summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt11
-rw-r--r--src/map/clif.c12
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/skill.c23
-rw-r--r--src/map/unit.c11
5 files changed, 38 insertions, 21 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index e1b73f21c..235846603 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,17 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/11/13
+ * Volcano/Deluge/Violent Gale are now interchangeable, in the sense that
+ as long as one of these is out, casting any of the three will not consume
+ gems, and will use the remaining time of the previous one. In turn, Land
+ Protector will now always consume gems on every cast. [Skotlex]
+ * Small cleanup in the Land protector code which may fix it not blocking
+ AoE skills. [Skotlex]
+ * Fixed the interpretation of "head_dir". Removed setting head_dir to match
+ character direction in the whole code. Now it is only reset to 0 (look
+ forward) when unit_setpos is invoked, or when a character begins walking.
+ Thanks to FlavioJS for figuring out how the client parses the head
+ direction. [Skotlex]
* Moved status_calc_pc back to pc_authok. [Lance]
2006/11/11
* Fixed debug message in login_sql [KarLaeda]
diff --git a/src/map/clif.c b/src/map/clif.c
index 4a9dab5ed..e79b7f78e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -919,7 +919,7 @@ static int clif_set0078(struct block_list *bl, struct view_data *vd, unsigned ch
WBUFW(buf,28)=vd->head_mid;
WBUFW(buf,30)=vd->hair_color;
WBUFW(buf,32)=vd->cloth_color;
- WBUFW(buf,34)=sd?sd->head_dir:dir;
+ WBUFW(buf,34)=sd?sd->head_dir:0;
WBUFL(buf,36)=guild_id;
WBUFW(buf,40)=emblem_id;
if (sd) {
@@ -954,7 +954,7 @@ static int clif_set0078(struct block_list *bl, struct view_data *vd, unsigned ch
WBUFW(buf,26)=vd->head_mid;
WBUFW(buf,28)=vd->hair_color;
WBUFW(buf,30)=vd->cloth_color;
- WBUFW(buf,32)=sd?sd->head_dir:dir;
+ WBUFW(buf,32)=sd?sd->head_dir:0;
WBUFL(buf,34)=guild_id;
WBUFW(buf,38)=emblem_id;
if (sd) {
@@ -989,7 +989,7 @@ static int clif_set0078(struct block_list *bl, struct view_data *vd, unsigned ch
WBUFW(buf,26)=vd->head_mid;
WBUFW(buf,28)=vd->hair_color;
WBUFW(buf,30)=vd->cloth_color;
- WBUFW(buf,32)=sd?sd->head_dir:dir;
+ WBUFW(buf,32)=sd?sd->head_dir:0;
WBUFL(buf,34)=guild_id;
WBUFL(buf,38)=emblem_id;
if (sd)
@@ -1073,7 +1073,7 @@ static int clif_set007b(struct block_list *bl, struct view_data *vd, struct unit
WBUFW(buf,32)=vd->head_mid;
WBUFW(buf,34)=vd->hair_color;
WBUFW(buf,36)=vd->cloth_color;
- WBUFW(buf,38)=sd?sd->head_dir:unit_getdir(bl);
+ WBUFW(buf,38)=sd?sd->head_dir:0;
WBUFL(buf,40)=guild_id;
WBUFW(buf,44)=emblem_id;
if (sd) {
@@ -1110,7 +1110,7 @@ static int clif_set007b(struct block_list *bl, struct view_data *vd, struct unit
WBUFW(buf,30)=vd->head_mid;
WBUFW(buf,32)=vd->hair_color;
WBUFW(buf,34)=vd->cloth_color;
- WBUFW(buf,36)=sd?sd->head_dir:unit_getdir(bl);
+ WBUFW(buf,36)=sd?sd->head_dir:0;
WBUFL(buf,38)=guild_id;
WBUFW(buf,42)=emblem_id;
if (sd) {
@@ -1147,7 +1147,7 @@ static int clif_set007b(struct block_list *bl, struct view_data *vd, struct unit
WBUFW(buf,30)=vd->head_mid;
WBUFW(buf,32)=vd->hair_color;
WBUFW(buf,34)=vd->cloth_color;
- WBUFW(buf,36)=sd?sd->head_dir:unit_getdir(bl);
+ WBUFW(buf,36)=sd?sd->head_dir:0;
WBUFL(buf,38)=guild_id;
WBUFL(buf,42)=emblem_id;
if (sd)
diff --git a/src/map/map.h b/src/map/map.h
index 270cb549b..b9a21036f 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -623,7 +623,7 @@ struct map_session_data {
int fd;
unsigned short mapindex;
unsigned short prev_speed,prev_adelay;
- unsigned char head_dir;
+ unsigned char head_dir; //0: Look forward. 1: Look right, 2: Look left.
unsigned int client_tick;
int npc_id,areanpc_id,npc_shopid;
int npc_item_flag; //Marks the npc_id with which you can use items during interactions with said npc (see script command enable_itemuse)
diff --git a/src/map/skill.c b/src/map/skill.c
index e11fc54f0..98f11a2dd 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6577,8 +6577,13 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
{
struct skill_unit_group *old_sg;
if ((old_sg = skill_locate_element_field(src)) != NULL)
- {
- if (old_sg->skill_id == skillid && old_sg->limit > 0)
+ { //HelloKitty confirmed that these are interchangeable,
+ //so you can change element and not consume gemstones.
+ if ((
+ old_sg->skill_id == SA_VOLCANO ||
+ old_sg->skill_id == SA_DELUGE ||
+ old_sg->skill_id == SA_VIOLENTGALE
+ ) && old_sg->limit > 0)
{ //Use the previous limit (minus the elapsed time) [Skotlex]
limit = old_sg->limit - DIFF_TICK(gettick(), old_sg->tick);
if (limit < 0) //This can happen...
@@ -8204,14 +8209,18 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
case SA_DELUGE:
case SA_VOLCANO:
case SA_VIOLENTGALE:
- case SA_LANDPROTECTOR:
{ //Does not consumes if the skill is already active. [Skotlex]
struct skill_unit_group *sg;
- if ((sg= skill_locate_element_field(&sd->bl)) != NULL && sg->skill_id == skill)
- {
+ if ((sg= skill_locate_element_field(&sd->bl)) != NULL &&
+ (
+ sg->skill_id == SA_VOLCANO ||
+ sg->skill_id == SA_DELUGE ||
+ sg->skill_id == SA_VIOLENTGALE
+ )) {
if (sg->limit - DIFF_TICK(gettick(), sg->tick) > 0)
checkitem_flag = delitem_flag = 0;
- else sg->limit = 0; //Disable it.
+ else
+ sg->limit = 0; //Disable it.
}
break;
}
@@ -9940,7 +9949,7 @@ int skill_unit_timer_sub_onplace (struct block_list *bl, va_list ap)
nullpo_retr(0, group=unit->group);
- if (!skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP)
+ if (!(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP))
&& map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR))
return 0; //AoE skills are ineffective. [Skotlex]
diff --git a/src/map/unit.c b/src/map/unit.c
index 2f46a0d9c..2f908cecf 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -80,8 +80,10 @@ int unit_walktoxy_sub(struct block_list *bl)
ud->state.change_walk_target=0;
- if (bl->type == BL_PC)
+ if (bl->type == BL_PC) {
+ ((TBL_PC *)bl)->head_dir = 0;
clif_walkok((TBL_PC*)bl);
+ }
clif_move(bl);
if(ud->walkpath.path_pos>=ud->walkpath.path_len)
@@ -134,8 +136,6 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
dir = ud->walkpath.path[ud->walkpath.path_pos];
ud->dir = dir;
- if (sd)
- sd->head_dir = dir;
dx = dirx[(int)dir];
dy = diry[(int)dir];
@@ -341,7 +341,6 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
sc = status_get_sc(bl);
if (sc && sc->count && sc->data[SC_CONFUSION].timer != -1) //Randomize the target position
map_random_dir(bl, &ud->to_x, &ud->to_y);
-
if(ud->walktimer != -1) {
ud->state.change_walk_target = 1;
@@ -435,7 +434,6 @@ int unit_movepos(struct block_list *bl,int dst_x,int dst_y, int easy, int checkp
dir = map_calc_dir(bl, dst_x,dst_y);
ud->dir = dir;
- if(sd) sd->head_dir = dir;
dx = dst_x - bl->x;
dy = dst_y - bl->y;
@@ -486,7 +484,7 @@ int unit_setdir(struct block_list *bl,unsigned char dir)
if (!ud) return 0;
ud->dir = dir;
if (bl->type == BL_PC)
- ((TBL_PC *)bl)->head_dir = dir;
+ ((TBL_PC *)bl)->head_dir = 0;
clif_changed_dir(bl, AREA);
return 0;
}
@@ -1336,7 +1334,6 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
if (battle_config.attack_direction_change &&
(src->type&battle_config.attack_direction_change)) {
ud->dir = map_calc_dir(src, target->x,target->y );
- if (sd) sd->head_dir = ud->dir;
}
if(ud->walktimer != -1)
unit_stop_walking(src,1);