Buff players

Sorry about noob topic. If i need buff all players in radius how i can do it?.aura apply it only on your target.Any ideas?

You would need to create a command and handler to do this.

Start by copying the exising “.aura apply” related code in the sources and rename it to something like “.aura applyall”. Then have the handler function iterate through all friendly units within a certain radius of the caster.

If you wanted to make it real fancy you could have the handler do something like “.aura applyall ” where radius is a value for the number of yards:

.aura applyall 10

This way you would be able to vary the distance you have to be from targets.

Another option would be to have the handler filter only units you are grouped with so you wouldn’t need a radius and you wouldn’t have to worry about buffing people that are running past you.

Thanks for answer but i dont know how to make it.Can you put custom script for it?

Compleate now. Can close it

Usually when people write custom code they share it. Just sayin’.

Ok.I just modify standart command .aura in the cs_misc.cpp to this custom code

static bool HandleAuraCommand(ChatHandler* handler, char const* args)
Unit* target = handler->getSelectedUnit();
if (!target)
return false;

    //if(target->GetMapId()==631 && handler->GetSession()->GetSecurity()<=SEC_ADMINISTRATOR)
    //    return false;

    // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
    uint32 spellId = handler->extractSpellIdFromLink((char*)args);

    char const* rradius = strtok(NULL, " ");

    uint32 radius = 0;

    if (rradius)
        radius = strtol(rradius, NULL, 10);

    if(radius > 0)
        std::list<Player*> players;
        Trinity::AnyPlayerInObjectRangeCheck checker(target, radius);
        Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(target, players, checker);
        target->VisitNearbyWorldObject(radius, searcher);

        for (std::list<Player*>::iterator it = players.begin(); it != players.end(); ++it)
            if (Player* pl = (*it))
                target->AddAura(spellId, pl);
        if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
            Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target);

    return true;

Its can work now like .aura 43816 100 (where 43816 id your aura 100 your distance). But if you use .aura when click on the player its work like standart command. Maybe its help some