summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-18 01:37:53 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-18 01:37:53 +0000
commitaefef10ae8e198660785b9dbaa267751274ba672 (patch)
treecc3acdb6ce754e5d16cd458138ec98618db51f05
parent9374324b4198605a9ee57f31de010ae18af49256 (diff)
downloadhercules-aefef10ae8e198660785b9dbaa267751274ba672.tar.gz
hercules-aefef10ae8e198660785b9dbaa267751274ba672.tar.bz2
hercules-aefef10ae8e198660785b9dbaa267751274ba672.tar.xz
hercules-aefef10ae8e198660785b9dbaa267751274ba672.zip
Added Official Guild Aura Implementation bugreport:667
Before: - Guild Aura would only trigger when guild master moved Now: - Guild Aura is triggered when master moves and/or when guild mate gets inside the area - Guild Aura range is no longer hardcoded, you may modify it from skill_unit_db Also: - Added new skill_unit_db target type 'guild' git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15707 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--db/pre-re/skill_unit_db.txt7
-rw-r--r--db/re/skill_unit_db.txt7
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/guild.c37
-rw-r--r--src/map/guild.h2
-rw-r--r--src/map/map.c37
-rw-r--r--src/map/skill.c40
-rw-r--r--src/map/skill.h9
-rw-r--r--src/map/status.c59
-rw-r--r--src/map/status.h6
-rw-r--r--src/map/unit.c23
11 files changed, 166 insertions, 75 deletions
diff --git a/db/pre-re/skill_unit_db.txt b/db/pre-re/skill_unit_db.txt
index 68d4dd21e..e6e39a665 100644
--- a/db/pre-re/skill_unit_db.txt
+++ b/db/pre-re/skill_unit_db.txt
@@ -1,7 +1,7 @@
// ID,unit ID,unit ID 2,layout,range,interval,target,flag
//
// layout = -1:special, 0:1*1, 1:3*3, 2:5*5, up to 5:11*11
-// target = friend (party +guildmates +neutral players) / party /
+// target = friend (party +guildmates +neutral players) / party / guild
// ally (party +guildmates) / all / enemy
// flag 0x001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend'
// 0x002(UF_NOREITERRATION) Spell cannot be stacked
@@ -133,3 +133,8 @@
8210,0x93, , 0, 0,1000,enemy, 0x006 //MA_LANDMINE
8211,0x95, , 0, 1,1000,enemy, 0x006 //MA_SANDMAN
8212,0x97, , 0, 1,1000,enemy, 0x006 //MA_FREEZINGTRAP
+
+10006,0xc1, , 2, 0, -1,guild, 0x040 //GD_LEADERSHIP
+10007,0xc2, , 2, 0, -1,guild, 0x040 //GD_GLORYWOUNDS
+10008,0xc3, , 2, 0, -1,guild, 0x040 //GD_SOULCOLD
+10009,0xc4, , 2, 0, -1,guild, 0x040 //GD_HAWKEYES \ No newline at end of file
diff --git a/db/re/skill_unit_db.txt b/db/re/skill_unit_db.txt
index 68d4dd21e..e6e39a665 100644
--- a/db/re/skill_unit_db.txt
+++ b/db/re/skill_unit_db.txt
@@ -1,7 +1,7 @@
// ID,unit ID,unit ID 2,layout,range,interval,target,flag
//
// layout = -1:special, 0:1*1, 1:3*3, 2:5*5, up to 5:11*11
-// target = friend (party +guildmates +neutral players) / party /
+// target = friend (party +guildmates +neutral players) / party / guild
// ally (party +guildmates) / all / enemy
// flag 0x001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend'
// 0x002(UF_NOREITERRATION) Spell cannot be stacked
@@ -133,3 +133,8 @@
8210,0x93, , 0, 0,1000,enemy, 0x006 //MA_LANDMINE
8211,0x95, , 0, 1,1000,enemy, 0x006 //MA_SANDMAN
8212,0x97, , 0, 1,1000,enemy, 0x006 //MA_FREEZINGTRAP
+
+10006,0xc1, , 2, 0, -1,guild, 0x040 //GD_LEADERSHIP
+10007,0xc2, , 2, 0, -1,guild, 0x040 //GD_GLORYWOUNDS
+10008,0xc3, , 2, 0, -1,guild, 0x040 //GD_SOULCOLD
+10009,0xc4, , 2, 0, -1,guild, 0x040 //GD_HAWKEYES \ No newline at end of file
diff --git a/src/map/clif.c b/src/map/clif.c
index f7157ab3b..6196d347d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4314,6 +4314,9 @@ static void clif_getareachar_skillunit(struct map_session_data *sd, struct skill
{
int fd = sd->fd;
+ if( unit->group->state.guildaura )
+ return;
+
#if PACKETVER >= 3
if(unit->group->unit_id==UNT_GRAFFITI) { // Graffiti [Valaris]
WFIFOHEAD(fd,packet_len(0x1c9));
@@ -5007,6 +5010,9 @@ void clif_skill_setunit(struct skill_unit *unit)
nullpo_retv(unit);
+ if( unit->group->state.guildaura )
+ return;
+
#if PACKETVER >= 3
if(unit->group->unit_id==UNT_GRAFFITI) { // Graffiti [Valaris]
WBUFW(buf, 0)=0x1c9;
@@ -9182,6 +9188,14 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
mail_clear(sd);
+ /* Guild Aura Init */
+ if( sd->state.gmaster_flag ) {
+ guild_guildaura_refresh(sd,GD_LEADERSHIP,guild_checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
+ guild_guildaura_refresh(sd,GD_GLORYWOUNDS,guild_checkskill(sd->state.gmaster_flag,GD_GLORYWOUNDS));
+ guild_guildaura_refresh(sd,GD_SOULCOLD,guild_checkskill(sd->state.gmaster_flag,GD_SOULCOLD));
+ guild_guildaura_refresh(sd,GD_HAWKEYES,guild_checkskill(sd->state.gmaster_flag,GD_HAWKEYES));
+ }
+
if(map[sd->bl.m].flag.loadevent) // Lance
npc_script_event(sd, NPCE_LOADMAP);
diff --git a/src/map/guild.c b/src/map/guild.c
index 47f5ee478..990cf16c4 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -286,8 +286,7 @@ void guild_makemember(struct guild_member *m,struct map_session_data *sd)
* ギルドのEXPキャッシュをinter鯖にフラッシュする
* @see DBApply
*/
-int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap)
-{
+int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
int i;
struct guild_expcache *c;
struct guild *g;
@@ -1225,15 +1224,45 @@ int guild_skillupack(int guild_id,int skill_num,int account_id)
int i;
if(g==NULL)
return 0;
- if(sd!=NULL)
+ if( sd != NULL ) {
clif_guild_skillup(sd,skill_num,g->skill[skill_num-GD_SKILLBASE].lv);
+
+ /* Guild Aura handling */
+ switch( skill_num ) {
+ case GD_LEADERSHIP:
+ case GD_GLORYWOUNDS:
+ case GD_SOULCOLD:
+ case GD_HAWKEYES:
+ guild_guildaura_refresh(sd,skill_num,g->skill[skill_num-GD_SKILLBASE].lv);
+ break;
+ }
+ }
+
// 全員に通知
for(i=0;i<g->max_member;i++)
if((sd=g->member[i].sd)!=NULL)
clif_guild_skillinfo(sd);
+
return 0;
}
-
+void guild_guildaura_refresh(struct map_session_data *sd, int skill_num, int skill_lv) {
+ struct skill_unit_group* group = NULL;
+ int type = status_skill2sc(skill_num);
+ if( !(battle_config.guild_aura&((agit_flag || agit2_flag)?2:1)) &&
+ !(battle_config.guild_aura&(map_flag_gvg2(sd->bl.m)?8:4)) )
+ return;
+ if( skill_lv <= 0 )
+ return;
+ if( sd->sc.data[type] && (group = skill_id2group(sd->sc.data[type]->val4)) ) {
+ skill_delunitgroup(group);
+ status_change_end(&sd->bl,type,INVALID_TIMER);
+ }
+ group = skill_unitsetting(&sd->bl,skill_num,skill_lv,sd->bl.x,sd->bl.y,0);
+ if( group ) {
+ sc_start4(&sd->bl,type,100,(battle_config.guild_aura&16)?0:skill_lv,0,0,group->group_id,600000);//duration doesn't matter these status never end with val4
+ }
+ return;
+}
// ギルド同盟数所得
int guild_get_alliance_count(struct guild *g,int flag)
{
diff --git a/src/map/guild.h b/src/map/guild.h
index ded8468d3..9ff74e0a3 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -101,6 +101,8 @@ int guild_agit_end(void);
int guild_agit2_start(void);
int guild_agit2_end(void);
+void guild_guildaura_refresh(struct map_session_data *sd, int skill_num, int skill_lv);
+
void do_final_guild(void);
#endif /* _GUILD_H_ */
diff --git a/src/map/map.c b/src/map/map.c
index 7879576a5..5a81733dc 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -415,16 +415,25 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if (bl->type&BL_CHAR) {
skill_unit_move(bl,tick,3);
sc = status_get_sc(bl);
- if (sc) {
- if (sc->count) {
- if (sc->data[SC_CLOAKING])
- skill_check_cloaking(bl, sc->data[SC_CLOAKING]);
- if (sc->data[SC_DANCING])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_DANCING]->val2), bl->m, x1-x0, y1-y0);
- if (sc->data[SC_WARM])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_WARM]->val4), bl->m, x1-x0, y1-y0);
- if (sc->data[SC_BANDING])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_BANDING]->val4), bl->m, x1-x0, y1-y0);
+ if (sc && sc->count) {
+ if (sc->data[SC_CLOAKING])
+ skill_check_cloaking(bl, sc->data[SC_CLOAKING]);
+ if (sc->data[SC_DANCING])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_DANCING]->val2), bl->m, x1-x0, y1-y0);
+ if (sc->data[SC_WARM])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_WARM]->val4), bl->m, x1-x0, y1-y0);
+ if (sc->data[SC_BANDING])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_BANDING]->val4), bl->m, x1-x0, y1-y0);
+ /* Guild Aura Moving */
+ if( bl->type == BL_PC && ((TBL_PC*)bl)->state.gmaster_flag ) {
+ if (sc->data[SC_LEADERSHIP])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_LEADERSHIP]->val4), bl->m, x1-x0, y1-y0);
+ if (sc->data[SC_GLORYWOUNDS])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_GLORYWOUNDS]->val4), bl->m, x1-x0, y1-y0);
+ if (sc->data[SC_SOULCOLD])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_SOULCOLD]->val4), bl->m, x1-x0, y1-y0);
+ if (sc->data[SC_HAWKEYES])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_HAWKEYES]->val4), bl->m, x1-x0, y1-y0);
}
}
} else
@@ -1643,15 +1652,17 @@ int map_quit(struct map_session_data *sd)
//Unit_free handles clearing the player related data,
//map_quit handles extra specific data which is related to quitting normally
//(changing map-servers invokes unit_free but bypasses map_quit)
- if( sd->sc.count )
- {
+ if( sd->sc.count ) {
//Status that are not saved...
status_change_end(&sd->bl, SC_BOSSMAPINFO, INVALID_TIMER);
status_change_end(&sd->bl, SC_AUTOTRADE, INVALID_TIMER);
status_change_end(&sd->bl, SC_SPURT, INVALID_TIMER);
status_change_end(&sd->bl, SC_BERSERK, INVALID_TIMER);
status_change_end(&sd->bl, SC_TRICKDEAD, INVALID_TIMER);
- status_change_end(&sd->bl, SC_GUILDAURA, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_LEADERSHIP, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_GLORYWOUNDS, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_SOULCOLD, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_HAWKEYES, INVALID_TIMER);
if(sd->sc.data[SC_ENDURE] && sd->sc.data[SC_ENDURE]->val4)
status_change_end(&sd->bl, SC_ENDURE, INVALID_TIMER); //No need to save infinite endure.
status_change_end(&sd->bl, SC_WEIGHT50, INVALID_TIMER);
diff --git a/src/map/skill.c b/src/map/skill.c
index da61c1f8c..325a3de33 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5919,7 +5919,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SC_INTFOOD: case SC_DEXFOOD: case SC_LUKFOOD:
case SC_HITFOOD: case SC_FLEEFOOD: case SC_BATKFOOD:
case SC_WATKFOOD: case SC_MATKFOOD: case SC_DANCING:
- case SC_GUILDAURA: case SC_EDP: case SC_AUTOBERSERK:
+ case SC_EDP: case SC_AUTOBERSERK:
case SC_CARTBOOST: case SC_MELTDOWN: case SC_SAFETYWALL:
case SC_SMA: case SC_SPEEDUP0: case SC_NOCHAT:
case SC_ANKLE: case SC_SPIDERWEB: case SC_JAILED:
@@ -5942,9 +5942,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
//case SC_SAVAGE_STEAK: case SC_COCKTAIL_WARG_BLOOD: case SC_MINOR_BBQ:
//case SC_SIROMA_ICE_TEA: case SC_DROCERA_HERB_STEAMED: case SC_PUTTI_TAILS_NOODLES:
case SC_NEUTRALBARRIER_MASTER: case SC_NEUTRALBARRIER: case SC_STEALTHFIELD_MASTER:
- case SC_STEALTHFIELD: case SC_GIANTGROWTH: case SC_MILLENNIUMSHIELD:
- case SC_REFRESH: case SC_STONEHARDSKIN: case SC_VITALITYACTIVATION:
- case SC_FIGHTINGSPIRIT: case SC_ABUNDANCE: case SC__SHADOWFORM:
+ case SC_STEALTHFIELD: case SC_GIANTGROWTH: case SC_MILLENNIUMSHIELD:
+ case SC_REFRESH: case SC_STONEHARDSKIN: case SC_VITALITYACTIVATION:
+ case SC_FIGHTINGSPIRIT: case SC_ABUNDANCE: case SC__SHADOWFORM:
+ case SC_LEADERSHIP: case SC_GLORYWOUNDS: case SC_SOULCOLD:
+ case SC_HAWKEYES: case SC_GUILDAURA:
continue;
/**
* bugreport:4888 these songs may only be dispelled if you're not in their song area anymore
@@ -7239,7 +7241,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SC_INTFOOD: case SC_DEXFOOD: case SC_LUKFOOD:
case SC_HITFOOD: case SC_FLEEFOOD: case SC_BATKFOOD:
case SC_WATKFOOD: case SC_MATKFOOD: case SC_DANCING:
- case SC_GUILDAURA: case SC_SPIRIT: case SC_AUTOBERSERK:
+ case SC_SPIRIT: case SC_AUTOBERSERK:
case SC_CARTBOOST: case SC_MELTDOWN: case SC_SAFETYWALL:
case SC_SMA: case SC_SPEEDUP0: case SC_NOCHAT:
case SC_ANKLE: case SC_SPIDERWEB: case SC_JAILED:
@@ -7267,6 +7269,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
//case SC_DROCERA_HERB_STEAMED: case SC_PUTTI_TAILS_NOODLES:
case SC_NEUTRALBARRIER_MASTER: case SC_NEUTRALBARRIER:
case SC_STEALTHFIELD_MASTER: case SC_STEALTHFIELD:
+ case SC_LEADERSHIP: case SC_GLORYWOUNDS: case SC_SOULCOLD:
+ case SC_HAWKEYES: case SC_GUILDAURA:
continue;
case SC_ASSUMPTIO:
if( bl->type == BL_MOB )
@@ -9611,6 +9615,12 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli
val2 = sc->data[SC_POISONINGWEAPON]->val2; // Type of Poison
limit = 4000 + 2000 * skilllv;
break;
+ case GD_LEADERSHIP:
+ case GD_GLORYWOUNDS:
+ case GD_SOULCOLD:
+ case GD_HAWKEYES:
+ limit = 1000000;//it doesn't matter
+ break;
case LG_BANDING:
limit = -1;
break;
@@ -9631,7 +9641,7 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli
group->bl_flag= skill_get_unit_bl_target(skillid);
group->state.ammo_consume = (sd && sd->state.arrow_atk && skillid != GS_GROUNDDRIFT); //Store if this skill needs to consume ammo.
group->state.song_dance = (unit_flag&(UF_DANCE|UF_SONG)?1:0)|(unit_flag&UF_ENSEMBLE?2:0); //Signals if this is a song/dance/duet
-
+ group->state.guildaura = ( skillid >= GD_LEADERSHIP && skillid <= GD_HAWKEYES )?1:0;
//if tick is greater than current, do not invoke onplace function just yet. [Skotlex]
if (DIFF_TICK(group->tick, gettick()) > SKILLUNITTIMER_INTERVAL)
active_flag = 0;
@@ -9940,6 +9950,14 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
break;
skill_blown(ss,bl,skill_get_blewcount(sg->skill_id,sg->skill_lv),unit_getdir(bl),0);
break;
+
+ case UNT_GD_LEADERSHIP:
+ case UNT_GD_GLORYWOUNDS:
+ case UNT_GD_SOULCOLD:
+ case UNT_GD_HAWKEYES:
+ if ( !sce )
+ sc_start4(bl,type,100,sg->skill_lv,0,0,0,1000);
+ break;
}
return skillid;
}
@@ -10594,6 +10612,13 @@ static int skill_unit_onleft (int skill_id, struct block_list *bl, unsigned int
}
}
break;
+ case GD_LEADERSHIP:
+ case GD_GLORYWOUNDS:
+ case GD_SOULCOLD:
+ case GD_HAWKEYES:
+ if( !(sce && sce->val4) )
+ status_change_end(bl, type, INVALID_TIMER);
+ break;
}
return skill_id;
@@ -13560,7 +13585,7 @@ static int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap)
nullpo_ret(group);
// check for expiration
- if( (DIFF_TICK(tick,group->tick) >= group->limit || DIFF_TICK(tick,group->tick) >= unit->limit) )
+ if( !group->state.guildaura && (DIFF_TICK(tick,group->tick) >= group->limit || DIFF_TICK(tick,group->tick) >= unit->limit) )
{// skill unit expired (inlined from skill_unit_onlimit())
switch( group->unit_id )
{
@@ -15447,6 +15472,7 @@ static bool skill_parse_row_unitdb(char* split[], int columns, int current)
else if( strcmpi(split[6],"friend")==0 ) skill_db[i].unit_target = BCT_NOENEMY;
else if( strcmpi(split[6],"party")==0 ) skill_db[i].unit_target = BCT_PARTY;
else if( strcmpi(split[6],"ally")==0 ) skill_db[i].unit_target = BCT_PARTY|BCT_GUILD;
+ else if( strcmpi(split[6],"guild")==0 ) skill_db[i].unit_target = BCT_GUILD;
else if( strcmpi(split[6],"all")==0 ) skill_db[i].unit_target = BCT_ALL;
else if( strcmpi(split[6],"enemy")==0 ) skill_db[i].unit_target = BCT_ENEMY;
else if( strcmpi(split[6],"self")==0 ) skill_db[i].unit_target = BCT_SELF;
diff --git a/src/map/skill.h b/src/map/skill.h
index 2ca265152..fa792540e 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -155,6 +155,7 @@ struct skill_unit_group {
struct {
unsigned ammo_consume : 1;
unsigned song_dance : 2; //0x1 Song/Dance, 0x2 Ensemble
+ unsigned guildaura : 1;
} state;
};
@@ -1558,6 +1559,14 @@ enum {
UNT_WATER_INSIGNIA, //TODO
UNT_WIND_INSIGNIA, //TODO
UNT_EARTH_INSIGNIA, //TODO
+
+ /**
+ * Guild Auras
+ **/
+ UNT_GD_LEADERSHIP = 0xc1,
+ UNT_GD_GLORYWOUNDS = 0xc2,
+ UNT_GD_SOULCOLD = 0xc3,
+ UNT_GD_HAWKEYES = 0xc4,
UNT_MAX = 0x190
};
diff --git a/src/map/status.c b/src/map/status.c
index f5c588b27..77525aed1 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -495,7 +495,11 @@ void initChangeTables(void)
set_sc( MER_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
set_sc( MER_INCAGI , SC_INCREASEAGI , SI_INCREASEAGI , SCB_AGI|SCB_SPEED );
- set_sc( GD_LEADERSHIP , SC_GUILDAURA , SI_BLANK , SCB_STR|SCB_AGI|SCB_VIT|SCB_DEX );
+ set_sc( GD_LEADERSHIP , SC_LEADERSHIP , SI_BLANK , SCB_STR );
+ set_sc( GD_GLORYWOUNDS , SC_GLORYWOUNDS , SI_BLANK , SCB_VIT );
+ set_sc( GD_SOULCOLD , SC_SOULCOLD , SI_BLANK , SCB_AGI );
+ set_sc( GD_HAWKEYES , SC_HAWKEYES , SI_BLANK , SCB_DEX );
+
set_sc( GD_BATTLEORDER , SC_BATTLEORDERS , SI_BLANK , SCB_STR|SCB_INT|SCB_DEX );
set_sc( GD_REGENERATION , SC_REGENERATION , SI_BLANK , SCB_REGEN );
@@ -3721,8 +3725,8 @@ static unsigned short status_calc_str(struct block_list *bl, struct status_chang
str += sc->data[SC_FOOD_STR_CASH]->val1;
if(sc->data[SC_BATTLEORDERS])
str += 5;
- if(sc->data[SC_GUILDAURA] && sc->data[SC_GUILDAURA]->val3>>16)
- str += (sc->data[SC_GUILDAURA]->val3)>>16;
+ if(sc->data[SC_LEADERSHIP])
+ str += sc->data[SC_LEADERSHIP]->val1;
if(sc->data[SC_LOUD])
str += 4;
if(sc->data[SC_TRUESIGHT])
@@ -3772,8 +3776,8 @@ static unsigned short status_calc_agi(struct block_list *bl, struct status_chang
agi += sc->data[SC_AGIFOOD]->val1;
if(sc->data[SC_FOOD_AGI_CASH])
agi += sc->data[SC_FOOD_AGI_CASH]->val1;
- if(sc->data[SC_GUILDAURA] && (sc->data[SC_GUILDAURA]->val4)>>16)
- agi += (sc->data[SC_GUILDAURA]->val4)>>16;
+ if(sc->data[SC_SOULCOLD])
+ agi += sc->data[SC_SOULCOLD]->val1;
if(sc->data[SC_TRUESIGHT])
agi += 5;
if(sc->data[SC_INCREASEAGI])
@@ -3822,8 +3826,8 @@ static unsigned short status_calc_vit(struct block_list *bl, struct status_chang
vit += sc->data[SC_FOOD_VIT_CASH]->val1;
if(sc->data[SC_CHANGE])
vit += sc->data[SC_CHANGE]->val2;
- if(sc->data[SC_GUILDAURA] && sc->data[SC_GUILDAURA]->val3&0xFFFF)
- vit += sc->data[SC_GUILDAURA]->val3&0xFFFF;
+ if(sc->data[SC_GLORYWOUNDS])
+ vit += sc->data[SC_GLORYWOUNDS]->val1;
if(sc->data[SC_TRUESIGHT])
vit += 5;
if(sc->data[SC_STRIPARMOR])
@@ -3917,8 +3921,8 @@ static unsigned short status_calc_dex(struct block_list *bl, struct status_chang
dex += sc->data[SC_FOOD_DEX_CASH]->val1;
if(sc->data[SC_BATTLEORDERS])
dex += 5;
- if(sc->data[SC_GUILDAURA] && sc->data[SC_GUILDAURA]->val4&0xFFFF)
- dex += sc->data[SC_GUILDAURA]->val4&0xFFFF;
+ if(sc->data[SC_HAWKEYES])
+ dex += sc->data[SC_HAWKEYES]->val1;
if(sc->data[SC_TRUESIGHT])
dex += 5;
if(sc->data[SC_QUAGMIRE])
@@ -6252,10 +6256,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
}
//Check for overlapping fails
- if( (sce = sc->data[type]) )
- {
- switch( type )
- {
+ if( (sce = sc->data[type]) ) {
+ switch( type ) {
case SC_MERC_FLEEUP:
case SC_MERC_ATKUP:
case SC_MERC_HPUP:
@@ -6343,6 +6345,13 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_SHAPESHIFT:
case SC_PROPERTYWALK:
break;
+ case SC_LEADERSHIP:
+ case SC_GLORYWOUNDS:
+ case SC_SOULCOLD:
+ case SC_HAWKEYES:
+ if( sce->val4 && !val4 )//you cannot override master guild aura
+ return 0;
+ break;
case SC_JOINTBEAT:
val2 |= sce->val2; // stackable ailments
default:
@@ -9078,17 +9087,6 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
}
break;
- case SC_GUILDAURA:
- {
- struct block_list *tbl = map_id2bl(sce->val2);
-
- if (tbl && battle_check_range(bl, tbl, 2)){
- sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
- return 0;
- }
- }
- break;
-
case SC_JAILED:
if(sce->val1 == INT_MAX || --(sce->val1) > 0)
{
@@ -9545,9 +9543,16 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
clif_sitting(bl);
}
sc_timer_next(10000 + tick, status_change_timer, bl->id, data);
+ return 0;
}
break;
-
+ case SC_LEADERSHIP:
+ case SC_GLORYWOUNDS:
+ case SC_SOULCOLD:
+ case SC_HAWKEYES:
+ /* they only end by status_change_end */
+ sc_timer_next(600000 + tick, status_change_timer, bl->id, data);
+ return 0;
}
// default for all non-handled control paths is to end the status
@@ -9650,6 +9655,10 @@ int status_change_clear_buffs (struct block_list* bl, int type)
case SC_COMBO:
case SC_SMA:
case SC_DANCING:
+ case SC_LEADERSHIP:
+ case SC_GLORYWOUNDS:
+ case SC_SOULCOLD:
+ case SC_HAWKEYES:
case SC_GUILDAURA:
case SC_SAFETYWALL:
case SC_PNEUMA:
diff --git a/src/map/status.h b/src/map/status.h
index 87274adc0..19985f62a 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -567,7 +567,11 @@ typedef enum sc_type {
SC_TIDAL_WEAPON_OPTION,//505
SC_ROCK_CRUSHER,
SC_ROCK_CRUSHER_ATK,
-
+ /* Guild Aura */
+ SC_LEADERSHIP,
+ SC_GLORYWOUNDS,
+ SC_SOULCOLD, //510
+ SC_HAWKEYES,
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
} sc_type;
diff --git a/src/map/unit.c b/src/map/unit.c
index 61046c4e0..9c6b8d760 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -183,29 +183,6 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
{// mercenary is too far from the master so warp the master's position
unit_warp( &sd->md->bl, sd->bl.m, sd->bl.x, sd->bl.y, CLR_TELEPORT );
}
-
- if (sd->state.gmaster_flag &&
- (battle_config.guild_aura&((agit_flag || agit2_flag)?2:1)) &&
- (battle_config.guild_aura&(map_flag_gvg2(bl->m)?8:4))
- )
- { //Guild Aura: Likely needs to be recoded, this method seems inefficient.
- struct guild *g = sd->state.gmaster_flag;
- int skill, strvit= 0, agidex = 0;
- if ((skill = guild_checkskill(g, GD_LEADERSHIP)) > 0) strvit |= (skill&0xFFFF)<<16;
- if ((skill = guild_checkskill(g, GD_GLORYWOUNDS)) > 0) strvit |= (skill&0xFFFF);
- if ((skill = guild_checkskill(g, GD_SOULCOLD)) > 0) agidex |= (skill&0xFFFF)<<16;
- if ((skill = guild_checkskill(g, GD_HAWKEYES)) > 0) agidex |= (skill&0xFFFF);
- if (strvit || agidex)
- {// replaced redundant foreachinrange call with smaller and much more efficient iteration
- for( i = 0; i < g->max_member; i++ )
- {
- if( g->member[i].online && g->member[i].sd && sd->bl.m == g->member[i].sd->bl.m && check_distance_bl(&sd->bl, &g->member[i].sd->bl, 2) )
- {// perform the aura on the member as appropriate
- skill_guildaura_sub(g->member[i].sd, sd->bl.id, strvit, agidex);
- }
- }
- }
- }
} else if (md) {
if( map_getcell(bl->m,x,y,CELL_CHKNPC) ) {
if( npc_touch_areanpc2(md) ) return 0; // Warped