Jump to content

ESTATE / Status Effect system compared to Horizon


Sephus

Recommended Posts

So the ESTATE system in Aegis (official servers) is what is responsible for modifying your status changes in combat or during game play in the world. I've noticed that they simply push a status modification into a vector and iterate over it to calculate the total status values per second. While it is effective, it was badly coded I had noticed. In Horizon I have rectified this system and made it super effective in code.

Screenshot_2024-09-01_104213.png?ex=66fb

In Aegis the code is called when status effect is set, and when the reset is complete. Similarly in Horizon have implemented periodic changes to statuses so simply that it can be coded in one line of code -

current_hp()->add_periodic_change(
        s_attribute_change_values(hp_regeneration()->total(), 0, 0, hp_minmax, [player, this]() {
                player->get_session()->clif()->notify_recovery(ZC_NOTIFY_RECOVERY_HP, this->hp_regeneration()->total());
        }), 
        0,
        player->map()->container()->game_config().get_natural_heal_hp_interval(), 
        "natural_hp_regen");

The above line induces a natural status recovery for a total of hp_regeneration value. For a total of hp_minmax. And updates the client. For an infinite duration and with an interval of `get_natural_heal_hp_interval`. The status is saved as "natural_hp_regen" and works internall with statuses in Horizon.

Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...