Jump to content

buff all the server


Guest $hadow $lifer

Recommended Posts

add new command... I think

for(SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
   {
       if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() )
           continue;

    //  itr->second->GetPlayer()->CastSpell(); add spell params first
   }

should be in it...but idk if that thing won't cause lags..

Link to comment
Share on other sites

Here's the current command i use for it:

usage: .castall <spellid>

bool ChatHandler::HandleCastAllCommand(const char* args)
{
   if(!*args)
       return false;

   uint32 spell_id = extractSpellIdFromLink((char*)args);
   if(!spell_id)
       return false;

   SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id);
   if(!spellInfo)
       return false;

   if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer()))
   {
       PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell_id);
       SetSentErrorMessage(true);
       return false;
   }


   HashMapHolder<Player>::MapType &m = HashMapHolder<Player>::GetContainer();
   HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
   for(; itr != m.end(); ++itr)
   {
       if ( (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) )
       {
           itr->second->CastSpell(itr->second, spell_id, true);
       }
   }

   return true;
}

Link to comment
Share on other sites

if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer()))

{

PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell_id);

SetSentErrorMessage(true);

return false;

}

there are two errors:

C:\\SVN\\MaNGOS\\src\\game\\Level1.cpp(2614): error C2653: 'SpellMgr' : is not a class or namespace name

C:\\SVN\\MaNGOS\\src\\game\\Level1.cpp(2614): error C3861: 'IsSpellValid': identifier not found, even with argument-dependent lookup

but, i have removed that' if ',and it works perfectly,thanks!

that 'if' was important if the gm wrong the spell id of cast.

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