AOC_PRC8/_module/nss/sf_percept.nss
Jaysyn904 5e558169a0 Initial Commit
Initial Commit
2025-04-03 11:24:16 -04:00

52 lines
1.4 KiB
Plaintext

//::///////////////////////////////////////////////
//:: 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);
}
}