thanna 11 Posted August 3, 2013 (edited) 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 August 4, 2013 by thanna Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted December 6, 2013 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. Quote Share this post Link to post Share on other sites
0 Brynner 34 Posted August 8, 2013 how did you solve this issue? Quote Share this post Link to post Share on other sites
0 Brynner 34 Posted August 8, 2013 i got it now. add_str change it to script->add_str Quote Share this post Link to post Share on other sites
0 Shatowolf 9 Posted December 4, 2013 It's not working on latest hercules. anyone any idea? Quote Share this post Link to post Share on other sites
0 Shatowolf 9 Posted December 6, 2013 bump, any fix on this issue on latest hercules? Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted December 6, 2013 can you provide the whole patch? want to test it. Quote Share this post Link to post Share on other sites
0 Shatowolf 9 Posted December 6, 2013 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 { Quote Share this post Link to post Share on other sites
0 Shatowolf 9 Posted December 6, 2013 (edited) 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 December 6, 2013 by Meigan Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted December 6, 2013 sorry typo-error, - ascript->add_str + script->add_str Quote Share this post Link to post Share on other sites
0 Shatowolf 9 Posted December 6, 2013 Compile success, it's very weird, still i can hit the emperium. Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted December 6, 2013 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 Quote Share this post Link to post Share on other sites
0 Shatowolf 9 Posted December 6, 2013 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. Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted December 6, 2013 okay nice to know that Quote Share this post Link to post Share on other sites
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
Edit: Already Solved it
Edited by thannaShare this post
Link to post
Share on other sites