mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 07:37:45 +00:00
correctly capture itemaction source slot/container from cast packet
This commit is contained in:
parent
fe5ff1a80f
commit
5f98d00d48
5 changed files with 18 additions and 7 deletions
|
@ -70,7 +70,9 @@ struct FFXIVIpcSkillHandler :
|
||||||
/* 0008 */ uint16_t sequence;
|
/* 0008 */ uint16_t sequence;
|
||||||
/* 000A */ char pad_000C[6];
|
/* 000A */ char pad_000C[6];
|
||||||
/* 0010 */ uint64_t targetId;
|
/* 0010 */ uint64_t targetId;
|
||||||
/* 0018 */ uint64_t unknown;
|
/* 0018 */ uint16_t itemSourceSlot;
|
||||||
|
/* 001A */ uint16_t itemSourceContainer;
|
||||||
|
/* 001C */ uint32_t unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FFXIVIpcAoESkillHandler :
|
struct FFXIVIpcAoESkillHandler :
|
||||||
|
|
|
@ -49,9 +49,13 @@ void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& play
|
||||||
bootstrapAction( player, action, *actionData );
|
bootstrapAction( player, action, *actionData );
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::Manager::ActionMgr::handleItemAction( Sapphire::Entity::Player& player, uint32_t itemId, Data::ItemActionPtr itemActionData )
|
void World::Manager::ActionMgr::handleItemAction( Sapphire::Entity::Player& player, uint32_t itemId,
|
||||||
|
Data::ItemActionPtr itemActionData,
|
||||||
|
uint16_t itemSourceSlot, uint16_t itemSourceContainer )
|
||||||
{
|
{
|
||||||
player.sendDebug( "got item act: {0}", itemId );
|
player.sendDebug( "got item act: {0}, slot: {1}, container: {2}", itemId, itemSourceSlot, itemSourceContainer );
|
||||||
|
|
||||||
|
// todo: check we have item & remove item from inventory
|
||||||
|
|
||||||
switch( itemActionData->type )
|
switch( itemActionData->type )
|
||||||
{
|
{
|
||||||
|
@ -133,8 +137,6 @@ bool World::Manager::ActionMgr::canPlayerUseAction( Entity::Player& player,
|
||||||
|
|
||||||
void World::Manager::ActionMgr::handleItemActionVFX( Sapphire::Entity::Player& player, uint32_t itemId, uint16_t vfxId )
|
void World::Manager::ActionMgr::handleItemActionVFX( Sapphire::Entity::Player& player, uint32_t itemId, uint16_t vfxId )
|
||||||
{
|
{
|
||||||
// todo: check we have item & remove item from inventory
|
|
||||||
|
|
||||||
Common::EffectEntry effect{};
|
Common::EffectEntry effect{};
|
||||||
effect.effectType = Common::ActionEffectType::VFX;
|
effect.effectType = Common::ActionEffectType::VFX;
|
||||||
effect.value = vfxId;
|
effect.value = vfxId;
|
||||||
|
|
|
@ -26,7 +26,8 @@ namespace Sapphire::World::Manager
|
||||||
void handleAoEPlayerAction( Entity::Player& player, uint32_t actionId,
|
void handleAoEPlayerAction( Entity::Player& player, uint32_t actionId,
|
||||||
Data::ActionPtr actionData, Common::FFXIVARR_POSITION3 pos );
|
Data::ActionPtr actionData, Common::FFXIVARR_POSITION3 pos );
|
||||||
|
|
||||||
void handleItemAction( Entity::Player& player, uint32_t itemId, Data::ItemActionPtr itemActionData );
|
void handleItemAction( Entity::Player& player, uint32_t itemId, Data::ItemActionPtr itemActionData,
|
||||||
|
uint16_t itemSourceSlot, uint16_t itemSourceContainer );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void bootstrapAction( Entity::Player& player, Action::ActionPtr currentAction, Data::Action& actionData );
|
void bootstrapAction( Entity::Player& player, Action::ActionPtr currentAction, Data::Action& actionData );
|
||||||
|
|
|
@ -24,6 +24,8 @@ void Sapphire::Network::GameConnection::actionHandler( FrameworkPtr pFw,
|
||||||
const auto actionId = packet.data().actionId;
|
const auto actionId = packet.data().actionId;
|
||||||
const auto sequence = packet.data().sequence;
|
const auto sequence = packet.data().sequence;
|
||||||
const auto targetId = packet.data().targetId;
|
const auto targetId = packet.data().targetId;
|
||||||
|
const auto itemSourceSlot = packet.data().itemSourceSlot;
|
||||||
|
const auto itemSourceContainer = packet.data().itemSourceContainer;
|
||||||
|
|
||||||
player.sendDebug( "Skill type: {0}, sequence: {1}, actionId: {2}, targetId: {3}", type, sequence, actionId, targetId );
|
player.sendDebug( "Skill type: {0}, sequence: {1}, actionId: {2}, targetId: {3}", type, sequence, actionId, targetId );
|
||||||
|
|
||||||
|
@ -63,7 +65,7 @@ void Sapphire::Network::GameConnection::actionHandler( FrameworkPtr pFw,
|
||||||
if( !itemAction )
|
if( !itemAction )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
actionMgr->handleItemAction( player, actionId, itemAction );
|
actionMgr->handleItemAction( player, actionId, itemAction, itemSourceSlot, itemSourceContainer );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,10 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
|
||||||
}
|
}
|
||||||
case ClientTriggerType::DyeItem: // Dye item
|
case ClientTriggerType::DyeItem: // Dye item
|
||||||
{
|
{
|
||||||
|
// param11 = item to dye container
|
||||||
|
// param12 = item to dye slot
|
||||||
|
// param2 = dye bag container
|
||||||
|
// param4 = dye bag slot
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ClientTriggerType::DirectorInitFinish: // Director init finish
|
case ClientTriggerType::DirectorInitFinish: // Director init finish
|
||||||
|
|
Loading…
Add table
Reference in a new issue