aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/GameObject
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-03-02 23:59:42 +0100
committerShauren <shauren.trinity@gmail.com>2013-03-02 23:59:42 +0100
commit6be5bc71eb667536d5f289aa8723766a912105da (patch)
tree014904a9e6f496b2f003fa6bb2189a9e7011b71a /src/server/game/Entities/GameObject
parent1baaaf1bf07aa93a49b255c2e4d018375471ea21 (diff)
Core/GameObjects
* Removed long deprecated code for mining nodes (multiple uses, artifact of TBC) * Made fishing pools generate use count only on spawn (and respawn) instead of randomizing use count on every fishing attempt - prevents early despawning in some cases
Diffstat (limited to 'src/server/game/Entities/GameObject')
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp35
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h9
2 files changed, 29 insertions, 15 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index c41c8e71a44..a2c0b4b8c92 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -224,6 +224,10 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
switch (goinfo->type)
{
+ case GAMEOBJECT_TYPE_FISHINGHOLE:
+ SetGoAnimProgress(animprogress);
+ m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishinghole.minSuccessOpens, GetGOInfo()->fishinghole.maxSuccessOpens);
+ break;
case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
m_goValue.Building.Health = goinfo->building.intactNumHits + goinfo->building.damagedNumHits;
m_goValue.Building.MaxHealth = m_goValue.Building.Health;
@@ -377,22 +381,27 @@ void GameObject::Update(uint32 diff)
//we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds)
if (GetGoState() != GO_STATE_READY)
ResetDoorOrButton();
- //flags in AB are type_button and we need to add them here so no break!
+ break;
+ case GAMEOBJECT_TYPE_FISHINGHOLE:
+ // Initialize a new max fish count on respawn
+ m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishinghole.minSuccessOpens, GetGOInfo()->fishinghole.maxSuccessOpens);
+ break;
default:
- if (!m_spawnedByDefault) // despawn timer
- {
- // can be despawned or destroyed
- SetLootState(GO_JUST_DEACTIVATED);
- return;
- }
- // respawn timer
- uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr->IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
- if (poolid)
- sPoolMgr->UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
- else
- GetMap()->AddToMap(this);
break;
}
+
+ if (!m_spawnedByDefault) // despawn timer
+ {
+ // can be despawned or destroyed
+ SetLootState(GO_JUST_DEACTIVATED);
+ return;
+ }
+ // respawn timer
+ uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr->IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
+ if (poolid)
+ sPoolMgr->UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
+ else
+ GetMap()->AddToMap(this);
}
}
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 1049285605e..556e4275edc 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -91,8 +91,8 @@ struct GameObjectTemplate
uint32 lootId; //1
uint32 chestRestockTime; //2
uint32 consumable; //3
- uint32 minSuccessOpens; //4
- uint32 maxSuccessOpens; //5
+ uint32 minSuccessOpens; //4 Deprecated, pre 3.0 was used for mining nodes but since WotLK all mining nodes are usable once and grant all loot with a single use
+ uint32 maxSuccessOpens; //5 Deprecated, pre 3.0 was used for mining nodes but since WotLK all mining nodes are usable once and grant all loot with a single use
uint32 eventId; //6 lootedEvent
uint32 linkedTrapId; //7
uint32 questId; //8 not used currently but store quest required for GO activation for player
@@ -529,6 +529,11 @@ class OPvPCapturePoint;
union GameObjectValue
{
+ //25 GAMEOBJECT_TYPE_FISHINGHOLE
+ struct
+ {
+ uint32 MaxOpens;
+ } FishingHole;
//29 GAMEOBJECT_TYPE_CAPTURE_POINT
struct
{