• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with conditions

yoiker

Member
Joined
Jan 21, 2012
Messages
194
Solutions
1
Reaction score
9
TFS 1.2

There any way to make the attributes "maxhitpointspercent & maxmanapointspercent"of items.xml be like conditions?

Now I explain: when the attribute I said a while ago either the amount you put in item.xml adds the % of your total health is used, perfect... but when you use it for conditions or movement it is not and presents a problem.

This reads the max health or max mana but which is surface; my character has health 37645 and I have an item in items.xml giving 5% of the max health of the player then stay 39527 with the item.

When I use the movement reads max health that gives me the item and should be the normal would be 37645.

When I use the movement that gives me 35% read the max health + which gives me the item (5%) and should be only the max health of the player but not take the item as max health also

Finally, it should look like:
health 37645 +5% +35% = health 52702

but I have news because it is in this way and is the problem: health 53361

To make it clearer movement or condition is reading the attribute assigned more health/mana max the player and should only be health/mana max

I hope you can help me solve this problem is using c ++ or lua, thanks for watching the post! ;D
 
a okkkk
registerMethod("Player", "getBaseMaxHealth", LuaScriptInterface::luaPlayerGetBaseMaxHealth);
registerMethod("Player", "getBaseMaxMana", LuaScriptInterface::luaPlayerGetBaseMaxMana);

function on equip > etc etc

player:getBaseMaxHealth()
player:getBaseMaxMana()

etc etc

then player set max mana, max hp etc etc.
 
a okkkk
registerMethod("Player", "getBaseMaxHealth", LuaScriptInterface::luaPlayerGetBaseMaxHealth);
registerMethod("Player", "getBaseMaxMana", LuaScriptInterface::luaPlayerGetBaseMaxMana);

function on equip > etc etc

player:getBaseMaxHealth()
player:getBaseMaxMana()

etc etc

then player set max mana, max hp etc etc.

did not work

Code:
    local legs = CONST_SLOT_LEGS
    local min = 0
    local max = 5

    local addpercent = 4
    local defaulpercent = 115
    local conditions = {}

    for num = min, max do
    conditions[num] = Condition(CONDITION_ATTRIBUTES)
    conditions[num]:setParameter(CONDITION_PARAM_TICKS, -1)
    conditions[num]:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, defaulpercent + addpercent * num)
    conditions[num]:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, defaulpercent + addpercent * num)
    conditions[num]:setParameter(CONDITION_PARAM_BUFF, false)
    conditions[num]:setParameter(CONDITION_PARAM_SUBID, 83)
    end

    function onEquip(player, item, slot, boolean)   
    if slot == legs then 
    local succes = item:getSucces()
    if succes < 10 then succes = 0 else succes = succes - 10 end
    player:getBaseMaxHealth(conditions[succes])
    player:getBaseMaxMana(conditions[succes])
    doAddCondition(player, conditions[succes])
    end
    return true
    end

    function onDeEquip(player, item, slot, boolean)
    doRemoveCondition(player, CONDITION_ATTRIBUTES, 83)
    return true
    end

And I also have those basic functions but it does not work for me, could you help me?
 
can you explain what do you whant? then i can make a new script from zero

Look, you can do the test and see that the attributes of maxhitpoints and maxmana points give the% of your maximum health / mana and if there are several do not collide with each other it is the same does not take the attribute as maximum life / mana.

When you use condition movements this takes the attributes of life and maximum mana as total life or total mana of the player is not like items.xml and is what I want to do
 
Back
Top