mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 05:57:45 +00:00
Forgot something
This commit is contained in:
parent
04814a3f15
commit
f429320ae0
6 changed files with 34 additions and 10 deletions
|
@ -10,6 +10,7 @@ class skillDef_121Def
|
|||
|
||||
def onFinish( player, target )
|
||||
{
|
||||
player.handleScriptSkill( STD_DAMAGE, 121, 5, 0, target );
|
||||
target.addStatusEffectByIdIfNotExist(143, 20000, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -345,13 +345,13 @@ bool Core::Data::ExdData::loadActionInfo()
|
|||
uint8_t points_type = getField< uint8_t >( fields, 30 );//28
|
||||
uint16_t points_cost = getField< uint16_t >( fields, 31 );//29
|
||||
|
||||
bool is_instant = getField< bool >( fields, 35 );
|
||||
uint32_t instantval = getField< bool >( fields, 35 );
|
||||
|
||||
uint8_t typeshift = 0x6;
|
||||
uint8_t mask = 1 << typeshift;
|
||||
is_instant &= mask;
|
||||
bool final = ( is_instant & mask ) == mask;
|
||||
is_instant = final;
|
||||
instantval &= mask;
|
||||
bool final = ( instantval & mask ) == mask;
|
||||
bool is_instant = final;
|
||||
|
||||
uint16_t cast_time = getField< uint16_t >( fields, 36 );
|
||||
uint16_t recast_time = getField< uint16_t >( fields, 37 );
|
||||
|
|
|
@ -70,13 +70,9 @@ void Core::Action::ActionCast::onFinish()
|
|||
auto pPlayer = m_pSource->getAsPlayer();
|
||||
pPlayer->sendDebug( "onFinish()" );
|
||||
|
||||
m_pTarget->onActionHostile( pPlayer->shared_from_this() );
|
||||
|
||||
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
|
||||
pPlayer->sendStateFlags();
|
||||
|
||||
|
||||
|
||||
g_scriptMgr.onCastFinish( pPlayer, m_pTarget, m_id );
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,27 @@ void Core::GameCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlayer
|
|||
else
|
||||
pPlayer->setClassJob( static_cast<Core::Common::ClassJob> ( id ) );
|
||||
}
|
||||
else if( subCommand == "no" )
|
||||
{
|
||||
int32_t id;
|
||||
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
|
||||
|
||||
|
||||
uint8_t typeshift = 0x6;
|
||||
uint8_t mask = 1 << typeshift;
|
||||
id &= mask;
|
||||
bool final = ( id & mask ) == mask;
|
||||
pPlayer->sendDebug( std::to_string(final) );
|
||||
}
|
||||
else if( subCommand == "aaah" )
|
||||
{
|
||||
int32_t id;
|
||||
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
pPlayer->sendDebug( std::to_string( pPlayer->actionHasCastTime( id ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ void Core::Network::GameConnection::skillHandler( Core::Network::Packets::GamePa
|
|||
targetActor = pPlayer->lookupTargetById( targetId );
|
||||
}
|
||||
|
||||
if( pPlayer->actionHasCastTime( action ) )
|
||||
if( !pPlayer->actionHasCastTime( action ) )
|
||||
{
|
||||
g_scriptMgr.onCastFinish( pPlayer, targetActor, action );
|
||||
}
|
||||
|
|
|
@ -988,7 +988,13 @@ const uint8_t * Core::Entity::Player::getStateFlags() const
|
|||
|
||||
bool Core::Entity::Player::actionHasCastTime( uint32_t actionId ) //TODO: Add logic for special cases
|
||||
{
|
||||
return g_exdData.m_actionInfoMap[actionId].is_instant;
|
||||
if( g_exdData.m_actionInfoMap[actionId].is_instant )
|
||||
return false;
|
||||
|
||||
if( g_exdData.m_actionInfoMap[actionId].cast_time == 0 )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Core::Entity::Player::hasStateFlag( Core::Common::PlayerStateFlag flag ) const
|
||||
|
@ -1528,6 +1534,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
|
|||
sendToInRangeSet( effectPacket, true );
|
||||
|
||||
pTarget.takeDamage( param1 );
|
||||
pTarget.onActionHostile( shared_from_this() );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue