Hello all. I'm having some errors with a quest file i have. It involves casting and spawning monsters from inside HP Events. Here's the file.
Code:
#Kaldra
#zone - Kod`Taz
#quest - Final Event
sub EVENT_SPAWN
{
quest::shout("WHO DARES CHALLENGE ME? I AM THE FINAL ARBITER OF MOLIMO, YOUR QUEST ENDS HERE, MORTALS!");
quest::setnexthpevent(70);
}
sub EVENT_ATTACK
{
quest::spawn(291096,0,0,($x-10),$y,$z);
quest::spawn(291096,0,0,($x+10),$y,$z);
quest::spawn(291096,0,0,($x-20),$y,$z);
quest::spawn(291096,0,0,($x+20),$y,$z);
quest::spawn(291096,0,0,$x,($y+10),$z);
}
sub EVENT_HP
{
if($hpevent == 70)
{
quest::selfcast(3150);
quest::setnexthpevent(30);
}
if($hpevent == 30)
{
quest::spawn(281097,0,0,($x-20),$y,$z);
quest::spawn(281097,0,0,($x+20),$y,$z);
}
}
sub EVENT_DEATH
{
quesT::shout("I underestimated you, Mortals. Very well, though you have bested me, Molimo will not relinquish his throne.");
}
When it hits the part of quest::selfcast and quest::spawn (inside the if statements about $hpevent==x)zone.exe gives me CastToClient errors. Is this an error in my source code of zone.exe or an error in my quest file? Heh...or both?
I do have an Idea though... since both spawn and selfcast work outside of the hp events, is there a Goto like function? To go to a certain label in the quest file, and then return to where it was called after it is done? Using that i could just have it jump to another section of the code upon the if($hpevent==x) statements returning true.
If you have any ideas of what could be wrong, please post.