// ===== rAthena Patch ======================================== // = King of Emperium Hill // ===== By: ================================================== // = AnnieRuru // ===== Current Version: ===================================== // = 1.2 // ===== Compatible With: ===================================== // = rAthena 2018-04-08 // ===== Description: ========================================= // = stop guild owner from hitting the emperium over and over // ===== Topic ================================================ // = http://herc.ws/board/topic/4495-king-of-emperium-hill/ // ===== Additional Comments: ================================= // = finally a patch for this popular script // ============================================================ db/castle_db.txt | 2 ++ src/map/battle.cpp | 7 +++++++ src/map/battle.hpp | 1 + 3 files changed, 10 insertions(+) diff --git a/db/castle_db.txt b/db/castle_db.txt index ceb74dd..0fc8231 100644 --- a/db/castle_db.txt +++ b/db/castle_db.txt @@ -60,3 +60,5 @@ 41,te_prtcas03,Gloria 3,Manager_TE#Wigner 42,te_prtcas04,Gloria 4,Manager_TE#Heine 43,te_prtcas05,Gloria 5,Manager_TE#Nerious + +100,guild_vs1,King of Emperium Hill,koe \ No newline at end of file diff --git a/src/map/battle.cpp b/src/map/battle.cpp index e845c5e..4234ba7 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -7643,6 +7643,13 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( (s_bl = battle_get_master(src)) == NULL ) s_bl = src; + if ( s_bl->type == BL_PC && t_bl->type == BL_MOB ) { + struct map_session_data *sd = BL_CAST( BL_PC, s_bl ); + if ( ( ( (TBL_MOB*)target )->mob_id == 1288 && !strcmp( mapindex_id2name(sd->mapindex), "guild_vs1" ) ) && + ( sd->status.guild_id == mapreg_readreg( add_str("$koegid") ) || battle_getcurrentskill(src) > 0 ) ) + return 0; + } + if ( s_bl->type == BL_PC ) { switch( t_bl->type ) { case BL_MOB: // Source => PC, Target => MOB diff --git a/src/map/battle.hpp b/src/map/battle.hpp index b5fe7d4..f8e8908 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -10,6 +10,7 @@ #include "../config/core.h" #include "map.hpp" //ELE_MAX +#include "mapreg.hpp" //fwd declaration struct map_session_data;