Updated Release Archive. Fixed Mage-killer prereqs. Removed old LETO & ConvoCC related files. Added organized spell scroll store. Fixed Gloura spellbook. Various TLK fixes. Reorganized Repo. Removed invalid user folders. Added DocGen back in.
102 lines
3.0 KiB
Plaintext
102 lines
3.0 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Shapechange
|
|
//:: NW_S0_ShapeChg.nss
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Preston Watamaniuk
|
|
//:: Created On: Jan 22, 2002
|
|
//:://////////////////////////////////////////////
|
|
|
|
//:: modified by mr_bumpkin Dec 4, 2003
|
|
|
|
#include "prc_inc_spells"
|
|
|
|
#include "pnp_shft_poly"
|
|
|
|
|
|
void main()
|
|
{
|
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
|
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION);
|
|
/*
|
|
Spellcast Hook Code
|
|
Added 2003-06-23 by GeorgZ
|
|
If you want to make changes to all spells,
|
|
check x2_inc_spellhook.nss to find out more
|
|
|
|
*/
|
|
|
|
if (!X2PreSpellCastCode())
|
|
{
|
|
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
|
return;
|
|
}
|
|
|
|
// End of Spell Cast Hook
|
|
|
|
|
|
//Declare major variables
|
|
int nSpell = GetSpellId();
|
|
object oTarget = PRCGetSpellTargetObject();
|
|
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
|
|
effect ePoly;
|
|
int nPoly;
|
|
int nMetaMagic = PRCGetMetaMagicFeat();
|
|
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
|
int nDuration = CasterLvl;
|
|
//Enter Metamagic conditions
|
|
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
|
|
//Determine Polymorph subradial type
|
|
if(nSpell == 392)
|
|
{
|
|
nPoly = POLYMORPH_TYPE_RED_DRAGON;
|
|
}
|
|
else if (nSpell == 393)
|
|
{
|
|
nPoly = POLYMORPH_TYPE_FIRE_GIANT;
|
|
}
|
|
else if (nSpell == 394)
|
|
{
|
|
nPoly = POLYMORPH_TYPE_BALOR;
|
|
}
|
|
else if (nSpell == 395)
|
|
{
|
|
nPoly = POLYMORPH_TYPE_DEATH_SLAAD;
|
|
}
|
|
else if (nSpell == 396)
|
|
{
|
|
nPoly = POLYMORPH_TYPE_IRON_GOLEM;
|
|
}
|
|
ePoly = EffectPolymorph(nPoly);
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SHAPECHANGE, FALSE));
|
|
|
|
// abort if mounted
|
|
if (!GetLocalInt(GetModule(),"X3_NO_SHAPESHIFT_SPELL_CHECK"))
|
|
{ // check to see if abort due to being mounted
|
|
if (PRCHorseGetIsMounted(oTarget))
|
|
{ // abort
|
|
if (GetIsPC(oTarget)) FloatingTextStrRefOnCreature(111982,oTarget,FALSE);
|
|
return;
|
|
} // abort
|
|
} // check to see if abort due to being mounted
|
|
|
|
//this command will make shore that polymorph plays nice with the shifter
|
|
ShifterCheck(oTarget);
|
|
|
|
DelayCommand(0.4, AssignCommand(oTarget, ClearAllActions())); // prevents an exploit
|
|
|
|
//Apply the VFX impact and effects
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
|
|
DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl));
|
|
|
|
DelayCommand(1.5,ActionCastSpellOnSelf(SPELL_SHAPE_INCREASE_DAMAGE));
|
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
|
// Getting rid of the integer used to hold the spells spell school
|
|
}
|