Astal
05-23-2011, 05:33 PM
I have it set up for the mobs to heal my boss every 60 seconds for 20k hp. The script is firing but the spell isnt casting. I have a feeling it has to do with $mob->SetTarget(); the ID is correct, but is that the correct code i would be looking for to pick an NPC to cast a spell on?
#Monolith of Lohesh
sub EVENT_SPAWN {
quest::settimer("HealLohesh", 60);
}
sub EVENT_TIMER {
if ( ($timer eq "HealLohesh" ) && (defined($entity_list->GetNPCByNPCTypeID(999424)) ) ) {
quest::say("Take our life oh dark one!!");
$mob->SetTarget(999424);
plugin::CastOnTarget(21479); #heal
quest::settimer("HealLohesh", 60);
}
}
I also tried it like this, same result
#Monolith of Lohesh
sub EVENT_SPAWN {
quest::settimer("HealLohesh", 60);
}
sub EVENT_TIMER {
if ( ($timer eq "HealLohesh" ) && (defined($entity_list->GetNPCByNPCTypeID(999424)) ) ) {
quest::say("Take our life oh dark one!!");
#$mob->SetTarget(999424);
$mob->CastSpell(21479, 999424, 10, -1, -1);
#plugin::CastOnTarget(21479); #heal
quest::settimer("HealLohesh", 60);
}
}
sub EVENT_SAY {
if($text=~/Hail/i) {
$client->Message(315, "Script working.");
}
}
#Monolith of Lohesh
sub EVENT_SPAWN {
quest::settimer("HealLohesh", 60);
}
sub EVENT_TIMER {
if ( ($timer eq "HealLohesh" ) && (defined($entity_list->GetNPCByNPCTypeID(999424)) ) ) {
quest::say("Take our life oh dark one!!");
$mob->SetTarget(999424);
plugin::CastOnTarget(21479); #heal
quest::settimer("HealLohesh", 60);
}
}
I also tried it like this, same result
#Monolith of Lohesh
sub EVENT_SPAWN {
quest::settimer("HealLohesh", 60);
}
sub EVENT_TIMER {
if ( ($timer eq "HealLohesh" ) && (defined($entity_list->GetNPCByNPCTypeID(999424)) ) ) {
quest::say("Take our life oh dark one!!");
#$mob->SetTarget(999424);
$mob->CastSpell(21479, 999424, 10, -1, -1);
#plugin::CastOnTarget(21479); #heal
quest::settimer("HealLohesh", 60);
}
}
sub EVENT_SAY {
if($text=~/Hail/i) {
$client->Message(315, "Script working.");
}
}