PoA_PRC8/_module/_removed files/everheartbeat.nss
Jaysyn904 151d074880 Added "Removed Files" folder
Added "Removed Files" folder in case we needed to review any of them.
2022-10-10 10:39:34 -04:00

78 lines
2.7 KiB
Plaintext

//Script Name: everheartbeat
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 4/20/08 (Updated 8/10/08)
/////////////////////////////////////////
/*
Some parts of this script were taken from
AW_Olorin's Paths of Ascension Module
This script goes in the OnHeartbeat
Event of the Module Properties
*/
////////////////////////////////////////
//Required Include
#include "nw_i0_tool"
//Main Script
void main()
{
object oPC = GetFirstPC();
/////////////////////////////////////////////////////////////////////////////
//Prevent Trap Setting in any area where the placeable object "No Crown"
//is located (Which is found on the custom paletted)
//I recommend you place this object anywhere you don't want traps set!
while(GetIsObjectValid(oPC))
{
object detector = GetNearestObjectByTag("nocrown", oPC, 0);
if (GetIsObjectValid(detector))
{
object trap = GetNearestTrapToObject(detector, FALSE);
if ( GetTrapCreator(trap) == oPC && !GetIsDM(oPC) && GetIsPC(oPC))
if (GetArea(oPC) != GetArea(GetObjectByTag("throneofdeath")))
{
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("prison"))));
SendMessageToPC(oPC, "You have been sent to jail for setting a trap in a restricted area.");
}
}
oPC = GetNextPC();
}
////////////////////////////////////////////////////////////////////////
//GLOBAL MESSAGING SYSTEM By: AW_OLORIN (Paths of Ascension)
// Server Time Keeper
int timekeeper = GetLocalInt(GetModule(), "loadtimer");
SetLocalInt(GetModule(), "loadtimer", (timekeeper +1));
// DM announcement check
//This feature isn't currently in Use, but DO NOT REMOVE IT!!!
int iAnnounceTimer = GetLocalInt(GetModule(),"iAnnounceTimer");
SetLocalInt(GetModule(), "iAnnounceTimer", (iAnnounceTimer +1) );
if(iAnnounceTimer >= GetLocalInt(GetModule(),"iAnnounce_Period"))
{
string sAnnouncement = GetLocalString(GetModule(),"Announcement");
string sAuthor = GetLocalString(GetModule(),"Announcement_Author");
SetLocalInt(GetModule(),"iAnnounceTimer",0);
if(sAnnouncement == "") return;
oPC = GetFirstPC();
while(GetIsObjectValid(oPC))
{
if(GetIsDM(oPC))
SendMessageToPC(oPC,"Module wide announcement being sent, created by DM " + sAuthor + ".");
SendMessageToPC(oPC,sAnnouncement);
oPC = GetNextPC();
}
}
//Main Script End
}