King of Emperium Hill

Hi @@AnnieRuru

There's a flaw with the script, players can enter the KOE room even after it ends. They talk to the NPC and leave the window option open, press OK once the KOE ends and you will be warped inside, able to claim the prize.
default_smile.png


 
1.1

- fix the bug mentioned above

- change all stuffs that I can find into constants

- fix a rare bug that if player brings in a slave monster, the monster get killed whenever the emperium spawn/dead

- add a plugin this time

 
Thank you I'm testing it now
default_smile.png


1.1
- fix the bug mentioned above
- change all stuffs that I can find into constants
- fix a rare bug that if player brings in a slave monster, the monster get killed whenever the emperium spawn/dead
- add a plugin this time
Can you also include the update to diff?
default_biggrin.png
Thanks

 
Can you also include the update to diff?
default_biggrin.png
Thanks
I believe the diff still works with latest hercwell if you manually insert those few lines

you can find them in spoiler tag

I recently hook with Haru in pull request at Github, so I can't have any diff in my test server

 
is HPM need for this plugin to work? like do I need to activate HPM together with this plugin?

Also getting this error

Code:
koe.c: In function ‘battle_check_target_post’:
koe.c:43: error: ‘MOBID_1288’ undeclared (first use in this function)
koe.c:43: error: (Each undeclared identifier is reported only once
koe.c:43: error: for each function it appears in.)
make[1]: *** [../../plugins/koe.so] Error 1

 
 
Last edited by a moderator:
Hi! Thx for the script, again.
       CC      koe.c
koe.c: In function 'battle_check_target_post':
koe.c:43: error: 'MOBID_EMPERIUM' undeclared (first use in this function)
koe.c:43: error: (Each undeclared identifier is reported only once
koe.c:43: error: for each function it appears in.)
koe.c: In function 'plugin_init':
koe.c:52: warning: implicit declaration of function 'addHookPost'
koe.c:52: warning: nested extern declaration of 'addHookPost'
make[1]: *** [../../plugins/koe.so] Error 1
 
Any fix for this ? I get this when trying to recompile with "make sql plugins"

Thanks ~
 
Hi! Thx for the script, again.
       CC      koe.c
koe.c: In function 'battle_check_target_post':
koe.c:43: error: 'MOBID_EMPERIUM' undeclared (first use in this function)
koe.c:43: error: (Each undeclared identifier is reported only once
koe.c:43: error: for each function it appears in.)
koe.c: In function 'plugin_init':
koe.c:52: warning: implicit declaration of function 'addHookPost'
koe.c:52: warning: nested extern declaration of 'addHookPost'
make[1]: *** [../../plugins/koe.so] Error 1
 
Any fix for this ? I get this when trying to recompile with "make sql plugins"

Thanks ~
I assume the plugin is not compatible with the current version of herc? You may want to use the patch instead.​

 
The plugin is created to stop people from killing their own emperium.

You can just code it so that when a guild kills the emperium if they already own it their entire guild gets warped out and the owner of the emperium is set to 0. This also forces the owning guild to watch their AoE and play a bit more carefully. It only takes once for a guild to learn from their mistake, since the other guilds can easily take the emperium while they are warped out. By doing this you get to entirely avoid the plugin and source edits, if you have a hard time updating your plugins this is a nice simple alternative. 

You can just add this bit to OnEmpDead:

if ( $koegid == getcharid(2) ) {
        mapannounce "guild_vs1", "You can't do that... bad " + strcharinfo(2) +" ",bc_map,0xFFCE00;
        mapwarp "guild_vs1","prontera",0,0,1,$koegid;
        $koegid = 0;
        sleep 500;
        if ( .start )
            monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead";
    end;
    }
 
anyone has the working diff/patch of this koe? tried to add the plugin gets error? also some links are broken
default_sad.png


help i got this error after building the koe.c

Code:
Warning    1    warning C4013: 'addHookPost' undefined; assuming extern returning int  
Error    2    error LNK2019: unresolved external symbol _addHookPost referenced in function _plugin_init
Error    3    error LNK1120: 1 unresolved externals
 
Last edited by a moderator:
Hello,

I get this error when making the plugin.

Code:
        CC      koe.c
koe.c: In function ‘battle_check_target_post’:
koe.c:43:25: error: ‘MOBID_EMPERIUM’ undeclared (first use in this function)
    if ( ( md->class_ == MOBID_EMPERIUM && !strcmp( mapindex_id2name(sd->mapindex), "guild_vs1" ) ) &&
                         ^
koe.c:43:25: note: each undeclared identifier is reported only once for each function it appears in
koe.c: In function ‘plugin_init’:
koe.c:52:2: warning: implicit declaration of function ‘addHookPost’ [-Wimplicit-function-declaration]
  addHookPost( "battle->check_target", battle_check_target_post );
  ^
koe.c:52:2: warning: nested extern declaration of ‘addHookPost’ [-Wnested-externs]
make[1]: *** [../../plugins/koe.so] Error 1
 
here:

Code:
//===== Hercules Plugin ======================================
//= King of Emperium Hill
//===== By: ==================================================
//= AnnieRuru
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: ===================================== 
//= Hercules 2015-12-19
//===== Description: =========================================
//= stop guild owner from hitting the emperium over and over
//===== Topic ================================================
//= [URL="https://boardtest.herc.ws/topic/4495-king-of-emperium-hill/"]http://herc.ws/board/topic/4495-king-of-emperium-hill/[/URL]
//===== Additional Comments: =================================  
//= finally a plugin for this popular script
//============================================================

#include "common/hercules.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "map/pc.h"
#include "map/mob.h"
#include "map/battle.h"
#include "map/mapreg.h"
#include "common/memmgr.h"
#include "plugins/HPMHooking.h"
#include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time)



HPExport struct hplugin_info pinfo = {
	"koe",
	SERVER_TYPE_MAP,
	"1.1",
	HPM_VERSION,
};

int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int *flag ) {
	if ( retVal == 1 ) {
		struct block_list *s_bl = src;
		if( (s_bl = battle->get_master(src)) == NULL )
			s_bl = src;
		if ( s_bl->type == BL_PC && target->type == BL_MOB ) {
			TBL_PC *sd = BL_CAST( BL_PC, s_bl );
			TBL_MOB *md = BL_CAST( BL_MOB, target );
			if ( ( md->class_ == MOBID_EMPELIUM && !strcmp( mapindex_id2name(sd->mapindex), "guild_vs1" ) ) &&
				( sd->status.guild_id == mapreg->readreg( script->add_str("$koegid") ) || battle->get_current_skill(src) > 0 ) )
				return 0;
		}
	}
	return retVal;
}

HPExport void plugin_init (void) {
	addHookPost( battle, check_target, battle_check_target_post );
}
 
here:

//===== Hercules Plugin ======================================
//= King of Emperium Hill
//===== By: ==================================================
//= AnnieRuru
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= Hercules 2015-12-19
//===== 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 plugin for this popular script
//============================================================

#include "common/hercules.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "map/pc.h"
#include "map/mob.h"
#include "map/battle.h"
#include "map/mapreg.h"
#include "common/memmgr.h"
#include "plugins/HPMHooking.h"
#include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time)



HPExport struct hplugin_info pinfo = {
"koe",
SERVER_TYPE_MAP,
"1.1",
HPM_VERSION,
};

int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int *flag ) {
if ( retVal == 1 ) {
struct block_list *s_bl = src;
if( (s_bl = battle->get_master(src)) == NULL )
s_bl = src;
if ( s_bl->type == BL_PC && target->type == BL_MOB ) {
TBL_PC *sd = BL_CAST( BL_PC, s_bl );
TBL_MOB *md = BL_CAST( BL_MOB, target );
if ( ( md->class_ == MOBID_EMPELIUM && !strcmp( mapindex_id2name(sd->mapindex), "guild_vs1" ) ) &&
( sd->status.guild_id == mapreg->readreg( script->add_str("$koegid") ) || battle->get_current_skill(src) > 0 ) )
return 0;
}
}
return retVal;
}

HPExport void plugin_init (void) {
addHookPost( battle, check_target, battle_check_target_post );
}
Thank you
default_smile.png


However here is another one.

Code:
In file included from koe.c:26:0:
koe.c: In function ‘plugin_init’:
../plugins/HPMHooking.h:54:54: warning: comparison of distinct pointer types lacks a cast [enabled by default]
   (void)((HPMHOOK_post_ ## ifname ## _ ## funcname)0 == (hook)), \
                                                      ^
koe.c:55:2: note: in expansion of macro ‘addHookPost’
  addHookPost( battle, check_target, battle_check_target_post );
  ^
 
koe.c: In function 'plugin_init':
koe.c:55: warning: comparison of distinct pointer types lacks a cast
        PLUGIN  koe
 How to fix this? I tried "make plugins" and try running the script but I can hit emp even if I own it so I checked FAQ says to recompile now I can't start my server.
 
Last edited by a moderator:
Can anyone improvised this? to make everyone online in guild receive a reward? 
If the koe ends and you are outside (for example you just died) you won't get any reward.

 
Back
Top