[DD SPELL]Ray of enfeeblement

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


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:

Code PHP:

//::///////////////////////////////////////////////
//:: 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(oTargetEventSpellCastAt(OBJECT_SELFSPELL_RAY_OF_ENFEEBLEMENT));
        
eRay EffectBeam(VFX_BEAM_ODDOBJECT_SELFBODY_NODE_HAND);
        
//Make SR check
        
if (!MyResistSpell(OBJECT_SELFoTarget))
        {
            
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(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.0);
                
DestroyObject(oTEMP1.2);
                return;
            }

            
//Make a Fort save to negate
            
if (!MySavingThrow(SAVING_THROW_FORToTargetGetSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
            {
                
//Enter Metamagic conditions
                
if (nMetaMagic == METAMAGIC_MAXIMIZE)
                {
                    
nLoss 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_INSTANTEffectDamage(1DAMAGE_TYPE_NEGATIVE), oTarget);
                }

                
//Set ability damage effect
                
eFeeb EffectAbilityDecrease(ABILITY_STRENGTHnLoss);
                
effect eLink EffectLinkEffects(eFeebeDur);
                
//Apply the ability damage effect and VFX impact
                
ApplyEffectToObject(DURATION_TYPE_TEMPORARYeLinkoTargetRoundsToSeconds(nDuration));
                
ApplyEffectToObject(DURATION_TYPE_TEMPORARYeVisoTarget);
            }

         }
    }
    
ApplyEffectToObject(DURATION_TYPE_TEMPORARYeRayoTarget1.0);

CORRECTIONS apportées :
*gestion de l'effet de type "rayon"
*gestion du critique
*1 min/nivo au lieu de 1 rd/nivo
Répondre

Connectés sur ce fil

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