summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c14
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/skill.c12
-rw-r--r--src/map/unit.c4
6 files changed, 16 insertions, 22 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 8f6fa41ac..1c7e37392 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3171,7 +3171,7 @@ ACMD_FUNC(questskill)
return -1;
}
- if (skill_id < 0 && skill_id >= MAX_SKILL_DB) {
+ if (skill_id >= MAX_SKILL_DB) {
clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
return -1;
}
@@ -3215,7 +3215,7 @@ ACMD_FUNC(lostskill)
return -1;
}
- if (skill_id < 0 && skill_id >= MAX_SKILL) {
+ if (skill_id >= MAX_SKILL) {
clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
return -1;
}
@@ -5416,13 +5416,13 @@ ACMD_FUNC(useskill)
char target[100];
nullpo_retr(-1, sd);
- if(!message || !*message || sscanf(message, "%hui %hui %23[^\n]", &skill_id, &skill_lv, target) != 3) {
+ if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
clif_displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
return -1;
}
- if ( (pl_sd = map_nick2sd(target)) == NULL )
- {
+ if(!strcmp(target,"self")) pl_sd = sd; //quick keyword
+ else if ( (pl_sd = map_nick2sd(target)) == NULL ){
clif_displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
@@ -5460,7 +5460,7 @@ ACMD_FUNC(displayskill)
uint16 skill_lv = 1;
nullpo_retr(-1, sd);
- if (!message || !*message || sscanf(message, "%hui %hui", &skill_id, &skill_lv) < 1)
+ if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1)
{
clif_displaymessage(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>}
return -1;
@@ -5486,7 +5486,7 @@ ACMD_FUNC(skilltree)
struct skill_tree_entry *ent;
nullpo_retr(-1, sd);
- if(!message || !*message || sscanf(message, "%hui %23[^\r\n]", &skill_id, target) != 2) {
+ if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) {
clif_displaymessage(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target>
return -1;
}
diff --git a/src/map/battle.c b/src/map/battle.c
index d6bcc6060..87f1e7196 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5846,7 +5846,7 @@ static const struct _battle_data {
{ "max_third_parameter", &battle_config.max_third_parameter, 120, 10, 10000, },
{ "max_baby_third_parameter", &battle_config.max_baby_third_parameter, 108, 10, 10000, },
{ "atcommand_max_stat_bypass", &battle_config.atcommand_max_stat_bypass, 0, 0, 100, },
- { "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 100 },
+ { "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 300 },
{ "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1 },
{ "feature.atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 },
{ "min_npc_vending_distance", &battle_config.min_npc_vending_distance, 3, 0, 100 },
diff --git a/src/map/clif.c b/src/map/clif.c
index 2199bf12a..4b5e34232 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5257,7 +5257,7 @@ void clif_skill_produce_mix_list(struct map_session_data *sd, uint16 skill_id ,
for(i=0,c=0;i<MAX_SKILL_PRODUCE_DB;i++){
if( skill_can_produce_mix(sd,skill_produce_db[i].nameid, trigger, 1) &&
- ( ( skill_id > 0 && skill_produce_db[i].req_skill == skill_id ) || skill_id < 0 )
+ ( skill_id > 0 && skill_produce_db[i].req_skill == skill_id )
){
if((view = itemdb_viewid(skill_produce_db[i].nameid)) > 0)
WFIFOW(fd,c*8+ 4)= view;
diff --git a/src/map/pc.c b/src/map/pc.c
index 3af065db8..c7d5b87f0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4882,7 +4882,7 @@ int pc_checkskill(struct map_session_data *sd,uint16 skill_id)
return guild_checkskill(g,skill_id);
return 0;
}
- else if( skill_id < 0 || skill_id >= ARRAYLENGTH(sd->status.skill) )
+ else if(skill_id >= ARRAYLENGTH(sd->status.skill) )
{
ShowError("pc_checkskill: Invalid skill id %d (char_id=%d).\n", skill_id, sd->status.char_id);
return 0;
@@ -5976,7 +5976,7 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id)
return 0;
}
- if( skill_id < 0 || skill_id >= MAX_SKILL )
+ if(skill_id >= MAX_SKILL )
return 0;
if( sd->status.skill_point > 0 &&
diff --git a/src/map/skill.c b/src/map/skill.c
index 918d10b53..d0319afb1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -524,7 +524,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
// allowing a skill to be cast. This is to prevent no-delay ACT files from spamming skills such as
// AC_DOUBLE which do not have a skill delay and are not regarded in terms of attack motion.
if( !sd->state.autocast && sd->skillitem != skill_id && sd->canskill_tick &&
- DIFF_TICK(gettick(), sd->canskill_tick) < (sd->battle_status.amotion * (100 + battle_config.skill_amotion_leniency) / 100) )
+ DIFF_TICK(gettick(), sd->canskill_tick) < (sd->battle_status.amotion * (battle_config.skill_amotion_leniency) / 100) )
{// attempted to cast a skill before the attack motion has finished
return 1;
}
@@ -724,7 +724,6 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
nullpo_ret(src);
nullpo_ret(bl);
- if(skill_id < 0) return 0;
if(skill_id > 0 && skill_lv <= 0) return 0; // don't forget auto attacks! - celest
if( dmg_lv < ATK_BLOCK ) // Don't apply effect if miss.
@@ -1746,7 +1745,6 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
nullpo_ret(src);
nullpo_ret(bl);
- if(skill_id < 0) return 0;
if(skill_id > 0 && skill_lv <= 0) return 0; // don't forget auto attacks! - celest
sd = BL_CAST(BL_PC, src);
@@ -3724,10 +3722,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else if( dir == 7 || dir < 2 ) y = i;
else y = 0;
if( (mbl == src || !map_flag_gvg(src->m) && !map[src->m].flag.battleground) && // only NJ_ISSEN don't have slide effect in GVG
- unit_movepos(src, mbl->x+x, mbl->y+y, 1, 1) ) {
+ unit_movepos(src, mbl->x+x, mbl->y+y, 1, 1) ) {
clif_slide(src, src->x, src->y);
//uncomment this if you want to remove MO_EXTREMITYFIST glitchy walking effect. [malufett]
- //clif_fixpos(src);
+ //clif_fixpos(src);
}
}
break;
@@ -7823,7 +7821,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( src == bl ) rate = 100; // Success Chance: On self, 100%
else if(bl->type == BL_PC) rate += 20 + 10 * skill_lv; // On Players, (20 + 10 * Skill Level) %
else rate += 40 + 10 * skill_lv; // On Monsters, (40 + 10 * Skill Level) %
-
+
if( sd )
skill_blockpc_start(sd,skill_id,4000);
@@ -9355,7 +9353,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
#endif
}
if (target && target->m == src->m)
- { //Move character to target anyway.
+ { //Move character to target anyway.
if (unit_movepos(src, src->x+3, src->y+3, 1, 1))
{ //Display movement + animation.
clif_slide(src,src->x,src->y);
diff --git a/src/map/unit.c b/src/map/unit.c
index 110fcb079..eb8eac589 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -866,8 +866,6 @@ int unit_stop_walking(struct block_list *bl,int type)
int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv)
{
- if(skill_id < 0) return 0;
-
return unit_skilluse_id2(
src, target_id, skill_id, skill_lv,
skill_castfix(src, skill_id, skill_lv),
@@ -1368,8 +1366,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv)
{
- if(skill_id < 0)
- return 0;
return unit_skilluse_pos2(
src, skill_x, skill_y, skill_id, skill_lv,
skill_castfix(src, skill_id, skill_lv),