[Solved] Koe patch

thanna

New member
Messages
212
Points
0
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

 
Last edited by a moderator:
It's not working on latest hercules.

anyone any idea?
default_biggrin.png


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

Code:
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 {
 
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.

 
Last edited by a moderator:
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

Code:
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
 
Last edited by a moderator:
sorry typo-error, 

ascript->add_str

+ script->add_str

 
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

Code:
// ====== 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
 
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.
default_biggrin.png

 
Back
Top