Jump to content
  • 0

Problem in King of the Emperium


dhaisuke

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  76
  • Reputation:   2
  • Joined:  06/07/12
  • Last Seen:  

Hi Guys I have a problem in koth im using miss AnniRu script

-	script	KoE	-1,{
OnInit:
	disablenpc "The King#KoE";
	disablenpc "Exit#KoE";
	bindatcmd "koe", strnpcinfo(0)+"::Oncommand", 99,99;
	end;
Oncommand:
	if ( compare( .@atcmd_parameters$, "on" ) ) goto L_start;
	else if ( compare( .@atcmd_parameters$, "off" ) ) goto L_end;
	else {
		dispbottom "type - '@koe on' to start the event";
		dispbottom "type - '@koe off' to end the event";
	}
	end;
L_start:
	gvgon "guild_vs1";
	announce "The King of Emperium Hill has begun!", bc_all;
	.start = 1;
	enablenpc "The King#KoE";
	disablenpc "Exit#KoE";
	$koegid = 0;
	donpcevent "::OnRevKoE";
	maprespawnguildid "guild_vs1", $koegid, 7;
	monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead";
	end;		
L_end:
	gvgoff "guild_vs1";
	announce "The King of Emperium Hill is over!", bc_all;
	.start = 0;
	enablenpc "Exit#KoE";
	disablenpc "The King#KoE";
	killmonsterall "guild_vs1";
//	maprespawnguildid "guild_vs1", $koegid, 6;
	end;
OnEmpDead:
	$koegid = getcharid(2);
	announce "The current King of Emperium Hill is the ["+ strcharinfo(2) +"] guild.", bc_all;
	donpcevent "::OnRevKoE";
	maprespawnguildid "guild_vs1", $koegid, 6;
	sleep 500;
	if ( .start )
		monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead";
	end;
}

// KoE Entrance
prontera,155,191,4	script	The King#KoE	58,{
    mes "[The King]";
	if ( !getcharid(2) ) {
		mes "You must have a guild to participate in the ^FF0000King of Emperium Hill Tournament^000000.";
		close;
	}
    mes "Hello.";
    mes "Would you like to participate in the ^FF0000King of Emperium Hill Tournament^000000?";
	if ( select ( "Yes", "No" ) == 2 ) close;
    switch( rand(1,4) ){
        case 1:	warp "guild_vs1", 50, 88; end;
        case 2:	warp "guild_vs1", 88, 50; end;
        case 3:	warp "guild_vs1", 50, 11; end;
        case 4:	warp "guild_vs1", 11, 50; end;
	}
}

// KoE Exit
guild_vs1,49,56,5	script	Exit#KoE	51,{
	mes "[Exit]";
	mes "See ya.";
	if ( getcharid(2) == $koegid )
		getitem 501, 1; // configure prize here
	close2;
	warp "Save",0,0;
	end;
}

// Flags
guild_vs1,49,38,4	script	King of Emperium Hill#1::koe_flag	722,{
	if ( !$koegid ) end;
	mes "[King of Emperium Hill]";
	mes "The Current King of Emperium Hill is the ["+ getguildname($koegid) +"] guild.";
	close;
OnRevKoE:
	flagemblem $koegid;
	end;
}
guild_vs1,61,49,6	duplicate(koe_flag)	King of Emperium Hill#2	722
guild_vs1,38,49,2	duplicate(koe_flag)	King of Emperium Hill#3	722
guild_vs1,49,61,0	duplicate(koe_flag)	King of Emperium Hill#4	722

guild_vs1	mapflag	nobranch
guild_vs1	mapflag	nomemo
guild_vs1	mapflag	nopenalty
guild_vs1	mapflag	noreturn
guild_vs1	mapflag	nosave	SavePoint
guild_vs1	mapflag	noteleport
guild_vs1	mapflag	gvg_noparty
guild_vs1	mapflag	nowarp
guild_vs1	mapflag	nowarpto
guild_vs1	mapflag	guildlock

its automated KOE but the problem is when the KOE end all in player Guild_vs1 map can receive the prize even if you are not the owner of the emperium 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

honestly ... how can the non-owner can receive the prize ?

if ( getcharid(2) == $koegid )
something wrong with this line ??

if the bug still exist

//	maprespawnguildid "guild_vs1", $koegid, 6;
uncomment this line to kick non owner off the map Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

Annie , this script im using too but in new revision, there are some changes in battle.c

 

Index: battle.c
===================================================================
--- battle.c	(revision 16817)
+++ battle.c	(working copy)
@@ -5021,6 +5021,13 @@
 	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)->class_ == 1288 && !strcmp( mapindex_id2name(sd->mapindex), "guild_vs1" ) ) &&
+			( sd->status.guild_id == mapreg_readreg( add_str("$KOEGUILD") ) || battle_getcurrentskill(src) > 0 ) )
+		return 0;
+	}
+
 	if ( s_bl->type == BL_PC ) {
 		switch( t_bl->type ) {
 			case BL_MOB: // Source => PC, Target => MOB
Index: battle.h
===================================================================
--- battle.h	(revision 16817)
+++ battle.h	(working copy)
@@ -3,6 +3,7 @@
 
 #ifndef _BATTLE_H_
 #define _BATTLE_H_
+#include "mapreg.h"
 
 // state of a single attack attempt; used in flee/def penalty calculations when mobbed
 typedef enum damage_lv {

this is your patch , and i show this 3ceam revision735 battle.c :

if( (t_bl = battle_get_master(target)) == NULL )
		t_bl = target;

	if( (s_bl = battle_get_master(src)) == NULL )
		s_bl = src;

	switch( target->type )
	{ // Checks on actual target
		case BL_PC:
			if (((TBL_PC*)target)->invincible_timer != INVALID_TIMER || pc_isinvisible((TBL_PC*)target))
				return -1; //Cannot be targeted yet.
			break;
		case BL_MOB:
			if((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres
				(((TBL_MOB*)target)->special_state.ai == 3 && battle_config.summon_flora&1)) && //Floras
				s_bl->type == BL_PC && src->type != BL_MOB)
			{	//Targettable by players
				state |= BCT_ENEMY;
				strip_enemy = 0;
			}
			break;

see there are some different right. im glad if you can make patch for this revision .
before this that patch works, but in this revision didnt work anymore :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

http://3ceam.googlecode.com/svn/trunk/rewrite/src/map/battle.c

you should tell me the what is the error, instead of telling me "didn't work anymore"

what I see the changes in 3ceam is they he use skill_num instead of battle_getcurrentskill

I think just change

battle_getcurrentskill(src) > 0

into

skill_num > 0

otherwise, define your "didn't work anymore"

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

that patch didnt work anymore means that that patch is for guild member cant break the emperium even it has been conquered.So its not working anymore.They can spam attack the emperium, other guild cant in the map .

Edited by amirbinazman
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

this must be the problem

( sd->status.guild_id == mapreg_readreg( add_str("$KOEGUILD")
1. did you do #include "mapreg.h" in battle.h ?

2. I'm not sure is 3ceam also implemented hercules' case-sensitive variable name, perhaps use lower case ?

EDIT: no.1 problem is unlikely ... your compiler should warn about mapreg_readreg is undefined

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

i already edit as patch before do this request :3
and already do #include "mapreg.h" in battle.h before posting this request here

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

They can spam attack the emperium, other guild cant in the map .

you mean after conquered the castle,

their own guild can attack their own emperium, but other guild cannot attack the emperium ?

sounds to me like there is a bug on the 3ceam side

just be sure,

did you included this line in db\castle_db.txt

100,guild_vs1,koe,koe,1
http://www.eathena.ws/board/index.php?s=&showtopic=174222&view=findpost&p=1491458 Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

sorry late, yes ive done all of that. to be sure, your patch is for the emperium cant be attack by guild owner . that patch doesnt work in 735 3ceam now.
ive done that castledb before

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  12/18/13
  • Last Seen:  

@chaos92 i facing same problem as u the guild owner can keep break the emperium after follow those step.

 

while if i follow AnnieRuru step in patch modified SRC i having error in battle.h

 

my battle h

 

#ifndef _BATTLE_H_
#define _BATTLE_H_
#include "mapreg.h"
 
but in annieruru src is below
 
 #include "../common/mmo.h"
 #include "../config/core.h"
 #include "map.h" //ELE_MAX
+#include "mapreg.h"
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...