mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
AoE refactor;
This commit is contained in:
parent
a6d7532038
commit
c5ea6ec8ac
5 changed files with 52 additions and 59 deletions
|
@ -228,6 +228,9 @@ global CURRENCY_TOMESTONELORE = 0X0E
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Skill handle types
|
// Skill handle types
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
global STD_DAMAGE = 0X00
|
global STD_DAMAGE = 0X03
|
||||||
global STD_HEAL = 0X01
|
global STD_HEAL = 0X04
|
||||||
global STD_DOT = 0X02
|
global STD_MP_LOSS = 0X0A
|
||||||
|
global STD_MP_GAIN = 0X0B
|
||||||
|
global STD_TP_LOSS = 0X0C
|
||||||
|
global STD_TP_GAIN = 0X0D
|
|
@ -548,7 +548,7 @@ namespace Core {
|
||||||
Unaspected = 7 // Doesn't imply magical unaspected damage - could be unaspected physical
|
Unaspected = 7 // Doesn't imply magical unaspected damage - could be unaspected physical
|
||||||
};
|
};
|
||||||
|
|
||||||
enum struct ActionType : int8_t
|
enum class ActionType : int8_t
|
||||||
{
|
{
|
||||||
WeaponOverride = -1, // Needs more investigation (takes the damage type of the equipped weapon)?
|
WeaponOverride = -1, // Needs more investigation (takes the damage type of the equipped weapon)?
|
||||||
Unknown_0 = 0,
|
Unknown_0 = 0,
|
||||||
|
@ -562,7 +562,7 @@ namespace Core {
|
||||||
LimitBreak = 8,
|
LimitBreak = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ActionEffectType : uint8_t
|
enum class ActionEffectType : uint8_t
|
||||||
{
|
{
|
||||||
Nothing = 0,
|
Nothing = 0,
|
||||||
Miss = 1,
|
Miss = 1,
|
||||||
|
@ -581,7 +581,7 @@ namespace Core {
|
||||||
GpGain = 14
|
GpGain = 14
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ActionHitSeverityType : uint8_t
|
enum class ActionHitSeverityType : uint8_t
|
||||||
{
|
{
|
||||||
NormalDamage = 0,
|
NormalDamage = 0,
|
||||||
CritHeal = 0,
|
CritHeal = 0,
|
||||||
|
@ -591,6 +591,18 @@ namespace Core {
|
||||||
CritDirectHitDamage = 3
|
CritDirectHitDamage = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class AoeType
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
SingleTarget,
|
||||||
|
TargetCircle,
|
||||||
|
Cone,
|
||||||
|
Line,
|
||||||
|
Unknown,
|
||||||
|
Unknown2,
|
||||||
|
GroundCircle, // for when you set aoe like asylum
|
||||||
|
};
|
||||||
|
|
||||||
enum HandleActionType : uint8_t
|
enum HandleActionType : uint8_t
|
||||||
{
|
{
|
||||||
Event,
|
Event,
|
||||||
|
@ -598,13 +610,6 @@ namespace Core {
|
||||||
Teleport
|
Teleport
|
||||||
};
|
};
|
||||||
|
|
||||||
enum HandleSkillType : uint8_t
|
|
||||||
{
|
|
||||||
StdDamage,
|
|
||||||
StdHeal,
|
|
||||||
StdDot,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum struct PlayerStateFlag : uint8_t
|
enum struct PlayerStateFlag : uint8_t
|
||||||
{
|
{
|
||||||
NoCombat,
|
NoCombat,
|
||||||
|
|
|
@ -44,9 +44,6 @@ float CalcBattle::calculateBaseStat( PlayerPtr pPlayer )
|
||||||
base = 1.63f * level + 121.02f;
|
base = 1.63f * level + 121.02f;
|
||||||
// ARR Base Stat Formula (Off by one in several cases)
|
// ARR Base Stat Formula (Off by one in several cases)
|
||||||
else
|
else
|
||||||
// Old: base = 0.053f * ( level * level ) + ( 1.022f * level ) - 0.907f + 20;
|
|
||||||
// V1: base = 0.0523f * ( level * level ) + ( 1.04f * level ) + 19.405f;
|
|
||||||
// V2: base = 0.05223f * ( level * level ) + ( 1.0405f * level ) + 19.405f;
|
|
||||||
base = 0.052602f * ( level * level ) + ( 1.0179f * level ) + 19.6f;
|
base = 0.052602f * ( level * level ) + ( 1.0179f * level ) + 19.6f;
|
||||||
|
|
||||||
return base;
|
return base;
|
||||||
|
@ -83,7 +80,7 @@ uint32_t CalcBattle::calculateMaxHp( PlayerPtr pPlayer )
|
||||||
else if ( level >= 50 )
|
else if ( level >= 50 )
|
||||||
approxBaseHp = 1700 + ( ( level - 50 ) * ( 1700 * 1.04325f ) );
|
approxBaseHp = 1700 + ( ( level - 50 ) * ( 1700 * 1.04325f ) );
|
||||||
else
|
else
|
||||||
approxBaseHp = paramGrowthInfoIt->second.mp_const * 0.7596f;
|
approxBaseHp = paramGrowthInfoIt->second.mp_const * 0.7667f;
|
||||||
|
|
||||||
uint16_t result = static_cast< uint16_t >( floor( jobModHp * ( approxBaseHp / 100.0f ) ) + floor( hpMod / 100.0f * ( vitStat - baseStat ) ) );
|
uint16_t result = static_cast< uint16_t >( floor( jobModHp * ( approxBaseHp / 100.0f ) ) + floor( hpMod / 100.0f * ( vitStat - baseStat ) ) );
|
||||||
|
|
||||||
|
|
|
@ -1518,30 +1518,35 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
|
||||||
{
|
{
|
||||||
sendDebug( std::to_string( pTarget.getId() ) );
|
sendDebug( std::to_string( pTarget.getId() ) );
|
||||||
sendDebug( "Handle script skill type: " + std::to_string( type ) );
|
sendDebug( "Handle script skill type: " + std::to_string( type ) );
|
||||||
|
|
||||||
auto actionInfoPtr = g_exdData.getActionInfo( actionId );
|
auto actionInfoPtr = g_exdData.getActionInfo( actionId );
|
||||||
|
|
||||||
|
sendDebug( actionInfoPtr->name );
|
||||||
|
if ( actionInfoPtr->is_aoe )
|
||||||
|
sendDebug( "is aoe: " + std::to_string( actionInfoPtr->is_aoe ) );
|
||||||
|
|
||||||
switch( type )
|
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
|
||||||
|
effectPacket.data().targetId = pTarget.getId();
|
||||||
|
effectPacket.data().actionAnimationId = actionId;
|
||||||
|
effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation
|
||||||
|
// effectPacket.data().unknown_3 = 1;
|
||||||
|
effectPacket.data().actionTextId = actionId;
|
||||||
|
effectPacket.data().numEffects = 1;
|
||||||
|
effectPacket.data().rotation = Math::Util::floatToUInt16Rot( getRotation() );
|
||||||
|
effectPacket.data().effectTarget = pTarget.getId();
|
||||||
|
effectPacket.data().effects[0].value = 0;
|
||||||
|
effectPacket.data().effects[0].effectType = static_cast < ActionEffectType >( type );
|
||||||
|
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
||||||
|
effectPacket.data().effects[0].unknown_3 = 7;
|
||||||
|
|
||||||
|
switch ( type )
|
||||||
{
|
{
|
||||||
|
|
||||||
case Core::Common::HandleSkillType::StdDamage:
|
case 3:
|
||||||
{
|
{
|
||||||
sendDebug( "STD_DAMAGE" );
|
sendDebug( "STD_DAMAGE" );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
|
|
||||||
effectPacket.data().targetId = pTarget.getId();
|
|
||||||
effectPacket.data().actionAnimationId = actionId;
|
|
||||||
effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation
|
|
||||||
// effectPacket.data().unknown_3 = 1;
|
|
||||||
effectPacket.data().actionTextId = actionId;
|
|
||||||
effectPacket.data().numEffects = 1;
|
|
||||||
effectPacket.data().rotation = Math::Util::floatToUInt16Rot( getRotation() );
|
|
||||||
effectPacket.data().effectTarget = pTarget.getId();
|
|
||||||
effectPacket.data().effects[0].value = static_cast< int16_t >( param1 );
|
effectPacket.data().effects[0].value = static_cast< int16_t >( param1 );
|
||||||
effectPacket.data().effects[0].effectType = ActionEffectType::Damage;
|
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
|
||||||
effectPacket.data().effects[0].unknown_3 = 7;
|
|
||||||
|
|
||||||
sendToInRangeSet( effectPacket, true );
|
sendToInRangeSet( effectPacket, true );
|
||||||
|
|
||||||
|
@ -1553,25 +1558,15 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Core::Common::HandleSkillType::StdHeal:
|
case 4:
|
||||||
{
|
{
|
||||||
uint32_t calculatedHeal = CalcBattle::calculateHealValue( getAsPlayer(), static_cast< uint32_t >( param1 ) );
|
uint32_t calculatedHeal = CalcBattle::calculateHealValue( getAsPlayer(), static_cast< uint32_t >( param1 ) );
|
||||||
|
|
||||||
sendDebug( "STD_HEAL" );
|
effectPacket.data().effects[0].value = static_cast< int16_t >( calculatedHeal );
|
||||||
|
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
|
|
||||||
effectPacket.data().targetId = pTarget.getId();
|
|
||||||
effectPacket.data().actionAnimationId = actionId;
|
|
||||||
effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation
|
|
||||||
// effectPacket.data().unknown_3 = 1;
|
|
||||||
effectPacket.data().actionTextId = actionId;
|
|
||||||
effectPacket.data().numEffects = 1;
|
|
||||||
effectPacket.data().rotation = Math::Util::floatToUInt16Rot( getRotation() );
|
|
||||||
effectPacket.data().effectTarget = pTarget.getId();
|
|
||||||
effectPacket.data().effects[0].value = calculatedHeal;
|
|
||||||
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
||||||
effectPacket.data().effects[0].unknown_3 = 7;
|
|
||||||
|
sendDebug( "STD_HEAL" );
|
||||||
|
|
||||||
sendToInRangeSet( effectPacket, true );
|
sendToInRangeSet( effectPacket, true );
|
||||||
|
|
||||||
|
@ -1580,9 +1575,10 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
|
||||||
|
|
||||||
// todo: get proper packets: the following was just kind of thrown together from what we know
|
// todo: get proper packets: the following was just kind of thrown together from what we know
|
||||||
// also toss AoE to another spot and make it generic
|
// also toss AoE to another spot and make it generic
|
||||||
|
sendDebug( actionInfoPtr->name );
|
||||||
if ( actionInfoPtr->is_aoe )
|
if ( actionInfoPtr->is_aoe )
|
||||||
{
|
{
|
||||||
|
sendDebug( "IS AOE LOL" );
|
||||||
for ( auto pCurAct : m_inRangePlayers )
|
for ( auto pCurAct : m_inRangePlayers )
|
||||||
{
|
{
|
||||||
assert( pCurAct );
|
assert( pCurAct );
|
||||||
|
@ -1591,20 +1587,12 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
|
||||||
|
|
||||||
if ( Math::Util::distance( pTarget.getPos().x, pTarget.getPos().y, pTarget.getPos().z, pCurAct->getPos().x, pCurAct->getPos().y, pCurAct->getPos().z ) <= actionInfoPtr->radius )
|
if ( Math::Util::distance( pTarget.getPos().x, pTarget.getPos().y, pTarget.getPos().z, pCurAct->getPos().x, pCurAct->getPos().y, pCurAct->getPos().z ) <= actionInfoPtr->radius )
|
||||||
{
|
{
|
||||||
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( pCurAct->getId() );
|
|
||||||
effectPacket.data().targetId = pCurAct->getId();
|
effectPacket.data().targetId = pCurAct->getId();
|
||||||
effectPacket.data().unknown_1 = 1; // the magic trick for getting it to work
|
effectPacket.data().unknown_1 = 1; // the magic trick for getting it to work
|
||||||
effectPacket.data().unknown_2 = 1;
|
|
||||||
effectPacket.data().unknown_8 = 1;
|
effectPacket.data().unknown_8 = 1;
|
||||||
effectPacket.data().unknown_5 = 1;
|
effectPacket.data().unknown_5 = 1;
|
||||||
effectPacket.data().actionAnimationId = actionId;
|
|
||||||
effectPacket.data().actionTextId = 0;
|
effectPacket.data().actionTextId = 0;
|
||||||
effectPacket.data().numEffects = 1;
|
|
||||||
effectPacket.data().effectTarget = pCurAct->getId();
|
effectPacket.data().effectTarget = pCurAct->getId();
|
||||||
effectPacket.data().effects[0].value = calculatedHeal;
|
|
||||||
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
|
||||||
effectPacket.data().effects[0].unknown_3 = 7;
|
|
||||||
|
|
||||||
pCurAct->sendToInRangeSet( effectPacket, true );
|
pCurAct->sendToInRangeSet( effectPacket, true );
|
||||||
pCurAct->heal( calculatedHeal );
|
pCurAct->heal( calculatedHeal );
|
||||||
|
@ -1618,7 +1606,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,13 +194,13 @@ void Core::StatusEffect::StatusEffectContainer::update()
|
||||||
if( thisTickDmg != 0 )
|
if( thisTickDmg != 0 )
|
||||||
{
|
{
|
||||||
m_pOwner->takeDamage( thisTickDmg );
|
m_pOwner->takeDamage( thisTickDmg );
|
||||||
m_pOwner->sendToInRangeSet( ActorControlPacket142( m_pOwner->getId(), HPFloatingText, 0, 3, thisTickDmg ) );
|
m_pOwner->sendToInRangeSet( ActorControlPacket142( m_pOwner->getId(), HPFloatingText, 0, static_cast< uint8_t >( ActionEffectType::Damage ), thisTickDmg ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( thisTickHeal != 0 )
|
if( thisTickHeal != 0 )
|
||||||
{
|
{
|
||||||
m_pOwner->heal( thisTickDmg );
|
m_pOwner->heal( thisTickDmg );
|
||||||
m_pOwner->sendToInRangeSet( ActorControlPacket142( m_pOwner->getId(), HPFloatingText, 0, 4, thisTickHeal ) );
|
m_pOwner->sendToInRangeSet( ActorControlPacket142( m_pOwner->getId(), HPFloatingText, 0, static_cast< uint8_t >( ActionEffectType::Heal ), thisTickHeal ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue