#include "nw_i0_plot"
effect eEffect;
object oTarget;
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 1.6

For download info, please visit:
http://www.lilacsoul.revility.com    */

//Put this OnEnter
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int nInt;
nInt=GetPLocalInt(oPC, "intNearWind");

if (!(nInt == 1))
   return;

nInt=GetPLocalInt(oPC, "intWindStarted");

if (!(nInt == 1))
   return;

if (!(ReflexSave(oPC, 14, SAVING_THROW_TYPE_TRAP  )))
   {
   nInt = d12();
   if (nInt==1)
      {
      FloatingTextStringOnCreature("The wind tosses you about the room into one of the spikes jutting out from the wall.", oPC);
      nInt = d6(1);
      eEffect = EffectDamage(nInt, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_NORMAL);

      ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

        oTarget = oPC;

        eEffect = EffectKnockdown();

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 6.0f);
        return;
      }
   else
      {
      FloatingTextStringOnCreature("The wind toss you about the room banging you into the hard stone walls and floor.", oPC);
      nInt = (d3(1))-1;
      eEffect = EffectDamage(nInt, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);

      ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

    oTarget = oPC;

    eEffect = EffectKnockdown();

    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 6.0f);
        return  ;
      }

   }
   FloatingTextStringOnCreature("You grab the floor and momentarily resist the force of the wind.", oPC);

}

