9
3

Widget.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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_WIDGET__
  17. #define __EQ2_WIDGET__
  18. #include "Spawn.h"
  19. #include "client.h"
  20. using namespace std;
  21. #define WIDGET_TYPE_GENERIC 0
  22. #define WIDGET_TYPE_DOOR 1
  23. #define WIDGET_TYPE_LIFT 2
  24. class Widget : public Spawn{
  25. public:
  26. Widget();
  27. virtual ~Widget();
  28. bool IsWidget(){ return true; }
  29. int32 GetWidgetID();
  30. void SetWidgetID(int32 val);
  31. void SetWidgetX(float val);
  32. float GetWidgetX();
  33. void SetWidgetY(float val);
  34. float GetWidgetY();
  35. void SetWidgetZ(float val);
  36. float GetWidgetZ();
  37. void SetIncludeLocation(bool val);
  38. bool GetIncludeLocation();
  39. void SetIncludeHeading(bool val);
  40. bool GetIncludeHeading();
  41. void SetWidgetIcon(int8 val);
  42. Widget* Copy();
  43. EQ2Packet* serialize(Player* player, int16 version);
  44. void HandleTimerUpdate();
  45. void OpenDoor();
  46. void CloseDoor();
  47. void HandleUse(Client* client, string command);
  48. float GetOpenHeading();
  49. void SetOpenHeading(float val);
  50. float GetClosedHeading();
  51. void SetClosedHeading(float val);
  52. float GetOpenY();
  53. void SetOpenY(float val);
  54. float GetCloseY();
  55. void SetCloseY(float val);
  56. float GetOpenX(){return open_x;}
  57. float GetOpenZ(){return open_z;}
  58. float GetCloseX(){return close_x;}
  59. float GetCloseZ(){return close_z;}
  60. void SetOpenX(float x){open_x = x;}
  61. void SetOpenZ(float z){open_z = z;}
  62. void SetCloseX(float x){close_x = x;}
  63. void SetCloseZ(float z){close_z = z;}
  64. int8 GetWidgetType();
  65. void SetWidgetType(int8 val);
  66. bool IsOpen();
  67. int32 GetActionSpawnID();
  68. void SetActionSpawnID(int32 id);
  69. int32 GetLinkedSpawnID();
  70. void SetLinkedSpawnID(int32 id);
  71. const char* GetOpenSound();
  72. void SetOpenSound(const char* name);
  73. const char* GetCloseSound();
  74. void SetCloseSound(const char* name);
  75. void SetOpenDuration(int16 val);
  76. int16 GetOpenDuration();
  77. void ProcessUse();
  78. void SetHouseID(int32 val) { m_houseID = val; }
  79. int32 GetHouseID() { return m_houseID; }
  80. void SetMultiFloorLift(bool val) { multi_floor_lift = val; }
  81. bool GetMultiFloorLift() { return multi_floor_lift; }
  82. private:
  83. int8 widget_type;
  84. bool include_location;
  85. bool include_heading;
  86. float widget_x;
  87. float widget_y;
  88. float widget_z;
  89. int32 widget_id;
  90. float open_heading;
  91. float closed_heading;
  92. float open_y;
  93. float close_y;
  94. Widget* action_spawn;
  95. int32 action_spawn_id;
  96. Widget* linked_spawn;
  97. int32 linked_spawn_id;
  98. bool is_open;
  99. string open_sound;
  100. string close_sound;
  101. int16 open_duration;
  102. int32 m_houseID;
  103. float open_x;
  104. float open_z;
  105. float close_x;
  106. float close_z;
  107. bool multi_floor_lift;
  108. };
  109. #endif