Advertisement
Guest User

Untitled

a guest
May 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. Index: src/arcemu-world/BattlegroundHandler.cpp
  2. ===================================================================
  3. --- src/arcemu-world/BattlegroundHandler.cpp (revision 3371)
  4. +++ src/arcemu-world/BattlegroundHandler.cpp (working copy)
  5. @@ -82,25 +82,15 @@
  6. * uint32 t = BattleGroundType
  7. **********************************************************************************/
  8. uint32 t = BATTLEGROUND_WARSONG_GULCH;
  9. - if (mapid == 0)
  10. - {
  11. - if(pCreature->GetCreatureInfo())
  12. - {
  13. - if(strstr(pCreature->GetCreatureInfo()->SubName, "Arena") != NULL)
  14. + if(mapid == 0){
  15. + if( strstr(pCreature->GetCreatureInfo()->SubName, "Arena") != NULL){
  16. t = BATTLEGROUND_ARENA_2V2;
  17. - else if(strstr(pCreature->GetCreatureInfo()->SubName, "Arathi") != NULL)
  18. - t = BATTLEGROUND_ARATHI_BASIN;
  19. - else if(strstr(pCreature->GetCreatureInfo()->SubName, "Eye of the Storm") != NULL)
  20. - t = BATTLEGROUND_EYE_OF_THE_STORM;
  21. - else if(strstr(pCreature->GetCreatureInfo()->SubName, "Warsong") != NULL)
  22. - t = BATTLEGROUND_WARSONG_GULCH;
  23. - else if(strstr(pCreature->GetCreatureInfo()->SubName, "Alterac") != NULL)
  24. - t = BATTLEGROUND_ALTERAC_VALLEY;
  25. - else if(strstr(pCreature->GetCreatureInfo()->SubName, "Strand") != NULL)
  26. - t = BATTLEGROUND_STRAND_OF_THE_ANCIENT;
  27. + }else{
  28. + BGMaster *battlemaster = BGMasterStorage.LookupEntry( pCreature->GetProto()->Id );
  29. + if( battlemaster != NULL )
  30. + t = battlemaster->bg;
  31. }
  32. - }
  33. - else
  34. + }else
  35. t = mapid;
  36.  
  37. BattlegroundManager.HandleBattlegroundListPacket(this, t);
  38. Index: src/arcemu-world/BattlegroundMgr.h
  39. ===================================================================
  40. --- src/arcemu-world/BattlegroundMgr.h (revision 3371)
  41. +++ src/arcemu-world/BattlegroundMgr.h (working copy)
  42. @@ -78,6 +78,21 @@
  43. BGSTATUS_TIME = 3, // Ex. Wintergrasp time remaining
  44. };
  45.  
  46. +
  47. +//////////////////////////////////////////////////////////////////////////////
  48. +//struct BGMaster;
  49. +// Contains creature -> battleground id association pairs
  50. +//
  51. +//fields:
  52. +// uint32 entry - creature entry of the battlemaster
  53. +// uint32 bg - ID of the battleground the creature is a battlemaster of
  54. +//
  55. +//////////////////////////////////////////////////////////////////////////////
  56. +struct BGMaster{
  57. + uint32 entry;
  58. + uint32 bg;
  59. +};
  60. +
  61. struct BGScore
  62. {
  63. uint32 KillingBlows;
  64. Index: src/arcemu-world/ObjectStorage.cpp
  65. ===================================================================
  66. --- src/arcemu-world/ObjectStorage.cpp (revision 3371)
  67. +++ src/arcemu-world/ObjectStorage.cpp (working copy)
  68. @@ -42,6 +42,7 @@
  69. const char * gUnitModelSizeFormat = "ufu";
  70. const char * gWorldStringTableFormat = "us"; // p2wow added [for worldserver common message storage]
  71. const char * gWorldBroadCastFormat = "usu";// announce message
  72. +const char * gBattleMasterFormat = "uu";
  73.  
  74. /** SQLStorage symbols
  75. */
  76. @@ -63,7 +64,9 @@
  77. SERVER_DECL SQLStorage<UnitModelSizeEntry, HashMapStorageContainer<UnitModelSizeEntry> > UnitModelSizeStorage;
  78. SERVER_DECL SQLStorage<WorldStringTable, HashMapStorageContainer<WorldStringTable> > WorldStringTableStorage;
  79. SERVER_DECL SQLStorage<WorldBroadCast, HashMapStorageContainer<WorldBroadCast> > WorldBroadCastStorage;
  80. +SERVER_DECL SQLStorage<BGMaster, HashMapStorageContainer<BGMaster> > BGMasterStorage;
  81.  
  82. +
  83. SERVER_DECL set<string> ExtraMapCreatureTables;
  84. SERVER_DECL set<string> ExtraMapGameObjectTables;
  85.  
  86. @@ -511,6 +514,7 @@
  87. make_task(UnitModelSizeStorage, UnitModelSizeEntry, HashMapStorageContainer, "unit_display_sizes", gUnitModelSizeFormat);
  88. make_task(WorldStringTableStorage, WorldStringTable, HashMapStorageContainer, "worldstring_tables", gWorldStringTableFormat);
  89. make_task(WorldBroadCastStorage, WorldBroadCast, HashMapStorageContainer, "worldbroadcast", gWorldBroadCastFormat);
  90. + make_task(BGMasterStorage, BGMaster, HashMapStorageContainer, "battlemasters", gBattleMasterFormat);
  91.  
  92. }
  93.  
  94. @@ -554,6 +558,7 @@
  95. UnitModelSizeStorage.Cleanup();
  96. WorldStringTableStorage.Cleanup();
  97. WorldBroadCastStorage.Cleanup();
  98. + BGMasterStorage.Cleanup();
  99. }
  100.  
  101. vector<pair<string,string> > additionalTables;
  102. Index: src/arcemu-world/ObjectStorage.h
  103. ===================================================================
  104. --- src/arcemu-world/ObjectStorage.h (revision 3371)
  105. +++ src/arcemu-world/ObjectStorage.h (working copy)
  106. @@ -39,6 +39,7 @@
  107. extern SERVER_DECL SQLStorage<UnitModelSizeEntry, HashMapStorageContainer<UnitModelSizeEntry> > UnitModelSizeStorage;
  108. extern SERVER_DECL SQLStorage<WorldStringTable, HashMapStorageContainer<WorldStringTable> > WorldStringTableStorage;
  109. extern SERVER_DECL SQLStorage<WorldBroadCast, HashMapStorageContainer<WorldBroadCast> > WorldBroadCastStorage;
  110. +extern SERVER_DECL SQLStorage<BGMaster, HashMapStorageContainer<BGMaster> > BGMasterStorage;
  111.  
  112. void Storage_FillTaskList(TaskList & tl);
  113. void Storage_Cleanup();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement