//:://///////////////////////////////////////////// //:: Name x2_def_percept //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Default On Perception script */ //::////////////////////////////////////////////// //:: Created By: Keith Warner //:: Created On: June 11/03 //::////////////////////////////////////////////// void SetFacingWaypoint(object oPC, string sWaypoint) { object oTarget = GetWaypointByTag(sWaypoint); vector vFace=GetPosition(oTarget); AssignCommand(oPC, SetFacingPoint(vFace)); } void main() { object oPC = GetLastPerceived(); object oMod = GetModule(); object oCaster; object oTarget; //if (!GetLastPerceptionSeen()) return; int iMode = GetLocalInt(oMod, "duel_on"); if ((iMode!=1)&&(GetIsPC(oPC))&&(GetIsDead(oPC))) { location iLocation = GetLocation(oPC); location iLocation2 = GetLocation(GetWaypointByTag("starfall_wp")); oCaster = OBJECT_SELF; oTarget = oPC; if (GetDistanceToObject(oPC)<2.0) { AssignCommand(oCaster, ActionMoveToLocation(iLocation)); DelayCommand(5.0, AssignCommand(oCaster, ActionMoveToLocation(iLocation2))); } AssignCommand(oCaster, ActionCastSpellAtObject (SPELL_RESURRECTION, oTarget, METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, FALSE)); DelayCommand(10.0, SetFacingWaypoint(oCaster, "sf_facing")); } else { ExecuteScript("nw_c2_default2", OBJECT_SELF); } }