diff --git a/src/tools/action_parse/actions/player.json b/src/tools/action_parse/actions/player.json index 149d05aa..e6c9cb3e 100644 --- a/src/tools/action_parse/actions/player.json +++ b/src/tools/action_parse/actions/player.json @@ -1,7 +1,7 @@ { "7": { "name": "Attack", - "potency": 0, + "potency": 110, "comboPotency": 0, "flankPotency": 0, "frontPotency": 0, @@ -16,7 +16,7 @@ }, "8": { "name": "Shot", - "potency": 0, + "potency": 100, "comboPotency": 0, "flankPotency": 0, "frontPotency": 0, diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index bf14dae8..3de95214 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -333,9 +333,11 @@ void Action::Action::start() // todo: m_recastTimeMs needs to be adjusted for player sks/sps auto actionStartPkt = makeActorControlSelf( m_pSource->getId(), ActorControlType::ActionStart, m_cooldownGroup, getId(), m_recastTimeMs / 10 ); - player->setRecastGroup( m_cooldownGroup, static_cast< float >( m_castTimeMs ) / 1000.f ); - - server().queueForPlayer( player->getCharacterId(), actionStartPkt ); + if( player ) + { + player->setRecastGroup( m_cooldownGroup, static_cast< float >( m_castTimeMs ) / 1000.f ); + server().queueForPlayer( player->getCharacterId(), actionStartPkt ); + } onStart(); @@ -369,7 +371,6 @@ void Action::Action::onStart() void Action::Action::interrupt() { assert( m_pSource ); - // things that aren't players don't care about cooldowns and state flags if( m_pSource->isPlayer() ) { @@ -409,7 +410,6 @@ void Action::Action::onInterrupt() void Action::Action::execute() { assert( m_pSource ); - // subtract costs first, if somehow the caster stops meeting those requirements cancel the cast if( !consumeResources() ) { @@ -464,6 +464,10 @@ std::pair< uint32_t, Common::ActionHitSeverityType > Action::Action::calcDamage( wepDmg = item->getMagicalDmg(); else wepDmg = item->getPhysicalDmg(); + + // is auto attack + if( getId() == 7 || getId() == 8 ) + return Math::CalcStats::calcAutoAttackDamage( *m_pSource->getAsPlayer() ); } return Math::CalcStats::calcActionDamage( *m_pSource, potency, wepDmg ); @@ -574,7 +578,6 @@ void Action::Action::buildActionResults() shouldRestoreMP = false; } } - m_actionResultBuilder->sendActionResults( m_hitActors ); // TODO: disabled, reset kills our queued actions diff --git a/src/world/Actor/BNpc.cpp b/src/world/Actor/BNpc.cpp index dbf779e6..f353a88b 100644 --- a/src/world/Actor/BNpc.cpp +++ b/src/world/Actor/BNpc.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include