diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index e3ad0d8b..8999588f 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -35,6 +35,23 @@ Sapphire::Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, m_castTime = static_cast< uint32_t >( action->cast100ms * 100 ); m_recastTime = static_cast< uint16_t >( action->recast100ms * 100 ); m_cooldownGroup = action->cooldownGroup; + m_range = action->range; + m_effectRange = action->effectRange; + + // a default range is set by the game for the class/job + if( m_range == -1 ) + { + switch( static_cast< Common::ClassJob >( action->classJob ) ) + { + case Common::ClassJob::Bard: + case Common::ClassJob::Archer: + m_range = 25; + + // anything that isnt ranged + default: + m_range = 3; + } + } m_actionCost.fill( { Common::ActionCostType::None, 0 } ); @@ -67,6 +84,7 @@ void Sapphire::Action::Action::setTargetChara( Sapphire::Entity::CharaPtr chara m_pTarget = chara; m_targetId = chara->getId(); + m_hasResidentTarget = false; } void Sapphire::Action::Action::setResidentTargetId( uint64_t targetId ) diff --git a/src/world/Action/Action.h b/src/world/Action/Action.h index 5310388f..4a98eaf3 100644 --- a/src/world/Action/Action.h +++ b/src/world/Action/Action.h @@ -122,6 +122,8 @@ namespace Sapphire::Action uint32_t m_castTime; uint16_t m_recastTime; uint8_t m_cooldownGroup; + int8_t m_range; + uint8_t m_effectRange; Entity::CharaPtr m_pSource; Entity::CharaPtr m_pTarget;