From 2f4ca9b5898f62fb2882b0c6bb0038c336cd5b18 Mon Sep 17 00:00:00 2001 From: NotAdam Date: Thu, 7 Mar 2019 21:58:12 +1100 Subject: [PATCH] add teleporting back in, remove action targeting for now --- src/common/Common.h | 8 +- src/scripts/action/common/ActionReturn6.cpp | 6 +- src/scripts/action/common/ActionSprint3.cpp | 4 +- src/scripts/action/common/ActionTeleport5.cpp | 46 ++++++ .../archer/ActionHeavyShot97.cpp | 4 +- src/world/Action/Action.cpp | 141 ++++++++++-------- src/world/Action/Action.h | 15 +- src/world/Actor/Player.cpp | 45 +++++- src/world/Actor/Player.h | 6 +- src/world/Manager/ActionMgr.cpp | 28 ++-- src/world/Script/NativeScriptApi.cpp | 6 +- src/world/Script/NativeScriptApi.h | 6 +- src/world/Script/ScriptMgr.cpp | 18 +-- src/world/Script/ScriptMgr.h | 6 +- 14 files changed, 227 insertions(+), 112 deletions(-) create mode 100644 src/scripts/action/common/ActionTeleport5.cpp diff --git a/src/common/Common.h b/src/common/Common.h index a5d60a91..f3f9a1ff 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -539,7 +539,7 @@ namespace Sapphire::Common enum class ActionPrimaryCostType : uint8_t { -// None = 0, // ? + None = 0, // ? MagicPoints = 3, TacticsPoints = 5, // WARGauge = 22, @@ -931,6 +931,12 @@ namespace Sapphire::Common IsFreeCompanyEstate = 16, }; + struct PlayerTeleportQuery + { + uint16_t targetAetheryte; + uint16_t cost; + }; + using PlayerStateFlagList = std::vector< PlayerStateFlag >; } diff --git a/src/scripts/action/common/ActionReturn6.cpp b/src/scripts/action/common/ActionReturn6.cpp index 19737104..9831c7e3 100644 --- a/src/scripts/action/common/ActionReturn6.cpp +++ b/src/scripts/action/common/ActionReturn6.cpp @@ -12,12 +12,12 @@ public: { } - void onFinish( Sapphire::Action::Action& currentAction ) override + void onExecute( Sapphire::Action::Action& action ) override { - if( !currentAction.getSourceChara()->isPlayer() ) + if( !action.getSourceChara()->isPlayer() ) return; - currentAction.getSourceChara()->getAsPlayer()->returnToHomepoint(); + action.getSourceChara()->getAsPlayer()->returnToHomepoint(); } }; diff --git a/src/scripts/action/common/ActionSprint3.cpp b/src/scripts/action/common/ActionSprint3.cpp index 1ccce78e..0067dcac 100644 --- a/src/scripts/action/common/ActionSprint3.cpp +++ b/src/scripts/action/common/ActionSprint3.cpp @@ -11,9 +11,9 @@ public: { } - void onFinish( Sapphire::Action::Action& currentAction ) override + void onExecute( Sapphire::Action::Action& action ) override { - auto sourceChara = currentAction.getSourceChara(); + auto sourceChara = action.getSourceChara(); if( !sourceChara->isPlayer() ) return; diff --git a/src/scripts/action/common/ActionTeleport5.cpp b/src/scripts/action/common/ActionTeleport5.cpp new file mode 100644 index 00000000..0d0df5c5 --- /dev/null +++ b/src/scripts/action/common/ActionTeleport5.cpp @@ -0,0 +1,46 @@ +#include