summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-24 23:58:40 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-24 23:58:40 +0000
commitec3f633cdaa6b4b0661400d2bada620f58987916 (patch)
treee1592c145f65a804d507d4e83bec3f875e2057f9 /src/map/skill.c
parentea40b015cb26db701961714237380e2e64525ae7 (diff)
downloadhercules-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
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c23
1 files changed, 12 insertions, 11 deletions
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);