UW2_PRC8/_module/nss/jumpnonmonkhome.nss
Jaysyn904 5197ad9a4d Initial upload
Initial upload
2023-09-25 20:24:01 -04:00

43 lines
1.0 KiB
Plaintext

int nInt;
location lTarget;
object oTarget;
//Created by Guile 3/17/07
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
//If your not a monk, go home!
if ((GetLevelByClass(CLASS_TYPE_MONK, oPC)>0))
{
oTarget = GetWaypointByTag("home");
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget = oPC;
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
DelayCommand(3.0, FloatingTextStringOnCreature("Only Monks may enter the Halls of Enlightenment.", oPC));
}
}