HerculesWS / Hercules

Hercules is a collaborative software development project revolving around the creation of a robust massively multiplayer online role playing game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. Hercules is a continuation of the original Athena project.
http://herc.ws
GNU General Public License v3.0
892 stars 757 forks source link

RG_GRAFFITI wipes all ground skills of caster #1278

Open theultramage opened 8 years ago

theultramage commented 8 years ago
int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
...
        case RG_GRAFFITI:
            skill->clear_unitgroup(src); // <-- deletes all units of caster
            skill->unitsetting(src,skill_id,skill_lv,x,y,0); // <-- places new unit

This is ancient, pre-r1-eaSVN code. It is a very poor way of ensuring the caster can only have one scribbled text on the ground at a time. A more appropriate way might be to adapt skill_graffitiremover(), or perhaps to scan through sd->skillunit[] and remove the old unit.

On Aegis it seems that trying to place a second graffiti on the floor will succeed, but do nothing.

I've looked into this recently because I've been told that people were abusing that RG_GRAFFITI code with chaser's SC_MANHOLE. Normally you can't stack them to keep the target trapped indefinitely (but you can still spam-cast, so meh). But because the status doesn't immediately end when the ground unit goes away (unlike ankle snare), you can alternate casting manhole and graffiti to pull this off.

AnisotropicDefixation commented 8 years ago

Well, that code is from the pre-renewal times when the class didn't have any other unit skills so it makes sense, needs updating though.

macabu commented 7 years ago

Just following it up. This commit https://github.com/rathena/rathena/commit/4c617bcd598fe1b5ea8b8e1e6276ee62b7d19143 fixes the bug.
Currently like ultramage said, if you use Manhole and Graffiti after, the Manhole will disappear but the effect will still linger and you can re-cast Manhole in a cell next to where Manhole was, effectively perma-trapping a player. Also re-casting Graffiti will remove the previous and replace it with another. But you shouldn't be able to as well.

I recorded a video of the bug: https://www.youtube.com/watch?v=L2vBgHElsgg Fixed with rathena commit: https://www.youtube.com/watch?v=7oFsa-i_m5I (don't mind the pc audio didn't realize it was being recorded :thinking: )