Jump to content

Fix regeneración de HP en monstruos


caanmasu

Recommended Posts

Hola

 

EDITADO: encontré una manera más sencilla. Poner un número muy grande en regen_cycle y el 1 en regen_percent. :v
Así haremos que cada 255 (es el máx) segundos regenere 1%

 

Sé que algunos ponen a veces eventos donde los mobs solo reciben 1 punto de daño por golpe y también sé que en el evento de attendance (cazajefes) el jefe no se recupera la vida hasta donde tengo entendido.

Este fix es para concretamente hacer que cuando pones en el mob_proto en el regen_percent un 0, no regenere la vida.

Digo esto porque todavía se sigue regenerando y la razón es porque en el código fuente hay una función que acota el rango de valores de 1 a x, siendo x el % de la regeneración. Solo debemos cambiar ese 1 por un 0.

 

char.cpp

Buscar este bloque:

EVENTFUNC(recovery_event)

Ir más bajo dentro del bloque y adaptar:

        if (!ch->IsDoor())
        {
#ifdef ENABLE_REGENPERCENT_0
            ch->MonsterLog("HP_REGEN +%d", MAX(0, (ch->GetMaxHP() * ch->GetMobTable().bRegenPercent) / 100));
            ch->PointChange(POINT_HP, MAX(0, (ch->GetMaxHP() * ch->GetMobTable().bRegenPercent) / 100));
#else
            ch->MonsterLog("HP_REGEN +%d", MAX(1, (ch->GetMaxHP() * ch->GetMobTable().bRegenPercent) / 100));
            ch->PointChange(POINT_HP, MAX(1, (ch->GetMaxHP() * ch->GetMobTable().bRegenPercent) / 100));
#endif
        }

 

Es opcional ponerle defines pero la idea es que entiendas que cuando se va a hacer el cambio de HP (aumentar en % por la reg) originalmente viene desde 1 hasta el regen_percent que hay en el mob_proto. Solo cambié el 1 por el 0. Solo de este modo se regenerará 0% cuando esté en 0 el regen_percent.

 

La condición del if indica que eso va a ocurrir en toda entidad caracter (mobs, metines, personajes, etc) menos puertas.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...