Encore un
Ce coup ci c'est le Negative Energy Ray qui passe au code "rayon".
Meme modification que d'habitude pour un sort de rayon.
[Necro ON]
Petite precision, ce sort est un sort de rayon, or comme c'est de l'energie negative, sur un mort vivant ca le soigne. Donc on peut le soigner a distance, mais par contre on peut mal le viser, et donc le rayon passe a coté du mort vivant et ne le soignera pas
[Necro off]
//::///////////////////////////////////////////////
//:: Negative Energy Ray
//:: NW_S0_NegRay
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Fires a bolt of negative energy at the target
doing 1d6 damage. Does an additional 1d6
damage for 2 levels after level 1 (3,5,7,9) to
a maximum of 5d6 at level 9.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 13, 2001
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Dolanor
//:: Created On: 22/05/2003
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//inclusion de la fonction RTA
#include "raw_code_rta"
void main()
{
//Declare major variables
object oTarget = GetSpellTargetObject();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
effect eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);;
if(nCasterLevel > 9)
{
nCasterLevel = 9;
}
nCasterLevel = (nCasterLevel + 1) / 2;
int nDamage = d6(nCasterLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
switch(RangeTouchAttack(oTarget,TRUE))
{
//Miss
case 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.7);
DestroyObject(oTEMP, 2.0);
return;
break;
}
//Critique
case 2:
nDamage = nDamage + d6(nCasterLevel);
break;
}
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
effect eHeal = EffectHeal(nDamage);
effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M);
if(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_RAY));
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make a saving throw check
if(/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
{
nDamage /= 2;
}
//Apply the VFX impact and effects
DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}
}
else
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_RAY, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
}
CORRECTIONS apportées :
*Gestion de l'effet "rayon" du sort
*Gestion des critiques
*Modification du delai de l'effet d'impact qui etait bien trop long.