*Some cleanup.
--HG-- branch : trunk
This commit is contained in:
@@ -511,11 +511,11 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
-- For quest The Denouncement and The Restless Dead
|
||||
DELETE FROM `spell_script_target` WHERE `entry` IN (48714,57806);
|
||||
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
('48714', '2', '27237'),
|
||||
('48714', '2', '27235'),
|
||||
('48714', '2', '27234'),
|
||||
('48714', '2', '27236'),
|
||||
('57806', '2', '31043');
|
||||
(48714, 2, 27237),
|
||||
(48714, 2, 27235),
|
||||
(48714, 2, 27234),
|
||||
(48714, 2, 27236),
|
||||
(57806, 2, 31043);
|
||||
|
||||
-- Zul'Drak
|
||||
DELETE FROM `spell_script_target` WHERE `entry` IN (55083,55223,59951,59952);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
bool GossipHello_npc_acherus_taxi(Player *pPlayer, Creature *pCreature)
|
||||
{
|
||||
pPlayer->SetTaxiCheater(true);
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID());
|
||||
return true;
|
||||
@@ -17,13 +16,10 @@ bool GossipSelect_npc_acherus_taxi(Player* pPlayer, Creature* pCreature, uint32
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
if (pPlayer->GetPositionZ() >= 316)
|
||||
{
|
||||
pPlayer->GetSession()->SendDoFlight(24446, 1053);
|
||||
}else{
|
||||
else
|
||||
pPlayer->GetSession()->SendDoFlight(24446, 1054);
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ void Map2ZoneCoordinates(float& x,float& y,uint32 zone)
|
||||
std::swap(x,y); // client have map coords swapped
|
||||
}
|
||||
|
||||
uint32 const* GetTalentTabPages(uint32 cls)
|
||||
uint32 const* GetTalentTabPages(uint8 cls)
|
||||
{
|
||||
return sTalentTabPages[cls];
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT
|
||||
void Zone2MapCoordinates(float &x, float &y, uint32 zone);
|
||||
void Map2ZoneCoordinates(float &x, float &y, uint32 zone);
|
||||
|
||||
uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls);
|
||||
uint32 const* /*[3]*/ GetTalentTabPages(uint8 cls);
|
||||
|
||||
extern DBCStorage <AchievementEntry> sAchievementStore;
|
||||
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||
|
||||
+3
-4
@@ -7326,7 +7326,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
}
|
||||
|
||||
//effect
|
||||
if ((player) && (!(player==m_session->GetPlayer())))
|
||||
if (player && player != m_session->GetPlayer())
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_FREEZE,name.c_str());
|
||||
|
||||
@@ -7370,10 +7370,8 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
{
|
||||
name = player->GetName();
|
||||
}
|
||||
}
|
||||
|
||||
else // if name entered
|
||||
{
|
||||
@@ -7506,7 +7504,8 @@ bool ChatHandler::HandlePossessCommand(const char* args)
|
||||
bool ChatHandler::HandleUnPossessCommand(const char *args)
|
||||
{
|
||||
Unit *pUnit = getSelectedUnit();
|
||||
if(!pUnit) pUnit = m_session->GetPlayer();
|
||||
if (!pUnit)
|
||||
pUnit = m_session->GetPlayer();
|
||||
|
||||
pUnit->RemoveCharmAuras();
|
||||
|
||||
|
||||
+3
-4
@@ -3394,8 +3394,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
return;
|
||||
|
||||
// unlearn non talent higher ranks (recursive)
|
||||
SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id);
|
||||
if (node)
|
||||
if (SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id))
|
||||
{
|
||||
if (HasSpell(node->next) && !GetTalentSpellPos(node->next))
|
||||
removeSpell(node->next,disabled);
|
||||
@@ -3403,7 +3402,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
//unlearn spells dependent from recently removed spells
|
||||
SpellsRequiringSpellMap const& reqMap = spellmgr.GetSpellsRequiringSpell();
|
||||
SpellsRequiringSpellMap::const_iterator itr2 = reqMap.find(spell_id);
|
||||
for (uint32 i=reqMap.count(spell_id); i>0; i--,itr2++)
|
||||
for (uint32 i = reqMap.count(spell_id); i > 0; --i, ++itr2)
|
||||
removeSpell(itr2->second,disabled,false);
|
||||
|
||||
// re-search, it can be corrupted in prev loop
|
||||
@@ -3434,7 +3433,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
RemoveAurasDueToSpell(spell_id);
|
||||
|
||||
// remove pet auras
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (PetAura const* petSpell = spellmgr.GetPetAura(spell_id, i))
|
||||
RemovePetAura(petSpell);
|
||||
|
||||
|
||||
+15
-18
@@ -1946,7 +1946,7 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
}
|
||||
|
||||
/*bool targetfound = false;
|
||||
for (int i = 0; i <3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if( spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
@@ -2025,7 +2025,7 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
continue;
|
||||
|
||||
bool found = false;
|
||||
for (int j = 0; j < 3; ++j)
|
||||
for (uint8 j = 0; j < 3; ++j)
|
||||
{
|
||||
switch (spellInfo->EffectImplicitTargetA[j])
|
||||
{
|
||||
@@ -2099,9 +2099,7 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
|
||||
SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find((spell<<8) + eff);
|
||||
if (itr != mSpellPetAuraMap.end())
|
||||
{
|
||||
itr->second.AddAura(pet, aura);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
|
||||
@@ -2184,7 +2182,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
|
||||
++family_count;
|
||||
|
||||
spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel,spell->Id));
|
||||
count++;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2197,7 +2195,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
{
|
||||
// skip empty list;
|
||||
bool have_spell = false;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
if (petDefSpells.spellid[j])
|
||||
{
|
||||
@@ -2211,7 +2209,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
// remove duplicates with levelupSpells if any
|
||||
if(PetLevelupSpellSet const *levelupSpells = cInfo->family ? spellmgr.GetPetLevelupSpellList(cInfo->family) : NULL)
|
||||
{
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
if(!petDefSpells.spellid[j])
|
||||
continue;
|
||||
@@ -2229,7 +2227,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
|
||||
// skip empty list;
|
||||
have_spell = false;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
if (petDefSpells.spellid[j])
|
||||
{
|
||||
@@ -2262,9 +2260,9 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
if (!spellDataEntry)
|
||||
continue;
|
||||
|
||||
int32 petSpellsId = -(int32)cInfo->PetSpellDataId;
|
||||
int32 petSpellsId = -int32(cInfo->PetSpellDataId);
|
||||
PetDefaultSpellsEntry petDefSpells;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
petDefSpells.spellid[j] = spellDataEntry->spellId[j];
|
||||
|
||||
if(LoadPetDefaultSpells_helper(cInfo, petDefSpells))
|
||||
@@ -2281,7 +2279,7 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
if (!spellEntry)
|
||||
continue;
|
||||
|
||||
for (int k = 0; k < 3; ++k)
|
||||
for (uint8 k = 0; k < 3; ++k)
|
||||
{
|
||||
if (spellEntry->Effect[k] == SPELL_EFFECT_SUMMON || spellEntry->Effect[k] == SPELL_EFFECT_SUMMON_PET)
|
||||
{
|
||||
@@ -2300,7 +2298,7 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
continue;
|
||||
|
||||
PetDefaultSpellsEntry petDefSpells;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
petDefSpells.spellid[j] = cInfo->spells[j];
|
||||
|
||||
if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
|
||||
@@ -2326,7 +2324,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
|
||||
bool need_check_reagents = false;
|
||||
|
||||
// check effects
|
||||
for (int i=0; i<3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
switch (spellInfo->Effect[i])
|
||||
{
|
||||
@@ -2373,7 +2371,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
|
||||
|
||||
if(need_check_reagents)
|
||||
{
|
||||
for (int j = 0; j < 8; ++j)
|
||||
for (uint8 j = 0; j < 8; ++j)
|
||||
{
|
||||
if (spellInfo->Reagent[j] > 0 && !ObjectMgr::GetItemPrototype(spellInfo->Reagent[j]))
|
||||
{
|
||||
@@ -2475,7 +2473,6 @@ void SpellMgr::LoadSpellAreas()
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
|
||||
@@ -2622,7 +2619,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(spellInfo->AreaGroupId);
|
||||
while (groupEntry)
|
||||
{
|
||||
for (uint32 i=0; i<6; ++i)
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id)
|
||||
found = true;
|
||||
if (found || !groupEntry->nextGroup)
|
||||
@@ -2684,7 +2681,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
return zone_id == 4197 || mapEntry->IsBattleGround() && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return zone_id == 4197 || (mapEntry->IsBattleGround() && player && player->InBattleGround()) ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
case 44521: // Preparation
|
||||
{
|
||||
@@ -2730,7 +2727,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
}
|
||||
|
||||
// aura limitations
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
switch (spellInfo->EffectApplyAuraName[i])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user