mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 19:17:45 +00:00
implement blackest night and dark arts
This commit is contained in:
parent
44f6aa49e4
commit
9084e17e07
4 changed files with 70 additions and 2 deletions
40
src/scripts/action/drk/ActionTheBlackestNight7393.cpp
Normal file
40
src/scripts/action/drk/ActionTheBlackestNight7393.cpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include <Action/Action.h>
|
||||||
|
#include <Math/CalcStats.h>
|
||||||
|
|
||||||
|
#include "StatusEffect/StatusEffect.h"
|
||||||
|
|
||||||
|
using namespace Sapphire;
|
||||||
|
using namespace Sapphire::StatusEffect;
|
||||||
|
|
||||||
|
const uint16_t STATUS_ID_THE_BLACKEST_NIGHT = 1178;
|
||||||
|
|
||||||
|
class ActionTheBlackestNight7393 :
|
||||||
|
public ScriptAPI::ActionScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ActionTheBlackestNight7393() :
|
||||||
|
ScriptAPI::ActionScript( 7393 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void onExecute( Sapphire::World::Action::Action& action ) override
|
||||||
|
{
|
||||||
|
auto pTarget = action.getHitChara();
|
||||||
|
World::Action::StatusEffectEntry effectEntry;
|
||||||
|
effectEntry.effectType = static_cast< uint32_t >( Common::StatusEffectType::Shield );
|
||||||
|
effectEntry.effectValue1 = static_cast< int32_t >( ( 1.0 * pTarget->getMaxHp() ) * 0.25 );
|
||||||
|
auto pNewEffect = Sapphire::StatusEffect::make_StatusEffect( STATUS_ID_THE_BLACKEST_NIGHT, action.getSourceChara(), pTarget, 7000, 3000 );
|
||||||
|
pNewEffect->replaceEffectEntry( effectEntry );
|
||||||
|
action.getEffectbuilder()->applyStatusEffect( pTarget, action.getSourceChara(), pNewEffect );
|
||||||
|
}
|
||||||
|
|
||||||
|
void onStart( Sapphire::World::Action::Action& action ) override
|
||||||
|
{
|
||||||
|
action.disableGenericHandler();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
EXPOSE_SCRIPT( ActionTheBlackestNight7393 );
|
|
@ -154,6 +154,22 @@ bool Action::Action::init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( auto player = m_pSource->getAsPlayer() )
|
||||||
|
{
|
||||||
|
switch( player->getClass() )
|
||||||
|
{
|
||||||
|
case Common::ClassJob::Darkknight:
|
||||||
|
{
|
||||||
|
if( m_primaryCostType == Common::ActionPrimaryCostType::MagicPoints && player->gaugeDrkGetDarkArts() )
|
||||||
|
{
|
||||||
|
setPrimaryCost( Common::ActionPrimaryCostType::None, 0 );
|
||||||
|
player->gaugeDrkSetDarkArts( false );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*if( !m_actionData->targetArea )
|
/*if( !m_actionData->targetArea )
|
||||||
{
|
{
|
||||||
// override pos to target position
|
// override pos to target position
|
||||||
|
|
|
@ -333,8 +333,8 @@ ActionLut::Lut ActionLut::m_actionLut =
|
||||||
{ 7390, { 0, 0, 0, 0, 1972, 10000, 65436, 0, 0, 0, 0, 0, 0 } },
|
{ 7390, { 0, 0, 0, 0, 1972, 10000, 65436, 0, 0, 0, 0, 0, 0 } },
|
||||||
|
|
||||||
//The Blackest Night, ブラックナイト
|
//The Blackest Night, ブラックナイト
|
||||||
//applies to self: Blackest Night, ブラックナイト, duration 0, param 0
|
//comment: status removed need script
|
||||||
{ 7393, { 0, 0, 0, 0, 1178, 0, 0, 0, 0, 0, 0, 0, 0 } },
|
{ 7393, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
|
||||||
|
|
||||||
//Stalwart Soul, ストルワートソウル
|
//Stalwart Soul, ストルワートソウル
|
||||||
//has damage: potency 300, combo potency 0, directional potency 0
|
//has damage: potency 300, combo potency 0, directional potency 0
|
||||||
|
|
|
@ -212,6 +212,18 @@ void Sapphire::StatusEffect::StatusEffect::removeStatus()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lol just hack it and hardcode this shit
|
||||||
|
if( m_markToRemove && m_id == 1178 )
|
||||||
|
{
|
||||||
|
if( auto drk = m_sourceActor->getAsPlayer() )
|
||||||
|
{
|
||||||
|
if( drk->getClass() == Common::ClassJob::Darkknight )
|
||||||
|
{
|
||||||
|
drk->gaugeDrkSetDarkArts( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Sapphire::StatusEffect::StatusEffect::getId() const
|
uint32_t Sapphire::StatusEffect::StatusEffect::getId() const
|
||||||
|
|
Loading…
Add table
Reference in a new issue