UW2_PRC8/_module/nss/ac_scalesofsente.nss

59 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2023-09-25 20:24:01 -04:00
//This is the default header for most items converted to the new
//tagbased system.
//Remember to create 2 scripts, one using the template, and name this
//script ac_"tagnameofitemgoeshere" (without the "")
#include "x2_inc_switches"
void main()
{
// Check if we have the correct event firing the script
if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
//Define Variables
object oItem=GetItemActivated();
object oActivator=GetItemActivator();
object oPlayer = GetItemActivator();
object target = GetItemActivatedTarget();
string tag = GetTag(oItem);
//You main script function goes under this line.
{
object oPC;
if (!GetIsDM(GetItemActivator())
){
SendMessageToPC(GetItemActivator(), "You are Mortal and this is not yours!!!!");
return;}
oPC = GetItemActivator();
object oTarget;
location lTarget;
oTarget = GetWaypointByTag("sentenced");
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());
DelayCommand(1.0, AssignCommand(oTarget, ActionJumpToLocation(GetLocation(GetWaypointByTag("sentenced")))));
FloatingTextStringOnCreature("You have been placed in prison by a DM for violation of server rules.", oPC);
}
}