Fixed comment text and code indentifiers spelling.

GetFieldNames part provided by Paradox.
This commit is contained in:
VladimirMangos 2008-11-06 19:18:36 +03:00
parent 4957d9f335
commit 4476d483d4
16 changed files with 192 additions and 193 deletions

View file

@ -300,11 +300,11 @@ void Creature::Update(uint32 diff)
switch( m_deathState ) switch( m_deathState )
{ {
case JUST_ALIVED: case JUST_ALIVED:
// Dont must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting.
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry()); sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry());
break; break;
case JUST_DIED: case JUST_DIED:
// Dont must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. // Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry()); sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry());
break; break;
case DEAD: case DEAD:
@ -470,7 +470,7 @@ void Creature::RegenerateHealth()
uint32 addvalue = 0; uint32 addvalue = 0;
// Not only pet, but any controelled creature // Not only pet, but any controlled creature
if(GetCharmerOrOwnerGUID()) if(GetCharmerOrOwnerGUID())
{ {
float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH); float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH);
@ -794,7 +794,7 @@ void Creature::sendPreparedGossip(Player* player)
} }
// in case non empty gossip menu (that not included quests list size) show it // in case non empty gossip menu (that not included quests list size) show it
// (quest entries from quest menu wiill be included in list) // (quest entries from quest menu will be included in list)
player->PlayerTalkClass->SendGossipMenu(GetNpcTextId(), GetGUID()); player->PlayerTalkClass->SendGossipMenu(GetNpcTextId(), GetGUID());
} }
@ -1064,7 +1064,7 @@ void Creature::SetLootRecipient(Unit *unit)
void Creature::SaveToDB() void Creature::SaveToDB()
{ {
// this should only be used when the creature has already been loaded // this should only be used when the creature has already been loaded
// perferably after adding to map, because mapid may not be valid otherwise // preferably after adding to map, because mapid may not be valid otherwise
CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid); CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid);
if(!data) if(!data)
{ {
@ -1436,7 +1436,7 @@ float Creature::GetAttackDistance(Unit const* pl) const
// "The aggro radius of a mob having the same level as the player is roughly 20 yards" // "The aggro radius of a mob having the same level as the player is roughly 20 yards"
float RetDistance = 20; float RetDistance = 20;
// "Aggro Radius varries with level difference at a rate of roughly 1 yard/level" // "Aggro Radius varies with level difference at a rate of roughly 1 yard/level"
// radius grow if playlevel < creaturelevel // radius grow if playlevel < creaturelevel
RetDistance -= (float)leveldif; RetDistance -= (float)leveldif;
@ -1731,7 +1731,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const
float AttackDist = GetAttackDistance(pVictim); float AttackDist = GetAttackDistance(pVictim);
uint32 ThreatRadius = sWorld.getConfig(CONFIG_THREAT_RADIUS); uint32 ThreatRadius = sWorld.getConfig(CONFIG_THREAT_RADIUS);
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and ouf of combat every update tick. //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
return ( length > (ThreatRadius > AttackDist ? ThreatRadius : AttackDist)); return ( length > (ThreatRadius > AttackDist ? ThreatRadius : AttackDist));
} }
@ -1800,7 +1800,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
return true; return true;
} }
/// Send a message to LocalDefense channel for players oposition team in the zone /// Send a message to LocalDefense channel for players opposition team in the zone
void Creature::SendZoneUnderAttackMessage(Player* attacker) void Creature::SendZoneUnderAttackMessage(Player* attacker)
{ {
uint32 enemy_team = attacker->GetTeam(); uint32 enemy_team = attacker->GetTeam();

View file

@ -62,7 +62,7 @@ GameObject::~GameObject()
{ {
if(m_uint32Values) // field array can be not exist if GameOBject not loaded if(m_uint32Values) // field array can be not exist if GameOBject not loaded
{ {
// crash possable at access to deleted GO in Unit::m_gameobj // crash possible at access to deleted GO in Unit::m_gameobj
uint64 owner_guid = GetOwnerGUID(); uint64 owner_guid = GetOwnerGUID();
if(owner_guid) if(owner_guid)
{ {
@ -70,7 +70,7 @@ GameObject::~GameObject()
if(owner) if(owner)
owner->RemoveGameObject(this,false); owner->RemoveGameObject(this,false);
else if(!IS_PLAYER_GUID(owner_guid)) else if(!IS_PLAYER_GUID(owner_guid))
sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possable later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid)); sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
} }
} }
} }
@ -204,7 +204,7 @@ void GameObject::Update(uint32 /*p_time*/)
((Player*)caster)->SendMessageToSet(&data,true); ((Player*)caster)->SendMessageToSet(&data,true);
} }
m_lootState = GO_READY; // can be succesfully open with some chance m_lootState = GO_READY; // can be successfully open with some chance
} }
return; return;
} }
@ -281,7 +281,7 @@ void GameObject::Update(uint32 /*p_time*/)
float radius = goInfo->trap.radius; float radius = goInfo->trap.radius;
if(!radius) if(!radius)
{ {
if(goInfo->trap.cooldown != 3) // cast in other case (at some triggring/linked go/etc explicit call) if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call)
return; return;
else else
{ {
@ -480,7 +480,7 @@ void GameObject::getFishLoot(Loot *fishloot)
void GameObject::SaveToDB() void GameObject::SaveToDB()
{ {
// this should only be used when the gameobject has already been loaded // this should only be used when the gameobject has already been loaded
// perferably after adding to map, because mapid may not be valid otherwise // preferably after adding to map, because mapid may not be valid otherwise
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid); GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid);
if(!data) if(!data)
{ {

View file

@ -110,7 +110,7 @@ static void AttemptAddMore(Player* _player)
if(!group->Create(_player->GetGUID(), _player->GetName())) if(!group->Create(_player->GetGUID(), _player->GetName()))
{ {
delete group; delete group;
return; // cann't create group (??) return; // can't create group (??)
} }
objmgr.AddGroup(group); objmgr.AddGroup(group);
@ -252,7 +252,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
{ {
uint32 number = 0; uint32 number = 0;
// start preper packet; // start prepare packet;
WorldPacket data(MSG_LOOKING_FOR_GROUP); WorldPacket data(MSG_LOOKING_FOR_GROUP);
data << uint32(type); // type data << uint32(type); // type
data << uint32(entry); // entry from LFGDungeons.dbc data << uint32(entry); // entry from LFGDungeons.dbc

View file

@ -430,7 +430,7 @@ bool ChatHandler::HandleReloadSpellElixirCommand(const char*)
{ {
sLog.outString( "Re-Loading Spell Elixir types..." ); sLog.outString( "Re-Loading Spell Elixir types..." );
spellmgr.LoadSpellElixirs(); spellmgr.LoadSpellElixirs();
SendGlobalSysMessage("DB table `spell_elixir` (spell exlixir types) reloaded."); SendGlobalSysMessage("DB table `spell_elixir` (spell elixir types) reloaded.");
return true; return true;
} }
@ -1395,7 +1395,7 @@ bool ChatHandler::HandleLearnAllCommand(const char* /*args*/)
"2426", "2426",
"5916", "5916",
"6634", "6634",
//"6718", phasing stealth, annoing for learn all case. //"6718", phasing stealth, annoying for learn all case.
"6719", "6719",
"8822", "8822",
"9591", "9591",
@ -1755,7 +1755,7 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/)
} }
} }
if(!spellid) // ??? none spells in telent if(!spellid) // ??? none spells in talent
continue; continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid); SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
@ -2694,15 +2694,15 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
bool known = target && target->HasSpell(id); bool known = target && target->HasSpell(id);
bool learn = (spellInfo->Effect[0] == SPELL_EFFECT_LEARN_SPELL); bool learn = (spellInfo->Effect[0] == SPELL_EFFECT_LEARN_SPELL);
uint32 telentCost = GetTalentSpellCost(id); uint32 talentCost = GetTalentSpellCost(id);
bool talent = (telentCost > 0); bool talent = (talentCost > 0);
bool passive = IsPassiveSpell(id); bool passive = IsPassiveSpell(id);
bool active = target && (target->HasAura(id,0) || target->HasAura(id,1) || target->HasAura(id,2)); bool active = target && (target->HasAura(id,0) || target->HasAura(id,1) || target->HasAura(id,2));
// unit32 used to prevent interpreting uint8 as char at output // unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank // find rank of learned spell for learning spell, or talent rank
uint32 rank = telentCost ? telentCost : spellmgr.GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id); uint32 rank = talentCost ? talentCost : spellmgr.GetSpellRank(learn ? spellInfo->EffectTriggerSpell[0] : id);
// send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
std::ostringstream ss; std::ostringstream ss;
@ -3062,7 +3062,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
if (!plGuid) if (!plGuid)
false; false;
// players's guild membership checked in AddMember before add // player's guild membership checked in AddMember before add
if (!targetGuild->AddMember (plGuid,targetGuild->GetLowestRank ())) if (!targetGuild->AddMember (plGuid,targetGuild->GetLowestRank ()))
return false; return false;
@ -3746,7 +3746,7 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
else // .levelup level else // .levelup level
addlevel = atoi(px); addlevel = atoi(px);
} }
// else .levelup - nothing do for prepering // else .levelup - nothing do for preparing
// player // player
Player *chr = NULL; Player *chr = NULL;
@ -3816,7 +3816,7 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
} }
else else
{ {
// update levle and XP at level, all other will be updated at loading // update level and XP at level, all other will be updated at loading
Tokens values; Tokens values;
Player::LoadValuesArrayFromDB(values,chr_guid); Player::LoadValuesArrayFromDB(values,chr_guid);
Player::SetUInt32ValueInArray(values,UNIT_FIELD_LEVEL,newlevel); Player::SetUInt32ValueInArray(values,UNIT_FIELD_LEVEL,newlevel);
@ -5199,7 +5199,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult* result)
std::string account_name; std::string account_name;
// "account" case, name can be get in same quary // "account" case, name can be get in same query
if(result->GetFieldCount() > 1) if(result->GetFieldCount() > 1)
account_name = fields[1].GetCppString(); account_name = fields[1].GetCppString();
// "character" case, name need extract from another DB // "character" case, name need extract from another DB
@ -5320,7 +5320,7 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
{ {
Player* pl = m_session->GetPlayer(); Player* pl = m_session->GetPlayer();
// accept only explictly selected target (not implicitly self targeting case) // accept only explicitly selected target (not implicitly self targeting case)
Unit* target = getSelectedUnit(); Unit* target = getSelectedUnit();
if(pl->GetSelection() && target) if(pl->GetSelection() && target)
{ {

View file

@ -372,7 +372,7 @@ void WorldSession::SendReturnToSender(uint8 messageType, uint32 sender_acc, uint
return; return;
} }
// preper mail and send in other case // prepare mail and send in other case
bool needItemDelay = false; bool needItemDelay = false;
if(mi && !mi->empty()) if(mi && !mi->empty())
@ -464,7 +464,7 @@ void WorldSession::HandleTakeItem(WorldPacket & recv_data )
else if(!receive) else if(!receive)
sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid); sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid);
// check player existanse // check player existence
if(receive || sender_accId) if(receive || sender_accId)
{ {
WorldSession::SendMailTo(receive, MAIL_NORMAL, MAIL_STATIONERY_NORMAL, m->receiver, m->sender, m->subject, 0, NULL, m->COD, 0, MAIL_CHECK_MASK_COD_PAYMENT); WorldSession::SendMailTo(receive, MAIL_NORMAL, MAIL_STATIONERY_NORMAL, m->receiver, m->sender, m->subject, 0, NULL, m->COD, 0, MAIL_CHECK_MASK_COD_PAYMENT);

View file

@ -1355,7 +1355,7 @@ void Map::RemoveAllObjectsInRemoveList()
Remove((GameObject*)obj,true); Remove((GameObject*)obj,true);
break; break;
case TYPEID_UNIT: case TYPEID_UNIT:
// in case triggred sequence some spell can continue casting after prev CleanupsBeforeDelete call // in case triggered sequence some spell can continue casting after prev CleanupsBeforeDelete call
// make sure that like sources auras/etc removed before destructor start // make sure that like sources auras/etc removed before destructor start
((Creature*)obj)->CleanupsBeforeDelete (); ((Creature*)obj)->CleanupsBeforeDelete ();
Remove((Creature*)obj,true); Remove((Creature*)obj,true);

View file

@ -129,7 +129,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if(!mEntry->IsMountAllowed()) if(!mEntry->IsMountAllowed())
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
// battleground state preper // battleground state prepare
if(_player->InBattleGround()) if(_player->InBattleGround())
{ {
BattleGround *bg = _player->GetBattleGround(); BattleGround *bg = _player->GetBattleGround();
@ -287,7 +287,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
movementInfo.t_time = 0; movementInfo.t_time = 0;
} }
// fall damage generation (ignore in flight case that can be triggred also at lags in moment teleportation to another map). // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND && !GetPlayer()->isInFlight()) if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND && !GetPlayer()->isInFlight())
{ {
Player *target = GetPlayer(); Player *target = GetPlayer();

View file

@ -815,7 +815,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const*
return; return;
} }
// replace by new strucutres array // replace by new structures array
const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1]; const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1];
int i=0; int i=0;
@ -920,7 +920,7 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const
else else
display_id = (cinfo->DisplayID_A2 != 0 && urand(0,1) == 0) ? cinfo->DisplayID_A2 : cinfo->DisplayID_A; display_id = (cinfo->DisplayID_A2 != 0 && urand(0,1) == 0) ? cinfo->DisplayID_A2 : cinfo->DisplayID_A;
} }
else // overriden in creature data else // overridden in creature data
display_id = data->displayid; display_id = data->displayid;
return display_id; return display_id;
@ -3034,7 +3034,7 @@ void ObjectMgr::LoadQuests()
{ {
sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.",
qinfo->GetQuestId(),qinfo->SrcItemId); qinfo->GetQuestId(),qinfo->SrcItemId);
qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward comptibility with DB qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB
} }
} }
else if(qinfo->SrcItemCount>0) else if(qinfo->SrcItemCount>0)
@ -3437,7 +3437,7 @@ void ObjectMgr::LoadQuests()
Quest const* quest = GetQuestTemplate(quest_id); Quest const* quest = GetQuestTemplate(quest_id);
// some quest referenced in spells not exist (outdataed spells) // some quest referenced in spells not exist (outdated spells)
if(!quest) if(!quest)
continue; continue;
@ -3797,7 +3797,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
// this will prevent quest completing without objective // this will prevent quest completing without objective
const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT); const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
// continue; - quest objective requiremet set and command can be allowed // continue; - quest objective requirement set and command can be allowed
} }
if(float(tmp.datalong2) > DEFAULT_VISIBILITY_DISTANCE) if(float(tmp.datalong2) > DEFAULT_VISIBILITY_DISTANCE)
@ -3971,7 +3971,7 @@ void ObjectMgr::LoadEventScripts()
{ {
std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first); std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
if (itr2 == evt_scripts.end()) if (itr2 == evt_scripts.end())
sLog.outErrorDb("Table `event_scripts` has script (Id: %u) not refering to any gameobject_template type 10 data2 field or type 3 data6 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT); sLog.outErrorDb("Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field or type 3 data6 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT);
} }
} }
@ -4138,7 +4138,7 @@ void ObjectMgr::LoadInstanceTemplate()
} }
} }
// the reset_delay must be atleast one day // the reset_delay must be at least one day
temp->reset_delay = std::max((uint32)1, (uint32)(temp->reset_delay * sWorld.getRate(RATE_INSTANCE_RESET_TIME))); temp->reset_delay = std::max((uint32)1, (uint32)(temp->reset_delay * sWorld.getRate(RATE_INSTANCE_RESET_TIME)));
} }
@ -4439,7 +4439,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
// this will prevent quest completing without objective // this will prevent quest completing without objective
const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT); const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
// continue; - quest modified to required obkective and trigger can be allowed. // continue; - quest modified to required objective and trigger can be allowed.
} }
mQuestAreaTriggerMap[trigger_ID] = quest_ID; mQuestAreaTriggerMap[trigger_ID] = quest_ID;
@ -4739,7 +4739,7 @@ void ObjectMgr::LoadGraveyardZones()
} }
if(!AddGraveYardLink(safeLocId,zoneId,team,false)) if(!AddGraveYardLink(safeLocId,zoneId,team,false))
sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Garveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId); sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId);
} while( result->NextRow() ); } while( result->NextRow() );
delete result; delete result;
@ -5103,7 +5103,7 @@ uint32 ObjectMgr::GenerateArenaTeamId()
++m_arenaTeamId; ++m_arenaTeamId;
if(m_arenaTeamId>=0xFFFFFFFF) if(m_arenaTeamId>=0xFFFFFFFF)
{ {
sLog.outError("Arena team ids overflow!! Can't continue, shuting down server. "); sLog.outError("Arena team ids overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_arenaTeamId; return m_arenaTeamId;
@ -5114,7 +5114,7 @@ uint32 ObjectMgr::GenerateGuildId()
++m_guildId; ++m_guildId;
if(m_guildId>=0xFFFFFFFF) if(m_guildId>=0xFFFFFFFF)
{ {
sLog.outError("Guild ids overflow!! Can't continue, shuting down server. "); sLog.outError("Guild ids overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_guildId; return m_guildId;
@ -5125,7 +5125,7 @@ uint32 ObjectMgr::GenerateAuctionID()
++m_auctionid; ++m_auctionid;
if(m_auctionid>=0xFFFFFFFF) if(m_auctionid>=0xFFFFFFFF)
{ {
sLog.outError("Auctions ids overflow!! Can't continue, shuting down server. "); sLog.outError("Auctions ids overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_auctionid; return m_auctionid;
@ -5136,7 +5136,7 @@ uint32 ObjectMgr::GenerateMailID()
++m_mailid; ++m_mailid;
if(m_mailid>=0xFFFFFFFF) if(m_mailid>=0xFFFFFFFF)
{ {
sLog.outError("Mail ids overflow!! Can't continue, shuting down server. "); sLog.outError("Mail ids overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_mailid; return m_mailid;
@ -5147,7 +5147,7 @@ uint32 ObjectMgr::GenerateItemTextID()
++m_ItemTextId; ++m_ItemTextId;
if(m_ItemTextId>=0xFFFFFFFF) if(m_ItemTextId>=0xFFFFFFFF)
{ {
sLog.outError("Item text ids overflow!! Can't continue, shuting down server. "); sLog.outError("Item text ids overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_ItemTextId; return m_ItemTextId;
@ -5175,7 +5175,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiItemGuid; ++m_hiItemGuid;
if(m_hiItemGuid>=0xFFFFFFFF) if(m_hiItemGuid>=0xFFFFFFFF)
{ {
sLog.outError("Item guid overflow!! Can't continue, shuting down server. "); sLog.outError("Item guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiItemGuid; return m_hiItemGuid;
@ -5183,7 +5183,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiCreatureGuid; ++m_hiCreatureGuid;
if(m_hiCreatureGuid>=0x00FFFFFF) if(m_hiCreatureGuid>=0x00FFFFFF)
{ {
sLog.outError("Creature guid overflow!! Can't continue, shuting down server. "); sLog.outError("Creature guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiCreatureGuid; return m_hiCreatureGuid;
@ -5191,7 +5191,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiPetGuid; ++m_hiPetGuid;
if(m_hiPetGuid>=0x00FFFFFF) if(m_hiPetGuid>=0x00FFFFFF)
{ {
sLog.outError("Pet guid overflow!! Can't continue, shuting down server. "); sLog.outError("Pet guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiPetGuid; return m_hiPetGuid;
@ -5199,7 +5199,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiCharGuid; ++m_hiCharGuid;
if(m_hiCharGuid>=0xFFFFFFFF) if(m_hiCharGuid>=0xFFFFFFFF)
{ {
sLog.outError("Players guid overflow!! Can't continue, shuting down server. "); sLog.outError("Players guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiCharGuid; return m_hiCharGuid;
@ -5207,7 +5207,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiGoGuid; ++m_hiGoGuid;
if(m_hiGoGuid>=0x00FFFFFF) if(m_hiGoGuid>=0x00FFFFFF)
{ {
sLog.outError("Gameobject guid overflow!! Can't continue, shuting down server. "); sLog.outError("Gameobject guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiGoGuid; return m_hiGoGuid;
@ -5215,7 +5215,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiCorpseGuid; ++m_hiCorpseGuid;
if(m_hiCorpseGuid>=0xFFFFFFFF) if(m_hiCorpseGuid>=0xFFFFFFFF)
{ {
sLog.outError("Corpse guid overflow!! Can't continue, shuting down server. "); sLog.outError("Corpse guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiCorpseGuid; return m_hiCorpseGuid;
@ -5223,7 +5223,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
++m_hiDoGuid; ++m_hiDoGuid;
if(m_hiDoGuid>=0xFFFFFFFF) if(m_hiDoGuid>=0xFFFFFFFF)
{ {
sLog.outError("DynamicObject guid overflow!! Can't continue, shuting down server. "); sLog.outError("DynamicObject guid overflow!! Can't continue, shutting down server. ");
sWorld.m_stopEvent = true; sWorld.m_stopEvent = true;
} }
return m_hiDoGuid; return m_hiDoGuid;
@ -6067,7 +6067,7 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo
return true; return true;
} }
if(strictMask & 0x1) // basic latin if(strictMask & 0x1) // basic Latin
{ {
if(isBasicLatinString(wstr,numericOrSpace)) if(isBasicLatinString(wstr,numericOrSpace))
return true; return true;
@ -6356,7 +6356,7 @@ const char *ObjectMgr::GetMangosString(int32 entry, int locale_idx) const
void ObjectMgr::LoadFishingBaseSkillLevel() void ObjectMgr::LoadFishingBaseSkillLevel()
{ {
mFishingBaseForArea.clear(); // for relaod case mFishingBaseForArea.clear(); // for reload case
uint32 count = 0; uint32 count = 0;
QueryResult *result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level"); QueryResult *result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level");
@ -6672,7 +6672,7 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial)
void ObjectMgr::LoadGameTele() void ObjectMgr::LoadGameTele()
{ {
m_GameTeleMap.clear(); // for relaod case m_GameTeleMap.clear(); // for reload case
uint32 count = 0; uint32 count = 0;
QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele"); QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");

View file

@ -362,7 +362,7 @@ Player::Player (WorldSession *session): Unit()
m_temporaryUnsummonedPetNumber = 0; m_temporaryUnsummonedPetNumber = 0;
//cache for UNIT_CREATED_BY_SPELL to allow //cache for UNIT_CREATED_BY_SPELL to allow
//returning reagests for temporarily removed pets //returning reagents for temporarily removed pets
//when dying/logging out //when dying/logging out
m_oldpetspell = 0; m_oldpetspell = 0;
@ -596,7 +596,7 @@ bool Player::Create( uint32 guidlow, std::string name, uint8 race, uint8 class_,
SetHealth(GetMaxHealth()); SetHealth(GetMaxHealth());
if (getPowerType()==POWER_MANA) if (getPowerType()==POWER_MANA)
{ {
UpdateMaxPower(POWER_MANA); // Update max Mana (for add bonus from intelect) UpdateMaxPower(POWER_MANA); // Update max Mana (for add bonus from intellect)
SetPower(POWER_MANA,GetMaxPower(POWER_MANA)); SetPower(POWER_MANA,GetMaxPower(POWER_MANA));
} }
@ -762,7 +762,7 @@ void Player::HandleDrowning()
return; return;
} }
uint32 UnderWaterTime = 1*MINUTE*1000; // default leangthL 1 min uint32 UnderWaterTime = 1*MINUTE*1000; // default length 1 min
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING); AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i) for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
@ -1445,7 +1445,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// client without expansion support // client without expansion support
if(GetSession()->Expansion() < mEntry->Expansion()) if(GetSession()->Expansion() < mEntry->Expansion())
{ {
sLog.outDebug("Player %s using client without required expansion tried teleport to non accessable map %u", GetName(), mapid); sLog.outDebug("Player %s using client without required expansion tried teleport to non accessible map %u", GetName(), mapid);
if(GetTransport()) if(GetTransport())
RepopAtGraveyard(); // teleport to near graveyard if on transport, looks blizz like :) RepopAtGraveyard(); // teleport to near graveyard if on transport, looks blizz like :)
@ -1473,7 +1473,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
SetSemaphoreTeleport(true); SetSemaphoreTeleport(true);
// The player was ported to another map and looses the duel immediatly. // The player was ported to another map and looses the duel immediately.
// We have to perform this check before the teleport, otherwise the // We have to perform this check before the teleport, otherwise the
// ObjectAccessor won't find the flag. // ObjectAccessor won't find the flag.
if (duel && GetMapId()!=mapid) if (duel && GetMapId()!=mapid)
@ -3668,7 +3668,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
SetPower(POWER_ENERGY, uint32(GetMaxPower(POWER_ENERGY)*restore_percent)); SetPower(POWER_ENERGY, uint32(GetMaxPower(POWER_ENERGY)*restore_percent));
} }
// update visbility // update visibility
ObjectAccessor::UpdateVisibilityForPlayer(this); ObjectAccessor::UpdateVisibilityForPlayer(this);
// some items limited to specific map // some items limited to specific map
@ -4135,7 +4135,7 @@ void Player::UpdateLocalChannels(uint32 newZone )
// leave old channel // leave old channel
(*i)->Leave(GetGUID(),false); // not send leave channel, it already replaced at client (*i)->Leave(GetGUID(),false); // not send leave channel, it already replaced at client
std::string name = (*i)->GetName(); // stroe name, (*i)erase in LeftChannel std::string name = (*i)->GetName(); // store name, (*i)erase in LeftChannel
LeftChannel(*i); // remove from player's channel list LeftChannel(*i); // remove from player's channel list
cMgr->LeftChannel(name); // delete if empty cMgr->LeftChannel(name); // delete if empty
} }
@ -4170,7 +4170,7 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa
{ {
if(modGroup >= BASEMOD_END || modType >= MOD_END) if(modGroup >= BASEMOD_END || modType >= MOD_END)
{ {
sLog.outError("ERROR in HandleBaseModValue(): nonexisted BaseModGroup of wrong BaseModType!"); sLog.outError("ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!");
return; return;
} }
@ -4207,7 +4207,7 @@ float Player::GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const
{ {
if(modGroup >= BASEMOD_END || modType > MOD_END) if(modGroup >= BASEMOD_END || modType > MOD_END)
{ {
sLog.outError("ERROR: trial to access nonexisted BaseModGroup or wrong BaseModType!"); sLog.outError("ERROR: trial to access non existed BaseModGroup or wrong BaseModType!");
return 0.0f; return 0.0f;
} }
@ -4879,7 +4879,7 @@ void Player::SetSkill(uint32 id, uint16 currVal, uint16 maxVal)
{ {
if (_spell_idx->second->skillId == id) if (_spell_idx->second->skillId == id)
{ {
// this may remove more than one spell (dependants) // this may remove more than one spell (dependents)
removeSpell(itr->first); removeSpell(itr->first);
next = m_spells.begin(); next = m_spells.begin();
break; break;
@ -6169,7 +6169,7 @@ void Player::UpdateZone(uint32 newZone)
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
SetRestType(REST_TYPE_NO); SetRestType(REST_TYPE_NO);
// Set player to FFA PVP when not in rested enviroment. // Set player to FFA PVP when not in rested environment.
if(sWorld.IsFFAPvPRealm()) if(sWorld.IsFFAPvPRealm())
SetFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP); SetFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
} }
@ -7568,7 +7568,7 @@ void Player::SendInitWorldStates()
data << uint32(0xaa8) << uint32(0x1); // 22 2728 Mage Tower uncontrolled (1 - yes, 0 - no) data << uint32(0xaa8) << uint32(0x1); // 22 2728 Mage Tower uncontrolled (1 - yes, 0 - no)
data << uint32(0xaa7) << uint32(0x0); // 23 2727 Fel Reaver - Horde control data << uint32(0xaa7) << uint32(0x0); // 23 2727 Fel Reaver - Horde control
data << uint32(0xaa6) << uint32(0x0); // 24 2726 Fel Reaver - Alliance control data << uint32(0xaa6) << uint32(0x0); // 24 2726 Fel Reaver - Alliance control
data << uint32(0xaa5) << uint32(0x1); // 25 2725 Fel Reaver uncontroled (1 - yes, 0 - no) data << uint32(0xaa5) << uint32(0x1); // 25 2725 Fel Reaver uncontrolled (1 - yes, 0 - no)
data << uint32(0xaa4) << uint32(0x0); // 26 2724 Boold Elf - Horde control data << uint32(0xaa4) << uint32(0x0); // 26 2724 Boold Elf - Horde control
data << uint32(0xaa3) << uint32(0x0); // 27 2723 Boold Elf - Alliance control data << uint32(0xaa3) << uint32(0x0); // 27 2723 Boold Elf - Alliance control
data << uint32(0xaa2) << uint32(0x1); // 28 2722 Boold Elf uncontrolled (1 - yes, 0 - no) data << uint32(0xaa2) << uint32(0x1); // 28 2722 Boold Elf uncontrolled (1 - yes, 0 - no)
@ -8718,7 +8718,7 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
} }
} }
// not specific slot or have spece for partly store only in specific slot // not specific slot or have space for partly store only in specific slot
// in specific bag // in specific bag
if( bag != NULL_BAG ) if( bag != NULL_BAG )
@ -9373,7 +9373,7 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
if(eslot != EQUIPMENT_SLOT_MAINHAND) if(eslot != EQUIPMENT_SLOT_MAINHAND)
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
// offhand item must can be stored in inventitory for offhand item and it also must be unequipped // offhand item must can be stored in inventory for offhand item and it also must be unequipped
Item *offItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND ); Item *offItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
ItemPosCountVec off_dest; ItemPosCountVec off_dest;
if( offItem && (!not_loading || if( offItem && (!not_loading ||
@ -9484,7 +9484,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
return EQUIP_ERR_OK; return EQUIP_ERR_OK;
} }
// not specific slot or have spece for partly store only in specific slot // not specific slot or have space for partly store only in specific slot
// in specific bag // in specific bag
if( bag != NULL_BAG ) if( bag != NULL_BAG )
@ -9546,7 +9546,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
} }
} }
// not specific bag or have spece for partly store only in specific bag // not specific bag or have space for partly store only in specific bag
// search stack for merge to // search stack for merge to
if( pProto->Stackable > 1 ) if( pProto->Stackable > 1 )
@ -10178,7 +10178,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool
pLastItem->SetOwnerGUID(GetGUID()); pLastItem->SetOwnerGUID(GetGUID());
// if this original item then it need create record in inventory // if this original item then it need create record in inventory
// in case trade we laready have item in other player inventory // in case trade we already have item in other player inventory
pLastItem->SetState(in_characterInventoryDB ? ITEM_CHANGED : ITEM_NEW, this); pLastItem->SetState(in_characterInventoryDB ? ITEM_CHANGED : ITEM_NEW, this);
} }
} }
@ -10420,7 +10420,7 @@ void Player::DestroyZoneLimitedItem( bool update, uint32 new_zone )
void Player::DestroyConjuredItems( bool update ) void Player::DestroyConjuredItems( bool update )
{ {
// used when entering arena // used when entering arena
// distroys all conjured items // destroys all conjured items
sLog.outDebug( "STORAGE: DestroyConjuredItems" ); sLog.outDebug( "STORAGE: DestroyConjuredItems" );
// in inventory // in inventory
@ -10968,7 +10968,7 @@ void Player::TradeCancel(bool sendback)
{ {
if(pTrader) if(pTrader)
{ {
// send yellow "Trade cancelled" message to both traders // send yellow "Trade canceled" message to both traders
WorldSession* ws; WorldSession* ws;
ws = GetSession(); ws = GetSession();
if(sendback) if(sendback)
@ -11183,7 +11183,7 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
if(apply) if(apply)
{ {
int32 basepoints = int32(enchant_amount); int32 basepoints = int32(enchant_amount);
// Random Property Exist - try found basepoints for spell (basepoints depencs from item suffix factor) // Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
if (item->GetItemRandomPropertyId() !=0 && !enchant_amount) if (item->GetItemRandomPropertyId() !=0 && !enchant_amount)
{ {
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
@ -12252,7 +12252,7 @@ bool Player::SatisfyQuestPreviousQuest( Quest const* qInfo, bool msg )
return true; return true;
// each-from-all exclusive group ( < 0) // each-from-all exclusive group ( < 0)
// can be start if only all quests in prev quest exclusive group complited and rewarded // can be start if only all quests in prev quest exclusive group completed and rewarded
ObjectMgr::ExclusiveQuestGroups::iterator iter = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator iter = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
@ -13916,7 +13916,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
std::map<uint64, Bag*> bagMap; // fast guid lookup for bags std::map<uint64, Bag*> bagMap; // fast guid lookup for bags
//NOTE: the "order by `bag`" is important because it makes sure //NOTE: the "order by `bag`" is important because it makes sure
//the bagMap is filled before items in the bags are loaded //the bagMap is filled before items in the bags are loaded
//NOTE2: the "order by `slot`" is needed becaue mainhand weapons are (wrongly?) //NOTE2: the "order by `slot`" is needed because mainhand weapons are (wrongly?)
//expected to be equipped before offhand items (TODO: fixme) //expected to be equipped before offhand items (TODO: fixme)
uint32 zone = GetZoneId(); uint32 zone = GetZoneId();
@ -14043,7 +14043,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
while(!problematicItems.empty()) while(!problematicItems.empty())
{ {
// fill mail // fill mail
MailItemsInfo mi; // item list prepering MailItemsInfo mi; // item list preparing
for(int i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i) for(int i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i)
{ {
@ -14591,7 +14591,7 @@ void Player::SendSavedInstances()
} }
} }
//Send opcode 811. true or flase means, whether you have current raid/heroic instances //Send opcode 811. true or false means, whether you have current raid/heroic instances
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP); data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP);
data << uint32(hasBeenSaved); data << uint32(hasBeenSaved);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
@ -16641,7 +16641,7 @@ void Player::SendCooldownEvent(SpellEntry const *spellInfo)
if ( !(spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) ) if ( !(spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) )
return; return;
// Get spell cooldwn // Get spell cooldown
int32 cooldown = GetSpellRecoveryTime(spellInfo); int32 cooldown = GetSpellRecoveryTime(spellInfo);
// Apply spellmods // Apply spellmods
ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, cooldown); ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, cooldown);
@ -17104,7 +17104,7 @@ void Player::SetGroup(Group *group, int8 subgroup)
void Player::SendInitialPacketsBeforeAddToMap() void Player::SendInitialPacketsBeforeAddToMap()
{ {
WorldPacket data(SMSG_SET_REST_START, 4); WorldPacket data(SMSG_SET_REST_START, 4);
data << uint32(0); // unknown, may be rest state time or expirience data << uint32(0); // unknown, may be rest state time or experience
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
// Homebind // Homebind
@ -17696,7 +17696,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons
break; break;
} }
default: default:
sLog.outError("HasItemFitToSpellReqirements: Not handeled spell reqirement for item class %u",spellInfo->EquippedItemClass); sLog.outError("HasItemFitToSpellReqirements: Not handled spell requirement for item class %u",spellInfo->EquippedItemClass);
break; break;
} }
@ -17741,7 +17741,7 @@ void Player::RemoveItemDependentAurasAndCasts( Item * pItem )
uint32 Player::GetResurrectionSpellId() uint32 Player::GetResurrectionSpellId()
{ {
// search priceless resurrection possabilities // search priceless resurrection possibilities
uint32 prio = 0; uint32 prio = 0;
uint32 spell_id = 0; uint32 spell_id = 0;
AuraList const& dummyAuras = GetAurasByType(SPELL_AURA_DUMMY); AuraList const& dummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
@ -17895,7 +17895,7 @@ uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
{ {
Item* item = GetWeaponForAttack(attType,true); Item* item = GetWeaponForAttack(attType,true);
// unarmmed only with base attack // unarmed only with base attack
if(attType != BASE_ATTACK && !item) if(attType != BASE_ATTACK && !item)
return 0; return 0;

View file

@ -346,7 +346,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before. m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before.
m_casttime = 0; // setup to correct value in Spell::prepare, don't must be used before. m_casttime = 0; // setup to correct value in Spell::prepare, don't must be used before.
m_timer = 0; // will set to castime in preper m_timer = 0; // will set to castime in prepare
m_needAliveTargetMask = 0; m_needAliveTargetMask = 0;
@ -1483,7 +1483,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
}break; }break;
// TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some sceals, fire shield from imp, etc..) // TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some seals, fire shield from imp, etc..)
case TARGET_SINGLE_PARTY: case TARGET_SINGLE_PARTY:
{ {
Unit *target = m_targets.getUnitTarget(); Unit *target = m_targets.getUnitTarget();
@ -2884,7 +2884,7 @@ void Spell::SendChannelStart(uint32 duration)
{ {
WorldObject* target = NULL; WorldObject* target = NULL;
// select first not rsusted target from target list for _0_ effect // select first not resisted target from target list for _0_ effect
if(!m_UniqueTargetInfo.empty()) if(!m_UniqueTargetInfo.empty())
{ {
for(std::list<TargetInfo>::iterator itr= m_UniqueTargetInfo.begin();itr != m_UniqueTargetInfo.end();++itr) for(std::list<TargetInfo>::iterator itr= m_UniqueTargetInfo.begin();itr != m_UniqueTargetInfo.end();++itr)
@ -4011,7 +4011,7 @@ int16 Spell::PetCanCast(Unit* target)
if(!m_caster->isAlive()) if(!m_caster->isAlive())
return SPELL_FAILED_CASTER_DEAD; return SPELL_FAILED_CASTER_DEAD;
if(m_caster->IsNonMeleeSpellCasted(false)) //prevent spellcast interuption by another spellcast if(m_caster->IsNonMeleeSpellCasted(false)) //prevent spellcast interruption by another spellcast
return SPELL_FAILED_SPELL_IN_PROGRESS; return SPELL_FAILED_SPELL_IN_PROGRESS;
if(m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo)) if(m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo))
return SPELL_FAILED_AFFECTING_COMBAT; return SPELL_FAILED_AFFECTING_COMBAT;
@ -4102,7 +4102,7 @@ uint8 Spell::CheckCasterAuras() const
else if(m_spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DISPEL_IMMUNITY) else if(m_spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DISPEL_IMMUNITY)
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i])); dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
} }
//immune movement impairement and loss of control //immune movement impairment and loss of control
if(m_spellInfo->Id==(uint32)42292) if(m_spellInfo->Id==(uint32)42292)
mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
} }
@ -4585,7 +4585,7 @@ uint8 Spell::CheckItems()
return SPELL_FAILED_CANT_BE_DISENCHANTED; return SPELL_FAILED_CANT_BE_DISENCHANTED;
uint32 item_quality = itemProto->Quality; uint32 item_quality = itemProto->Quality;
// 2.0.x addon: Check player enchanting level agains the item desenchanting requirements // 2.0.x addon: Check player enchanting level against the item disenchanting requirements
uint32 item_disenchantskilllevel = itemProto->RequiredDisenchantSkill; uint32 item_disenchantskilllevel = itemProto->RequiredDisenchantSkill;
if (item_disenchantskilllevel == uint32(-1)) if (item_disenchantskilllevel == uint32(-1))
return SPELL_FAILED_CANT_BE_DISENCHANTED; return SPELL_FAILED_CANT_BE_DISENCHANTED;

View file

@ -210,7 +210,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI &Aura::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI
&Aura::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE &Aura::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE
&Aura::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell &Aura::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell
&Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemended in Unit::MagicSpellHitResult &Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult
&Aura::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT &Aura::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT
&Aura::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA &Aura::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA
&Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE &Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE
@ -224,7 +224,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK &Aura::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK
&Aura::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK &Aura::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
&Aura::HandleUnused, //173 SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell &Aura::HandleUnused, //173 SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell
&Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT) &Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT)
&Aura::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus &Aura::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus
&Aura::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end &Aura::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end
&Aura::HandleNULL, //177 SPELL_AURA_AOE_CHARM &Aura::HandleNULL, //177 SPELL_AURA_AOE_CHARM
@ -237,7 +237,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
&Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
&Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult &Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult
&Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemended in Unit::GetUnitCriticalChance &Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
&Aura::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance &Aura::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
&Aura::HandleModRating, //189 SPELL_AURA_MOD_RATING &Aura::HandleModRating, //189 SPELL_AURA_MOD_RATING
&Aura::HandleNULL, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN &Aura::HandleNULL, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN
@ -492,10 +492,9 @@ Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoi
uint32 triggeredSpellId = spellproto->EffectTriggerSpell[eff]; uint32 triggeredSpellId = spellproto->EffectTriggerSpell[eff];
SpellEntry const* triggredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId); if(SpellEntry const* triggeredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId))
if (triggredSpellInfo)
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
if (triggredSpellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_ENEMY) if (triggeredSpellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_ENEMY)
return new SingleEnemyTargetAura(spellproto, eff, currentBasePoints, target, caster, castItem); return new SingleEnemyTargetAura(spellproto, eff, currentBasePoints, target, caster, castItem);
return new Aura(spellproto, eff, currentBasePoints, target, caster, castItem); return new Aura(spellproto, eff, currentBasePoints, target, caster, castItem);
@ -1075,7 +1074,7 @@ void Aura::_RemoveAura()
((Player*)caster)->SendCooldownEvent(GetSpellProto()); ((Player*)caster)->SendCooldownEvent(GetSpellProto());
} }
} }
else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove proccess. else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove process.
UpdateSlotCounterAndDuration(false); UpdateSlotCounterAndDuration(false);
} }
@ -1225,12 +1224,12 @@ void Aura::TriggerSpell()
uint64 originalCasterGUID = GetCasterGUID(); uint64 originalCasterGUID = GetCasterGUID();
SpellEntry const *triggredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
SpellEntry const *auraSpellInfo = GetSpellProto(); SpellEntry const *auraSpellInfo = GetSpellProto();
uint32 auraId = auraSpellInfo->Id; uint32 auraId = auraSpellInfo->Id;
// specific code for cases with no trigger spell provided in field // specific code for cases with no trigger spell provided in field
if (triggredSpellInfo == NULL) if (triggeredSpellInfo == NULL)
{ {
switch(auraSpellInfo->SpellFamilyName) switch(auraSpellInfo->SpellFamilyName)
{ {
@ -1238,7 +1237,7 @@ void Aura::TriggerSpell()
{ {
switch(auraId) switch(auraId)
{ {
// Firestone Passive (1-5 rangs) // Firestone Passive (1-5 ranks)
case 758: case 758:
case 17945: case 17945:
case 17947: case 17947:
@ -1272,7 +1271,7 @@ void Aura::TriggerSpell()
// case 812: break; // case 812: break;
// // Polymorphic Ray // // Polymorphic Ray
// case 6965: break; // case 6965: break;
// // Fire Nova (1-7 Rangs) // // Fire Nova (1-7 ranks)
// case 8350: // case 8350:
// case 8508: // case 8508:
// case 8509: // case 8509:
@ -1831,8 +1830,8 @@ void Aura::TriggerSpell()
break; break;
} }
// Reget trigger spell proto // Reget trigger spell proto
triggredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
if(triggredSpellInfo == NULL) if(triggeredSpellInfo == NULL)
{ {
sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex()); sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex());
return; return;
@ -1840,7 +1839,7 @@ void Aura::TriggerSpell()
} }
else else
{ {
// Spell exist but require costum code // Spell exist but require custom code
switch(auraId) switch(auraId)
{ {
// Curse of Idiocy // Curse of Idiocy
@ -1850,7 +1849,7 @@ void Aura::TriggerSpell()
// BUT: // BUT:
// 1) target show casting at each triggered cast: target don't must show casting animation for any triggered spell // 1) target show casting at each triggered cast: target don't must show casting animation for any triggered spell
// but must show affect apply like item casting // but must show affect apply like item casting
// 2) maybe aura must be replace by new with accumulative stat mods insteed stacking // 2) maybe aura must be replace by new with accumulative stat mods instead stacking
// prevent cast by triggered auras // prevent cast by triggered auras
if(m_caster_guid == m_target->GetGUID()) if(m_caster_guid == m_target->GetGUID())
@ -1890,7 +1889,7 @@ void Aura::TriggerSpell()
} }
} }
// All ok cast by default case // All ok cast by default case
Spell *spell = new Spell(caster, triggredSpellInfo, true, originalCasterGUID ); Spell *spell = new Spell(caster, triggeredSpellInfo, true, originalCasterGUID );
SpellCastTargets targets; SpellCastTargets targets;
targets.setUnitTarget( target ); targets.setUnitTarget( target );
@ -2014,7 +2013,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// Dark Fiend // Dark Fiend
if(GetId()==45934) if(GetId()==45934)
{ {
// Kill target if dispeled // Kill target if dispelled
if (m_removeMode==AURA_REMOVE_BY_DISPEL) if (m_removeMode==AURA_REMOVE_BY_DISPEL)
m_target->DealDamage(m_target, m_target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); m_target->DealDamage(m_target, m_target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return; return;
@ -2720,7 +2719,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
Aura* handledAura = *otherTransforms.begin(); Aura* handledAura = *otherTransforms.begin();
for(Unit::AuraList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i) for(Unit::AuraList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i)
{ {
// negative auras are prefered // negative auras are preferred
if(!IsPositiveSpell((*i)->GetSpellProto()->Id)) if(!IsPositiveSpell((*i)->GetSpellProto()->Id))
{ {
handledAura = *i; handledAura = *i;
@ -3166,7 +3165,7 @@ void Aura::HandleAuraModDisarm(bool apply, bool Real)
if (m_target->GetTypeId() != TYPEID_PLAYER) if (m_target->GetTypeId() != TYPEID_PLAYER)
return; return;
// main-hand attack speed already set to special value for feral form already and don't must chnage and reset at remove. // main-hand attack speed already set to special value for feral form already and don't must change and reset at remove.
if (((Player *)m_target)->IsInFeralForm()) if (((Player *)m_target)->IsInFeralForm())
return; return;
@ -3470,7 +3469,7 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
if (currentSpell && currentSpell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE) if (currentSpell && currentSpell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
{ {
uint32 state = currentSpell->getState(); uint32 state = currentSpell->getState();
// Stop spells on prepere or casting state // Stop spells on prepare or casting state
if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING ) if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING )
{ {
currentSpell->cancel(); currentSpell->cancel();
@ -4038,7 +4037,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
int32 mws = caster->GetAttackTime(BASE_ATTACK); int32 mws = caster->GetAttackTime(BASE_ATTACK);
float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE); float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE);
float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE); float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE);
// WARNING! in 3.0 multipler 0.00743f change to 0.6 // WARNING! in 3.0 multiplier 0.00743f change to 0.6
m_modifier.m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.00743f); m_modifier.m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.00743f);
} }
return; return;
@ -4066,7 +4065,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
// Rip // Rip
if (m_spellProto->SpellFamilyFlags & 0x000000000000800000LL) if (m_spellProto->SpellFamilyFlags & 0x000000000000800000LL)
{ {
// $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, wheather 4 or 5 CPs are being used] // $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, whether 4 or 5 CPs are being used]
if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER) if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER)
{ {
uint8 cp = ((Player*)caster)->GetComboPoints(); uint8 cp = ((Player*)caster)->GetComboPoints();
@ -4119,7 +4118,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
// Rupture // Rupture
if (m_spellProto->SpellFamilyFlags & 0x000000000000100000LL) if (m_spellProto->SpellFamilyFlags & 0x000000000000100000LL)
{ {
// Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP inrease the contribution from AP] // Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP increase the contribution from AP]
if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER) if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER)
{ {
uint8 cp = ((Player*)caster)->GetComboPoints(); uint8 cp = ((Player*)caster)->GetComboPoints();
@ -4449,9 +4448,9 @@ void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real)
if(m_modifier.m_miscvalue != SPELL_SCHOOL_MASK_NORMAL) if(m_modifier.m_miscvalue != SPELL_SCHOOL_MASK_NORMAL)
{ {
// support required adding replace UpdateArmor by loop by UpdateResistence at intelect update // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
// and include in UpdateResistence same code as in UpdateArmor for aura mod apply. // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
sLog.outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) need adding support for non-armor resistences!"); sLog.outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) need adding support for non-armor resistances!");
return; return;
} }

View file

@ -708,7 +708,7 @@ void Spell::EffectDummy(uint32 i)
} }
case 13567: // Dummy Trigger case 13567: // Dummy Trigger
{ {
// can be used for different aura triggreing, so select by aura // can be used for different aura triggering, so select by aura
if(!m_triggeredByAuraSpell || !unitTarget) if(!m_triggeredByAuraSpell || !unitTarget)
return; return;
@ -2640,31 +2640,31 @@ void Spell::EffectEnergize(uint32 i)
return; return;
// Some level depends spells // Some level depends spells
int multipler = 0; int multiplier = 0;
int level_diff = 0; int level_diff = 0;
switch (m_spellInfo->Id) switch (m_spellInfo->Id)
{ {
// Restore Energy // Restore Energy
case 9512: case 9512:
level_diff = m_caster->getLevel() - 40; level_diff = m_caster->getLevel() - 40;
multipler = 2; multiplier = 2;
break; break;
// Blood Fury // Blood Fury
case 24571: case 24571:
level_diff = m_caster->getLevel() - 60; level_diff = m_caster->getLevel() - 60;
multipler = 10; multiplier = 10;
break; break;
// Burst of Energy // Burst of Energy
case 24532: case 24532:
level_diff = m_caster->getLevel() - 60; level_diff = m_caster->getLevel() - 60;
multipler = 4; multiplier = 4;
break; break;
default: default:
break; break;
} }
if (level_diff > 0) if (level_diff > 0)
damage -= multipler * level_diff; damage -= multiplier * level_diff;
if(damage < 0) if(damage < 0)
return; return;

View file

@ -443,7 +443,7 @@ void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
if(!HasAuraType(auraType)) if(!HasAuraType(auraType))
return; return;
// The chance to dispell an aura depends on the damage taken with respect to the casters level. // The chance to dispel an aura depends on the damage taken with respect to the casters level.
uint32 max_dmg = getLevel() > 8 ? 25 * getLevel() - 150 : 50; uint32 max_dmg = getLevel() > 8 ? 25 * getLevel() - 150 : 50;
float chance = float(damage) / max_dmg * 100.0f; float chance = float(damage) / max_dmg * 100.0f;
if (roll_chance_f(chance)) if (roll_chance_f(chance))
@ -498,7 +498,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
} }
pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_FEAR, damage); pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_FEAR, damage);
// root type spells do not dispell the root effect // root type spells do not dispel the root effect
if(!spellProto || spellProto->Mechanic != MECHANIC_ROOT) if(!spellProto || spellProto->Mechanic != MECHANIC_ROOT)
pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_ROOT, damage); pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_ROOT, damage);
@ -780,7 +780,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
{ {
if(getVictim()) if(getVictim())
{ {
// if have target and damage pVictim just call AI recation // if have target and damage pVictim just call AI reaction
if(pVictim != getVictim() && pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->AI()) if(pVictim != getVictim() && pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->AI())
((Creature*)pVictim)->AI()->AttackedBy(this); ((Creature*)pVictim)->AI()->AttackedBy(this);
} }
@ -927,7 +927,7 @@ void Unit::CastStop(uint32 except_spellid)
InterruptSpell(i,false); InterruptSpell(i,false);
} }
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
{ {
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
@ -937,10 +937,10 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte
return; return;
} }
CastSpell(Victim,spellInfo,triggered,castItem,triggredByAura, originalCaster); CastSpell(Victim,spellInfo,triggered,castItem,triggeredByAura, originalCaster);
} }
void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
{ {
if(!spellInfo) if(!spellInfo)
{ {
@ -951,18 +951,18 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
if (castItem) if (castItem)
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
if(!originalCaster && triggredByAura) if(!originalCaster && triggeredByAura)
originalCaster = triggredByAura->GetCasterGUID(); originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster ); Spell *spell = new Spell(this, spellInfo, triggered, originalCaster );
SpellCastTargets targets; SpellCastTargets targets;
targets.setUnitTarget( Victim ); targets.setUnitTarget( Victim );
spell->m_CastItem = castItem; spell->m_CastItem = castItem;
spell->prepare(&targets, triggredByAura); spell->prepare(&targets, triggeredByAura);
} }
void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
{ {
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
@ -972,10 +972,10 @@ void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32
return; return;
} }
CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggredByAura, originalCaster); CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggeredByAura, originalCaster);
} }
void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
{ {
if(!spellInfo) if(!spellInfo)
{ {
@ -986,8 +986,8 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const
if (castItem) if (castItem)
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
if(!originalCaster && triggredByAura) if(!originalCaster && triggeredByAura)
originalCaster = triggredByAura->GetCasterGUID(); originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster); Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
@ -1003,11 +1003,11 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const
SpellCastTargets targets; SpellCastTargets targets;
targets.setUnitTarget( Victim ); targets.setUnitTarget( Victim );
spell->m_CastItem = castItem; spell->m_CastItem = castItem;
spell->prepare(&targets, triggredByAura); spell->prepare(&targets, triggeredByAura);
} }
// used for scripting // used for scripting
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
{ {
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
@ -1017,11 +1017,11 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
return; return;
} }
CastSpell(x, y, z,spellInfo,triggered,castItem,triggredByAura, originalCaster); CastSpell(x, y, z,spellInfo,triggered,castItem,triggeredByAura, originalCaster);
} }
// used for scripting // used for scripting
void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
{ {
if(!spellInfo) if(!spellInfo)
{ {
@ -1032,15 +1032,15 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo
if (castItem) if (castItem)
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
if(!originalCaster && triggredByAura) if(!originalCaster && triggeredByAura)
originalCaster = triggredByAura->GetCasterGUID(); originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster ); Spell *spell = new Spell(this, spellInfo, triggered, originalCaster );
SpellCastTargets targets; SpellCastTargets targets;
targets.setDestination(x, y, z); targets.setDestination(x, y, z);
spell->m_CastItem = castItem; spell->m_CastItem = castItem;
spell->prepare(&targets, triggredByAura); spell->prepare(&targets, triggeredByAura);
} }
void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *damage, CleanDamage *cleanDamage, bool *crit, bool isTriggeredSpell) void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *damage, CleanDamage *cleanDamage, bool *crit, bool isTriggeredSpell)
@ -1048,7 +1048,7 @@ void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *da
// TODO this in only generic way, check for exceptions // TODO this in only generic way, check for exceptions
DEBUG_LOG("DealFlatDamage (BEFORE) >> DMG:%u", *damage); DEBUG_LOG("DealFlatDamage (BEFORE) >> DMG:%u", *damage);
// Per-damage calss calculation // Per-damage class calculation
switch (spellInfo->DmgClass) switch (spellInfo->DmgClass)
{ {
// Melee and Ranged Spells // Melee and Ranged Spells
@ -1652,7 +1652,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
RemainingDamage -= currentAbsorb; RemainingDamage -= currentAbsorb;
} }
// only split damage if not damaing yourself // only split damage if not damaging yourself
if(pVictim != this) if(pVictim != this)
{ {
AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT); AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT);
@ -2173,7 +2173,7 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
else if (attType == OFF_ATTACK) else if (attType == OFF_ATTACK)
hitInfo = HITINFO_LEFTSWING; hitInfo = HITINFO_LEFTSWING;
else else
return; // ignore ranaged case return; // ignore ranged case
uint32 extraAttacks = m_extraAttacks; uint32 extraAttacks = m_extraAttacks;
@ -2287,7 +2287,7 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt
} }
else else
{ {
// parry can be avoided only by some abilites // parry can be avoided only by some abilities
parry_chance = pVictim->GetUnitParryChance(); parry_chance = pVictim->GetUnitParryChance();
// block might be bypassed by it as well // block might be bypassed by it as well
block_chance = pVictim->GetUnitBlockChance(); block_chance = pVictim->GetUnitBlockChance();
@ -2301,7 +2301,7 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt
// Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura // Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura
crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask); crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask);
if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents fpr speed if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents for speed
{ {
AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT); AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i) for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i)
@ -2862,7 +2862,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
} }
// TODO need use this code for spell hit result calculation // TODO need use this code for spell hit result calculation
// now code commented for compotability // now code commented for computability
switch (spell->DmgClass) switch (spell->DmgClass)
{ {
case SPELL_DAMAGE_CLASS_RANGED: case SPELL_DAMAGE_CLASS_RANGED:
@ -3033,7 +3033,7 @@ float Unit::GetUnitBlockChance() const
if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block) if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block)
return GetFloatValue(PLAYER_BLOCK_PERCENTAGE); return GetFloatValue(PLAYER_BLOCK_PERCENTAGE);
} }
// is player but has no block ability or no not broken shield equiped // is player but has no block ability or no not broken shield equipped
return 0.0f; return 0.0f;
} }
else else
@ -3114,7 +3114,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
if(((Player*)this)->IsInFeralForm()) if(((Player*)this)->IsInFeralForm())
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
// weaon skill or (unarmed for base attack) // weapon skill or (unarmed for base attack)
uint32 skill = item ? item->GetSkill() : SKILL_UNARMED; uint32 skill = item ? item->GetSkill() : SKILL_UNARMED;
// in PvP use full skill instead current skill value // in PvP use full skill instead current skill value
@ -3459,13 +3459,13 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
float Unit::GetTotalAuraMultiplier(AuraType auratype) const float Unit::GetTotalAuraMultiplier(AuraType auratype) const
{ {
float multipler = 1.0f; float multiplier = 1.0f;
AuraList const& mTotalAuraList = GetAurasByType(auratype); AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
multipler *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f; multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
return multipler; return multiplier;
} }
int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const
@ -3508,16 +3508,16 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask)
float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
{ {
float multipler = 1.0f; float multiplier = 1.0f;
AuraList const& mTotalAuraList = GetAurasByType(auratype); AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{ {
Modifier* mod = (*i)->GetModifier(); Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue & misc_mask) if (mod->m_miscvalue & misc_mask)
multipler *= (100.0f + mod->m_amount)/100.0f; multiplier *= (100.0f + mod->m_amount)/100.0f;
} }
return multipler; return multiplier;
} }
int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
@ -3566,16 +3566,16 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value)
float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const
{ {
float multipler = 1.0f; float multiplier = 1.0f;
AuraList const& mTotalAuraList = GetAurasByType(auratype); AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{ {
Modifier* mod = (*i)->GetModifier(); Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue == misc_value) if (mod->m_miscvalue == misc_value)
multipler *= (100.0f + mod->m_amount)/100.0f; multiplier *= (100.0f + mod->m_amount)/100.0f;
} }
return multipler; return multiplier;
} }
int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
@ -3691,7 +3691,7 @@ bool Unit::AddAura(Aura *Aur)
if (!RemoveNoStackAurasDueToAura(Aur)) if (!RemoveNoStackAurasDueToAura(Aur))
{ {
delete Aur; delete Aur;
return false; // couldnt remove conflicting aura with higher rank return false; // couldn't remove conflicting aura with higher rank
} }
} }
@ -3823,7 +3823,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
for(int j = 0; j < 3; ++j) for(int j = 0; j < 3; ++j)
{ {
// prevent remove dummy triggered spells at next effect aura add // prevent remove dummy triggered spells at next effect aura add
switch(spellProto->Effect[j]) // main spell auras added added after triggred spell switch(spellProto->Effect[j]) // main spell auras added added after triggered spell
{ {
case SPELL_EFFECT_DUMMY: case SPELL_EFFECT_DUMMY:
switch(spellId) switch(spellId)
@ -3836,7 +3836,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
if(is_triggered_by_spell) if(is_triggered_by_spell)
break; break;
// prevent remove form main spell by triggred passive spells // prevent remove form main spell by triggered passive spells
switch(i_spellProto->EffectApplyAuraName[j]) // main aura added before triggered spell switch(i_spellProto->EffectApplyAuraName[j]) // main aura added before triggered spell
{ {
case SPELL_AURA_MOD_SHAPESHIFT: case SPELL_AURA_MOD_SHAPESHIFT:
@ -4005,7 +4005,7 @@ void Unit::RemoveAurasWithDispelType( DispelType type )
{ {
// Create dispel mask by dispel type // Create dispel mask by dispel type
uint32 dispelMask = GetDispellMask(type); uint32 dispelMask = GetDispellMask(type);
// Dispel all existing auras vs current dispell type // Dispel all existing auras vs current dispel type
AuraMap& auras = GetAuras(); AuraMap& auras = GetAuras();
for(AuraMap::iterator itr = auras.begin(); itr != auras.end(); ) for(AuraMap::iterator itr = auras.begin(); itr != auras.end(); )
{ {
@ -4414,7 +4414,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic
sLog.outDebug("ProcDamageAndSpell: invoked due to spell id %u %s", procSpell->Id, (isTriggeredSpell?"(triggered)":"")); sLog.outDebug("ProcDamageAndSpell: invoked due to spell id %u %s", procSpell->Id, (isTriggeredSpell?"(triggered)":""));
// Assign melee/ranged proc flags for magic attacks, that are actually melee/ranged abilities // Assign melee/ranged proc flags for magic attacks, that are actually melee/ranged abilities
// not assign for spell proc triggered spell to prevent infinity (or unexpacted 2-3 times) melee damage spell proc call with melee damage effect // not assign for spell proc triggered spell to prevent infinity (or unexpected 2-3 times) melee damage spell proc call with melee damage effect
// That is the question though if it's fully correct // That is the question though if it's fully correct
if(procSpell && !isTriggeredSpell) if(procSpell && !isTriggeredSpell)
{ {
@ -4441,7 +4441,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic
// Not much to do if no flags are set. // Not much to do if no flags are set.
if (procAttacker) if (procAttacker)
{ {
// procces auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set // processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcEffectAuraTypes,attType, procSpell, damage, damageSchoolMask); ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcEffectAuraTypes,attType, procSpell, damage, damageSchoolMask);
ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcCastAuraTypes,attType, procSpell, damage, damageSchoolMask); ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcCastAuraTypes,attType, procSpell, damage, damageSchoolMask);
} }
@ -4450,7 +4450,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic
// Not much to do if no flags are set or there is no victim // Not much to do if no flags are set or there is no victim
if(pVictim && pVictim->isAlive() && procVictim) if(pVictim && pVictim->isAlive() && procVictim)
{ {
// procces auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set // processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcEffectAuraTypes,attType,procSpell, damage, damageSchoolMask); pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcEffectAuraTypes,attType,procSpell, damage, damageSchoolMask);
pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcCastAuraTypes,attType,procSpell, damage, damageSchoolMask); pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcCastAuraTypes,attType,procSpell, damage, damageSchoolMask);
} }
@ -4639,7 +4639,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint
case 18765: case 18765:
case 35429: case 35429:
{ {
// prevent chain of triggred spell from same triggred spell // prevent chain of triggered spell from same triggered spell
if(procSpell && procSpell->Id==26654) if(procSpell && procSpell->Id==26654)
return false; return false;
@ -5659,7 +5659,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint
return false; return false;
uint32 spellId = 0; uint32 spellId = 0;
// Every Lightning Bolt and Chain Lightning spell have dublicate vs half damage and zero cost // Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost
switch (procSpell->Id) switch (procSpell->Id)
{ {
// Lightning Bolt // Lightning Bolt
@ -5702,7 +5702,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint
if (procSpell->SpellFamilyFlags & 0x0000000000000002LL) if (procSpell->SpellFamilyFlags & 0x0000000000000002LL)
((Player*)this)->RemoveSpellCooldown(spellId); ((Player*)this)->RemoveSpellCooldown(spellId);
// Hmmm.. in most case spells alredy set half basepoints but... // Hmmm.. in most case spells already set half basepoints but...
// Lightning Bolt (2-10 rank) have full basepoint and half bonus from level // Lightning Bolt (2-10 rank) have full basepoint and half bonus from level
// As on wiki: // As on wiki:
// BUG: Rank 2 to 10 (and maybe 11) of Lightning Bolt will proc another Bolt with FULL damage (not halved). This bug is known and will probably be fixed soon. // BUG: Rank 2 to 10 (and maybe 11) of Lightning Bolt will proc another Bolt with FULL damage (not halved). This bug is known and will probably be fixed soon.
@ -5920,7 +5920,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
if( pVictim == this ) if( pVictim == this )
return false; return false;
// custom chnace // custom chance
float chance = 0; float chance = 0;
switch (triggeredByAura->GetId()) switch (triggeredByAura->GetId())
{ {
@ -6982,7 +6982,7 @@ void Unit::RemoveAllAttackers()
AttackerSet::iterator iter = m_attackers.begin(); AttackerSet::iterator iter = m_attackers.begin();
if(!(*iter)->AttackStop()) if(!(*iter)->AttackStop())
{ {
sLog.outError("WORLD: Unit has an attacker that isnt attacking it!"); sLog.outError("WORLD: Unit has an attacker that isn't attacking it!");
m_attackers.erase(iter); m_attackers.erase(iter);
} }
} }
@ -8278,7 +8278,7 @@ void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType ty
float Unit::GetWeaponProcChance() const float Unit::GetWeaponProcChance() const
{ {
// normalized proc chance for weapon attack speed // normalized proc chance for weapon attack speed
// (odd formulae...) // (odd formula...)
if(isAttackReady(BASE_ATTACK)) if(isAttackReady(BASE_ATTACK))
return (GetAttackTime(BASE_ATTACK) * 1.8f / 1000.0f); return (GetAttackTime(BASE_ATTACK) * 1.8f / 1000.0f);
else if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK)) else if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK))
@ -8507,7 +8507,7 @@ bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList)
if(!IsVisibleInGridForPlayer((Player *)u)) if(!IsVisibleInGridForPlayer((Player *)u))
return false; return false;
// if player is dead then he can't detect anyone in anycases // if player is dead then he can't detect anyone in any cases
if(!u->isAlive()) if(!u->isAlive())
detect = false; detect = false;
} }
@ -9115,7 +9115,7 @@ bool Unit::SelectHostilTarget()
assert(GetTypeId()== TYPEID_UNIT); assert(GetTypeId()== TYPEID_UNIT);
Unit* target = NULL; Unit* target = NULL;
//This function only useful once AI has been initilazied //This function only useful once AI has been initialized
if (!((Creature*)this)->AI()) if (!((Creature*)this)->AI())
return false; return false;
@ -9389,7 +9389,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
{ {
if(unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END) if(unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{ {
sLog.outError("ERROR in HandleStatModifier(): nonexisted UnitMods or wrong UnitModifierType!"); sLog.outError("ERROR in HandleStatModifier(): non existed UnitMods or wrong UnitModifierType!");
return false; return false;
} }
@ -9459,7 +9459,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
{ {
if( unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END) if( unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{ {
sLog.outError("ERROR: trial to access nonexisted modifier value from UnitMods!"); sLog.outError("ERROR: trial to access non existed modifier value from UnitMods!");
return 0.0f; return 0.0f;
} }
@ -9489,7 +9489,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
{ {
if(unitMod >= UNIT_MOD_END) if(unitMod >= UNIT_MOD_END)
{ {
sLog.outError("ERROR: trial to access nonexisted UnitMods in GetTotalAuraModValue()!"); sLog.outError("ERROR: trial to access non existed UnitMods in GetTotalAuraModValue()!");
return 0.0f; return 0.0f;
} }
@ -9789,7 +9789,7 @@ void Unit::CleanupsBeforeDelete()
if(m_uint32Values) // only for fully created object if(m_uint32Values) // only for fully created object
{ {
InterruptNonMeleeSpells(true); InterruptNonMeleeSpells(true);
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted ans will deleated at call in Map::RemoveAllObjectsInRemoveList m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
CombatStop(); CombatStop();
ClearComboPointHolders(); ClearComboPointHolders();
DeleteThreatList(); DeleteThreatList();
@ -10097,7 +10097,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if(!found) if(!found)
{ {
sLog.outError("Spell aura %u (id:%u effect:%u) has been deleted before call spell proc event handler",*aur,i->triggeredByAura_SpellPair.first,i->triggeredByAura_SpellPair.second); sLog.outError("Spell aura %u (id:%u effect:%u) has been deleted before call spell proc event handler",*aur,i->triggeredByAura_SpellPair.first,i->triggeredByAura_SpellPair.second);
sLog.outError("It can be deleted one from early proccesed auras:"); sLog.outError("It can be deleted one from early processed auras:");
for(ProcTriggeredList::iterator i2 = procTriggered.begin(); i != i2; ++i2) for(ProcTriggeredList::iterator i2 = procTriggered.begin(); i != i2; ++i2)
sLog.outError(" Spell aura %u (id:%u effect:%u)",*aur,i2->triggeredByAura_SpellPair.first,i2->triggeredByAura_SpellPair.second); sLog.outError(" Spell aura %u (id:%u effect:%u)",*aur,i2->triggeredByAura_SpellPair.first,i2->triggeredByAura_SpellPair.second);
sLog.outError(" <end of list>"); sLog.outError(" <end of list>");
@ -10347,7 +10347,7 @@ void Unit::StopMoving()
clearUnitState(UNIT_STAT_MOVING); clearUnitState(UNIT_STAT_MOVING);
// send explicit stop packet // send explicit stop packet
// rely on vmaps here because for exemple stormwind is in air // rely on vmaps here because for example stormwind is in air
//float z = MapManager::Instance().GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); //float z = MapManager::Instance().GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true);
//if (fabs(GetPositionZ() - z) < 2.0f) //if (fabs(GetPositionZ() - z) < 2.0f)
// Relocate(GetPositionX(), GetPositionY(), z); // Relocate(GetPositionX(), GetPositionY(), z);

View file

@ -920,12 +920,12 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false); void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype); void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true); uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true);
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const; bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;
@ -1316,10 +1316,10 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*) void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask ); void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask );
bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);
bool HandleProcTriggerSpell(Unit *pVictim,uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attType,uint32 cooldown); bool HandleProcTriggerSpell(Unit *pVictim,uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attType,uint32 cooldown);
bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell,uint32 cooldown); bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell,uint32 cooldown);
uint32 m_state; // Even derived shouldn't modify uint32 m_state; // Even derived shouldn't modify
uint32 m_CombatTimer; uint32 m_CombatTimer;

View file

@ -314,7 +314,7 @@ void LoadDBCStores(std::string dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentTabStore, dbcPath,"TalentTab.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentTabStore, dbcPath,"TalentTab.dbc");
// preper fast data access to bit pos of talent ranks for use at inspecting // prepare fast data access to bit pos of talent ranks for use at inspecting
{ {
// fill table by amount of talent ranks and fill sTalentTabBitSizeInInspect // fill table by amount of talent ranks and fill sTalentTabBitSizeInInspect
// store in with (row,col,talent)->size key for correct sorting by (row,col) // store in with (row,col,talent)->size key for correct sorting by (row,col)

View file

@ -33,7 +33,7 @@ class MANGOS_DLL_SPEC QueryResult
uint32 GetField_idx(const std::string &name) const uint32 GetField_idx(const std::string &name) const
{ {
for(FieldNames::const_iterator iter = GetFiedNames().begin(); iter != GetFiedNames().end(); ++iter) for(FieldNames::const_iterator iter = GetFieldNames().begin(); iter != GetFieldNames().end(); ++iter)
{ {
if(iter->second == name) if(iter->second == name)
return iter->first; return iter->first;
@ -53,7 +53,7 @@ class MANGOS_DLL_SPEC QueryResult
uint32 GetFieldCount() const { return mFieldCount; } uint32 GetFieldCount() const { return mFieldCount; }
uint64 GetRowCount() const { return mRowCount; } uint64 GetRowCount() const { return mRowCount; }
FieldNames const& GetFiedNames() const {return mFieldNames; } FieldNames const& GetFieldNames() const {return mFieldNames; }
protected: protected:
Field *mCurrentRow; Field *mCurrentRow;