From d620f0763d55e84c3c592a08d8810848e7307d99 Mon Sep 17 00:00:00 2001 From: Maru Date: Fri, 15 Sep 2017 00:56:29 -0300 Subject: [PATCH] Status effect source reference; ActionCast battle log work; Cleaning compiler warnings; --- scripts/chai/skill/cnj/skillDef_121.chai | 2 +- scripts/chai/skill/cnj/skillDef_125.chai | 2 +- scripts/chai/skill/cnj/skillDef_128.chai | 2 +- scripts/chai/skill/cnj/skillDef_132.chai | 2 +- scripts/chai/skill/skillDef_3.chai | 2 +- src/servers/Server_Common/Common.h | 6 ++-- src/servers/Server_Zone/Action/ActionCast.cpp | 12 ++++++-- src/servers/Server_Zone/Actor/Actor.cpp | 10 +++---- src/servers/Server_Zone/Actor/Actor.h | 6 ++-- src/servers/Server_Zone/Actor/BattleNpc.cpp | 2 +- src/servers/Server_Zone/Actor/CalcBattle.cpp | 8 +++--- src/servers/Server_Zone/Actor/CalcBattle.h | 2 +- src/servers/Server_Zone/Actor/Player.cpp | 28 +++++++++---------- src/servers/Server_Zone/Actor/PlayerEvent.cpp | 10 +++---- src/servers/Server_Zone/Actor/PlayerQuest.cpp | 4 +-- .../Network/Handlers/ActionHandler.cpp | 2 +- .../Server_Zone/Script/ScriptManager.cpp | 2 +- src/servers/Server_Zone/ServerZone.cpp | 2 +- .../StatusEffect/StatusEffectContainer.cpp | 9 +++--- src/servers/Server_Zone/Zone/Zone.cpp | 2 +- 20 files changed, 61 insertions(+), 54 deletions(-) diff --git a/scripts/chai/skill/cnj/skillDef_121.chai b/scripts/chai/skill/cnj/skillDef_121.chai index 19749681..048ec609 100644 --- a/scripts/chai/skill/cnj/skillDef_121.chai +++ b/scripts/chai/skill/cnj/skillDef_121.chai @@ -11,7 +11,7 @@ class skillDef_121Def def onFinish( player, target ) { player.handleScriptSkill( STD_DAMAGE, 121, 50, 0, target ); - target.addStatusEffectByIdIfNotExist(143, 20000, 0); + target.addStatusEffectByIdIfNotExist(143, 20000, player, 0); } }; diff --git a/scripts/chai/skill/cnj/skillDef_125.chai b/scripts/chai/skill/cnj/skillDef_125.chai index 5adb4eca..2795dc85 100644 --- a/scripts/chai/skill/cnj/skillDef_125.chai +++ b/scripts/chai/skill/cnj/skillDef_125.chai @@ -10,7 +10,7 @@ class skillDef_125Def def onFinish( player, target ) { - target.addStatusEffectByIdIfNotExist( 148, 60000, 0 ); + target.addStatusEffectByIdIfNotExist( 148, 60000, player, 0 ); } }; diff --git a/scripts/chai/skill/cnj/skillDef_128.chai b/scripts/chai/skill/cnj/skillDef_128.chai index 74b58e85..0d5aa11f 100644 --- a/scripts/chai/skill/cnj/skillDef_128.chai +++ b/scripts/chai/skill/cnj/skillDef_128.chai @@ -10,7 +10,7 @@ class skillDef_128Def def onFinish( player, target ) { - target.addStatusEffectByIdIfNotExist(3, 30000, 0); + target.addStatusEffectByIdIfNotExist( 3, 30000, player, 0 ); } }; diff --git a/scripts/chai/skill/cnj/skillDef_132.chai b/scripts/chai/skill/cnj/skillDef_132.chai index 765f82a1..3cca7909 100644 --- a/scripts/chai/skill/cnj/skillDef_132.chai +++ b/scripts/chai/skill/cnj/skillDef_132.chai @@ -11,7 +11,7 @@ class skillDef_132Def def onFinish( player, target ) { player.handleScriptSkill( STD_DAMAGE, 132, 50, 0, target ); - target.addStatusEffectByIdIfNotExist( 143, 20000, 0 ); + target.addStatusEffectByIdIfNotExist( 143, 20000, player, 0 ); } }; diff --git a/scripts/chai/skill/skillDef_3.chai b/scripts/chai/skill/skillDef_3.chai index 8936bec9..e888058a 100644 --- a/scripts/chai/skill/skillDef_3.chai +++ b/scripts/chai/skill/skillDef_3.chai @@ -10,7 +10,7 @@ class skillDef_3Def def onFinish( player, target ) { - player.addStatusEffectById(50, 20000, 30); + player.addStatusEffectById(50, 20000, player, 30); } }; diff --git a/src/servers/Server_Common/Common.h b/src/servers/Server_Common/Common.h index f4577309..966596bc 100644 --- a/src/servers/Server_Common/Common.h +++ b/src/servers/Server_Common/Common.h @@ -743,7 +743,7 @@ namespace Core { Flee = 0x1B, - Unk3 = 0x20, + Unk3 = 0x20, // Animation related? CombatIndicationShow = 0x22, @@ -769,7 +769,7 @@ namespace Core { ItemRepairMsg = 0x5C, LeveStartAnim = 0x66, - Unk4 = 0x67, + LeveStartError = 0x67, PlayerNameGrayout = 0x6A, ItemObtainMsg = 0x75, @@ -869,7 +869,7 @@ namespace Core { AchievementPopup = 0x203, - Unk7 = 0x205, + Unk7 = 0x205, // LogMessage? AchievementMsg = 0x206, SetItemLevel = 0x209, diff --git a/src/servers/Server_Zone/Action/ActionCast.cpp b/src/servers/Server_Zone/Action/ActionCast.cpp index b22ab5d8..ef138cdd 100644 --- a/src/servers/Server_Zone/Action/ActionCast.cpp +++ b/src/servers/Server_Zone/Action/ActionCast.cpp @@ -8,6 +8,7 @@ #include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket142.h" #include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket143.h" +#include "src/servers/Server_Zone/Network/PacketWrappers/ActorControlPacket144.h" #include "src/servers/Server_Zone/Actor/Player.h" #include "src/servers/Server_Zone/Script/ScriptManager.h" @@ -53,10 +54,11 @@ void Core::Action::ActionCast::onStart() castPacket.data().action_id = m_id; castPacket.data().unknown = 1; - castPacket.data().cast_time = m_castTime / 1000; // This is used for the cast bar above the target bar of the caster. + castPacket.data().unknown_1 = m_id; + castPacket.data().cast_time = static_cast< float >( m_castTime / 1000 ); // This is used for the cast bar above the target bar of the caster. castPacket.data().target_id = m_pTarget->getId(); - m_pSource->sendToInRangeSet( castPacket, false ); + m_pSource->sendToInRangeSet( castPacket, true ); m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting ); m_pSource->getAsPlayer()->sendStateFlags(); @@ -73,6 +75,10 @@ void Core::Action::ActionCast::onFinish() pPlayer->unsetStateFlag( PlayerStateFlag::Casting ); pPlayer->sendStateFlags(); + /*auto control = ActorControlPacket143( m_pTarget->getId(), ActorControlType::Unk7, + 0x219, m_id, m_id, m_id, m_id ); + m_pSource->sendToInRangeSet( control, true );*/ + g_scriptMgr.onCastFinish( pPlayer, m_pTarget, m_id ); } @@ -86,7 +92,7 @@ void Core::Action::ActionCast::onInterrupt() m_pSource->getAsPlayer()->sendStateFlags(); auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt, - 0x219, 0x04, m_id, 1 ); + 0x219, 1, m_id, 1 ); m_pSource->sendToInRangeSet( control, true ); } diff --git a/src/servers/Server_Zone/Actor/Actor.cpp b/src/servers/Server_Zone/Actor/Actor.cpp index 65053d30..e5ba2213 100644 --- a/src/servers/Server_Zone/Actor/Actor.cpp +++ b/src/servers/Server_Zone/Actor/Actor.cpp @@ -627,26 +627,26 @@ void Core::Entity::Actor::addStatusEffect( StatusEffect::StatusEffectPtr pEffect } /*! \param StatusEffectPtr to be applied to the actor */ -void Core::Entity::Actor::addStatusEffectById( int32_t id, int32_t duration, uint16_t param ) +void Core::Entity::Actor::addStatusEffectById( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param ) { - StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, shared_from_this(), shared_from_this(), duration, 3000 ) ); + StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, pSource.shared_from_this(), shared_from_this(), duration, 3000 ) ); effect->setParam( param ); addStatusEffect( effect ); } /*! \param StatusEffectPtr to be applied to the actor */ -void Core::Entity::Actor::addStatusEffectByIdIfNotExist( int32_t id, int32_t duration, uint16_t param ) +void Core::Entity::Actor::addStatusEffectByIdIfNotExist( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param ) { if( !m_pStatusEffectContainer->hasStatusEffect( id ) ) { - StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, shared_from_this(), shared_from_this(), duration, 3000 ) ); + StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, pSource.shared_from_this(), shared_from_this(), duration, 3000 ) ); effect->setParam( param ); addStatusEffect( effect ); } } /*! \param Status that should be removed, based on its ID. */ -void Core::Entity::Actor::removeSingleStatusEffectFromId( int32_t id ) +void Core::Entity::Actor::removeSingleStatusEffectFromId( uint32_t id ) { m_pStatusEffectContainer->removeSingleStatusEffectFromId( id ); } diff --git a/src/servers/Server_Zone/Actor/Actor.h b/src/servers/Server_Zone/Actor/Actor.h index e975d9a3..de6b9118 100644 --- a/src/servers/Server_Zone/Actor/Actor.h +++ b/src/servers/Server_Zone/Actor/Actor.h @@ -293,13 +293,13 @@ public: void addStatusEffect( StatusEffect::StatusEffectPtr pEffect ); // add a status effect by id - void addStatusEffectById( int32_t id, int32_t duration, uint16_t param = 0 ); + void addStatusEffectById( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param = 0 ); // add a status effect by id if it doesn't exist - void addStatusEffectByIdIfNotExist( int32_t id, int32_t duration, uint16_t param = 0 ); + void addStatusEffectByIdIfNotExist( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param = 0 ); // remove a status effect by id - void removeSingleStatusEffectFromId( int32_t id ); + void removeSingleStatusEffectFromId( uint32_t id ); //get the status effect container StatusEffect::StatusEffectContainerPtr getStatusEffectContainer() const; diff --git a/src/servers/Server_Zone/Actor/BattleNpc.cpp b/src/servers/Server_Zone/Actor/BattleNpc.cpp index 436e072f..b9891203 100644 --- a/src/servers/Server_Zone/Actor/BattleNpc.cpp +++ b/src/servers/Server_Zone/Actor/BattleNpc.cpp @@ -425,7 +425,7 @@ void Core::Entity::BattleNpc::onDeath() // todo: check for companion if( pHateEntry->m_pActor->isPlayer() ) // && pHateEntry->m_hateAmount >= plsBeHatedThisMuchAtLeast ) { - auto level = pHateEntry->m_pActor->getLevel(); + uint8_t level = pHateEntry->m_pActor->getLevel(); auto levelDiff = (int)this->m_level - (int)level; auto cappedLevelDiff = Math::Util::clamp( levelDiff, 1, 6 ); diff --git a/src/servers/Server_Zone/Actor/CalcBattle.cpp b/src/servers/Server_Zone/Actor/CalcBattle.cpp index fd7f84f4..f33c2e5c 100644 --- a/src/servers/Server_Zone/Actor/CalcBattle.cpp +++ b/src/servers/Server_Zone/Actor/CalcBattle.cpp @@ -29,7 +29,7 @@ extern Core::Data::ExdData g_exdData; // 3 Versions. SB and HW are linear, ARR is polynomial. // Originally from Player.cpp, calculateStats(). -uint32_t CalcBattle::calculateBaseStat( PlayerPtr pPlayer ) +float CalcBattle::calculateBaseStat( PlayerPtr pPlayer ) { float base = 0.0f; uint8_t level = pPlayer->getLevel(); @@ -37,7 +37,7 @@ uint32_t CalcBattle::calculateBaseStat( PlayerPtr pPlayer ) // SB Base Stat Formula (Aligned) if ( level > 60 ) { - base = ( ( ( level == 61) ? 224 : 220 ) + ( level - 61 ) * 8); + base = ( ( ( level == 61 ) ? 224 : 220 ) + ( level - 61 ) * 8); } // HW Base Stat Formula (Aligned) else if ( level > 50 ) @@ -85,7 +85,7 @@ uint32_t CalcBattle::calculateMaxHp( PlayerPtr pPlayer ) else approxBaseHp = paramGrowthInfoIt->second.mp_const * 0.7596f; - uint16_t result = 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 ) ) ); return result; } @@ -108,7 +108,7 @@ uint32_t CalcBattle::calculateMaxMp( PlayerPtr pPlayer ) uint16_t jobModMp = classInfoIt->second.mod_mpcpgp; uint16_t baseMp = paramGrowthInfoIt->second.mp_const; - uint16_t result = floor( floor( piety - baseStat ) * ( pietyScalar / 100 ) + baseMp ) * jobModMp / 100; + uint16_t result = static_cast< uint16_t >( floor( floor( piety - baseStat ) * ( pietyScalar / 100 ) + baseMp ) * jobModMp / 100 ); return result; } diff --git a/src/servers/Server_Zone/Actor/CalcBattle.h b/src/servers/Server_Zone/Actor/CalcBattle.h index 9d0cdcb1..f4885725 100644 --- a/src/servers/Server_Zone/Actor/CalcBattle.h +++ b/src/servers/Server_Zone/Actor/CalcBattle.h @@ -12,7 +12,7 @@ namespace Entity { { public: - static uint32_t calculateBaseStat( PlayerPtr pPlayer ); + static float calculateBaseStat( PlayerPtr pPlayer ); static uint32_t calculateMaxMp( PlayerPtr pPlayer ); static uint32_t calculateMaxHp( PlayerPtr pPlayer ); static uint32_t calculateHealValue( PlayerPtr pPlayer, uint32_t potency ); diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index 07436ae4..dc5bbf41 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -218,12 +218,12 @@ void Core::Entity::Player::calculateStats() // TODO: put formula somewhere else... float base = CalcBattle::calculateBaseStat( getAsPlayer() ); - m_baseStats.str = base * ( static_cast< float >( classInfo.mod_str ) / 100 ) + tribeInfo.mod_str; - m_baseStats.dex = base * ( static_cast< float >( classInfo.mod_dex ) / 100 ) + tribeInfo.mod_dex; - m_baseStats.vit = base * ( static_cast< float >( classInfo.mod_vit ) / 100 ) + tribeInfo.mod_vit; - m_baseStats.inte = base * ( static_cast< float >( classInfo.mod_int ) / 100 ) + tribeInfo.mod_int; - m_baseStats.mnd = base * ( static_cast< float >( classInfo.mod_mnd ) / 100 ) + tribeInfo.mod_mnd; - m_baseStats.pie = base * ( static_cast< float >( classInfo.mod_pie ) / 100 ) + tribeInfo.mod_pie; + m_baseStats.str = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_str ) / 100 ) + tribeInfo.mod_str ); + m_baseStats.dex = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_dex ) / 100 ) + tribeInfo.mod_dex ); + m_baseStats.vit = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_vit ) / 100 ) + tribeInfo.mod_vit ); + m_baseStats.inte = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_int ) / 100 ) + tribeInfo.mod_int ); + m_baseStats.mnd = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_mnd ) / 100 ) + tribeInfo.mod_mnd ); + m_baseStats.pie = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_pie ) / 100 ) + tribeInfo.mod_pie ); m_baseStats.skillSpeed = paramGrowthInfo.base_secondary; m_baseStats.spellSpeed = paramGrowthInfo.base_secondary; @@ -243,7 +243,7 @@ void Core::Entity::Player::calculateStats() m_hp = m_baseStats.max_hp; - m_baseStats.determination = base; + m_baseStats.determination = static_cast< uint32_t >( base ); } @@ -513,7 +513,7 @@ bool Core::Entity::Player::isAetheryteRegistered( uint8_t aetheryteId ) const uint8_t value; Util::valueToFlagByteIndexValue( aetheryteId, value, index ); - return m_aetheryte[index] & value; + return ( m_aetheryte[index] & value ) != 0; } uint8_t * Core::Entity::Player::getDiscoveryBitmask() @@ -608,7 +608,7 @@ bool Core::Entity::Player::isActionLearned( uint8_t actionId ) const uint8_t value; Util::valueToFlagByteIndexValue( actionId, value, index ); - return m_unlocks[index] & value; + return ( m_unlocks[index] & value ) != 0; } void Core::Entity::Player::gainExp( uint32_t amount ) @@ -997,7 +997,7 @@ bool Core::Entity::Player::hasStateFlag( Core::Common::PlayerStateFlag flag ) co uint8_t value; Util::valueToFlagByteIndexValue( iFlag, value, index ); - return m_stateFlags[index] & value; + return ( m_stateFlags[index] & value ) != 0; } void Core::Entity::Player::setStateFlag( Core::Common::PlayerStateFlag flag ) @@ -1463,7 +1463,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget ) //uint64_t tick = Util::getTimeMs(); //srand(static_cast< uint32_t >(tick)); - uint32_t damage = mainWeap->getAutoAttackDmg(); + uint32_t damage = static_cast< uint32_t >( mainWeap->getAutoAttackDmg() ); uint32_t variation = 0 + rand() % 3; if ( getClass() == JOB_MACHINIST || @@ -1534,7 +1534,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId, effectPacket.data().numEffects = 1; effectPacket.data().rotation = Math::Util::floatToUInt16Rot( getRotation() ); effectPacket.data().effectTarget = pTarget.getId(); - effectPacket.data().effects[0].param1 = param1; + effectPacket.data().effects[0].param1 = static_cast< int16_t >( param1 ); effectPacket.data().effects[0].unknown_1 = 3; effectPacket.data().effects[0].unknown_2 = 1; effectPacket.data().effects[0].unknown_3 = 7; @@ -1544,14 +1544,14 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId, if ( !pTarget.isAlive() ) break; - pTarget.takeDamage( param1 ); + pTarget.takeDamage( static_cast< uint32_t >( param1 ) ); pTarget.onActionHostile( shared_from_this() ); break; } case Core::Common::HandleSkillType::StdHeal: { - uint32_t calculatedHeal = CalcBattle::calculateHealValue( getAsPlayer(), param1 ); + uint32_t calculatedHeal = CalcBattle::calculateHealValue( getAsPlayer(), static_cast< uint32_t >( param1 ) ); sendDebug( "STD_HEAL" ); diff --git a/src/servers/Server_Zone/Actor/PlayerEvent.cpp b/src/servers/Server_Zone/Actor/PlayerEvent.cpp index 1240c800..f0bf77fe 100644 --- a/src/servers/Server_Zone/Actor/PlayerEvent.cpp +++ b/src/servers/Server_Zone/Actor/PlayerEvent.cpp @@ -264,14 +264,14 @@ void Core::Entity::Player::onTick() if( !isAlive() || !isLoadingComplete() ) return; - int32_t addHp = getMaxHp() * 0.1f + 1; - int32_t addMp = getMaxMp() * 0.06f + 1; - int32_t addTp = 100; + uint32_t addHp = static_cast< uint32_t >( getMaxHp() * 0.1f + 1 ); + uint32_t addMp = static_cast< uint32_t >( getMaxMp() * 0.06f + 1 ); + uint32_t addTp = 100; if( !m_actorIdTohateSlotMap.empty() ) { - addHp = getMaxHp() * 0.01f + 1; - addMp = getMaxHp() * 0.02f + 1; + addHp = static_cast< uint32_t >( getMaxHp() * 0.01f + 1 ); + addMp = static_cast< uint32_t >( getMaxMp() * 0.02f + 1 ); addTp = 60; } diff --git a/src/servers/Server_Zone/Actor/PlayerQuest.cpp b/src/servers/Server_Zone/Actor/PlayerQuest.cpp index e1965c8a..c6038f61 100644 --- a/src/servers/Server_Zone/Actor/PlayerQuest.cpp +++ b/src/servers/Server_Zone/Actor/PlayerQuest.cpp @@ -74,7 +74,7 @@ bool Core::Entity::Player::loadActiveQuests() void Core::Entity::Player::finishQuest( uint16_t questId ) { - int8_t idx = getQuestIndex( questId ); + int8_t idx = getQuestIndex( static_cast< uint16_t >( questId ) ); if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) ) { @@ -123,7 +123,7 @@ void Core::Entity::Player::unfinishQuest( uint16_t questId ) void Core::Entity::Player::removeQuest( uint16_t questId ) { - int8_t idx = getQuestIndex( questId ); + int8_t idx = getQuestIndex( static_cast< uint16_t >( questId ) ); if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) ) { diff --git a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp index d8fbfc62..01f2e024 100644 --- a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp @@ -109,7 +109,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in case 0x68: // Remove status (clicking it off) { // todo: check if status can be removed by client from exd - pPlayer->removeSingleStatusEffectFromId( param1 ); + pPlayer->removeSingleStatusEffectFromId( static_cast< uint32_t >( param1 ) ); break; } case 0x69: // Cancel cast diff --git a/src/servers/Server_Zone/Script/ScriptManager.cpp b/src/servers/Server_Zone/Script/ScriptManager.cpp index 3a71c367..61c331bd 100644 --- a/src/servers/Server_Zone/Script/ScriptManager.cpp +++ b/src/servers/Server_Zone/Script/ScriptManager.cpp @@ -346,7 +346,7 @@ bool Core::Scripting::ScriptManager::onMobKill( Entity::PlayerPtr pPlayer, uint1 // loop through all active quests and try to call available onMobKill callbacks for( size_t i = 0; i < 30; i++ ) { - auto activeQuests = pPlayer->getQuestActive( i ); + auto activeQuests = pPlayer->getQuestActive( static_cast< uint16_t >( i ) ); if( !activeQuests ) continue; diff --git a/src/servers/Server_Zone/ServerZone.cpp b/src/servers/Server_Zone/ServerZone.cpp index 6fb74f16..16042e03 100644 --- a/src/servers/Server_Zone/ServerZone.cpp +++ b/src/servers/Server_Zone/ServerZone.cpp @@ -99,7 +99,7 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] ) } std::vector args( argv + 1, argv + argc ); - for( auto i = 0; i + 1 < args.size(); i += 2 ) + for( uint32_t i = 0; i + 1 < args.size(); i += 2 ) { std::string arg( "" ); std::string val( "" ); diff --git a/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp b/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp index 9e2e1e74..e842d0dc 100644 --- a/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp +++ b/src/servers/Server_Zone/StatusEffect/StatusEffectContainer.cpp @@ -57,8 +57,8 @@ void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr m_effectMap[nextSlot] = pEffect; GamePacketNew< Server::FFXIVIpcAddStatusEffect, ServerZoneIpcType > statusEffectAdd( m_pOwner->getId() ); - statusEffectAdd.data().actor_id = m_pOwner->getId(); - statusEffectAdd.data().actor_id1 = m_pOwner->getId(); + statusEffectAdd.data().actor_id = pEffect->getTargetActorId(); + statusEffectAdd.data().actor_id1 = pEffect->getSrcActorId(); statusEffectAdd.data().current_hp = m_pOwner->getHp(); statusEffectAdd.data().current_mp = m_pOwner->getMp(); statusEffectAdd.data().current_tp = m_pOwner->getTp(); @@ -71,6 +71,7 @@ void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr //statusEffectAdd.data().unknown2 = 28; statusEffectAdd.data().param = pEffect->getParam(); + bool sendToSelf = m_pOwner->isPlayer() ? true : false; m_pOwner->sendToInRangeSet( statusEffectAdd, sendToSelf ); @@ -142,8 +143,8 @@ void Core::StatusEffect::StatusEffectContainer::update() { uint64_t currentTimeMs = Util::getTimeMs(); - uint64_t thisTickDmg = 0; - uint64_t thisTickHeal = 0; + uint32_t thisTickDmg = 0; + uint32_t thisTickHeal = 0; for( auto effectIt : m_effectMap ) { diff --git a/src/servers/Server_Zone/Zone/Zone.cpp b/src/servers/Server_Zone/Zone/Zone.cpp index 522dc9a8..b03abde8 100644 --- a/src/servers/Server_Zone/Zone/Zone.cpp +++ b/src/servers/Server_Zone/Zone/Zone.cpp @@ -189,7 +189,7 @@ void Zone::loadCellCache() Entity::BattleNpcPtr pBNpc( new Entity::BattleNpc( modelId, nameId, pos, sizeId, type, level, behaviour, mobType ) ); - pBNpc->setRotation( rotation ); + pBNpc->setRotation( static_cast< float >( rotation ) ); cache.push_back( pBNpc ); //pushActor( pBNpc );