Jump to content
  • 0
thanna

[Solved] Koe patch

Question

this src patch is working before but when I updated my hercules it has errors, I hope someone can help me out, thanks in advance

 

Index: battle.c===================================================================--- battle.c	(revision 16921)+++ battle.c	(working copy)@@ -5089,6 +5089,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 ) {Index: battle.h===================================================================--- battle.h	(revision 16921)+++ 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 {

 

Edit: Already Solved it

Edited by thanna

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

is that your script? are you sure you are using Latest hercules?

 

 
- mapreg_readreg+ mapreg->readreg- battle_getcurrentskill+ battle->get_current_skill- add_str+ script->add_str

(-) delete

(+) add

 

try this: battle.c

 

	//t_bl/s_bl hold the 'master' of the attack, while src/target are the actual	//objects involved.	if( (t_bl = battle->get_master(target)) == NULL )		t_bl = target;	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( script->add_str("$KOEGUILD") ) || battle->get_current_skill(src) > 0 ) )		return 0;	}	if ( s_bl->type == BL_PC ) {		switch( t_bl->type ) {			case BL_MOB: // Source => PC, Target => MOB				if (pc->has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVM) )					return 0;				break;			case BL_PC:				if (pc->has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVP))					return 0;				break;			default:/* anything else goes */				break;		}	} 

battle.h

#include "mapreg.h"

Please apply it manually.

Share this post


Link to post
Share on other sites
  • 0

can you provide the whole patch? want to test it.

 

 

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 => MOBIndex: 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 {

Share this post


Link to post
Share on other sites
  • 0

is that your script? are you sure you are using Latest hercules?

 

 
- mapreg_readreg+ mapreg->readreg- battle_getcurrentskill+ battle->get_current_skill- add_str+ script->add_str

(-) delete

(+) add

 

try this: battle.c

 

	//t_bl/s_bl hold the 'master' of the attack, while src/target are the actual	//objects involved.	if( (t_bl = battle->get_master(target)) == NULL )		t_bl = target;	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( ascript->add_str("$KOEGUILD") ) || battle->get_current_skill(src) > 0 ) )		return 0;	}	if ( s_bl->type == BL_PC ) {		switch( t_bl->type ) {			case BL_MOB: // Source => PC, Target => MOB				if (pc->has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVM) )					return 0;				break;			case BL_PC:				if (pc->has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVP))					return 0;				break;			default:/* anything else goes */				break;		}	} 

battle.h

#include "mapreg.h"

Please apply it manually.

 

 

Yes, gonna test it now. will update you shoutly

 

Edit : getting this

 

 

battle.c: In function 'battle_check_target':battle.c:5829: error: 'ascript' undeclared (first use in this function)battle.c:5829: error: (Each undeclared identifier is reported only oncebattle.c:5829: error: for each function it appears in.)make[1]: *** [obj_sql/battle.o] Error 1make[1]: Leaving directory `/home/Hercules/trunk/src/map'make: *** [map_sql] Error 2
Edited by Meigan

Share this post


Link to post
Share on other sites
  • 0

make sure that you have Guild and it has skills. or try to input another emp in mob_db2 and avail, it is just a replica

 

// ====== mob_db.txt / mob_db2.txt =======// 3000,EMPELIUM,Emperium,Emperium,90,700,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0// ====== mob_avail.txt =======// 3000,1288

Share this post


Link to post
Share on other sites
  • 0

 

make sure that you have Guild and it has skills. or try to input another emp in mob_db2 and avail, it is just a replica

 

// ====== mob_db.txt / mob_db2.txt =======// 3000,EMPELIUM,Emperium,Emperium,90,700,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0// ====== mob_avail.txt =======// 3000,1288

 

 

I fixed it.

 

	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( script->add_str("$KOEGUILD") ) || battle->get_current_skill(src) > 0 ) )		return 0;	}

 

i just change the 

 

( sd->status.guild_id == mapreg->readreg( script->add_str("$koegid") ) || battle->get_current_skill(src) > 0 ) )
return 0;
 
 
It's working fine now. :D

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.