42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Mail - Conversation, Message Count
|
|
//:: mail_conv_msgcnt.nss
|
|
//:: Copyright (c) 2003 Jake E. Fitch
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Report the number of messages the Character has.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: 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 iMessageCount = 0;
|
|
int iNewMessageCount = 0;
|
|
|
|
int iMB = GetLocalInt(oMailman, "mail_Mailbox");
|
|
int iLastMessage = GetCampaignInt(DBName, "LastMessage");
|
|
int iCounter;
|
|
|
|
for (iCounter = 1; iCounter <=iLastMessage; iCounter++) {
|
|
if(iMB == GetCampaignInt(DBName, "T" + IntToString(iCounter))) {
|
|
iMessageCount++;
|
|
|
|
if(!GetCampaignInt(DBName, "R" + IntToString(iCounter))) iNewMessageCount++;
|
|
}
|
|
}
|
|
|
|
string sMessage = "You have " + IntToString(iNewMessageCount) + " new messages, and " + IntToString(iMessageCount) + " total messages.";
|
|
|
|
SetCustomToken(8000, sMessage);
|
|
|
|
return TRUE;
|
|
}
|