diff options
author | megamage <none@none> | 2009-08-08 12:25:20 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-08 12:25:20 -0500 |
commit | 58dc6e180bf88cc62a4bdff403b54c2cf9eba995 (patch) | |
tree | 3c0dd962d82dc294da0fca02fc0612e1febf20f9 /src | |
parent | f8a05d264f77f366bf9f367dc5c59262c190c017 (diff) |
[8320] Imporovements in wild summoned gameobjects work. Author: VladimirMangos
* Not set owner for will summoned gameobjects.
Its not expected to have owner, and must be accessable to all players (or team).
* Set for all objects summoned by spells: despawned by deafult for proper despawn withut owner.
* Cleanup Spell::EffectSummonObjectWild.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/GameObject.cpp | 2 | ||||
-rw-r--r-- | src/game/GameObject.h | 21 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 45 | ||||
-rw-r--r-- | src/trinitycore/Master.cpp | 5 |
4 files changed, 40 insertions, 33 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 457591e63b4..526b60c1de9 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -921,6 +921,7 @@ void GameObject::SetGoArtKit(uint8 kit) data->ArtKit = kit; } +/* void GameObject::SetOwnerGUID(uint64 owner) { // Owner already found and different than expected owner - remove object from old owner @@ -931,6 +932,7 @@ void GameObject::SetOwnerGUID(uint64 owner) m_spawnedByDefault = false; // all object with owner is despawned after delay SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner); } +*/ void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false */) { diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 9a86c93389c..8e2a37fe55e 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -591,10 +591,6 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject bool IsTransport() const; - void SetOwnerGUID(uint64 owner); - uint64 GetOwnerGUID() const { return GetUInt64Value(OBJECT_FIELD_CREATED_BY); } - Unit* GetOwner(bool inWorld = true) const; - uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f); @@ -613,6 +609,21 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject bool LoadFromDB(uint32 guid, Map *map); void DeleteFromDB(); + void SetOwnerGUID(uint64 owner) + { + m_spawnedByDefault = false; // all object with owner is despawned after delay + SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner); + } + uint64 GetOwnerGUID() const { return GetUInt64Value(OBJECT_FIELD_CREATED_BY); } + Unit* GetOwner(bool inWorld = true) const; + + void SetSpellId(uint32 id) + { + m_spawnedByDefault = false; // all summoned object is despawned after delay + m_spellId = id; + } + uint32 GetSpellId() const { return m_spellId;} + time_t GetRespawnTime() const { return m_respawnTime; } time_t GetRespawnTimeEx() const { @@ -641,8 +652,6 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject void Refresh(); void Delete(); void DeleteObjectWithOwner(); - void SetSpellId(uint32 id) { m_spellId = id;} - uint32 GetSpellId() const { return m_spellId;} void getFishLoot(Loot *loot, Player* loot_owner); GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); } void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 4571e66a3d0..c2e8fc63853 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4563,39 +4563,40 @@ void Spell::EffectSummonObjectWild(uint32 i) } int32 duration = GetSpellDuration(m_spellInfo); + pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); pGameObj->SetSpellId(m_spellInfo->Id); - if(pGameObj->GetGoType() != GAMEOBJECT_TYPE_FLAGDROP) // make dropped flag clickable for other players (not set owner guid (created by) for this)... - m_caster->AddGameObject(pGameObj); + // Wild object not have owner and check clickable by players map->Add(pGameObj); - if(pGameObj->GetMapId() == 489 && pGameObj->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP) //WS + if(pGameObj->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP && m_caster->GetTypeId() == TYPEID_PLAYER) { - if(m_caster->GetTypeId() == TYPEID_PLAYER) + Player *pl = (Player*)m_caster; + BattleGround* bg = ((Player *)m_caster)->GetBattleGround(); + + switch(pGameObj->GetMapId()) { - Player *pl = (Player*)m_caster; - BattleGround* bg = ((Player *)m_caster)->GetBattleGround(); - if(bg && bg->GetTypeID()==BATTLEGROUND_WS && bg->GetStatus() == STATUS_IN_PROGRESS) + case 489: //WS { - uint32 team = ALLIANCE; + if(bg && bg->GetTypeID()==BATTLEGROUND_WS && bg->GetStatus() == STATUS_IN_PROGRESS) + { + uint32 team = ALLIANCE; - if(pl->GetTeam() == team) - team = HORDE; + if(pl->GetTeam() == team) + team = HORDE; - ((BattleGroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(),team); + ((BattleGroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(),team); + } + break; } - } - } - - if(pGameObj->GetMapId() == 566 && pGameObj->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP) //EY - { - if(m_caster->GetTypeId() == TYPEID_PLAYER) - { - BattleGround* bg = ((Player *)m_caster)->GetBattleGround(); - if(bg && bg->GetTypeID()==BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS) + case 566: //EY { - ((BattleGroundEY*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID()); + if(bg && bg->GetTypeID()==BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS) + { + ((BattleGroundEY*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID()); + } + break; } } } @@ -4609,7 +4610,7 @@ void Spell::EffectSummonObjectWild(uint32 i) linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); linkedGO->SetSpellId(m_spellInfo->Id); - m_caster->AddGameObject(linkedGO); + // Wild object not have owner and check clickable by players map->Add(linkedGO); } else diff --git a/src/trinitycore/Master.cpp b/src/trinitycore/Master.cpp index 7e48b97eb4f..b9bf375628b 100644 --- a/src/trinitycore/Master.cpp +++ b/src/trinitycore/Master.cpp @@ -317,13 +317,8 @@ int Master::Run() { FreezeDetectorRunnable *fdr = new FreezeDetectorRunnable(); fdr->SetDelayTime(freeze_delay*1000); -<<<<<<< HEAD:src/mangosd/Master.cpp - ACE_Based::Thread t(*fdr); - t.setPriority(ACE_Based::High); -======= ACE_Based::Thread t(fdr); t.setPriority(ACE_Based::Highest); ->>>>>>> ca55c2a9d069aaef0d3deafb4884bfd8d3884444:src/mangosd/Master.cpp } ///- Launch the world listener socket |