summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2015-05-26 05:13:17 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2015-05-26 05:13:17 +0800
commitcd8e68ba9e18a6be416ecc4197b119eb9425fc23 (patch)
tree8721f1f332120afa9130af5ae387995a7a128b59 /src/map
parent027f124cbb96bb99d00bc31ad51345024edadf66 (diff)
downloadhercules-cd8e68ba9e18a6be416ecc4197b119eb9425fc23.tar.gz
hercules-cd8e68ba9e18a6be416ecc4197b119eb9425fc23.tar.bz2
hercules-cd8e68ba9e18a6be416ecc4197b119eb9425fc23.tar.xz
hercules-cd8e68ba9e18a6be416ecc4197b119eb9425fc23.zip
Another batch of corrected skill level check
-Followup@dbaff8bdff2552c94d83e71249ae9e2117f62a72 -Added missing code from previous commit@027f124cbb96bb99d00bc31ad51345024edadf66 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c39
-rw-r--r--src/map/skill.c3
3 files changed, 29 insertions, 15 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 603db4738..393511d1c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3368,7 +3368,7 @@ void battle_consume_ammo(TBL_PC*sd, int skill_id, int lv) {
if (!battle_config.arrow_decrement)
return;
- if (skill_id) {
+ if (skill_id && lv) {
qty = skill->get_ammo_qty(skill_id, lv);
if (!qty) qty = 1;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 0dc04a3b8..1e3a3c27d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1520,21 +1520,24 @@ void clif_homskillinfoblock(struct map_session_data *sd) {
WFIFOHEAD(fd, 4+37*MAX_HOMUNSKILL);
WFIFOW(fd,0)=0x235;
- for ( i = 0; i < MAX_HOMUNSKILL; i++){
+ for ( i = 0; i < MAX_HOMUNSKILL; i++ ) {
int id = hd->homunculus.hskill[i].id;
- if (id != 0) {
+ if ( id != 0 ) {
j = id - HM_SKILLBASE;
+ WFIFOW(fd, len) = id;
+ WFIFOW(fd, len + 2) = skill->get_inf(id);
+ WFIFOW(fd, len + 4) = 0;
+ WFIFOW(fd, len + 6) = hd->homunculus.hskill[j].lv;
if ( hd->homunculus.hskill[j].lv ) {
- WFIFOW(fd, len) = id;
- WFIFOW(fd, len + 2) = skill->get_inf(id);
- WFIFOW(fd, len + 4) = 0;
- WFIFOW(fd, len + 6) = hd->homunculus.hskill[j].lv;
WFIFOW(fd, len + 8) = skill->get_sp(id, hd->homunculus.hskill[j].lv);
WFIFOW(fd, len + 10) = skill->get_range2(&sd->hd->bl, id, hd->homunculus.hskill[j].lv);
- safestrncpy((char*)WFIFOP(fd, len + 12), skill->get_name(id), NAME_LENGTH);
- WFIFOB(fd, len + 36) = (hd->homunculus.hskill[j].lv < homun->skill_tree_get_max(id, hd->homunculus.class_)) ? 1 : 0;
- len += 37;
+ } else {
+ WFIFOW(fd, len + 8) = 0;
+ WFIFOW(fd, len + 10) = 0;
}
+ safestrncpy((char*)WFIFOP(fd, len + 12), skill->get_name(id), NAME_LENGTH);
+ WFIFOB(fd, len + 36) = (hd->homunculus.hskill[j].lv < homun->skill_tree_get_max(id, hd->homunculus.class_)) ? 1 : 0;
+ len += 37;
}
}
WFIFOW(fd,2)=len;
@@ -7453,8 +7456,13 @@ void clif_guild_skillinfo(struct map_session_data* sd)
WFIFOW(fd,p+0) = id;
WFIFOL(fd,p+2) = skill->get_inf(id);
WFIFOW(fd,p+6) = g->skill[i].lv;
- WFIFOW(fd,p+8) = skill->get_sp(id, g->skill[i].lv);
- WFIFOW(fd,p+10) = skill->get_range(id, g->skill[i].lv);
+ if ( g->skill[i].lv ) {
+ WFIFOW(fd, p + 8) = skill->get_sp(id, g->skill[i].lv);
+ WFIFOW(fd, p + 10) = skill->get_range(id, g->skill[i].lv);
+ } else {
+ WFIFOW(fd, p + 8) = 0;
+ WFIFOW(fd, p + 10) = 0;
+ }
safestrncpy((char*)WFIFOP(fd,p+12), skill->get_name(id), NAME_LENGTH);
WFIFOB(fd,p+36)= (g->skill[i].lv < guild->skill_get_max(id) && sd == g->member[0].sd) ? 1 : 0;
c++;
@@ -15678,8 +15686,13 @@ void clif_mercenary_skillblock(struct map_session_data *sd)
WFIFOW(fd,len) = id;
WFIFOL(fd,len+2) = skill->get_inf(id);
WFIFOW(fd,len+6) = md->db->skill[j].lv;
- WFIFOW(fd,len+8) = skill->get_sp(id, md->db->skill[j].lv);
- WFIFOW(fd,len+10) = skill->get_range2(&md->bl, id, md->db->skill[j].lv);
+ if ( md->db->skill[j].lv ) {
+ WFIFOW(fd, len + 8) = skill->get_sp(id, md->db->skill[j].lv);
+ WFIFOW(fd, len + 10) = skill->get_range2(&md->bl, id, md->db->skill[j].lv);
+ } else {
+ WFIFOW(fd, len + 8) = 0;
+ WFIFOW(fd, len + 10) = 0;
+ }
safestrncpy((char*)WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
WFIFOB(fd,len+36) = 0; // Skillable for Mercenary?
len += 37;
diff --git a/src/map/skill.c b/src/map/skill.c
index ba7465c0b..f44497d82 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11977,7 +11977,8 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
break;
default:
skill->attack(skill->get_type(sg->skill_id),ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
- sg->unit_id = UNT_USED_TRAPS;
+ if ( sg->interval == skill->get_time(sg->skill_id, sg->skill_lv) )
+ sg->unit_id = UNT_USED_TRAPS; // remove unit once it does its job once.
}
break;