[DD SPELL]Negative Energy Ray

Répondre
Partager Rechercher
http://dolanor.free.fr/nwn/images/pierre100sorts.jpg



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]

Code PHP:

//::///////////////////////////////////////////////
//:: 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_EVILOBJECT_SELFBODY_NODE_HAND);;

    if(
nCasterLevel 9)
    {
        
nCasterLevel 9;
    }
    
nCasterLevel = (nCasterLevel 1) / 2;
    
int nDamage d6(nCasterLevel);

    
//Enter Metamagic conditions
    
if (nMetaMagic == METAMAGIC_MAXIMIZE)
    {
        
nDamage 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(oTargetATTACK_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_TEMPORARYeRayoTEMP1.7);
            
DestroyObject(oTEMP2.0);
            return;
            break;
        }
        
//Critique
        
case 2:
            
nDamage nDamage d6(nCasterLevel);
            break;
    }
    
effect eVis EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
    
effect eDam EffectDamage(nDamageDAMAGE_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(oTargetEventSpellCastAt(OBJECT_SELFSPELL_NEGATIVE_ENERGY_RAY));
            if (!
MyResistSpell(OBJECT_SELFoTarget))
            {
                
//Make a saving throw check
                
if(/*Will Save*/ MySavingThrow(SAVING_THROW_WILLoTargetGetSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
                {
                    
nDamage /= 2;
                }
                
//Apply the VFX impact and effects
                
DelayCommand(0.2ApplyEffectToObject(DURATION_TYPE_INSTANTeVisoTarget));
                
ApplyEffectToObject(DURATION_TYPE_INSTANTeDamoTarget);
            }
        }
    }
    else
    {
        
//Fire cast spell at event for the specified target
        
SignalEvent(oTargetEventSpellCastAt(OBJECT_SELFSPELL_NEGATIVE_ENERGY_RAYFALSE));
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeVisHealoTarget);
        
ApplyEffectToObject(DURATION_TYPE_INSTANTeHealoTarget);
    }
    
ApplyEffectToObject(DURATION_TYPE_TEMPORARYeRayoTarget1.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.
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés