Jump to content

megamage

Members
  • Posts

    42
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by megamage

  1. First you may look at Unit::AddAura which checks if there already exists stacking auras. You may add m_stack of the old aura and update modifier and then delete Aur; return false; so the new aura is not added. If multiple stacks from different casters is allowed is also checked there. Now only DoT/HoT is allowed though it is not a correct checking method.

  2. If you go to wowhead to search for spell 27285, you will see a link to youtube in the comments. That video shows how 27285 works in official (players learn it accidentally due to bug). It is like a blizzard or flamestrike spell.

    I do not know if someone who play in official can test this spell. First cast seed of corruption to an enemy, then log out or teleport to another map or kill himself, then another player trigger the proc spell, and see if there is aoe damage.

  3. Why say it is a hack? You can .learn 27285 and will see it is a 50000-yard range spell. There is no proof that this spell should be casted by the m_target of the aura. Though there is also no proof that this shiould be casted by the caster, a 50000-yard range makes it more believable. If this should be casted by the m_target, why a 50000-yard range is needed?

    For implicit target = 22/30 AOE damge spells, I know lots of boss spells are of this kind. Some of them are to give target an aura, to periodically trigger this AOE spell to damage its teammates. Others are triggered by one-shot spells, such as 41131. 41131 is also incorrently handled in core. Now it is:

    unitTarget->CastSpell(unitTarget, 41131, true);

    It should be:

    unitTarget->CastSpell(unitTarget, 41131, true, 0, 0, originalCaster);

    What should be questioned is the current way. There is no proof that we should use originalcaster to select target for some spells, while not use it for other spells. Target selection should totally be based on dbc.

  4. This is the patch for seed (actually it is the 27285 spell I was talking about).

    Index: Unit.cpp
    ===================================================================
    --- Unit.cpp        (revision 6483)
    +++ Unit.cpp        (working copy)
    @@ -4961,7 +4999,8 @@
                                            RemoveAurasDueToSpell(triggeredByAura->GetId());
    
                                            // Cast finish spell (triggeredByAura already not exist!)
    -                                        CastSpell(this, 27285, true, castItem, NULL, casterGuid);
    +                                        if(Unit* caster = GetUnit(*this, casterGuid))
    +                                                caster->CastSpell(this, 27285, true, castItem);
                                            return;
                                    }
    
    @@ -4983,7 +5022,8 @@
                                            RemoveAurasDueToSpell(triggeredByAura->GetId());
    
                                            // Cast finish spell (triggeredByAura already not exist!)
    -                                        CastSpell(this, 32865, true, castItem, NULL, casterGuid);
    +                                        if(Unit* caster = GetUnit(*this, casterGuid))
    +                                                caster->CastSpell(this, 32865, true, castItem);
                                            return;
                                    }
                                    // Damage counting

  5. Some spells make the target do AOE and damage its allies.

    Example such as 39968 and 17739 have implicit_target = friendly target around the caster. If we use the original caster to check the target, the AOE will damage original caster's allies. The target check should be based on the caster, only the damage bonus is based on original caster.

    Another example is 27285. This spell has implicit_target = enemy target in the area. Currently in core this spell is casted by the aura-bearer. That is wrong. This spell should be casted by the original caster, not the aura bearer.

    The difference between 39968 and 27285 is: 39968 is a range = 0 spell, but 27285 is a range = 50000 spell

    The correct cast sequence is:

    39968: A casts 39835 to B, B triggers 39968, then B cast 39968 to itself and damage all B's friend around B.

    27285: A casts 27243 to B, B triggers 27285, then A cast 27285 to B again and damage all A's enemy around B.

    Index: Spell.h
    ===================================================================
    --- Spell.h        (revision 6480)
    +++ Spell.h        (working copy)
    @@ -580,7 +580,7 @@
                            SpellTargets TargetType = SPELL_TARGETS_NOT_FRIENDLY)
                            : i_data(&data), i_spell(spell), i_push_type(type), i_radius(radius), i_TargetType(TargetType)
                    {
    -                        i_originalCaster = spell.GetOriginalCaster();
    +                        i_originalCaster = spell.GetCaster();//spell.GetOriginalCaster();
                    }
    
                    template<class T> inline void Visit(GridRefManager<T>    &m)

  6. Now we can only use CastSpell to a unit target. But some spells should target at the ground, such as spell 41481, 41482 and 40940. Another problem is that if you cast such spells on a unittarget, you may not see the correct spell visual. You may try to learn 40940 and cast it, you will see the visual effect. But if you use .cast to cast it on a unittarget (that is using CastSpell function), you will not see the visual effect.

    The code is simple, only change a few lines of the other CastSpell() function.

    Index: Unit.cpp
    ===================================================================
    --- Unit.cpp        (revision 6477)
    +++ Unit.cpp        (working copy)
    @@ -974,6 +1009,41 @@
            spell->prepare(&targets, triggredByAura);
    }
    
    +void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
    +{
    +        SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
    +
    +        if(!spellInfo)
    +        {
    +                sLog.outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),
    (GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
    +                return;
    +        }
    +
    +        CastSpell(x, y, z,spellInfo,triggered,castItem,triggredByAura, originalCaster);
    +}
    +
    +void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
    +{
    +        if(!spellInfo)
    +        {
    +                sLog.outError("CastSpell: unknown spell by caster: %s %u)", (GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),
    (GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
    +                return;
    +        }
    +
    +        if (castItem)
    +                DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
    +
    +        if(!originalCaster && triggredByAura)
    +                originalCaster = triggredByAura->GetCasterGUID();
    +
    +        Spell *spell = new Spell(this, spellInfo, triggered, originalCaster );
    +
    +        SpellCastTargets targets;
    +        targets.setDestination(x, y, z);
    +        spell->m_CastItem = castItem;
    +        spell->prepare(&targets, triggredByAura);
    +}
    +
    void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster)
    {
            SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
    Index: Unit.h
    ===================================================================
    --- Unit.h        (revision 6477)
    +++ Unit.h        (working copy)
    @@ -892,6 +894,8 @@
                    uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true);
                    void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
                    void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
    +                void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
    +                void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
                    void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
                    void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0);
                    bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;

  7. 37674 is a dummy effect, and 37675 does real damage.

    Index: SpellEffects.cpp
    ===================================================================
    --- SpellEffects.cpp        (revision 6447)
    +++ SpellEffects.cpp        (working copy)
    @@ -940,6 +943,12 @@
                                            m_caster->CastSpell(m_caster,spell_id,true,NULL);
                                            return;
                                    }
    +                                case 37674:                                                                 // Chaos Blast
    +                                {
    +                                        if(unitTarget)
    +                                                m_caster->CastSpell(unitTarget,37675,true);
    +                                        return;
    +                                }
                                    case 29858:                                                                 // Soulshatter
                                    {
                                            if (unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT && unitTarget->IsHostileTo(m_caster))

  8. In instancescript, we need to get worldobject by GUID. But GetUnit and GetGameObject need another worldobject as input param and a initial worldobject is not available in instancescript. This w.o. is only used to compare the map. Can MANGOS provide a function so that we can access w.o. from instancescript? I think we can use map directly as input param.

    Please see discussion here:

    http://forums.scriptdev2.com/index.php?sho...amp;#entry19998

  9. Example: 43149 periodic trigger 43150. 43150 is a target_type 6 spell. In current rev, 43150 will be cast on caster itself, but it is supposed to cast on victim.

    Index: SpellAuras.cpp
    ===================================================================
    --- SpellAuras.cpp        (revision 6412)
    +++ SpellAuras.cpp        (working copy)
    @@ -1200,6 +1200,19 @@
            }
    }
    
    +Unit* Aura::GetTriggerTarget() const
    +{
    +        if(!m_target) return NULL;
    +        uint32 triggeredSpellId = GetSpellProto()->EffectTriggerSpell[m_effIndex];
    +        SpellEntry const* triggredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId);
    +        if (triggredSpellInfo)
    +                for (int i = 0; i < 3; ++i)
    +                        if (GetSpellMaxRange(sSpellRangeStore.LookupEntry(triggredSpellInfo->rangeIndex)))
    +                                return ObjectAccessor::GetUnit(*m_target, m_target->GetTypeId()==TYPEID_PLAYER ? 
    +                                ((Player*)m_target)->GetSelection() : m_target->GetUInt64Value(UNIT_FIELD_TARGET));
    +        return m_target; 
    +}
    +
    void Aura::TriggerSpell()
    {
            Unit* caster = GetCaster();
    Index: SpellAuras.h
    ===================================================================
    --- SpellAuras.h        (revision 6412)
    +++ SpellAuras.h        (working copy)
    @@ -288,7 +288,7 @@
    
                    int32 m_procCharges;
    
    -                virtual Unit* GetTriggerTarget() const { return m_target; }
    +                virtual Unit* GetTriggerTarget() const;
    
                    // add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
                    void HandleShapeshiftBoosts(bool apply);

  10. How to check this bug:

    use spell 17738 or 43648 on a creature. Then you will see the creature has the aura, but you are triggering triggered spells and taken damage.

    Index: SpellAuras.cpp
    ===================================================================
    --- SpellAuras.cpp        (revision 6412)
    +++ SpellAuras.cpp        (working copy)
    @@ -1835,7 +1848,7 @@
                    }
            }
            // All ok cast by default case
    -        Spell *spell = new Spell(caster, triggredSpellInfo, true, originalCasterGUID );
    +        Spell *spell = new Spell(m_target, triggredSpellInfo, true, originalCasterGUID );
    
            SpellCastTargets targets;
            targets.setUnitTarget( target );

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use