[10692] Fixed some GCC warnings and code errors.

Thanks to freghar for provide cleaned list of warning messages.
This commit is contained in:
VladimirMangos 2010-11-07 21:21:53 +03:00
parent 349719e520
commit 10d3d3ce24
33 changed files with 363 additions and 306 deletions

View file

@ -1238,7 +1238,7 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *commandTable, const char
{ {
// command have subcommands, but not '' subcommand and then any data in `command` useless for it. // command have subcommands, but not '' subcommand and then any data in `command` useless for it.
if (cmdName.empty()) if (cmdName.empty())
sLog.outErrorDb("Table `command` have command '%s' that only used with some subcommand selection, it can't have help or overwritten access level, skip.", cmdName.c_str(), fullcommand.c_str()); sLog.outErrorDb("Table `command` have command '%s' that only used with some subcommand selection, it can't have help or overwritten access level, skip.", cmdName.c_str());
else else
sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", cmdName.c_str(), fullcommand.c_str()); sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", cmdName.c_str(), fullcommand.c_str());
return false; return false;
@ -2303,7 +2303,7 @@ char* ChatHandler::ExtractQuotedArg( char** args, bool asis /*= false*/ )
while (*tail && *tail != guard) while (*tail && *tail != guard)
++tail; ++tail;
if (!*tail || tail[1] && !isWhiteSpace(tail[1])) // fail if (!*tail || (tail[1] && !isWhiteSpace(tail[1]))) // fail
return NULL; return NULL;
if (!tail[1]) // quote is last char in string if (!tail[1]) // quote is last char in string
@ -2521,7 +2521,7 @@ char* ChatHandler::ExtractLinkArg(char** args, char const* const* linkTypes /*=
tail += 2; // skip h| tail += 2; // skip h|
// r // r
if (!*tail || *tail != 'r' || *(tail+1) && !isWhiteSpace(*(tail+1))) if (!*tail || *tail != 'r' || (*(tail+1) && !isWhiteSpace(*(tail+1))))
return NULL; return NULL;
++tail; // skip r ++tail; // skip r

View file

@ -864,7 +864,7 @@ void Creature::PrepareBodyLootState()
// have normal loot // have normal loot
if (GetCreatureInfo()->maxgold > 0 || GetCreatureInfo()->lootid || if (GetCreatureInfo()->maxgold > 0 || GetCreatureInfo()->lootid ||
// ... or can have skinning after // ... or can have skinning after
GetCreatureInfo()->SkinLootId && sWorld.getConfig(CONFIG_BOOL_CORPSE_EMPTY_LOOT_SHOW)) (GetCreatureInfo()->SkinLootId && sWorld.getConfig(CONFIG_BOOL_CORPSE_EMPTY_LOOT_SHOW)))
{ {
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
return; return;

View file

@ -540,10 +540,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle);
break; break;
default:
break;
} }
} }
break; break;
} }
default:
break;
} }
break; break;

View file

@ -206,9 +206,10 @@ enum AchievementCriteriaTypes
// 122 // 122
// 123 // 123
// 0..123 => 124 criteria types total // 0..123 => 124 criteria types total
ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124,
}; };
#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 124
enum AreaFlags enum AreaFlags
{ {
AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring) AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring)

View file

@ -189,7 +189,7 @@ bool IsAcceptableClientBuild(uint32 build)
{ {
int accepted_versions[] = EXPECTED_MANGOSD_CLIENT_BUILD; int accepted_versions[] = EXPECTED_MANGOSD_CLIENT_BUILD;
for(int i = 0; accepted_versions[i]; ++i) for(int i = 0; accepted_versions[i]; ++i)
if(build == accepted_versions[i]) if(int(build) == accepted_versions[i])
return true; return true;
return false; return false;

View file

@ -74,7 +74,7 @@ void GMTicketMgr::LoadGMTickets()
delete result; delete result;
sLog.outString(); sLog.outString();
sLog.outString(">> Loaded %d GM tickets", GetTicketCount()); sLog.outString(">> Loaded " SIZEFMTD " GM tickets", GetTicketCount());
} }
void GMTicketMgr::DeleteAll() void GMTicketMgr::DeleteAll()

View file

@ -240,7 +240,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
// can't uninvite yourself // can't uninvite yourself
if (guid == GetPlayer()->GetObjectGuid()) if (guid == GetPlayer()->GetObjectGuid())
{ {
sLog.outError("WorldSession::HandleGroupUninviteGuidOpcode: leader %s tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetObjectGuid().GetString().c_str()); sLog.outError("WorldSession::HandleGroupUninviteGuidOpcode: leader %s tried to uninvite himself from the group.", GetPlayer()->GetObjectGuid().GetString().c_str());
return; return;
} }

View file

@ -991,7 +991,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
bool Item::IsLimitedToAnotherMapOrZone( uint32 cur_mapId, uint32 cur_zoneId) const bool Item::IsLimitedToAnotherMapOrZone( uint32 cur_mapId, uint32 cur_zoneId) const
{ {
ItemPrototype const* proto = GetProto(); ItemPrototype const* proto = GetProto();
return proto && (proto->Map && proto->Map != cur_mapId || proto->Area && proto->Area != cur_zoneId ); return proto && ((proto->Map && proto->Map != cur_mapId) || (proto->Area && proto->Area != cur_zoneId));
} }
// Though the client has the information in the item's data field, // Though the client has the information in the item's data field,

View file

@ -4252,7 +4252,7 @@ bool ChatHandler::HandleEventStartCommand(char* args)
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
if (event_id < 1 || event_id >=(int32)events.size()) if (event_id < 1 || event_id >= events.size())
{ {
SendSysMessage(LANG_EVENT_NOT_EXIST); SendSysMessage(LANG_EVENT_NOT_EXIST);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -4292,7 +4292,7 @@ bool ChatHandler::HandleEventStopCommand(char* args)
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap(); GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
if (event_id < 1 || event_id >=(int32)events.size()) if (event_id < 1 || event_id >= events.size())
{ {
SendSysMessage(LANG_EVENT_NOT_EXIST); SendSysMessage(LANG_EVENT_NOT_EXIST);
SetSentErrorMessage(true); SetSentErrorMessage(true);

View file

@ -416,8 +416,6 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
if (!pItem) if (!pItem)
return; return;
ItemPrototype const* proto = pItem->GetProto();
switch (pItem->loot.loot_type) switch (pItem->loot.loot_type)
{ {
// temporary loot in stacking items, clear loot state, no auto loot move // temporary loot in stacking items, clear loot state, no auto loot move

View file

@ -1171,7 +1171,8 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const
if(GetAreaInfo(x, y, z, mogpFlags, adtId, rootId, groupId)) if(GetAreaInfo(x, y, z, mogpFlags, adtId, rootId, groupId))
{ {
haveAreaInfo = true; haveAreaInfo = true;
if(wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId)) wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
if (wmoEntry)
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId); atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
} }

View file

@ -128,7 +128,7 @@ void MotionMaster::DelayedClean(bool reset, bool all)
else else
m_cleanFlag &= ~MMCF_RESET; m_cleanFlag &= ~MMCF_RESET;
if (empty() || !all && size() == 1) if (empty() || (!all && size() == 1))
return; return;
if (!m_expList) if (!m_expList)

View file

@ -3826,11 +3826,11 @@ void ObjectMgr::LoadQuests()
} }
//check for proper RequiredSkill value (skill case) //check for proper RequiredSkill value (skill case)
if (int32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort))) if (uint32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort)))
{ {
if (qinfo->RequiredSkill != skill_id) if (qinfo->RequiredSkill != skill_id)
{ {
sLog.outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%i).", sLog.outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkill` does not have a corresponding value (%u).",
qinfo->GetQuestId(),qinfo->ZoneOrSort,skill_id); qinfo->GetQuestId(),qinfo->ZoneOrSort,skill_id);
//override, and force proper value here? //override, and force proper value here?
} }
@ -5939,7 +5939,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
// if find graveyard at different map from where entrance placed (or no entrance data), use any first // if find graveyard at different map from where entrance placed (or no entrance data), use any first
if (!mapEntry || if (!mapEntry ||
mapEntry->ghost_entrance_map < 0 || mapEntry->ghost_entrance_map < 0 ||
mapEntry->ghost_entrance_map != entry->map_id || uint32(mapEntry->ghost_entrance_map) != entry->map_id ||
(mapEntry->ghost_entrance_x == 0 && mapEntry->ghost_entrance_y == 0)) (mapEntry->ghost_entrance_x == 0 && mapEntry->ghost_entrance_y == 0))
{ {
// not have any coordinates for check distance anyway // not have any coordinates for check distance anyway
@ -6174,10 +6174,12 @@ void ObjectMgr::LoadAreaTriggerTeleports()
AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 map_id) const AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 map_id) const
{ {
const MapEntry *mapEntry = sMapStore.LookupEntry(map_id); const MapEntry *mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry) return NULL; if (!mapEntry || mapEntry->ghost_entrance_map < 0)
return NULL;
for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); ++itr) for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); ++itr)
{ {
if(itr->second.target_mapId == mapEntry->ghost_entrance_map) if (itr->second.target_mapId == uint32(mapEntry->ghost_entrance_map))
{ {
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
if(atEntry && atEntry->mapid == map_id) if(atEntry && atEntry->mapid == map_id)
@ -8867,8 +8869,6 @@ void ObjectMgr::LoadTrainerSpell()
void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates) void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
{ {
CacheVendorItemMap& vendorList = isTemplates ? m_mCacheVendorTemplateItemMap : m_mCacheVendorItemMap; CacheVendorItemMap& vendorList = isTemplates ? m_mCacheVendorTemplateItemMap : m_mCacheVendorItemMap;
CacheVendorItemMap const* parentList = isTemplates ? NULL : &m_mCacheVendorTemplateItemMap;
// For reload case // For reload case
for (CacheVendorItemMap::iterator itr = vendorList.begin(); itr != vendorList.end(); ++itr) for (CacheVendorItemMap::iterator itr = vendorList.begin(); itr != vendorList.end(); ++itr)
@ -8878,7 +8878,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
std::set<uint32> skip_vendors; std::set<uint32> skip_vendors;
QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM %s", tableName); QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM %s", tableName);
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); barGoLink bar( 1 );
@ -8915,7 +8915,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
delete result; delete result;
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %d vendor items", count); sLog.outString( ">> Loaded %u vendor items", count);
} }

View file

@ -596,7 +596,7 @@ void Pet::Regenerate(Powers power)
// Apply modifiers (if any). // Apply modifiers (if any).
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i) for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == power) if ((*i)->GetModifier()->m_miscvalue == int32(power))
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f; addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
ModifyPower(power, (int32)addvalue); ModifyPower(power, (int32)addvalue);

View file

@ -138,13 +138,13 @@ void PetAI::UpdateAI(const uint32 diff)
Unit* owner = m_creature->GetCharmerOrOwner(); Unit* owner = m_creature->GetCharmerOrOwner();
if(m_updateAlliesTimer <= diff) if (m_updateAlliesTimer <= diff)
// UpdateAllies self set update timer // UpdateAllies self set update timer
UpdateAllies(); UpdateAllies();
else else
m_updateAlliesTimer -= diff; m_updateAlliesTimer -= diff;
if (inCombat && (!m_creature->getVictim() || m_creature->IsPet() && ((Pet*)m_creature)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS)) if (inCombat && (!m_creature->getVictim() || (m_creature->IsPet() && ((Pet*)m_creature)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS)))
_stopAttack(); _stopAttack();
// i_pet.getVictim() can't be used for check in case stop fighting, i_pet.getVictim() clear at Unit death etc. // i_pet.getVictim() can't be used for check in case stop fighting, i_pet.getVictim() clear at Unit death etc.

View file

@ -2140,7 +2140,7 @@ void Player::Regenerate(Powers power, uint32 diff)
uint32 cd_diff = diff; uint32 cd_diff = diff;
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i) for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == power && (*i)->GetMiscBValue()==GetCurrentRune(rune)) if ((*i)->GetModifier()->m_miscvalue == int32(power) && (*i)->GetMiscBValue()==GetCurrentRune(rune))
cd_diff = cd_diff * ((*i)->GetModifier()->m_amount + 100) / 100; cd_diff = cd_diff * ((*i)->GetModifier()->m_amount + 100) / 100;
SetRuneCooldown(rune, (cd < cd_diff) ? 0 : cd - cd_diff); SetRuneCooldown(rune, (cd < cd_diff) ? 0 : cd - cd_diff);
@ -2159,7 +2159,7 @@ void Player::Regenerate(Powers power, uint32 diff)
{ {
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i) for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == power) if ((*i)->GetModifier()->m_miscvalue == int32(power))
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f; addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
} }
@ -3511,8 +3511,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
if (!pSkill) if (!pSkill)
continue; continue;
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && if ((_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL &&
pSkill->categoryId != SKILL_CATEGORY_CLASS ||// not unlearn class skills (spellbook/talent pages) pSkill->categoryId != SKILL_CATEGORY_CLASS) ||// not unlearn class skills (spellbook/talent pages)
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)) ((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0))
{ {
@ -5234,6 +5234,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
ApplyCastTimePercentMod(RatingChange,apply); ApplyCastTimePercentMod(RatingChange,apply);
break; break;
} }
default:
break;
} }
UpdateRating(cr); UpdateRating(cr);
@ -6269,7 +6271,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32
percent += rep > 0 ? repMod : -repMod; percent += rep > 0 ? repMod : -repMod;
float rate = 1.0f; float rate;
switch (source) switch (source)
{ {
case REPUTATION_SOURCE_KILL: case REPUTATION_SOURCE_KILL:
@ -6278,6 +6280,10 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32
case REPUTATION_SOURCE_QUEST: case REPUTATION_SOURCE_QUEST:
rate = sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_QUEST); rate = sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_QUEST);
break; break;
case REPUTATION_SOURCE_SPELL:
default:
rate = 1.0f;
break;
} }
if (rate != 1.0f && creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel())) if (rate != 1.0f && creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))
@ -9446,7 +9452,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// prevent cheating // prevent cheating
if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END || slot >= PLAYER_SLOT_END) if ((slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) || slot >= PLAYER_SLOT_END)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
} }
else else
@ -13242,7 +13248,7 @@ bool Player::IsCurrentQuest( uint32 quest_id ) const
if (itr == mQuestStatus.end()) if (itr == mQuestStatus.end())
return false; return false;
return itr->second.m_status == QUEST_STATUS_INCOMPLETE || itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded; return itr->second.m_status == QUEST_STATUS_INCOMPLETE || (itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded);
} }
Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const *pQuest) Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const *pQuest)
@ -16113,8 +16119,8 @@ void Player::_LoadMailedItems(QueryResult *result)
void Player::_LoadMails(QueryResult *result) void Player::_LoadMails(QueryResult *result)
{ {
m_mail.clear(); m_mail.clear();
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 // 0 1 2 3 4 5 6 7 8 9 10 11 12
//"SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow() //"SELECT id,messageType,sender,receiver,subject,body,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow()
if(!result) if(!result)
return; return;
@ -16128,14 +16134,13 @@ void Player::_LoadMails(QueryResult *result)
m->receiver = fields[3].GetUInt32(); m->receiver = fields[3].GetUInt32();
m->subject = fields[4].GetCppString(); m->subject = fields[4].GetCppString();
m->body = fields[5].GetCppString(); m->body = fields[5].GetCppString();
bool has_items = fields[6].GetBool(); m->expire_time = (time_t)fields[6].GetUInt64();
m->expire_time = (time_t)fields[7].GetUInt64(); m->deliver_time = (time_t)fields[7].GetUInt64();
m->deliver_time = (time_t)fields[8].GetUInt64(); m->money = fields[8].GetUInt32();
m->money = fields[9].GetUInt32(); m->COD = fields[9].GetUInt32();
m->COD = fields[10].GetUInt32(); m->checked = fields[10].GetUInt32();
m->checked = fields[11].GetUInt32(); m->stationery = fields[11].GetUInt8();
m->stationery = fields[12].GetUInt8(); m->mailTemplateId = fields[12].GetInt16();
m->mailTemplateId = fields[13].GetInt16();
if(m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId)) if(m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
{ {
@ -16390,7 +16395,8 @@ void Player::_LoadSpells(QueryResult *result)
// skip talents & drop unneeded data // skip talents & drop unneeded data
if(GetTalentSpellPos(spell_id)) if(GetTalentSpellPos(spell_id))
{ {
sLog.outError("Player::_LoadSpells: Player (GUID: %u) has talent spell in character_spell, removing it.", GetGUIDLow(), spell_id); sLog.outError("Player::_LoadSpells: %s has talent spell %u in character_spell, removing it.",
GetObjectGuid().GetString().c_str(), spell_id);
CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'", spell_id); CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'", spell_id);
continue; continue;
} }
@ -17374,6 +17380,10 @@ void Player::_SaveSkills()
CharacterDatabase.PExecute("UPDATE character_skills SET value = '%u',max = '%u'WHERE guid = '%u' AND skill = '%u' ", CharacterDatabase.PExecute("UPDATE character_skills SET value = '%u',max = '%u'WHERE guid = '%u' AND skill = '%u' ",
value, max, GetGUIDLow(), itr->first ); value, max, GetGUIDLow(), itr->first );
break; break;
case SKILL_UNCHANGED:
case SKILL_DELETED:
MANGOS_ASSERT(false);
break;
}; };
itr->second.uState = SKILL_UNCHANGED; itr->second.uState = SKILL_UNCHANGED;
@ -19003,13 +19013,13 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
// cooldown information stored in item prototype // cooldown information stored in item prototype
// This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client. // This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
if(itemId) if (itemId)
{ {
if(ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId)) if (ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId))
{ {
for(int idx = 0; idx < 5; ++idx) for(int idx = 0; idx < 5; ++idx)
{ {
if(proto->Spells[idx].SpellId == spellInfo->Id) if (proto->Spells[idx].SpellId == spellInfo->Id)
{ {
cat = proto->Spells[idx].SpellCategory; cat = proto->Spells[idx].SpellCategory;
rec = proto->Spells[idx].SpellCooldown; rec = proto->Spells[idx].SpellCooldown;
@ -19021,7 +19031,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
} }
// if no cooldown found above then base at DBC data // if no cooldown found above then base at DBC data
if(rec < 0 && catrec < 0) if (rec < 0 && catrec < 0)
{ {
cat = spellInfo->Category; cat = spellInfo->Category;
rec = spellInfo->RecoveryTime; rec = spellInfo->RecoveryTime;
@ -19034,7 +19044,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
time_t recTime; time_t recTime;
// overwrite time for selected category // overwrite time for selected category
if(infinityCooldown) if (infinityCooldown)
{ {
// use +MONTH as infinity mark for spell cooldown (will checked as MONTH/2 at save ans skipped) // use +MONTH as infinity mark for spell cooldown (will checked as MONTH/2 at save ans skipped)
// but not allow ignore until reset or re-login // but not allow ignore until reset or re-login
@ -19045,14 +19055,14 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
{ {
// shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK) // shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK)
// prevent 0 cooldowns set by another way // prevent 0 cooldowns set by another way
if (rec <= 0 && catrec <= 0 && (cat == 76 || IsAutoRepeatRangedSpell(spellInfo) && spellInfo->Id != SPELL_ID_AUTOSHOT)) if (rec <= 0 && catrec <= 0 && (cat == 76 || (IsAutoRepeatRangedSpell(spellInfo) && spellInfo->Id != SPELL_ID_AUTOSHOT)))
rec = GetAttackTime(RANGED_ATTACK); rec = GetAttackTime(RANGED_ATTACK);
// Now we have cooldown data (if found any), time to apply mods // Now we have cooldown data (if found any), time to apply mods
if(rec > 0) if (rec > 0)
ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell); ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell);
if(catrec > 0) if (catrec > 0)
ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec, spell); ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec, spell);
// replace negative cooldowns by 0 // replace negative cooldowns by 0
@ -19060,7 +19070,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
if (catrec < 0) catrec = 0; if (catrec < 0) catrec = 0;
// no cooldown after applying spell mods // no cooldown after applying spell mods
if( rec == 0 && catrec == 0) if (rec == 0 && catrec == 0)
return; return;
catrecTime = catrec ? curTime+catrec/IN_MILLISECONDS : 0; catrecTime = catrec ? curTime+catrec/IN_MILLISECONDS : 0;
@ -19068,18 +19078,18 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
} }
// self spell cooldown // self spell cooldown
if(recTime > 0) if (recTime > 0)
AddSpellCooldown(spellInfo->Id, itemId, recTime); AddSpellCooldown(spellInfo->Id, itemId, recTime);
// category spells // category spells
if (cat && catrec > 0) if (cat && catrec > 0)
{ {
SpellCategoryStore::const_iterator i_scstore = sSpellCategoryStore.find(cat); SpellCategoryStore::const_iterator i_scstore = sSpellCategoryStore.find(cat);
if(i_scstore != sSpellCategoryStore.end()) if (i_scstore != sSpellCategoryStore.end())
{ {
for(SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset) for(SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset)
{ {
if(*i_scset == spellInfo->Id) // skip main spell, already handled above if (*i_scset == spellInfo->Id) // skip main spell, already handled above
continue; continue;
AddSpellCooldown(*i_scset, itemId, catrecTime); AddSpellCooldown(*i_scset, itemId, catrecTime);
@ -20705,23 +20715,23 @@ void Player::UpdateCorpseReclaimDelay()
void Player::SendCorpseReclaimDelay(bool load) void Player::SendCorpseReclaimDelay(bool load)
{ {
Corpse* corpse = GetCorpse(); Corpse* corpse = GetCorpse();
if(!corpse) if (!corpse)
return; return;
uint32 delay; uint32 delay;
if(load) if (load)
{ {
if(corpse->GetGhostTime() > m_deathExpireTime) if (corpse->GetGhostTime() > m_deathExpireTime)
return; return;
bool pvp = corpse->GetType()==CORPSE_RESURRECTABLE_PVP; bool pvp = corpse->GetType()==CORPSE_RESURRECTABLE_PVP;
uint32 count; uint32 count;
if( pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP) || if ((pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
!pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE) ) (!pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
{ {
count = uint32(m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP; count = uint32(m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
if(count>=MAX_DEATH_COUNT) if (count>=MAX_DEATH_COUNT)
count = MAX_DEATH_COUNT-1; count = MAX_DEATH_COUNT-1;
} }
else else
@ -20730,7 +20740,7 @@ void Player::SendCorpseReclaimDelay(bool load)
time_t expected_time = corpse->GetGhostTime()+copseReclaimDelay[count]; time_t expected_time = corpse->GetGhostTime()+copseReclaimDelay[count];
time_t now = time(NULL); time_t now = time(NULL);
if(now >= expected_time) if (now >= expected_time)
return; return;
delay = uint32(expected_time-now); delay = uint32(expected_time-now);
@ -22457,6 +22467,7 @@ Object* Player::GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask)
case HIGHGUID_TRANSPORT: case HIGHGUID_TRANSPORT:
case HIGHGUID_CORPSE: case HIGHGUID_CORPSE:
case HIGHGUID_MO_TRANSPORT: case HIGHGUID_MO_TRANSPORT:
case HIGHGUID_INSTANCE:
break; break;
} }

View file

@ -281,22 +281,22 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
return; return;
} }
int32 mapid = corpse->GetMapId(); uint32 corpsemapid = corpse->GetMapId();
float x = corpse->GetPositionX(); float x = corpse->GetPositionX();
float y = corpse->GetPositionY(); float y = corpse->GetPositionY();
float z = corpse->GetPositionZ(); float z = corpse->GetPositionZ();
int32 corpsemapid = mapid; int32 mapid = corpsemapid;
// if corpse at different map // if corpse at different map
if(mapid != _player->GetMapId()) if (corpsemapid != _player->GetMapId())
{ {
// search entrance map for proper show entrance // search entrance map for proper show entrance
if(MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapid)) if (MapEntry const* corpseMapEntry = sMapStore.LookupEntry(corpsemapid))
{ {
if(corpseMapEntry->IsDungeon() && corpseMapEntry->ghost_entrance_map >= 0) if (corpseMapEntry->IsDungeon() && corpseMapEntry->ghost_entrance_map >= 0)
{ {
// if corpse map have entrance // if corpse map have entrance
if(Map const* entranceMap = sMapMgr.CreateBaseMap(corpseMapEntry->ghost_entrance_map)) if (Map const* entranceMap = sMapMgr.CreateBaseMap(corpseMapEntry->ghost_entrance_map))
{ {
mapid = corpseMapEntry->ghost_entrance_map; mapid = corpseMapEntry->ghost_entrance_map;
x = corpseMapEntry->ghost_entrance_x; x = corpseMapEntry->ghost_entrance_x;
@ -313,7 +313,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
data << float(x); data << float(x);
data << float(y); data << float(y);
data << float(z); data << float(z);
data << int32(corpsemapid); data << uint32(corpsemapid);
data << uint32(0); // unknown data << uint32(0); // unknown
SendPacket(&data); SendPacket(&data);
} }

View file

@ -242,7 +242,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode( WorldPacket & recv_data )
// Verify that the guid is valid and is a questgiver or involved in the requested quest // Verify that the guid is valid and is a questgiver or involved in the requested quest
Object* pObject = _player->GetObjectByTypeMask(guid, TYPEMASK_CREATURE_GAMEOBJECT_OR_ITEM); Object* pObject = _player->GetObjectByTypeMask(guid, TYPEMASK_CREATURE_GAMEOBJECT_OR_ITEM);
if(!pObject||!pObject->HasQuest(quest) && !pObject->HasInvolvedQuest(quest)) if (!pObject || (!pObject->HasQuest(quest) && !pObject->HasInvolvedQuest(quest)))
{ {
_player->PlayerTalkClass->CloseGossip(); _player->PlayerTalkClass->CloseGossip();
return; return;

View file

@ -4375,10 +4375,11 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_targets.m_targetMask == TARGET_FLAG_SELF && if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
m_spellInfo->EffectImplicitTargetA[EFFECT_INDEX_1] == TARGET_CHAIN_DAMAGE) m_spellInfo->EffectImplicitTargetA[EFFECT_INDEX_1] == TARGET_CHAIN_DAMAGE)
{ {
if (target = m_caster->GetMap()->GetUnit(((Player *)m_caster)->GetSelectionGuid())) target = m_caster->GetMap()->GetUnit(((Player *)m_caster)->GetSelectionGuid());
m_targets.setUnitTarget(target); if (!target)
else
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
m_targets.setUnitTarget(target);
} }
} }
@ -4944,9 +4945,9 @@ SpellCastResult Spell::CheckCast(bool strict)
case SPELL_EFFECT_POWER_DRAIN: case SPELL_EFFECT_POWER_DRAIN:
{ {
// Can be area effect, Check only for players and not check if target - caster (spell can have multiply drain/burn effects) // Can be area effect, Check only for players and not check if target - caster (spell can have multiply drain/burn effects)
if(m_caster->GetTypeId() == TYPEID_PLAYER) if (m_caster->GetTypeId() == TYPEID_PLAYER)
if(Unit* target = m_targets.getUnitTarget()) if (Unit* target = m_targets.getUnitTarget())
if(target != m_caster && target->getPowerType() != m_spellInfo->EffectMiscValue[i]) if (target != m_caster && int32(target->getPowerType()) != m_spellInfo->EffectMiscValue[i])
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
break; break;
} }
@ -6403,7 +6404,7 @@ bool Spell::CheckTarget( Unit* target, SpellEffectIndex eff )
bool Spell::IsNeedSendToClient() const bool Spell::IsNeedSendToClient() const
{ {
return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || IsChanneledSpell(m_spellInfo) || return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || IsChanneledSpell(m_spellInfo) ||
m_spellInfo->speed > 0.0f || !m_triggeredByAuraSpell && !m_IsTriggeredSpell; m_spellInfo->speed > 0.0f || (!m_triggeredByAuraSpell && !m_IsTriggeredSpell);
} }

View file

@ -390,7 +390,7 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
m_applyTime = time(NULL); m_applyTime = time(NULL);
int32 damage; int32 damage;
if(!caster) if (!caster)
{ {
damage = m_currentBasePoints; damage = m_currentBasePoints;
m_maxduration = target->CalculateSpellDuration(spellproto, m_effIndex, target); m_maxduration = target->CalculateSpellDuration(spellproto, m_effIndex, target);
@ -403,34 +403,36 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
if (!damage && castItem && castItem->GetItemSuffixFactor()) if (!damage && castItem && castItem->GetItemSuffixFactor())
{ {
ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId())); ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()));
if(item_rand_suffix) if (item_rand_suffix)
{ {
for (int k = 0; k < 3; ++k) for (int k = 0; k < 3; ++k)
{ {
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]); SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]);
if(pEnchant) if (pEnchant)
{ {
for (int t = 0; t < 3; ++t) for (int t = 0; t < 3; ++t)
if(pEnchant->spellid[t] == spellproto->Id)
{ {
if(pEnchant->spellid[t] != spellproto->Id)
continue;
damage = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000 ); damage = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000 );
break; break;
} }
} }
if(damage) if (damage)
break; break;
} }
} }
} }
} }
if(m_maxduration == -1 || isPassive && spellproto->DurationIndex == 0) if (m_maxduration == -1 || (isPassive && spellproto->DurationIndex == 0))
isPermanent = true; isPermanent = true;
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL; Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
if(!isPermanent && modOwner) if (!isPermanent && modOwner)
{ {
modOwner->ApplySpellMod(spellproto->Id, SPELLMOD_DURATION, m_maxduration); modOwner->ApplySpellMod(spellproto->Id, SPELLMOD_DURATION, m_maxduration);
// Get zero duration aura after - need set m_maxduration > 0 for apply/remove aura work // Get zero duration aura after - need set m_maxduration > 0 for apply/remove aura work
@ -961,7 +963,7 @@ void Aura::ReapplyAffectedPassiveAuras( Unit* target, bool owner_mode )
{ {
// permanent passive or permanent area aura // permanent passive or permanent area aura
// passive spells can be affected only by own or owner spell mods) // passive spells can be affected only by own or owner spell mods)
if (itr->second->IsPermanent() && (owner_mode && itr->second->IsPassive() || itr->second->IsAreaAura()) && if ((itr->second->IsPermanent() && (owner_mode && itr->second->IsPassive() || itr->second->IsAreaAura())) &&
// non deleted and not same aura (any with same spell id) // non deleted and not same aura (any with same spell id)
!itr->second->IsDeleted() && itr->second->GetId() != GetId() && !itr->second->IsDeleted() && itr->second->GetId() != GetId() &&
// and affected by aura // and affected by aura
@ -2903,10 +2905,10 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
uint32 aurMechMask = GetAllSpellMechanicMask(aurSpellInfo); uint32 aurMechMask = GetAllSpellMechanicMask(aurSpellInfo);
// If spell that caused this aura has Croud Control or Daze effect // If spell that caused this aura has Croud Control or Daze effect
if((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) || if ((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
// some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells) // some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells)
aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 && (aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 &&
(aurMechMask & (1 << (MECHANIC_SNARE-1)))==0) (aurMechMask & (1 << (MECHANIC_SNARE-1))) == 0))
{ {
++iter; ++iter;
continue; continue;
@ -3259,7 +3261,7 @@ void Aura::HandleForceReaction(bool apply, bool Real)
player->GetReputationMgr().SendForceReactions(); player->GetReputationMgr().SendForceReactions();
// stop fighting if at apply forced rank friendly or at remove real rank friendly // stop fighting if at apply forced rank friendly or at remove real rank friendly
if (apply && faction_rank >= REP_FRIENDLY || !apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY) if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
player->StopAttackFaction(faction_id); player->StopAttackFaction(faction_id);
} }
@ -3278,16 +3280,16 @@ void Aura::HandleAuraModSkill(bool apply, bool /*Real*/)
void Aura::HandleChannelDeathItem(bool apply, bool Real) void Aura::HandleChannelDeathItem(bool apply, bool Real)
{ {
if(Real && !apply) if (Real && !apply)
{ {
if(m_removeMode != AURA_REMOVE_BY_DEATH) if (m_removeMode != AURA_REMOVE_BY_DEATH)
return; return;
// Item amount // Item amount
if (m_modifier.m_amount <= 0) if (m_modifier.m_amount <= 0)
return; return;
SpellEntry const *spellInfo = GetSpellProto(); SpellEntry const *spellInfo = GetSpellProto();
if(spellInfo->EffectItemType[m_effIndex] == 0) if (spellInfo->EffectItemType[m_effIndex] == 0)
return; return;
Unit* victim = GetTarget(); Unit* victim = GetTarget();
@ -3300,7 +3302,7 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real)
{ {
// Only from non-grey units // Only from non-grey units
if (!((Player*)caster)->isHonorOrXPTarget(victim) || if (!((Player*)caster)->isHonorOrXPTarget(victim) ||
victim->GetTypeId() == TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)) (victim->GetTypeId() == TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)))
return; return;
} }
@ -7798,7 +7800,7 @@ m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
m_isDeathPersist = IsDeathPersistentSpell(m_spellProto); m_isDeathPersist = IsDeathPersistentSpell(m_spellProto);
m_isSingleTarget = IsSingleTargetSpell(spellproto); m_isSingleTarget = IsSingleTargetSpell(spellproto);
if(GetSpellMaxDuration(m_spellProto) == -1 || m_isPassive && m_spellProto->DurationIndex == 0) if (GetSpellMaxDuration(m_spellProto) == -1 || (m_isPassive && m_spellProto->DurationIndex == 0))
m_permanent = true; m_permanent = true;
m_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() && m_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() &&
@ -8091,8 +8093,8 @@ void SpellAuraHolder::CleanupTriggeredSpells()
// needed for spell 43680, maybe others // needed for spell 43680, maybe others
// TODO: is there a spell flag, which can solve this in a more sophisticated way? // TODO: is there a spell flag, which can solve this in a more sophisticated way?
if(m_spellProto->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_TRIGGER_SPELL && if (m_spellProto->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
GetSpellDuration(m_spellProto) == m_spellProto->EffectAmplitude[i]) GetSpellDuration(m_spellProto) == int32(m_spellProto->EffectAmplitude[i]))
continue; continue;
m_target->RemoveAurasDueToSpell(tSpellId); m_target->RemoveAurasDueToSpell(tSpellId);
@ -8313,7 +8315,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
// Ice Barrier (non stacking from one caster) // Ice Barrier (non stacking from one caster)
if (m_spellProto->SpellIconID == 32) if (m_spellProto->SpellIconID == 32)
{ {
if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL || m_removeMode == AURA_REMOVE_BY_SHIELD_BREAK) if ((!apply && m_removeMode == AURA_REMOVE_BY_DISPEL) || m_removeMode == AURA_REMOVE_BY_SHIELD_BREAK)
{ {
Unit::AuraList const& dummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& dummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr) for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
@ -8449,7 +8451,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
{ {
// Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch // Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch
if (m_spellProto->SpellIconID == 234 && m_spellProto->SpellVisual[0] || m_spellProto->SpellIconID == 2213) if ((m_spellProto->SpellIconID == 234 && m_spellProto->SpellVisual[0]) || m_spellProto->SpellIconID == 2213)
{ {
if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL) if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL)
{ {

View file

@ -1641,8 +1641,9 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
m_caster->CastSpell(m_caster, spellID, true, NULL); m_caster->CastSpell(m_caster, spellID, true, NULL);
return; return;
} }
case EFFECT_INDEX_1: case EFFECT_INDEX_1: // additional data for dummy[0]
return; // additional data for dummy[0] case EFFECT_INDEX_2:
return;
} }
return; return;
} }
@ -3807,8 +3808,8 @@ void Spell::EffectOpenLock(SpellEffectIndex eff_idx)
{ {
GameObjectInfo const* goInfo = gameObjTarget->GetGOInfo(); GameObjectInfo const* goInfo = gameObjTarget->GetGOInfo();
// Arathi Basin banner opening ! // Arathi Basin banner opening !
if (goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune || if ((goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune) ||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK) (goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK))
{ {
//CanUseBattleGroundObject() already called in CheckCast() //CanUseBattleGroundObject() already called in CheckCast()
// in battleground check // in battleground check
@ -5831,7 +5832,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
if (const SpellEntry *pSpell = sSpellStore.LookupEntry(m_spellInfo->CalculateSimpleValue(eff_idx))) if (const SpellEntry *pSpell = sSpellStore.LookupEntry(m_spellInfo->CalculateSimpleValue(eff_idx)))
{ {
// if we used item at least once... // if we used item at least once...
if (pTarget->IsTemporarySummon() && pTarget->GetEntry() == pSpell->EffectMiscValue[eff_idx]) if (pTarget->IsTemporarySummon() && int32(pTarget->GetEntry()) == pSpell->EffectMiscValue[eff_idx])
{ {
TemporarySummon* pSummon = (TemporarySummon*)pTarget; TemporarySummon* pSummon = (TemporarySummon*)pTarget;

View file

@ -193,7 +193,7 @@ uint32 GetSpellCastTimeForBonus( SpellEntry const *spellProto, DamageEffectType
for(int j = 0; j < MAX_EFFECT_INDEX; ++j) for(int j = 0; j < MAX_EFFECT_INDEX; ++j)
{ {
if (spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH || if (spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) (spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH))
{ {
CastingTime /= 2; CastingTime /= 2;
break; break;
@ -1018,7 +1018,7 @@ void SpellMgr::LoadSpellTargetPositions()
if (spellInfo->Effect[i]==SPELL_EFFECT_BIND && spellInfo->EffectMiscValue[i]) if (spellInfo->Effect[i]==SPELL_EFFECT_BIND && spellInfo->EffectMiscValue[i])
{ {
uint32 zone_id = sMapMgr.GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); uint32 zone_id = sMapMgr.GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z);
if (zone_id != spellInfo->EffectMiscValue[i]) if (int32(zone_id) != spellInfo->EffectMiscValue[i])
{ {
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], zone_id); sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], zone_id);
break; break;
@ -1742,22 +1742,22 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Soulstone Resurrection and Twisting Nether (resurrector) // Soulstone Resurrection and Twisting Nether (resurrector)
if( spellInfo_1->SpellIconID == 92 && spellInfo_2->SpellIconID == 92 && ( if (spellInfo_1->SpellIconID == 92 && spellInfo_2->SpellIconID == 92 && (
spellInfo_1->SpellVisual[0] == 99 && spellInfo_2->SpellVisual[0] == 0 || (spellInfo_1->SpellVisual[0] == 99 && spellInfo_2->SpellVisual[0] == 0) ||
spellInfo_2->SpellVisual[0] == 99 && spellInfo_1->SpellVisual[0] == 0 ) ) (spellInfo_2->SpellVisual[0] == 99 && spellInfo_1->SpellVisual[0] == 0)))
return false; return false;
// Heart of the Wild, Agility and various Idol Triggers // Heart of the Wild, Agility and various Idol Triggers
if(spellInfo_1->SpellIconID == 240 && spellInfo_2->SpellIconID == 240) if (spellInfo_1->SpellIconID == 240 && spellInfo_2->SpellIconID == 240)
return false; return false;
// Personalized Weather (thunder effect should overwrite rainy aura) // Personalized Weather (thunder effect should overwrite rainy aura)
if(spellInfo_1->SpellIconID == 2606 && spellInfo_2->SpellIconID == 2606) if (spellInfo_1->SpellIconID == 2606 && spellInfo_2->SpellIconID == 2606)
return false; return false;
// Brood Affliction: Bronze // Brood Affliction: Bronze
if( (spellInfo_1->Id == 23170 && spellInfo_2->Id == 23171) || if ((spellInfo_1->Id == 23170 && spellInfo_2->Id == 23171) ||
(spellInfo_2->Id == 23170 && spellInfo_1->Id == 23171) ) (spellInfo_2->Id == 23170 && spellInfo_1->Id == 23171))
return false; return false;
// Cool Down (See PeriodicAuraTick()) // Cool Down (See PeriodicAuraTick())
@ -1766,34 +1766,34 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// See Chapel Invisibility and See Noth Invisibility // See Chapel Invisibility and See Noth Invisibility
if( (spellInfo_1->Id == 52950 && spellInfo_2->Id == 52707) || if ((spellInfo_1->Id == 52950 && spellInfo_2->Id == 52707) ||
(spellInfo_2->Id == 52950 && spellInfo_1->Id == 52707) ) (spellInfo_2->Id == 52950 && spellInfo_1->Id == 52707))
return false; return false;
// Regular and Night Elf Ghost // Regular and Night Elf Ghost
if( (spellInfo_1->Id == 8326 && spellInfo_2->Id == 20584) || if ((spellInfo_1->Id == 8326 && spellInfo_2->Id == 20584) ||
(spellInfo_2->Id == 8326 && spellInfo_1->Id == 20584) ) (spellInfo_2->Id == 8326 && spellInfo_1->Id == 20584))
return false; return false;
// Kindred Spirits // Kindred Spirits
if( spellInfo_1->SpellIconID == 3559 && spellInfo_2->SpellIconID == 3559 ) if (spellInfo_1->SpellIconID == 3559 && spellInfo_2->SpellIconID == 3559)
return false; return false;
break; break;
} }
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
// Arcane Intellect and Insight // Arcane Intellect and Insight
if( spellInfo_2->SpellIconID == 125 && spellInfo_1->Id == 18820 ) if (spellInfo_2->SpellIconID == 125 && spellInfo_1->Id == 18820)
return false; return false;
break; break;
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Scroll of Protection and Defensive Stance (multi-family check) // Scroll of Protection and Defensive Stance (multi-family check)
if( spellInfo_1->SpellIconID == 276 && spellInfo_1->SpellVisual[0] == 196 && spellInfo_2->Id == 71) if (spellInfo_1->SpellIconID == 276 && spellInfo_1->SpellVisual[0] == 196 && spellInfo_2->Id == 71)
return false; return false;
// Improved Hamstring -> Hamstring (multi-family check) // Improved Hamstring -> Hamstring (multi-family check)
if( (spellInfo_2->SpellFamilyFlags & UI64LIT(0x2)) && spellInfo_1->Id == 23694 ) if ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x2)) && spellInfo_1->Id == 23694)
return false; return false;
break; break;
@ -1801,11 +1801,11 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
{ {
// Scroll of Stamina and Leader of the Pack (multi-family check) // Scroll of Stamina and Leader of the Pack (multi-family check)
if( spellInfo_1->SpellIconID == 312 && spellInfo_1->SpellVisual[0] == 216 && spellInfo_2->Id == 24932 ) if (spellInfo_1->SpellIconID == 312 && spellInfo_1->SpellVisual[0] == 216 && spellInfo_2->Id == 24932)
return false; return false;
// Dragonmaw Illusion (multi-family check) // Dragonmaw Illusion (multi-family check)
if (spellId_1 == 40216 && spellId_2 == 42016 ) if (spellId_1 == 40216 && spellId_2 == 42016)
return false; return false;
break; break;
@ -1813,7 +1813,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
{ {
// Garrote-Silence -> Garrote (multi-family check) // Garrote-Silence -> Garrote (multi-family check)
if( spellInfo_1->SpellIconID == 498 && spellInfo_1->SpellVisual[0] == 0 && spellInfo_2->SpellIconID == 498 ) if (spellInfo_1->SpellIconID == 498 && spellInfo_1->SpellVisual[0] == 0 && spellInfo_2->SpellIconID == 498)
return false; return false;
break; break;
@ -1821,22 +1821,22 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
{ {
// Concussive Shot and Imp. Concussive Shot (multi-family check) // Concussive Shot and Imp. Concussive Shot (multi-family check)
if( spellInfo_1->Id == 19410 && spellInfo_2->Id == 5116 ) if (spellInfo_1->Id == 19410 && spellInfo_2->Id == 5116)
return false; return false;
// Improved Wing Clip -> Wing Clip (multi-family check) // Improved Wing Clip -> Wing Clip (multi-family check)
if( (spellInfo_2->SpellFamilyFlags & UI64LIT(0x40)) && spellInfo_1->Id == 19229 ) if ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x40)) && spellInfo_1->Id == 19229)
return false; return false;
break; break;
} }
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
// Unstable Currents and other -> *Sanctity Aura (multi-family check) // Unstable Currents and other -> *Sanctity Aura (multi-family check)
if( spellInfo_2->SpellIconID==502 && spellInfo_1->SpellIconID==502 && spellInfo_1->SpellVisual[0]==969 ) if (spellInfo_2->SpellIconID==502 && spellInfo_1->SpellIconID==502 && spellInfo_1->SpellVisual[0]==969)
return false; return false;
// *Band of Eternal Champion and Seal of Command(multi-family check) // *Band of Eternal Champion and Seal of Command(multi-family check)
if( spellId_1 == 35081 && spellInfo_2->SpellIconID==561 && spellInfo_2->SpellVisual[0]==7992) if (spellId_1 == 35081 && spellInfo_2->SpellIconID==561 && spellInfo_2->SpellVisual[0]==7992)
return false; return false;
// Blessing of Sanctuary (multi-family check, some from 16 spell icon spells) // Blessing of Sanctuary (multi-family check, some from 16 spell icon spells)
@ -1854,60 +1854,60 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_MAGE ) if( spellInfo_2->SpellFamilyName == SPELLFAMILY_MAGE )
{ {
// Blizzard & Chilled (and some other stacked with blizzard spells // Blizzard & Chilled (and some other stacked with blizzard spells
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x100000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x100000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x100000)) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x100000))))
return false; return false;
// Blink & Improved Blink // Blink & Improved Blink
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499)) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499)))
return false; return false;
// Living Bomb & Ignite (Dots) // Living Bomb & Ignite (Dots)
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000000)) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000000))))
return false; return false;
// Fireball & Pyroblast (Dots) // Fireball & Pyroblast (Dots)
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x400000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x400000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x400000)) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x400000))))
return false; return false;
} }
// Detect Invisibility and Mana Shield (multi-family check) // Detect Invisibility and Mana Shield (multi-family check)
if( spellInfo_2->Id == 132 && spellInfo_1->SpellIconID == 209 && spellInfo_1->SpellVisual[0] == 968 ) if (spellInfo_2->Id == 132 && spellInfo_1->SpellIconID == 209 && spellInfo_1->SpellVisual[0] == 968)
return false; return false;
// Combustion and Fire Protection Aura (multi-family check) // Combustion and Fire Protection Aura (multi-family check)
if( spellInfo_1->Id == 11129 && spellInfo_2->SpellIconID == 33 && spellInfo_2->SpellVisual[0] == 321 ) if (spellInfo_1->Id == 11129 && spellInfo_2->SpellIconID == 33 && spellInfo_2->SpellVisual[0] == 321)
return false; return false;
// Arcane Intellect and Insight // Arcane Intellect and Insight
if( spellInfo_1->SpellIconID == 125 && spellInfo_2->Id == 18820 ) if (spellInfo_1->SpellIconID == 125 && spellInfo_2->Id == 18820)
return false; return false;
break; break;
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_WARLOCK ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_WARLOCK)
{ {
// Siphon Life and Drain Life // Siphon Life and Drain Life
if( spellInfo_1->SpellIconID == 152 && spellInfo_2->SpellIconID == 546 || if ((spellInfo_1->SpellIconID == 152 && spellInfo_2->SpellIconID == 546) ||
spellInfo_2->SpellIconID == 152 && spellInfo_1->SpellIconID == 546 ) (spellInfo_2->SpellIconID == 152 && spellInfo_1->SpellIconID == 546))
return false; return false;
//Corruption & Seed of corruption //Corruption & Seed of corruption
if( spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 1932 || if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 1932) ||
spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 1932 ) (spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 1932))
if(spellInfo_1->SpellVisual[0] != 0 && spellInfo_2->SpellVisual[0] != 0) if(spellInfo_1->SpellVisual[0] != 0 && spellInfo_2->SpellVisual[0] != 0)
return true; // can't be stacked return true; // can't be stacked
// Corruption and Unstable Affliction // Corruption and Unstable Affliction
if( spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 2039 || if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 2039) ||
spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 2039 ) (spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 2039))
return false; return false;
// (Corruption or Unstable Affliction) and (Curse of Agony or Curse of Doom) // (Corruption or Unstable Affliction) and (Curse of Agony or Curse of Doom)
if( (spellInfo_1->SpellIconID == 313 || spellInfo_1->SpellIconID == 2039) && (spellInfo_2->SpellIconID == 544 || spellInfo_2->SpellIconID == 91) || if (((spellInfo_1->SpellIconID == 313 || spellInfo_1->SpellIconID == 2039) && (spellInfo_2->SpellIconID == 544 || spellInfo_2->SpellIconID == 91)) ||
(spellInfo_2->SpellIconID == 313 || spellInfo_2->SpellIconID == 2039) && (spellInfo_1->SpellIconID == 544 || spellInfo_1->SpellIconID == 91) ) ((spellInfo_2->SpellIconID == 313 || spellInfo_2->SpellIconID == 2039) && (spellInfo_1->SpellIconID == 544 || spellInfo_1->SpellIconID == 91)))
return false; return false;
// Metamorphosis, diff effects // Metamorphosis, diff effects
@ -1915,47 +1915,47 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
} }
// Detect Invisibility and Mana Shield (multi-family check) // Detect Invisibility and Mana Shield (multi-family check)
if( spellInfo_1->Id == 132 && spellInfo_2->SpellIconID == 209 && spellInfo_2->SpellVisual[0] == 968 ) if (spellInfo_1->Id == 132 && spellInfo_2->SpellIconID == 209 && spellInfo_2->SpellVisual[0] == 968)
return false; return false;
break; break;
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_WARRIOR ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_WARRIOR)
{ {
// Rend and Deep Wound // Rend and Deep Wound
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x1000000000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x1000000000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1000000000)) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1000000000))))
return false; return false;
// Battle Shout and Rampage // Battle Shout and Rampage
if( (spellInfo_1->SpellIconID == 456 && spellInfo_2->SpellIconID == 2006) || if ((spellInfo_1->SpellIconID == 456 && spellInfo_2->SpellIconID == 2006) ||
(spellInfo_2->SpellIconID == 456 && spellInfo_1->SpellIconID == 2006) ) (spellInfo_2->SpellIconID == 456 && spellInfo_1->SpellIconID == 2006))
return false; return false;
} }
// Hamstring -> Improved Hamstring (multi-family check) // Hamstring -> Improved Hamstring (multi-family check)
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x2)) && spellInfo_2->Id == 23694 ) if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2)) && spellInfo_2->Id == 23694)
return false; return false;
// Defensive Stance and Scroll of Protection (multi-family check) // Defensive Stance and Scroll of Protection (multi-family check)
if( spellInfo_1->Id == 71 && spellInfo_2->SpellIconID == 276 && spellInfo_2->SpellVisual[0] == 196 ) if (spellInfo_1->Id == 71 && spellInfo_2->SpellIconID == 276 && spellInfo_2->SpellVisual[0] == 196)
return false; return false;
// Bloodlust and Bloodthirst (multi-family check) // Bloodlust and Bloodthirst (multi-family check)
if( spellInfo_2->Id == 2825 && spellInfo_1->SpellIconID == 38 && spellInfo_1->SpellVisual[0] == 0 ) if (spellInfo_2->Id == 2825 && spellInfo_1->SpellIconID == 38 && spellInfo_1->SpellVisual[0] == 0)
return false; return false;
break; break;
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_PRIEST ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_PRIEST)
{ {
//Devouring Plague and Shadow Vulnerability //Devouring Plague and Shadow Vulnerability
if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x800000000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x800000000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x800000000))) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x800000000))))
return false; return false;
//StarShards and Shadow Word: Pain //StarShards and Shadow Word: Pain
if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000))) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000))))
return false; return false;
// Dispersion // Dispersion
if ((spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) || if ((spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) ||
@ -1964,11 +1964,11 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
} }
break; break;
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_DRUID ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_DRUID)
{ {
//Omen of Clarity and Blood Frenzy //Omen of Clarity and Blood Frenzy
if( (spellInfo_1->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_1->SpellIconID == 108) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000000)) || if (((spellInfo_1->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_1->SpellIconID == 108) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000000))) ||
(spellInfo_2->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_2->SpellIconID == 108) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000000)) ) ((spellInfo_2->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_2->SpellIconID == 108) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000000))))
return false; return false;
// Tree of Life (Shapeshift) and 34123 Tree of Life (Passive) // Tree of Life (Shapeshift) and 34123 Tree of Life (Passive)
@ -1977,8 +1977,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Lifebloom and Wild Growth // Lifebloom and Wild Growth
if (spellInfo_1->SpellIconID == 2101 && spellInfo_2->SpellIconID == 2864 || if ((spellInfo_1->SpellIconID == 2101 && spellInfo_2->SpellIconID == 2864) ||
spellInfo_2->SpellIconID == 2101 && spellInfo_1->SpellIconID == 2864 ) (spellInfo_2->SpellIconID == 2101 && spellInfo_1->SpellIconID == 2864))
return false; return false;
// Innervate and Glyph of Innervate and some other spells // Innervate and Glyph of Innervate and some other spells
@ -1986,19 +1986,23 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Wrath of Elune and Nature's Grace // Wrath of Elune and Nature's Grace
if( spellInfo_1->Id == 16886 && spellInfo_2->Id == 46833 || spellInfo_2->Id == 16886 && spellInfo_1->Id == 46833 ) if ((spellInfo_1->Id == 16886 && spellInfo_2->Id == 46833) ||
(spellInfo_2->Id == 16886 && spellInfo_1->Id == 46833))
return false; return false;
// Bear Rage (Feral T4 (2)) and Omen of Clarity // Bear Rage (Feral T4 (2)) and Omen of Clarity
if( spellInfo_1->Id == 16864 && spellInfo_2->Id == 37306 || spellInfo_2->Id == 16864 && spellInfo_1->Id == 37306 ) if ((spellInfo_1->Id == 16864 && spellInfo_2->Id == 37306) ||
(spellInfo_2->Id == 16864 && spellInfo_1->Id == 37306))
return false; return false;
// Cat Energy (Feral T4 (2)) and Omen of Clarity // Cat Energy (Feral T4 (2)) and Omen of Clarity
if( spellInfo_1->Id == 16864 && spellInfo_2->Id == 37311 || spellInfo_2->Id == 16864 && spellInfo_1->Id == 37311 ) if ((spellInfo_1->Id == 16864 && spellInfo_2->Id == 37311) ||
(spellInfo_2->Id == 16864 && spellInfo_1->Id == 37311))
return false; return false;
// Survival Instincts and Survival Instincts // Survival Instincts and Survival Instincts
if( spellInfo_1->Id == 61336 && spellInfo_2->Id == 50322 || spellInfo_2->Id == 61336 && spellInfo_1->Id == 50322 ) if ((spellInfo_1->Id == 61336 && spellInfo_2->Id == 50322) ||
(spellInfo_2->Id == 61336 && spellInfo_1->Id == 50322))
return false; return false;
// Savage Roar and Savage Roar (triggered) // Savage Roar and Savage Roar (triggered)
@ -2006,12 +2010,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Frenzied Regeneration and Savage Defense // Frenzied Regeneration and Savage Defense
if( spellInfo_1->Id == 22842 && spellInfo_2->Id == 62606 || spellInfo_2->Id == 22842 && spellInfo_1->Id == 62606 ) if ((spellInfo_1->Id == 22842 && spellInfo_2->Id == 62606) ||
(spellInfo_2->Id == 22842 && spellInfo_1->Id == 62606))
return false; return false;
} }
// Leader of the Pack and Scroll of Stamina (multi-family check) // Leader of the Pack and Scroll of Stamina (multi-family check)
if( spellInfo_1->Id == 24932 && spellInfo_2->SpellIconID == 312 && spellInfo_2->SpellVisual[0] == 216 ) if (spellInfo_1->Id == 24932 && spellInfo_2->SpellIconID == 312 && spellInfo_2->SpellVisual[0] == 216)
return false; return false;
// Dragonmaw Illusion (multi-family check) // Dragonmaw Illusion (multi-family check)
@ -2020,63 +2025,64 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
break; break;
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_ROGUE ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_ROGUE)
{ {
// Master of Subtlety // Master of Subtlety
if (spellId_1 == 31665 && spellId_2 == 31666 || spellId_1 == 31666 && spellId_2 == 31665 ) if ((spellId_1 == 31665 && spellId_2 == 31666) ||
(spellId_1 == 31666 && spellId_2 == 31665))
return false; return false;
// Sprint & Sprint (waterwalk) // Sprint & Sprint (waterwalk)
if( spellInfo_1->SpellIconID == 516 && spellInfo_2->SpellIconID == 516 && if (spellInfo_1->SpellIconID == 516 && spellInfo_2->SpellIconID == 516 &&
(spellInfo_1->Category == 44 && spellInfo_2->Category == 0 || ((spellInfo_1->Category == 44 && spellInfo_2->Category == 0) ||
spellInfo_2->Category == 44 && spellInfo_1->Category == 0)) (spellInfo_2->Category == 44 && spellInfo_1->Category == 0)))
return false; return false;
} }
//Overkill //Overkill
if( spellInfo_1->SpellIconID == 2285 && spellInfo_2->SpellIconID == 2285 ) if (spellInfo_1->SpellIconID == 2285 && spellInfo_2->SpellIconID == 2285)
return false; return false;
// Garrote -> Garrote-Silence (multi-family check) // Garrote -> Garrote-Silence (multi-family check)
if( spellInfo_1->SpellIconID == 498 && spellInfo_2->SpellIconID == 498 && spellInfo_2->SpellVisual[0] == 0 ) if (spellInfo_1->SpellIconID == 498 && spellInfo_2->SpellIconID == 498 && spellInfo_2->SpellVisual[0] == 0)
return false; return false;
break; break;
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_HUNTER ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_HUNTER)
{ {
// Rapid Fire & Quick Shots // Rapid Fire & Quick Shots
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000)) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000))) )
return false; return false;
// Serpent Sting & (Immolation/Explosive Trap Effect) // Serpent Sting & (Immolation/Explosive Trap Effect)
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x00000004000)) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x00000004000))) ||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000)) ) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000))))
return false; return false;
// Bestial Wrath // Bestial Wrath
if( spellInfo_1->SpellIconID == 1680 && spellInfo_2->SpellIconID == 1680 ) if (spellInfo_1->SpellIconID == 1680 && spellInfo_2->SpellIconID == 1680)
return false; return false;
} }
// Wing Clip -> Improved Wing Clip (multi-family check) // Wing Clip -> Improved Wing Clip (multi-family check)
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x40)) && spellInfo_2->Id == 19229 ) if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x40)) && spellInfo_2->Id == 19229)
return false; return false;
// Concussive Shot and Imp. Concussive Shot (multi-family check) // Concussive Shot and Imp. Concussive Shot (multi-family check)
if( spellInfo_2->Id == 19410 && spellInfo_1->Id == 5116 ) if (spellInfo_2->Id == 19410 && spellInfo_1->Id == 5116)
return false; return false;
break; break;
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_PALADIN ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_PALADIN)
{ {
// Paladin Seals // Paladin Seals
if (IsSealSpell(spellInfo_1) && IsSealSpell(spellInfo_2)) if (IsSealSpell(spellInfo_1) && IsSealSpell(spellInfo_2))
return true; return true;
// Swift Retribution / Improved Devotion Aura (talents) and Paladin Auras // Swift Retribution / Improved Devotion Aura (talents) and Paladin Auras
if ((spellInfo_1->SpellFamilyFlags2 & 0x00000020) && (spellInfo_2->SpellIconID == 291 || spellInfo_2->SpellIconID == 3028) || if (((spellInfo_1->SpellFamilyFlags2 & 0x00000020) && (spellInfo_2->SpellIconID == 291 || spellInfo_2->SpellIconID == 3028)) ||
(spellInfo_2->SpellFamilyFlags2 & 0x00000020) && (spellInfo_1->SpellIconID == 291 || spellInfo_1->SpellIconID == 3028)) ((spellInfo_2->SpellFamilyFlags2 & 0x00000020) && (spellInfo_1->SpellIconID == 291 || spellInfo_1->SpellIconID == 3028)))
return false; return false;
// Beacon of Light and Light's Beacon // Beacon of Light and Light's Beacon
@ -2101,23 +2107,23 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Combustion and Fire Protection Aura (multi-family check) // Combustion and Fire Protection Aura (multi-family check)
if( spellInfo_2->Id == 11129 && spellInfo_1->SpellIconID == 33 && spellInfo_1->SpellVisual[0] == 321 ) if (spellInfo_2->Id == 11129 && spellInfo_1->SpellIconID == 33 && spellInfo_1->SpellVisual[0] == 321)
return false; return false;
// *Sanctity Aura -> Unstable Currents and other (multi-family check) // *Sanctity Aura -> Unstable Currents and other (multi-family check)
if( spellInfo_1->SpellIconID==502 && spellInfo_2->SpellFamilyName == SPELLFAMILY_GENERIC && spellInfo_2->SpellIconID==502 && spellInfo_2->SpellVisual[0]==969 ) if (spellInfo_1->SpellIconID==502 && spellInfo_2->SpellFamilyName == SPELLFAMILY_GENERIC && spellInfo_2->SpellIconID==502 && spellInfo_2->SpellVisual[0]==969)
return false; return false;
// *Seal of Command and Band of Eternal Champion (multi-family check) // *Seal of Command and Band of Eternal Champion (multi-family check)
if( spellInfo_1->SpellIconID==561 && spellInfo_1->SpellVisual[0]==7992 && spellId_2 == 35081) if (spellInfo_1->SpellIconID==561 && spellInfo_1->SpellVisual[0]==7992 && spellId_2 == 35081)
return false; return false;
break; break;
case SPELLFAMILY_SHAMAN: case SPELLFAMILY_SHAMAN:
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_SHAMAN ) if (spellInfo_2->SpellFamilyName == SPELLFAMILY_SHAMAN)
{ {
// Windfury weapon // Windfury weapon
if( spellInfo_1->SpellIconID==220 && spellInfo_2->SpellIconID==220 && if (spellInfo_1->SpellIconID==220 && spellInfo_2->SpellIconID==220 &&
spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags ) spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)
return false; return false;
// Ghost Wolf // Ghost Wolf
@ -2129,7 +2135,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
} }
// Bloodlust and Bloodthirst (multi-family check) // Bloodlust and Bloodthirst (multi-family check)
if( spellInfo_1->Id == 2825 && spellInfo_2->SpellIconID == 38 && spellInfo_2->SpellVisual[0] == 0 ) if (spellInfo_1->Id == 2825 && spellInfo_2->SpellIconID == 38 && spellInfo_2->SpellVisual[0] == 0)
return false; return false;
break; break;
case SPELLFAMILY_DEATHKNIGHT: case SPELLFAMILY_DEATHKNIGHT:
@ -2187,13 +2193,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
for (int i = 0; i < MAX_EFFECT_INDEX; ++i) for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{ {
if (spellInfo_1->Effect[i] != spellInfo_2->Effect[i] || if (spellInfo_1->Effect[i] != spellInfo_2->Effect[i] ||
spellInfo_1->EffectItemType[i] != spellInfo_2->EffectItemType[i] || spellInfo_1->EffectItemType[i] != spellInfo_2->EffectItemType[i] ||
spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i] || spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i] ||
spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]) spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i])
return false; return false;
// ignore dummy only spells // ignore dummy only spells
if(spellInfo_1->Effect[i] && spellInfo_1->Effect[i] != SPELL_EFFECT_DUMMY && spellInfo_1->EffectApplyAuraName[i] != SPELL_AURA_DUMMY) if (spellInfo_1->Effect[i] && spellInfo_1->Effect[i] != SPELL_EFFECT_DUMMY && spellInfo_1->EffectApplyAuraName[i] != SPELL_AURA_DUMMY)
dummy_only = false; dummy_only = false;
} }
if (dummy_only) if (dummy_only)
@ -3505,27 +3511,27 @@ void SpellMgr::LoadSpellAreas()
continue; continue;
} }
if(abs(spellArea.auraSpell)==spellArea.spellId) if(uint32(abs(spellArea.auraSpell))==spellArea.spellId)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell,abs(spellArea.auraSpell)); sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
continue; continue;
} }
// not allow autocast chains by auraSpell field (but allow use as alternative if not present) // not allow autocast chains by auraSpell field (but allow use as alternative if not present)
if(spellArea.autocast && spellArea.auraSpell > 0) if (spellArea.autocast && spellArea.auraSpell > 0)
{ {
bool chain = false; bool chain = false;
SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId); SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId);
for(SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr) for(SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
{ {
if(itr->second->autocast && itr->second->auraSpell > 0) if (itr->second->autocast && itr->second->auraSpell > 0)
{ {
chain = true; chain = true;
break; break;
} }
} }
if(chain) if (chain)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell);
continue; continue;
@ -3534,7 +3540,7 @@ void SpellMgr::LoadSpellAreas()
SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell); SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell);
for(SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2) for(SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
{ {
if(itr2->second.autocast && itr2->second.auraSpell > 0) if (itr2->second.autocast && itr2->second.auraSpell > 0)
{ {
chain = true; chain = true;
break; break;
@ -3807,7 +3813,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
} }
// TODO: for spellCategory better check need dbc loading // TODO: for spellCategory better check need dbc loading
if (category < -1 || category >=0 && sSpellCategoryStore.find(category) == sSpellCategoryStore.end()) if (category < -1 || (category >=0 && sSpellCategoryStore.find(category) == sSpellCategoryStore.end()))
{ {
sLog.outError("Table '%s' for spell %u have wrong SpellCategory value(%u), skipped.",table,spell,category); sLog.outError("Table '%s' for spell %u have wrong SpellCategory value(%u), skipped.",table,spell,category);
continue; continue;
@ -3844,7 +3850,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
continue; continue;
} }
if(family >= 0 && spellEntry->SpellFamilyName != family) if (family >= 0 && spellEntry->SpellFamilyName != uint32(family))
{ {
sLog.outError("Spell %u '%s' family(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellFamilyName,family,code.c_str()); sLog.outError("Spell %u '%s' family(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellFamilyName,family,code.c_str());
continue; continue;
@ -3873,19 +3879,19 @@ void SpellMgr::CheckUsedSpells(char const* table)
} }
} }
if(spellIcon >= 0 && spellEntry->SpellIconID != spellIcon) if (spellIcon >= 0 && spellEntry->SpellIconID != uint32(spellIcon))
{ {
sLog.outError("Spell %u '%s' icon(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellIconID,spellIcon,code.c_str()); sLog.outError("Spell %u '%s' icon(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellIconID,spellIcon,code.c_str());
continue; continue;
} }
if(spellVisual >= 0 && spellEntry->SpellVisual[0] != spellVisual) if (spellVisual >= 0 && spellEntry->SpellVisual[0] != uint32(spellVisual))
{ {
sLog.outError("Spell %u '%s' visual(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellVisual[0],spellVisual,code.c_str()); sLog.outError("Spell %u '%s' visual(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->SpellVisual[0],spellVisual,code.c_str());
continue; continue;
} }
if(category >= 0 && spellEntry->Category != category) if (category >= 0 && spellEntry->Category != uint32(category))
{ {
sLog.outError("Spell %u '%s' category(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->Category,category,code.c_str()); sLog.outError("Spell %u '%s' category(%u) <> %u but used in %s.",spell,name.c_str(),spellEntry->Category,category,code.c_str());
continue; continue;
@ -3893,13 +3899,13 @@ void SpellMgr::CheckUsedSpells(char const* table)
if (effectIdx >= EFFECT_INDEX_0) if (effectIdx >= EFFECT_INDEX_0)
{ {
if(effectType >= 0 && spellEntry->Effect[effectIdx] != effectType) if (effectType >= 0 && spellEntry->Effect[effectIdx] != uint32(effectType))
{ {
sLog.outError("Spell %u '%s' effect%d <> %u but used in %s.",spell,name.c_str(),effectIdx+1,effectType,code.c_str()); sLog.outError("Spell %u '%s' effect%d <> %u but used in %s.",spell,name.c_str(),effectIdx+1,effectType,code.c_str());
continue; continue;
} }
if(auraType >= 0 && spellEntry->EffectApplyAuraName[effectIdx] != auraType) if (auraType >= 0 && spellEntry->EffectApplyAuraName[effectIdx] != uint32(auraType))
{ {
sLog.outError("Spell %u '%s' aura%d <> %u but used in %s.",spell,name.c_str(),effectIdx+1,auraType,code.c_str()); sLog.outError("Spell %u '%s' aura%d <> %u but used in %s.",spell,name.c_str(),effectIdx+1,auraType,code.c_str());
continue; continue;
@ -3908,13 +3914,13 @@ void SpellMgr::CheckUsedSpells(char const* table)
} }
else else
{ {
if(effectType >= 0 && !IsSpellHaveEffect(spellEntry,SpellEffects(effectType))) if (effectType >= 0 && !IsSpellHaveEffect(spellEntry,SpellEffects(effectType)))
{ {
sLog.outError("Spell %u '%s' not have effect %u but used in %s.",spell,name.c_str(),effectType,code.c_str()); sLog.outError("Spell %u '%s' not have effect %u but used in %s.",spell,name.c_str(),effectType,code.c_str());
continue; continue;
} }
if(auraType >= 0 && !IsSpellHaveAura(spellEntry,AuraType(auraType))) if (auraType >= 0 && !IsSpellHaveAura(spellEntry, AuraType(auraType)))
{ {
sLog.outError("Spell %u '%s' not have aura %u but used in %s.",spell,name.c_str(),auraType,code.c_str()); sLog.outError("Spell %u '%s' not have aura %u but used in %s.",spell,name.c_str(),auraType,code.c_str());
continue; continue;
@ -3929,13 +3935,13 @@ void SpellMgr::CheckUsedSpells(char const* table)
for(uint32 spellId = 1; spellId < sSpellStore.GetNumRows(); ++spellId) for(uint32 spellId = 1; spellId < sSpellStore.GetNumRows(); ++spellId)
{ {
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId);
if(!spellEntry) if (!spellEntry)
continue; continue;
if(family >=0 && spellEntry->SpellFamilyName != family) if (family >=0 && spellEntry->SpellFamilyName != uint32(family))
continue; continue;
if(familyMaskA != UI64LIT(0xFFFFFFFFFFFFFFFF) || familyMaskB != 0xFFFFFFFF) if (familyMaskA != UI64LIT(0xFFFFFFFFFFFFFFFF) || familyMaskB != 0xFFFFFFFF)
{ {
if(familyMaskA == UI64LIT(0x0000000000000000) && familyMaskB == 0x00000000) if(familyMaskA == UI64LIT(0x0000000000000000) && familyMaskB == 0x00000000)
{ {
@ -3944,34 +3950,34 @@ void SpellMgr::CheckUsedSpells(char const* table)
} }
else else
{ {
if((spellEntry->SpellFamilyFlags & familyMaskA)==0 && (spellEntry->SpellFamilyFlags2 & familyMaskB)==0) if ((spellEntry->SpellFamilyFlags & familyMaskA)==0 && (spellEntry->SpellFamilyFlags2 & familyMaskB)==0)
continue; continue;
} }
} }
if(spellIcon >= 0 && spellEntry->SpellIconID != spellIcon) if (spellIcon >= 0 && spellEntry->SpellIconID != uint32(spellIcon))
continue; continue;
if(spellVisual >= 0 && spellEntry->SpellVisual[0] != spellVisual) if (spellVisual >= 0 && spellEntry->SpellVisual[0] != uint32(spellVisual))
continue; continue;
if(category >= 0 && spellEntry->Category != category) if (category >= 0 && spellEntry->Category != uint32(category))
continue; continue;
if(effectIdx >= 0) if (effectIdx >= 0)
{ {
if(effectType >=0 && spellEntry->Effect[effectIdx] != effectType) if (effectType >=0 && spellEntry->Effect[effectIdx] != uint32(effectType))
continue; continue;
if(auraType >=0 && spellEntry->EffectApplyAuraName[effectIdx] != auraType) if (auraType >=0 && spellEntry->EffectApplyAuraName[effectIdx] !=uint32(auraType))
continue; continue;
} }
else else
{ {
if(effectType >=0 && !IsSpellHaveEffect(spellEntry,SpellEffects(effectType))) if (effectType >=0 && !IsSpellHaveEffect(spellEntry,SpellEffects(effectType)))
continue; continue;
if(auraType >=0 && !IsSpellHaveAura(spellEntry,AuraType(auraType))) if (auraType >=0 && !IsSpellHaveAura(spellEntry,AuraType(auraType)))
continue; continue;
} }
@ -3979,9 +3985,9 @@ void SpellMgr::CheckUsedSpells(char const* table)
break; break;
} }
if(!found) if (!found)
{ {
if(effectIdx >= 0) if (effectIdx >= 0)
sLog.outError("Spells '%s' not found for family %i (" I64FMT "," I32FMT ") icon(%i) visual(%i) category(%i) effect%d(%i) aura%d(%i) but used in %s", sLog.outError("Spells '%s' not found for family %i (" I64FMT "," I32FMT ") icon(%i) visual(%i) category(%i) effect%d(%i) aura%d(%i) but used in %s",
name.c_str(),family,familyMaskA,familyMaskB,spellIcon,spellVisual,category,effectIdx+1,effectType,effectIdx+1,auraType,code.c_str()); name.c_str(),family,familyMaskA,familyMaskB,spellIcon,spellVisual,category,effectIdx+1,effectType,effectIdx+1,auraType,code.c_str());
else else

View file

@ -326,7 +326,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
Item* castItem = my_trade->GetSpellCastItem(); Item* castItem = my_trade->GetSpellCastItem();
if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) || if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) ||
my_trade->HasSpellCastItem() && !castItem) (my_trade->HasSpellCastItem() && !castItem))
{ {
clearAcceptTradeMode(my_trade, his_trade); clearAcceptTradeMode(my_trade, his_trade);
clearAcceptTradeMode(myItems, hisItems); clearAcceptTradeMode(myItems, hisItems);
@ -361,7 +361,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
Item* castItem = his_trade->GetSpellCastItem(); Item* castItem = his_trade->GetSpellCastItem();
if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) ||
his_trade->HasSpellCastItem() && !castItem) (his_trade->HasSpellCastItem() && !castItem))
{ {
delete my_spell; delete my_spell;
his_trade->SetSpell(0); his_trade->SetSpell(0);

View file

@ -492,9 +492,9 @@ void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb) void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb)
{ {
if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()))
{ {
if(absorb) if (absorb)
*absorb += damage; *absorb += damage;
damage = 0; damage = 0;
return; return;
@ -1332,7 +1332,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
if(!this || !pVictim) if(!this || !pVictim)
return; return;
if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()))
return; return;
SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID); SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID);
@ -1639,7 +1639,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
if(!this || !pVictim) if(!this || !pVictim)
return; return;
if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode()))
return; return;
//You don't lose health from damage taken from another player while in a sanctuary //You don't lose health from damage taken from another player while in a sanctuary
@ -2380,7 +2380,7 @@ void Unit::CalculateAbsorbResistBlock(Unit *pCaster, SpellNonMeleeDamage *damage
if (blocked) if (blocked)
{ {
damageInfo->blocked = GetShieldBlockValue(); damageInfo->blocked = GetShieldBlockValue();
if (damageInfo->damage < (int32)damageInfo->blocked) if (damageInfo->damage < damageInfo->blocked)
damageInfo->blocked = damageInfo->damage; damageInfo->blocked = damageInfo->damage;
damageInfo->damage-=damageInfo->blocked; damageInfo->damage-=damageInfo->blocked;
} }
@ -2679,8 +2679,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
// mobs can score crushing blows if they're 4 or more levels above victim // mobs can score crushing blows if they're 4 or more levels above victim
if (GetLevelForTarget(pVictim) >= pVictim->GetLevelForTarget(this) + 4 && if (GetLevelForTarget(pVictim) >= pVictim->GetLevelForTarget(this) + 4 &&
// can be from by creature (if can) or from controlled player that considered as creature // can be from by creature (if can) or from controlled player that considered as creature
(GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->IsPet() && ((GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->IsPet() &&
!(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) || !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) ||
GetTypeId()==TYPEID_PLAYER && !GetCharmerOrOwnerGuid().IsEmpty())) GetTypeId()==TYPEID_PLAYER && !GetCharmerOrOwnerGuid().IsEmpty()))
{ {
// when their weapon skill is 15 or more above victim's defense skill // when their weapon skill is 15 or more above victim's defense skill
@ -3926,7 +3926,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder)
} }
// passive and persistent auras can stack with themselves any number of times // passive and persistent auras can stack with themselves any number of times
if (!holder->IsPassive() && !holder->IsPersistent() || holder->IsAreaAura()) if ((!holder->IsPassive() && !holder->IsPersistent()) || holder->IsAreaAura())
{ {
SpellAuraHolderBounds spair = GetSpellAuraHolderBounds(aurSpellInfo->Id); SpellAuraHolderBounds spair = GetSpellAuraHolderBounds(aurSpellInfo->Id);
@ -4181,7 +4181,7 @@ bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder *holder)
// single allowed spell specific from same caster or from any caster at target // single allowed spell specific from same caster or from any caster at target
bool is_spellSpecPerTargetPerCaster = IsSingleFromSpellSpecificPerTargetPerCaster(spellId_spec,i_spellId_spec); bool is_spellSpecPerTargetPerCaster = IsSingleFromSpellSpecificPerTargetPerCaster(spellId_spec,i_spellId_spec);
bool is_spellSpecPerTarget = IsSingleFromSpellSpecificPerTarget(spellId_spec,i_spellId_spec); bool is_spellSpecPerTarget = IsSingleFromSpellSpecificPerTarget(spellId_spec,i_spellId_spec);
if( is_spellSpecPerTarget || is_spellSpecPerTargetPerCaster && holder->GetCasterGUID() == (*i).second->GetCasterGUID() ) if (is_spellSpecPerTarget || (is_spellSpecPerTargetPerCaster && holder->GetCasterGUID() == (*i).second->GetCasterGUID()))
{ {
// cannot remove higher rank // cannot remove higher rank
if (sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId)) if (sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
@ -5741,7 +5741,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
if(itr->second.state == PLAYERSPELL_REMOVED) continue; if(itr->second.state == PLAYERSPELL_REMOVED) continue;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo || !IsPassiveSpell(spellInfo)) continue; if (!spellInfo || !IsPassiveSpell(spellInfo)) continue;
if (spellInfo->CasterAuraState == flag) if (AuraState(spellInfo->CasterAuraState) == flag)
CastSpell(this, itr->first, true, NULL); CastSpell(this, itr->first, true, NULL);
} }
} }
@ -5759,7 +5759,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
for (Unit::SpellAuraHolderMap::iterator itr = tAuras.begin(); itr != tAuras.end();) for (Unit::SpellAuraHolderMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
{ {
SpellEntry const* spellProto = (*itr).second->GetSpellProto(); SpellEntry const* spellProto = (*itr).second->GetSpellProto();
if (spellProto->CasterAuraState == flag) if (AuraState(spellProto->CasterAuraState) == flag)
{ {
RemoveSpellAuraHolder(itr->second); RemoveSpellAuraHolder(itr->second);
itr = tAuras.begin(); itr = tAuras.begin();
@ -7107,10 +7107,10 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType
AuraList const& mModDamageDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE); AuraList const& mModDamageDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
for(AuraList::const_iterator i = mModDamageDone.begin(); i != mModDamageDone.end(); ++i) for(AuraList::const_iterator i = mModDamageDone.begin(); i != mModDamageDone.end(); ++i)
{ {
if ((*i)->GetModifier()->m_miscvalue & schoolMask && // schoolmask has to fit with the intrinsic spell school if (((*i)->GetModifier()->m_miscvalue & schoolMask && // schoolmask has to fit with the intrinsic spell school
(*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask() && // AND schoolmask has to fit with weapon damage school (essential for non-physical spells) (*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask() && // AND schoolmask has to fit with weapon damage school (essential for non-physical spells)
((*i)->GetSpellProto()->EquippedItemClass == -1 || // general, weapon independent ((*i)->GetSpellProto()->EquippedItemClass == -1) || // general, weapon independent
pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto()))) // OR used weapon fits aura requirements (pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto())))) // OR used weapon fits aura requirements
{ {
DoneFlat += (*i)->GetModifier()->m_amount; DoneFlat += (*i)->GetModifier()->m_amount;
} }
@ -7146,10 +7146,10 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType
AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
{ {
if ((*i)->GetModifier()->m_miscvalue & schoolMask && // schoolmask has to fit with the intrinsic spell school if (((*i)->GetModifier()->m_miscvalue & schoolMask && // schoolmask has to fit with the intrinsic spell school
(*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask() && // AND schoolmask has to fit with weapon damage school (essential for non-physical spells) (*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask() && // AND schoolmask has to fit with weapon damage school (essential for non-physical spells)
((*i)->GetSpellProto()->EquippedItemClass == -1 || // general, weapon independent ((*i)->GetSpellProto()->EquippedItemClass == -1) || // general, weapon independent
pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto()))) // OR used weapon fits aura requirements (pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto())))) // OR used weapon fits aura requirements
{ {
DonePercent *= ((*i)->GetModifier()->m_amount+100.0f) / 100.0f; DonePercent *= ((*i)->GetModifier()->m_amount+100.0f) / 100.0f;
} }
@ -7280,8 +7280,8 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType
{ {
// search for glyph dummy aura // search for glyph dummy aura
if (Aura *aur = GetDummyAura(56826)) if (Aura *aur = GetDummyAura(56826))
// check for Serpent Sting // check for Serpent Sting at target
if (Aura *serpentSting = pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, UI64LIT(0x0000000000004000))) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, UI64LIT(0x0000000000004000)))
DonePercent *= (aur->GetModifier()->m_amount+100.0f) / 100.0f; DonePercent *= (aur->GetModifier()->m_amount+100.0f) / 100.0f;
} }
} }
@ -8000,7 +8000,7 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
{ {
if(uint32 mask = (m_detectInvisibilityMask & u->m_invisibilityMask)) if(uint32 mask = (m_detectInvisibilityMask & u->m_invisibilityMask))
{ {
for(uint32 i = 0; i < 10; ++i) for(int32 i = 0; i < 10; ++i)
{ {
if(((1 << i) & mask)==0) if(((1 << i) & mask)==0)
continue; continue;
@ -8009,22 +8009,20 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
int32 invLevel = 0; int32 invLevel = 0;
Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY); Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr) for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
if(((*itr)->GetModifier()->m_miscvalue)==i && invLevel < (*itr)->GetModifier()->m_amount) if ((*itr)->GetModifier()->m_miscvalue==i && invLevel < (*itr)->GetModifier()->m_amount)
invLevel = (*itr)->GetModifier()->m_amount; invLevel = (*itr)->GetModifier()->m_amount;
// find invisibility detect level // find invisibility detect level
int32 detectLevel = 0; int32 detectLevel = 0;
Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION); Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
for(Unit::AuraList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr) for(Unit::AuraList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
if(((*itr)->GetModifier()->m_miscvalue)==i && detectLevel < (*itr)->GetModifier()->m_amount) if ((*itr)->GetModifier()->m_miscvalue==i && detectLevel < (*itr)->GetModifier()->m_amount)
detectLevel = (*itr)->GetModifier()->m_amount; detectLevel = (*itr)->GetModifier()->m_amount;
if(i==6 && GetTypeId()==TYPEID_PLAYER) // special drunk detection case if (i==6 && GetTypeId()==TYPEID_PLAYER) // special drunk detection case
{
detectLevel = ((Player*)this)->GetDrunkValue(); detectLevel = ((Player*)this)->GetDrunkValue();
}
if(invLevel <= detectLevel) if (invLevel <= detectLevel)
return true; return true;
} }
} }
@ -8081,6 +8079,8 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced, float ratio)
} }
} }
break; break;
default:
break;
} }
int32 main_speed_mod = 0; int32 main_speed_mod = 0;
@ -9698,6 +9698,8 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
case SPELL_AURA_PROC_FAILED: case SPELL_AURA_PROC_FAILED:
procSuccess = false; procSuccess = false;
break; break;
case SPELL_AURA_PROC_OK:
break;
} }
anyAuraProc = true; anyAuraProc = true;
@ -10254,18 +10256,20 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
{ {
Player* player = GetCharmerOrOwnerPlayerOrPlayerItself(); Player* player = GetCharmerOrOwnerPlayerOrPlayerItself();
if(!player || attackedPlayer && (attackedPlayer == player || player->duel && player->duel->opponent == attackedPlayer)) if (!player || (attackedPlayer && (attackedPlayer == player || (player->duel && player->duel->opponent == attackedPlayer))))
return; return;
player->SetContestedPvPTimer(30000); player->SetContestedPvPTimer(30000);
if(!player->hasUnitState(UNIT_STAT_ATTACK_PLAYER))
if (!player->hasUnitState(UNIT_STAT_ATTACK_PLAYER))
{ {
player->addUnitState(UNIT_STAT_ATTACK_PLAYER); player->addUnitState(UNIT_STAT_ATTACK_PLAYER);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
// call MoveInLineOfSight for nearby contested guards // call MoveInLineOfSight for nearby contested guards
SetVisibility(GetVisibility()); SetVisibility(GetVisibility());
} }
if(!hasUnitState(UNIT_STAT_ATTACK_PLAYER))
if (!hasUnitState(UNIT_STAT_ATTACK_PLAYER))
{ {
addUnitState(UNIT_STAT_ATTACK_PLAYER); addUnitState(UNIT_STAT_ATTACK_PLAYER);
// call MoveInLineOfSight for nearby contested guards // call MoveInLineOfSight for nearby contested guards

View file

@ -479,18 +479,18 @@ SpellAuraProcResult Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura
} }
// default case // default case
if(!target || target!=this && !target->isAlive()) if (!target || (target != this && !target->isAlive()))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id)) if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if(basepoints0) if (basepoints0)
CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
else else
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
if( cooldown && GetTypeId()==TYPEID_PLAYER ) if (cooldown && GetTypeId()==TYPEID_PLAYER)
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); ((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
@ -520,7 +520,7 @@ SpellAuraProcResult Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*
case 54646: case 54646:
{ {
Unit* caster = triggeredByAura->GetCaster(); Unit* caster = triggeredByAura->GetCaster();
if(!caster) if (!caster)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
triggered_spell_id = 54648; triggered_spell_id = 54648;
@ -532,7 +532,7 @@ SpellAuraProcResult Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*
} }
// processed charge only counting case // processed charge only counting case
if(!triggered_spell_id) if (!triggered_spell_id)
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id); SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id);
@ -544,18 +544,18 @@ SpellAuraProcResult Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*
} }
// default case // default case
if(!target || target!=this && !target->isAlive()) if (!target || (target != this && !target->isAlive()))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id)) if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if(basepoints0) if (basepoints0)
CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
else else
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
if( cooldown && GetTypeId()==TYPEID_PLAYER ) if (cooldown && GetTypeId()==TYPEID_PLAYER)
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); ((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
@ -2646,22 +2646,22 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
} }
// processed charge only counting case // processed charge only counting case
if(!triggered_spell_id) if (!triggered_spell_id)
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id); SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id);
if(!triggerEntry) if (!triggerEntry)
{ {
sLog.outError("Unit::HandleDummyAuraProc: Spell %u have nonexistent triggered spell %u",dummySpell->Id,triggered_spell_id); sLog.outError("Unit::HandleDummyAuraProc: Spell %u have nonexistent triggered spell %u",dummySpell->Id,triggered_spell_id);
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
} }
// default case // default case
if(!target || target!=this && !target->isAlive()) if (!target || (target != this && !target->isAlive()))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id)) if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2]) if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
@ -3457,7 +3457,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
} }
} }
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(trigger_spell_id)) if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(trigger_spell_id))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
// try detect target manually if not set // try detect target manually if not set
@ -3465,7 +3465,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim; target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
// default case // default case
if (!target || target!=this && !target->isAlive()) if (!target || (target != this && !target->isAlive()))
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2]) if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
@ -3477,7 +3477,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
else else
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
if( cooldown && GetTypeId()==TYPEID_PLAYER ) if (cooldown && GetTypeId()==TYPEID_PLAYER)
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown); ((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown);
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
@ -3684,7 +3684,8 @@ SpellAuraProcResult Unit::HandleModPowerCostSchoolAuraProc(Unit* /*pVictim*/, ui
SpellAuraProcResult Unit::HandleMechanicImmuneResistanceAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) SpellAuraProcResult Unit::HandleMechanicImmuneResistanceAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
{ {
// Compare mechanic // Compare mechanic
return !(procSpell==NULL || procSpell->Mechanic != triggeredByAura->GetModifier()->m_miscvalue) ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; return !(procSpell==NULL || int32(procSpell->Mechanic) != triggeredByAura->GetModifier()->m_miscvalue)
? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED;
} }
SpellAuraProcResult Unit::HandleModDamageFromCasterAuraProc(Unit* pVictim, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) SpellAuraProcResult Unit::HandleModDamageFromCasterAuraProc(Unit* pVictim, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)

View file

@ -883,15 +883,15 @@ void World::SetInitialWorldSettings()
LoadConfigSettings(); LoadConfigSettings();
///- Check the existence of the map files for all races' startup areas. ///- Check the existence of the map files for all races' startup areas.
if( !MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f) if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f) ||
||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) !MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) ||
||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) !MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) ||
||!MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f) !MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f) ||
||!MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f) !MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f) ||
||!MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f) !MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f) ||
||!MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f) !MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f) ||
||m_configUint32Values[CONFIG_UINT32_EXPANSION] && ( (m_configUint32Values[CONFIG_UINT32_EXPANSION] &&
!MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f) ) ) (!MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f))))
{ {
sLog.outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map and vmap files in appropriate directories or correct the DataDir value in the mangosd.conf file.",m_dataPath.c_str(),m_dataPath.c_str()); sLog.outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map and vmap files in appropriate directories or correct the DataDir value in the mangosd.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
Log::WaitBeforeContinueIfNeed(); Log::WaitBeforeContinueIfNeed();
@ -1338,7 +1338,7 @@ void World::DetectDBCLang()
{ {
uint32 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255); uint32 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255);
if(m_lang_confid != 255 && m_lang_confid >= MAX_LOCALE) if (m_lang_confid != 255 && m_lang_confid >= MAX_LOCALE)
{ {
sLog.outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)",MAX_LOCALE); sLog.outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)",MAX_LOCALE);
m_lang_confid = LOCALE_enUS; m_lang_confid = LOCALE_enUS;
@ -1348,10 +1348,10 @@ void World::DetectDBCLang()
std::string availableLocalsStr; std::string availableLocalsStr;
int default_locale = MAX_LOCALE; uint32 default_locale = MAX_LOCALE;
for (int i = MAX_LOCALE-1; i >= 0; --i) for (int i = MAX_LOCALE-1; i >= 0; --i)
{ {
if ( strlen(race->name[i]) > 0) // check by race names if (strlen(race->name[i]) > 0) // check by race names
{ {
default_locale = i; default_locale = i;
m_availableDbcLocaleMask |= (1 << i); m_availableDbcLocaleMask |= (1 << i);
@ -1360,13 +1360,13 @@ void World::DetectDBCLang()
} }
} }
if( default_locale != m_lang_confid && m_lang_confid < MAX_LOCALE && if (default_locale != m_lang_confid && m_lang_confid < MAX_LOCALE &&
(m_availableDbcLocaleMask & (1 << m_lang_confid)) ) (m_availableDbcLocaleMask & (1 << m_lang_confid)) )
{ {
default_locale = m_lang_confid; default_locale = m_lang_confid;
} }
if(default_locale >= MAX_LOCALE) if (default_locale >= MAX_LOCALE)
{ {
sLog.outError("Unable to determine your DBC Locale! (corrupt DBC?)"); sLog.outError("Unable to determine your DBC Locale! (corrupt DBC?)");
Log::WaitBeforeContinueIfNeed(); Log::WaitBeforeContinueIfNeed();

View file

@ -705,6 +705,8 @@ void WorldSession::SaveTutorialsData()
CharacterDatabase.PExecute("INSERT INTO character_tutorial (account,tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7) VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", CharacterDatabase.PExecute("INSERT INTO character_tutorial (account,tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7) VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
GetAccountId(), m_Tutorials[0], m_Tutorials[1], m_Tutorials[2], m_Tutorials[3], m_Tutorials[4], m_Tutorials[5], m_Tutorials[6], m_Tutorials[7]); GetAccountId(), m_Tutorials[0], m_Tutorials[1], m_Tutorials[2], m_Tutorials[3], m_Tutorials[4], m_Tutorials[5], m_Tutorials[6], m_Tutorials[7]);
break; break;
case TUTORIALDATA_UNCHANGED:
break;
} }
m_tutorialState = TUTORIALDATA_UNCHANGED; m_tutorialState = TUTORIALDATA_UNCHANGED;

View file

@ -612,7 +612,7 @@ int WorldSocket::handle_input_missing_data (void)
} }
} }
return n == recv_size ? 1 : 2; return size_t(n) == recv_size ? 1 : 2;
} }
int WorldSocket::cancel_wakeup_output (GuardType& g) int WorldSocket::cancel_wakeup_output (GuardType& g)

View file

@ -237,11 +237,11 @@ bool Database::CheckRequiredField( char const* table_name, char const* required_
if(!reqName.empty()) if(!reqName.empty())
{ {
sLog.outErrorDb("The table `%s` in your [%s] database indicates that this database is out of date!",table_name,db_name); sLog.outErrorDb("The table `%s` in your [%s] database indicates that this database is out of date!",table_name,db_name);
sLog.outErrorDb(""); sLog.outErrorDb();
sLog.outErrorDb(" [A] You have: --> `%s.sql`",cur_sql_update_name.c_str()); sLog.outErrorDb(" [A] You have: --> `%s.sql`",cur_sql_update_name.c_str());
sLog.outErrorDb(""); sLog.outErrorDb();
sLog.outErrorDb(" [B] You need: --> `%s.sql`",req_sql_update_name); sLog.outErrorDb(" [B] You need: --> `%s.sql`",req_sql_update_name);
sLog.outErrorDb(""); sLog.outErrorDb();
sLog.outErrorDb("You must apply all updates after [A] to [B] to use mangos with this database."); sLog.outErrorDb("You must apply all updates after [A] to [B] to use mangos with this database.");
sLog.outErrorDb("These updates are included in the sql/updates folder."); sLog.outErrorDb("These updates are included in the sql/updates folder.");
sLog.outErrorDb("Please read the included [README] in sql/updates for instructions on updating."); sLog.outErrorDb("Please read the included [README] in sql/updates for instructions on updating.");
@ -250,10 +250,10 @@ bool Database::CheckRequiredField( char const* table_name, char const* required_
{ {
sLog.outErrorDb("The table `%s` in your [%s] database is missing its version info.",table_name,db_name); sLog.outErrorDb("The table `%s` in your [%s] database is missing its version info.",table_name,db_name);
sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date.",table_name,db_name); sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date.",table_name,db_name);
sLog.outErrorDb(""); sLog.outErrorDb();
sLog.outErrorDb("This revision of MaNGOS requires a database updated to:"); sLog.outErrorDb("This revision of MaNGOS requires a database updated to:");
sLog.outErrorDb("`%s.sql`",req_sql_update_name); sLog.outErrorDb("`%s.sql`",req_sql_update_name);
sLog.outErrorDb(""); sLog.outErrorDb();
if(!strcmp(db_name, "WORLD")) if(!strcmp(db_name, "WORLD"))
sLog.outErrorDb("Post this error to your database provider forum or find a solution there."); sLog.outErrorDb("Post this error to your database provider forum or find a solution there.");
@ -265,10 +265,10 @@ bool Database::CheckRequiredField( char const* table_name, char const* required_
{ {
sLog.outErrorDb("The table `%s` in your [%s] database is missing or corrupt.",table_name,db_name); sLog.outErrorDb("The table `%s` in your [%s] database is missing or corrupt.",table_name,db_name);
sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date.",table_name,db_name); sLog.outErrorDb("MaNGOS cannot find the version info needed to check that the db is up to date.",table_name,db_name);
sLog.outErrorDb(""); sLog.outErrorDb();
sLog.outErrorDb("This revision of mangos requires a database updated to:"); sLog.outErrorDb("This revision of mangos requires a database updated to:");
sLog.outErrorDb("`%s.sql`",req_sql_update_name); sLog.outErrorDb("`%s.sql`",req_sql_update_name);
sLog.outErrorDb(""); sLog.outErrorDb();
if(!strcmp(db_name, "WORLD")) if(!strcmp(db_name, "WORLD"))
sLog.outErrorDb("Post this error to your database provider forum or find a solution there."); sLog.outErrorDb("Post this error to your database provider forum or find a solution there.");

View file

@ -460,6 +460,30 @@ void Log::outError( const char * err, ... )
fflush(stderr); fflush(stderr);
} }
void Log::outErrorDb()
{
if (m_includeTime)
outTime();
fprintf( stderr, "\n" );
if (logfile)
{
outTimestamp(logfile);
fprintf(logfile, "ERROR:\n" );
fflush(logfile);
}
if (dberLogfile)
{
outTimestamp(dberLogfile);
fprintf(dberLogfile, "\n" );
fflush(dberLogfile);
}
fflush(stderr);
}
void Log::outErrorDb( const char * err, ... ) void Log::outErrorDb( const char * err, ... )
{ {
if (!err) if (!err)

View file

@ -135,6 +135,7 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
void outDebug( const char * str, ... ) ATTR_PRINTF(2,3); void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
// any log level // any log level
void outMenu( const char * str, ... ) ATTR_PRINTF(2,3); void outMenu( const char * str, ... ) ATTR_PRINTF(2,3);
void outErrorDb(); // any log level
// any log level // any log level
void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3); void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);
// any log level // any log level

View file

@ -101,12 +101,12 @@ int ThreadPriority::getPriority(Priority p) const
# define THREADFLAG (THR_NEW_LWP | THR_JOINABLE) # define THREADFLAG (THR_NEW_LWP | THR_JOINABLE)
#endif #endif
Thread::Thread() : m_task(0), m_iThreadId(0), m_hThreadHandle(0) Thread::Thread() : m_iThreadId(0), m_hThreadHandle(0), m_task(0)
{ {
} }
Thread::Thread(Runnable* instance) : m_task(instance), m_iThreadId(0), m_hThreadHandle(0) Thread::Thread(Runnable* instance) : m_iThreadId(0), m_hThreadHandle(0), m_task(instance)
{ {
// register reference to m_task to prevent it deeltion until destructor // register reference to m_task to prevent it deeltion until destructor
if (m_task) if (m_task)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10691" #define REVISION_NR "10692"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__