Author Topic: Changing player datablock's max health with events?  (Read 1864 times)

Can it be done? Would it require client sided add-ons?

Changing a datablock's health with events?
Easily possible, but it would affect every player using that datablock.

Changing a datablock's health with events?
Easily possible, but it would affect every player using that datablock.
Maximum health and I'm looking for something that changes it individually for one person. Not for everyone using the datablock.

You can't change a single player's datablock without it affecting every other person using that same datablock... As crab has said..

What about a damageReduction player variable, and then package onDamage to deal less damage based on the variable?

I saw this done in such a way that it worked exactly the same as changing a players max health. I forgot who posted it, or where they posted it

What about a damageReduction player variable, and then package onDamage to deal less damage based on the variable?

I saw this done in such a way that it worked exactly the same as changing a players max health. I forgot who posted it, or where they posted it

Lol yes, or overwrite the damage functions and create new ones D:  :cookieMonster:

What about a damageReduction player variable, and then package onDamage to deal less damage based on the variable?

I saw this done in such a way that it worked exactly the same as changing a players max health. I forgot who posted it, or where they posted it
Yes that would work too. In fact. That would be even better. It would work like armor. Can this be done? The reduction should be in percentages.

package damagePack
{
   function Player::damage(%damaged, %damager, %pos, %damageInflicted, %damage, %damageType)
   {
      //blah? alter the %damageInflicted if the player is a player or something?
   
      Parent::damage(%damaged, %damager, %pos, %damageInflicted, %damage, %damageType);
   }
};

activatePackage(damagePack);

Something like that hopefully.

Yes that would work too. In fact. That would be even better. It would work like armor. Can this be done? The reduction should be in percentages.
I saw code here before that did exactly what you want, but I forgot who posted it and exactly where it was posted.


EDIT : Found it
http://forum.blockland.us/index.php?topic=158593.msg3828480#msg3828480

So basically something like

Code: [Select]
package fakeMaxHP
{
    function Player::damage(this,%obj,%pos,%damage,%damageType)
    {
        %damage = %damage / (%player.fakeMaxHP / 100);
        Parent::damage(%this,%obj,%pos,%damage,%damageType);
    }
};
ActivatePackage(fakeMaxHP);

With an event to set %player.fakeMaxHP, of course.
« Last Edit: July 28, 2011, 05:22:34 PM by Headcrab Zombie »