GroundSpawn.h 2.8 KB

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