View Full Version : Boss trigger event
Durge
01-27-2012, 11:51 PM
Hey guys, I'm totally baffled as to why this won't work, but maybe you guys can help? I dumbed this down a ton to try and get the boss to move, but he still wont move
##Test Boss Quest
##Created by Durge
sub EVENT_SPAWN
{
quest::setnexthpevent(75);
}
sub EVENT_COMBAT
{
$combat_state = 1;
quest::shout("How dare you attack me $name! You shall die for your heracy!");
}
sub EVENT_HP
{
if($hpevent == 75)
{
quest::shout("Stupid mortals! You think you can defeat me?");
quest::moveto(-324, 778, -10, 128, 1);
}
}
Tabasco
01-28-2012, 12:56 AM
This looks fine to me, except you might want to correct 'heresy.'
Upon further inspection, these commands try to give the mob a waypoint, which they seem to ignore in combat.
I even tried $npc->GMMove to same effect, but the source doesn't force an update.
Try updating the final command in perl_mob.cpp, XS_Mob_GMMove to:
THIS->GMMove(x, y, z, heading, true);
I can test this further tomorrow.
Durge
01-28-2012, 01:01 AM
Ok, thanks I'll give it a shot
trevius
01-28-2012, 01:59 PM
I think GMMove makes them warp/gate to whatever location you use. Unfortuantely, due to how combat works, you can't really make an NPC walk to another location during combat without using a few tricks.
You could set the special attacks to H so it won't aggro and then wipe the hate list both using quest objects. Then, it should be able to walk to another location, but you will also want to set it to save its guard point.
Before the move, you probably have to do something like this:
$npc->NPCSpecialAttacks("H", 0);
$npc->WipeHateList();
Then, the move:
$npc->MoveTo(-324, 778, -10, 128, 1);
And after it gets to the destination, you would turn aggro back on like this:
$npc->NPCSpecialAttacks("H", 0, 0 1);
But, the NPC would not be attacking the whole time it is moving. If you wanted it to attack while walking, you would need to simulate it using Damage() or something on a timer.
I don't know the details of exactly what you are wanting to do, but it is probably not going to be as simple as you may have expected.
Also, I don't know why you are setting $combat_state to 1 in EVENT_COMBAT. That is not how it works. You would do something more like this:
if ($combat_state)
{
quest::shout("How dare you attack me, $name! You shall die for your heresy!");
}
Tabasco
01-28-2012, 03:41 PM
I suppose you could depop and pop if the move needs to be instant.
trevius
01-28-2012, 04:27 PM
That depends on if they want the NPC to walk to a destination or if they are ok with them warping to a destination. If they don't need it to walk there, then they can just have it warp there with GMMove() like you said.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.