diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index 4671bf90..1a56ca55 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -6,6 +6,7 @@ #include "Script/ScriptMgr.h" #include "Actor/Player.h" +#include "Actor/BNpc.h" #include #include "Network/PacketWrappers/ActorControlPacket142.h" @@ -335,6 +336,25 @@ void Sapphire::Action::Action::damageTarget( uint32_t potency, Entity::Chara& ch else entry.value = static_cast< int16_t >( potency ); + // add to aggro table + // todo: probably move this into takeDamage? this is pretty garbage + if( chara.isBattleNpc() ) + { + auto bNpc = chara.getAsBNpc(); + if( bNpc ) + { + if( bNpc->getStance() != Common::Stance::Active ) + { + bNpc->aggro( getSourceChara() ); + bNpc->hateListUpdate( getSourceChara(), potency ); + } + else + { + bNpc->hateListUpdate( getSourceChara(), potency ); + } + } + } + // todo: aspected damage? chara.takeDamage( potency );