Amon_PRC8/_removed/nw_s0_shapechg.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

70 lines
2.1 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Shapechange
//:: NW_S0_ShapeChg.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 22, 2002
//:://////////////////////////////////////////////
//small duration change by Tris'la to stop stupid monk/druid expolit
int badDruidYesYouAre(int xDur);
void main()
{
//Declare major variables
int nSpell = GetSpellId();
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
effect ePoly;
int nPoly;
int nMetaMagic = GetMetaMagicFeat();
int nDuration;
nDuration = badDruidYesYouAre(nDuration);
if (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));
//Apply the VFX impact and effects
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oTarget, TurnsToSeconds(nDuration)));
}
int badDruidYesYouAre(int xDur){
int classPoistionFirst = GetClassByPosition(1, OBJECT_SELF);
int classPositionSecond = GetClassByPosition(2, OBJECT_SELF);
int classPositionThird = GetClassByPosition(3, OBJECT_SELF);
if ((classPoistionFirst == CLASS_TYPE_MONK) || (classPositionSecond == CLASS_TYPE_MONK) || (classPositionThird == CLASS_TYPE_MONK))
return xDur = 1;
else
return xDur = GetCasterLevel(OBJECT_SELF);
}