diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-24 23:58:40 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-24 23:58:40 +0000 |
commit | ec3f633cdaa6b4b0661400d2bada620f58987916 (patch) | |
tree | e1592c145f65a804d507d4e83bec3f875e2057f9 | |
parent | ea40b015cb26db701961714237380e2e64525ae7 (diff) | |
download | hercules-ec3f633cdaa6b4b0661400d2bada620f58987916.tar.gz hercules-ec3f633cdaa6b4b0661400d2bada620f58987916.tar.bz2 hercules-ec3f633cdaa6b4b0661400d2bada620f58987916.tar.xz hercules-ec3f633cdaa6b4b0661400d2bada620f58987916.zip |
- Fixed Warp Portal.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5740 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/map/clif.c | 7 | ||||
-rw-r--r-- | src/map/map.h | 1 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 23 |
5 files changed, 19 insertions, 15 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 15dac6cec..f682296a5 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/24
+ * Fixed Warp Portal. [Skotlex] * Modified script commands atcommand/charcommand to execute even if there isn't a player attached. They'll use a dummy player data with the same position/name as the script's owner (usually an npc). Be careful when using diff --git a/src/map/clif.c b/src/map/clif.c index 3f9e5e6c4..dd95009d8 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5353,7 +5353,7 @@ int clif_skill_delunit(struct skill_unit *unit) * ワープ場所選択
*------------------------------------------
*/
-int clif_skill_warppoint(struct map_session_data *sd,int skill_num, int skill_lv,
+int clif_skill_warppoint(struct map_session_data *sd,int skill_num,int skill_lv,
const char *map1,const char *map2,const char *map3,const char *map4)
{
int fd;
@@ -5370,7 +5370,10 @@ int clif_skill_warppoint(struct map_session_data *sd,int skill_num, int skill_lv strncpy((char*)WFIFOP(fd,52),map4,MAP_NAME_LENGTH);
WFIFOSET(fd,packet_len_table[0x11c]);
sd->menuskill_id = skill_num;
- sd->menuskill_lv = skill_lv;
+ if (skill_num == AL_WARP)
+ sd->menuskill_lv = (sd->ud.skillx<<16)|sd->ud.skilly; //Store warp position here.
+ else
+ sd->menuskill_lv = skill_lv;
return 0;
}
/*==========================================
diff --git a/src/map/map.h b/src/map/map.h index b80f6f295..633c7d5da 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -507,7 +507,6 @@ struct map_session_data { int cart_weight,cart_max_weight,cart_num,cart_max_num;
int fd;
unsigned short mapindex;
- short to_x,to_y;
short speed,prev_speed;
unsigned char head_dir;
unsigned int client_tick,server_tick;
diff --git a/src/map/pc.c b/src/map/pc.c index 75ce05530..d76f83337 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3226,7 +3226,7 @@ int pc_walktodir(struct map_session_data *sd,int step) to_x += dir_x;
to_y += dir_y;
}
- unit_walktoxy(&sd->bl, sd->to_x, sd->to_y, 1);
+ unit_walktoxy(&sd->bl, to_x, to_y, 1);
return 1;
}
diff --git a/src/map/skill.c b/src/map/skill.c index dd30b56f5..4a6032d2b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6153,7 +6153,7 @@ int skill_castend_map( struct map_session_data *sd,int skill_num, const char *ma {
const struct point *p[4];
struct skill_unit_group *group;
- int i, lv;
+ int i, lv, wx, wy;
int maxcount=0;
unsigned short mapindex;
mapindex = mapindex_name2id((char*)map);
@@ -6178,7 +6178,11 @@ int skill_castend_map( struct map_session_data *sd,int skill_num, const char *ma return 0;
}
}
- lv = sd->menuskill_lv;
+
+ lv = sd->skillitem==skill_num?sd->menuskill_lv:pc_checkskill(sd,skill_num);
+ wx = sd->menuskill_lv>>16;
+ wy = sd->menuskill_lv&0xffff;
+
if(lv <= 0) return 0;
for(i=0;i<lv;i++){
if(mapindex == p[i]->map){
@@ -6191,28 +6195,25 @@ int skill_castend_map( struct map_session_data *sd,int skill_num, const char *ma skill_failed(sd);
return 0;
}
- //FIXME: What about when you use another ground skill? skillx
- //and skilly are messed up already... [Skotlex]
- if(!skill_check_condition(sd, sd->menuskill_id, sd->menuskill_lv,3)) //This checks versus skillid/skilllv...
+
+ if(!skill_check_condition(sd, sd->menuskill_id, lv,3)) //This checks versus skillid/skilllv...
{
skill_failed(sd);
return 0;
}
- if(skill_check_unit_range2(&sd->bl,sd->bl.m,sd->ud.skillx,sd->ud.skilly,skill_num,lv) > 0) {
+ if(skill_check_unit_range2(&sd->bl,sd->bl.m,wx,wy,skill_num,lv) > 0) {
clif_skill_fail(sd,0,0,0);
skill_failed(sd);
return 0;
}
- if((group=skill_unitsetting(&sd->bl,skill_num,lv,sd->ud.skillx,sd->ud.skilly,0))==NULL) {
+ if((group=skill_unitsetting(&sd->bl,skill_num,lv,wx,wy,0))==NULL) {
skill_failed(sd);
return 0;
}
//Now that there's a mapindex, use that in val3 rather than a string. [Skotlex]
- group->val3 = mapindex;
-// group->valstr=(char *)aCallocA(MAP_NAME_LENGTH,sizeof(char));
-// memcpy(group->valstr,map,MAP_NAME_LENGTH-1);
group->val2=(x<<16)|y;
+ group->val3 = mapindex;
}
break;
}
@@ -6572,7 +6573,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int if(bl->type==BL_PC){
struct map_session_data *sd = (struct map_session_data *)bl;
if((!sd->chatID || battle_config.chat_warpportal)
- && sd->to_x == src->bl.x && sd->to_y == src->bl.y) {
+ && sd->ud.to_x == src->bl.x && sd->ud.to_y == src->bl.y) {
if (pc_setpos(sd,sg->val3,sg->val2>>16,sg->val2&0xffff,3) == 0) {
if (--sg->val1<=0 || sg->src_id == bl->id)
skill_delunitgroup(sg);
|