Shargast_PRC8/_module/Chapter 1/nss/bhh_dismount_all.nss
Jaysyn904 66a0a3e043 Initial commit
Initial commit.
2024-08-03 14:13:18 -04:00

48 lines
1.1 KiB
Plaintext

// Party dismount from horses
// Author : Proleric
// Modified : 06-May-2008
#include "x3_inc_horse"
void bhSetFollowDistance(object oPC);
void main()
{
object oPC = GetPCSpeaker();
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_HORSE_PARTY_DISMOUNT, oPC, METAMAGIC_ANY, TRUE,
0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
DelayCommand(HORSE_DISMOUNT_DURATION + 2.0, bhSetFollowDistance(oPC));
}
// Set appropriate default follow distances
// The different cases are broken out so they can be changed individually
void bhSetFollowDistance(object oPC)
{
int nHench = 1;
object oHench = GetHenchman(oPC, nHench);
object oHorse;
while (GetIsObjectValid(oHench))
{
if (HorseGetIsAMount(oHench))
ExecuteScript("nw_ch_dist_6", oHench); // PC's horse
else
{
ExecuteScript("nw_ch_dist_6", oHench); // Dismounted henchman
oHorse = HorseGetMyHorse(oHench);
if (GetIsObjectValid(oHorse))
ExecuteScript("nw_ch_dist_6", oHorse); // Henchman's horse
}
oHench = GetHenchman(oPC, ++nHench);
}
}