Jump to content

Brain Link Ulduar Yogg Saron


Guest breakwater

Recommended Posts

Hi all,

I have write a Spellhandling for Brain Link. But I have general problems with Mangos. Thats NO complete patch. Only a discussion about coding.

At first my code

@@ -1852,6 +1854,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
                    break;
                case 28542:                                 // Life Drain
                case 62476:                                 // Icicle (Hodir 10man)
+                case 63802:                                 // Brain Link (Ulduar - Yogg Saron)
                case 66013:                                 // Penetrating Cold (10 man)
                case 68509:                                 // Penetrating Cold (10 man heroic)
                case 69278:                                 // Gas spore - 10
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 7114f3a..94a0021 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -8520,6 +8520,40 @@ void Aura::PeriodicDummyTick()
                        caster->CastCustomSpell(target, 63278, 0, &(spell->EffectBasePoints[0]), 0, false, 0, 0, caster->GetObjectGuid() , spell);
                    return;
                }
+                case 63802:                                 // Brain Link (Ulduar - Yogg Saron)
+                {
+                    Unit* caster = GetCaster();
+
+                    if (!caster || !target)
+                        return;
+                    // only at Player because of perfermonce
+                    if (target->GetTypeId() != TYPEID_PLAYER)
+                        return;
+                    
+                    // only in instance because of perfermonce
+                    if (!(caster->GetMap()->IsDungeon()) || !(target->GetMap()->IsDungeon()))
+                        return;
+
+                    Map::PlayerList const &PlayerList = target->GetMap()->GetPlayers();
+                    if (PlayerList.isEmpty())
+                        return;
+                    // search for partner
+                    for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
+                    {
+                        if (!itr->getSource()->HasAura(63802))
+                            continue;
+                        // no self partnership 
+                        if (itr->getSource()->GetObjectGuid() == target->GetObjectGuid())
+                            continue;
+
+                        if (target->GetDistance2d(itr->getSource()) > 20)
+                            target->CastSpell(itr->getSource(), 63803, true); // damage spell
+                        else
+                            target->CastSpell(itr->getSource(), 63804, true); // optic spell
+                        return;
+                    }
+                    break;
+                }
                case 64161:                                 // Empowered (Ulduar - Yogg Saron)
                {
                    uint8 stacks = 0;

Now my problems: The spell visual works good, but the spell dmg calculation is with real caster (a Player with buffs etc.; calculate spelldamage ...). If I use the original caster ( a mob) the visual effect "fly" from this mob to caster(visual mistake).

An other Problem is: If a Player attack a Player with a spell with Effect SPELL_EFFECT_SCHOOL_DAMAGE, the player is in combat with this player, so the player can not support the other one. That are realy confuse, bad, if the players fight against a boss.

I hope someone can help me.

Link to comment
Share on other sites

if ignore GO casting case:

spell cast function have special originalCasterGuid arg -> who command cast, who provided spellmods if player and etc

caster -> unit that visually cast spell

target -> target of spell

target->cast(target, ... original) is self cast target to target but by command of original caster

last also meaning that LoS calcukated from target to target, so possition original caster not important, just must be at map.

Link to comment
Share on other sites

Now i have this part and i have the discript visual mistake

if (target->GetDistance2d(itr->getSource()) > 20)
                           target->CastSpell(itr->getSource(), 63803, true, 0, 0, caster->GetObjectGuid()); // damage spell
                       else
                           target->CastSpell(itr->getSource(), 63804, true, 0, 0, caster->GetObjectGuid()); // optic spell

target - Player with dummyperiodic aura 63802

caster - Caster which cast the spell 63802 on 2 players and make give aura. Maxtarget from this spell is Two.

(itr->getSource) - Player in Map with has also the aura 63802

My Problem is now, that the spell beam take the way player to mob to other Player Only a visual mistake.

Spell calculation is now RIGHT, the damage make the mob, Players can support themself with heals etc.

I take the GM-command ".cast target 63802" with mob in target.

Link to comment
Share on other sites

×
×
  • 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