mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[10692] Fixed some GCC warnings and code errors.
Thanks to freghar for provide cleaned list of warning messages.
This commit is contained in:
parent
349719e520
commit
10d3d3ce24
33 changed files with 363 additions and 306 deletions
|
|
@ -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.
|
||||
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
|
||||
sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", cmdName.c_str(), fullcommand.c_str());
|
||||
return false;
|
||||
|
|
@ -2303,7 +2303,7 @@ char* ChatHandler::ExtractQuotedArg( char** args, bool asis /*= false*/ )
|
|||
while (*tail && *tail != guard)
|
||||
++tail;
|
||||
|
||||
if (!*tail || tail[1] && !isWhiteSpace(tail[1])) // fail
|
||||
if (!*tail || (tail[1] && !isWhiteSpace(tail[1]))) // fail
|
||||
return NULL;
|
||||
|
||||
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|
|
||||
|
||||
// r
|
||||
if (!*tail || *tail != 'r' || *(tail+1) && !isWhiteSpace(*(tail+1)))
|
||||
if (!*tail || *tail != 'r' || (*(tail+1) && !isWhiteSpace(*(tail+1))))
|
||||
return NULL;
|
||||
|
||||
++tail; // skip r
|
||||
|
|
|
|||
|
|
@ -864,7 +864,7 @@ void Creature::PrepareBodyLootState()
|
|||
// have normal loot
|
||||
if (GetCreatureInfo()->maxgold > 0 || GetCreatureInfo()->lootid ||
|
||||
// ... 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);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -540,10 +540,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -206,9 +206,10 @@ enum AchievementCriteriaTypes
|
|||
// 122
|
||||
// 123
|
||||
// 0..123 => 124 criteria types total
|
||||
ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124,
|
||||
};
|
||||
|
||||
#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 124
|
||||
|
||||
enum AreaFlags
|
||||
{
|
||||
AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring)
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ bool IsAcceptableClientBuild(uint32 build)
|
|||
{
|
||||
int accepted_versions[] = EXPECTED_MANGOSD_CLIENT_BUILD;
|
||||
for(int i = 0; accepted_versions[i]; ++i)
|
||||
if(build == accepted_versions[i])
|
||||
if(int(build) == accepted_versions[i])
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ void GMTicketMgr::LoadGMTickets()
|
|||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %d GM tickets", GetTicketCount());
|
||||
sLog.outString(">> Loaded " SIZEFMTD " GM tickets", GetTicketCount());
|
||||
}
|
||||
|
||||
void GMTicketMgr::DeleteAll()
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
|||
// can't uninvite yourself
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -991,7 +991,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
|
|||
bool Item::IsLimitedToAnotherMapOrZone( uint32 cur_mapId, uint32 cur_zoneId) const
|
||||
{
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -4252,7 +4252,7 @@ bool ChatHandler::HandleEventStartCommand(char* args)
|
|||
|
||||
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);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -4292,7 +4292,7 @@ bool ChatHandler::HandleEventStopCommand(char* args)
|
|||
|
||||
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);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
|
|||
|
|
@ -416,8 +416,6 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
|
|||
if (!pItem)
|
||||
return;
|
||||
|
||||
ItemPrototype const* proto = pItem->GetProto();
|
||||
|
||||
switch (pItem->loot.loot_type)
|
||||
{
|
||||
// temporary loot in stacking items, clear loot state, no auto loot move
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
haveAreaInfo = true;
|
||||
if(wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId))
|
||||
wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
|
||||
if (wmoEntry)
|
||||
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ void MotionMaster::DelayedClean(bool reset, bool all)
|
|||
else
|
||||
m_cleanFlag &= ~MMCF_RESET;
|
||||
|
||||
if (empty() || !all && size() == 1)
|
||||
if (empty() || (!all && size() == 1))
|
||||
return;
|
||||
|
||||
if (!m_expList)
|
||||
|
|
|
|||
|
|
@ -3826,11 +3826,11 @@ void ObjectMgr::LoadQuests()
|
|||
}
|
||||
|
||||
//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)
|
||||
{
|
||||
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);
|
||||
//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 (!mapEntry ||
|
||||
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))
|
||||
{
|
||||
// not have any coordinates for check distance anyway
|
||||
|
|
@ -6174,10 +6174,12 @@ void ObjectMgr::LoadAreaTriggerTeleports()
|
|||
AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 map_id) const
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
if(atEntry && atEntry->mapid == map_id)
|
||||
|
|
@ -8867,8 +8869,6 @@ void ObjectMgr::LoadTrainerSpell()
|
|||
void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
|
||||
{
|
||||
CacheVendorItemMap& vendorList = isTemplates ? m_mCacheVendorTemplateItemMap : m_mCacheVendorItemMap;
|
||||
CacheVendorItemMap const* parentList = isTemplates ? NULL : &m_mCacheVendorTemplateItemMap;
|
||||
|
||||
|
||||
// For reload case
|
||||
for (CacheVendorItemMap::iterator itr = vendorList.begin(); itr != vendorList.end(); ++itr)
|
||||
|
|
@ -8915,7 +8915,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
|
|||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %d vendor items", count);
|
||||
sLog.outString( ">> Loaded %u vendor items", count);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ void Pet::Regenerate(Powers power)
|
|||
// Apply modifiers (if any).
|
||||
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
|
||||
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;
|
||||
|
||||
ModifyPower(power, (int32)addvalue);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
|||
else
|
||||
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();
|
||||
|
||||
// i_pet.getVictim() can't be used for check in case stop fighting, i_pet.getVictim() clear at Unit death etc.
|
||||
|
|
|
|||
|
|
@ -2140,7 +2140,7 @@ void Player::Regenerate(Powers power, uint32 diff)
|
|||
uint32 cd_diff = diff;
|
||||
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
|
||||
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;
|
||||
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -3511,8 +3511,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
|
|||
if (!pSkill)
|
||||
continue;
|
||||
|
||||
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)
|
||||
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)
|
||||
// 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))
|
||||
{
|
||||
|
|
@ -5234,6 +5234,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
|
|||
ApplyCastTimePercentMod(RatingChange,apply);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateRating(cr);
|
||||
|
|
@ -6269,7 +6271,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32
|
|||
|
||||
percent += rep > 0 ? repMod : -repMod;
|
||||
|
||||
float rate = 1.0f;
|
||||
float rate;
|
||||
switch (source)
|
||||
{
|
||||
case REPUTATION_SOURCE_KILL:
|
||||
|
|
@ -6278,6 +6280,10 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32
|
|||
case REPUTATION_SOURCE_QUEST:
|
||||
rate = sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_QUEST);
|
||||
break;
|
||||
case REPUTATION_SOURCE_SPELL:
|
||||
default:
|
||||
rate = 1.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// 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;
|
||||
}
|
||||
else
|
||||
|
|
@ -13242,7 +13248,7 @@ bool Player::IsCurrentQuest( uint32 quest_id ) const
|
|||
if (itr == mQuestStatus.end())
|
||||
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)
|
||||
|
|
@ -16113,8 +16119,8 @@ void Player::_LoadMailedItems(QueryResult *result)
|
|||
void Player::_LoadMails(QueryResult *result)
|
||||
{
|
||||
m_mail.clear();
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
//"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()
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
//"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)
|
||||
return;
|
||||
|
||||
|
|
@ -16128,14 +16134,13 @@ void Player::_LoadMails(QueryResult *result)
|
|||
m->receiver = fields[3].GetUInt32();
|
||||
m->subject = fields[4].GetCppString();
|
||||
m->body = fields[5].GetCppString();
|
||||
bool has_items = fields[6].GetBool();
|
||||
m->expire_time = (time_t)fields[7].GetUInt64();
|
||||
m->deliver_time = (time_t)fields[8].GetUInt64();
|
||||
m->money = fields[9].GetUInt32();
|
||||
m->COD = fields[10].GetUInt32();
|
||||
m->checked = fields[11].GetUInt32();
|
||||
m->stationery = fields[12].GetUInt8();
|
||||
m->mailTemplateId = fields[13].GetInt16();
|
||||
m->expire_time = (time_t)fields[6].GetUInt64();
|
||||
m->deliver_time = (time_t)fields[7].GetUInt64();
|
||||
m->money = fields[8].GetUInt32();
|
||||
m->COD = fields[9].GetUInt32();
|
||||
m->checked = fields[10].GetUInt32();
|
||||
m->stationery = fields[11].GetUInt8();
|
||||
m->mailTemplateId = fields[12].GetInt16();
|
||||
|
||||
if(m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
|
||||
{
|
||||
|
|
@ -16390,7 +16395,8 @@ void Player::_LoadSpells(QueryResult *result)
|
|||
// skip talents & drop unneeded data
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -17374,6 +17380,10 @@ void Player::_SaveSkills()
|
|||
CharacterDatabase.PExecute("UPDATE character_skills SET value = '%u',max = '%u'WHERE guid = '%u' AND skill = '%u' ",
|
||||
value, max, GetGUIDLow(), itr->first );
|
||||
break;
|
||||
case SKILL_UNCHANGED:
|
||||
case SKILL_DELETED:
|
||||
MANGOS_ASSERT(false);
|
||||
break;
|
||||
};
|
||||
itr->second.uState = SKILL_UNCHANGED;
|
||||
|
||||
|
|
@ -19045,7 +19055,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
|
|||
{
|
||||
// shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK)
|
||||
// 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);
|
||||
|
||||
// Now we have cooldown data (if found any), time to apply mods
|
||||
|
|
@ -20717,8 +20727,8 @@ void Player::SendCorpseReclaimDelay(bool load)
|
|||
bool pvp = corpse->GetType()==CORPSE_RESURRECTABLE_PVP;
|
||||
|
||||
uint32 count;
|
||||
if( pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP) ||
|
||||
!pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
|
||||
if ((pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
||||
(!pvp && sWorld.getConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
||||
{
|
||||
count = uint32(m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
|
||||
if (count>=MAX_DEATH_COUNT)
|
||||
|
|
@ -22457,6 +22467,7 @@ Object* Player::GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask)
|
|||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_CORPSE:
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HIGHGUID_INSTANCE:
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -281,17 +281,17 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
|||
return;
|
||||
}
|
||||
|
||||
int32 mapid = corpse->GetMapId();
|
||||
uint32 corpsemapid = corpse->GetMapId();
|
||||
float x = corpse->GetPositionX();
|
||||
float y = corpse->GetPositionY();
|
||||
float z = corpse->GetPositionZ();
|
||||
int32 corpsemapid = mapid;
|
||||
int32 mapid = corpsemapid;
|
||||
|
||||
// if corpse at different map
|
||||
if(mapid != _player->GetMapId())
|
||||
if (corpsemapid != _player->GetMapId())
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
|
|
@ -313,7 +313,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
|||
data << float(x);
|
||||
data << float(y);
|
||||
data << float(z);
|
||||
data << int32(corpsemapid);
|
||||
data << uint32(corpsemapid);
|
||||
data << uint32(0); // unknown
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
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();
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4375,10 +4375,11 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
|
||||
m_spellInfo->EffectImplicitTargetA[EFFECT_INDEX_1] == TARGET_CHAIN_DAMAGE)
|
||||
{
|
||||
if (target = m_caster->GetMap()->GetUnit(((Player *)m_caster)->GetSelectionGuid()))
|
||||
m_targets.setUnitTarget(target);
|
||||
else
|
||||
target = m_caster->GetMap()->GetUnit(((Player *)m_caster)->GetSelectionGuid());
|
||||
if (!target)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
m_targets.setUnitTarget(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4946,7 +4947,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
// 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 (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;
|
||||
break;
|
||||
}
|
||||
|
|
@ -6403,7 +6404,7 @@ bool Spell::CheckTarget( Unit* target, SpellEffectIndex eff )
|
|||
bool Spell::IsNeedSendToClient() const
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -411,8 +411,10 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
|
|||
if (pEnchant)
|
||||
{
|
||||
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 );
|
||||
break;
|
||||
}
|
||||
|
|
@ -425,7 +427,7 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
|
|||
}
|
||||
}
|
||||
|
||||
if(m_maxduration == -1 || isPassive && spellproto->DurationIndex == 0)
|
||||
if (m_maxduration == -1 || (isPassive && spellproto->DurationIndex == 0))
|
||||
isPermanent = true;
|
||||
|
||||
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
|
||||
|
|
@ -961,7 +963,7 @@ void Aura::ReapplyAffectedPassiveAuras( Unit* target, bool owner_mode )
|
|||
{
|
||||
// permanent passive or permanent area aura
|
||||
// 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)
|
||||
!itr->second->IsDeleted() && itr->second->GetId() != GetId() &&
|
||||
// and affected by aura
|
||||
|
|
@ -2905,8 +2907,8 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
|
|||
// If spell that caused this aura has Croud Control or Daze effect
|
||||
if ((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
|
||||
// some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells)
|
||||
aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 &&
|
||||
(aurMechMask & (1 << (MECHANIC_SNARE-1)))==0)
|
||||
(aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 &&
|
||||
(aurMechMask & (1 << (MECHANIC_SNARE-1))) == 0))
|
||||
{
|
||||
++iter;
|
||||
continue;
|
||||
|
|
@ -3259,7 +3261,7 @@ void Aura::HandleForceReaction(bool apply, bool Real)
|
|||
player->GetReputationMgr().SendForceReactions();
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
|
@ -3300,7 +3302,7 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real)
|
|||
{
|
||||
// Only from non-grey units
|
||||
if (!((Player*)caster)->isHonorOrXPTarget(victim) ||
|
||||
victim->GetTypeId() == TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim))
|
||||
(victim->GetTypeId() == TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)))
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -7798,7 +7800,7 @@ m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
|
|||
m_isDeathPersist = IsDeathPersistentSpell(m_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_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() &&
|
||||
|
|
@ -8092,7 +8094,7 @@ void SpellAuraHolder::CleanupTriggeredSpells()
|
|||
// needed for spell 43680, maybe others
|
||||
// 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 &&
|
||||
GetSpellDuration(m_spellProto) == m_spellProto->EffectAmplitude[i])
|
||||
GetSpellDuration(m_spellProto) == int32(m_spellProto->EffectAmplitude[i]))
|
||||
continue;
|
||||
|
||||
m_target->RemoveAurasDueToSpell(tSpellId);
|
||||
|
|
@ -8313,7 +8315,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
|
|||
// Ice Barrier (non stacking from one caster)
|
||||
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);
|
||||
for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
|
||||
|
|
@ -8449,7 +8451,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
|
|||
case SPELLFAMILY_PRIEST:
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1641,8 +1641,9 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
|||
m_caster->CastSpell(m_caster, spellID, true, NULL);
|
||||
return;
|
||||
}
|
||||
case EFFECT_INDEX_1:
|
||||
return; // additional data for dummy[0]
|
||||
case EFFECT_INDEX_1: // additional data for dummy[0]
|
||||
case EFFECT_INDEX_2:
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -3807,8 +3808,8 @@ void Spell::EffectOpenLock(SpellEffectIndex eff_idx)
|
|||
{
|
||||
GameObjectInfo const* goInfo = gameObjTarget->GetGOInfo();
|
||||
// Arathi Basin banner opening !
|
||||
if (goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
|
||||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK)
|
||||
if ((goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune) ||
|
||||
(goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK))
|
||||
{
|
||||
//CanUseBattleGroundObject() already called in CheckCast()
|
||||
// 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 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ uint32 GetSpellCastTimeForBonus( SpellEntry const *spellProto, DamageEffectType
|
|||
for(int j = 0; j < MAX_EFFECT_INDEX; ++j)
|
||||
{
|
||||
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;
|
||||
break;
|
||||
|
|
@ -1018,7 +1018,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
|||
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);
|
||||
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);
|
||||
break;
|
||||
|
|
@ -1743,8 +1743,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
|
||||
// Soulstone Resurrection and Twisting Nether (resurrector)
|
||||
if (spellInfo_1->SpellIconID == 92 && spellInfo_2->SpellIconID == 92 && (
|
||||
spellInfo_1->SpellVisual[0] == 99 && spellInfo_2->SpellVisual[0] == 0 ||
|
||||
spellInfo_2->SpellVisual[0] == 99 && spellInfo_1->SpellVisual[0] == 0 ) )
|
||||
(spellInfo_1->SpellVisual[0] == 99 && spellInfo_2->SpellVisual[0] == 0) ||
|
||||
(spellInfo_2->SpellVisual[0] == 99 && spellInfo_1->SpellVisual[0] == 0)))
|
||||
return false;
|
||||
|
||||
// Heart of the Wild, Agility and various Idol Triggers
|
||||
|
|
@ -1854,23 +1854,23 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_MAGE )
|
||||
{
|
||||
// Blizzard & Chilled (and some other stacked with blizzard spells
|
||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x100000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x100000)) )
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x100000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x100000))))
|
||||
return false;
|
||||
|
||||
// Blink & Improved Blink
|
||||
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) )
|
||||
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)))
|
||||
return false;
|
||||
|
||||
// Living Bomb & Ignite (Dots)
|
||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000000)) )
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000000))))
|
||||
return false;
|
||||
|
||||
// Fireball & Pyroblast (Dots)
|
||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x400000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x400000)) )
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x400000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x400000))))
|
||||
return false;
|
||||
}
|
||||
// Detect Invisibility and Mana Shield (multi-family check)
|
||||
|
|
@ -1890,24 +1890,24 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_WARLOCK)
|
||||
{
|
||||
// Siphon Life and Drain Life
|
||||
if( spellInfo_1->SpellIconID == 152 && spellInfo_2->SpellIconID == 546 ||
|
||||
spellInfo_2->SpellIconID == 152 && spellInfo_1->SpellIconID == 546 )
|
||||
if ((spellInfo_1->SpellIconID == 152 && spellInfo_2->SpellIconID == 546) ||
|
||||
(spellInfo_2->SpellIconID == 152 && spellInfo_1->SpellIconID == 546))
|
||||
return false;
|
||||
|
||||
//Corruption & Seed of corruption
|
||||
if( spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 1932 ||
|
||||
spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 1932 )
|
||||
if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 1932) ||
|
||||
(spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 1932))
|
||||
if(spellInfo_1->SpellVisual[0] != 0 && spellInfo_2->SpellVisual[0] != 0)
|
||||
return true; // can't be stacked
|
||||
|
||||
// Corruption and Unstable Affliction
|
||||
if( spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 2039 ||
|
||||
spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 2039 )
|
||||
if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 2039) ||
|
||||
(spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 2039))
|
||||
return false;
|
||||
|
||||
// (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) ||
|
||||
(spellInfo_2->SpellIconID == 313 || spellInfo_2->SpellIconID == 2039) && (spellInfo_1->SpellIconID == 544 || spellInfo_1->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)))
|
||||
return false;
|
||||
|
||||
// Metamorphosis, diff effects
|
||||
|
|
@ -1922,8 +1922,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_WARRIOR)
|
||||
{
|
||||
// Rend and Deep Wound
|
||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x1000000000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1000000000)) )
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x1000000000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1000000000))))
|
||||
return false;
|
||||
|
||||
// Battle Shout and Rampage
|
||||
|
|
@ -1949,13 +1949,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_PRIEST)
|
||||
{
|
||||
//Devouring Plague and Shadow Vulnerability
|
||||
if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x800000000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x800000000)))
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x800000000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x800000000))))
|
||||
return false;
|
||||
|
||||
//StarShards and Shadow Word: Pain
|
||||
if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000)))
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000))))
|
||||
return false;
|
||||
// Dispersion
|
||||
if ((spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) ||
|
||||
|
|
@ -1967,8 +1967,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_DRUID)
|
||||
{
|
||||
//Omen of Clarity and Blood Frenzy
|
||||
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)) )
|
||||
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))))
|
||||
return false;
|
||||
|
||||
// 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;
|
||||
|
||||
// Lifebloom and Wild Growth
|
||||
if (spellInfo_1->SpellIconID == 2101 && spellInfo_2->SpellIconID == 2864 ||
|
||||
spellInfo_2->SpellIconID == 2101 && spellInfo_1->SpellIconID == 2864 )
|
||||
if ((spellInfo_1->SpellIconID == 2101 && spellInfo_2->SpellIconID == 2864) ||
|
||||
(spellInfo_2->SpellIconID == 2101 && spellInfo_1->SpellIconID == 2864))
|
||||
return false;
|
||||
|
||||
// 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;
|
||||
|
||||
// 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;
|
||||
|
||||
// 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;
|
||||
|
||||
// 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;
|
||||
|
||||
// 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;
|
||||
|
||||
// Savage Roar and Savage Roar (triggered)
|
||||
|
|
@ -2006,7 +2010,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
return false;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
@ -2023,13 +2028,14 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_ROGUE)
|
||||
{
|
||||
// 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;
|
||||
|
||||
// Sprint & Sprint (waterwalk)
|
||||
if (spellInfo_1->SpellIconID == 516 && spellInfo_2->SpellIconID == 516 &&
|
||||
(spellInfo_1->Category == 44 && spellInfo_2->Category == 0 ||
|
||||
spellInfo_2->Category == 44 && spellInfo_1->Category == 0))
|
||||
((spellInfo_1->Category == 44 && spellInfo_2->Category == 0) ||
|
||||
(spellInfo_2->Category == 44 && spellInfo_1->Category == 0)))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2045,13 +2051,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
if (spellInfo_2->SpellFamilyName == SPELLFAMILY_HUNTER)
|
||||
{
|
||||
// Rapid Fire & Quick Shots
|
||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000)) )
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000))) )
|
||||
return false;
|
||||
|
||||
// Serpent Sting & (Immolation/Explosive Trap Effect)
|
||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x00000004000)) ||
|
||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000)) )
|
||||
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x00000004000))) ||
|
||||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000))))
|
||||
return false;
|
||||
|
||||
// Bestial Wrath
|
||||
|
|
@ -2075,8 +2081,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
|||
return true;
|
||||
|
||||
// Swift Retribution / Improved Devotion Aura (talents) and Paladin Auras
|
||||
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))
|
||||
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)))
|
||||
return false;
|
||||
|
||||
// Beacon of Light and Light's Beacon
|
||||
|
|
@ -3505,7 +3511,7 @@ void SpellMgr::LoadSpellAreas()
|
|||
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));
|
||||
continue;
|
||||
|
|
@ -3807,7 +3813,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
|
|||
}
|
||||
|
||||
// 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);
|
||||
continue;
|
||||
|
|
@ -3844,7 +3850,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
|
|||
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());
|
||||
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());
|
||||
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());
|
||||
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());
|
||||
continue;
|
||||
|
|
@ -3893,13 +3899,13 @@ void SpellMgr::CheckUsedSpells(char const* table)
|
|||
|
||||
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());
|
||||
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());
|
||||
continue;
|
||||
|
|
@ -3932,7 +3938,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
|
|||
if (!spellEntry)
|
||||
continue;
|
||||
|
||||
if(family >=0 && spellEntry->SpellFamilyName != family)
|
||||
if (family >=0 && spellEntry->SpellFamilyName != uint32(family))
|
||||
continue;
|
||||
|
||||
if (familyMaskA != UI64LIT(0xFFFFFFFFFFFFFFFF) || familyMaskB != 0xFFFFFFFF)
|
||||
|
|
@ -3949,21 +3955,21 @@ void SpellMgr::CheckUsedSpells(char const* table)
|
|||
}
|
||||
}
|
||||
|
||||
if(spellIcon >= 0 && spellEntry->SpellIconID != spellIcon)
|
||||
if (spellIcon >= 0 && spellEntry->SpellIconID != uint32(spellIcon))
|
||||
continue;
|
||||
|
||||
if(spellVisual >= 0 && spellEntry->SpellVisual[0] != spellVisual)
|
||||
if (spellVisual >= 0 && spellEntry->SpellVisual[0] != uint32(spellVisual))
|
||||
continue;
|
||||
|
||||
if(category >= 0 && spellEntry->Category != category)
|
||||
if (category >= 0 && spellEntry->Category != uint32(category))
|
||||
continue;
|
||||
|
||||
if (effectIdx >= 0)
|
||||
{
|
||||
if(effectType >=0 && spellEntry->Effect[effectIdx] != effectType)
|
||||
if (effectType >=0 && spellEntry->Effect[effectIdx] != uint32(effectType))
|
||||
continue;
|
||||
|
||||
if(auraType >=0 && spellEntry->EffectApplyAuraName[effectIdx] != auraType)
|
||||
if (auraType >=0 && spellEntry->EffectApplyAuraName[effectIdx] !=uint32(auraType))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
|
|||
Item* castItem = my_trade->GetSpellCastItem();
|
||||
|
||||
if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) ||
|
||||
my_trade->HasSpellCastItem() && !castItem)
|
||||
(my_trade->HasSpellCastItem() && !castItem))
|
||||
{
|
||||
clearAcceptTradeMode(my_trade, his_trade);
|
||||
clearAcceptTradeMode(myItems, hisItems);
|
||||
|
|
@ -361,7 +361,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& recvPacket)
|
|||
Item* castItem = his_trade->GetSpellCastItem();
|
||||
|
||||
if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) ||
|
||||
his_trade->HasSpellCastItem() && !castItem)
|
||||
(his_trade->HasSpellCastItem() && !castItem))
|
||||
{
|
||||
delete my_spell;
|
||||
his_trade->SetSpell(0);
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
|
|||
|
||||
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)
|
||||
*absorb += damage;
|
||||
|
|
@ -1332,7 +1332,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
|||
if(!this || !pVictim)
|
||||
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;
|
||||
|
||||
SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID);
|
||||
|
|
@ -1639,7 +1639,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
|||
if(!this || !pVictim)
|
||||
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;
|
||||
|
||||
//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)
|
||||
{
|
||||
damageInfo->blocked = GetShieldBlockValue();
|
||||
if (damageInfo->damage < (int32)damageInfo->blocked)
|
||||
if (damageInfo->damage < damageInfo->blocked)
|
||||
damageInfo->blocked = damageInfo->damage;
|
||||
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
|
||||
if (GetLevelForTarget(pVictim) >= pVictim->GetLevelForTarget(this) + 4 &&
|
||||
// can be from by creature (if can) or from controlled player that considered as creature
|
||||
(GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->IsPet() &&
|
||||
!(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) ||
|
||||
((GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->IsPet() &&
|
||||
!(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) ||
|
||||
GetTypeId()==TYPEID_PLAYER && !GetCharmerOrOwnerGuid().IsEmpty()))
|
||||
{
|
||||
// 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
|
||||
if (!holder->IsPassive() && !holder->IsPersistent() || holder->IsAreaAura())
|
||||
if ((!holder->IsPassive() && !holder->IsPersistent()) || holder->IsAreaAura())
|
||||
{
|
||||
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
|
||||
bool is_spellSpecPerTargetPerCaster = IsSingleFromSpellSpecificPerTargetPerCaster(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
|
||||
if (sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId))
|
||||
|
|
@ -5741,7 +5741,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
|
|||
if(itr->second.state == PLAYERSPELL_REMOVED) continue;
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
if (!spellInfo || !IsPassiveSpell(spellInfo)) continue;
|
||||
if (spellInfo->CasterAuraState == flag)
|
||||
if (AuraState(spellInfo->CasterAuraState) == flag)
|
||||
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();)
|
||||
{
|
||||
SpellEntry const* spellProto = (*itr).second->GetSpellProto();
|
||||
if (spellProto->CasterAuraState == flag)
|
||||
if (AuraState(spellProto->CasterAuraState) == flag)
|
||||
{
|
||||
RemoveSpellAuraHolder(itr->second);
|
||||
itr = tAuras.begin();
|
||||
|
|
@ -7107,10 +7107,10 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType
|
|||
AuraList const& mModDamageDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
|
||||
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)->GetSpellProto()->EquippedItemClass == -1 || // general, weapon independent
|
||||
pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto()))) // OR used weapon fits aura requirements
|
||||
((*i)->GetSpellProto()->EquippedItemClass == -1) || // general, weapon independent
|
||||
(pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto())))) // OR used weapon fits aura requirements
|
||||
{
|
||||
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);
|
||||
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)->GetSpellProto()->EquippedItemClass == -1 || // general, weapon independent
|
||||
pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto()))) // OR used weapon fits aura requirements
|
||||
((*i)->GetSpellProto()->EquippedItemClass == -1) || // general, weapon independent
|
||||
(pWeapon && pWeapon->IsFitToSpellRequirements((*i)->GetSpellProto())))) // OR used weapon fits aura requirements
|
||||
{
|
||||
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
|
||||
if (Aura *aur = GetDummyAura(56826))
|
||||
// check for Serpent Sting
|
||||
if (Aura *serpentSting = pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, UI64LIT(0x0000000000004000)))
|
||||
// check for Serpent Sting at target
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, UI64LIT(0x0000000000004000)))
|
||||
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))
|
||||
{
|
||||
for(uint32 i = 0; i < 10; ++i)
|
||||
for(int32 i = 0; i < 10; ++i)
|
||||
{
|
||||
if(((1 << i) & mask)==0)
|
||||
continue;
|
||||
|
|
@ -8009,20 +8009,18 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
|
|||
int32 invLevel = 0;
|
||||
Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
|
||||
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;
|
||||
|
||||
// find invisibility detect level
|
||||
int32 detectLevel = 0;
|
||||
Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
|
||||
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;
|
||||
|
||||
if (i==6 && GetTypeId()==TYPEID_PLAYER) // special drunk detection case
|
||||
{
|
||||
detectLevel = ((Player*)this)->GetDrunkValue();
|
||||
}
|
||||
|
||||
if (invLevel <= detectLevel)
|
||||
return true;
|
||||
|
|
@ -8081,6 +8079,8 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced, float ratio)
|
|||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int32 main_speed_mod = 0;
|
||||
|
|
@ -9698,6 +9698,8 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
|||
case SPELL_AURA_PROC_FAILED:
|
||||
procSuccess = false;
|
||||
break;
|
||||
case SPELL_AURA_PROC_OK:
|
||||
break;
|
||||
}
|
||||
|
||||
anyAuraProc = true;
|
||||
|
|
@ -10254,10 +10256,11 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
|
|||
{
|
||||
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;
|
||||
|
||||
player->SetContestedPvPTimer(30000);
|
||||
|
||||
if (!player->hasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
{
|
||||
player->addUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
|
|
@ -10265,6 +10268,7 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
|
|||
// call MoveInLineOfSight for nearby contested guards
|
||||
SetVisibility(GetVisibility());
|
||||
}
|
||||
|
||||
if (!hasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
{
|
||||
addUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ SpellAuraProcResult Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
}
|
||||
|
||||
// default case
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
if (!target || (target != this && !target->isAlive()))
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
|
||||
|
|
@ -544,7 +544,7 @@ SpellAuraProcResult Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*
|
|||
}
|
||||
|
||||
// default case
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
if (!target || (target != this && !target->isAlive()))
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
|
||||
|
|
@ -2658,7 +2658,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
}
|
||||
|
||||
// default case
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
if (!target || (target != this && !target->isAlive()))
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
if (cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
|
||||
|
|
@ -3465,7 +3465,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
|
|||
target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
|
||||
|
||||
// default case
|
||||
if (!target || target!=this && !target->isAlive())
|
||||
if (!target || (target != this && !target->isAlive()))
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
|
||||
|
|
@ -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*/)
|
||||
{
|
||||
// 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*/)
|
||||
|
|
|
|||
|
|
@ -883,15 +883,15 @@ void World::SetInitialWorldSettings()
|
|||
LoadConfigSettings();
|
||||
|
||||
///- Check the existence of the map files for all races' startup areas.
|
||||
if( !MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
|
||||
||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f)
|
||||
||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f)
|
||||
||!MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f)
|
||||
||!MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f)
|
||||
||!MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
|
||||
||!MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f)
|
||||
||m_configUint32Values[CONFIG_UINT32_EXPANSION] && (
|
||||
!MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f) ) )
|
||||
if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f) ||
|
||||
!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) ||
|
||||
!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) ||
|
||||
!MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f) ||
|
||||
!MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f) ||
|
||||
!MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f) ||
|
||||
!MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f) ||
|
||||
(m_configUint32Values[CONFIG_UINT32_EXPANSION] &&
|
||||
(!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());
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
|
|
@ -1348,7 +1348,7 @@ void World::DetectDBCLang()
|
|||
|
||||
std::string availableLocalsStr;
|
||||
|
||||
int default_locale = MAX_LOCALE;
|
||||
uint32 default_locale = MAX_LOCALE;
|
||||
for (int i = MAX_LOCALE-1; i >= 0; --i)
|
||||
{
|
||||
if (strlen(race->name[i]) > 0) // check by race names
|
||||
|
|
|
|||
|
|
@ -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')",
|
||||
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;
|
||||
case TUTORIALDATA_UNCHANGED:
|
||||
break;
|
||||
}
|
||||
|
||||
m_tutorialState = TUTORIALDATA_UNCHANGED;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -237,11 +237,11 @@ bool Database::CheckRequiredField( char const* table_name, char const* required_
|
|||
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("");
|
||||
sLog.outErrorDb();
|
||||
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("");
|
||||
sLog.outErrorDb();
|
||||
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("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("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("`%s.sql`",req_sql_update_name);
|
||||
sLog.outErrorDb("");
|
||||
sLog.outErrorDb();
|
||||
|
||||
if(!strcmp(db_name, "WORLD"))
|
||||
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("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("`%s.sql`",req_sql_update_name);
|
||||
sLog.outErrorDb("");
|
||||
sLog.outErrorDb();
|
||||
|
||||
if(!strcmp(db_name, "WORLD"))
|
||||
sLog.outErrorDb("Post this error to your database provider forum or find a solution there.");
|
||||
|
|
|
|||
|
|
@ -460,6 +460,30 @@ void Log::outError( const char * err, ... )
|
|||
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, ... )
|
||||
{
|
||||
if (!err)
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
|
|||
void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
// any log level
|
||||
void outMenu( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outErrorDb(); // any log level
|
||||
// any log level
|
||||
void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
// any log level
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ int ThreadPriority::getPriority(Priority p) const
|
|||
# define THREADFLAG (THR_NEW_LWP | THR_JOINABLE)
|
||||
#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
|
||||
if (m_task)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10691"
|
||||
#define REVISION_NR "10692"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue