Hey, i want to do buff command on my servers. how it works?

gm write .buffall spellID

system message in middle of screen "All players buffed, enjoi"!!

This is scritp form TC i dont know how working on OC, can sameone help me? thanks!

http://prnt.sc/bm2ng9
http://prnt.sc/bm2nj0
http://prnt.sc/bm2nru

Here is the fixed script, but i don't know how to use Aura or AddAura so i used CastSpell

bool ChatHandler::HandleBuffAllCommand(const char* args)
{
    uint32 spellID = extractSpellIdFromLink((char*) args);
    if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellID))
    {
        SessionMap::const_iterator itr;
        for (itr = sWorld.GetAllSessions().begin(); itr != sWorld.GetAllSessions().end(); ++itr)
        {
            if (itr->second &&
                itr->second->GetPlayer() &&
                itr->second->GetPlayer()->IsInWorld())
            {
                if (Player* player = itr->second->GetPlayer())
                {
                    player->CastSpell(player, spellID, true);
                    player->GetSession()->SendNotification("All players buffed, enjoy");
                }
            }
        }
    }
    return true;
}