

effect eEffect;

void main()
{
object oPC;
oPC=GetFirstPC();
while (oPC != OBJECT_INVALID)
            {

 int nInt;
 int nRandom;
nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYPoison");
if (nInt == 1)
  {

  nInt = GetLocalInt(oPC, "poisonRound");
  //FloatingTextStringOnCreature(IntToString(nInt), oPC);

  nInt += 1;

  SetLocalInt(oPC, "poisonRound", nInt);

  nInt=GetLocalInt(oPC, "poisonRound");

  if (nInt == 9)
    {
    nRandom = d4();

    if (nRandom ==  1)
        {
         // statements ...
         // without a break testing would continue
         // in this example if we didn't use a break, the default
         // condition would also evaluate as true if x == 0
             FloatingTextStringOnCreature("You can barely breath in the poison gas.", oPC, FALSE);
            object oTarget;
            oTarget = oPC;

            effect eEffect;
            eEffect = EffectKnockdown();

            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 3.0f);
        }
    if (nRandom ==  2)
        {
                FloatingTextStringOnCreature("You can barely breath in the poison gas.", oPC, FALSE);
            object oTarget;
            oTarget = oPC;

            effect eEffect;
            eEffect = EffectKnockdown();

            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 6.0f);
         // statements ...
        }
    if (nRandom ==  3)
        {
         // statements ...
             FloatingTextStringOnCreature("You take damage from the poison gas.", oPC, FALSE);
            int nDamage;
            nDamage = d3(1) -1 ;

            eEffect = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);

            ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
            nInt = 0;
            SetLocalInt(oPC, "poisonRound", nInt);
         }
    if (nRandom ==  4)
        {
         FloatingTextStringOnCreature("You can barely breath in the poison gas.", oPC, FALSE);
         }





    }
  if (nInt == 19)
    {

        nRandom = d4();

    if (nRandom ==  1)
        {
         // statements ...
         // without a break testing would continue
         // in this example if we didn't use a break, the default
         // condition would also evaluate as true if x == 0
             FloatingTextStringOnCreature("You can barely breath in the poison gas.", oPC, FALSE);
            object oTarget;
            oTarget = oPC;

            effect eEffect;
            eEffect = EffectKnockdown();

            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 3.0f);
        }
    if (nRandom ==  2)
        {
                FloatingTextStringOnCreature("You take damage from the poison gas.", oPC, FALSE);
    int nDamage;
    nDamage = d3(1) -1 ;

    eEffect = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);

    ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
    nInt = 0;
    SetLocalInt(oPC, "poisonRound", nInt);
        }
    if (nRandom ==  3)
        {
         // statements ...
             FloatingTextStringOnCreature("You take damage from the poison gas.", oPC, FALSE);
            int nDamage;
            nDamage = d3(1) -1 ;

            eEffect = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);

            ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
            nInt = 0;
            SetLocalInt(oPC, "poisonRound", nInt);
         }
    if (nRandom ==  4)
        {
         FloatingTextStringOnCreature("You can barely breath in the poison gas.", oPC, FALSE);
         }


    FloatingTextStringOnCreature("You take damage from the poison gas.", oPC, FALSE);
    int nDamage;
    nDamage = d3(1) -1 ;

    eEffect = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY);

    ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
    nInt = 0;
    SetLocalInt(oPC, "poisonRound", nInt);
    }

  }


                oPC=GetNextPC();

            }



}

