1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 23:57:46 +00:00
sapphire/src/scripts/action/war/ActionUnchained.cpp

32 lines
842 B
C++
Raw Normal View History

2023-03-08 18:09:10 +01:00
#include <Script/NativeScriptApi.h>
#include <ScriptObject.h>
#include <Actor/Player.h>
#include <Action/CommonAction.h>
#include <Action/Action.h>
2023-03-09 00:14:48 +01:00
#include <StatusEffect/StatusEffect.h>
2023-03-08 18:09:10 +01:00
using namespace Sapphire;
using namespace Sapphire::World::Action;
class ActionUnchained : public Sapphire::ScriptAPI::ActionScript
{
public:
ActionUnchained() : Sapphire::ScriptAPI::ActionScript( 50 )
{
}
void onExecute( Sapphire::World::Action::Action& action ) override
{
auto pPlayer = action.getSourceChara()->getAsPlayer();
if( !pPlayer )
return;
2023-03-09 00:14:48 +01:00
if( auto status = pPlayer->getStatusEffectById( Defiance ); status )
status->setModifier( Common::ParamModifier::DamageDealtPercent, 0 );
2023-03-08 18:09:10 +01:00
action.getActionResultBuilder()->applyStatusEffectSelf( Unchained, 20000, 0 );
2023-03-08 18:09:10 +01:00
}
};
EXPOSE_SCRIPT( ActionUnchained );