9
3

GroundSpawn.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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_GroundSpawn__
  17. #define __EQ2_GroundSpawn__
  18. #include "Spawn.h"
  19. #include "client.h"
  20. #include "../common/Mutex.h"
  21. class GroundSpawn : public Spawn {
  22. public:
  23. GroundSpawn();
  24. virtual ~GroundSpawn();
  25. GroundSpawn* Copy(){
  26. GroundSpawn* new_spawn = new GroundSpawn();
  27. new_spawn->size = size;
  28. new_spawn->SetPrimaryCommands(&primary_command_list);
  29. new_spawn->SetSecondaryCommands(&secondary_command_list);
  30. new_spawn->database_id = database_id;
  31. new_spawn->primary_command_list_id = primary_command_list_id;
  32. new_spawn->secondary_command_list_id = secondary_command_list_id;
  33. memcpy(&new_spawn->appearance, &appearance, sizeof(AppearanceData));
  34. new_spawn->faction_id = faction_id;
  35. new_spawn->target = 0;
  36. new_spawn->SetTotalHP(GetTotalHP());
  37. new_spawn->SetTotalPower(GetTotalPower());
  38. new_spawn->SetHP(GetHP());
  39. new_spawn->SetPower(GetPower());
  40. new_spawn->SetNumberHarvests(number_harvests);
  41. new_spawn->SetAttemptsPerHarvest(num_attempts_per_harvest);
  42. new_spawn->SetGroundSpawnEntryID(groundspawn_id);
  43. new_spawn->SetCollectionSkill(collection_skill.c_str());
  44. SetQuestsRequired(new_spawn);
  45. new_spawn->forceMapCheck = forceMapCheck;
  46. new_spawn->SetOmittedByDBFlag(IsOmittedByDBFlag());
  47. new_spawn->SetLootTier(GetLootTier());
  48. new_spawn->SetLootDropType(GetLootDropType());
  49. new_spawn->SetRandomizeHeading(GetRandomizeHeading());
  50. return new_spawn;
  51. }
  52. bool IsGroundSpawn(){ return true; }
  53. EQ2Packet* serialize(Player* player, int16 version);
  54. int8 GetNumberHarvests();
  55. void SetNumberHarvests(int8 val);
  56. int8 GetAttemptsPerHarvest();
  57. void SetAttemptsPerHarvest(int8 val);
  58. int32 GetGroundSpawnEntryID();
  59. void SetGroundSpawnEntryID(int32 val);
  60. void ProcessHarvest(Client* client);
  61. void SetCollectionSkill(const char* val);
  62. const char* GetCollectionSkill();
  63. string GetHarvestMessageName(bool present_tense = false, bool failure = false);
  64. string GetHarvestSpellType();
  65. string GetHarvestSpellName();
  66. void HandleUse(Client* client, string type);
  67. void SetRandomizeHeading(bool val) { randomize_heading = val; }
  68. bool GetRandomizeHeading() { return randomize_heading; }
  69. private:
  70. int8 number_harvests;
  71. int8 num_attempts_per_harvest;
  72. int32 groundspawn_id;
  73. string collection_skill;
  74. Mutex MHarvest;
  75. Mutex MHarvestUse;
  76. bool randomize_heading;
  77. };
  78. #endif