diff --git a/src/servers/Server_Common/Common.h b/src/servers/Server_Common/Common.h index 954f08cc..b55bc905 100644 --- a/src/servers/Server_Common/Common.h +++ b/src/servers/Server_Common/Common.h @@ -545,13 +545,37 @@ namespace Core { FcTalk = 0x001F, }; + enum struct ActionAspect : uint8_t + { + None = 0, // Doesn't imply unaspected + Fire = 1, + Ice = 2, + Wind = 3, + Stone = 4, + Lightning = 5, + Water = 6, + Unaspected = 7 // Doesn't imply magical unaspected damage - could be unaspected physical + }; + + enum struct ActionModel : int8_t + { + Physical = -1, + Unknown_0 = 0, // Very likely actions that only deals with status effects and nothing else + Unknown_1 = 1, // Related to actions that deal with player movement (knockbacks, gapclosers etc) + Unknown_2 = 2, // Possibly attacks that bypass calculation (deal raw damage) + Unknown_3 = 3, // Possibly AoEs without marker + Unknown_4 = 4, + Magical = 5, + Unknown_6 = 6, // Possibly breath, eye & song attacks + Unknown_7 = 7, + LimitBreak = 8, + }; + enum ActionType : uint8_t { - Event, Spell, Teleport - }; enum HandleSkillType : uint8_t diff --git a/src/servers/Server_Common/Exd/ExdData.cpp b/src/servers/Server_Common/Exd/ExdData.cpp index a5097aba..5f9f22c5 100644 --- a/src/servers/Server_Common/Exd/ExdData.cpp +++ b/src/servers/Server_Common/Exd/ExdData.cpp @@ -346,11 +346,11 @@ bool Core::Data::ExdData::loadActionInfo() uint16_t points_cost = getField< uint16_t >( fields, 31 ); // 31 uint32_t instantval = getField< bool >( fields, 35 ); // 35 - uint16_t cast_time = getField< uint16_t >(fields, 36); // 36 - uint16_t recast_time = getField< uint16_t >(fields, 37); // 37 + uint16_t cast_time = getField< uint16_t >( fields, 36 ); // 36 + uint16_t recast_time = getField< uint16_t >( fields, 37 ); // 37 - uint16_t type = getField< uint16_t >(fields, 39); // 39: Action type - uint16_t aspect = getField< uint16_t >(fields, 40); // 40: Action aspect + int8_t model = getField< int8_t >( fields, 39 ); // 39: Action model + uint8_t aspect = getField< uint8_t >( fields, 40 ); // 40: Action aspect uint8_t typeshift = 0x6; uint8_t mask = 1 << typeshift; @@ -386,6 +386,9 @@ bool Core::Data::ExdData::loadActionInfo() info.cast_time = cast_time * 100; info.recast_time = recast_time * 100; + info.model = model; + info.aspect = aspect; + m_actionInfoMap[id] = info; } diff --git a/src/servers/Server_Common/Exd/ExdData.h b/src/servers/Server_Common/Exd/ExdData.h index b69e378a..f0c5793f 100644 --- a/src/servers/Server_Common/Exd/ExdData.h +++ b/src/servers/Server_Common/Exd/ExdData.h @@ -247,7 +247,7 @@ namespace Core { uint32_t cast_time; // 36 uint32_t recast_time; // 37 - uint8_t type; // 39 + int8_t model; // 39 uint8_t aspect; // 40 }; diff --git a/src/servers/Server_Common/Network/PacketDef/Zone/ServerZoneDef.h b/src/servers/Server_Common/Network/PacketDef/Zone/ServerZoneDef.h index 67e7b4bf..cfd585cf 100644 --- a/src/servers/Server_Common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/servers/Server_Common/Network/PacketDef/Zone/ServerZoneDef.h @@ -299,7 +299,7 @@ struct effectEntry uint8_t unknown_2; uint8_t unknown_3; int8_t bonusPercent; - int16_t param1; + int16_t dmgValue; uint8_t unknown_5; uint8_t unknown_6; }; diff --git a/src/servers/Server_Zone/Action/Action.h b/src/servers/Server_Zone/Action/Action.h index c68becb6..496fe309 100644 --- a/src/servers/Server_Zone/Action/Action.h +++ b/src/servers/Server_Zone/Action/Action.h @@ -6,32 +6,6 @@ namespace Core { namespace Action { - enum struct ActionAspect : uint32_t - { - None = 0, // Doesn't imply unaspected - Fire = 1, - Ice = 2, - Wind = 3, - Stone = 4, - Lightning = 5, - Water = 6, - Unaspected = 7 // Doesn't imply magical unaspected damage - could be unaspected physical - }; - - enum struct ActionType : int16_t - { - Physical = -1, - Unknown_0 = 0, // Very likely actions that only deals with status effects and nothing else - Unknown_1 = 1, // Related to actions that deal with player movement (knockbacks, gapclosers etc) - Unknown_2 = 2, // Possibly attacks that bypass calculation (deal raw damage) - Unknown_3 = 3, // Possibly AoEs without marker - Unknown_4 = 4, - Magical = 5, - Unknown_6 = 6, // Possibly breath, eye & song attacks - Unknown_7 = 7, - LimitBreak = 8, - }; - class Action { diff --git a/src/servers/Server_Zone/Actor/Actor.cpp b/src/servers/Server_Zone/Actor/Actor.cpp index 6a3d45e3..d0b76564 100644 --- a/src/servers/Server_Zone/Actor/Actor.cpp +++ b/src/servers/Server_Zone/Actor/Actor.cpp @@ -645,3 +645,8 @@ void Core::Entity::Actor::addStatusEffectByIdIfNotExist( int32_t id, int32_t dur } } +/*! \param Status that should be removed, based on its ID. */ +void Core::Entity::Actor::removeSingleStatusEffectFromId( int32_t id ) +{ + m_pStatusEffectContainer->removeSingleStatusEffectFromId( id ); +} \ No newline at end of file diff --git a/src/servers/Server_Zone/Actor/Actor.h b/src/servers/Server_Zone/Actor/Actor.h index 49ec397c..aab602be 100644 --- a/src/servers/Server_Zone/Actor/Actor.h +++ b/src/servers/Server_Zone/Actor/Actor.h @@ -298,6 +298,9 @@ public: // add a status effect by id if it doesn't exist void addStatusEffectByIdIfNotExist( int32_t id, int32_t duration, uint16_t param = 0 ); + // remove a status effect by id + void removeSingleStatusEffectFromId( int32_t id ); + // TODO: Why did i even declare them publicly here?! std::set< ActorPtr > m_inRangeActors; std::set< PlayerPtr > m_inRangePlayers; diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index 07db8ed7..406ceefb 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -1460,9 +1460,9 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget ) uint32_t damage = mainWeap->getAutoAttackDmg(); uint32_t variation = 0 + rand() % 3; - if (getClass() == JOB_MACHINIST || + if ( getClass() == JOB_MACHINIST || getClass() == JOB_BARD || - getClass() == CLASS_ARCHER) + getClass() == CLASS_ARCHER ) { GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId()); effectPacket.data().targetId = pTarget->getId(); diff --git a/src/servers/Server_Zone/Actor/PlayerInventory.cpp b/src/servers/Server_Zone/Actor/PlayerInventory.cpp index 6eeaad18..b5380d82 100644 --- a/src/servers/Server_Zone/Actor/PlayerInventory.cpp +++ b/src/servers/Server_Zone/Actor/PlayerInventory.cpp @@ -16,7 +16,7 @@ using namespace Core::Common; using namespace Core::Network::Packets; using namespace Core::Network::Packets::Server; -Core::InventoryPtr Core::Entity::Player::getInvetory() const +Core::InventoryPtr Core::Entity::Player::getInventory() const { return m_pInventory; } diff --git a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp index 91be50ea..d8fbfc62 100644 --- a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp @@ -106,6 +106,12 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in pPlayer->changeTarget( targetId ); break; } + case 0x68: // Remove status (clicking it off) + { + // todo: check if status can be removed by client from exd + pPlayer->removeSingleStatusEffectFromId( param1 ); + break; + } case 0x69: // Cancel cast { if( pPlayer->checkAction() ) diff --git a/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp b/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp index ada8d528..45b08c9e 100644 --- a/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/InventoryHandler.cpp @@ -63,19 +63,19 @@ void Core::Network::GameConnection::inventoryModifyHandler( const Packets::GameP case 0x07: // discard item action { - pPlayer->getInvetory()->discardItem( fromContainer, fromSlot ); + pPlayer->getInventory()->discardItem( fromContainer, fromSlot ); } break; case 0x08: // move item action { - pPlayer->getInvetory()->moveItem( fromContainer, fromSlot, toContainer, toSlot ); + pPlayer->getInventory()->moveItem( fromContainer, fromSlot, toContainer, toSlot ); } break; case 0x09: // swap item action { - pPlayer->getInvetory()->swapItem( fromContainer, fromSlot, toContainer, toSlot ); + pPlayer->getInventory()->swapItem( fromContainer, fromSlot, toContainer, toSlot ); } break; diff --git a/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp b/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp index 3feea268..77d43b5f 100644 --- a/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp +++ b/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp @@ -76,6 +76,18 @@ void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr } +void Core::StatusEffect::StatusEffectContainer::removeSingleStatusEffectFromId( uint32_t id ) +{ + for (auto effectIt : m_effectMap) + { + if (effectIt.second->getId() == id) + { + removeStatusEffect( effectIt.first ); + break; + } + } +} + void Core::StatusEffect::StatusEffectContainer::removeStatusEffect( uint8_t effectSlotId ) { auto pEffectIt = m_effectMap.find( effectSlotId ); diff --git a/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.h b/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.h index 6d479090..a6f2a01c 100644 --- a/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.h +++ b/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.h @@ -21,6 +21,7 @@ public: void addStatusEffect( StatusEffectPtr pEffect ); void removeStatusEffect( uint8_t effectSlotId ); + void removeSingleStatusEffectFromId( uint32_t id ); void update(); bool hasStatusEffect( uint32_t id );