mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 23:57:46 +00:00
32 lines
No EOL
842 B
C++
32 lines
No EOL
842 B
C++
#include <Script/NativeScriptApi.h>
|
|
#include <ScriptObject.h>
|
|
#include <Actor/Player.h>
|
|
#include <Action/CommonAction.h>
|
|
#include <Action/Action.h>
|
|
#include <StatusEffect/StatusEffect.h>
|
|
|
|
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;
|
|
|
|
if( auto status = pPlayer->getStatusEffectById( Defiance ); status )
|
|
status->setModifier( Common::ParamModifier::DamageDealtPercent, 0 );
|
|
|
|
action.getActionResultBuilder()->applyStatusEffectSelf( Unchained, 20000, 0 );
|
|
}
|
|
};
|
|
|
|
EXPOSE_SCRIPT( ActionUnchained ); |