apparently I don't know the secret to posting code without it jumbling up.
int step1 = GetLocalInt (OBJECT_SELF, "step1");
int step2 = GetLocalInt (OBJECT_SELF, "step2");int step3 = GetLocalInt (OBJECT_SELF, "step3");
int step4 = GetLocalInt (OBJECT_SELF, "step4");
int nMaxHP = GetMaxHitPoints(); // OBJECT_SELF (the caller) is default
int nCurHP = GetCurrentHitPoints(); // OBJECT_SELF (the caller) is default
//Step1
if (step1 == 1){return;}//Another option besides return to get to step2?
if (nCurHP < (nMaxHP / 2))
{
// stop whatever the creature is doing
ClearAllActions();
ActionSpeakString("I'm at 50%!");
SetLocalInt(OBJECT_SELF,"step1",1);//so step1 only happens once.
}
//Step2
if (step2 == 1){return;}
if (nCurHP < (nMaxHP / 4))
{
// stop whatever the creature is doing
ClearAllActions();
ActionSpeakString("I'm at 20%!");
SetLocalInt(OBJECT_SELF,"step2",1);//so step2 only happens once.
}
Modifié par Buddywarrior, 25 juillet 2012 - 01:50 .





Retour en haut






