Ancordia_PRC8/_module/nss/quest_payransom2.nss
Jaysyn904 102ba7dab6 Initial Commit
Initial Commit
2023-09-21 19:51:32 -04:00

28 lines
825 B
Plaintext

#include "x4_inc_functions"
void main()
{
object oPC = GetPCSpeaker();
string sDB = CharacterDB(oPC);
string sRansom = GetCampaignString(sDB, "QUEST_EXTRA2");
if (sRansom == "1500") sRansom = "2000";
if (sRansom == "1000") sRansom = "1500";
if (sRansom == "700") sRansom = "1000";
int nRansom = StringToInt(sRansom);
if (GetGold(oPC) < nRansom) return;
TakeGoldFromCreature(nRansom, oPC, TRUE);
SetLocalInt(OBJECT_SELF, "Quest_Halt", TRUE);
object oObject = GetFirstObjectInArea(GetArea(OBJECT_SELF));
while (oObject != OBJECT_INVALID)
{
if (GetLocalInt(oObject, "RansomQuest") == TRUE)
{
SetLocalInt(oObject, "Rescued", TRUE);
break;
}
oObject = GetNextObjectInArea(GetArea(OBJECT_SELF));
}
}