Unknown Soldier
Mapping a map
- Joined
- Oct 30, 2010
- Messages
- 294
- Solutions
- 11
- Reaction score
- 665
Hi,
I was just wondering how could I maintain all 3 conditions at once (as in title: mana leech, life leech and critital hit), using 3 different items to get each one of them. The problem is when I receive first condition and then want to get another one, the first one disappears. Example: I am using item A and receive a life leech. Life leech works. Then I use item B to get mana leech. Mana leech works. BUT life leech disappears.
I would like to maintain each condition, so that player can have either one, two or three at once, depending on how many items were used.
Screenshot as an example, even after using 3 items that apply all 3 conditions, only one condition is active, instead of all 3.
How can I do that?
Thanks in advance!
I was just wondering how could I maintain all 3 conditions at once (as in title: mana leech, life leech and critital hit), using 3 different items to get each one of them. The problem is when I receive first condition and then want to get another one, the first one disappears. Example: I am using item A and receive a life leech. Life leech works. Then I use item B to get mana leech. Mana leech works. BUT life leech disappears.
I would like to maintain each condition, so that player can have either one, two or three at once, depending on how many items were used.
Screenshot as an example, even after using 3 items that apply all 3 conditions, only one condition is active, instead of all 3.
How can I do that?
Thanks in advance!
Lua:
local config = {
cdtime = 60, --duration of condition in minutes
criteffect = 179,
manaeffect = 176,
lifeeffect = 178,
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target:isPlayer() then
if item.itemid == 34398 then
player:getPosition():sendMagicEffect(config.criteffect)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been imbued with the power of the crystal and received powerful strike (critical hit), that will last for "..config.cdtime.." minutes.")
item:remove(1)
local condition1 = Condition(CONDITION_ATTRIBUTES)
condition1:setParameter(CONDITION_PARAM_SPECIALSKILL_CRITICALHITCHANCE, 20)
condition1:setParameter(CONDITION_PARAM_SPECIALSKILL_CRITICALHITAMOUNT, 10)
condition1:setTicks(config.cdtime*60*1000)
player:addCondition(condition1)
elseif item.itemid == 34396 then
player:getPosition():sendMagicEffect(config.manaeffect)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been imbued with the power of the crystal and received powerful void (mana leech), that will last for "..config.cdtime.." minutes.")
item:remove(1)
local condition2 = Condition(CONDITION_ATTRIBUTES)
condition2:setParameter(CONDITION_PARAM_SPECIALSKILL_MANALEECHCHANCE, 100)
condition2:setParameter(CONDITION_PARAM_SPECIALSKILL_MANALEECHAMOUNT, 9)
condition2:setTicks(config.cdtime*60*1000)
player:addCondition(condition2)
elseif item.itemid == 34397 then
player:getPosition():sendMagicEffect(config.lifeeffect)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been imbued with the power of the crystal and received powerful vampirism (life leech), that will last for "..config.cdtime.." minutes.")
item:remove(1)
local condition3 = Condition(CONDITION_ATTRIBUTES)
condition3:setParameter(CONDITION_PARAM_SPECIALSKILL_LIFELEECHCHANCE, 100)
condition3:setParameter(CONDITION_PARAM_SPECIALSKILL_LIFELEECHAMOUNT, 9)
condition3:setTicks(config.cdtime*60*1000)
player:addCondition(condition3)
end
end
end
Last edited: