Hey does anyone have an example of a mob script...
that casts spells ect...
Im looking to do some custom scripted mobs with spells in em. Ive done custom scripted mobs before just nothing with spells. I know u use the $NPC->CastSpell or whatever it is but it wants a target Id, should I just use whatever target has aggro? And what about AOE spells, do you still need a target id? Wiki doesnt have much info on it |
So far I have this, i was reading around and found out about using $client->GetID() inside the cast spell. Her shouts but doesnt cast
Code:
sub EVENT_SPAWN { |
I'm pretty sure the $client is not passed with the HP event. Maybe you could use the mob's target?
|
Try this:
Code:
$targ = $npc->GetHateTop(); |
Here is one way to do it:
Code:
sub EVENT_SPAWN { Code:
#Usage: plugin::CastOnTarget(spellid); |
Funny thing is, I thought about doing the same thing. I'll commit this later.
And by the way Trevius, whenever you have time I'd like to IRC you about the armorsets. Got some things made you might appreciate. |
Thanks Ill try it out
One question, what about PB AOEs? Do i have to make em player targeted for em to work? |
Hey am I missing something? Smaug is only casting the one type of spell 21439 at both events.
Instead of 21440. If i change it to 21440 on top and 21439 he will only cast 21440. Code:
#Smaug |
You might want an else in there since if the hpevent is 95 then both ifs are true.
I'd check them in reverse order for what I assume you want. I'm not a perl coder, so take this as pseudo code. if($hpevent <= 95) ... else if($hpevent <= 98) ... |
Or == since the event was triggered by 98 and then 95
|
Yeah, always use == in hp events, otherwise it may make more than 1 match that is not intended (which is what is happening in your example since the first one is always true once the NPC drops below 98%).
And to cast a PBAE, I think you can just use $mobid variable export to cast the spell with the NPC as the target. Code:
$npc->CastSpell(21439, $mobid); |
Quote:
|
All times are GMT -4. The time now is 05:45 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.