#include "prc_class_const"

effect eEffect;
object oTarget;

//Put this OnEnter
void main()
{
object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int iWarrior	= GetLevelByClass(CLASS_TYPE_FIGHTER, oPC)
				+ GetLevelByClass(CLASS_TYPE_CW_SAMURAI, oPC)
				+ GetLevelByClass(CLASS_TYPE_KNIGHT, oPC)
				+ GetLevelByClass(CLASS_TYPE_MARSHAL, oPC)
				+ GetLevelByClass(CLASS_TYPE_SAMURAI, oPC)
				+ GetLevelByClass(CLASS_TYPE_SOULKNIFE, oPC)
				+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
				+ GetLevelByClass(CLASS_TYPE_INCARNATE, oPC)
				+ GetLevelByClass(CLASS_TYPE_HEXBLADE, oPC)
				+ GetLevelByClass(CLASS_TYPE_DUSKBLADE, oPC)
				+ GetLevelByClass(CLASS_TYPE_PSYWAR, oPC)				
				+ GetLevelByClass(CLASS_TYPE_SWASHBUCKLER, oPC)
				+ GetLevelByClass(CLASS_TYPE_WARBLADE, oPC)
				+ GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC)
				+ GetLevelByClass(CLASS_TYPE_PALADIN, oPC)
				+ GetLevelByClass(CLASS_TYPE_RANGER, oPC)
				+ GetLevelByClass(CLASS_TYPE_CRUSADER, oPC)
				+ GetLevelByClass(CLASS_TYPE_SWORDSAGE, oPC);

if (iWarrior > 0)
   {
   oTarget = GetObjectByTag("c42FighterChecka");

   DestroyObject(oTarget, 0.0);

   //oTarget = GetObjectByTag("c42FighterCheckb");

   //DestroyObject(oTarget, 0.0);

   //oTarget = GetObjectByTag("c42FighterCheckc");

   //DestroyObject(oTarget, 0.0);

   //oTarget = GetObjectByTag("c42FighterCheckd");

   //DestroyObject(oTarget, 0.0);
   return;
   }
   int iDamage;
   iDamage = d4(1);
   eEffect = EffectDamage(iDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);

   ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

   FloatingTextStringOnCreature("You are pushed back down the stairs by an unseen force.", oPC);
   oTarget = GetWaypointByTag("c42Fighter");
    location lTarget;
    lTarget = GetLocation(oTarget);

    //only do the jump if the location is valid.
    //though not flawless, we just check if it is in a valid area.
    //the script will stop if the location isn't valid - meaning that
    //nothing put after the teleport will fire either.
    //the current location won't be stored, either

    if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;

    AssignCommand(oPC, ClearAllActions());

    AssignCommand(oPC, ActionJumpToLocation(lTarget));
}
