Module commit
Module commit.
This commit is contained in:
54
_module/nss/temps_on_heartb.nss
Normal file
54
_module/nss/temps_on_heartb.nss
Normal file
@@ -0,0 +1,54 @@
|
||||
#include "ww_inc_on_hrtbt"
|
||||
#include "werewolf_friends"
|
||||
|
||||
#include "vamp_friends"
|
||||
#include "vamp_sunsystem"
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Temps persistant
|
||||
//:: Par Zyzko
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
// A mettre sur le On HeartBeat du module
|
||||
// Paste it on your HeartBeat module event
|
||||
|
||||
void main()
|
||||
{
|
||||
object oMod = GetModule();
|
||||
//ExecuteScript("_cb_heartbeat", oMod); <- PRC8 replaces all this garbage
|
||||
object oPC = GetFirstPC();
|
||||
int iCurrentHour = GetTimeHour();
|
||||
int nCurrentMinute = GetTimeMinute();
|
||||
int nCurrentSecond = GetTimeSecond();
|
||||
int nCurrentMilli = GetTimeMillisecond();
|
||||
SetTime(iCurrentHour, nCurrentMinute, nCurrentSecond, nCurrentMilli);
|
||||
|
||||
WWHrtbt(oPC);
|
||||
// if the character is a valid player character, run the following...
|
||||
if (GetIsObjectValid(oPC))
|
||||
{
|
||||
//If entering object is PC werewolf, make every werewolf on area friendly towards entering werewolf.
|
||||
//and make every NPC werewolf in the module friendly with the PC werewolf
|
||||
werewolf_friends(oPC);
|
||||
}
|
||||
|
||||
// if the character is a valid player character, run the following...
|
||||
if (GetIsObjectValid(oPC))
|
||||
{
|
||||
//If entering object is Undead, make it friendly towards every vampire on module.
|
||||
//If entering object is Vampire, make every undead on area friendly towards entering vampire.
|
||||
vamp_friends(oPC);
|
||||
PrintString("on_enter: " + GetName(oPC) + " (is a valid object) entering "+GetName(GetArea(oPC)));
|
||||
if(GetSubRace(oPC)=="Vampire" && GetIsPC(oPC))
|
||||
{
|
||||
//Init sunsystem for entering vampire. If area is underground you dont need this.
|
||||
vamp_sunsystem(oPC);
|
||||
}
|
||||
}
|
||||
|
||||
//Sauvegarde a chaque heure
|
||||
if (GetLocalInt(oMod, "CheckHour") != GetTimeHour())
|
||||
{
|
||||
SetLocalInt(oMod, "CheckHour", GetTimeHour());
|
||||
ExecuteScript("temps_sauv", oMod);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user