Commit graph

106 commits

Author SHA1 Message Date
AlexDereka
ebfb0f9835 [9389] Cleanup config data. Use proper names and expected types. 2010-02-15 15:29:06 +03:00
AlexDereka
ccfd42bf3e [9381] Fixed some compile warnings. 2010-02-14 18:16:07 +03:00
VladimirMangos
87a35b0489 [9317] Call linkedtrap summon in more cases.
* GAMEOBJECT_TYPE_BUTTON can have linked traps
* Spell::EffectSummonObject also can summon objects with linked traps

Thanks to patman128 for research second case.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-02-07 02:51:45 +03:00
XTZGZoReX
0ff9250de2 [9245] Remove CellLock class and all cell-level thread locking.
* It was wasting CPU power as cell-level locking is not needed.
* Future multithreading will be on map-level.
* CellLock was just a 'proxy' between Cell and CellPair and in some cases carried redundant data.
* Some minor cleanup in Cell::Visit/Map::Visit.
2010-01-23 21:36:15 +01:00
NoFantasy
544d396beb [9205] Move script call GOHello to GameObject::Use
This provide more accurate call in case of delay use from spell effects

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-17 23:44:33 +01:00
NoFantasy
16c0ff3ef7 [9204] Move remaining handling of GO from SendLoot to GameObject::Use
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-17 23:06:31 +01:00
NoFantasy
55b6b0eb26 [9201] Fix typo from [9200] and clean up code in function.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-17 12:02:45 +01:00
NoFantasy
95f9ec5fb2 [9200] Move handling of most GO's from SendLoot() to GameObject::Use()
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-17 11:45:14 +01:00
NoFantasy
07a5c698ca [9199] Clarify debug log message in GameObject::Use
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-17 10:52:01 +01:00
NoFantasy
dbf0fafbfe [9182] Replace 0 with NULL in a few CastSpell calls (removed where not needed)
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-15 01:43:02 +01:00
NoFantasy
0d6b7f144c [9181] Rewrite parts of GameObject use for GO type 10
This implement using autoclose time for type 10 and also sending a custom animation for some.
To avoid duplicate code, remove code from SendLoot() (handled in Use() instead)

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-15 01:23:45 +01:00
NoFantasy
a461652636 [9180] Add function to send custom animation for GameObject
Replace in code where packet used explicit.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-15 01:01:41 +01:00
VladimirMangos
4d90a2e1f2 [9146] More poolmgr cleanps.
* Replace mixed values used type args by function template specializations
* More explcilty show fact that poolmgr work only with db guids.
2010-01-11 12:24:36 +03:00
VladimirMangos
fe6e2e1746 [9122] Updated copyright notice for new year.
Also fix some lost in past cases.
2010-01-08 00:02:21 +03:00
DasBlub
ebb063beb9 [9107] Fix most of the gcc warnings
* use UI64FMTD instead of "%u" for uint64 output
* on most *NIX systems, I64FMT is "%016lX" and not "%016llX"
* also fix typo: renamed GridMap::loadHeihgtData to GridMap::loadHeightData

Note: there are still many warnings from the 3rd party libraries g3dlite and ACE. Those warnings won't be fixed with that commit.
Also, a few warnings from MaNGOS are left, they'll be fixed later.

Signed-off-by: XTZGZoReX <xtzgzorex@gmail.com>
2010-01-03 15:30:22 +01:00
NoFantasy
cccb85dbe2 [9017] Fix typo in GO gossipID check for type 10
Signed-off-by: NoFantasy <nofantasy@nf.no>
2009-12-17 22:35:57 +01:00
NoFantasy
090c8b8854 [8923] Restructure gossip menus and make it possible to build selections by database
As result, gossip for GO is now possible. Moved related data structures and remove useless from code.
Please note that after some time, table npc_gossip will be fully removed (use menuId in _template in relation to gossip_menu as replacement).
Special thanks to GriffonHeart for help with research, discussions and ideas of code and thanks to Vladimir for helpful input.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2009-12-06 02:27:26 +01:00
balrok
56d694b5fb [8846] corrections for my last commit
thx to vladimir and apoc :)
2009-11-20 13:25:54 +01:00
balrok
1d362eace4 [8845] fixed some gcc warnings 2009-11-20 12:57:19 +01:00
XTZGZoReX
0734adb746 [8789] Rename several singleton macros to use more consistent names.
* objmgr -> sObjectMgr
 * spellmgr -> sSpellMgr
 * WaypointMgr -> sWaypointMgr
 * poolhandler -> sPoolMgr
 * objaccessor -> sObjectAccessor
 * mapmgr -> sMapMgr
 * sInstanceSaveManager -> sInstanceSaveMgr
 * ticketmgr -> sTicketMgr
 * CreatureEAI_Mgr -> sEventAIMgr
 * auctionmgr -> sAuctionMgr
 * achievementmgr -> sAchievementMgr
2009-11-08 12:11:34 +01:00
XTZGZoReX
33d475caf3 [8786] Rename some files.
* HostilRefManager.cpp/.h -> HostileRefManager.cpp/.h
 * PoolHandler.cpp/.h -> PoolManager.cpp/.h
2009-11-08 04:21:56 +01:00
XTZGZoReX
1f23884757 Don't use singleton to access static functions.
* This affects especially ObjectMgr functions:
   - GetCreatureInfo
   - GetGameObjectInfo
   - GetInstanceTemplate
   These are in fact static functions.
2009-11-08 03:54:27 +01:00
VladimirMangos
d594a29af1 [8779] Not output error at empty item loot for mail template at mail creating. 2009-11-06 02:39:51 +03:00
VladimirMangos
b942616ded [8710] Make vehicle guid counter per-map local.
Also update/drop/move to Map some dependent functions.
2009-10-22 17:43:41 +04:00
VladimirMangos
bc1f6c7d3f [8654] Allow loading some type gameobjects without diplay id set.
But make its always inviisble for client.
2009-10-17 02:16:36 +04:00
ApoC
45c9c136ba [8653] Implemented per map guids store.
This patch implements storing guid->object pairs on per map level, this leads
to less locking in ObjectAccessor in case of further multithreaded map update.

For case of cross map guid looking (auras cases) all maps are linked into
ObjectAccessor and can be traversed for this lookup.

Signed-off-by: ApoC <apoc@nymfe.net>
2009-10-17 00:12:31 +02:00
balrok
45f6a474bf [8608] implement BattleGround Alterac Valley
sql won't be included - please look at your database
providers forum

also note, that creature_loot_template id 0
is used for the loot of dead players in this bg
(after a player died and you remove insignia from him..
he not only drops money - he drops some random items too)

further work must be done in better code for adjusting right
levels to creatures - maybe using something similar like it's
done in heroic instances

also quests and creatures needs some scripts in future

thanks to:
netsky - initial start of this patch
bogie - 2nd person writing on this patch
triply, kapatejib, vladimir - code review and suggestions
arrai - for his great tool and help
and all testers / code contributers - I won't write
down a list, else I would forget most probably one ^^
2009-10-09 18:18:22 +02:00
XTZGZoReX
63897d56d7 Move visibility update functions to more appropriate classes.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-10-01 19:01:42 +04:00
balrok
b2e32f4ff9 [8570] allow negative spawntimesecs also when NoDamageImmune is 0
thx to crackm for report and investigations :)
2009-09-30 15:09:07 +02:00
balrok
538c5c257e [8548] implement db supported battleground eventindexes
those eventindexes will then be used by the battleground-code to decide
which creature belongs to which objective
for example all creatures in alteracvalley which are standing around a tower
will belong to one eventindex then.. the eventindex will be defined through the code
and must be proper documented for db-devs
2009-09-28 16:41:00 +02:00
Ambal
cfea99ea62 [8524] New cell search algorithm implemented. You can now choose different visibility distances on continents, in BG/Arenas and instances.
Please, update your config files and check new options:

Visibility.Distance.Continents    = 90
Visibility.Distance.Instances     = 120
Visibility.Distance.BGArenas      = 180

Thanks everyone involved in patch tests!

Signed-off-by: Ambal <pogrebniak@gala.net>
2009-09-21 23:25:29 +03:00
balrok
bd30769dec [8475] fixed some gcc-warnings
all warnings from Wunused
and some from Wall

cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code

for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint

also note for coding:
if you do something like
    if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)

Signed-off-by: balrok <der-coole-carl@gmx.net>
2009-09-05 13:47:47 +02:00
Opterman
26a104a05a [8461] Correcting buildUpdateValues for GAMEOBJECT_DYNAMIC flag.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2009-09-04 01:18:17 +02:00
VladimirMangos
45dd7140b5 [8422] Implement far sight like spells work for long distance.
* Added basic infrastructure for visibility update in case difference player and current view point.
  Just for note: seletect additional arg way beacuse repeatable search object will slow but store pointer will not safe,
  so use middle case: get view point pointer early as possible at visibility updates.
* Implement dynamic object and creature activisation while it's target of far sight spell effect
* Use this for SPELL_AURA_BIND_SIGHT, SPELL_AURA_FAR_SIGHT and SPELL_EFFECT_ADD_FARSIGHT.
* Note2: some spyglass like spells let look _around_ at long distance, this hard implement in current grid loading system
  Without additional changes and not implemented (you will see empty area without creatures in likes case)

* Also fixed warning spam at CMSG_MOVE_SET_CAN_FLY_ACK receive by use proper packet sructure reading.
2009-08-26 08:30:40 +04:00
VladimirMangos
74d27294aa [8381] Some refactoring work in Unit::m_currentSpells code.
* Restrict access, use enum args, move some repeated code parts to function.
* Make m_selfContainer set only part of Unit::SetCurrentCastedSpell
2009-08-18 02:12:56 +04:00
Ambal
64f11bedf7 [8252] Move DB scripting code from global World to Map.
This one more step to pre-map events proccesing and parallel in future.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-07-26 12:20:59 +04:00
VladimirMangos
39833b0069 [8205] Really use trap GO charges and avoid casting in despawned state.
* Drop horribale hack with stored charges amount, use instead GO info charges data as expected.
* Count trap activations as charge uses if it have limited charges.
* Check trap reactions only in ready spawned state.
2009-07-19 07:41:08 +04:00
VladimirMangos
9a0abf0e01 [8183] Some gameobject despanw related fixes
* Implement use `consumable` field in gameobject template for gameobject required explcit despawn at use.
* Move gameobject template fields cech function from Gameobject to gameobject template class, and update callers.
* Cast spells at gameobject use with gameobject guid as original caster guid, as already used in some other cases.
2009-07-15 06:32:08 +04:00
Ambal
58209ee79a [8182] Store and use Map* pointer in WorldObject instead map ids for speedup
Also some code logic cleanups.
Changes let make more cleanups in base map access and other places,
but this chnages not inlcuded in patch.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-07-15 02:13:52 +04:00
Win32
03926619d9 [8151] Fixed some format warnings and typos.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

SOme changes rewrited with using [8150]
2009-07-09 01:09:12 +04:00
Ambal
9f938a9ed4 [8103] More wide use IsInWorld checks and delayed at teleport operations.
* IsInWorld used to prevent return unexpected not in world objects.
* Delayed operations need to process its in world state.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-07-01 14:00:29 +04:00
VladimirMangos
9f41772828 [8102] Simplify code base at new root method WorldObject::CleanupsBeforeDelete
* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
* Create Gameobject version to make GO with owner more safe for remove
2009-07-01 11:09:34 +04:00
Ambal
b76c4c2f3c [8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
2009-06-16 12:47:02 +04:00
tomrus88
1f87157edf Merge commit 'origin/master' into 310
Conflicts:
	src/game/UpdateData.cpp
2009-06-07 21:42:02 +04:00
Ambal
4118a70f65 [7969] Remove gameobject from owner gameobjecs list at expire.
This will prevent delayd owner access from gameobject destructor
in time remove list proccessing and fix possible related problems
with crosslinked pointers.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-06-06 11:40:59 +04:00
tomrus88
cffbb8661b Merge commit 'origin/master' into 310
Conflicts:
	src/game/Player.cpp
	src/game/SpellAuras.cpp
2009-06-02 15:01:26 +04:00
NoFantasy
bfafee5263 [7933] Call goober GO event script not only at open spell cast, also really call camera GO event scripts.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-06-01 05:29:55 +04:00
tomrus88
908f41b031 Attempt to fix quests. Some other fixes. 2009-05-07 02:04:43 +04:00
tomrus88
7e938af972 Updated to latest PTR client build 9868. 2009-05-05 10:41:22 +04:00
tomrus88
d4323e0071 Merge commit 'origin/master' into 310
Conflicts:
	src/game/CharacterHandler.cpp
	src/game/Player.cpp
2009-04-29 11:51:15 +04:00