1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 11:07:45 +00:00

Merge remote-tracking branch 'remotes/origin/develop' into develop_5.25

This commit is contained in:
collett 2020-05-16 18:22:32 +09:00
commit 965b88f37d
3 changed files with 15 additions and 7 deletions

View file

@ -663,6 +663,7 @@ namespace Sapphire::Common
{
None = 0,
Absorbed = 0x04,
ExtendedValue = 0x40,
EffectOnSource = 0x80,
Reflected = 0xA0,
};
@ -691,7 +692,7 @@ namespace Sapphire::Common
* Has no effect on what is shown and stored in value
*/
uint8_t param2;
uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers
uint8_t extendedValueHighestByte;
uint8_t flags;
int16_t value;
};

View file

@ -156,14 +156,21 @@ void Sapphire::World::Action::EffectResult::provoke()
Common::EffectEntry EffectResult::buildEffectEntry() const
{
Common::EffectEntry entry{};
// todo: that retarded shit so > u16 max numbers work
entry.value = getValue();
entry.effectType = m_type;
if( m_value > 0x0000FFFF )
{
entry.value = static_cast< uint16_t >( m_value & 0x0000FFFF );
entry.extendedValueHighestByte = static_cast< uint8_t >( m_value >> 16 );
entry.flags = static_cast< uint8_t >( m_flag ) + static_cast< uint8_t >( Common::ActionEffectResultFlag::ExtendedValue );
}
else
{
entry.value = static_cast< uint16_t >( m_value );
entry.flags = static_cast< uint8_t >( m_flag );
}
entry.param0 = m_param0;
entry.param1 = m_param1;
entry.effectType = m_type;
entry.param2 = static_cast< uint8_t >( m_param2 );
entry.flags = static_cast< uint8_t >( m_flag );
return entry;
}

View file

@ -11,7 +11,7 @@ using namespace Sapphire::Common;
std::string Sapphire::World::Manager::EventMgr::getEventName( uint32_t eventId )
{
auto& exdData = Common::Service< Data::ExdDataGenerated >::ref();
uint16_t eventType = eventId >> 16;
auto eventType = static_cast< Event::EventHandler::EventHandlerType >( eventId >> 16 );
auto unknown = std::string{ "unknown" };