Alangara_PRC8/_module/nss/ipi_do_checkout.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

25 lines
867 B
Plaintext

#include "ipi_constants"
#include "ipi_defaults"
#include "pf_facade"
void main()
{
string sInnPrefix = GetStringRight(GetTag(OBJECT_SELF),2);
object myInn = GetObjectByTag(sPREFIX + sInnPrefix);
int roomNum = GetLocalInt(OBJECT_SELF, CURRENTROOM_VAR);
// Give any refund
int refund = GetLocalInt(OBJECT_SELF, REFUNDAMOUNT_VAR);
if (refund > 0) GiveGoldToCreature(GetPCSpeaker(), refund);
// Remove the relevant varables
string sTenantVar = "Rm" + IntToStringPad3(roomNum) + "Tenant";
string sExpireVar = "Rm" + IntToStringPad3(roomNum) + "Expire";
DeletePFCampaignVariable(sCampaignName, sTenantVar, myInn);
DeletePFCampaignVariable(sCampaignName, sExpireVar, myInn);
string msg = "Expiring contract for "+ GetName(GetPCSpeaker()) +
" on room " + IntToString(roomNum);
WriteTimestampedLogEntry(msg);
}