diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index a786ffa25..720d0f768 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -1386,7 +1386,7 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float // so we must create it specific for this instance GameObject * go = new GameObject; if(!go->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(), - PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) + PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,GO_ANIMPROGRESS_DEFAULT,GO_STATE_READY)) { sLog.outErrorDb("Gameobject template %u not found in database! BattleGround not created!", entry); sLog.outError("Cannot create gameobject template %u! BattleGround not created!", entry); diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 841cbb30d..e5d8be8b2 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -95,7 +95,7 @@ void GameObject::RemoveFromWorld() Object::RemoveFromWorld(); } -bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state) +bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint8 animprogress, GOState go_state) { MANGOS_ASSERT(map); Relocate(x,y,z,ang); @@ -135,6 +135,9 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); + if (goinfo->type == GAMEOBJECT_TYPE_TRANSPORT) + SetFlag(GAMEOBJECT_FLAGS, (GO_FLAG_TRANSPORT | GO_FLAG_NODESPAWN)); + SetEntry(goinfo->id); SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId); @@ -189,7 +192,7 @@ void GameObject::Update(uint32 /*p_time*/) if(caster && caster->GetTypeId()==TYPEID_PLAYER) { SetGoState(GO_STATE_ACTIVE); - SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN); + // SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN); UpdateData udata; WorldPacket packet; @@ -570,7 +573,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) float rotation2 = data->rotation2; float rotation3 = data->rotation3; - uint32 animprogress = data->animprogress; + uint8 animprogress = data->animprogress; GOState go_state = data->go_state; m_DBTableGuid = guid; @@ -803,7 +806,7 @@ void GameObject::SummonLinkedTrapIfAny() GameObject* linkedGO = new GameObject; if (!linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, GetMap(), - GetPhaseMask(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) + GetPhaseMask(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { delete linkedGO; linkedGO = NULL; diff --git a/src/game/GameObject.h b/src/game/GameObject.h index e09c24c2a..689bfe975 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -577,6 +577,8 @@ class Unit; // 5 sec for bobber catch #define FISHING_BOBBER_READY_TIME 5 +#define GO_ANIMPROGRESS_DEFAULT 0xFF + class MANGOS_DLL_SPEC GameObject : public WorldObject { public: @@ -586,7 +588,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void AddToWorld(); void RemoveFromWorld(); - bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state); + bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint8 animprogress, GOState go_state); void Update(uint32 p_time); GameObjectInfo const* GetGOInfo() const; diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 6dbc95224..59daa980f 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1088,7 +1088,7 @@ bool ChatHandler::HandleGameObjectAddCommand(char* args) GameObject* pGameObj = new GameObject; uint32 db_lowGUID = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); - if (!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) + if (!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { delete pGameObj; return false; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 29edbc900..050fcfb87 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3800,7 +3800,7 @@ void Aura::HandleAuraModStun(bool apply, bool Real) { GameObject* pObj = new GameObject; if(pObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 185584, target->GetMap(), target->GetPhaseMask(), - target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) + target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { pObj->SetRespawnTime(GetAuraDuration()/IN_MILLISECONDS); pObj->SetSpellId(GetId()); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 43d9be97d..ead314765 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -952,7 +952,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) // create before death for get proper coordinates if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(), creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), - creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY) ) + creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY) ) { delete pGameObj; return; @@ -5491,7 +5491,7 @@ void Spell::EffectSummonObjectWild(SpellEffectIndex eff_idx) Map *map = target->GetMap(); if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map, - m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) + m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { delete pGameObj; return; @@ -6745,7 +6745,7 @@ void Spell::EffectDuel(SpellEffectIndex eff_idx) m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 , m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 , m_caster->GetPositionZ(), - m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) + m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { delete pGameObj; return; @@ -7120,7 +7120,7 @@ void Spell::EffectSummonObject(SpellEffectIndex eff_idx) Map *map = m_caster->GetMap(); if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, - m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) + m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { delete pGameObj; return; @@ -7704,7 +7704,7 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx) GameObject* pGameObj = new GameObject; if(!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap, - m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) + m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, GO_ANIMPROGRESS_DEFAULT, GO_STATE_READY)) { delete pGameObj; return; diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index cef0579b0..0c3431d07 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -92,7 +92,7 @@ void MapManager::LoadTransports() x = t->m_WayPoints[0].x; y = t->m_WayPoints[0].y; z = t->m_WayPoints[0].z; mapid = t->m_WayPoints[0].mapid; o = 1; // creates the Gameobject - if(!t->Create(entry, mapid, x, y, z, o, 100, 0)) + if (!t->Create(entry, mapid, x, y, z, o, GO_ANIMPROGRESS_DEFAULT, 0)) { delete t; continue; @@ -138,7 +138,7 @@ Transport::Transport() : GameObject() m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION); } -bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags) +bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint8 animprogress, uint16 dynamicHighValue) { Relocate(x,y,z,ang); // instance id and phaseMask isn't set to values different from std. @@ -166,7 +166,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); - SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64)); + SetUInt32Value(GAMEOBJECT_FLAGS, (GO_FLAG_TRANSPORT | GO_FLAG_NODESPAWN)); SetUInt32Value(GAMEOBJECT_LEVEL, m_period); SetEntry(goinfo->id); @@ -174,10 +174,12 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, SetGoState(GO_STATE_READY); SetGoType(GameobjectTypes(goinfo->type)); - + SetGoArtKit(0); SetGoAnimProgress(animprogress); - if(dynflags) - SetUInt32Value(GAMEOBJECT_DYNAMIC, MAKE_PAIR32(0, dynflags)); + + // low part always 0, dynamicHighValue is some kind of progression (not implemented) + SetUInt16Value(GAMEOBJECT_DYNAMIC, 0, 0); + SetUInt16Value(GAMEOBJECT_DYNAMIC, 1, dynamicHighValue); SetName(goinfo->name); diff --git a/src/game/Transports.h b/src/game/Transports.h index f64142c95..a7917d69d 100644 --- a/src/game/Transports.h +++ b/src/game/Transports.h @@ -30,7 +30,7 @@ class Transport : public GameObject public: explicit Transport(); - bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags); + bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint8 animprogress, uint16 dynamicHighValue); bool GenerateWaypoints(uint32 pathid, std::set &mapids); void Update(uint32 p_time); bool AddPassenger(Player* passenger); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 88ce2268e..55b83908e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10599" + #define REVISION_NR "10600" #endif // __REVISION_NR_H__