[DD SPELL] Prismatic Ray

Répondre
Partager Rechercher
Rayon prismatiques mis a jour par Olblach dans son hak.
Grace a SoU, ca devient ce que ca devait etre (gestion de la petrification) Mais il y'a aussi une gestion pour l'envoi dans des plans divers et variés

Adresse vers le hakpack sur le vault : http://nwvault.ign.com/Files/scripts...01046708.shtml

Code PHP:

//::///////////////////////////////////////////////
//:: Prismatic Spray
//:: [NW_S0_PrisSpray.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Sends out a prismatic cone that has a random
//:: effect for each target struck.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Dec 19, 2000
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: Last Updated By: Aidan Scanlan On: April 11, 2001
//:: Last Updated By: Preston Watamaniuk, On: June 11, 2001

// Modified by Olblach to conform 3rd Ed. PHB October, 9, 2003
// Update: October, 21, 2003 Changed the poison death part, the 2 rays hit and added more than one plane teleporting

int ApplyPrismaticEffect(int nEffectobject oTarget);

#include "X0_I0_SPELLS"


// Change the NUMPLANES value to the number of planes in your module
// They Waypoints will have to be named WP_PLANE, WP_PLANE1, and so on...
// for 3 planes:
// const int NUMPLANES = 3 ;
// and create 3 waypoints WP_PLANE, WP_PLANE1, WP_PLANE2
// for 5 planes:
// const int NUMPLANES = 5 ;
// and create 5 waypoints WP_PLANE, WP_PLANE1, WP_PLANE2, WP_PLANE3, WP_PLANE4

const int NUMPLANES ;


void main()
{
    
//Declare major variables
    
object oTarget;
    
int nCasterLevel GetCasterLevel(OBJECT_SELF);
    
int nMetaMagic GetMetaMagicFeat();
    
int nRandom;
    
int nHD;
    
int nVisualnVisual2 ;
    
effect eVisual;
    
int bTwoEffects;
    
//Set the delay to apply to effects based on the distance to the target
    
float fDelay 0.5 GetDistanceBetween(OBJECT_SELFoTarget)/20;
    
//Get first target in the spell area
    
oTarget GetFirstObjectInShape(SHAPE_SPELLCONE11.0GetSpellTargetLocation());
    while (
GetIsObjectValid(oTarget))
    {
        if (
spellsIsTarget(oTargetSPELL_TARGET_STANDARDHOSTILEOBJECT_SELF))
        {
            
//Fire cast spell at event for the specified target
            
SignalEvent(oTargetEventSpellCastAt(OBJECT_SELFSPELL_PRISMATIC_SPRAY));
            
//Make an SR check
            
if (!MyResistSpell(OBJECT_SELFoTargetfDelay) && (oTarget != OBJECT_SELF))
            {
                
//Blind the target if they are less than 9 HD
                
nHD GetHitDice(oTarget);
                if (
nHD <= 8)
                {
                    
ApplyEffectToObject(DURATION_TYPE_TEMPORARYEffectBlindness(), oTargetRoundsToSeconds(d4()+d4()));
                }
                
//Determine if 1 or 2 effects are going to be applied
                
nRandom d8();
                if(
nRandom == 8)
                {
                
nRandom Random(7)+;
                
int nRandom2 ;

                    do {
                        
nRandom2 Random(7)+1;
                    } while (
nRandom2 == nRandom) ;
                    
//Get the visual effect
                    
nVisual ApplyPrismaticEffect(nRandomoTarget);
                    
nVisual2 ApplyPrismaticEffect(nRandom2oTarget);
                }
                else
                {
                    
//Get the visual effect
                    
nVisual ApplyPrismaticEffect(nRandomoTarget);
                }
                
//Set the visual effect
                
if(nVisual != 0)
                {
                    
eVisual EffectVisualEffect(nVisual);
                    
//Apply the visual effect
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoTarget));
                }
                if(
nVisual2 != 0)
                {
                    
eVisual EffectVisualEffect(nVisual2);
                    
//Apply the visual effect
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoTarget));
                }
            }
        }
        
//Get next target in the spell area
        
oTarget GetNextObjectInShape(SHAPE_SPELLCONE11.0GetSpellTargetLocation());
    }
}

///////////////////////////////////////////////////////////////////////////////
//  ApplyPrismaticEffect
///////////////////////////////////////////////////////////////////////////////
/*  Given a reference integer and a target, this function will apply the effect
    of corresponding prismatic cone to the target.  To have any effect the
    reference integer (nEffect) must be from 1 to 7.*/
///////////////////////////////////////////////////////////////////////////////
//  Created By: Aidan Scanlan On: April 11, 2001
///////////////////////////////////////////////////////////////////////////////

int ApplyPrismaticEffect(int nEffectobject oTarget)
{
    
int nDamage;
    
effect ePrism;
    
effect eVis;
    
effect eDur EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
    
effect eLink;
    
int nVis;
    
float fDelay 0.5 GetDistanceBetween(OBJECT_SELFoTarget)/20;
    
//Based on the random number passed in, apply the appropriate effect and set the visual to
    //the correct constant

// Uncomment the line below if you want to test the teleport to plane only feature (and don't forget to comment it back when done ;))
//    nEffect=7 ;
    
switch(nEffect)
    {
        case 
1://fire
            
nDamage 20;
            
nVis VFX_IMP_FLAME_S;
            
nDamage GetReflexAdjustedDamage(nDamageoTargetGetSpellSaveDC(),SAVING_THROW_TYPE_FIRE);
            
ePrism EffectDamage(nDamageDAMAGE_TYPE_FIRE);
            
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
        break;
        case 
2//Acid
            
nDamage 40;
            
nVis VFX_IMP_ACID_L;
            
nDamage GetReflexAdjustedDamage(nDamageoTargetGetSpellSaveDC(),SAVING_THROW_TYPE_ACID);
            
ePrism EffectDamage(nDamageDAMAGE_TYPE_ACID);
            
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
        break;
        case 
3//Electricity
            
nDamage 80;
            
nVis VFX_IMP_LIGHTNING_S;
            
nDamage GetReflexAdjustedDamage(nDamageoTargetGetSpellSaveDC(),SAVING_THROW_TYPE_ELECTRICITY);
            
ePrism EffectDamage(nDamageDAMAGE_TYPE_ELECTRICAL);
            
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
        break;
        case 
4//Poison
            
{
                if (
MySavingThrow(SAVING_THROW_FORToTargetGetSpellSaveDC(), SAVING_THROW_TYPE_POISON) == 0)
                {
                    if (
GetIsImmune(oTargetIMMUNITY_TYPE_POISON)) {
                        
ePrism EffectPoison(POISON_BEBILITH_VENOM);
                        
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
                    }
                    else {
                        
ePrism ExtraordinaryEffect(EffectDeath());
                        
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
                    }
                }
                else {
                    
nDamage 20 ;
                    
effect ePoison EffectDamage(nDamageDAMAGE_TYPE_MAGICAL); //poison
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePoisonoTarget));
                }
            }
        break;
        case 
5//Paralyze
            
{
                
effect eDur2 EffectVisualEffect(VFX_DUR_PARALYZED);
                if (
MySavingThrow(SAVING_THROW_FORToTargetGetSpellSaveDC()) == 0)
                {
                    
ePrism EffectParalyze();
                    
eLink EffectLinkEffects(eDurePrism);
                    
eLink EffectLinkEffects(eLinkeDur2);
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_PERMANENTeLinkoTarget));
                }
            }
        break;
        case 
6//Feeblemind
            
{
                
effect eMind EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
                
ePrism EffectConfused();
                
eLink EffectLinkEffects(eMindePrism);
                
eLink EffectLinkEffects(eLinkeDur);

                if (!
/*Will Save*/ MySavingThrow(SAVING_THROW_WILLoTargetGetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLSOBJECT_SELFfDelay))
                {
                    
nVis VFX_IMP_CONFUSION_S;
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_PERMANENTeLinkoTarget));
                }
            }
        break;
        case 
7//Sent to outer plane
            
{
                if (!
/*Will Save*/ MySavingThrow(SAVING_THROW_WILLoTargetGetSpellSaveDC(), SAVING_THROW_TYPE_NONEOBJECT_SELFfDelay))
                {
                    
//nVis = VFX_IMP_DEATH;
                    
nVis VFX_IMP_UNSUMMON ;
                    if (!
GetIsPC(oTarget))
                        
DestroyObject(oTargetfDelay+0.3) ;
                    else {
                    
object oPlane GetWaypointByTag("WP_PLANE") ;
                    
int nPlane Random(NUMPLANES) ;
                        if (
nPlane == 0)
                            
oPlane GetWaypointByTag("WP_PLANE") ;
                        else
                            
oPlane GetWaypointByTag("WP_PLANE"+IntToString(Random(NUMPLANES)+1)) ;
                        
DelayCommand(fDelayAssignCommand(oTargetActionJumpToObject(oPlane)));
                    }
                }
            }
        break;
    }
    return 
nVis;

Je rajoute le code que j'ai modifié car j'ai trouvé certaines incohérences dans le code Olblach. (bien sur je peux me tromper, mais le code marche )


Les probleme/ajouts a regler :

* Le fait que le mage qui a petrifié/Confus a vie enleve les etats speciaux en se reposant. Mais je pense que c limité par le jeu, a moins d'agir par la BDD
*Faire un systeme pour que les waypoint ne soient pas uniquement des waypoint avec des numeros (car on peut ne pas s'y retrouver). Donc scan des waypoint existants commencant par : WP_PLANE_, puis random dans cette liste (mais il me semble que l'on a pas acces aux array, donc ca va etre dur)


Code PHP:

//::///////////////////////////////////////////////
//:: Prismatic Spray
//:: [NW_S0_PrisSpray.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Sends out a prismatic cone that has a random
//:: effect for each target struck.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Dec 19, 2000
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: Last Updated By: Aidan Scanlan On: April 11, 2001
//:: Last Updated By: Preston Watamaniuk, On: June 11, 2001

// Modified by Olblach to conform 3rd Ed. PHB October, 9, 2003
// Update: October, 21, 2003 Changed the poison death part, the 2 rays hit and added more than one plane teleporting

int ApplyPrismaticEffect(int nEffectobject oTarget);

#include "X0_I0_SPELLS"


// Change the NUMPLANES value to the number of planes in your module
// They Waypoints will have to be named WP_PLANE, WP_PLANE1, and so on...
// for 3 planes:
// const int NUMPLANES = 3 ;
// and create 3 waypoints WP_PLANE, WP_PLANE1, WP_PLANE2
// for 5 planes:
// const int NUMPLANES = 5 ;
// and create 5 waypoints WP_PLANE, WP_PLANE1, WP_PLANE2, WP_PLANE3, WP_PLANE4

const int NUMPLANES ;


void main()
{
    
//Declare major variables
    
object oTarget;
    
int nCasterLevel GetCasterLevel(OBJECT_SELF);
    
int nMetaMagic GetMetaMagicFeat();
    
int nRandom;
    
int nHD;
    
int nVisualnVisual2 ;
    
effect eVisual;
    
int bTwoEffects;
    
//Set the delay to apply to effects based on the distance to the target
    
float fDelay 0.5 GetDistanceBetween(OBJECT_SELFoTarget)/20;
    
//Get first target in the spell area
    
oTarget GetFirstObjectInShape(SHAPE_SPELLCONE11.0GetSpellTargetLocation());
    while (
GetIsObjectValid(oTarget))
    {
        if (
spellsIsTarget(oTargetSPELL_TARGET_STANDARDHOSTILEOBJECT_SELF))
        {
            
//Fire cast spell at event for the specified target
            
SignalEvent(oTargetEventSpellCastAt(OBJECT_SELFSPELL_PRISMATIC_SPRAY));
            
//Make an SR check
            
if (!MyResistSpell(OBJECT_SELFoTargetfDelay) && (oTarget != OBJECT_SELF))
            {
                
//Blind the target if they are less than 9 HD
                
nHD GetHitDice(oTarget);
                if (
nHD <= 8)
                {
                    
ApplyEffectToObject(DURATION_TYPE_TEMPORARYEffectBlindness(), oTargetRoundsToSeconds(d4()+d4()));
                }
                
//Determine if 1 or 2 effects are going to be applied
                
nRandom d8();
                if(
nRandom == 8)
                {
                    
nRandom d8();
                    
// we roll again if it is another 8
                    
nRandom 8;
                    while (
nRandom == 8)
                    {
                         
nRandom d8();
                    }

                    
int nRandom2 ;

                    do
                    {
                        
nRandom2 d8();
                        
// we roll again if it is another 8
                        
while (nRandom2 == 8)
                        {
                             
nRandom2 d8();
                        }
                    } while (
nRandom2 == nRandom) ;
                    
//Get the visual effect
                    
if (nRandom == 7)
                    {
                        
nVisual ApplyPrismaticEffect(nRandom2oTarget);
                        
nVisual2 ApplyPrismaticEffect(nRandomoTarget);
                    }
                    else
                    {
                        
nVisual ApplyPrismaticEffect(nRandomoTarget);
                        
nVisual2 ApplyPrismaticEffect(nRandom2oTarget);
                    }
                }
                else
                {
                    
//Get the visual effect
                    
nVisual ApplyPrismaticEffect(nRandomoTarget);
                }
                
//Set the visual effect
                
if(nVisual != 0)
                {
                    
eVisual EffectVisualEffect(nVisual);
                    
//Apply the visual effect
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoTarget));
                }
                if(
nVisual2 != 0)
                {
                    
eVisual EffectVisualEffect(nVisual2);
                    
//Apply the visual effect
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTeVisualoTarget));
                }
            }
        }
        
//Get next target in the spell area
        
oTarget GetNextObjectInShape(SHAPE_SPELLCONE11.0GetSpellTargetLocation());
    }
}

///////////////////////////////////////////////////////////////////////////////
//  ApplyPrismaticEffect
///////////////////////////////////////////////////////////////////////////////
/*  Given a reference integer and a target, this function will apply the effect
    of corresponding prismatic cone to the target.  To have any effect the
    reference integer (nEffect) must be from 1 to 7.*/
///////////////////////////////////////////////////////////////////////////////
//  Created By: Aidan Scanlan On: April 11, 2001
///////////////////////////////////////////////////////////////////////////////

int ApplyPrismaticEffect(int nEffectobject oTarget)
{
    
int nDamage;
    
effect ePrism;
    
effect eVis;
    
effect eDur EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
    
effect eLink;
    
int nVis;
    
float fDelay 0.5 GetDistanceBetween(OBJECT_SELFoTarget)/20;
    
//Based on the random number passed in, apply the appropriate effect and set the visual to
    //the correct constant

// Uncomment the line below if you want to test the teleport to plane only feature (and don't forget to comment it back when done ;))
//    nEffect=7 ;
    
switch(nEffect)
    {
        case 
1://fire
            
nDamage 20;
            
nVis VFX_IMP_FLAME_S;
            
nDamage GetReflexAdjustedDamage(nDamageoTargetGetSpellSaveDC(),SAVING_THROW_TYPE_FIRE);
            
ePrism EffectDamage(nDamageDAMAGE_TYPE_FIRE);
            
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
        break;
        case 
2//Acid
            
nDamage 40;
            
nVis VFX_IMP_ACID_L;
            
nDamage GetReflexAdjustedDamage(nDamageoTargetGetSpellSaveDC(),SAVING_THROW_TYPE_ACID);
            
ePrism EffectDamage(nDamageDAMAGE_TYPE_ACID);
            
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
        break;
        case 
3//Electricity
            
nDamage 80;
            
nVis VFX_IMP_LIGHTNING_S;
            
nDamage GetReflexAdjustedDamage(nDamageoTargetGetSpellSaveDC(),SAVING_THROW_TYPE_ELECTRICITY);
            
ePrism EffectDamage(nDamageDAMAGE_TYPE_ELECTRICAL);
            
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
        break;
        case 
4//Poison
            
{
                if (
MySavingThrow(SAVING_THROW_FORToTargetGetSpellSaveDC(), SAVING_THROW_TYPE_POISON) == 0)
                {
                    if (!
GetIsImmune(oTargetIMMUNITY_TYPE_POISON)) {
                        
ePrism ExtraordinaryEffect(EffectDeath());
                        
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePrismoTarget));
                    }
                }
                else {
                    
nDamage 20 ;
                    
effect ePoison EffectDamage(nDamageDAMAGE_TYPE_MAGICAL); //poison
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_INSTANTePoisonoTarget));
                }
            }
        break;
        case 
5//Petrify
            
{
                
effect eDur2 EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
                
// * exit if creature is immune to petrification

                
if (MySavingThrow(SAVING_THROW_FORToTargetGetSpellSaveDC()) == 0)
                {
                    if (!
spellsIsImmuneToPetrification(oTarget) == TRUE)
                    {
                        
ePrism ExtraordinaryEffect(EffectPetrify());
                        
eLink EffectLinkEffects(eDurePrism);
                        
eLink EffectLinkEffects(eLinkeDur2);
                        
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_PERMANENTeLinkoTarget));
                    }
                }
            }
        break;
        case 
6//Feeblemind
            
{
                
effect eMind EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
                
ePrism ExtraordinaryEffect(EffectConfused());
                
eLink EffectLinkEffects(eMindePrism);
                
eLink EffectLinkEffects(eLinkeDur);

                if (!
/*Will Save*/ MySavingThrow(SAVING_THROW_WILLoTargetGetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLSOBJECT_SELFfDelay))
                {
                    
nVis VFX_IMP_CONFUSION_S;
                    
DelayCommand(fDelayApplyEffectToObject(DURATION_TYPE_PERMANENTeLinkoTarget));
                }
            }
        break;
        case 
7//Sent to outer plane
            
{
                if (!
/*Will Save*/ MySavingThrow(SAVING_THROW_WILLoTargetGetSpellSaveDC(), SAVING_THROW_TYPE_NONEOBJECT_SELFfDelay))
                {
                    
//nVis = VFX_IMP_DEATH;
                    
nVis VFX_IMP_UNSUMMON ;
                    if (!
GetIsPC(oTarget))
                        
DestroyObject(oTargetfDelay+0.3) ;
                    else {
                    
object oPlane GetWaypointByTag("WP_PLANE") ;
                    
int nPlane Random(NUMPLANES) ;
                        if (
nPlane == 0)
                            
oPlane GetWaypointByTag("WP_PLANE") ;
                        else
                            
oPlane GetWaypointByTag("WP_PLANE"+IntToString(Random(NUMPLANES)+1)) ;
                        
DelayCommand(fDelayAssignCommand(oTargetActionJumpToObject(oPlane)));
                    }
                }
            }
        break;
    }
    return 
nVis;

Citation :
* Le fait que le mage qui a petrifié/Confus a vie enleve les etats speciaux en se reposant. Mais je pense que c limité par le jeu, a moins d'agir par la BDD
Tu met l'effet en ExtraordinaryEffect(), et surtout, tu fais en sorte que l'effet ne soit pas appliqué par le mage, genre :

Ceci :
ePrism = ExtraordinaryEffect(EffectPetrify());
eLink = EffectLinkEffects(eDur, ePrism);
eLink = EffectLinkEffects(eLink, eDur2);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget));


Va donner ceci :

Code PHP:

                                                ePrism ExtraordinaryEffect(EffectPetrify());
                        
eLink EffectLinkEffects(eDurePrism);
                        
eLink EffectLinkEffects(eLinkeDur2);
                        
DelayCommand(fDelayAssignCommand(oTargetApplyEffectToObject(DURATION_TYPE_PERMANENTeLinkoTarget))); //C'est ici que j'ai modifié, le principe etant de faire en sorte que ce soit oTarget a l'origine de l'effet qui le paralyse.
//Attention, ce systeme a l'inconvenient de ne pas donner les xps en cas de mort (enfin, si, mais il les donne au mort qui s'est auto-tué, en fait)
//A n'appliquer que dans des effets qui ne tuent pas. 

Citation :
*Faire un systeme pour que les waypoint ne soient pas uniquement des waypoint avec des numeros (car on peut ne pas s'y retrouver). Donc scan des waypoint existants commencant par : WP_PLANE_, puis random dans cette liste (mais il me semble que l'on a pas acces aux array, donc ca va etre dur)
Je vois pas pourquoi tu veux des Arrays : WP_PLANE_1 / WP_PLANE_2 /etc, ca t'embete ? tu veux y mettre WP_PLANE_NORDOUEST / WP_PLANE_FUGUE / Etc ???

dans ce cas, fais toi simplement une fonction de correspondance qui retourne le tag idoine en fonction de l'int en entree...
Citation :
Provient du message de Dolanor
Je rajoute le code que j'ai modifié car j'ai trouvé certaines incohérences dans le code Olblach. (bien sur je peux me tromper, mais le code marche )

Les probleme/ajouts a regler :

* Le fait que le mage qui a petrifié/Confus a vie enleve les etats speciaux en se reposant. Mais je pense que c limité par le jeu, a moins d'agir par la BDD
*Faire un systeme pour que les waypoint ne soient pas uniquement des waypoint avec des numeros (car on peut ne pas s'y retrouver). Donc scan des waypoint existants commencant par : WP_PLANE_, puis random dans cette liste (mais il me semble que l'on a pas acces aux array, donc ca va etre dur)
[/php]
Pour la dépétrification, c'est expliqué dans le sort de pétrification.
Code PHP:

        // * calculate Duration based on difficulty settings
        
int nGameDiff GetGameDifficulty();
        switch (
nGameDiff)
        {
            case 
GAME_DIFFICULTY_VERY_EASY:
            case 
GAME_DIFFICULTY_EASY:
            case 
GAME_DIFFICULTY_NORMAL:
                    
fDifficulty RoundsToSeconds(nPower); // One Round per hit-die or caster level
                
break;
            case 
GAME_DIFFICULTY_CORE_RULES:
            case 
GAME_DIFFICULTY_DIFFICULT:
                
bShowPopup TRUE;
            break;
        } 
A moins de jouer en mode Règles DD3, l'effet de pétrification n'est pas définitif.
Citation :
Provient du message de eMRaistlin
Tu met l'effet en ExtraordinaryEffect(), et surtout, tu fais en sorte que l'effet ne soit pas appliqué par le mage, genre :

Ceci :
ePrism = ExtraordinaryEffect(EffectPetrify());
eLink = EffectLinkEffects(eDur, ePrism);
eLink = EffectLinkEffects(eLink, eDur2);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget));


Va donner ceci :

Code PHP:

                                                ePrism ExtraordinaryEffect(EffectPetrify());
                        
eLink EffectLinkEffects(eDurePrism);
                        
eLink EffectLinkEffects(eLinkeDur2);
                        
DelayCommand(fDelayAssignCommand(oTargetApplyEffectToObject(DURATION_TYPE_PERMANENTeLinkoTarget))); //C'est ici que j'ai modifié, le principe etant de faire en sorte que ce soit oTarget a l'origine de l'effet qui le paralyse.
//Attention, ce systeme a l'inconvenient de ne pas donner les xps en cas de mort (enfin, si, mais il les donne au mort qui s'est auto-tué, en fait)
//A n'appliquer que dans des effets qui ne tuent pas. 
Bien vu pour le fait de changer le createur de l'effet (rahlala les bidouilles qu'il faut trouver pour faire ca lol ^^)
(extraordinary je l'ai deja mis en fait, ptet pas encore sur le post mais bon )

Citation :
Provient du message de eMRaistlin
Je vois pas pourquoi tu veux des Arrays : WP_PLANE_1 / WP_PLANE_2 /etc, ca t'embete ? tu veux y mettre WP_PLANE_NORDOUEST / WP_PLANE_FUGUE / Etc ???
Oui car un module avec des tag wp_plane_1/2/3 etc, si on bosse a plusieurs dessus, a moins de faire un tableau de comparatif en html etc. Difficile de deviner ou ca amene et ou ca se trouve (car ce waypoint pourrait servir pour une changement de plan par exemple, et la si on met une boite de dialogue par exemple, on va s'amuser pour rechercher dans chaque zone la correspondance des waypoints )

Citation :
Provient du message de eMRaistlin
dans ce cas, fais toi simplement une fonction de correspondance qui retourne le tag idoine en fonction de l'int en entree...
Moi je verrai plutot un scan complet de tous les waypoint commencant par wp_plane_, puis de choisir au hasard dans cette liste. Mais pour cela il me faudrait un array il me semble
M'enfin ce sont encore des détails et c'est plutot pour un monde persistent assez consequent avec assez de wp_plane pour que ca vaille la peine Donc c'est mineur

Citation :
Provient du message de Archamedes_Fr
Pour la dépétrification, c'est expliqué dans le sort de pétrification.
Code PHP:

        // * calculate Duration based on difficulty settings
        
int nGameDiff GetGameDifficulty();
        switch (
nGameDiff)
        {
            case 
GAME_DIFFICULTY_VERY_EASY:
            case 
GAME_DIFFICULTY_EASY:
            case 
GAME_DIFFICULTY_NORMAL:
                    
fDifficulty RoundsToSeconds(nPower); // One Round per hit-die or caster level
                
break;
            case 
GAME_DIFFICULTY_CORE_RULES:
            case 
GAME_DIFFICULTY_DIFFICULT:
                
bShowPopup TRUE;
            break;
        } 
A moins de jouer en mode Règles DD3, l'effet de pétrification n'est pas définitif.
Je n'utilise pas DoPetrifcation de biobio que je trouve sympa pour tous les petits joueurs, mais pas du tout assez D&D style Donc je fais une bonne vieille petrification de derriere les fagots et ca marche (mais apres c une limite du moteur contournable en changeant le createur de l'effet comme indiqué par eMR (d'ailleurs ca vient de m'ouvrir de nouvelles perspectives que j'avais abandonné a cause de ce systeme )
Citation :
Moi je verrai plutot un scan complet de tous les waypoint commencant par wp_plane_, puis de choisir au hasard dans cette liste. Mais pour cela il me faudrait un array il me semble
beuh, tu va perdre en temps machine en prod ce que tu va gagner en temps de programation... c'est jamais bon. vaux mieux perdre du temps en conception a faire un listing des WP puis les gerer facilement en prod avec une fonction dans une bibliotheque devouée
Citation :
Provient du message de eMRaistlin
beuh, tu va perdre en temps machine en prod ce que tu va gagner en temps de programation... c'est jamais bon. vaux mieux perdre du temps en conception a faire un listing des WP puis les gerer facilement en prod avec une fonction dans une bibliotheque devouée
Oui j'ai reflechi au temps machine. Et me suis dit que ct pas une super bonne idée meme si elle etait faisable. Donc un listing de tous les waypoints c mieux. (si encore les maps etaient dynamique, ca se comprendrait, mais comme c compilé ...)
Mais dans tous les cas, garder des noms coherents et pas que des WP_PLANE1 etc
Hop hop
J'ai remis a jour mon code.

Bug corrigés :

* Si lors d'un double touché, le premier rayon etait 1 rayon d'envoi vers un autre plan et le second n'importe quel rayon. Le fait que le 2 eme rayon fasse un effet empechait la teleportation vers un autre plan ( un effet envoi puis effet petrification (meme si la petrification etait loupée) laissait le monstre sur place et la teleportation n'avait pas lieu


Bugs encore presents :
* Effet "permanents" qui s'enlevent apres un sommeil.
J'ai bien testé ta méthode eMR. Mais en fait ca marche pas qd meme. Je pense que pour le moteur du jeu, meme si la personne qui se petrifie elle meme, c'est toi qui lui a donné cet ordre, donc les effets disparaissent : /
J'ai essayé avec un Fake caster qui commandait a la cible de se petrifier, et meme probleme. Et si le fake caster petrifie lui meme la cible, c'est la meme chose
En tout cas dommage, ca m'ote un espoir car je ne vois plus comment faire. Ptet avec des clear actions ou je ne sais, mais ca me semble bancal :'(


[EDIT] Yes ! Probleme contourné
Il suffit de faire un execute script sur le fake caster.
Pour chaque cible on crée/MaJ la localObject du fake caster, puis le fake caster execute un script externe qui fait un ApplyEffectToObject a la cible mis dans le localobject.
Avec ca les golem de chair reste de pierre

Merci pour la piste eMR. Je pense faire un post concernant cette methode pour creer des effet réellement permanents
Répondre

Connectés sur ce fil

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