aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/ArenaTeam.cpp8
-rw-r--r--src/game/Chat.cpp1
-rw-r--r--src/game/Level3.cpp4
-rw-r--r--src/game/Spell.cpp39
-rw-r--r--src/game/Unit.cpp11
-rw-r--r--src/game/Unit.h1
-rw-r--r--src/game/Wintergrasp.cpp19
7 files changed, 60 insertions, 23 deletions
diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp
index f777b0ee8b1..00e0f088227 100644
--- a/src/game/ArenaTeam.cpp
+++ b/src/game/ArenaTeam.cpp
@@ -145,7 +145,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
// hide promote/remove buttons
if(CaptainGuid != PlayerGuid)
pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + 1, 1);
- sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUID(), GetType(), GetId());
+ sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUIDLow(), GetType(), GetId());
}
return true;
}
@@ -254,7 +254,7 @@ void ArenaTeam::SetCaptain(const uint64& guid)
if(newcaptain)
{
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0);
- sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUID(), newcaptain->GetName(), newcaptain->GetGUID(), GetId(), GetType());
+ sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUID(), GetId(), GetType());
}
}
@@ -280,7 +280,7 @@ void ArenaTeam::DelMember(uint64 guid)
{
player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + i, 0);
}
- sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), guid, GetType(), GetId());
+ sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
}
@@ -299,7 +299,7 @@ void ArenaTeam::Disband(WorldSession *session)
}
if(Player *player = session->GetPlayer())
- sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUID(), GetType(), GetId());
+ sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", Id);
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index ba9cc5d7a2d..1722fd9602c 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -713,7 +713,6 @@ ChatCommand * ChatHandler::getCommandTable()
{ "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
{ "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
{ "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
- { "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
{ "possess", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePossessCommand, "", NULL },
{ "unpossess", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnPossessCommand, "", NULL },
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index bc0e3b8f80f..06338bbe233 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -122,6 +122,9 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args)
}
else if (strncmp(opt,"maxitems",l) == 0)
{
+ PSendSysMessage("ahbotoptions mintime has been deprecated");
+ return false;
+ /*
char * param1 = strtok(NULL, " ");
if ((!ahMapIdStr) || (!param1))
{
@@ -129,6 +132,7 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args)
return false;
}
AuctionHouseBotCommands(2, ahMapID, NULL, param1);
+ */
}
else if (strncmp(opt,"mintime",l) == 0)
{
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 49327ed359f..e861635281e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1036,7 +1036,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
SpellMissInfo missInfo = DoSpellHitOnUnit(spellHitTarget, mask);
if(missInfo != SPELL_MISS_NONE)
{
- m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo);
+ if(missInfo != SPELL_MISS_MISS)
+ m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo);
m_damage = 0;
spellHitTarget = NULL;
}
@@ -1186,10 +1187,17 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if( !m_caster->IsFriendlyTo(unit) )
{
+ // reset damage to 0 if target has Invisibility or Vanish aura (_only_ vanish, not stealth) and isn't visible for caster
+ // I do not think this is a correct way to fix it. Sanctuary effect should make all delayed spells invalid
// for delayed spells ignore not visible explicit target
- if(m_spellInfo->speed > 0.0f && unit == m_targets.getUnitTarget() && !unit->isVisibleForOrDetect(m_caster,false))
+ if(m_spellInfo->speed > 0.0f && unit == m_targets.getUnitTarget()
+ && (unit->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)
+ || unit->HasAuraTypeWithFamilyFlags(SPELL_AURA_MOD_STEALTH, SPELLFAMILY_ROGUE, SPELLFAMILYFLAG_ROGUE_VANISH))
+ && !unit->isVisibleForOrDetect(m_caster, true))
{
- return SPELL_MISS_EVADE;
+ // that was causing CombatLog errors
+ // return SPELL_MISS_EVADE;
+ return SPELL_MISS_MISS; // miss = do not send anything here
}
unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
@@ -2547,18 +2555,29 @@ void Spell::cancel()
void Spell::cast(bool skipCheck)
{
- SetExecutedCurrently(true);
-
// update pointers base at GUIDs to prevent access to non-existed already object
UpdatePointers();
- // cancel at lost main target unit
- if(!m_targets.getUnitTarget() && m_targets.getUnitTargetGUID() && m_targets.getUnitTargetGUID() != m_caster->GetGUID())
+ if(m_targets.getUnitTarget())
{
- cancel();
- SetExecutedCurrently(false);
- return;
+ // three check: prepare, cast (m_casttime > 0), hit (delayed)
+ if(m_casttime && m_targets.getUnitTarget()->isAlive() && !m_caster->canSeeOrDetect(m_targets.getUnitTarget(), true))
+ {
+ cancel();
+ return;
+ }
}
+ else
+ {
+ // cancel at lost main target unit
+ if(m_targets.getUnitTargetGUID() && m_targets.getUnitTargetGUID() != m_caster->GetGUID())
+ {
+ cancel();
+ return;
+ }
+ }
+
+ SetExecutedCurrently(true);
if(m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster)
m_caster->SetInFront(m_targets.getUnitTarget());
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 82efd2e54a4..14ad660df6d 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -513,6 +513,17 @@ void Unit::UpdateInterruptMask()
m_interruptMask |= spell->m_spellInfo->ChannelInterruptFlags;
}
+bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const
+{
+ if(!HasAuraType(auraType)) return false;
+ AuraEffectList const &auras = GetAurasByType(auraType);
+ for(AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ if(SpellEntry const *iterSpellProto = (*itr)->GetSpellProto())
+ if(iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags[0] & familyFlags)
+ return true;
+ return false;
+}
+
/* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */
void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell)
{
diff --git a/src/game/Unit.h b/src/game/Unit.h
index ea99f8a2424..82e4df55a96 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1243,6 +1243,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void ClearInCombat();
uint32 GetCombatTimer() const { return m_CombatTimer; }
+ bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 782ec4ab537..2d76559a1c0 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -49,6 +49,9 @@ void LoadTeamPair(TeamPairMap &pairMap, const TeamPair *pair)
}
}
+#define REMOVE_RANK_AURAS(p) (p)->RemoveAura(SPELL_RECRUIT);\
+ (p)->RemoveAura(SPELL_CORPORAL);(p)->RemoveAura(SPELL_LIEUTENANT)
+
typedef std::list<const AreaPOIEntry *> AreaPOIList;
bool OPvPWintergrasp::SetupOutdoorPvP()
@@ -342,8 +345,12 @@ void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
{
- if(!plr->GetSession()->PlayerLogout() && plr->m_Vehicle) // dismiss in change zone case
- plr->m_Vehicle->Dismiss();
+ if(!plr->GetSession()->PlayerLogout())
+ {
+ if(plr->m_Vehicle) // dismiss in change zone case
+ plr->m_Vehicle->Dismiss();
+ REMOVE_RANK_AURAS(plr);
+ }
plr->RemoveAura(SPELL_TENACITY);
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
UpdateTenacityStack();
@@ -495,9 +502,7 @@ void OPvPWintergrasp::StartBattle()
{
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
{
- (*itr)->RemoveAura(SPELL_RECRUIT);
- (*itr)->RemoveAura(SPELL_CORPORAL);
- (*itr)->RemoveAura(SPELL_LIEUTENANT);
+ REMOVE_RANK_AURAS(*itr);
(*itr)->CastSpell(*itr, SPELL_RECRUIT, true);
}
}
@@ -514,9 +519,7 @@ void OPvPWintergrasp::EndBattle()
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
{
- (*itr)->RemoveAura(SPELL_RECRUIT);
- (*itr)->RemoveAura(SPELL_CORPORAL);
- (*itr)->RemoveAura(SPELL_LIEUTENANT);
+ REMOVE_RANK_AURAS(*itr);
}
}
}