43 lines
1.8 KiB
Plaintext
43 lines
1.8 KiB
Plaintext
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
//:::::::::::::::::::::::: Shayan's Subrace Engine :::::::::::::::::::::::::::::
|
|
//::::::::::::::::::::::: File Name: sha_clock :::::::::::::::::::::::::::::::::
|
|
//:::::::::::::::::::::::::: Heartbeat Script ::::::::::::::::::::::::::::::::::
|
|
//:: Written by: Shayan
|
|
//:: Contact: mail_shayan@yhaoo.com :://
|
|
//:: Forums: http://p2.forumforfree.com/shayan.html :://
|
|
|
|
//:: This script should be placed on one random inanimate object in the module
|
|
//:: This is absolutely cruical bit (and new to version 2.7). Without it things won't function.
|
|
|
|
#include "sha_subr_methds"
|
|
void main()
|
|
{
|
|
int iTime = SHA_GetCurrentTime();
|
|
int iLastTime = GetLocalInt(OBJECT_SELF, "STORED_TIME");
|
|
SetLocalInt(OBJECT_SELF, "STORED_TIME", iTime);
|
|
|
|
|
|
if(iTime != iLastTime)
|
|
{
|
|
if(GetLocalInt(GetModule(), "SHUTDOWN_SSE"))
|
|
{ return; }
|
|
//There has been a day/night transition! Signal Event!
|
|
object oPC = GetFirstPC();
|
|
while(GetIsObjectValid(oPC) && !GetIsDM(oPC) && !GetLocalInt(GetArea(oPC), "DISABLE_SUBRACE_ENGINE"))
|
|
{
|
|
string subrace = GetLocalString(oPC, SUBRACE_TAG);
|
|
if(subrace != "")
|
|
{
|
|
string SubraceTag = SUBRACE_TAG + "_" + subrace;
|
|
ApplyTemporarySubraceAppearance(SubraceTag, oPC, iTime);
|
|
ApplySubraceEffect(oPC, SubraceTag, iTime);
|
|
CheckIfCanUseEquipedWeapon(oPC);
|
|
DelayCommand(6.0, CheckIfCanUseEquippedArmor(oPC));
|
|
DelayCommand(8.0, EquipTemporarySubraceSkin(SubraceTag, oPC, iTime));
|
|
DelayCommand(11.0, EquipTemporarySubraceClaw(SubraceTag, oPC, iTime));
|
|
}
|
|
oPC = GetNextPC();
|
|
}
|
|
}
|
|
}
|