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

44 lines
1.3 KiB
Plaintext

//:://////////////////////////////////////////////////
//:: 69_hench_quit
//:: Copyright (c) 2002 Floodgate Entertainment
//:://////////////////////////////////////////////////
/*
Actions taken when a henchman quits/refuses his/her current/former
master.
*/
//:://////////////////////////////////////////////////
//:: Created By: 69MEH69
//:: Created On: Apr2005
//:://////////////////////////////////////////////////
#include "x4_inc_functions"
#include "69_hench_lib"
#include "x3_inc_horse"
void main()
{
object oPC = GetPCSpeaker();
SetLocalInt(OBJECT_SELF, "Gone", 1);
SetIsDestroyable(TRUE, TRUE, TRUE);
int nHenchPosition = GetLocalInt(OBJECT_SELF, "HenchPosition");
string sHenchPosition = IntToString(nHenchPosition);
int nIsRanged = GetAssociateState(NW_ASC_USE_RANGED_WEAPON);
string sHenchName = GetName(OBJECT_SELF);
SetCampaignInt(CharacterDB(oPC), "HENCH_"+sHenchPosition+"_RANGED", nIsRanged);
//Remove the horse the resurrected player is mounted - riding would be too good if you didn't lose your horse upon death.
if (HorseGetIsMounted(OBJECT_SELF) == TRUE)
{
HorseInstantDismount(OBJECT_SELF);
}
StoreCampaignObject(CharacterDB(oPC), "HENCH_"+sHenchPosition, OBJECT_SELF);
DelayCommand(1.0, SetCampaignString(CharacterDB(oPC), "HENCH_"+sHenchPosition+"_NAME", sHenchName));
DelayCommand(1.0, QuitHenchman69(oPC));
}