summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 05:19:37 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 05:19:37 +0000
commitc67c76ccdd9c8f534c15e05f368aad3b762b2450 (patch)
tree50e9de1c6033242a35a7c2f5f00162c98b281628
parent3c28bcdb276c7edaebfa39db390c8d55652a8525 (diff)
downloadhercules-c67c76ccdd9c8f534c15e05f368aad3b762b2450.tar.gz
hercules-c67c76ccdd9c8f534c15e05f368aad3b762b2450.tar.bz2
hercules-c67c76ccdd9c8f534c15e05f368aad3b762b2450.tar.xz
hercules-c67c76ccdd9c8f534c15e05f368aad3b762b2450.zip
Fixed bugreport:5355 Shadow Chaser's Auto Shadow Spell is now fully functional.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15756 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c19
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/skill.c6
-rw-r--r--src/map/skill.h4
5 files changed, 27 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index afefe3d7e..831b80b66 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4202,7 +4202,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
if (sd) {
if( wd.flag&BF_SHORT && sc && sc->data[SC__AUTOSHADOWSPELL] && rand()%100 < sc->data[SC__AUTOSHADOWSPELL]->val3 &&
- sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id != 0 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].flag == 13 )
+ sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id != 0 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].flag == SKILL_FLAG_PLAGIARIZED )
{
int r_skill = sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id,
r_lv = sc->data[SC__AUTOSHADOWSPELL]->val2;
diff --git a/src/map/clif.c b/src/map/clif.c
index 8aa336cae..fabfa7ec2 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -15746,7 +15746,7 @@ int clif_autoshadowspell_list(struct map_session_data *sd) {
WFIFOHEAD(fd, 2 * 6 + 4);
WFIFOW(fd,0) = 0x442;
for( i = 0, c = 0; i < MAX_SKILL; i++ )
- if( sd->status.skill[i].flag == 13 && sd->status.skill[i].id > 0 &&
+ if( sd->status.skill[i].flag == SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].id > 0 &&
sd->status.skill[i].id < GS_GLITTERING && skill_get_type(sd->status.skill[i].id) == BF_MAGIC )
{ // Can't auto cast both Extended class and 3rd class skills.
WFIFOW(fd,8+c*2) = sd->status.skill[i].id;
@@ -15820,6 +15820,22 @@ void clif_msgtable_num(int fd, int line, int num) {
WFIFOSET(fd, packet_len(0x7e2));
#endif
}
+/*==========================================
+ * used by SC_AUTOSHADOWSPELL
+ *------------------------------------------*/
+void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) {
+
+ if( sd->menuskill_id != SC_AUTOSHADOWSPELL )
+ return;
+
+ if( pc_istrading(sd) ) {
+ clif_skill_fail(sd,sd->ud.skillid,0,0);
+ sd->menuskill_val = sd->menuskill_id = 0;
+ return;
+ }
+ skill_select_menu(sd,RFIFOL(fd,2),RFIFOW(fd,6));
+ sd->menuskill_val = sd->menuskill_id = 0;
+}
/*==========================================
* Main client packet processing function
@@ -16393,6 +16409,7 @@ static int packetdb_readdb(void)
{clif_parse_BattleChat,"battlechat"},
{clif_parse_mercenary_action,"mermenu"},
{clif_parse_progressbar,"progressbar"},
+ {clif_parse_SkillSelectMenu,"skillselectmenu"},
#if PACKETVER >= 20091229
{clif_parse_PartyBookingRegisterReq,"bookingregreq"},
{clif_parse_PartyBookingSearchReq,"bookingsearchreq"},
diff --git a/src/map/pc.c b/src/map/pc.c
index fc108888f..67c49b9fe 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1166,7 +1166,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->status.skill[sd->reproduceskill_id].lv = pc_readglobalreg(sd,"REPRODUCE_SKILL_LV");
if( i < sd->status.skill[sd->reproduceskill_id].lv)
sd->status.skill[sd->reproduceskill_id].lv = i;
- sd->status.skill[sd->reproduceskill_id].flag = 13;
+ sd->status.skill[sd->reproduceskill_id].flag = SKILL_FLAG_PLAGIARIZED;
}
}
//Weird... maybe registries were reloaded?
diff --git a/src/map/skill.c b/src/map/skill.c
index c3870a3a3..78b35a0b0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2350,7 +2350,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if( sc && sc->data[SC__REPRODUCE] && (lv = sc->data[SC__REPRODUCE]->val1) ) {
//Level dependent and limitation.
lv = min(lv,skill_get_max(copy_skill));
- if( tsd->reproduceskill_id && tsd->status.skill[tsd->reproduceskill_id].flag == 13 ) {
+ if( tsd->reproduceskill_id && tsd->status.skill[tsd->reproduceskill_id].flag == SKILL_FLAG_PLAGIARIZED ) {
tsd->status.skill[tsd->reproduceskill_id].id = 0;
tsd->status.skill[tsd->reproduceskill_id].lv = 0;
tsd->status.skill[tsd->reproduceskill_id].flag = 0;
@@ -2363,7 +2363,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
tsd->status.skill[copy_skill].id = copy_skill;
tsd->status.skill[copy_skill].lv = lv;
- tsd->status.skill[copy_skill].flag = 13;
+ tsd->status.skill[copy_skill].flag = SKILL_FLAG_PLAGIARIZED;
clif_addskill(tsd,copy_skill);
} else {
lv = skilllv;
@@ -14731,7 +14731,7 @@ int skill_select_menu(struct map_session_data *sd,int flag,int skill_id) {
status_change_end(&sd->bl,SC_STOP,-1);
}
- if( (id = sd->status.skill[skill_id].id) == 0 || sd->status.skill[skill_id].flag != 13 ||
+ if( (id = sd->status.skill[skill_id].id) == 0 || sd->status.skill[skill_id].flag != SKILL_FLAG_PLAGIARIZED ||
skill_id >= GS_GLITTERING || skill_get_type(skill_id) != BF_MAGIC ) {
clif_skill_fail(sd,SC_AUTOSHADOWSPELL,0,0);
return 0;
diff --git a/src/map/skill.h b/src/map/skill.h
index 14b051b2e..fe187b039 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -1627,4 +1627,8 @@ enum gx_poison {
PO_MAGICMUSHROOM,
PO_VENOMBLEED
};
+/**
+ * Auto Shadow Spell (Shadow Chaser)
+ **/
+int skill_select_menu(struct map_session_data *sd,int flag,int skill_id);
#endif /* _SKILL_H_ */