Issue information

Issue ID
#452
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Nov 19, 2007 17:28
Last Post
Hercules Elf Bot
Nov 19, 2007 17:28
Confirmation
N/A

Hercules Elf Bot - Nov 19, 2007 17:28

Originally posted by [b]Skotlex[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=452

Skill castend id has this near the end of it, where there used to be a "skill_fail" message when ANY of the checks inside the do {} failed.
CODE
   ud->canact_tick = tick;
   //You can't place a skill failed packet here because it would be
   //sent in ALL cases, even cases where skill_check_condition fails
   //which would lead to double 'skill failed' messages u.u [Skotlex]
   if(sd) sd->skillitem = sd->skillitemlv = 0;
   else
   if(md) md->skillidx = -1;
   return 0;
}

However, skill_castend_pos does NOT has this warning/commented out thing:
CODE
   ud->canact_tick = tick;
   ud->skillid = ud->skilllv = 0;
   if(sd) {
      clif_skill_fail(sd,ud->skillid,0,0);
      sd->skillitem = sd->skillitemlv = 0;
   }
   else if (hd && hd->master)
      clif_skill_fail(hd->master, ud->skillid, 0, 0);
   else if(md)
      md->skillidx  = -1;
   return 0;

}


This leads to double "skill failed" messages whenever "skill_check_condition" invokes a "skill fail" message when it fails. This will happen when:
- You are overweight
- You do not have enough HP/SP/Zeny/spirit spheres
- You can;t summon more plants for cannibalize/sphere mine
- The skill state requirement fails
- Required materials are not met

There are many more skill fail messagesd inside skill_check_condition, but they will are not mentioned since they are for targetted skills.

What happens if we just remove that clif_skill_fail call near the end of skill_castend_pos? It means that when the skill fails for any of the following reasons, there will be no error message, just a silent fail:
- Caster is dead
- You can't place the skill because it overlaps on another skill that you can't cast over (unit flag for no overlapping)
- You can't place the skill because it overlaps with another player (unit flag for no foot set)
- status_check_skilluse fails (stuff like trying to use a skill while cursed/petrified/asleep, etc; even though if I remember correctly the default Aegis behaviour is that ground spells always come off when they are done casting)
- distance check fails (kinda irrelevant as the official config states unlimited range)

Therefore... we should probably delete the skill_fail message at the end of castend_pos, and add it to any of the previous cases where it actually triggers (would need Aegis testing to know in which of such cases the skill failed message shows). I will delete that extra "skill fail" message, and it is up to any testers out there to figure out if there should be any such messages printed for the previous check-list.