aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp26
-rw-r--r--src/server/game/Scripting/ScriptMgr.h12
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp30
-rw-r--r--src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp101
-rw-r--r--src/server/scripts/World/action_ip_logger.cpp24
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.cpp2
6 files changed, 46 insertions, 149 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 492197db64e..5e12022312d 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16378,19 +16378,25 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
}
}
- WorldObject::SetPhaseMask(newPhaseMask, update);
+ // Phase player, dont update
+ WorldObject::SetPhaseMask(newPhaseMask, false);
- if (!IsInWorld())
- return;
+ // Phase pets and summons
+ if (IsInWorld())
+ {
+ for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
+ if ((*itr)->GetTypeId() == TYPEID_UNIT)
+ (*itr)->SetPhaseMask(newPhaseMask, true);
- for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
- if ((*itr)->GetTypeId() == TYPEID_UNIT)
- (*itr)->SetPhaseMask(newPhaseMask, true);
+ for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
+ if (m_SummonSlot[i])
+ if (Creature* summon = GetMap()->GetCreature(m_SummonSlot[i]))
+ summon->SetPhaseMask(newPhaseMask, true);
+ }
- for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
- if (m_SummonSlot[i])
- if (Creature* summon = GetMap()->GetCreature(m_SummonSlot[i]))
- summon->SetPhaseMask(newPhaseMask, true);
+ // Update visibility after phasing pets and summons so they wont despawn
+ if (update)
+ UpdateObjectVisibility();
}
void Unit::UpdateObjectVisibility(bool forced)
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index e31a8ec1328..ee95759c72e 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -781,22 +781,22 @@ class AccountScript : public ScriptObject
public:
// Called when an account logged in succesfully
- virtual void OnAccountLogin(uint32 accountId) {}
+ virtual void OnAccountLogin(uint32 /*accountId*/) {}
// Called when an account login failed
- virtual void OnFailedAccountLogin(uint32 accountId) {}
+ virtual void OnFailedAccountLogin(uint32 /*accountId*/) {}
// Called when Email is successfully changed for Account
- virtual void OnEmailChange(uint32 accountId) {}
+ virtual void OnEmailChange(uint32 /*accountId*/) {}
// Called when Email failed to change for Account
- virtual void OnFailedEmailChange(uint32 accountId) {}
+ virtual void OnFailedEmailChange(uint32 /*accountId*/) {}
// Called when Password is successfully changed for Account
- virtual void OnPasswordChange(uint32 accountId) {}
+ virtual void OnPasswordChange(uint32 /*accountId*/) {}
// Called when Password failed to change for Account
- virtual void OnFailedPasswordChange(uint32 accountId) {}
+ virtual void OnFailedPasswordChange(uint32 /*accountId*/) {}
};
class GuildScript : public ScriptObject
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 3e4786df870..75dbd457b91 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -694,21 +694,12 @@ void Aura::Update(uint32 diff, Unit* caster)
if (int32(caster->GetHealth()) > manaPerSecond)
caster->ModifyHealth(-manaPerSecond);
else
- {
Remove();
- return;
- }
}
+ else if (int32(caster->GetPower(powertype)) >= manaPerSecond)
+ caster->ModifyPower(powertype, -manaPerSecond);
else
- {
- if (int32(caster->GetPower(powertype)) >= manaPerSecond)
- caster->ModifyPower(powertype, -manaPerSecond);
- else
- {
- Remove();
- return;
- }
- }
+ Remove();
}
}
}
@@ -734,17 +725,17 @@ int32 Aura::CalcMaxDuration(Unit* caster) const
// IsPermanent() checks max duration (which we are supposed to calculate here)
if (maxDuration != -1 && modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration);
+
return maxDuration;
}
void Aura::SetDuration(int32 duration, bool withMods)
{
if (withMods)
- {
if (Unit* caster = GetCaster())
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, duration);
- }
+
m_duration = duration;
SetNeedClientUpdateForTargets();
}
@@ -782,6 +773,7 @@ void Aura::SetCharges(uint8 charges)
{
if (m_procCharges == charges)
return;
+
m_procCharges = charges;
m_isUsingCharges = m_procCharges != 0;
SetNeedClientUpdateForTargets();
@@ -796,6 +788,7 @@ uint8 Aura::CalcMaxCharges(Unit* caster) const
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, maxProcCharges);
+
return maxProcCharges;
}
@@ -818,6 +811,7 @@ bool Aura::ModCharges(int32 num, AuraRemoveMode removeMode)
SetCharges(charges);
}
+
return false;
}
@@ -886,6 +880,7 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode)
if (SpellModifier* mod = aurEff->GetSpellModifier())
mod->charges = GetCharges();
}
+
SetNeedClientUpdateForTargets();
return false;
}
@@ -901,10 +896,8 @@ bool Aura::HasMoreThanOneEffectForType(AuraType auraType) const
{
uint32 count = 0;
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- {
- if (HasEffect(i) && GetSpellInfo()->Effects[i].ApplyAuraName == auraType)
+ if (HasEffect(i) && AuraType(GetSpellInfo()->Effects[i].ApplyAuraName) == auraType)
++count;
- }
return count > 1;
}
@@ -912,10 +905,9 @@ bool Aura::HasMoreThanOneEffectForType(AuraType auraType) const
bool Aura::IsArea() const
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- {
if (HasEffect(i) && GetSpellInfo()->Effects[i].IsAreaAuraEffect())
return true;
- }
+
return false;
}
diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
index aa9774bfd62..ee244e51b09 100644
--- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
@@ -133,106 +133,6 @@ class npc_risen_husk_spirit : public CreatureScript
};
/*######
-## npc_theramor_guard
-######*/
-
-enum TheramoreGuard
-{
- QUEST_DISCREDITING_THE_DESERTERS = 11133,
-
- NPC_THERAMORE_GUARD = 4979,
-
- SPELL_DOCTORED_LEAFLET = 42725,
- SPELL_PROPAGANDIZED = 42246,
-
- SAY_QUEST1 = 0,
- SAY_QUEST2 = 1,
- SAY_QUEST3 = 2
-};
-
-#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?"
-
-class npc_theramore_guard : public CreatureScript
-{
-public:
- npc_theramore_guard() : CreatureScript("npc_theramore_guard") { }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
-
- if (action == GOSSIP_SENDER_INFO)
- {
- player->CLOSE_GOSSIP_MENU();
- player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0);
- creature->AI()->Talk(SAY_QUEST1);
- creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false);
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000;
- CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true;
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_theramore_guardAI(creature);
- }
-
- struct npc_theramore_guardAI : public ScriptedAI
- {
- npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { }
-
- uint32 YellTimer;
- uint32 Step;
- bool bYellTimer;
-
- void Reset() override
- {
- bYellTimer = false;
- Step = 0;
- }
-
- void UpdateAI(uint32 Diff) override
- {
- if (!me->HasAura(SPELL_PROPAGANDIZED))
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- if (bYellTimer && YellTimer <= Diff)
- {
- switch (Step)
- {
- case 0:
- Talk(SAY_QUEST2);
- YellTimer = 3000;
- ++Step;
- break;
- case 1:
- Talk(SAY_QUEST3);
- me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
- Step = 0;
- bYellTimer = false;
- break;
- }
- }
- else
- YellTimer -= Diff;
- }
- };
-};
-
-/*######
## npc_lady_jaina_proudmoore
######*/
@@ -772,7 +672,6 @@ void AddSC_dustwallow_marsh()
new npc_private_hendel();
new npc_zelfrax();
new npc_stinky();
- new npc_theramore_guard();
new spell_ooze_zap();
new spell_ooze_zap_channel_end();
new spell_energize_aoe();
diff --git a/src/server/scripts/World/action_ip_logger.cpp b/src/server/scripts/World/action_ip_logger.cpp
index d4f48ab19be..057f3d6ee36 100644
--- a/src/server/scripts/World/action_ip_logger.cpp
+++ b/src/server/scripts/World/action_ip_logger.cpp
@@ -49,39 +49,39 @@ class AccountActionIpLogger : public AccountScript
// We log last_ip instead of last_attempt_ip, as login was successful
// ACCOUNT_LOGIN = 0
- void OnAccountLogin(uint32 accountId)
+ void OnAccountLogin(uint32 accountId) override
{
AccountIPLogAction(accountId, ACCOUNT_LOGIN);
}
// We log last_attempt_ip instead of last_ip, as failed login doesn't necessarily mean approperiate user
// ACCOUNT_FAIL_LOGIN = 1
- void OnFailedAccountLogin(uint32 accountId)
+ void OnFailedAccountLogin(uint32 accountId) override
{
AccountIPLogAction(accountId, ACCOUNT_FAIL_LOGIN);
}
// ACCOUNT_CHANGE_PW = 2
- void OnPasswordChange(uint32 accountId)
+ void OnPasswordChange(uint32 accountId) override
{
AccountIPLogAction(accountId, ACCOUNT_CHANGE_PW);
}
// ACCOUNT_CHANGE_PW_FAIL = 3
- void OnFailedPasswordChange(uint32 accountId)
+ void OnFailedPasswordChange(uint32 accountId) override
{
AccountIPLogAction(accountId, ACCOUNT_CHANGE_PW_FAIL);
}
// Registration Email can NOT be changed apart from GM level users. Thus, we do not require to log them...
- // ACCOUNT_CHANGE_EMAIL = 4
- void OnEmailChange(uint32 accountId)
+ // ACCOUNT_CHANGE_EMAIL = 4
+ void OnEmailChange(uint32 accountId) override
{
AccountIPLogAction(accountId, ACCOUNT_CHANGE_EMAIL); // ... they get logged by gm command logger anyway
}
// ACCOUNT_CHANGE_EMAIL_FAIL = 5
- void OnFailedEmailChange(uint32 accountId)
+ void OnFailedEmailChange(uint32 accountId) override
{
AccountIPLogAction(accountId, ACCOUNT_CHANGE_EMAIL_FAIL);
}
@@ -168,19 +168,19 @@ class CharacterActionIpLogger : public PlayerScript
CharacterActionIpLogger() : PlayerScript("CharacterActionIpLogger") { }
// CHARACTER_CREATE = 7
- void OnCreate(Player* player)
+ void OnCreate(Player* player) override
{
CharacterIPLogAction(player, CHARACTER_CREATE);
}
// CHARACTER_LOGIN = 8
- void OnLogin(Player* player)
+ void OnLogin(Player* player, bool /*firstLogin*/) override
{
CharacterIPLogAction(player, CHARACTER_LOGIN);
}
// CHARACTER_LOGOUT = 9
- void OnLogout(Player* player)
+ void OnLogout(Player* player) override
{
CharacterIPLogAction(player, CHARACTER_LOGOUT);
}
@@ -252,13 +252,13 @@ public:
CharacterDeleteActionIpLogger() : PlayerScript("CharacterDeleteActionIpLogger") { }
// CHARACTER_DELETE = 10
- void OnDelete(uint64 guid, uint32 accountId)
+ void OnDelete(uint64 guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_DELETE);
}
// CHARACTER_FAILED_DELETE = 11
- void OnFailedDelete(uint64 guid, uint32 accountId)
+ void OnFailedDelete(uint64 guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE);
}
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp
index d5ad7f15a04..350a258f455 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.cpp
+++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp
@@ -877,7 +877,7 @@ unsigned nestingLevel,
DWORD_PTR offset,
bool & bHandled,
const char* Name,
-char* suffix,
+char* /*suffix*/,
bool newSymbol,
bool logChildren)
{