1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-01 00:27:44 +00:00

Always send AOE effects as AOE packet, regardless of targetcount. Also allow setting position of aoe effect

This commit is contained in:
Mordred 2025-01-06 15:35:17 +01:00
parent 46cbd436f9
commit 1eb202faa8
4 changed files with 22 additions and 122 deletions

View file

@ -5373,66 +5373,8 @@
"target": [] "target": []
} }
}, },
"453": {
"name": "Incinerate",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"454": {
"name": "Vulcan Burst",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"455": {
"name": "Eruption",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"456": {
"name": "Radiant Plume",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"457": { "457": {
"name": "Crimson Cyclone", "name": "Crimson Cyclone",
"potency": 0, "potency": 0,
@ -5448,21 +5390,6 @@
"target": [] "target": []
} }
}, },
"458": {
"name": "Hellfire",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"462": { "462": {
"name": "イフリート:角復活", "name": "イフリート:角復活",
"potency": 0, "potency": 0,
@ -8928,36 +8855,6 @@
"target": [] "target": []
} }
}, },
"733": {
"name": "Eruption",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"734": {
"name": "Radiant Plume",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"735": { "735": {
"name": "Miasma Breath", "name": "Miasma Breath",
"potency": 0, "potency": 0,
@ -10518,21 +10415,6 @@
"target": [] "target": []
} }
}, },
"872": {
"name": "attack",
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
"rearPotency": 0,
"curePotency": 0,
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
}
},
"873": { "873": {
"name": "attack", "name": "attack",
"potency": 0, "potency": 0,

View file

@ -143,12 +143,21 @@ std::shared_ptr< FFXIVPacketBase > ActionResultBuilder::createActionResultPacket
auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
auto zone = teriMgr.getTerritoryByGuId( m_sourceChara->getTerritoryId() ); auto zone = teriMgr.getTerritoryByGuId( m_sourceChara->getTerritoryId() );
if( targetCount > 1 ) // use AoeEffect packets // need to get actionData
auto& exdData = Common::Service< Data::ExdData >::ref();
auto actionData = exdData.getRow< Excel::Action >( m_actionId );
if( !actionData )
throw std::runtime_error( "No actiondata found!" );
if( targetCount > 1 || actionData->data().EffectType != Common::CastType::SingleTarget ) // use AoeEffect packets
{ {
auto actionResult = makeEffectPacket( m_sourceChara->getId(), targetList[ 0 ]->getId(), m_actionId ); auto actionResult = makeEffectPacket( m_sourceChara->getId(), 0, m_actionId );
actionResult->setRotation( Common::Util::floatToUInt16Rot( m_sourceChara->getRot() ) ); actionResult->setRotation( Common::Util::floatToUInt16Rot( m_sourceChara->getRot() ) );
actionResult->setRequestId( m_requestId ); actionResult->setRequestId( m_requestId );
actionResult->setResultId( m_resultId ); actionResult->setResultId( m_resultId );
actionResult->setTargetPosition( m_sourceChara->getPos() );
uint8_t targetIndex = 0; uint8_t targetIndex = 0;
for( auto& [ actor, actorResultList ] : m_actorResultsMap ) for( auto& [ actor, actorResultList ] : m_actorResultsMap )

View file

@ -417,6 +417,7 @@ namespace Sapphire::Encounter
if( !pAction || pAction->isInterrupted() ) if( !pAction || pAction->isInterrupted() )
{ {
actionMgr.handleTargetedAction( *pBNpc, pActionData->m_actionId, targetId, pTeri->getNextActionResultId() ); actionMgr.handleTargetedAction( *pBNpc, pActionData->m_actionId, targetId, pTeri->getNextActionResultId() );
//actionMgr.handlePlacedAction( *pBNpc, pActionData->m_actionId, pBNpc->getPos(), pTeri->getNextActionResultId() );
} }
// todo: this really shouldnt exist, but need to figure out why actions interrupt // todo: this really shouldnt exist, but need to figure out why actions interrupt
else if( pAction->getId() == pActionData->m_actionId ) else if( pAction->getId() == pActionData->m_actionId )

View file

@ -2,6 +2,7 @@
#include <Network/GamePacket.h> #include <Network/GamePacket.h>
#include <Network/PacketDef/Zone/ServerZoneDef.h> #include <Network/PacketDef/Zone/ServerZoneDef.h>
#include <Util/UtilMath.h>
#include "Forwards.h" #include "Forwards.h"
#include <string> #include <string>
#include <cstring> #include <cstring>
@ -87,6 +88,13 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
{ {
m_data.ResultId = static_cast< uint32_t >( resultId ); m_data.ResultId = static_cast< uint32_t >( resultId );
} }
void setTargetPosition( Common::FFXIVARR_POSITION3& pos )
{
m_data.TargetPos[ 0 ] = Common::Util::floatToUInt16( pos.x );
m_data.TargetPos[ 1 ] = Common::Util::floatToUInt16( pos.y );
m_data.TargetPos[ 2 ] = Common::Util::floatToUInt16( pos.z );
}
private: private:
uint8_t m_targetEffectCount{ 0 }; uint8_t m_targetEffectCount{ 0 };
uint8_t m_sourceEffectCount{ 0 }; uint8_t m_sourceEffectCount{ 0 };