Exported function(s): ApplyRawDamage()/ApplyDamage()

Archive of the older Feature Request Forum Posts
Locked
User avatar
MontuZ
Forum Regular
Posts: 338
Joined: Fri Feb 10, 2006 8:08 am

Exported function(s): ApplyRawDamage()/ApplyDamage()

Post by MontuZ »

It's come to my attention that this is likely the only thing that can control how/when a player dies. I understand that this has come up in the past as a suggestion, I'm just posting again to get on your nerves =)

I'd also like to be able to create corpses without having to hook several packet, maybe; CreateCorpse(graphic, etc); returning a corpse_reference and being able to set a mobiles last corpse prop of course.
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Post by ncrsn »

Code: Select all

function ApplyRawDamageEX( who, damage )
    var hp := GetVital(who, "Life");
    
    var realdamage := damage * 100;
    
    if (hp <= realdamage)
        // Player will die. Do something?
    else
        // Default behaviour.
        ApplyRawDamage(who, damage);
    endif
endfunction

function ApplyDamageEX( who, damage )
    // Pick an armor.
    // Calculate a new damage.
    // Deal the damage.
    ApplyRawDamageEX(who, newdamage);
endfunction
Using functions like these instead of the EX-less core functions you can have your own "death hook" without any new core support. And if you wish to, also change the nature of death. Instead of damagehook I'd vote for otherwise complex or totally undoable things, like the creatable and customizable corpses, which you also mentioned.

Of course what I (or we) need or want does not change what we will or won't get.
Locked