Thanks

Moderator: Event DM
liephus wrote:The Avlis Team, we put the "F U" in fun.
Code: Select all
void main()
{
if (!GetIsPC(GetEnteringObject()))
return;
if (GetLocalInt(OBJECT_SELF, "TTimeout"))
return;
if (!GetIsNight())
return;
string sTag = GetTag(OBJECT_SELF);
//Insert Values here
string sResRef1 = "xxxx"
string sResRef2 = "yyyy"
string sResRef3 = "zzzz"
int iNo1 = #;
int iNo2 = #;
int iNo3 = #;
int i;
object oWP = GetNearestObjectByTag("WP_" + sTag);
object oNew;
location lWP = GetLocation(oWP);
if (sResRef1 != "")
{
while (i < iNo1 && i < 10)
{
oNew = CreateObject(OBJECT_TYPE_CREATURE, sResRef1, lWP, TRUE);
SetLocalInt(oNew, "despawn", TRUE);
i++;
}
}
i = 0;
if (sResRef2 != "")
{
while (i < iNo2 && i < 10)
{
oNew = CreateObject(OBJECT_TYPE_CREATURE, sResRef2, lWP, TRUE);
SetLocalInt(oNew, "despawn", TRUE);
i++;
}
}
i = 0;
if (sResRef3 != "")
{
while (i < iNo3 && i < 10)
{
oNew = CreateObject(OBJECT_TYPE_CREATURE, sResRef3, lWP, TRUE);
SetLocalInt(oNew, "despawn", TRUE);
i++;
}
}
SetLocalInt(OBJECT_SELF, "TTimeout", TRUE);
DelayCommand(1800.0, DeleteLocalInt(OBJECT_SELF, "TTimeout"));
}
Code: Select all
// Name : encset_atnight.nss
// Purpose :
// Author : n.a.
// Modified : March 7, 2004 by Mistcaller
// ** Sets the encounter active only during night times **
void ResetEncounter(float fTimeToWait, int nValue, object encounter)
{
DelayCommand(fTimeToWait, SetEncounterActive(nValue, encounter));
DelayCommand(fTimeToWait, DeleteLocalInt(encounter, "Disabled"));
}
void main()
{
object oPlayer = GetEnteringObject();
if (!GetIsPC(oPlayer)) return;
int nHour = GetTimeHour();
if((nHour < 6 || nHour > 18) && GetLocalInt(OBJECT_SELF, "Disabled") == 0)
{
SetEncounterActive(TRUE,OBJECT_SELF);
//1500 is 25 minutes
ResetEncounter(1500.0, TRUE, OBJECT_SELF);
SetLocalInt(OBJECT_SELF, "Disabled", 1);
}
ResetEncounter(3.0, FALSE, OBJECT_SELF);
}