Horizon Official Technical Documentation
SkillExecution.hpp
Go to the documentation of this file.
1
2#ifndef HORIZON_ZONE_GAME_SKILLEXECUTION_HPP
3#define HORIZON_ZONE_GAME_SKILLEXECUTION_HPP
4
10
11namespace Horizon
12{
13namespace Zone
14{
15class GameLogicProcess;
16class SkillExecution : public std::enable_shared_from_this<SkillExecution>
17{
18public:
19 SkillExecution(std::shared_ptr<Unit> initial_source, int16_t skill_id, int16_t skill_lv);
21
22 void execute(int initial_target_guid);
23 void execute(MapCoords map_coords);
24 void execute(int16_t x, int16_t y);
25 void execute(MapCoords map_coords, std::string message);
26 void execute(int16_t x, int16_t y, std::string message);
27
28 sol::table get_skill_cast_data() { return _scd; }
29private:
30 void start_execution(enum skill_target_type target_type);
31 std::shared_ptr<Map> map() { return _map.expired() ? nullptr : _map.lock(); }
32 void set_map(std::shared_ptr<Map> map);
33 std::shared_ptr<GameLogicProcess> map_container() { return _map_container_thread.lock(); }
34 std::shared_ptr<ScriptManager> lua_manager() { return _lua_mgr.lock(); }
35 std::shared_ptr<sol::state> lua_state() { return _lua_state.lock(); }
36
37 std::weak_ptr<Map> _map;
38 std::weak_ptr<GameLogicProcess> _map_container_thread;
39 std::weak_ptr<ScriptManager> _lua_mgr;
40 std::weak_ptr<sol::state> _lua_state;
41 std::shared_ptr<Unit> _initial_source{nullptr};
42 std::shared_ptr<Unit> _initial_target{nullptr};
43 int16_t _skill_id;
44 int16_t _skill_lv;
46 std::string _message;
47 sol::table _scd;
48};
49}
50}
51
52#endif /* HORIZON_ZONE_GAME_SKILLEXECUTION_HPP */
skill_target_type
Definition: SkillDefinitions.hpp:343
Definition: SkillExecution.hpp:17
int16_t _skill_lv
Definition: SkillExecution.hpp:44
std::shared_ptr< Unit > _initial_source
Definition: SkillExecution.hpp:41
std::weak_ptr< GameLogicProcess > _map_container_thread
Definition: SkillExecution.hpp:38
std::shared_ptr< Unit > _initial_target
Definition: SkillExecution.hpp:42
std::shared_ptr< Map > map()
Definition: SkillExecution.hpp:31
std::weak_ptr< ScriptManager > _lua_mgr
Definition: SkillExecution.hpp:39
std::string _message
Definition: SkillExecution.hpp:46
std::weak_ptr< sol::state > _lua_state
Definition: SkillExecution.hpp:40
std::shared_ptr< sol::state > lua_state()
Definition: SkillExecution.hpp:35
std::shared_ptr< ScriptManager > lua_manager()
Definition: SkillExecution.hpp:34
int16_t _skill_id
Definition: SkillExecution.hpp:43
void execute(int initial_target_guid)
Definition: SkillExecution.cpp:76
SkillExecution(std::shared_ptr< Unit > initial_source, int16_t skill_id, int16_t skill_lv)
Definition: SkillExecution.cpp:15
MapCoords _map_coords
Definition: SkillExecution.hpp:45
sol::table _scd
Definition: SkillExecution.hpp:47
sol::table get_skill_cast_data()
Definition: SkillExecution.hpp:28
~SkillExecution()
Definition: SkillExecution.cpp:21
void start_execution(enum skill_target_type target_type)
Definition: SkillExecution.cpp:25
void set_map(std::shared_ptr< Map > map)
Definition: SkillExecution.cpp:104
std::weak_ptr< Map > _map
Definition: SkillExecution.hpp:37
std::shared_ptr< GameLogicProcess > map_container()
Definition: SkillExecution.hpp:33
Definition: Element.hpp:7