mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-07 19:27:45 +00:00
Redefining: ActionModel and ActionAspect; Action for removing status effect off from HUD;
This commit is contained in:
parent
b7a3ec8bdc
commit
610e824ac0
13 changed files with 68 additions and 40 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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() )
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Add table
Reference in a new issue