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

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);
}