|
|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
| Quests::Q&A This is the quest support section |
 |
|
 |

10-23-2009, 06:23 PM
|
 |
Legendary Member
|
|
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
|
|
I'd do something like this. But of course tweak to your liking.
Actually, I think all you would need is:
Code:
if($signal == 5){
quest::say("Thanks arias, i'm following you.");
$npc->SetFollowID($entity_list->GetMobByNpcTypeID(189490)->GetID());
}
but here's something I wrote up for vindi pets. I need to remove the signal add hate trick, it's too powerful and sees through FD.
Code:
#Shin: Added pet support to Vindi
sub EVENT_SPAWN {
quest::settimer(1, 1); #Initial spawn of pets
}
sub EVENT_TIMER {
if ($timer eq "1") { #initial spawn.
$vindipets[0] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$vindipets[1] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$entity_list->GetMobID($vindipets[0])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
$entity_list->GetMobID($vindipets[1])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
quest::stoptimer(1);
quest::settimer(2, 120); #This is the respawn for pet delay
}
if ($timer eq "2") {
if (!defined @vindipets) { #this happens if someone #reloadpl's. I don't really have a good solution.
$vindipets[0] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$vindipets[1] = quest::spawn2(113120,0,0,$x,$y,$z,$h);
$entity_list->GetMobID($vindipets[0])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
$entity_list->GetMobID($vindipets[1])->SetFollowID($npc->GetID()); #make new spawned pet follow Vindi.
}
for ($i = 0; $i < scalar @vindipets; $i++) { #Pet check
if (defined $vindipets[$i]) { #I find this a silly check but scalar size is wierd.
if (!defined $entity_list->GetMobID($vindipets[$i])) {
$vindipets[$i] = quest::spawn2(113120,0,0,$x,$y,$z,$h); #respawn pet.
$entity_list->GetMobID($vindipets[$i])->SetFollowID($npc->GetID()); #set vindi owner.
}
}
}
}
}
sub EVENT_COMBAT {
if ($combat == 1) {
quest::signalwith(113120,$client->GetID(),0); #there's more than pets with this name, need a new npc type id. And this is working too well, I think FD is being seen thru with "pets".
}
}
sub EVENT_ATTACK {
quest::shout("Your kind will not defile the temple of Rallos Zek!");
}
# Quest by mystic414
sub EVENT_SIGNAL { #Pet Aggro'd, this is more uber than EQ live. Put in guardian
$mob->AddToHateList($signal, 1, 0) #This is too much though
}
|
 |
|
 |

10-23-2009, 07:10 PM
|
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
i'm looking to make a formation, because I have 5 NPC's that will be following 1, and follow bunches them all up behind him, and looks crappy. thats why i'm wanting to have them around the NPC and update thier position based on the main NPC moving. i'm just having trouble finding the main NPC's loc, and updating it to its "minions" so they can update thier position.
|

10-23-2009, 09:18 PM
|
|
Sarnak
|
|
Join Date: Mar 2009
Location: none
Posts: 30
|
|
Try calling GetX and GetY on the mob returned by GetMobByNPCTypeID instead of on the ID returned by GetID.
Code:
my $revoltldrID = 189490;
my $ldrMob = $entity_list->GetMobByNpcTypeID($revoltldrID);
my $ldrX = $ldrMob->GetX();
my $ldrY = $ldrMob->GetY();
|
 |
|
 |

10-23-2009, 09:41 PM
|
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
Code:
if($signal == 5){
quest::say("Thanks arias, i'm following you.");
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $x_loc = 0;
my $y_loc = 0;
my $z_loc = 0;
quest::say("checking for mob");
my $target_to_follow = $entity_list->GetMobByNpcTypeID(189490);
if($target_to_follow){
quest::say("found mob, get coords");
$x_loc = $target_to_follow->GetX();
$y_loc = $target_to_follow->GetY();
$z_loc = $target_to_follow->GetZ();
quest::say("mobs coords is $x_loc, $y_loc, $z_loc");
}
quest::say("setting run mode to 1");
quest::SetRunning(1);
quest::say("while state executing");
while($x != $x_loc && $y != $y_loc + 10) {
$npc->moveto($x_loc,$y_loc + 10,$z);
}
quest::SetRunning(0);
quest::signalwith(189490,12,0);
}
heres what I have now. it makes it all the way to the while statement, including giving correct coords for the npc (thanks KLS and wesell) but the mob doesn't move. obviously a problem with the while statement, but I don't know what. (i'm thinking its the moveto, but not sure.) can anyone provide some enlightenment for this learning mind? 
|
 |
|
 |

10-23-2009, 10:29 PM
|
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
MoveTo not moveto (yes they're case sensitive).
|
 |
|
 |

10-23-2009, 10:32 PM
|
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
ok i'm done for the night, i'm gonna post what I got, and how its working, maybe someone can tell what i'm doin wrong.
NPC A
Code:
if($signal == 12) {
if(defined($qglobals{$name."partywalk"})) {
quest::signalwith(189492,11,0);
}
}
used to loop NPC B's moveto.
NPC B part 1
Code:
if($signal == 5){
quest::say("Thanks arias, i'm following you.");
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
my $x_loc = 0;
my $y_loc = 0;
my $z_loc = 0;
my $h_loc = 0;
#quest::say("checking for mob");
my $target_to_follow = $entity_list->GetMobByNpcTypeID(189490);
if($target_to_follow){
# quest::say("found mob, get coords");
$x_loc = $target_to_follow->GetX();
$y_loc = $target_to_follow->GetY();
$z_loc = $target_to_follow->GetZ();
$h_loc = $target_to_follow->GetHeading();
# quest::say("mobs coords is $x_loc, $y_loc, $z_loc");
}
# quest::say("setting run mode to 1");
quest::SetRunning(1);
# quest::say("while state executing");
if($x != $x_loc && $y != $y_loc + 10) {
quest::moveto($x_loc,$y_loc + 10,$z,$h,1);
}
quest::say("sending signal");
quest::signalwith(189490,12,0);
}
gets signal 5 from NPC A, starts everything up. (not included here, as it works.)
NPC B part 2
Code:
if($signal == 11) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
my $x_loc = 0;
my $y_loc = 0;
my $z_loc = 0;
my $h_loc = 0;
# quest::say("checking for mob");
my $target_to_follow = $entity_list->GetMobByNpcTypeID(189490);
if($target_to_follow){
quest::say("found mob, get coords");
$x_loc = $target_to_follow->GetX();
$y_loc = $target_to_follow->GetY();
$z_loc = $target_to_follow->GetZ();
$h_loc = $target_to_follow->getHeading();
}
if($x != $x_loc && $y != $y_loc - 10) {
quest::moveto($x_loc,$y_loc - 10,$z_loc,$h_loc,1);
}
quest::say("sending signal");
quest::signalwith(189490,12,0);
}
this is to continue the loop, when recieving signal 11 from NPC A (code above).
all globals are defined, and everything starts up, NPC moves one time, to first coords it finds when inital script is started. then nothing. npc just stands there. I really hope someone can help me figure this out. thanks 
|
 |
|
 |

10-23-2009, 11:34 PM
|
|
Sarnak
|
|
Join Date: Mar 2009
Location: none
Posts: 30
|
|
Just glanced at it, but it may just be improper capitalization on the GetHeading method.
|

10-23-2009, 11:43 PM
|
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
I would agree.
|

10-24-2009, 09:38 AM
|
|
Hill Giant
|
|
Join Date: May 2005
Posts: 134
|
|
Quote:
Originally Posted by Wesell
Just glanced at it, but it may just be improper capitalization on the GetHeading method.
|
wow I feel dumb, that was it. its working great now. ty guys for the help, and the learning experience.
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 09:41 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |