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

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.
|
 |
|
 |
 |
|
 |

08-01-2008, 08:20 PM
|
Sarnak
|
|
Join Date: Aug 2006
Posts: 60
|
|
You were calling for the npc to attack a client, but a client is not returned in a timer (does not check for client interaction!). So, you would have needed to add a $client = $npc->GetHateTop(); or something.
That still doesn't account for the other issue. Try this:
Code:
#Nightwhisker Fight
my $adds = undef;
sub EVENT_SPAWN { #Not really needed. Was for testing.
quest::stoptimer("rat_adds");
my $adds = 0;
}
sub EVENT_COMBAT {
if ($combat_state == 0) {
quest::depopall(2700659);
quest::depopall(2700660);
quest::depopall(2700661);
quest::stoptimer("rat_adds");
quest::stoptimer("rat_agro");
}
#Replaced event attack with:
if ($combat_state == 1) {
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");
#the big chunk of change
for($adds = 0; $adds < 10; $adds++) {
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, $x, $y, $z, 0);
sethate();
}
quest::say("Come! Come! Rid these halls of the humaniods!");
$adds = 0;
quest::settimer("rat_adds",10); }
}
sub EVENT_DEATH {
$timestamp = localtime(time);
quest::depopall(2700659);
quest::depopall(2700660);
quest::depopall(2700661);
quest::stoptimer("rat_adds");
quest::shout2("SQUEEEEEEEK!");
quest::write("bossdeaths.txt","[$timestamp]:Nightwhisker was killed by $name the $class.");
}
#added routine to process ALL npcs.
sub sethate {
my $client = $npc->GetHateTop();
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); }
}
Technically, it could still have a problem or two so you could consider using an array and processing a loop for each npcspawn. While it is *technically* possible to run into a problem, you won't run into the potential problem with this script. Let me know if it works for you!
|
 |
|
 |
 |
|
 |

08-02-2008, 05:09 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I wound up just going a simpler route. I couldn't get any other way to do it exactly the way I wanted it to. Basically I was wanting rats to come pouring into the room from 2 halls near the named. Which I think would look a bit cooler than just having them spawn right in the room.
No matter what I did, I couldn't get more than 3 of them to take the hate and come running. And even when they did, they were running through the walls instead of pathing like they are supposed to. So, the effect was lost.
Finally, I just decided to spawn them and then have each spawn use a quest to quest::moveto(); and head to the named. Once they are there, they will agro on the players instead of pathing back like they normally would using the command. Though, I wish quest::pathto() was actually working, cause then I could have them do exactly what I have been wanting. With the moveto, I wound up making it similar, but they pop closer by so they have a straight shot to the named and don't go through walls.
Code:
#Nightwhisker Fight
sub EVENT_SPAWN {
quest::stoptimer("rat_adds");
}
sub EVENT_TIMER {
if ($timer eq "rat_adds") {
quest::stoptimer("rat_adds");
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 16.2, 3287.8, 18.1,62);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 15.7, 3301.6, 18.1,64);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 40.4, 3287.9, 18.1,62);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 38.4, 3301.8, 18.1,63);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 51.0, 3295.6, 18.1,64);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 166.1, 3428.4, 24.1,128);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 149.7, 3428.4, 24.1,124);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 151.5, 3398.2, 24.1,125);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 166.0, 3395.6, 24.1,128);
quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 159.3, 3371.6, 24.1,129);
quest::say("Come! Come! Rid these halls of the humaniods!");
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"); }
if ($combat_state == 1) {
quest::stoptimer("rat_adds");
quest::shout("Rats of Dreadsire, I call upon you! Come to my aid!");
quest::settimer("rat_adds",10); }
}
sub EVENT_DEATH {
$timestamp = localtime(time);
quest::depopall(2700659);
quest::depopall(2700660);
quest::depopall(2700661);
quest::stoptimer("rat_adds");
quest::shout2("SQUEEEEEEEK!");
quest::write("bossdeaths.txt","[$timestamp]:Nightwhisker was killed by $name the $class.");
}
Code:
#Nightwhisker Rat Adds
sub EVENT_SPAWN {
quest::moveto(158.7,3294.2,19.2)
}
|
 |
|
 |

08-09-2008, 07:49 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
My opinion on this is worth less than nothing, but for the little it's worth:
Quote:
if ($timer eq "rat_agro")
|
Interestingly, when I tried "eq" in one of my $timer functions, it broke. But when I use "==" it works fine. Not saying this was the problem in your script; just that my script does not work when using "eq."
|

08-09-2008, 08:47 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
== is for numerical values and eq is for everything else.
|
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 04:22 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |