Initial Commit
Initial Commit
This commit is contained in:
23
_module/nss/house_dobuy.nss
Normal file
23
_module/nss/house_dobuy.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "nwnx_files"
|
||||
#include "x4_inc_functions"
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oModule = GetModule();
|
||||
|
||||
string sDatabase = GetLocalString(oModule, "DB");
|
||||
string sHouseName = GetLocalString(oPC, "HouseToSell");
|
||||
int nPrice = GetLocalInt(oPC, "HouseToSell_p");
|
||||
|
||||
//Prepare the name of the variable that stores ownership and its value in a form of a string
|
||||
string sHouseOwnership = "H_"+sHouseName+"_OWNER";
|
||||
string sOwner = CharacterDB(oPC);
|
||||
|
||||
//Do the transaction between the agency and the player
|
||||
SetCampaignString(sDatabase, sHouseOwnership, sOwner);
|
||||
TakeGoldFromCreature(nPrice, oPC, TRUE);
|
||||
|
||||
//In ONLINE mode, register the current date
|
||||
if (GetLocalString(oModule, "MODE") == "ONLINE")
|
||||
SetCampaignInt(sDatabase, "TIME_"+sHouseName, GetSystemTime());
|
||||
}
|
||||
Reference in New Issue
Block a user