Aller au contenu

Photo

[AIDE SCRIPT] Taunt pour guerrier mystique


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
algun

algun
  • Members
  • 24 messages
Bonjour,

J'essaye de rendre le taunt du guerrier disponible pour le guerrier mystique et je pense que j'ai un petit problème avec le script
- j'ai bien l'icone du taunt dans la categorie guerrier mystique
- j'ai bien l'effet visuel quand je le cast
- ... ces crétins de mobs m'ignorent royalement et continue de taper sur mes compagnons :(

Si quelqu'un a une idée

#include "log_h"
#include "abi_templates"
#include "combat_h"
#include "talent_constants_h"
#include "achievement_core_h"
#include "ai_threat_h"
#include "spell_constants_h"


void _ApplySpellEffects(struct EventSpellScriptImpactStruct stEvent, object oTarget)
{
    float fScaledValue;
    effect eEffect;

    switch (stEvent.nAbility)
    {
        case ABILITY_TALENT_TAUNT:
        {
            // if hostile
            if (IsObjectHostile(stEvent.oCaster, oTarget) == TRUE)
            {
                float fThreat = TAUNT_THREAT_INCREASE;

                if (HasAbility(stEvent.oCaster, ABILITY_TALENT_FRIGHTENING) == TRUE)
                {
                    fThreat += FRIGHTENING_TAUNT_BONUS;
                }
                SetLocalInt(oTarget, AI_THREAT_TARGET_SWITCH_COUNTER, 0);
                AI_Threat_UpdateCreatureThreat(oTarget, stEvent.oCaster, fThreat);
            }

            break;
        }
    }
}
void _ApplyImpactDamageAndEffects(struct EventSpellScriptImpactStruct stEvent)
{
    // only work for sphere spells
    int nAoEType = GetM2DAInt(TABLE_ABILITIES_SPELLS, "aoe_type", stEvent.nAbility);
    if (nAoEType == 1)
    {
        // location impact vfx
        if (stEvent.oTarget != OBJECT_INVALID)
        {
            stEvent.lTarget = GetLocation(stEvent.oTarget);
        }
        Ability_ApplyLocationImpactVFX(stEvent.nAbility, stEvent.lTarget);

        float fRadius = GetM2DAFloat(TABLE_ABILITIES_SPELLS, "aoe_param1", stEvent.nAbility);

        // get objects in area of effect
        object[] oTargets = GetObjectsInShape(OBJECT_TYPE_CREATURE, SHAPE_SPHERE, stEvent.lTarget, fRadius);

        // spell-specific special events
        switch (stEvent.nAbility)
        {
            case ABILITY_TALENT_WAR_CRY:
            {
                // caster vfx
                effect eEffect = EffectVisualEffect(WAR_CRY_CASTER_VFX);
                ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oCaster, 0.0f, stEvent.oCaster, stEvent.nAbility);

                break;
            }

            case ABILITY_TALENT_CLEANSE_AREA:
            {
                // glyph of paralysis
                object[] oTraps = GetObjectsInShape(OBJECT_TYPE_PLACEABLE, SHAPE_SPHERE, stEvent.lTarget, fRadius);

                int nCount = 0;
                int nMax = GetArraySize(oTraps);
                for (nCount = 0; nCount < nMax; nCount++)
                {
                    #ifdef DEBUG
                    Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, "AoE " + ToString(nCount) + " = " + GetTag(oTraps[nCount]));
                    #endif
                    if (GetTag(oTraps[nCount]) == GLYPH_OF_PARALYSIS_TAG)
                    {
                        DestroyObject(oTraps[nCount]);
                    }
                }

                // normal glyphs
                oTraps = GetObjectsInShape(OBJECT_TYPE_AREAOFEFFECTOBJECT, SHAPE_SPHERE, stEvent.lTarget, fRadius);

                nCount = 0;
                nMax = GetArraySize(oTraps);
                for (nCount = 0; nCount < nMax; nCount++)
                {
                    #ifdef DEBUG
                    Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, "AoE " + ToString(nCount) + " = " + GetTag(oTraps[nCount]));
                    #endif
                    string sTag = GetTag(oTraps[nCount]);
                    if ((sTag == GLYPH_OF_WARDING_TAG) || (sTag == GLYPH_OF_REPULSION_TAG))
                    {
                        DestroyObject(oTraps[nCount]);
                    }
                }

                break;
            }
        }

        // cycle through objects
        int nCount = 0;
        int nMax = GetArraySize(oTargets);
        for (nCount = 0; nCount < nMax; nCount++)
        {
            // per-spell effects
            _ApplySpellEffects(stEvent, oTargets[nCount]);
        }

        // ------------ <Core Achievements Processing> -------------------
        ACH_ProcessAchievementImpactDamageAndEffects(stEvent, oTargets);
        // ------------ <Core Achievements Processing/> -------------------
    }
}

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev); // CAST (directly from engine) or COMMAND_PENDING (re-directed by rules_core)

    switch(nEventType)
    {
        case EVENT_TYPE_SPELLSCRIPT_PENDING:
        {
            // Get a structure with the event parameters
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);

            #ifdef DEBUG
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + ".EVENT_TYPE_SPELLSCRIPT_PENDING", Log_GetAbilityNameById(stEvent.nAbility));
            #endif

            // Setting Return Value
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);

            break;
        }

        case EVENT_TYPE_SPELLSCRIPT_CAST:
        {
            // Get a structure with the event parameters
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);

            #ifdef DEBUG
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + ".EVENT_TYPE_SPELLSCRIPT_CAST",Log_GetAbilityNameById(stEvent.nAbility));
            #endif

            // hand this through to cast_impact
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);

            break;
        }

        case EVENT_TYPE_SPELLSCRIPT_IMPACT:
        {
            // Get a structure with the event parameters
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);

            #ifdef DEBUG
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + ".EVENT_TYPE_SPELLSCRIPT_IMPACT",Log_GetAbilityNameById(stEvent.nAbility));
            #endif

            // AbiAoEImpact(stEvent.lTarget,  stEvent.oCaster, stEvent.nAbility);
            _ApplyImpactDamageAndEffects(stEvent);

            break;
        }
    }
}



#2
algun

algun
  • Members
  • 24 messages
evidement... si je fait des conneries grosses comme des maisons....



ca marche