Battledale_PRC8/_module/nss/fr_s2_wildsh_org.nss

81 lines
2.1 KiB
Plaintext
Raw Permalink Normal View History

//::///////////////////////////////////////////////
//:: Wild Shape
//:: NW_S2_WildShape
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Allows the Druid to change into animal forms.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 22, 2002
//:://////////////////////////////////////////////
#include "prc_inc_spells"
void main()
{
//Declare major variables
int nSpell = PRCGetSpellId();
object oTarget = PRCGetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH);
effect ePoly;
int nPoly;
int nMetaMagic = PRCGetMetaMagicFeat();
int nDuration = GetLevelByClass(CLASS_TYPE_DRUID);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Determine Polymorph subradial type
if(nSpell == 401)
{
nPoly = POLYMORPH_TYPE_BROWN_BEAR;
if (nDuration >= 12)
{
nPoly = POLYMORPH_TYPE_DIRE_BROWN_BEAR;
}
}
else if (nSpell == 402)
{
nPoly = POLYMORPH_TYPE_PANTHER;
if (nDuration >= 12)
{
nPoly = POLYMORPH_TYPE_DIRE_PANTHER;
}
}
else if (nSpell == 403)
{
nPoly = POLYMORPH_TYPE_WOLF;
if (nDuration >= 12)
{
nPoly = POLYMORPH_TYPE_DIRE_WOLF;
}
}
else if (nSpell == 404)
{
nPoly = POLYMORPH_TYPE_BOAR;
if (nDuration >= 12)
{
nPoly = POLYMORPH_TYPE_DIRE_BOAR;
}
}
else if (nSpell == 405)
{
nPoly = POLYMORPH_TYPE_BADGER;
if (nDuration >= 12)
{
nPoly = POLYMORPH_TYPE_DIRE_BADGER;
}
}
ePoly = EffectPolymorph(nPoly);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_WILD_SHAPE, FALSE));
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, OBJECT_SELF, HoursToSeconds(nDuration));
}