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

08-01-2008, 03:47 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Adding Hate to Spawned Adds is not Working
I can't seem to figure out how to get this quest working properly. It seems pretty simple, since basically all it is supposed to do is spawn some adds and then add hate to the new spawns. The quest works fine accept for the section I highlighted in RED. The adds spawn, but they never agro. And, when the script runs, it breaks at the point where they are supposed to agro and doesn't even continue to cycle through and repeat the timers as it should. I don't get the "Testing Rat Agro Section!" message that I added to check if it was making that far.
This same section works just fine in another encounter I have, but on that encounter, the adds that come aren't spawned by the quest, they are just normal zone spawns. I suspect that "$entity_list->GetMobByNpcTypeID();" is what causes the problem. I think that since these are spawned adds and not static spawns in the zone, it can't find them in the entity list.
Does anyone know a way to get it working for spawned adds?
Code:
#Nightwhisker Fight
sub EVENT_ATTACK {
quest::stoptimer("rat_adds");
quest::shout("Rats of Dreadsire, I call upon you! Come to my aid!");
quest::settimer("rat_adds",10);
}
sub EVENT_TIMER {
if ($timer eq "rat_adds") {
quest::stoptimer("rat_adds");
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 17.7, 3209.0, 0.8,12);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 33.4, 3208.6, 1.8,6);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 29.9, 3223.7, 5.5,7);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 41.6, 3238.8, 10.3,253);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 24.9, 3245.3, 12.4,5);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 55.4, 3450.6, 24.1,61);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 67.4, 3440.7, 24.1,64);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 80.4, 3456.6, 24.1,61);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 101.3, 3439.0, 24.1,64);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 107.9, 3454.8, 24.1,66);
quest::say("Come! Come! Rid these halls of the humaniods!");
quest::settimer("rat_agro",2); }
if ($timer eq "rat_agro") {
my $tiny_rats = $entity_list->GetMobByNpcTypeID(2700659);
my $albino_rats = $entity_list->GetMobByNpcTypeID(2700660);
my $black_rats = $entity_list->GetMobByNpcTypeID(2700661);
if ($tiny_rats) {
my $hate_tiny_rats = $tiny_rats->CastToNPC();
$hate_tiny_rats->AddToHateList($client, 1); }
if ($albino_rats) {
my $hate_albino_rats = $albino_rats->CastToNPC();
$hate_albino_rats->AddToHateList($client, 1); }
if ($black_rats) {
my $hate_black_rats = $black_rats->CastToNPC();
$hate_black_rats->AddToHateList($client, 1); }
quest::stoptimer("rat_agro");
quest::say("Testing Rat Agro Section!");
quest::settimer("rat_adds",10); }
}
sub EVENT_COMBAT {
if ($combat_state == 0) {
quest::depopall(2700659);
quest::depopall(2700660);
quest::depopall(2700661);
quest::stoptimer("rat_adds");
quest::stoptimer("rat_agro");
}
}
sub EVENT_DEATH {
$timestamp = localtime(time);
quest::depopall(2700659);
quest::depopall(2700660);
quest::depopall(2700661);
quest::stoptimer("rat_adds");
quest::stoptimer("rat_agro");
quest::shout2("SQUEEEEEEEK!");
quest::write("bossdeaths.txt","[$timestamp]:Nightwhisker was killed by $name the $class.");
}
My Perl knowledge sucks heh.
|
 |
|
 |
 |
|
 |

08-01-2008, 06:52 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Well, I tried quite a bit more experimenting, but still haven't found a good solution. So far, I tried moving the section highlighted in red in the post above to the EVENT_ATTACK section and then it was working. But, even there I have another issue with it. I am spawning 10 NPCs at a time, so I would like for it to send hate to all 10 of them, but it is only sending it to the nearest NPC for each of the 3 types.
I still can't figure out why it won't work in the timer section like I posted it. I even made static spawned versions of the NPCs and commented out the spawning part and it still does nothing and breaks the script at that point.
It seems like the section in question is actually just doing this below, but I dunno why I can't just put it in the way it is here:
$EntityList->GetMobByNpcTypeID(2700659)->CastToNPC()->AddToHateList($client, 1);
$EntityList->GetMobByNpcTypeID(2700660)->CastToNPC()->AddToHateList($client, 1);
$EntityList->GetMobByNpcTypeID(2700661)->CastToNPC()->AddToHateList($client, 1);
So, I need a way for it to send hate to ALL npcs with that same ID. Otherwise, I will have to make 30 (10 spawns with random chance to spawn 1 of 3 different types) different NPC IDs and make them all individuals, which I would prefer to avoid. And the only other thing I need is to figure out why it won't work in the section with the timer as I posted originally.
If someone knows a better way to send hate and do what I need, I am open to suggestions 
|
 |
|
 |

08-01-2008, 07:15 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
Edit: Missread the script
|

08-01-2008, 07:16 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
Bah, won't stop adding posts..
Sorry.
|

08-01-2008, 07:22 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
Maybe using a signalwith to the NPCs with the name or id of the person attacking?
|
 |
|
 |

08-01-2008, 08:32 AM
|
Dragon
|
|
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
|
|
If it's only adding hate to one NPC of each type, is it possible that that's the problem and that it's actually coded that way? It can only signal one NPC of each type when it fires? I know Cazic only sends hate to his three golems, which each have unique NPC IDs, so it wouldn't be an issue that shows up there. And all of the linked mobs in ToV that I can think of have seperate names and NPC IDs (like Aaryonar and his guards, for example).
The only one I can think of that's comparable is Tunare. She has a whole slew of NPCs she adds hate to, but does it affect all of them, or just one? Can't say I've ever tested it fully. And I'd imagine that since mobs gain proximity aggro and assist one another, that it's never really mattered in that instance.
I would suggest that if it's working for one NPC of each type, to make sure you have them set to the same primary faction and that they're set to assist. It might be a little sloppier, but it will still get the same desired affect, I would reason. And maybe check Tunare's functionality to see if she's getting it to work where yours won't, for some reason.
Best of luck, wish I had more solid answers.
|
 |
|
 |
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 07:21 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |