/* DM's Chair Script
/  Written by: SwiftFury A.K.A. John Diem
/  Put this script in the On-Used Event for a chair or throne.
/  Place a waypoint with the tag "WP_Throne" a little ways infront
/  of the chair. That's it.  (If you point the WP away from the chair the
/  PC will spin around as they fall)
/  When a PC tries to sit in the DM's Chair they will get a suprise.
/  The Dm can sit in the chair with out any problems.
*/

void main()
{
    object oPC=GetLastUsedBy();
    object ochair=OBJECT_SELF;
    object oWP=GetObjectByTag("WP_Throne");
    effect eKnock=EffectKnockdown();
        if (!GetIsDM(oPC))
    {
        ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SOUND_BURST),OBJECT_SELF, 1.0);
        AssignCommand(oPC, JumpToObject(oWP));
        ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnock, oPC, 8.0f));
        ActionCastSpellAtObject(SPELL_CALL_LIGHTNING,oPC,METAMAGIC_ANY,TRUE,5,PROJECTILE_PATH_TYPE_DEFAULT,TRUE);
    }
    else
    {
    AssignCommand(GetLastUsedBy(),ActionSit(ochair));
    }
}