1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Merge pull request #77 from itsmaru/master

Fix build; Fix issue #68; Base raise handling; Sorting out action casting stuff;
This commit is contained in:
SapphireMordred 2017-08-30 10:07:22 +02:00 committed by GitHub
commit 9146e0515d
14 changed files with 93 additions and 11 deletions

View file

@ -10,7 +10,7 @@ class skillDef_121Def
def onFinish( player, target ) def onFinish( player, target )
{ {
player.handleScriptSkill( STD_DAMAGE, 121, 5, 0, target ); player.handleScriptSkill( STD_DAMAGE, 121, 50, 0, target );
target.addStatusEffectByIdIfNotExist(143, 20000, 0); target.addStatusEffectByIdIfNotExist(143, 20000, 0);
} }

View file

@ -0,0 +1,18 @@
// Skill Name: Raise
// Skill ID: 125
class skillDef_125Def
{
def skillDef_125Def()
{
}
def onFinish( player, target )
{
target.addStatusEffectByIdIfNotExist( 148, 60000, 0 );
}
};
GLOBAL skillDef_125 = skillDef_125Def();

View file

@ -0,0 +1,19 @@
// Skill Name: Aero II
// Skill ID: 132
class skillDef_132Def
{
def skillDef_132Def()
{
}
def onFinish( player, target )
{
player.handleScriptSkill( STD_DAMAGE, 132, 50, 0, target );
target.addStatusEffectByIdIfNotExist( 143, 20000, 0 );
}
};
GLOBAL skillDef_132 = skillDef_132Def();

View file

@ -1,4 +1,4 @@
// Status Name: Wind // Status Name: Aero
// Status ID: 143 // Status ID: 143
class statusDef_143Def class statusDef_143Def

View file

@ -0,0 +1,18 @@
// Status Name: Aero II
// Status ID: 144
class statusDef_144Def
{
def statusDef_144Def()
{
}
def onTick( actor, effect )
{
effect.registerTickEffect( 1, 50 );
}
};
GLOBAL statusDef_144 = statusDef_144Def();

View file

@ -114,6 +114,13 @@ namespace Core {
FadeIn = 5, FadeIn = 5,
}; };
enum struct ResurrectType : uint8_t
{
None = 0,
RaiseSpell = 5,
Return = 8
};
enum Tribe : uint8_t enum Tribe : uint8_t
{ {
Midlander = 1, Midlander = 1,

View file

@ -1,4 +1,4 @@
#include <math.h> #include <cmath>
#include "UtilMath.h" #include "UtilMath.h"
float Core::Math::Util::distanceSq( float x, float y, float z, float x1, float y1, float z1 ) float Core::Math::Util::distanceSq( float x, float y, float z, float x1, float y1, float z1 )

View file

@ -53,10 +53,10 @@ void Core::Action::ActionCast::onStart()
castPacket.data().action_id = m_id; castPacket.data().action_id = m_id;
castPacket.data().unknown = 1; castPacket.data().unknown = 1;
castPacket.data().cast_time = m_castTime; castPacket.data().cast_time = m_castTime / 1000; // This is used for the cast bar above the target bar of the caster.
castPacket.data().target_id = m_pTarget->getId(); castPacket.data().target_id = m_pTarget->getId();
m_pSource->sendToInRangeSet( castPacket, true ); m_pSource->sendToInRangeSet( castPacket, false );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting ); m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting );
m_pSource->getAsPlayer()->sendStateFlags(); m_pSource->getAsPlayer()->sendStateFlags();

View file

@ -216,7 +216,7 @@ void Core::Entity::Actor::die()
// if the actor is a player, the update needs to be send to himself too // if the actor is a player, the update needs to be send to himself too
bool selfNeedsUpdate = isPlayer(); bool selfNeedsUpdate = isPlayer();
sendToInRangeSet( ActorControlPacket142( m_id, SetStatus, static_cast< uint8_t>( ActorStatus::Dead ) ), selfNeedsUpdate ); sendToInRangeSet( ActorControlPacket142( m_id, SetStatus, static_cast< uint8_t >( ActorStatus::Dead ) ), selfNeedsUpdate );
// TODO: not all actor show the death animation when they die, some quest npcs might just despawn // TODO: not all actor show the death animation when they die, some quest npcs might just despawn
// although that might be handled by setting the HP to 1 and doing some script magic // although that might be handled by setting the HP to 1 and doing some script magic

View file

@ -2,6 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <stdint.h> #include <stdint.h>
#include <cmath>
#include <src/servers/Server_Common/Database/Database.h> #include <src/servers/Server_Common/Database/Database.h>
#include <src/servers/Server_Common/Logging/Logger.h> #include <src/servers/Server_Common/Logging/Logger.h>

View file

@ -3,6 +3,7 @@
#include "CalcBattle.h" #include "CalcBattle.h"
#include "Actor.h" #include "Actor.h"
#include "Player.h" #include "Player.h"
#include <cmath>
using namespace Core::Entity; using namespace Core::Entity;

View file

@ -1516,10 +1516,11 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
case Core::Common::HandleSkillType::StdDamage: case Core::Common::HandleSkillType::StdDamage:
{ {
sendDebug( "STD_DAMAGE" ); sendDebug( "STD_DAMAGE" );
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() ); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget.getId(); effectPacket.data().targetId = pTarget.getId();
effectPacket.data().actionAnimationId = actionId; effectPacket.data().actionAnimationId = actionId;
effectPacket.data().unknown_2 = 0; effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation
// effectPacket.data().unknown_3 = 1; // effectPacket.data().unknown_3 = 1;
effectPacket.data().actionTextId = actionId; effectPacket.data().actionTextId = actionId;
effectPacket.data().numEffects = 1; effectPacket.data().numEffects = 1;
@ -1532,6 +1533,9 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
sendToInRangeSet( effectPacket, true ); sendToInRangeSet( effectPacket, true );
if ( !pTarget.isAlive() )
break;
pTarget.takeDamage( param1 ); pTarget.takeDamage( param1 );
pTarget.onActionHostile( shared_from_this() ); pTarget.onActionHostile( shared_from_this() );
break; break;
@ -1546,7 +1550,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() ); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget.getId(); effectPacket.data().targetId = pTarget.getId();
effectPacket.data().actionAnimationId = actionId; effectPacket.data().actionAnimationId = actionId;
effectPacket.data().unknown_2 = 0; effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation
// effectPacket.data().unknown_3 = 1; // effectPacket.data().unknown_3 = 1;
effectPacket.data().actionTextId = actionId; effectPacket.data().actionTextId = actionId;
effectPacket.data().numEffects = 1; effectPacket.data().numEffects = 1;
@ -1559,6 +1563,9 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
sendToInRangeSet( effectPacket, true ); sendToInRangeSet( effectPacket, true );
if ( !pTarget.isAlive() )
break;
pTarget.heal( calculatedHeal ); pTarget.heal( calculatedHeal );
break; break;
} }

View file

@ -128,8 +128,19 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
} }
case 0xC8: // return dead case 0xC8: // return dead
{ {
pPlayer->returnToHomepoint(); switch ( static_cast < ResurrectType >( param1 ) )
break; {
case ResurrectType::RaiseSpell:
// todo: handle raise case (set position to raiser, apply weakness status, set hp/mp/tp as well as packet)
pPlayer->returnToHomepoint();
break;
case ResurrectType::Return:
pPlayer->returnToHomepoint();
break;
default:
break;
}
} }
case 0xC9: // Finish zoning case 0xC9: // Finish zoning
{ {

View file

@ -116,7 +116,7 @@ void Core::StatusEffect::StatusEffectContainer::sendUpdate()
slot++; slot++;
} }
bool sendToSelf = m_pOwner->isPlayer() ? true : false; bool sendToSelf = m_pOwner->isPlayer();
m_pOwner->sendToInRangeSet( statusEffectList, sendToSelf ); m_pOwner->sendToInRangeSet( statusEffectList, sendToSelf );
} }