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

77 lines
3.2 KiB
Plaintext

//:: Xovian's Familiar Summon
//:: Created: 25 Aug 10
//:: This script is used as a call in conversation for a Henchman to summon their familiar.
//:: The Henchman will summon a different Familiar based on Alignment.
//Henchmen Summons Familiar//
void HenchmanSummonFamiliar(object oHench);
//Henchmen Summons Familiar//
void HenchmanSummonFamiliar(object oHench)
{
/* valid familiars:
// nw_fm_bat, nw_fm_crag, nw_fm_hell, nw_fm_imp, nw_fm_fire, nw_fm_ice,
// nw_fm_pixi, nw_fm_rave, x0_fm_pdrg0, x2_fm_eye0 */
if(GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_EVIL || IP_CONST_ALIGNMENTGROUP_EVIL == TRUE)
{
//Evil Alignment will summon:
string eType = "x2_fm_eye0"; //FAMILIAR_CREATURE_TYPE_EYEBALL
int nHD = GetLevelByClass(CLASS_TYPE_WIZARD, oHench) + GetLevelByClass(CLASS_TYPE_SORCERER, oHench);
if (nHD == 0)
return;
else if (nHD <= 1)
eType = eType + "0" + IntToString(nHD);
else
eType = eType + IntToString(nHD);
//Summon the familiar and add it as a henchman
object oFam = CreateObject(OBJECT_TYPE_CREATURE, eType, GetLocation(OBJECT_SELF), FALSE);
SetName(oFam, GetName(oHench)+ "'s Familiar");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oFam));
AddHenchman(oHench, oFam);
DecrementRemainingFeatUses(oHench, FEAT_SUMMON_FAMILIAR);
}
else if(GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_GOOD || IP_CONST_ALIGNMENTGROUP_GOOD == TRUE)
{
//Good Alignment will summon:
string gType = "x0_fm_pdrg0"; //FAMILIAR_CREATURE_TYPE_PSEUDO_DRAGON
int nHD = GetLevelByClass(CLASS_TYPE_WIZARD, oHench) + GetLevelByClass(CLASS_TYPE_SORCERER, oHench);
if (nHD == 0)
return;
else if (nHD <= 1)
gType = gType + "0" + IntToString(nHD);
else
gType = gType + IntToString(nHD);
//Summon the familiar and add it as a henchman
object oFam = CreateObject(OBJECT_TYPE_CREATURE, gType, GetLocation(OBJECT_SELF), FALSE);
SetName(oFam, GetName(oHench)+ "'s Familiar");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oFam));
AddHenchman(oHench, oFam);
DecrementRemainingFeatUses(oHench, FEAT_SUMMON_FAMILIAR);
}
else
{
//All other non-specifc or Neutral Alignment will summon:
string nType = "nw_fm_pixi"; //FAMILIAR_CREATURE_TYPE_PIXIE
int nHD = GetLevelByClass(CLASS_TYPE_WIZARD, oHench) + GetLevelByClass(CLASS_TYPE_SORCERER, oHench);
if (nHD == 0)
return;
else if (nHD <= 1)
nType = nType + "0" + IntToString(nHD);
else
nType = nType + IntToString(nHD);
//Summon the familiar and add it as a henchman
object oFam = CreateObject(OBJECT_TYPE_CREATURE, nType, GetLocation(OBJECT_SELF), FALSE);
SetName(oFam, GetName(oHench)+ "'s Familiar");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oFam));
AddHenchman(oHench, oFam);
DecrementRemainingFeatUses(oHench, FEAT_SUMMON_FAMILIAR);
}
}
//Makes a henchman summon their familiar
void main()
{
AssignCommand(OBJECT_SELF, HenchmanSummonFamiliar(OBJECT_SELF));
}