Initial Upload
Initial Upload
This commit is contained in:
34
_module/nss/kpb_deposit100.nss
Normal file
34
_module/nss/kpb_deposit100.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
////////////////////////////////////////////
|
||||
// Kittrell's Persistent Banking System //
|
||||
// Designed by: Brian J. Kittrell //
|
||||
// //
|
||||
// This script does the following: //
|
||||
// //
|
||||
// kpb_deposit100 - This script allows //
|
||||
// players to deposit 100 of their gold //
|
||||
// that they are carrying. //
|
||||
////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nDeposit = 100;
|
||||
int nBalance = GetCampaignInt("kpb_bank", "KPB_BANK_BALANCE", oPC);
|
||||
int nAmount = (nDeposit + nBalance);
|
||||
int nGold = GetGold(oPC);
|
||||
int iMonth = GetCalendarMonth();
|
||||
int iDay = GetCalendarDay();
|
||||
int iYear = GetCalendarYear();
|
||||
if (nGold >= 100)
|
||||
{
|
||||
TakeGoldFromCreature(nDeposit, oPC, TRUE);
|
||||
SetCampaignInt("kpb_bank", "KPB_BANK_BALANCE", nAmount, oPC);
|
||||
SetCampaignInt("kpb_bank", "KPB_DEPO_YEAR", iYear, oPC);
|
||||
SetCampaignInt("kpb_bank", "KPB_DEPO_DAY", iDay, oPC);
|
||||
SetCampaignInt("kpb_bank", "KPB_DEPO_MONTH", iMonth, oPC);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpeakString("Sorry, you do not have enough gold to deposit.", TALKVOLUME_TALK);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user