Jump to content

Lance Rack in Argent Tournament Grounds


Guest brew93

Recommended Posts

When I use the Lance Racks in ATG it does nothing.

The rack uses this spell.

This spell would have to make Alliance Lance for alliance caracters, and Horde Lance for the horde caracters.

With this it works.

void Spell::EffectScriptEffect(uint32 effIndex)
{
   // TODO: we must implement hunter pet summon at login there (spell 6962)


               switch(m_spellInfo->Id)
               {
                       case 63845:                             // Lance Rack 
                       if (Unit* caster = GetCaster())
                       {
                           switch(caster->getRace())
                           {
                               // Alliance Lance
                               case RACE_HUMAN:
                                    m_caster->CastSpell(m_caster, 63914, true);
                                   break;
                               case RACE_DWARF:
                                   m_caster->CastSpell(m_caster, 63914, true);
                                   break;
                               case RACE_NIGHTELF:
                                   m_caster->CastSpell(m_caster, 63914, true);
                                   break;
                               case RACE_GNOME:
                                   m_caster->CastSpell(m_caster, 63914, true);
                                   break;
                               case RACE_DRAENEI:
                                  m_caster->CastSpell(m_caster, 63914, true);
                                   break;

                               // Horde Lance
                               case RACE_ORC:
                                   m_caster->CastSpell(m_caster, 63919, true);
                                   break;
                               case RACE_UNDEAD_PLAYER:
                                   m_caster->CastSpell(m_caster, 63919, true);
                                   break;
                               case RACE_TAUREN:
                                   m_caster->CastSpell(m_caster, 63919, true);
                                   break;
                               case RACE_TROLL:
                                   m_caster->CastSpell(m_caster, 63919, true);
                                   break;
                               case RACE_BLOODELF:
                                   m_caster->CastSpell(m_caster, 63919, true);
                                   break;
                               default:
                                   break;
                           }
                       }
                       return;
               }

(SpellEffects.cpp 4995th line)

Link to comment
Share on other sites

You sure like redundant code xD

Besides the fact that you could simplify that switch statement a lot, why don't you use getTeam() instead?

Just need to make sure you're dealing with a player...but you probably should anyway.

Like:

...
                           switch(caster->getTeam())
                           {
                               // Alliance Lance
                               case ALLIANCE:
                                    m_caster->CastSpell(m_caster, 63914, true);
                                    break;
                               case HORDE:
                                    m_caster->CastSpell(m_caster, 63919, true);
                                    break;
                               default:
                                    break;
                           }
...

Other than that, i haven't really looked into it...

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