Issue information

Issue ID
#6115
Status
Fixed
Severity
Fair
Started
Hercules Elf Bot
Jun 26, 2012 11:08
Last Post
Hercules Elf Bot
Jul 26, 2012 2:31
Confirmation
Yes (4)
No (0)

Hercules Elf Bot - Jun 26, 2012 11:08

Originally posted by [b]Daegaladh[/b]
All of this has been tested on iRO and kRO
1. Players without guild should be able to attack Guardians.
2. Mercenaries cannot attack Emperium


Here's my fixes for them:


[CODE]
Index: battle.c
===================================================================
--- battle.c (revision 16347)
+++ battle.c (working copy)
@@ -914,8 +914,7 @@
}
if(src->type != BL_MOB) {
struct guild *g=guild_search(status_get_guild_id(src));
- if (!g) return 0;
- if (class_ == MOBID_EMPERIUM && guild_checkskill(g,GD_APPROVAL) <= 0)
+ if (class_ == MOBID_EMPERIUM && (!g || guild_checkskill(g,GD_APPROVAL) <= 0))
return 0;
if (battle_config.guild_max_castles && guild_checkcastles(g)>=battle_config.guild_max_castles)
return 0; // [MouseJstr]
@@ -4843,6 +4842,10 @@
if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data && flag&BCT_ENEMY)
return 0; //pet may not attack Guardians/Emperium
break;
+ case BL_MER:
+ if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM && flag&BCT_ENEMY)
+ return 0; //mercenary may not attack Emperium
+ break;
case BL_SKILL: {
struct skill_unit *su = (struct skill_unit *)src;
if (!su->group)
@@ -4879,8 +4882,8 @@
return 0; // You can't target anything out of your duel
}
}
- if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data )
- return 0; //If you don't belong to a guild, can't target guardians/emperium.
+ if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM)
+ return 0; //If you don't belong to a guild, can't target emperium.
if( t_bl->type != BL_PC )
state |= BCT_ENEMY; //Natural enemy.
break;[/CODE]

Hercules Elf Bot - Jul 26, 2012 2:31

Originally posted by [b]Ind[/b]
Fixed in [rev=16502] thank you