diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-07-23 17:58:54 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-07-23 17:58:54 +0000 |
commit | 6619e19b58fff810cdebc8e00c83a1b5c261214d (patch) | |
tree | ab99022cb2d793dd412e4d239bb9aa2a9a334f51 /src/map | |
parent | 212c7b263c822dc1850823a88228d331e6092afc (diff) | |
download | hercules-6619e19b58fff810cdebc8e00c83a1b5c261214d.tar.gz hercules-6619e19b58fff810cdebc8e00c83a1b5c261214d.tar.bz2 hercules-6619e19b58fff810cdebc8e00c83a1b5c261214d.tar.xz hercules-6619e19b58fff810cdebc8e00c83a1b5c261214d.zip |
* Changed the restricting mapflag for @jump from nowarp/nowarpto to noteleport
* Simplified the mapindex code a bit
* Changed clif_skill_warppoint() so that now the '.gat' adding happens inside and doesn't have to be handled by the calling code
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10901 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 20 | ||||
-rw-r--r-- | src/map/clif.h | 3 | ||||
-rw-r--r-- | src/map/skill.c | 35 |
4 files changed, 26 insertions, 34 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index ccd5b37ed..32541b9c4 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1357,7 +1357,7 @@ int atcommand_jump(const int fd, struct map_session_data* sd, const char* comman x = -1; if (y <= 0) y = -1; - if (sd->bl.m >= 0 && (map[sd->bl.m].flag.nowarp || map[sd->bl.m].flag.nowarpto) && battle_config.any_warp_GM_min_level > pc_isGM(sd)) { + if (sd->bl.m >= 0 && map[sd->bl.m].flag.noteleport && battle_config.any_warp_GM_min_level > pc_isGM(sd)) { clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } diff --git a/src/map/clif.c b/src/map/clif.c index 72295dc4c..df5e16532 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4656,22 +4656,24 @@ int clif_skill_delunit(struct skill_unit *unit) /*========================================== * ワープ場所選択 *------------------------------------------*/ -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 clif_skill_warppoint(struct map_session_data* sd, int skill_num, int skill_lv, int map1, int map2, int map3, int map4) { int fd; nullpo_retr(0, sd); + fd = sd->fd; - fd=sd->fd; WFIFOHEAD(fd,packet_len(0x11c)); - WFIFOW(fd,0)=0x11c; - WFIFOW(fd,2)=skill_num; - strncpy((char*)WFIFOP(fd, 4),map1,MAP_NAME_LENGTH_EXT); - strncpy((char*)WFIFOP(fd,20),map2,MAP_NAME_LENGTH_EXT); - strncpy((char*)WFIFOP(fd,36),map3,MAP_NAME_LENGTH_EXT); - strncpy((char*)WFIFOP(fd,52),map4,MAP_NAME_LENGTH_EXT); + WFIFOW(fd,0) = 0x11c; + WFIFOW(fd,2) = skill_num; + memset(WFIFOP(fd,4), 0x00, 4*MAP_NAME_LENGTH_EXT); + if (map1 == -1) strcpy((char*)WFIFOP(fd, 4), "Random"); + if (map1 > 0) snprintf((char*)WFIFOP(fd, 4), MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(map1)); + if (map2 > 0) snprintf((char*)WFIFOP(fd,20), MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(map2)); + if (map3 > 0) snprintf((char*)WFIFOP(fd,36), MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(map3)); + if (map4 > 0) snprintf((char*)WFIFOP(fd,52), MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(map4)); WFIFOSET(fd,packet_len(0x11c)); + sd->menuskill_id = skill_num; if (skill_num == AL_WARP) sd->menuskill_lv = (sd->ud.skillx<<16)|sd->ud.skilly; //Store warp position here. diff --git a/src/map/clif.h b/src/map/clif.h index 159c1546a..4f35818cc 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -191,8 +191,7 @@ int clif_skill_nodamage(struct block_list *src,struct block_list *dst, int clif_skill_poseffect(struct block_list *src,int skill_id, int val,int x,int y,int tick); int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst); -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 clif_skill_warppoint(struct map_session_data* sd, int skill_num, int skill_lv, int map1, int map2, int map3, int map4); int clif_skill_memo(struct map_session_data *sd,int flag); int clif_skill_teleportmessage(struct map_session_data *sd,int flag); int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger); diff --git a/src/map/skill.c b/src/map/skill.c index 1f609117d..0f95a0f7b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4436,7 +4436,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case AL_TELEPORT: - if(sd) { + if(sd) + { if (map[bl->m].flag.noteleport) { clif_skill_teleportmessage(sd,0); break; @@ -4448,21 +4449,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_skill_nodamage(src,bl,skillid,skilllv,1); if(skilllv == 1) { // possibility to skip menu [LuzZza] - if(!battle_config.skip_teleport_lv1_menu && - sd->skillitem != AL_TELEPORT) //If skillid is not teleport, this was auto-casted! [Skotlex] - clif_skill_warppoint(sd,skillid,skilllv,"Random","","",""); + if(!battle_config.skip_teleport_lv1_menu && sd->skillitem != AL_TELEPORT) + clif_skill_warppoint(sd,skillid,skilllv, -1,0,0,0); else pc_randomwarp(sd,3); } else { if (sd->skillitem != AL_TELEPORT) - { - char save_map[MAP_NAME_LENGTH_EXT]; - snprintf(save_map, MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(sd->status.save_point.map)); - clif_skill_warppoint(sd,skillid,skilllv,"Random",save_map,"",""); - } + clif_skill_warppoint(sd,skillid,skilllv, -1,sd->status.save_point.map,0,0); else //Autocasted Teleport level 2?? - pc_setpos(sd,sd->status.save_point.map, - sd->status.save_point.x,sd->status.save_point.y,3); + pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3); } } else unit_warp(bl,-1,-1,-1,3); @@ -6111,17 +6106,13 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s break; case AL_WARP: - if(sd) { - char memo[4][MAP_NAME_LENGTH_EXT] = {"", "", "", ""}; - snprintf(memo[0], MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(sd->status.save_point.map)); - if (skilllv>1 && sd->status.memo_point[0].map) - snprintf(memo[1], MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(sd->status.memo_point[0].map)); - if (skilllv>2 && sd->status.memo_point[1].map) - snprintf(memo[2], MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(sd->status.memo_point[1].map)); - if (skilllv>3 && sd->status.memo_point[2].map) - snprintf(memo[3], MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(sd->status.memo_point[2].map)); - - clif_skill_warppoint(sd,skillid,skilllv, memo[0],memo[1],memo[2],memo[3]); + if(sd) + { + clif_skill_warppoint(sd, skillid, skilllv, sd->status.save_point.map, + (skilllv >= 2) ? sd->status.memo_point[0].map : 0, + (skilllv >= 3) ? sd->status.memo_point[1].map : 0, + (skilllv >= 4) ? sd->status.memo_point[1].map : 0 + ); } break; |