Author Topic: Need a starting conditional  (Read 396 times)

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
Need a starting conditional
« on: October 25, 2011, 04:06:39 am »


               Hiya sweeties,

I need a starting conditional that checks to see if the PC is dazed, but the script generator doesn't give an option to check on the present condition of a PC.

Any help is greatly appreciated.

'<img'>
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Need a starting conditional
« Reply #1 on: October 25, 2011, 04:19:58 am »


               

int StartingConditional()
{

object oPC = GetPCSpeaker();

if  (! (GetHasSpellEffect(SPELL_DAZE, oPC)) ) return FALSE;

   return TRUE;
}


FP!
               
               

               
            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
Need a starting conditional
« Reply #2 on: October 25, 2011, 06:43:31 am »


               Thank you so much, sweetie! *huggles*':kissing:'
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Need a starting conditional
« Reply #3 on: October 25, 2011, 03:55:17 pm »


               Doesn't GetHasSpellEffect only return true if the target actually is under the effects of the specified spell?

int StartingConditional()
{
    object oPC = GetPCSpeaker();
    effect eEff = GetFirstEffect(oPC);

    while (GetIsEffectValid(eEff))
    {
        if (GetEffectType(eEff) == EFFECT_TYPE_DAZED) {return TRUE;}
        eEff = GetNextEffect(oPC);
    }

    return FALSE;
}


This should work, no matter what the source of the daze is.
               
               

               


                     Modifié par Xardex, 25 octobre 2011 - 02:56 .
                     
                  


            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
Need a starting conditional
« Reply #4 on: October 25, 2011, 09:42:32 pm »


               Thank you sweetie. *huggles*