Initial commit
Adding all of the current content for Anphillia Unlimited.
This commit is contained in:
93
_module/nss/wa_deities.nss
Normal file
93
_module/nss/wa_deities.nss
Normal file
@@ -0,0 +1,93 @@
|
||||
string FixedInt (int n)
|
||||
{
|
||||
string sN = IntToString(n);
|
||||
if (n < 0)
|
||||
return "ERROR";
|
||||
if (n < 10)
|
||||
return "00" + sN;
|
||||
if (n < 100)
|
||||
return "0" + sN;
|
||||
if (n < 1000)
|
||||
return sN;
|
||||
return "ERROR";
|
||||
}
|
||||
|
||||
void CreateDeity(string name)
|
||||
{
|
||||
/*
|
||||
name = GetStringUpperCase(name);
|
||||
|
||||
string Temp = GetLocalString(GetModule(), "Deity001");
|
||||
int n = 1;
|
||||
while (Temp != "")
|
||||
{
|
||||
n++;
|
||||
Temp = GetLocalString(GetModule(), "Deity" + FixedInt(n));
|
||||
}
|
||||
|
||||
WriteTimestampedLogEntry("Created " + name);
|
||||
|
||||
SetLocalString(GetModule(), "Deity" + FixedInt(n), name);
|
||||
*/
|
||||
SetLocalString(GetModule(), "LastDeity", name);
|
||||
}
|
||||
|
||||
void Domain(int DomainNum, string name = "LAST_ONE")
|
||||
{
|
||||
int n;
|
||||
if (name == "LAST_ONE")
|
||||
{
|
||||
/*
|
||||
name = GetLocalString(GetModule(), "Deity001");
|
||||
n = 1;
|
||||
while (name != "")
|
||||
{
|
||||
n++;
|
||||
name = GetLocalString(GetModule(), "Deity" + FixedInt(n));
|
||||
}
|
||||
*/
|
||||
name = GetLocalString(GetModule(), "LastDeity");
|
||||
}
|
||||
|
||||
name = GetStringUpperCase(name);
|
||||
|
||||
|
||||
int Temp = GetLocalInt(GetModule(), name + "_Domain1");
|
||||
n = 1;
|
||||
while (Temp != 0)
|
||||
{
|
||||
n++;
|
||||
Temp = GetLocalInt(GetModule(), name + "_Domain" + IntToString(n));
|
||||
}
|
||||
WriteTimestampedLogEntry("Added " + IntToString(n) + " for " + name);
|
||||
SetLocalInt(GetModule(), name + "_Domain" + IntToString(n), DomainNum);
|
||||
}
|
||||
|
||||
|
||||
int CheckPlayer(object oPC, string Deity = "DEFAULT_DEITY")
|
||||
{
|
||||
if (Deity == "DEFAULT_DEITY")
|
||||
{
|
||||
Deity = GetDeity(oPC);
|
||||
}
|
||||
|
||||
Deity = GetStringUpperCase(Deity);
|
||||
|
||||
int n = 1;
|
||||
int Feat = GetLocalInt(GetModule(), Deity + "_Domain" + IntToString(n));
|
||||
int CorrectDomains = 0;
|
||||
|
||||
while (Feat != 0 && CorrectDomains != 2)
|
||||
{
|
||||
if (GetHasFeat(Feat, oPC) == TRUE)
|
||||
CorrectDomains++;
|
||||
n++;
|
||||
Feat = GetLocalInt(GetModule(), Deity + "_Domain" + IntToString(n));
|
||||
}
|
||||
|
||||
if (CorrectDomains == 2)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user