From 5aa2f17fc124f33c58264000e4da231ae1bd6a8c Mon Sep 17 00:00:00 2001 From: aleos89 Date: Fri, 7 Mar 2014 11:53:14 -0500 Subject: [PATCH] Bug Fixes * Fixed Guild Auras applying to other guilds. (bugreport:7073) (Hercules 81caf70, 7fc0697, eb53067) * Fixed wrong packet being used for storages on 20071002 and older clients. --- db/pre-re/skill_unit_db.txt | 2 +- db/re/skill_unit_db.txt | 2 +- src/map/battle.c | 4 ++-- src/map/battle.h | 22 ++++++++++++---------- src/map/clif.c | 2 +- src/map/skill.c | 3 ++- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/db/pre-re/skill_unit_db.txt b/db/pre-re/skill_unit_db.txt index 96c70d4d64..7b586e221f 100644 --- a/db/pre-re/skill_unit_db.txt +++ b/db/pre-re/skill_unit_db.txt @@ -5,7 +5,7 @@ // // layout = -1:special, 0:1*1, 1:3*3, 2:5*5, up to 5:11*11 // target = friend (party +guildmates +neutral players) / party / guild -// ally (party +guildmates) / all / enemy +// ally (party +guildmates) / all / sameguild (guild but no allies) / enemy // flag 0x0001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend' // 0x0002(UF_NOREITERRATION) Spell cannot be stacked // 0x0004(UF_NOFOOTSET) Spell cannot be cast near/on targets diff --git a/db/re/skill_unit_db.txt b/db/re/skill_unit_db.txt index 4f55f2c936..678c401676 100644 --- a/db/re/skill_unit_db.txt +++ b/db/re/skill_unit_db.txt @@ -5,7 +5,7 @@ // // layout = -1:special, 0:1*1, 1:3*3, 2:5*5, up to 5:11*11 // target = friend (party +guildmates +neutral players) / party / guild -// ally (party +guildmates) / all / enemy +// ally (party +guildmates) / all / sameguild (guild but no allies) / enemy // flag 0x0001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend' // 0x0002(UF_NOREITERRATION) Spell cannot be stacked // 0x0004(UF_NOFOOTSET) Spell cannot be cast near/on targets diff --git a/src/map/battle.c b/src/map/battle.c index c7a350f13e..bacc7e7ddb 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6879,7 +6879,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f { int s_guild = status_get_guild_id(s_bl); int t_guild = status_get_guild_id(t_bl); - if( !(map[m].flag.pvp && map[m].flag.pvp_noguild) && s_guild && t_guild && (s_guild == t_guild || guild_isallied(s_guild, t_guild)) && (!map[m].flag.battleground || sbg_id == tbg_id) ) + if( !(map[m].flag.pvp && map[m].flag.pvp_noguild) && s_guild && t_guild && (s_guild == t_guild || (!(flag&BCT_SAMEGUILD) && guild_isallied(s_guild, t_guild))) && (!map[m].flag.battleground || sbg_id == tbg_id) ) state |= BCT_GUILD; else state |= BCT_ENEMY; @@ -6912,7 +6912,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f { int s_guild = status_get_guild_id(s_bl); int t_guild = status_get_guild_id(t_bl); - if(s_guild && t_guild && (s_guild == t_guild || guild_isallied(s_guild, t_guild))) + if(s_guild && t_guild && (s_guild == t_guild || (!(flag&BCT_SAMEGUILD) && guild_isallied(s_guild, t_guild)))) state |= BCT_GUILD; } } //end non pvp/gvg chk rivality diff --git a/src/map/battle.h b/src/map/battle.h index d3d3502583..d22003250e 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -33,16 +33,18 @@ enum { // Flag of the final calculation enum e_battle_check_target {//New definitions [Skotlex] - BCT_ENEMY = 0x020000, - BCT_NOENEMY = 0x1d0000, //This should be (~BCT_ENEMY&BCT_ALL) - BCT_PARTY = 0x040000, - BCT_NOPARTY = 0x1b0000, //This should be (~BCT_PARTY&BCT_ALL) - BCT_GUILD = 0x080000, - BCT_NOGUILD = 0x170000, //This should be (~BCT_GUILD&BCT_ALL) - BCT_ALL = 0x1f0000, - BCT_NOONE = 0x000000, - BCT_SELF = 0x010000, - BCT_NEUTRAL = 0x100000, + BCT_NOONE = 0x000000, + BCT_SELF = 0x010000, + BCT_ENEMY = 0x020000, + BCT_PARTY = 0x040000, + BCT_GUILDALLY = 0x080000, // Only allies, NOT guildmates + BCT_NEUTRAL = 0x100000, + BCT_SAMEGUILD = 0x200000, // No Guild Allies + BCT_GUILD = 0x280000, // Guild AND Allies (BCT_SAMEGUILD|BCT_GUILDALLY) + BCT_NOGUILD = 0x170000, // This should be (~BCT_GUILD&BCT_ALL) + BCT_NOPARTY = 0x3b0000, // This should be (~BCT_PARTY&BCT_ALL) + BCT_NOENEMY = 0x3d0000, // This should be (~BCT_ENEMY&BCT_ALL) + BCT_ALL = 0x3f0000, }; // dammage structure diff --git a/src/map/clif.c b/src/map/clif.c index f68161e0f9..0dfbec3f51 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2554,7 +2554,7 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items #if PACKETVER < 20071002 const int se = 20; //entry size equip const int sidxe = 4; //start itemlist idx - const int cmde = 0x2d1; + const int cmde = 0xa6; #elif PACKETVER < 20100629 const int se = 26; const int sidxe = 4; diff --git a/src/map/skill.c b/src/map/skill.c index c272f8d2fa..11c4de0bda 100755 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -12211,7 +12211,7 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un case UNT_GD_GLORYWOUNDS: case UNT_GD_SOULCOLD: case UNT_GD_HAWKEYES: - if ( !sce ) + if ( !sce && battle_check_target(&sg->unit->bl, bl, sg->target_flag) > 0 ) sc_start4(ss, bl,type,100,sg->skill_lv,0,0,0,1000); break; } @@ -18990,6 +18990,7 @@ static bool skill_parse_row_unitdb(char* split[], int columns, int current) { else if( strcmpi(split[6],"all")==0 ) skill_db[idx].unit_target = BCT_ALL; else if( strcmpi(split[6],"enemy")==0 ) skill_db[idx].unit_target = BCT_ENEMY; else if( strcmpi(split[6],"self")==0 ) skill_db[idx].unit_target = BCT_SELF; + else if( strcmpi(split[6],"sameguild"==0 ) skill_db[idx].unit_target = BCT_GUILD|BCT_SAMEGUILD; else if( strcmpi(split[6],"noone")==0 ) skill_db[idx].unit_target = BCT_NOONE; else skill_db[idx].unit_target = strtol(split[6],NULL,16);