Log in

View Full Version : Mobs arent casting spells....


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.");
}

}

Shamanistik08
05-23-2011, 05:36 PM
Totally new to perl, but there is no quotes normally here?

plugin::CastOnTarget('21479');

Just a guess..

Astal
05-23-2011, 05:57 PM
Totally new to perl, but there is no quotes normally here?

plugin::CastOnTarget('21479');

Just a guess..

nope, it works fine on all my other scripts

Shamanistik08
05-23-2011, 07:40 PM
you should also add a stop timer, or remove the 2nd set timer. but it has nothing to do with the cast spell.

Astal
05-23-2011, 07:53 PM
you should also add a stop timer, or remove the 2nd set timer. but it has nothing to do with the cast spell.

i tried doing that for a different one but the timer didnt trigget again unless I had a start timer in each timer.


Ill have to go back and test all my other timers haha