This is what I am trying to do, but cant seem to get it right is to get the mob to spawn with a lower percentage of health, in this case it would be 85% and every 15% there on after. the text in red is what I want to get to work and then proceed to copy that for each health percentage. This way I can change this mob's HP and not have to worry about changing the script each time just to adjust the HP I want the mob to be at, at each of these globals.
Code:
sub EVENT_SPAWN
{
if(defined($qglobals{yar})){ #spawn at lower % of health
if ($qglobals{yar} == 1)
{
quest::shout ("RAWR 1"); #was used to test if the script ws working
}
elsif ($qglobals{yar} == 2)
{
quest::shout ("RAWR 2");
$mob->SetHP($mob->GetHP()*85);
}
elsif ($qglobals{yar} == 3)
{
$npc->SetHP(7000);
}
elsif ($qglobals{yar} == 4)
{
$npc->SetHP(5500);
}
elsif ($qglobals{yar} == 5)
{
$npc->SetHP(4000);
}
elsif ($qglobals{yar} == 6)
{
$npc->SetHP(2500);
}
elsif ($qglobals{yar} == 7)
{
$npc->SetHP(1000);
}
}
}
I hate searching the forums for hours on end for posts similair to what I want so I can use it in my own scripts. This one has been bugging me the last few days. If I can get this one snipet to work, I think it would make for an awesome mob encounter (im going to use it for sure). I will even post it in the quest custom section of the forums for all who would like to use it or some form of it or alter it to their own needs.
I am going to bed since its 4am and I need to get up in a few hours to deal with RL stuff.
TIA!!!!!