26 lines
1002 B
Plaintext
26 lines
1002 B
Plaintext
|
#include "69_hench_lib"
|
||
|
#include "x4_inc_functions"
|
||
|
void main()
|
||
|
{
|
||
|
object oPC = GetPCSpeaker();
|
||
|
int nHenchPosition = GetLocalInt(oPC, "HenchChosen");
|
||
|
string sHenchPosition = IntToString(nHenchPosition);
|
||
|
int nIsRanged = GetCampaignInt(CharacterDB(oPC), "HENCH_"+sHenchPosition+"_RANGED");
|
||
|
DeleteLocalInt(oPC, "HenchChosen");
|
||
|
|
||
|
object oHench = RetrieveCampaignObject(CharacterDB(oPC), "HENCH_"+sHenchPosition, GetLocation(oPC));
|
||
|
SetLocalInt(oHench, "JustSpawned", TRUE);
|
||
|
DelayCommand(1.0, DeleteLocalInt(oHench, "JustSpawned"));
|
||
|
HireHenchman69(oPC, oHench);
|
||
|
SetLocalInt(oHench, "HenchPosition", nHenchPosition);
|
||
|
|
||
|
//Resurrect the henchman if necessary and heal fully
|
||
|
if (GetIsDead(oHench)) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oHench);
|
||
|
DelayCommand(0.3, ForceRest(oHench));
|
||
|
|
||
|
//Set all the integers
|
||
|
if(nIsRanged == TRUE)
|
||
|
ExecuteScript("69_hen_spawnin_r", oHench);
|
||
|
else ExecuteScript("69_hen_spawnin", oHench);
|
||
|
}
|