I am almost completely stuck. I cannot get this bugger to do anything other than stand there like a goon. I am clueless as to where this is failing as it produces no output.
Occasionally it will get an error involving "$i->AddToHateList($attackerID,100)" but I found a post leading me to believe that AddToHateList used entityID instead.
Code:
$calledIt = 0;
$markPlayer = 0;
sub EVENT_SPAWN
{
}
sub EVENT_DEATH
{
quest::signalwith(999147,999148,0);
quest::emote("yelps in pain.");
undef $calledIt;
undef $markPlayer;
}
sub EVENT_ATTACK
{
# my @NPCLIST = $entity_list->GetNPCList();
# my @victimList = $npc->GetHateList();
# my $victimCount = scalar (@victimList);
# quest::shout("DEBUG: $victimCount");
if($calledIt == 0)
{
$calledIt = 1;
charge(0, $client);
}
}
sub EVENT_AGGRO
{
if($calledIt == 0)
{
$calledIt = 1;
charge(0, $client);
}
}
sub EVENT_SIGNAL
{
if($calledIt == 0)
{
$calledIt = 1;
$markPlayer = $signal;
charge($markPlayer, 0);
}
if($signal eq "tmHT")
{
castHT();
quest::stoptimer("tmHT");
quest::settimer("tmHT", 15);
}
}
sub charge
{
my $var1 = $_[0]; ## character id storage
my $var2 = $_[1]; ## client id storage
if($var1 == 0)
{
$attacker = $var2->GetName();
$attackerID = $var2->CharacterID();
}
else
{
$var2 = $entity_list->GetClientByCharID($var1);
$attacker = $var2->GetName();
$attackerID = $var1;
}
# warn players
quest::shout("Blackburrrroooooow!");
quest::attack($attacker);
# call up lists of gnolls
my @NPCLIST = $entity_list->GetNPCList();
#my @fippy = $entity_list->GetMobByNpcTypeID(999150);
#my @tranixx = $entity_list->GetMobByNpcTypeID(999149);
my $fippy = 999150;
my $tranixx = 999149;
my $tempScalar = 0;
foreach $i (@NPCLIST){
if($i->GetNPCTypeID() == ($fippy || $tranixx)) {
$i->AddToHateList($attackerID, 1000);
}
}
# if gnoll(s) exist, set them on player
# $tempScalar = scalar (@fippy);
# quest::say("DEBUG: Fippy $tempScalar");
# if($tempScalar > 0)
# {
# foreach $i(@fippy)
# {
# $i->AddToHateList($attackerID,100);
# }
# }
#
# $tempScalar = scalar (@tranixx);
# quest::say("DEBUG: Tranixx $tempScalar");
# if($tempScalar > 0)
# {
# foreach $i(@tranixx)
# {
# $i->AddToHateList($attackerID,100);
# }
# }
quest::settimer("tmHT", 15);
}
sub castHT
{
my $victim = $mob->GetHateRandom();
quest::say("$victim");
}
The castHT also completely fails for no given reason that I can figure out. Any insight/pointers would be greatly useful!
-Hate