Commit graph

106 commits

Author SHA1 Message Date
VladimirMangos
6487c24f29 [9545] Rename ObjectDefines.h -> ObjectGuid.h
Also move unrelated generic defines to Common.h
2010-03-07 20:05:32 +03:00
VladimirMangos
b47520a500 [9543] Really call ACHIEVEMENT_CRITERIA_TYPE_WIN_BG
Also make more wide set achievement type criterias expected requirement in DB table.

Original patch in achievement call part provided BudIcePenguin.
Prepared to mangos sources by Burned@ru-mangos.ru
2010-03-07 15:34:17 +03:00
VladimirMangos
010b0504b6 [9452] Replace battleground announcer options.
* Drop Battleground.QueueAnnouncer.Enable and Battleground.QueueAnnouncer.PlayerOnly
* Add Battleground.QueueAnnouncer.Join with 0..2 values (1=to joined player, 2=to world)
* Add Battleground.QueueAnnouncer.Start for start bg event

Also fixed bug when not rated arenas announced as BG announces
Also lost mangosd.config changes from prev commit.
2010-02-25 17:02:50 +03:00
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
63709fdc49 Use PVPDificulty.dbc for bg/arena bracket selection (levels and difficulty) 2010-01-09 03:36:27 +03:00
VladimirMangos
3e3c090348 [9129] Rename BG/arena queue_id to bracket_id and related functions/etc
This is more consistent to wide used terms

Also some other cleanups.
2010-01-08 22:40:34 +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
balrok
23f603268d [8927] added missing continue for last commit 2009-12-06 10:01:47 +01:00
balrok
1de6692e04 [8926] BattleGround: call correct function at playerleave
it will now correctly drop the flag and correctly remove the player from
eye of the storm objectives

+ also avoid the spamming of all "Player not found!" messages in battlegrounds

    maybe all existing "player not found!" places should now get an assert(false)
    since this shouldn't happen anymore

+ also better error output in GetBattleGroundQueueIdFromLevel
2009-12-06 09:50:35 +01:00
VladimirMangos
fe1fae46ee [8830] Restore build at *nix. Make MAKE_PAIR* users includes explicit.
Comment for recently added field also.
2009-11-18 23:57:20 +03:00
Triply
537562f29f [8818] Language.h cleanup, TODO cleanup WS and EY messages. Removed 2 minutes starting message from battlegrounds.
Signed-off-by: Triply <triply@getmangos.com>
2009-11-15 09:07:26 +01:00
XTZGZoReX
a69fe0cb1d [8813] Re-implement some changes in [8799], but with mutex calls commented. 2009-11-14 15:07:04 +01:00
XTZGZoReX
ec808c9d3d [8809] Revert "[8799] Implemented thread safe bg queue updates."
This reverts commit 72f7a7ee56c63672faa7786b1d162a7a3b9ab406.

This is temporary revert due to bug in ACE_Thread_Mutex.
Original code itself in commit has no problem.

Conflicts:

	src/shared/revision_nr.h
2009-11-12 16:00:28 +01:00
Triply
ee0fa56166 [8799] Implemented thread safe bg queue updates.
Signed-off-by: Triply <triply@getmangos.com>
2009-11-09 22:25:54 +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
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
d009994f59 [8768] Rewrite code for prepare and send mails.
* Move send functions to new MailDraft class from WorldSession
* Simplify use different args combinations used in SendMailTo
  by groupping its by functionality in Helper classes. This also will prevent wrong way use args combinations.
2009-11-03 17:34:23 +03:00
VladimirMangos
d5dad82f3d [8764] Simplify code for mail items send. Avoid packet unread spam at errors. 2009-11-02 15:58:12 +03:00
NoFantasy
65965bc5fa [8642] Replace the Spanish word 'hostil' with the English one.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2009-10-14 12:46:10 +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
c5a22f775b [8574] Use map pointer in BattleGround for faster access
this avoids the HashMapHolder usage when searching
for objects
2009-09-30 18:18:33 +02:00
balrok
bf8e801ab0 [8563] fixed buffobject despawning in wsg
cause those objects are spawned through db
old buff-handling code only threw errors
2009-09-29 16:38:58 +02:00
balrok
1f9b4ca4c3 [8553] removed spiritguide from code
they basicaly should
*autocast 22011
*give player after gossiphello buff 2584
*port players away to another spiritguides, when they die

so this can be done by a script
and maybe eventai
2009-09-28 16:45:06 +02:00
balrok
0ce6395857 gm command for reload of eventindex
also i merged both loading functions together
(union-select gameobject and creature)
those loading functions were pretty similar
2009-09-28 16:42:08 +02:00
balrok
2adf6245c2 BattleGround: removed now unneeded functions
I couldn't remove AddObject and m_bgObjects from code
cause it's still needed for buffobjects.. later
the poolsystem must be rewritten, so that it'll work for instances too
then those objects can be removed

(it would be possible to take the eventsystem for those spawns too - but
this would be the wrong way to handle it)
2009-09-28 16:42:01 +02:00
balrok
9b7b3b0304 corrected spawning of buffobjects in arena
they are spawned in all arenas 60 seconds after start
so i implemented this function in BattleGround.cpp
maybe we should use BattleGroundAA for such things
then we also can drop all arena-files, cause
all arenas are working in the same way
(at least those which are currently implemented)
2009-09-28 16:41:54 +02:00
balrok
c77683afbb event-handling functions in battleground-class
i added a map m_ActiveEvents which will track all current active events
it's allways key:event1 -> value:event2 so it's like a one dimensional array
which contains current active event2..
i only need one event2 in this list, cause i only want to allow one event2 at
the same time if other event2 are also active right now - i would just despawn
it

(for example (numbers not real) arathi basin stables are event1=3 and have 5
states (alliance assault, horde assault, neutral...) so every state has an
event2 index and only one state at a time is possible (so if we spawn
horde-contested gameobjects/creatures, we will despawn everything else)

OnObjectDBLoad - generic implementation for this function:
    will automaticly spawn or not spawn.. open (doors) or not open
    gameobjects/creatures

doors:
i use event1=254 and event2=0

IsDoor(event1,event2) - just a check if this event could be a door (mostly not
    needed for bg-subclasses)

OpenDoorEvent(event1,event2) - opens the door (used in bg subclass cause some
doors also must be despawned)

SpawnEvent(event1, event2, bool spawn)
    spawn=true says all related gameobjects/creatures getting spawned, else despawned
    will despawn all event2 in event1 which are not equal to the
    event2-parameter
    also this function will set the right values in m_ActiveEvents

IsActiveEvent(event1,event2) - returns true if event is active
2009-09-28 16:41:33 +02:00
balrok
3cf92b8507 spawnbgobject now accepts guids instead of bg_objects-index
this makes those functions independent from the bg_objects vector

also dooropen and doorclose will now accept only guid

additional i removed the comments around spawnbgcreatures-function
also i updated this function, so that it'll work
2009-09-28 16:15:25 +02: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
Triply
56ddf40d62 [8474] Allow to delete BattleGround objects when any of invited players didn't click to enter battle.
Rename m_TeamScores500disadvantage to m_TeamScores500Disadvantage, and optimize its update.
Patch is tested.

Signed-off-by: Triply <triply@getmangos.com>
2009-09-05 13:31:40 +02:00
balrok
beae3fe00f [8427] remove afk-flag at bg-join
Signed-off-by: balrok <der-coole-carl@gmx.net>
2009-08-27 12:24:05 +02:00
VladimirMangos
7caf5b5b2f [8344] In case battleground reward items player must "receive" instead "create" item in message. 2009-08-10 15:28:05 +04:00
ApoC
6d9448dd7f [8339] Improved storing/restoring BG entry point
* Introduced new table character_battleground_data
* Entry point is now stored on BG enter event not join event
* Entry point for dungeons is now correctly set to nearest graveyard
  (this prevent well known assert in GetInstance because of porting to already destroyed instance)
* Teleporting from BG correctly restore mount state
* Teleporting from BG correctly restore taxi flight
  (in multipath flight you will end up in nearest transition point on the route)

Signed-off-by: ApoC <apoc@nymfe.net>
2009-08-09 11:00:37 +02:00
VladimirMangos
4e2536df45 [8331] Restore spirit guids work, step 2
Remove hack in battleground code that prevent proper work guids in result
sabotage of now correct work spell itself.
2009-08-09 00:49:14 +04:00
VladimirMangos
a6413516f9 [8315] Fixed memory leaks (mostly at server shutdown) and code cleanups.
* Fixed leak in BattleGround::m_PlayerScores at BattleGround::Reset,
  add and use BattleGroundScoreMap typedef
* Delete AreaTeam objects stored in global map at shutdown
* Delete Corpse objects stored in global map at shutdown
* Store guild bank log entries as objectes instead pointers in log event lists
2009-08-05 14:27:30 +04:00
VladimirMangos
9002710c93 [8276] Implement achievment ACHIEVEMENT_CRITERIA_TYPE_WIN_BG
* including new achievement createria data type ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE

Note: Some achivement creteria for success need data in `achievement_criteria_data`
2009-07-29 17:29:10 +04:00
balrok
d8c1e3991f [8274] use virtual m_TeamScore for battlegrounds
score is used in every battleground (not arena)
so we can use it as a virtual variable to access
it also from BattleGround-class

Signed-off-by: balrok <der-coole-carl@gmx.net>
2009-07-29 14:45:45 +02: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
AlexDereka
68ee99f6ac [8006] Fixed crash in EndBattleGround(). 2009-06-14 00:44:31 +04:00
Trazom
626553c9ee [7934] Implement ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also added ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE and support
this criteira special cases base at `achievement_criteria_data`
that required DB support.
2009-06-01 07:32:03 +04:00
VladimirMangos
2a27a44e2a [7918] Improve portability in work with uint64 string format specifiers and in code literals.
* Replace platform seelction MaNGOS code for select format descriptor for uint64 by using ACE define.
  I64FMTD renamed to UI64FMTD for more clear name.
* Add new define UI64LIT (base at ACE seelction) for build portables uint64 literals.
  Please always use UI64LIT(0x00001) instead less portable 0x00001LL
2009-05-30 22:44:20 +04:00
raczman
159258b668 [7859] Memory leak in BG code.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Thanks to ANTOMA for prepering patch to mangos.
2009-05-20 16:34:28 +04:00
Nezemnoy
00820846e9 [7805] Refactoring batleground rewards code for cleanup and useful state for custom reward reuse.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-09 16:20:13 +04:00
zhenya
8144f30199 [7730] Some optimizantion and code style.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
2009-04-29 01:05:21 +04:00
VladimirMangos
c2e6dd20dd [7715] Provided way for scripts set alternative gameobject state for client show.
Also use enum for gsmeobject states.
2009-04-26 07:21:11 +04:00
Trazom
eedc10d46f [7703] Implement heal/damage total counters and related BG achievments.
* ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
* ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-04-23 23:56:15 +04:00
VladimirMangos
fc0e1ecdf1 [7690] Move GetCreature/GetGameobject to class Map.
* This let get objects at map without reference to player or another object.
* Simplify future implementation for per-map storage for like objects
2009-04-20 19:08:13 +04:00
VladimirMangos
eb198f8239 [7645] Fixed problems wit temporary unsummoned pets and cleanup code.
* Save temporary unsummoned pet to current slot (instead non_in_slot mode) and
  prevent save as current pet summoned while temporay unsummon (arena)
* Prevent overwrite temporary summoned pet data
* At player loading set temporary unsummoned pet data instead pet loading
  if pet expected to be temporary unsummoned in current player state (loading in taxi flight/etc)
* Restore proper pet at arena leave and unsummon in arena summoned.
2009-04-11 08:46:48 +04:00
balrok
6b2fd22a9c [7632] more "if"-condition related codestyle in battlegroundfiles
this time with this regex:
sed -i 's/if *( *\(.*\) *)$/if (\1)/' BattleGround*
2009-04-07 17:25:53 +00:00