28 lines
825 B
Plaintext
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));
|
|
}
|
|
}
|