9
3

GroundSpawn.h 2.7 KB

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