[7839] Rafactoring player targeting code in chat command and related cleanups/improvments.
* New extractOptFirstArg function for easy get 2 args in case option playe name as first arg.
* New extractPlayerTarget function for get player pointer/guid/name for online/offline player base at provided name
or if not provided by current seelction with error cases processing.
* Property apply mute/unmute in case use different character name from loggined currently for account.
* .reset commands can be used from console now
* .repairitems comamnd can be used from console now but only to online player.
Author: VladimirMangos
--HG--
branch : trunk
This commit is contained in:
1 parent
d2ef2c0500
commit
3569f949d7
16 files changed
+693
-1142
No files matched your search
+13
-4
@@ -1944,6 +1944,8 @@ void SpellMgr::LoadPetLevelupSpellMap()
|
||||
mPetLevelupSpellMap.clear(); // need for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
uint32 family_count = 0;
|
||||
|
||||
for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i)
|
||||
{
|
||||
CreatureFamilyEntry const *creatureFamily = sCreatureFamilyStore.LookupEntry(i);
|
||||
@@ -1968,17 +1970,24 @@ void SpellMgr::LoadPetLevelupSpellMap()
|
||||
continue;
|
||||
|
||||
SpellEntry const *spell = sSpellStore.LookupEntry(skillLine->spellId);
|
||||
// not exist or triggered or talent
|
||||
if(!spell || !spell->spellLevel)
|
||||
if(!spell) // not exist or triggered or talent
|
||||
continue;
|
||||
mPetLevelupSpellMap.insert(PetLevelupSpellMap::value_type(creatureFamily->ID, std::make_pair(spell->spellLevel , spell->Id )));
|
||||
|
||||
if(!spell->spellLevel)
|
||||
continue;
|
||||
|
||||
PetLevelupSpellSet& spellSet = mPetLevelupSpellMap[creatureFamily->ID];
|
||||
if(spellSet.empty())
|
||||
++family_count;
|
||||
|
||||
spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel,spell->Id));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %u pet levelup spells", count );
|
||||
sLog.outString( ">> Loaded %u pet levelup and default spells for %u families", count, family_count );
|
||||
}
|
||||
|
||||
/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc
|
||||
|
||||
Reference in new issue
Block a user