SpawnLists.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef EQ2_SPAWN_LISTS
  17. #define EQ2_SPAWN_LISTS
  18. #include "../common/types.h"
  19. #include <vector>
  20. #include <map>
  21. #define SPAWN_ENTRY_TYPE_NPC 0
  22. #define SPAWN_ENTRY_TYPE_OBJECT 1
  23. #define SPAWN_ENTRY_TYPE_WIDGET 2
  24. #define SPAWN_ENTRY_TYPE_SIGN 3
  25. #define SPAWN_ENTRY_TYPE_GROUNDSPAWN 4
  26. struct EntityCommand{
  27. string name;
  28. float distance;
  29. string error_text;
  30. string command;
  31. int16 cast_time;
  32. int32 spell_visual;
  33. map<int32, bool> allow_or_deny; // this is a map of player IDs and whether they are allowed on the command or denied
  34. bool default_allow_list; // if set to false then its a defaultDenyList
  35. };
  36. struct SpawnEntry{
  37. int32 spawn_entry_id;
  38. int32 spawn_location_id;
  39. int8 spawn_type;
  40. int32 spawn_id;
  41. float spawn_percentage;
  42. int32 respawn;
  43. int32 expire_time;
  44. int32 expire_offset;
  45. };
  46. class SpawnLocation{
  47. public:
  48. SpawnLocation(){
  49. x = 0;
  50. y = 0;
  51. z = 0;
  52. heading = 0;
  53. total_percentage = 0;
  54. x_offset = 0;
  55. y_offset = 0;
  56. z_offset = 0;
  57. placement_id = 0;
  58. pitch = 0;
  59. roll = 0;
  60. grid_id = 0;
  61. conditional = 0;
  62. }
  63. ~SpawnLocation(){
  64. for(int32 i=0;i<entities.size();i++)
  65. safe_delete(entities[i]);
  66. }
  67. void AddSpawn(SpawnEntry* entity){ entities.push_back(entity); }
  68. vector<SpawnEntry*> entities;
  69. float x;
  70. float y;
  71. float z;
  72. float heading;
  73. float x_offset;
  74. float y_offset;
  75. float z_offset;
  76. int32 placement_id;
  77. float pitch;
  78. float roll;
  79. float total_percentage;
  80. int32 grid_id;
  81. string script;
  82. int8 conditional;
  83. };
  84. #endif