summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-21 15:59:38 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-21 15:59:38 +0000
commita102b2dffb9365116701f99c0dcc486a74cbc073 (patch)
treef48c32f5ee7c056fa4eb9675b33c69b574cfee1d /src/map/skill.c
parent6a71c68fd365d0b7e91fe89a2d02296ef465a720 (diff)
downloadhercules-a102b2dffb9365116701f99c0dcc486a74cbc073.tar.gz
hercules-a102b2dffb9365116701f99c0dcc486a74cbc073.tar.bz2
hercules-a102b2dffb9365116701f99c0dcc486a74cbc073.tar.xz
hercules-a102b2dffb9365116701f99c0dcc486a74cbc073.zip
- Some fine-tuning of the warp portal code which prevents it from messing up other skills if you "precast" it.
- Fixed the weapon refine code using sd->skillid instead of sd->menuskill_id - Fixed some npc_event error reports (three error where displaying at the exact same msg, making it impossible to tell which one of the three actually happened) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5356 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 33fa365bc..ced58c325 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5730,8 +5730,10 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data )
status_change_end(&sd->bl,SC_MAGICPOWER,-1);
//Clean this up for future references to battle_getcurrentskill. [Skotlex]
- sd->skillid = sd->skilllv = -1;
- sd->skilltarget = 0;
+ if (sd->skilltimer == -1) {
+ sd->skillid = sd->skilllv = -1;
+ sd->skilltarget = 0;
+ }
return 0;
#undef skill_failed
}
@@ -5831,8 +5833,10 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data )
skill_castend_pos2(&sd->bl,sd->skillx,sd->skilly,sd->skillid,sd->skilllv,tick,0);
- if (sd->skillid != AL_WARP)
- sd->skillid = sd->skilllv = -1; //Clean this up for future references to battle_getcurrentskill. [Skotlex]
+ //Clean this up for future references to battle_getcurrentskill. [Skotlex]
+ if (sd->skilltimer == -1) {
+ sd->skillid = sd->skilllv = -1;
+ }
return 0;
#undef skill_failed
}
@@ -6143,7 +6147,7 @@ int skill_castend_map( struct map_session_data *sd,int skill_num, const char *ma
nullpo_retr(0, sd);
//Simplify skill_failed code.
-#define skill_failed(sd) { sd->skillid = sd->skilllv = sd->skillitem = sd->skillitemlv = -1; sd->menuskill_id = sd->menuskill_lv = 0; }
+#define skill_failed(sd) { sd->menuskill_id = sd->menuskill_lv = 0; }
if( sd->bl.prev == NULL || pc_isdead(sd) )
return 0;
@@ -6242,17 +6246,22 @@ int skill_castend_map( struct map_session_data *sd,int skill_num, const char *ma
skill_failed(sd);
return 0;
}
- //FIXME: What is gonna be done in the case other skills are being used
- //in the middle of this block of code? Something more robust needs be
- //figured out. And what about when you use another ground skill? skillx
+ //FIXME: What about when you use another ground skill? skillx
//and skilly are messed up already... [Skotlex]
+ i = sd->skillid;
+ lv = sd->skilllv;
sd->skillid = sd->menuskill_id;
sd->skilllv = sd->menuskill_lv;
- if(!skill_check_condition(sd,3))
+ if(!skill_check_condition(sd,3)) //This checks versus skillid/skilllv...
{
+ sd->skillid = i;
+ sd->skilllv = lv;
skill_failed(sd);
return 0;
}
+ sd->skillid = i;
+ sd->skilllv = lv;
+ lv = sd->menuskill_lv;
if(skill_check_unit_range2(&sd->bl,sd->bl.m,sd->skillx,sd->skilly,skill_num,lv) > 0) {
clif_skill_fail(sd,0,0,0);
@@ -9049,11 +9058,11 @@ void skill_weaponrefine(struct map_session_data *sd,int idx)
item = &sd->status.inventory[idx];
if(item->nameid > 0 && ditem->type == 4) {
- if (item->refine >= sd->skilllv ||
+ if (item->refine >= sd->menuskill_lv ||
item->refine >= MAX_REFINE || // if it's no longer refineable
ditem->flag.no_refine || // if the item isn't refinable
(i = pc_search_inventory(sd, material [ditem->wlv])) < 0 ) { //fixed by Lupus (item pos can be = 0!)
- clif_skill_fail(sd,sd->skillid,0,0);
+ clif_skill_fail(sd,sd->menuskill_id,0,0);
return;
}