LoT_PRC8/_module/nss/henchcomp.nss
Jaysyn904 ec287507a1 Initial upload
Initial upload.
2023-09-25 21:32:17 -04:00

83 lines
3.3 KiB
Plaintext

//:: Xovian's Companion Summon
//:: Created: 25 Aug 10
//:: This script is used as a call in conversation for a Henchman to summon their Companion.
//:: The Henchman will summon a different Companion based on Alignment.
//Henchmen Summons Companion//
void HenchmanSummonCompanion(object oHench);
//Henchmen Summons Companion//
void HenchmanSummonCompanion(object oHench)
{
/* valid companions:
// nw_ac_badger, nw_ac_bear, nw_ac_boar, nw_ac_dwlf,
// nw_ac_spid, nw_ac_hawk, nw_ac_pant, nw_ac_wolf, x0_ac_drat0 */
if(GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_EVIL || IP_CONST_ALIGNMENTGROUP_EVIL == TRUE)
{
//Evil Alignment will summon:
string eType = "nw_ac_spid"; //ANIMAL_COMPANION_CREATURE_TYPE_SPIDER
int nHD = GetLevelByClass(CLASS_TYPE_RANGER, oHench)-5;
if (nHD < 0) nHD = 0;
nHD += GetLevelByClass(CLASS_TYPE_DRUID, oHench);
if (nHD == 0)
return;
else if (nHD <= 1)
eType = eType + "0" + IntToString(nHD);
else
eType = eType + IntToString(nHD);
//Summon the companion and add it as a henchman
object oCom = CreateObject(OBJECT_TYPE_CREATURE, eType, GetLocation(OBJECT_SELF), FALSE);
SetName(oCom, GetName(oHench)+ "'s Companion");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oCom));
AddHenchman(oHench, oCom);
DecrementRemainingFeatUses(oHench, FEAT_ANIMAL_COMPANION);
}
else if(GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_GOOD || IP_CONST_ALIGNMENTGROUP_GOOD == TRUE)
{
//Good Alignment will summon:
string gType = "nw_ac_hawk"; //ANIMAL_COMPANION_CREATURE_TYPE_HAWK
int nHD = GetLevelByClass(CLASS_TYPE_RANGER, oHench)-5;
if (nHD < 0) nHD = 0;
nHD += GetLevelByClass(CLASS_TYPE_DRUID, oHench);
if (nHD == 0)
return;
else if (nHD <= 1)
gType = gType + "0" + IntToString(nHD);
else
gType = gType + IntToString(nHD);
//Summon the companion and add it as a henchman
object oCom = CreateObject(OBJECT_TYPE_CREATURE, gType, GetLocation(OBJECT_SELF), FALSE);
SetName(oCom, GetName(oHench)+ "'s Companion");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oCom));
AddHenchman(oHench, oCom);
DecrementRemainingFeatUses(oHench, FEAT_ANIMAL_COMPANION);
}
else
{
//All other non-specifc or Neutral Alignment will summon:
string nType = "nw_ac_pant"; //ANIMAL_COMPANION_CREATURE_TYPE_PANTHER
int nHD = GetLevelByClass(CLASS_TYPE_RANGER, oHench)-5;
if (nHD < 0) nHD = 0;
nHD += GetLevelByClass(CLASS_TYPE_DRUID, oHench);
if (nHD == 0)
return;
else if (nHD <= 1)
nType = nType + "0" + IntToString(nHD);
else
nType = nType + IntToString(nHD);
//Summon the companion and add it as a henchman
object oCom = CreateObject(OBJECT_TYPE_CREATURE, nType, GetLocation(OBJECT_SELF), FALSE);
SetName(oCom, GetName(oHench)+ "'s Companion");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oCom));
AddHenchman(oHench, oCom);
DecrementRemainingFeatUses(oHench, FEAT_ANIMAL_COMPANION);
}
}
//Makes a henchman summon their Companion
void main()
{
AssignCommand(OBJECT_SELF, HenchmanSummonCompanion(OBJECT_SELF));
}