1. #ifndef OUTDOOR_PVP_CA_
  2. #define OUTDOOR_PVP_CA_
  3. #include "OutdoorPvP.h"
  4. #include "DBCStructure.h"
  5. const uint32 CA_OUTDOORPVP_ZONE = 268;
  6. enum OutdoorPvPCAMisc
  7. {
  8. CA_TOWER_NUM = 6,
  9. CA_SUMMON_NPC_NUM = 2,
  10. CA_BOSSES_NUM = 2,
  11. CA_NEUTRALL_BOSS_NUM = 1,
  12. CA_NEUTRALL_CREEP_NUM = 8,
  13. CA_CREATURE_TELEPORT = 2,
  14. CA_OBJ_NUM = 5
  15. };
  16. enum OutdoorPvPCACreType
  17. {
  18. CREATURE_TOWER,
  19. CREATURE_BOSS,
  20. CREATURE_CREEPS,
  21. CREATURE_OTHER
  22. };
  23. const creature_type CA_NPC[19] =
  24. {
  25. {500100,469,37,385.971f,123.039f,247.01f,2.27449f}, //towers Alliance
  26. {500101,469,37,884.624f,53.9453f,300.495f,3.10701f},
  27. {500102,469,37,1007.17f,299.301f,329.513f,5.29827f},
  28. {500110,67,37,217.999f,285.239f,265.702f,4.83881f}, //towers Horde
  29. {500111,67,37,40.6596f,594.728f,270.034f,2.91223f},
  30. {500112,67,37,111.332f,989.631f,296.663f,0.37932f},
  31. {500109,469,37,1094.846f,297.789f,338.614f,3.253f}, //boss Alliance
  32. {500119,67,37,43.672f,1172.592f,367.344f,5.265f}, //boss Horde
  33. {500108,469,37,1020.697f,268.367f,331.41f,2.1f}, //npc summon Alliance
  34. {500118,67,37,131.839f,1034.631f,297.041f,4.964f}, //npc summon Horde
  35. {500120,0,37,-24.903f,-32.703f,267.315f,0.263f}, //neutral_bosses
  36. {500121,0,37,208.666f,34.061f,236.902f,2.882f}, //neutral_creeps
  37. {500121,0,37,181.969f,-0.469f,237.440f,2.073f},
  38. {500121,0,37,113.592f,154.821f,238.062f,4.457f},
  39. {500121,0,37,157.889f,161.115f,239.206f,5.152f},
  40. {500121,0,37,313.909f,525.031f,286.610f,1.67f},
  41. {500121,0,37,331.830f,528.019f,288.615f,2.92f},
  42. {500121,0,37,736.405f,345.555f,279.597f,6.15f},
  43. {500121,0,37,739.333f,334.857f,276.275f,0.64f}
  44. };
  45. const go_type CA_OBJ[CA_OBJ_NUM] =
  46. {
  47. {179905,37,24.1198f,454.163f,325.424f,0,0,0,0,0},
  48. {179905,37,662.314f,107.142f,298.563f,0,0,0,0,0},
  49. {179871,37,850.858f,338.06f,269.57f,0,0,0,0,0},
  50. {179904,37,152.334f,68.736f,230.783f,0,0,0,0,0},
  51. {179871,37,282.153f,772.27f,263.774f,0,0,0,0,0}
  52. };
  53. const creature_type* creatures = CA_NPC;
  54. const go_type* objects = CA_OBJ;
  55. const uint32 Buff[6] =
  56. {
  57. 41630,//1
  58. 71188,//2
  59. 71193,//3
  60. 41630,//1
  61. 71188,//2
  62. 71193,//3 maybe 71195
  63. };
  64. struct teleporter_type
  65. {
  66. uint32 map;
  67. float x;
  68. float y;
  69. float z;
  70. float o;
  71. };
  72. const teleporter_type SPAWN[2] =
  73. {
  74. //alliance
  75. {37,1245.12f,248.638f,355.214f,3.1f},
  76. //horde
  77. {37,39.38f,916.849f,339.394f,5.93f}
  78. };
  79. enum OutdoorPvPCASpells
  80. {
  81. KILLREWARD = 49426,
  82. WINREWARD = 37829,
  83. SPELL_TENACITY = 58549,
  84. SPELL_TENACITY_VEHICLE = 59911,
  85. SPELL_KILL_BOSS_NEUTRAL = 41924,
  86. SPELL_KILL_CREEP_NEUTRAL = 57060,
  87. SPELL_KILL_BOSS_NEUTRAL_ALL = 71463,
  88. SPELL_DMG = 47253, //47253 59742
  89. SPELL_BUFF_TOWER = 68652
  90. };
  91. class OutdoorPvPCA;
  92. class OutdoorPvPCA : public OutdoorPvP
  93. {
  94. public:
  95. OutdoorPvPCA();
  96. bool SetupOutdoorPvP();
  97. bool Update(uint32 diff);
  98. void HandlePlayerEnterZone(Player * plr, uint32 zone);
  99. void HandlePlayerLeaveZone(Player * plr, uint32 zone);
  100. void HandleKillImpl(Player * plr, Unit * killed);
  101. void HandleKill(Player* killer, Unit* killed);
  102. void Rewards(TeamId team);
  103. void CheckNPC();
  104. void OnCreatureCreate(Creature *creature);
  105. void OnCreatureRemove(Creature *creature);
  106. protected:
  107. void RestartCA();
  108. void UpdateTenacityStack();
  109. void ResurrectSystem(TeamId team);
  110. void TeleportPlayersOnCA(TeamId team);
  111. void RespawnAllCreaturesOnCA();
  112. void AddTowersToCA();
  113. void AddBossesToCA();
  114. void AddCreepsSummonNpcToCA();
  115. void AddNeutrallBossToCA();
  116. void AddNeutrallCreepsToCA();
  117. void AddCreatureTeleporter();
  118. void AddCreatureTeleport();
  119. void AddObjectBuffs();
  120. OutdoorPvPCACreType GetCreatureType(uint32 entry) const;
  121. void AddCre(uint32 type, uint32 guid, uint32 entry);
  122. bool AddCreature(uint32 type, uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay);
  123. bool DelCreature(uint32 type);
  124. void AddGO(uint32 type, uint32 guid, uint32 entry);
  125. bool AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3);
  126. bool DelObject(uint32 type);
  127. bool UpdateCreatureInfo(Creature *creature);
  128. typedef std::set<Creature*> CreatureSet;
  129. CreatureSet m_creature;
  130. CreatureSet m_vehicles[2];
  131. private:
  132. int32 m_tenacityStack;
  133. uint32 check_towers[CA_TOWER_NUM];
  134. std::map<uint32, uint64> m_Objects;
  135. std::map<uint32, uint64> m_Creatures;
  136. std::map<uint64, uint32> m_ObjectTypes;
  137. std::map<uint64, uint32> m_CreatureTypes;
  138. };