Sign in to follow this  
Followers 0
Beret

Effect State refactoring

4 posts in this topic

Currently all eathena based emulators work the effect state incorrectly. In hercules uses two enumerations one for effects other for icons.

This is totally wrong, in the official there is only an enumeration for the state of effects that are those of skills such as blessing. This enumeration is the same present in the lua files.

With this proposed change SI_ enumeration must be removed and the client itself will recognize and apply the icon according to the effect state ID.

the enumeration of effects states currently contains effects that should be used in another enumeration, they are.

 SC_STONE = 0,
 SC_COMMON_MIN = 0, // begin
 SC_FREEZE,
 SC_STUN,
 SC_SLEEP,
 SC_POISON,
 SC_CURSE,
 SC_SILENCE,
 SC_CONFUSION,
 SC_BLIND,
 SC_BLOODING,
 SC_DPOISON, //10
 SC_FEAR,
 SC_COLD,
 SC_BURNING,
 SC_DEEP_SLEEP,
 SC_COMMON_MAX = 14, // end

In aegis, these effects are worked on in another type of enumeration, because they do not have icons, see below the enumeration of aegis.

typedef enum <unnamed-tag> {  
  BODY_STONECURSE =  0x1,
  BODY_FREEZING =  0x2,
  BODY_STUN =  0x3,
  BODY_SLEEP =  0x4,
  BODY_UNDEAD =  0x5,
  HEALTH_POISON =  0x6,
  HEALTH_CURSE =  0x7,
  HEALTH_SILENCE =  0x8,
  HEALTH_CONFUSION =  0x9,
  HEALTH_BLIND =  0xa,
  HEALTH_HEAVYPOISON =  0xb,
  HEALTH_BLOODING =  0xc,
  EFFECT_ENDURE =  0xd,
  EFFECT_HASTE =  0xe,
  EFFECT_HASTEATTACK =  0xf,
  EFFECT_SLOW_POTION =  0x10,
  EFFECT_HASTE_POTION =  0x11,
  EFFECT_SANTA =  0x12,
  EFFECT_ANGELUS =  0x13,
  EFFECT_PUSHCART =  0x14,
  EFFECT_CONCENTRATE =  0x15,
  EFFECT_HIDE =  0x16,
  EFFECT_WEDDING =  0x17,
  EFFECT_PLUSATTACKPOWER =  0x18,
  EFFECT_PLUSMAGICPOWER =  0x19,
  EFFECT_CLAIRVOYANCE =  0x1a,
  EFFECT_HASTE_HORSE =  0x1b,
  EFFECT_SUMMER =  0x1c,
  HEALTH_FEAR =  0x1d,
  BODY_BURNNING =  0x1e,
  BODY_IMPRISON =  0x1f,
  HANDICAPSTATE_DEEPSLEEP =  0x20,
  HANDICAPSTATE_FROSTMISTY =  0x21,
  HANDICAPSTATE_COLD =  0x22,
  HANDICAPSTATE_NORECOVER =  0x23,
  EFFECT_HASTEATTACK_CASH =  0x24,
  HANDICAPSTATE_ICEEXPLO =  0x25,
  HANDICAPSTATE_ILLUSION =  0x26,
  EFFECT_HANBOK =  0x27,
  STATE_ENUM_END_MARK =  0x28,
} <unnamed-tag>;

So my suggestion is the separation of these effects and removal of the enumeration of the icons, since the enumeration of the effects must be the same present in the efstids.lua file, this makes the icon already recognized only using an enumeration and not two as we do today

Share this post


Link to post
Share on other sites

There's no point at all of doing that, it was designed this way to save memory that would happen due to any waste in IDs (which is an usual act from Gravity), not only it saves memory it also reduce the time spent in looping the status changes.

Share this post


Link to post
Share on other sites
4 hours ago, hemagx said:

There's no point at all of doing that, it was designed this way to save memory that would happen due to any waste in IDs (which is an usual act from Gravity), not only it saves memory it also reduce the time spent in looping the status changes.

But there's no reason for you to use 2 enumerations to create a effect state. The SI enumeration only exists for the correction of the incorrect value of the SC enumeration.

Share this post


Link to post
Share on other sites

You will lose the ability to map existing SIs to custom SC if you migrate to Aegis’ model. (or perhaps you can add an additional custom SI field in the EFST data struct) It’s fine as is, as long as adding a new SC isn’t a pain in the ass and the information sent to the client is correct.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0