aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2013-02-21 00:45:02 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2013-02-21 00:45:02 +0100
commitc0c2e533a967640bd14553fa98916974e013e7bd (patch)
tree593c67bc0d63e33efe7658b2f81ccf1cc5df5134 /src
parent1df992e918e954431f49626d44345530b50e591a (diff)
parent59c3c6b8a6a318c3b937defaeb165a5f77b25ff8 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Handlers/MiscHandler.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Accounts/AccountMgr.cpp2
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp5
-rw-r--r--src/server/game/Entities/Creature/Creature.h6
-rw-r--r--src/server/game/Events/GameEventMgr.cpp2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp10
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp31
-rw-r--r--src/server/game/Server/WorldSession.cpp39
-rw-r--r--src/server/game/Server/WorldSession.h2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp14
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp5
10 files changed, 47 insertions, 69 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index bd560c8266e..12624c29686 100644
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -1,4 +1,4 @@
- /*
+/*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 9cec59db168..58f2edf5f74 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -145,7 +145,7 @@ Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapCreature(),
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLowGUID(0),
m_PlayerDamageReq(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0),
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
-m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(1), m_originalEquipmentId(1), m_AlreadyCallAssistance(false),
+m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
{
@@ -325,7 +325,10 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
if (!data || data->equipmentId == 0) // use default from the template
LoadEquipment(GetOriginalEquipmentId());
else if (data && data->equipmentId != 0) // override, 0 means no equipment
+ {
+ m_originalEquipmentId = data->equipmentId;
LoadEquipment(data->equipmentId);
+ }
SetName(normalInfo->Name); // at normal entry always
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 6e737709f99..4127ab281dd 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -552,8 +552,8 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
void UpdateAttackPowerAndDamage(bool ranged = false);
void UpdateDamagePhysical(WeaponAttackType attType);
- uint8 GetOriginalEquipmentId() const { return m_originalEquipmentId; }
- uint32 GetCurrentEquipmentId() { return m_equipmentId; }
+ int8 GetOriginalEquipmentId() const { return m_originalEquipmentId; }
+ uint8 GetCurrentEquipmentId() { return m_equipmentId; }
void SetCurrentEquipmentId(uint8 id) { m_equipmentId = id; }
float GetSpellDamageMod(int32 Rank);
@@ -751,7 +751,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
MovementGeneratorType m_defaultMovementType;
uint32 m_DBTableGuid; ///< For new or temporary creatures is 0 for saved it is lowguid
uint8 m_equipmentId;
- uint8 m_originalEquipmentId;
+ int8 m_originalEquipmentId; // can be -1
bool m_AlreadyCallAssistance;
bool m_AlreadySearchedAssistance;
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index d06ff1fa533..36193d78218 100644
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -1366,7 +1366,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (data2->equipmentId == 0)
- itr->second.equipement_id_prev = 1;
+ itr->second.equipement_id_prev = 0; ///@todo: verify this line
else if (data2->equipmentId != -1)
itr->second.equipement_id_prev = data->equipmentId;
itr->second.modelid_prev = displayID;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index b5273c72468..399087d1c0a 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1492,7 +1492,7 @@ void ObjectMgr::LoadCreatures()
data.id = entry;
data.mapid = fields[2].GetUInt16();
data.displayid = fields[3].GetUInt32();
- data.equipmentId = fields[4].GetInt32();
+ data.equipmentId = fields[4].GetInt8();
data.posX = fields[5].GetFloat();
data.posY = fields[6].GetFloat();
data.posZ = fields[7].GetFloat();
@@ -1534,13 +1534,13 @@ void ObjectMgr::LoadCreatures()
if (!ok)
continue;
- // -1 random, 0 no equipment, 1 is default (may or may not have equipment)
+ // -1 random, 0 no equipment,
if (data.equipmentId != 0)
{
- if (!GetEquipmentInfo(data.id, data.equipmentId) && data.equipmentId != 1)
+ if (!GetEquipmentInfo(data.id, data.equipmentId))
{
sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId);
- data.equipmentId = 1;
+ data.equipmentId = 0;
}
}
@@ -1714,7 +1714,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
data.id = entry;
data.mapid = mapId;
data.displayid = 0;
- data.equipmentId = 1;
+ data.equipmentId = 0;
data.posX = x;
data.posY = y;
data.posZ = z;
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 4d72e79f4df..a2768319150 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -375,33 +375,34 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
if (uint64 lguid = GetPlayer()->GetLootGUID())
DoLootRelease(lguid);
- uint32 reason = 0;
+ bool instantLogout = (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->isInCombat()) ||
+ GetPlayer()->isInFlight() || HasPermission(RBAC_PERM_INSTANT_LOGOUT);
+
+ /// TODO: Possibly add RBAC permission to log out in combat
+ bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
- if (GetPlayer()->isInCombat())
+ uint32 reason = 0;
+ if (GetPlayer()->isInCombat() && !canLogoutInCombat)
reason = 1;
else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR))
reason = 3; // is jumping or falling
else if (GetPlayer()->duel || GetPlayer()->HasAura(9454)) // is dueling or frozen by GM via freeze command
reason = 2; // FIXME - Need the correct value
+ WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4);
+ data << uint32(reason);
+ data << uint8(0);
+ SendPacket(&data);
+
if (reason)
{
- WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4);
- data << uint32(reason);
- data << uint8(0);
- SendPacket(&data);
LogoutRequest(0);
return;
}
- //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf
- if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||
- HasPermission(RBAC_PERM_INSTANT_LOGOUT))
+ // instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf
+ if (instantLogout)
{
- WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4);
- data << uint32(reason);
- data << uint8(1); // instant logout
- SendPacket(&data);
LogoutPlayer(true);
return;
}
@@ -414,10 +415,6 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
- WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4);
- data << uint32(0);
- data << uint8(0);
- SendPacket(&data);
LogoutRequest(time(NULL));
}
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index d12128b11c1..1819b829404 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -447,14 +447,14 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
}
/// %Log the player out
-void WorldSession::LogoutPlayer(bool Save)
+void WorldSession::LogoutPlayer(bool save)
{
// finish pending transfers before starting the logout
while (_player && _player->IsBeingTeleportedFar())
HandleMoveWorldportAckOpcode();
m_playerLogout = true;
- m_playerSave = Save;
+ m_playerSave = save;
if (_player)
{
@@ -469,39 +469,6 @@ void WorldSession::LogoutPlayer(bool Save)
_player->BuildPlayerRepop();
_player->RepopAtGraveyard();
}
- else if (!_player->getAttackers().empty())
- {
- // build set of player who attack _player or who have pet attacking of _player
- std::set<Player*> aset;
- for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)
- {
- Unit* owner = (*itr)->GetOwner(); // including player controlled case
- if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- aset.insert(owner->ToPlayer());
- else if ((*itr)->GetTypeId() == TYPEID_PLAYER)
- aset.insert((Player*)(*itr));
- }
-
- // CombatStop() method is removing all attackers from the AttackerSet
- // That is why it must be AFTER building current set of attackers
- _player->CombatStop();
- _player->getHostileRefManager().setOnlineOfflineState(false);
- _player->RemoveAllAurasOnDeath();
- _player->SetPvPDeath(!aset.empty());
- _player->KillPlayer();
- _player->BuildPlayerRepop();
- _player->RepopAtGraveyard();
-
- // give honor to all attackers from set like group case
- for (std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)
- (*itr)->RewardHonor(_player, aset.size());
-
- // give bg rewards and update counters like kill by first from attackers
- // this can't be called for all attackers.
- if (!aset.empty())
- if (Battleground* bg = _player->GetBattleground())
- bg->HandleKillPlayer(_player, *aset.begin());
- }
else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{
// this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION
@@ -550,7 +517,7 @@ void WorldSession::LogoutPlayer(bool Save)
///- empty buyback items and save the player in the database
// some save parts only correctly work in case player present in map/player_lists (pets, etc)
- if (Save)
+ if (save)
{
uint32 eslot;
for (int j = BUYBACK_SLOT_START; j < BUYBACK_SLOT_END; ++j)
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 70a405fd808..96b766fdf74 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -258,7 +258,7 @@ class WorldSession
return (_logoutTime > 0 && currTime >= _logoutTime + 20);
}
- void LogoutPlayer(bool Save);
+ void LogoutPlayer(bool save);
void KickPlayer();
void QueuePacket(WorldPacket* new_packet);
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
index d0a83e4322e..a9b41b719f7 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
@@ -27,9 +27,10 @@ EndScriptData */
#include "ScriptedCreature.h"
#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 18500
+#define SPELL_WINGBUFFET 23339
#define SPELL_SHADOWOFEBONROC 23340
-#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
+#define SPELL_HEAL 41386 //The Heal spell of his Shadow
+#define SPELL_THRASH 3391
class boss_ebonroc : public CreatureScript
{
@@ -49,6 +50,7 @@ public:
uint32 WingBuffet_Timer;
uint32 ShadowOfEbonroc_Timer;
uint32 Heal_Timer;
+ uint32 Thrash_Timer;
void Reset()
{
@@ -56,6 +58,7 @@ public:
WingBuffet_Timer = 30000;
ShadowOfEbonroc_Timer = 45000;
Heal_Timer = 1000;
+ Thrash_Timer = 10000;
}
void EnterCombat(Unit* /*who*/)
@@ -75,6 +78,13 @@ public:
ShadowFlame_Timer = urand(12000, 15000);
} else ShadowFlame_Timer -= diff;
+ //Thrash Timer
+ if (Thrash_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_THRASH);
+ Thrash_Timer = urand(10000, 15000);
+ } else Thrash_Timer -= diff;
+
//Wing Buffet Timer
if (WingBuffet_Timer <= diff)
{
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index 10ff16b5ddd..ce23f4ca4f6 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -124,8 +124,9 @@ bool MySQLConnection::Open()
{
sLog->outInfo(LOG_FILTER_SQL, "MySQL client library: %s", mysql_get_client_info());
sLog->outInfo(LOG_FILTER_SQL, "MySQL server ver: %s ", mysql_get_server_info(m_Mysql));
- if (mysql_get_server_version(m_Mysql) != mysql_get_client_version())
- sLog->outInfo(LOG_FILTER_SQL, "[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements.");
+ // MySQL version above 5.1 IS required in both client and server and there is no known issue with different versions above 5.1
+ // if (mysql_get_server_version(m_Mysql) != mysql_get_client_version())
+ // sLog->outInfo(LOG_FILTER_SQL, "[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements.");
}
sLog->outInfo(LOG_FILTER_SQL, "Connected to MySQL database at %s", m_connectionInfo.host.c_str());