As of June 3rd, the specialeffect() command has been upgraded and it now allows to use effects on any kind of unit (player, npc, mob, homunculus, ...) and to show it to any player. This allowed us to deprecate specialeffect2() and misceffect() so now there is a single command for effects instead of 3 different ones, making things simpler for everyone. You can still use specialeffect2() and misceffect() but they will trigger a warning every time, since they will be removed in the future.
Here's how the updated specialeffect() command works:
specialeffect(effect number{, send target{, unit id{, account id ]}})
effect number is the effect to use.
see effect_list.txt for a list of all effects
send target is to whom the effect should be sent. The most common values are:
AREA will show the effect to every player in the area
SELF will show the effect to one player only
see constants.md for a list of possible send targets
unit id is the unit on which the effect should be centered
it can be a mob id, an account id, a npc id or the id of any other kind of unit
account id is the player to which the effect should be sent if SELF was specified as send target
To migrate from specialeffect2 to specialeffect:
specialeffect2(effect) ➜ specialeffect(effect, AREA, playerattached())
specialeffect2(effect, target, "player name") ➜ specialeffect(effect, target, getcharid(CHAR_ID_ACCOUNT, "player name"))
To migrate from misceffect to specialeffect:
Because the behaviour of this command varies depending on if the npc has a sprite or not, what you want is either one of the two:
misceffect(effect) ➜ specialeffect(effect)
misceffect(effect) ➜ specialeffect(effect, AREA, playerattached())