Changed folder name.
Changed folder name.
This commit is contained in:
78
_module/nss/overspawnmsg.nss
Normal file
78
_module/nss/overspawnmsg.nss
Normal file
@@ -0,0 +1,78 @@
|
||||
//Created by Genisys / Guile 5/25/08
|
||||
|
||||
//This trigger permits the party to escape the party jail for overspawning
|
||||
//If any player has been been here before they will be ported to DM jail.
|
||||
|
||||
//You will need to create 4 way points and give them tagname (see below)
|
||||
//There are 3 waypoints you need to have 1) "home"(the jail exit way point)
|
||||
//2) "partyjail" the party jail way point 3) "offended" for repeat offenders
|
||||
//4) "jailportway" where the portal to exit will spawn (in the party jail!)
|
||||
void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
object oTarget;
|
||||
location lTarget;
|
||||
oTarget = GetWaypointByTag("offended");
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
object oItem;
|
||||
oItem = GetFirstItemInInventory(oPC);
|
||||
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (GetTag(oItem)=="gemofteleporation") DestroyObject(oItem);
|
||||
if (GetTag(oItem)=="fieldtent") DestroyObject(oItem);
|
||||
if (GetTag(oItem)=="teleportationgem") DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory(oPC);
|
||||
}
|
||||
|
||||
if(GetLocalInt(oPC, "EnteredJail") <=2)
|
||||
{
|
||||
|
||||
DelayCommand(2.0, FloatingTextStringOnCreature
|
||||
("You have been sent to jail for overspawning!", oPC));
|
||||
|
||||
DelayCommand(4.0, FloatingTextStringOnCreature
|
||||
("You will be released in 3 minutes!", oPC));
|
||||
|
||||
DelayCommand(6.0, FloatingTextStringOnCreature
|
||||
("Next time you will not be released till restart!", oPC));
|
||||
|
||||
//This delay handles how long they are in jail (Currently 3 Minutes)
|
||||
DelayCommand(180.0, ExecuteScript("exitjail", oPC));
|
||||
}
|
||||
|
||||
else if(GetLocalInt(oPC, "EnteredJail") >=3)
|
||||
{
|
||||
|
||||
DelayCommand(2.0, FloatingTextStringOnCreature
|
||||
("You have been sent to jail for overspawning!", oPC));
|
||||
|
||||
DelayCommand(4.0, FloatingTextStringOnCreature
|
||||
("Because this is your third offense, you will not be released till restart!", oPC));
|
||||
|
||||
|
||||
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
|
||||
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
|
||||
AssignCommand(oPC, ActionJumpToLocation(lTarget));
|
||||
|
||||
}
|
||||
int bInt;
|
||||
bInt = GetLocalInt(oPC, "EnterJail");
|
||||
//If this isn't their first visit..
|
||||
if(bInt<0)
|
||||
{
|
||||
++bInt;
|
||||
SetLocalInt(oPC, "EnteredJail", bInt);
|
||||
}
|
||||
//Otherwise set the local int to 1
|
||||
else
|
||||
{
|
||||
SetLocalInt(oPC, "EnteredJail", 1);
|
||||
}
|
||||
//If they overspawn again in the next 10 minutes then they won't be released!
|
||||
DelayCommand(900.0, SetLocalInt(oPC, "EnteredJail", 0));
|
||||
|
||||
}
|
Reference in New Issue
Block a user