Modification de flétrissure :
//::///////////////////////////////////////////////
//:: Horrid Wilting
//:: NW_S0_HorrWilt
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All living creatures (not undead or constructs)
suffer 1d8 damage of negative energy per caster level to a maximum
of 25d8 damage. 1/2 on successful fortitude save
but Water elemental suffer a -2 penalty on the roll.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 12 , 2001
//:: Modified By: Dolanor
//:: Modified On: 22/05/2003
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLvl = GetCasterLevel(oCaster);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_HORRID_WILTING);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Limit Caster level for the purposes of damage
if (nCasterLvl > 25)
{
nCasterLvl = 25;
}
//Apply the horrid wilting explosion at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HORRID_WILTING));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetRandomDelay(1.5, 2.5);
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
if(GetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT && GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Roll damage for each target
nDamage = d8(nCasterLvl);
//Resolve metamagic
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 8 * nCasterLvl;
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage / 2;
}
//Si la cible est un elementaire d'eau, il subit un malus de -2 au JS
if (GetRacialType(oTarget) == RACIAL_TYPE_ELEMENTAL && GetStringLeft(GetTag(oTarget),6) == "NW_WAT")
{
//On applique le malus de -2 au jet de sauvegarde
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSavingThrowDecrease(SAVING_THROW_FORT, 2, SAVING_THROW_TYPE_NONE), oTarget);
if(/*Fort Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, (GetSpellSaveDC()), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
nDamage = nDamage/2;
}
//On enleve le malus de -2 au jet de sauvegarde
RemoveEffect(oTarget,EffectSavingThrowDecrease(SAVING_THROW_FORT, 2, SAVING_THROW_TYPE_NEGATIVE));
}
else if(/*Fort Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
nDamage = nDamage/2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
// Apply effects to the currently selected target.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
}
}
CORRECTION apportées :
*Changement du type de dommage : Energie negative au lieu de magique.
*Rajout du malus au JS de -2 pour les elementaires d'eau, mais pas pour les vegetaux vu que le type vegetal n'existe pas.
*Endommage aussi bien ami que ennemi. Mages bigleux s'abstenir !
PS : Par contre, pourquoi voudrais tu mettre les dommages en type energie negative Sol ?? Je l'ai fait mais je me pose encore la question, je pense que les degats magiques sont plus adaptés.