PDA

View Full Version : "Tieing" mobs together... little help please.


Joetuul
02-20-2009, 10:44 AM
What I am looking to do is this...

When a player aggro's MobA I want MobA to signal MobB to assist and vice versa, so this way the Player gets both mobs every time without the chance of splitting.. But when I engage it always crashes the zone. Kind of irritating when I have re-written this script like 15 times and it does the exact same thing... crash the zone. argh. Here is the code I assume would work.

Mob A ... same code for Mob B since they should do the exact same thing.

sub EVENT_SPAWN
{
quest::spawn2(1270,0,0,148.6,-308.5,-2.8,0); # this is to spawn a mob that "pushes" the player back, not letting them past to the next encounter with out finishing this one first #

my $x;
my $y;
my $z;
my $h;

$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();
$c = Mob->GetTopHate(); I have also tried $c = Mob->GetRandomHate(); But this also crashes the zone.
}

sub EVENT_SIGNAL
{
if ($signal == 1)
{
quest::attack($c); have also tried quest::attack($name); but this only makes Mob B say "I can not attack"
}
}

sub EVENT_COMBAT
{
if($combat_state == 1)
{
quest::signalwith(999810, 1, 0); #signals mob B to assist
}
}

sub EVENT_DEATH
{
quest::signalwith(1270, 1, 0); # Despawns the "pusher mob"
}


Was hoping the same code would work for Mob B as well. but like I said... just crashes the zone. Right now I have it set up differently (Mob A spawning mob B at 98% since Mob A will be in "summon" mode and can't be split. but it does not do exactly what I want, but works for me temporarily until I can figure this out.

### After looking at this while posting I can see it sends the script into a loop of sorts, probably crashing the zone. but I still can't figure this out. TIA

ChaosSlayer
02-20-2009, 12:02 PM
the "assist" script should be very simular to assist script of Cazic Thule in Fear.
Thought I haven't looked if anyone actualy done it.

ANother simular script was with Lord Vyen in NTOV who would summon to him all other dragons in the zone

ChaosSlayer
02-20-2009, 12:05 PM
# Call Dread, Fright & Terror to aid Cazic Thule if they're still alive

# code by mystic414




sub EVENT_AGGRO {

quest::shout("Denizens of Fear, your master commands you to come forth to his aid!!");

quest::signalwith(72000,1,0);

quest::signalwith(72004,1,0);

quest::signalwith(72002,1,0);

my $dread_mob = $entity_list->GetMobByNpcTypeID(72000);

my $fright_mob = $entity_list->GetMobByNpcTypeID(72004);

my $terror_mob = $entity_list->GetMobByNpcTypeID(72002);

if ($dread_mob) {

my $dread_mobnpc = $dread_mob->CastToNPC();

$dread_mobnpc->AddToHateList($client, 1);

}

if ($fright_mob) {

my $fright_mobnpc = $fright_mob->CastToNPC();

$fright_mobnpc->AddToHateList($client, 1);

}

if ($terror_mob) {

my $terror_mobnpc = $terror_mob->CastToNPC();

$terror_mobnpc->AddToHateList($client, 1);

}

}

Joetuul
02-20-2009, 11:28 PM
DOH! I didnt even think of CT. I am ashamed of myself... I had to go to Fear way too many times in my days on Live. thanks for pointing that one out. I will check into it NOW!.

thanks again CS!

Joetuul
02-21-2009, 12:18 AM
That script worked out perfectly!!! thanks

ChaosSlayer
02-21-2009, 02:50 AM
no problem 8-)