Further file organization
Further file organization
This commit is contained in:
103
nwn/nwnprc/trunk/spells/nw_s0_polyself.nss
Normal file
103
nwn/nwnprc/trunk/spells/nw_s0_polyself.nss
Normal file
@@ -0,0 +1,103 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Polymorph Self
|
||||
//:: NW_S0_PolySelf.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The PC is able to changed their form to one of
|
||||
several forms.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 21, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#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_IMP_POLYMORPH);
|
||||
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 == 387)
|
||||
{
|
||||
nPoly = POLYMORPH_TYPE_GIANT_SPIDER;
|
||||
}
|
||||
else if (nSpell == 388)
|
||||
{
|
||||
nPoly = POLYMORPH_TYPE_TROLL;
|
||||
}
|
||||
else if (nSpell == 389)
|
||||
{
|
||||
nPoly = POLYMORPH_TYPE_UMBER_HULK;
|
||||
}
|
||||
else if (nSpell == 390)
|
||||
{
|
||||
nPoly = POLYMORPH_TYPE_PIXIE;
|
||||
}
|
||||
else if (nSpell == 391)
|
||||
{
|
||||
nPoly = POLYMORPH_TYPE_ZOMBIE;
|
||||
}
|
||||
ePoly = EffectPolymorph(nPoly);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_POLYMORPH_SELF, 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);
|
||||
|
||||
AssignCommand(oTarget, ClearAllActions()); // prevents an exploit
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
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
|
||||
}
|
||||
|
Reference in New Issue
Block a user