Allez, maintenant que j'ai le code pour le rayon, autant en profiter !! ^^
Donc voila, Rayon affaiblissant qui passe en mode D&D 3
Avec gestion du critique (pour des dommage de caracteristiques et/ou de niveau, le dommage s'eleve a 1 pt de degat d'energie negative) (par contre c'est frustrant car je n'arrive plus a retrouver ma source dans mon manuel grrr lol, fo que je relise pour etre sur si c 1 pt de critique en tout, ou 1 pt par nivo/pt de carac absorbé) Dans le doute, je laisse 1 tout court, et de toute maniere c pas la mer a boire a rajouter les critiques :bouffon:
//::///////////////////////////////////////////////
//:: Ray of EnFeeblement
//:: [NW_S0_rayEnfeeb.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Target must make a Fort save if the caster has succed his RTA
//:: or take ability damage to Strength equaling 1d6 +1 per 2 levels,
//:: to a maximum of +5. Duration of 1 minute per
//:: caster level.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Feb 2, 2001
//:: Modified By: Dolanor
//:: Modified On: 21/05/2003
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "raw_code_rta"
void main()
{
//Declare major variables
object oTarget = GetSpellTargetObject();
int nDuration = GetCasterLevel(OBJECT_SELF) * 60;
int nBonus = nDuration / 2;
//Limit bonus ability damage
if (nBonus > 5)
{
nBonus = 5;
}
if(nBonus == 0)
{
nBonus = 1;
}
int nLoss = d6() + nBonus;
int nMetaMagic = GetMetaMagicFeat();
effect eFeeb;
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
effect eRay;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Limit duration
if (nDuration > 10)
{
nDuration = 10;
}
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_ENFEEBLEMENT));
eRay = EffectBeam(VFX_BEAM_ODD, OBJECT_SELF, BODY_NODE_HAND);
//Make SR check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
int nRTA = RangeTouchAttack(oTarget,TRUE);
//Miss
if (nRTA == 0)
{
SendMessageToPC(OBJECT_SELF,"You missed the target, and lost the magic energy in the process");
vector vPos = MissRangeTouchAttack(oTarget, ATTACK_TYPE_SPELL);
vPos = Vector(vPos.x,vPos.y,vPos.z);
location lLocation = Location(GetArea(oTarget),vPos,1.7);
//creation de l'objet fictif a la position decalee
object oTEMP = CreateObject(OBJECT_TYPE_PLACEABLE, "neantobject", lLocation);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTEMP, 1.0);
DestroyObject(oTEMP, 1.2);
return;
}
//Make a Fort save to negate
if (!MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
{
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nLoss = 6 + nBonus;
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nLoss = nLoss + (nLoss/2);
}
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration * 2;
}
//Critique
if (nRTA == 2)
{
//Dommage de 1 d'energie negative
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(1, DAMAGE_TYPE_NEGATIVE), oTarget);
}
//Set ability damage effect
eFeeb = EffectAbilityDecrease(ABILITY_STRENGTH, nLoss);
effect eLink = EffectLinkEffects(eFeeb, eDur);
//Apply the ability damage effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget);
}
}
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.0);
}
CORRECTIONS apportées :
*gestion de l'effet de type "rayon"
*gestion du critique
*1 min/nivo au lieu de 1 rd/nivo