42 lines
1.4 KiB
Plaintext
42 lines
1.4 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Mail - Has No Mailbox
|
|
//:: mail_hasnomb.nss
|
|
//:: Copyright (c) 2003 Jake E. Fitch
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Determines if the character has a mailbox and if so returns False.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Jake E. Fitch (Milambus Mandragon)
|
|
//:: Created On: Jan. 6, 2004
|
|
//:://////////////////////////////////////////////
|
|
|
|
#include "mail_include"
|
|
|
|
int StartingConditional()
|
|
{
|
|
object oPC = GetPCSpeaker();
|
|
object oMailman = GetNearestObjectByTag("Mailman", oPC);
|
|
|
|
int iTotalMB = GetCampaignInt(DBName, "LastMailbox");
|
|
int iCounter;
|
|
|
|
// If its already been determined, no need to go through the mailboxes again.
|
|
if (GetLocalInt(oMailman, "mail_Mailbox") > 0) return FALSE;
|
|
|
|
// Go through each mailbox comparing its owners name and cd key to the current character.
|
|
for (iCounter = 0; iCounter <= iTotalMB; iCounter++) {
|
|
int iNameMatch = (GetName(oPC) == GetCampaignString(DBName, "MBOwner" + IntToString(iCounter)));
|
|
int iCDMatch = TRUE;
|
|
|
|
if (CDKeyCheck) iCDMatch = (GetPCPublicCDKey(oPC) == GetCampaignString(DBName, "MBCDKey" + IntToString(iCounter)));
|
|
|
|
if (iNameMatch && iCDMatch) {
|
|
SetLocalInt(oMailman, "mail_Mailbox", iCounter);
|
|
return FALSE;
|
|
}
|
|
}
|
|
|
|
return TRUE;
|
|
}
|