9
3

GroundSpawn.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. return new_spawn;
  47. }
  48. bool IsGroundSpawn(){ return true; }
  49. EQ2Packet* serialize(Player* player, int16 version);
  50. int8 GetNumberHarvests();
  51. void SetNumberHarvests(int8 val);
  52. int8 GetAttemptsPerHarvest();
  53. void SetAttemptsPerHarvest(int8 val);
  54. int32 GetGroundSpawnEntryID();
  55. void SetGroundSpawnEntryID(int32 val);
  56. void ProcessHarvest(Client* client);
  57. void SetCollectionSkill(const char* val);
  58. const char* GetCollectionSkill();
  59. string GetHarvestMessageName(bool present_tense = false, bool failure = false);
  60. string GetHarvestSpellType();
  61. string GetHarvestSpellName();
  62. void HandleUse(Client* client, string type);
  63. private:
  64. int8 number_harvests;
  65. int8 num_attempts_per_harvest;
  66. int32 groundspawn_id;
  67. string collection_skill;
  68. Mutex MHarvest;
  69. Mutex MHarvestUse;
  70. };
  71. #endif