mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 08:07:46 +00:00
First step of inventory cleanup, moving defs to common
This commit is contained in:
parent
64f603e48e
commit
dbf0ce5284
14 changed files with 143 additions and 202 deletions
|
@ -114,6 +114,57 @@ namespace Common {
|
|||
FreeCompanyCrystal = 22001
|
||||
};
|
||||
|
||||
enum ContainerType : uint16_t
|
||||
{
|
||||
Unknown = 0,
|
||||
Bag = 1,
|
||||
GearSet = 2,
|
||||
CurrencyCrystal = 3,
|
||||
Armory = 4
|
||||
};
|
||||
|
||||
|
||||
enum CurrencyType : uint8_t
|
||||
{
|
||||
Gil = 0x01,
|
||||
StormSeal = 0x02,
|
||||
SerpentSeal = 0x03,
|
||||
FlameSeal = 0x04,
|
||||
TomestonePhilo = 0x05,
|
||||
TomestoneMytho = 0x06,
|
||||
WolfMark = 0x07,
|
||||
TomestoneSold = 0x08,
|
||||
AlliedSeal = 0x09,
|
||||
TomestonePoet = 0x0A,
|
||||
Mgp = 0x0B,
|
||||
TomestoneLaw = 0x0C,
|
||||
TomestoneEso = 0x0D,
|
||||
TomestoneLore = 0x0E
|
||||
};
|
||||
|
||||
enum CrystalType : uint8_t
|
||||
{
|
||||
FireShard = 0x01,
|
||||
IceShard = 0x02,
|
||||
WindShard = 0x03,
|
||||
EarthShard = 0x04,
|
||||
LightningShard = 0x05,
|
||||
WaterShard = 0x06,
|
||||
|
||||
FireCrystal = 0x07,
|
||||
IceCrystal = 0x08,
|
||||
WindCrystal = 0x09,
|
||||
EarthCrystal = 0x0A,
|
||||
LightningCrystal = 0x0B,
|
||||
WaterCrystal = 0x0C,
|
||||
|
||||
FireCluster = 0x0D,
|
||||
IceCluster = 0x0E,
|
||||
WindCluster = 0x0F,
|
||||
EarthCluster = 0x10,
|
||||
LightningCluster = 0x11,
|
||||
WaterCluster = 0x12
|
||||
};
|
||||
|
||||
enum struct ZoneingType : uint8_t
|
||||
{
|
||||
|
|
|
@ -303,11 +303,11 @@ struct effectEntry
|
|||
{
|
||||
Common::ActionEffectType effectType;
|
||||
Common::ActionHitSeverityType hitSeverity;
|
||||
uint8_t unknown_3;
|
||||
uint8_t param;
|
||||
int8_t bonusPercent;
|
||||
int16_t value;
|
||||
uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers
|
||||
uint8_t unknown_6;
|
||||
uint8_t flags;
|
||||
int16_t value;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
||||
|
@ -318,17 +318,26 @@ struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
|||
uint32_t unknown_2;
|
||||
uint32_t unknown_5;
|
||||
uint32_t unknown_6;
|
||||
uint32_t effectTargetId;
|
||||
uint16_t unknown_7;
|
||||
uint16_t rotation;
|
||||
uint16_t actionTextId;
|
||||
uint8_t unknown_61;
|
||||
uint8_t unknown_62;
|
||||
uint8_t unknown_10;
|
||||
uint16_t unknown_8;
|
||||
|
||||
uint8_t unknown_9;
|
||||
uint8_t numEffects;
|
||||
uint32_t u11;
|
||||
|
||||
uint16_t unknown_10;
|
||||
uint32_t unknown_11;
|
||||
uint16_t unknown_12;
|
||||
|
||||
effectEntry effects[8];
|
||||
uint32_t effectTarget;
|
||||
uint64_t unknown_8;
|
||||
|
||||
uint32_t unknown_13;
|
||||
uint16_t unknown_14;
|
||||
|
||||
uint32_t effectTargetId;
|
||||
|
||||
uint64_t unknown_15;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -78,11 +78,11 @@ void Core::Action::ActionMount::onFinish()
|
|||
effectPacket->data().targetId = pPlayer->getId();
|
||||
effectPacket->data().actionAnimationId = m_id;
|
||||
// Affects displaying action name next to number in floating text
|
||||
effectPacket->data().unknown_62 = 13;
|
||||
//effectPacket->data().unknown_62 = 13;
|
||||
effectPacket->data().actionTextId = 4;
|
||||
effectPacket->data().numEffects = 1;
|
||||
effectPacket->data().rotation = Math::Util::floatToUInt16Rot( pPlayer->getRot() );
|
||||
effectPacket->data().effectTarget = INVALID_GAME_OBJECT_ID;
|
||||
//effectPacket->data().effectTarget = INVALID_GAME_OBJECT_ID;
|
||||
effectPacket->data().effects[0].effectType = ActionEffectType::Mount;
|
||||
effectPacket->data().effects[0].hitSeverity = ActionHitSeverityType::CritDamage;
|
||||
effectPacket->data().effects[0].value = m_id;
|
||||
|
|
|
@ -68,13 +68,13 @@ void Core::Action::ActionTeleport::onFinish()
|
|||
auto pPlayer = m_pSource->getAsPlayer();
|
||||
|
||||
// check we can finish teleporting
|
||||
if( pPlayer->getCurrency( Inventory::CurrencyType::Gil ) < m_cost )
|
||||
if( pPlayer->getCurrency( Common::CurrencyType::Gil ) < m_cost )
|
||||
{
|
||||
onInterrupt();
|
||||
return;
|
||||
}
|
||||
|
||||
pPlayer->removeCurrency( Inventory::CurrencyType::Gil, m_cost );
|
||||
pPlayer->removeCurrency( Common::CurrencyType::Gil, m_cost );
|
||||
|
||||
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
|
||||
|
||||
|
@ -92,7 +92,7 @@ void Core::Action::ActionTeleport::onFinish()
|
|||
effectPacket->data().unknown_5 = 1;
|
||||
effectPacket->data().numEffects = 1;
|
||||
effectPacket->data().rotation = static_cast< uint16_t >( 0x8000 * ( ( pPlayer->getRot() + 3.1415926 ) ) / 3.1415926 );
|
||||
effectPacket->data().effectTarget = pPlayer->getId();
|
||||
effectPacket->data().effectTargetId = pPlayer->getId();
|
||||
pPlayer->sendToInRangeSet( effectPacket, true );
|
||||
|
||||
pPlayer->teleport( m_targetAetheryte );
|
||||
|
|
|
@ -77,7 +77,7 @@ void Core::Action::EventItemAction::onFinish()
|
|||
effectPacket->data().unknown_5 = 2;
|
||||
effectPacket->data().numEffects = 1;
|
||||
effectPacket->data().rotation = Math::Util::floatToUInt16Rot( m_pSource->getRot() );
|
||||
effectPacket->data().effectTarget = static_cast< uint32_t >( m_additional );
|
||||
effectPacket->data().effectTargetId = static_cast< uint32_t >( m_additional );
|
||||
|
||||
m_pSource->getAsPlayer()->unsetStateFlag( Common::PlayerStateFlag::Casting );
|
||||
m_pSource->sendToInRangeSet( effectPacket, true );
|
||||
|
|
|
@ -407,11 +407,11 @@ void Core::Entity::Chara::autoAttack( CharaPtr pTarget )
|
|||
ipcEffect->data().actionTextId = 0x366;
|
||||
ipcEffect->data().numEffects = 1;
|
||||
ipcEffect->data().rotation = Math::Util::floatToUInt16Rot( getRot() );
|
||||
ipcEffect->data().effectTarget = pTarget->getId();
|
||||
ipcEffect->data().effectTargetId = pTarget->getId();
|
||||
ipcEffect->data().effects[0].value = damage;
|
||||
ipcEffect->data().effects[0].effectType = ActionEffectType::Damage;
|
||||
ipcEffect->data().effects[0].hitSeverity = static_cast< ActionHitSeverityType >( variation );
|
||||
ipcEffect->data().effects[0].unknown_3 = 7;
|
||||
//ipcEffect->data().effects[0].unknown_3 = 7;
|
||||
|
||||
sendToInRangeSet( ipcEffect );
|
||||
|
||||
|
@ -447,12 +447,12 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
|||
auto effectPacket = makeZonePacket< FFXIVIpcEffect >( getId() );
|
||||
effectPacket->data().targetId = target.getId();
|
||||
effectPacket->data().actionAnimationId = actionId;
|
||||
effectPacket->data().unknown_62 = 1; // Affects displaying action name next to number in floating text
|
||||
//effectPacket->data().unknown_62 = 1; // Affects displaying action name next to number in floating text
|
||||
effectPacket->data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation
|
||||
effectPacket->data().actionTextId = actionId;
|
||||
effectPacket->data().numEffects = 1;
|
||||
effectPacket->data().rotation = Math::Util::floatToUInt16Rot( getRot() );
|
||||
effectPacket->data().effectTarget = target.getId();
|
||||
effectPacket->data().effectTargetId = target.getId();
|
||||
|
||||
// Todo: for each actor, calculate how much damage the calculated value should deal to them - 2-step damage calc. we only have 1-step
|
||||
switch( type )
|
||||
|
@ -463,7 +463,7 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
|||
effectPacket->data().effects[0].value = static_cast< uint16_t >( param1 );
|
||||
effectPacket->data().effects[0].effectType = ActionEffectType::Damage;
|
||||
effectPacket->data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
||||
effectPacket->data().effects[0].unknown_3 = 7;
|
||||
//effectPacket->data().effects[0].unknown_3 = 7;
|
||||
|
||||
if( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 || actionInfoPtr->castType != 1 )
|
||||
{
|
||||
|
@ -488,7 +488,7 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
|||
for( const auto& pHitActor : actorsCollided )
|
||||
{
|
||||
effectPacket->data().targetId = pHitActor->getId();
|
||||
effectPacket->data().effectTarget = pHitActor->getId();
|
||||
effectPacket->data().effectTargetId = pHitActor->getId();
|
||||
|
||||
// todo: send to range of what? ourselves? when mob script hits this is going to be lacking
|
||||
sendToInRangeSet( effectPacket, true );
|
||||
|
@ -541,7 +541,7 @@ void Core::Entity::Chara::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
|||
for( auto pHitActor : actorsCollided )
|
||||
{
|
||||
effectPacket->data().targetId = target.getId();
|
||||
effectPacket->data().effectTarget = pHitActor->getId();
|
||||
effectPacket->data().effectTargetId = pHitActor->getId();
|
||||
|
||||
sendToInRangeSet( effectPacket, true );
|
||||
pHitActor->getAsChara()->heal( calculatedHeal );
|
||||
|
|
|
@ -769,12 +769,12 @@ void Core::Entity::Player::sendModel()
|
|||
sendToInRangeSet( boost::make_shared< ModelEquipPacket >( *getAsPlayer() ), true );
|
||||
}
|
||||
|
||||
uint32_t Core::Entity::Player::getModelForSlot( Inventory::EquipSlot slot )
|
||||
uint32_t Core::Entity::Player::getModelForSlot( Common::EquipSlot slot )
|
||||
{
|
||||
return m_modelEquip[slot];
|
||||
}
|
||||
|
||||
void Core::Entity::Player::setModelForSlot( Inventory::EquipSlot slot, uint32_t val )
|
||||
void Core::Entity::Player::setModelForSlot( Common::EquipSlot slot, uint32_t val )
|
||||
{
|
||||
m_modelEquip[slot] = val;
|
||||
}
|
||||
|
@ -1023,7 +1023,7 @@ void Core::Entity::Player::update( int64_t currTime )
|
|||
{
|
||||
if( m_targetId && m_currentStance == Entity::Chara::Stance::Active && isAutoattackOn() )
|
||||
{
|
||||
auto mainWeap = m_pInventory->getItemAt( Inventory::GearSet0, Inventory::EquipSlot::MainHand );
|
||||
auto mainWeap = m_pInventory->getItemAt( Common::GearSet0, Common::EquipSlot::MainHand );
|
||||
|
||||
// @TODO i dislike this, iterating over all in range actors when you already know the id of the actor you need...
|
||||
for( auto actor : m_inRangeActor )
|
||||
|
@ -1406,8 +1406,8 @@ uint32_t Core::Entity::Player::getPersistentEmote() const
|
|||
void Core::Entity::Player::autoAttack( CharaPtr pTarget )
|
||||
{
|
||||
|
||||
auto mainWeap = m_pInventory->getItemAt( Inventory::GearSet0,
|
||||
Inventory::EquipSlot::MainHand );
|
||||
auto mainWeap = m_pInventory->getItemAt( Common::GearSet0,
|
||||
Common::EquipSlot::MainHand );
|
||||
|
||||
pTarget->onActionHostile( *this );
|
||||
//uint64_t tick = Util::getTimeMs();
|
||||
|
@ -1423,16 +1423,16 @@ void Core::Entity::Player::autoAttack( CharaPtr pTarget )
|
|||
effectPacket->data().actionAnimationId = 8;
|
||||
// effectPacket.data().unknown_2 = variation;
|
||||
effectPacket->data().numEffects = 1;
|
||||
effectPacket->data().unknown_61 = 1;
|
||||
effectPacket->data().unknown_62 = 1;
|
||||
//effectPacket->data().unknown_61 = 1;
|
||||
//effectPacket->data().unknown_62 = 1;
|
||||
effectPacket->data().actionTextId = 8;
|
||||
effectPacket->data().rotation = Math::Util::floatToUInt16Rot( getRot() );
|
||||
effectPacket->data().effectTargetId = pTarget->getId();
|
||||
effectPacket->data().effectTarget = pTarget->getId();
|
||||
//effectPacket->data().effectTarget = pTarget->getId();
|
||||
effectPacket->data().effects[0].value = damage;
|
||||
effectPacket->data().effects[0].effectType = Common::ActionEffectType::Damage;
|
||||
effectPacket->data().effects[0].hitSeverity = Common::ActionHitSeverityType::NormalDamage;
|
||||
effectPacket->data().effects[0].unknown_3 = 7;
|
||||
//effectPacket->data().effects[0].unknown_3 = 7;
|
||||
|
||||
sendToInRangeSet(effectPacket, true);
|
||||
}
|
||||
|
@ -1444,15 +1444,15 @@ void Core::Entity::Player::autoAttack( CharaPtr pTarget )
|
|||
effectPacket->data().actionAnimationId = 7;
|
||||
// effectPacket.data().unknown_2 = variation;
|
||||
effectPacket->data().numEffects = 1;
|
||||
effectPacket->data().unknown_61 = 1;
|
||||
effectPacket->data().unknown_62 = 1;
|
||||
//effectPacket->data().unknown_61 = 1;
|
||||
//effectPacket->data().unknown_62 = 1;
|
||||
effectPacket->data().actionTextId = 7;
|
||||
effectPacket->data().rotation = Math::Util::floatToUInt16Rot( getRot() );
|
||||
effectPacket->data().effectTarget = pTarget->getId();
|
||||
effectPacket->data().effectTargetId = pTarget->getId();
|
||||
effectPacket->data().effects[0].value = damage;
|
||||
effectPacket->data().effects[0].effectType = Common::ActionEffectType::Damage;
|
||||
effectPacket->data().effects[0].hitSeverity = Common::ActionHitSeverityType::NormalDamage;
|
||||
effectPacket->data().effects[0].unknown_3 = 71;
|
||||
//effectPacket->data().effects[0].unknown_3 = 71;
|
||||
|
||||
sendToInRangeSet(effectPacket, true);
|
||||
}
|
||||
|
@ -1701,7 +1701,7 @@ void Core::Entity::Player::teleportQuery( uint16_t aetheryteId )
|
|||
// cap at 999 gil
|
||||
cost = cost > uint16_t{999} ? uint16_t{999} : cost;
|
||||
|
||||
bool insufficientGil = getCurrency( Inventory::CurrencyType::Gil ) < cost;
|
||||
bool insufficientGil = getCurrency( Common::CurrencyType::Gil ) < cost;
|
||||
// TODO: figure out what param1 really does
|
||||
queuePacket( boost::make_shared< ActorControlPacket143 >( getId(), TeleportStart, insufficientGil ? 2 : 0, aetheryteId ) );
|
||||
|
||||
|
|
|
@ -223,9 +223,9 @@ public:
|
|||
/*! add an item to a given container */
|
||||
bool addItem( uint16_t containerId, uint16_t catalogId, uint32_t quantity );
|
||||
/*! equip an item to a specified slot */
|
||||
void equipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem, bool sendModel );
|
||||
void equipItem( Common::EquipSlot equipSlotId, ItemPtr pItem, bool sendModel );
|
||||
/*! remove an item from an equipment slot */
|
||||
void unequipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem );
|
||||
void unequipItem( Common::EquipSlot equipSlotId, ItemPtr pItem );
|
||||
/*! equip a weapon, possibly forcing a job change */
|
||||
void equipWeapon( ItemPtr pItem );
|
||||
/*! get player ilvl */
|
||||
|
@ -243,9 +243,9 @@ public:
|
|||
/*! return a const pointer to the model array */
|
||||
const uint32_t* getModelArray() const;
|
||||
/*! return the equipment model in a specified equipment slot */
|
||||
uint32_t getModelForSlot( Inventory::EquipSlot slot );
|
||||
uint32_t getModelForSlot( Common::EquipSlot slot );
|
||||
/*! set the equipment model in a specified equipment slot */
|
||||
void setModelForSlot( Inventory::EquipSlot slot, uint32_t val );
|
||||
void setModelForSlot( Common::EquipSlot slot, uint32_t val );
|
||||
/*! return the current amount of currency of type */
|
||||
uint32_t getCurrency( uint8_t type ) const;
|
||||
/*! add amount to the currency of type */
|
||||
|
|
|
@ -86,7 +86,7 @@ void Core::Entity::Player::equipWeapon( ItemPtr pItem )
|
|||
}
|
||||
|
||||
// equip an item
|
||||
void Core::Entity::Player::equipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem, bool sendUpdate )
|
||||
void Core::Entity::Player::equipItem( Common::EquipSlot equipSlotId, ItemPtr pItem, bool sendUpdate )
|
||||
{
|
||||
|
||||
//g_framework.getLogger().debug( "Equipping into slot " + std::to_string( equipSlotId ) );
|
||||
|
@ -96,18 +96,18 @@ void Core::Entity::Player::equipItem( Inventory::EquipSlot equipSlotId, ItemPtr
|
|||
|
||||
switch( equipSlotId )
|
||||
{
|
||||
case Inventory::EquipSlot::MainHand:
|
||||
case Common::EquipSlot::MainHand:
|
||||
m_modelMainWeapon = model;
|
||||
m_modelSubWeapon = model2;
|
||||
// TODO: add job change upon changing weapon if needed
|
||||
// equipWeapon( pItem );
|
||||
break;
|
||||
|
||||
case Inventory::EquipSlot::OffHand:
|
||||
case Common::EquipSlot::OffHand:
|
||||
m_modelSubWeapon = model;
|
||||
break;
|
||||
|
||||
case Inventory::EquipSlot::SoulCrystal:
|
||||
case Common::EquipSlot::SoulCrystal:
|
||||
// TODO: add Job change on equipping crystal
|
||||
// change job
|
||||
break;
|
||||
|
@ -126,7 +126,7 @@ void Core::Entity::Player::equipItem( Inventory::EquipSlot equipSlotId, ItemPtr
|
|||
}
|
||||
}
|
||||
|
||||
void Core::Entity::Player::unequipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem )
|
||||
void Core::Entity::Player::unequipItem( Common::EquipSlot equipSlotId, ItemPtr pItem )
|
||||
{
|
||||
m_modelEquip[static_cast< uint8_t >( equipSlotId )] = 0;
|
||||
sendModel();
|
||||
|
@ -137,19 +137,19 @@ void Core::Entity::Player::unequipItem( Inventory::EquipSlot equipSlotId, ItemPt
|
|||
|
||||
uint32_t Core::Entity::Player::getCurrency( uint8_t type ) const
|
||||
{
|
||||
return m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
||||
return m_pInventory->getCurrency( static_cast< Common::CurrencyType >( type ) );
|
||||
}
|
||||
|
||||
// TODO: these next functions are so similar that they could likely be simplified
|
||||
void Core::Entity::Player::addCurrency( uint8_t type, uint32_t amount )
|
||||
{
|
||||
if( !m_pInventory->addCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
|
||||
if( !m_pInventory->addCurrency( static_cast< Common::CurrencyType >( type ), amount ) )
|
||||
return;
|
||||
|
||||
auto invUpPacket = makeZonePacket< FFXIVIpcUpdateInventorySlot >( getId() );
|
||||
invUpPacket->data().containerId = Inventory::InventoryType::Currency;
|
||||
invUpPacket->data().containerId = Common::InventoryType::Currency;
|
||||
invUpPacket->data().catalogId = 1;
|
||||
invUpPacket->data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
||||
invUpPacket->data().quantity = m_pInventory->getCurrency( static_cast< Common::CurrencyType >( type ) );
|
||||
invUpPacket->data().slot = static_cast< uint8_t >( type ) - 1;
|
||||
|
||||
queuePacket( invUpPacket );
|
||||
|
@ -157,13 +157,13 @@ void Core::Entity::Player::addCurrency( uint8_t type, uint32_t amount )
|
|||
|
||||
void Core::Entity::Player::removeCurrency( uint8_t type, uint32_t amount )
|
||||
{
|
||||
if( !m_pInventory->removeCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
|
||||
if( !m_pInventory->removeCurrency( static_cast< Common::CurrencyType >( type ), amount ) )
|
||||
return;
|
||||
|
||||
auto invUpPacket = makeZonePacket< FFXIVIpcUpdateInventorySlot >( getId() );
|
||||
invUpPacket->data().containerId = Inventory::InventoryType::Currency;
|
||||
invUpPacket->data().containerId = Common::InventoryType::Currency;
|
||||
invUpPacket->data().catalogId = 1;
|
||||
invUpPacket->data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
|
||||
invUpPacket->data().quantity = m_pInventory->getCurrency( static_cast< Common::CurrencyType >( type ) );
|
||||
invUpPacket->data().slot = static_cast< uint8_t >( type ) - 1;
|
||||
|
||||
queuePacket( invUpPacket );
|
||||
|
@ -172,18 +172,18 @@ void Core::Entity::Player::removeCurrency( uint8_t type, uint32_t amount )
|
|||
|
||||
uint32_t Core::Entity::Player::getCrystal( uint8_t type ) const
|
||||
{
|
||||
return m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
||||
return m_pInventory->getCrystal( static_cast< Common::CrystalType >( type ) );
|
||||
}
|
||||
|
||||
void Core::Entity::Player::addCrystal( uint8_t type, uint32_t amount )
|
||||
{
|
||||
if( !m_pInventory->addCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
|
||||
if( !m_pInventory->addCrystal( static_cast< Common::CrystalType >( type ), amount ) )
|
||||
return;
|
||||
|
||||
auto invUpPacket = makeZonePacket< FFXIVIpcUpdateInventorySlot >( getId() );
|
||||
invUpPacket->data().containerId = Inventory::InventoryType::Crystal;
|
||||
invUpPacket->data().containerId = Common::InventoryType::Crystal;
|
||||
invUpPacket->data().catalogId = static_cast< uint8_t >( type ) + 1;
|
||||
invUpPacket->data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
||||
invUpPacket->data().quantity = m_pInventory->getCrystal( static_cast< Common::CrystalType >( type ) );
|
||||
invUpPacket->data().slot = static_cast< uint8_t >( type ) - 1;
|
||||
|
||||
queuePacket( invUpPacket );
|
||||
|
@ -194,13 +194,13 @@ void Core::Entity::Player::addCrystal( uint8_t type, uint32_t amount )
|
|||
|
||||
void Core::Entity::Player::removeCrystal( uint8_t type, uint32_t amount )
|
||||
{
|
||||
if( !m_pInventory->removeCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
|
||||
if( !m_pInventory->removeCrystal( static_cast< Common::CrystalType >( type ), amount ) )
|
||||
return;
|
||||
|
||||
auto invUpPacket = makeZonePacket< FFXIVIpcUpdateInventorySlot >( getId() );
|
||||
invUpPacket->data().containerId = Inventory::InventoryType::Crystal;
|
||||
invUpPacket->data().containerId = Common::InventoryType::Crystal;
|
||||
invUpPacket->data().catalogId = static_cast< uint8_t >( type ) + 1;
|
||||
invUpPacket->data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
|
||||
invUpPacket->data().quantity = m_pInventory->getCrystal( static_cast< Common::CrystalType >( type ) );
|
||||
invUpPacket->data().slot = static_cast< uint8_t >( type ) - 1;
|
||||
|
||||
queuePacket( invUpPacket );
|
||||
|
|
|
@ -268,7 +268,7 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
|||
uint32_t val;
|
||||
sscanf( params.c_str(), "%d %d", &slot, &val );
|
||||
|
||||
player.setModelForSlot( static_cast< Inventory::EquipSlot >( slot ), val );
|
||||
player.setModelForSlot( static_cast< Common::EquipSlot >( slot ), val );
|
||||
player.sendModel();
|
||||
player.sendDebug( "Model updated" );
|
||||
}
|
||||
|
|
|
@ -983,7 +983,7 @@ uint8_t Core::Inventory::getFreeSlotsInBags()
|
|||
}
|
||||
|
||||
|
||||
Core::Inventory::ContainerType Core::Inventory::getContainerType( uint32_t containerId )
|
||||
Core::Common::ContainerType Core::Inventory::getContainerType( uint32_t containerId )
|
||||
{
|
||||
if( containerId < 5 )
|
||||
{
|
||||
|
@ -1003,7 +1003,7 @@ Core::Inventory::ContainerType Core::Inventory::getContainerType( uint32_t conta
|
|||
}
|
||||
else
|
||||
{
|
||||
return Unknown;
|
||||
return Common::Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,125 +16,6 @@ public:
|
|||
Inventory( Entity::Player* pOwner );
|
||||
~Inventory();
|
||||
|
||||
enum ContainerType : uint16_t
|
||||
{
|
||||
Unknown = 0,
|
||||
Bag = 1,
|
||||
GearSet = 2,
|
||||
CurrencyCrystal = 3,
|
||||
Armory = 4
|
||||
};
|
||||
|
||||
enum InventoryType : uint16_t
|
||||
{
|
||||
Bag0 = 0,
|
||||
Bag1 = 1,
|
||||
Bag2 = 2,
|
||||
Bag3 = 3,
|
||||
|
||||
GearSet0 = 1000,
|
||||
GearSet1 = 1001,
|
||||
|
||||
Currency = 2000,
|
||||
Crystal = 2001,
|
||||
//UNKNOWN_0 = 2003,
|
||||
KeyItem = 2004,
|
||||
DamagedGear = 2007,
|
||||
//UNKNOWN_1 = 2008,
|
||||
|
||||
ArmoryOff = 3200,
|
||||
ArmoryHead = 3201,
|
||||
ArmoryBody = 3202,
|
||||
ArmoryHand = 3203,
|
||||
ArmoryWaist = 3204,
|
||||
ArmoryLegs = 3205,
|
||||
ArmoryFeet = 3206,
|
||||
ArmotyNeck = 3207,
|
||||
ArmoryEar = 3208,
|
||||
ArmoryWrist = 3209,
|
||||
ArmoryRing = 3300,
|
||||
|
||||
ArmorySoulCrystal = 3400,
|
||||
ArmoryMain = 3500,
|
||||
|
||||
RetainerBag0 = 10000,
|
||||
RetainerBag1 = 10001,
|
||||
RetainerBag2 = 10002,
|
||||
RetainerBag3 = 10003,
|
||||
RetainerBag4 = 10004,
|
||||
RetainerBag5 = 10005,
|
||||
RetainerBag6 = 10006,
|
||||
RetainerEquippedGear = 11000,
|
||||
RetainerGil = 12000,
|
||||
RetainerCrystal = 12001,
|
||||
RetainerMarket = 12002,
|
||||
|
||||
FreeCompanyBag0 = 20000,
|
||||
FreeCompanyBag1 = 20001,
|
||||
FreeCompanyBag2 = 20002,
|
||||
FreeCompanyGil = 22000,
|
||||
FreeCompanyCrystal = 22001
|
||||
};
|
||||
|
||||
enum CurrencyType : uint8_t
|
||||
{
|
||||
Gil = 0x01,
|
||||
StormSeal = 0x02,
|
||||
SerpentSeal = 0x03,
|
||||
FlameSeal = 0x04,
|
||||
TomestonePhilo = 0x05,
|
||||
TomestoneMytho = 0x06,
|
||||
WolfMark = 0x07,
|
||||
TomestoneSold = 0x08,
|
||||
AlliedSeal = 0x09,
|
||||
TomestonePoet = 0x0A,
|
||||
Mgp = 0x0B,
|
||||
TomestoneLaw = 0x0C,
|
||||
TomestoneEso = 0x0D,
|
||||
TomestoneLore = 0x0E
|
||||
};
|
||||
|
||||
enum CrystalType : uint8_t
|
||||
{
|
||||
FireShard = 0x01,
|
||||
IceShard = 0x02,
|
||||
WindShard = 0x03,
|
||||
EarthShard = 0x04,
|
||||
LightningShard = 0x05,
|
||||
WaterShard = 0x06,
|
||||
|
||||
FireCrystal = 0x07,
|
||||
IceCrystal = 0x08,
|
||||
WindCrystal = 0x09,
|
||||
EarthCrystal = 0x0A,
|
||||
LightningCrystal = 0x0B,
|
||||
WaterCrystal = 0x0C,
|
||||
|
||||
FireCluster = 0x0D,
|
||||
IceCluster = 0x0E,
|
||||
WindCluster = 0x0F,
|
||||
EarthCluster = 0x10,
|
||||
LightningCluster = 0x11,
|
||||
WaterCluster = 0x12
|
||||
};
|
||||
|
||||
enum EquipSlot : uint8_t
|
||||
{
|
||||
MainHand = 0,
|
||||
OffHand = 1,
|
||||
Head = 2,
|
||||
Body = 3,
|
||||
Hands = 4,
|
||||
Waist = 5,
|
||||
Legs = 6,
|
||||
Feet = 7,
|
||||
Neck = 8,
|
||||
Ear = 9,
|
||||
Wrist = 10,
|
||||
Ring1 = 11,
|
||||
Ring2 = 12,
|
||||
SoulCrystal = 13,
|
||||
};
|
||||
using InvSlotPair = std::pair< uint16_t, int8_t >;
|
||||
typedef std::vector< InvSlotPair > InvSlotPairVec;
|
||||
|
||||
|
@ -160,15 +41,15 @@ public:
|
|||
/*! calculate and return player ilvl based off equipped gear */
|
||||
uint16_t calculateEquippedGearItemLevel();
|
||||
/*! return the current amount of currency of type */
|
||||
uint32_t getCurrency( CurrencyType type );
|
||||
uint32_t getCurrency( Common::CurrencyType type );
|
||||
/*! add amount to the current of type */
|
||||
bool addCurrency( CurrencyType type, uint32_t amount );
|
||||
bool addCurrency( Common::CurrencyType type, uint32_t amount );
|
||||
/*! remove amount from the currency of type */
|
||||
bool removeCurrency( CurrencyType type, uint32_t amount );
|
||||
bool removeCurrency( Common::CurrencyType type, uint32_t amount );
|
||||
|
||||
void updateCurrencyDb();
|
||||
void updateBagDb( InventoryType type );
|
||||
void updateMannequinDb( InventoryType type );
|
||||
void updateBagDb( Common::InventoryType type );
|
||||
void updateMannequinDb( Common::InventoryType type );
|
||||
void updateItemDb( ItemPtr pItem ) const;
|
||||
void deleteItemDb( ItemPtr pItem ) const;
|
||||
|
||||
|
@ -177,11 +58,11 @@ public:
|
|||
uint16_t getArmoryToEquipSlot( uint8_t slotId );
|
||||
|
||||
/*! return the crystal amount of currency of type */
|
||||
uint32_t getCrystal( CrystalType type );
|
||||
uint32_t getCrystal( Common::CrystalType type );
|
||||
/*! add amount to the crystal of type */
|
||||
bool addCrystal( CrystalType type, uint32_t amount );
|
||||
bool addCrystal( Common::CrystalType type, uint32_t amount );
|
||||
/*! remove amount from the crystals of type */
|
||||
bool removeCrystal( CrystalType type, uint32_t amount );
|
||||
bool removeCrystal( Common::CrystalType type, uint32_t amount );
|
||||
bool isObtainable( uint32_t catalogId, uint8_t quantity );
|
||||
|
||||
void updateCrystalDb();
|
||||
|
@ -192,7 +73,7 @@ public:
|
|||
|
||||
uint8_t getFreeSlotsInBags();
|
||||
|
||||
ContainerType getContainerType( uint32_t containerId );
|
||||
Common::ContainerType getContainerType( uint32_t containerId );
|
||||
|
||||
uint32_t getNextUId();
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ private:
|
|||
{
|
||||
m_data.mainWeapon = player.getModelMainWeapon();
|
||||
m_data.offWeapon = player.getModelSubWeapon();
|
||||
m_data.models[0] = player.getModelForSlot( Inventory::EquipSlot::Head );
|
||||
m_data.models[1] = player.getModelForSlot( Inventory::EquipSlot::Body );
|
||||
m_data.models[2] = player.getModelForSlot( Inventory::EquipSlot::Hands );
|
||||
m_data.models[3] = player.getModelForSlot( Inventory::EquipSlot::Legs );
|
||||
m_data.models[4] = player.getModelForSlot( Inventory::EquipSlot::Feet );
|
||||
m_data.models[0] = player.getModelForSlot( Common::EquipSlot::Head );
|
||||
m_data.models[1] = player.getModelForSlot( Common::EquipSlot::Body );
|
||||
m_data.models[2] = player.getModelForSlot( Common::EquipSlot::Hands );
|
||||
m_data.models[3] = player.getModelForSlot( Common::EquipSlot::Legs );
|
||||
m_data.models[4] = player.getModelForSlot( Common::EquipSlot::Feet );
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -50,16 +50,16 @@ namespace Server {
|
|||
|
||||
memcpy( m_data.look, player.getLookArray(), 26 );
|
||||
|
||||
auto item = player.getInventory()->getItemAt( Inventory::GearSet0, Inventory::EquipSlot::MainHand );
|
||||
auto item = player.getInventory()->getItemAt( Common::GearSet0, Common::EquipSlot::MainHand );
|
||||
if( item )
|
||||
m_data.mainWeaponModel = item->getModelId1();
|
||||
m_data.secWeaponModel = player.getModelSubWeapon();
|
||||
|
||||
m_data.models[0] = player.getModelForSlot( Inventory::EquipSlot::Head );
|
||||
m_data.models[1] = player.getModelForSlot( Inventory::EquipSlot::Body );
|
||||
m_data.models[2] = player.getModelForSlot( Inventory::EquipSlot::Hands );
|
||||
m_data.models[3] = player.getModelForSlot( Inventory::EquipSlot::Legs );
|
||||
m_data.models[4] = player.getModelForSlot( Inventory::EquipSlot::Feet );
|
||||
m_data.models[0] = player.getModelForSlot( Common::EquipSlot::Head );
|
||||
m_data.models[1] = player.getModelForSlot( Common::EquipSlot::Body );
|
||||
m_data.models[2] = player.getModelForSlot( Common::EquipSlot::Hands );
|
||||
m_data.models[3] = player.getModelForSlot( Common::EquipSlot::Legs );
|
||||
m_data.models[4] = player.getModelForSlot( Common::EquipSlot::Feet );
|
||||
strcpy( m_data.name, player.getName().c_str() );
|
||||
|
||||
m_data.pos.x = player.getPos().x;
|
||||
|
|
Loading…
Add table
Reference in a new issue