oshrigames
Active Member
hello
i'm using TFS 1.2 (protocol 10.98).
i simply in a lose..
i'm trying to create advanced potions that work on multiple Conditions but since i have no errors i don't know how to locate the issues or what goes worng.
example for 2 Conditions
first is: CONDITION_REGENERATION
heal 50 hp per 3 sec for 1 min (1 * 60 * 1000)
second is: CONDITION_ATTRIBUTES
gain 500 to max hp for 1 min (60000)
i tried to figure it out using spells scripts that has multiple Conditions. (protector.lua has 3 conditions)
but after few days of non stop fails i figure i'll ask for help maybe someone can explain it and save me from some future heart problems. LOL
this potion is just a multiple condition potion for testing.
i want to be able to code them on my own so once i know how it works properly ill release a list of advanced potions to the community
(it has huge unused potential).
any help will be greatly appreciated.
i'm using TFS 1.2 (protocol 10.98).
i simply in a lose..
i'm trying to create advanced potions that work on multiple Conditions but since i have no errors i don't know how to locate the issues or what goes worng.
example for 2 Conditions
first is: CONDITION_REGENERATION
heal 50 hp per 3 sec for 1 min (1 * 60 * 1000)
second is: CONDITION_ATTRIBUTES
gain 500 to max hp for 1 min (60000)
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setCondition(condition)
local condition = Condition(CONDITION_REGENERATION)
condition:setParameter(CONDITION_PARAM_SUBID, 3)
condition:setParameter(CONDITION_PARAM_TICKS, 1 * 60 * 1000) -- 1 minute
condition:setParameter(CONDITION_PARAM_HEALTHGAIN, 50) -- heal 50 every 3 sec
condition:setParameter(CONDITION_PARAM_HEALTHTICKS, 3000)
condition:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_SUBID, 2)
condition:setParameter(CONDITION_PARAM_TICKS, 60000) -- 1 minute
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 500) -- gain 500 to max hp
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:addCondition(condition)
if player:addCondition(condition) then
player:getPosition():sendMagicEffect(CONST_ME_POFF)
Item(item.uid):remove(1)
end
return true
end
[
CONDITION_NONE,
CONDITION_POISON = 1 << 0,
CONDITION_FIRE = 1 << 1,
CONDITION_ENERGY = 1 << 2,
CONDITION_BLEEDING = 1 << 3,
CONDITION_HASTE = 1 << 4,
CONDITION_PARALYZE = 1 << 5,
CONDITION_OUTFIT = 1 << 6,
CONDITION_INVISIBLE = 1 << 7,
CONDITION_LIGHT = 1 << 8,
CONDITION_MANASHIELD = 1 << 9,
CONDITION_INFIGHT = 1 << 10,
CONDITION_DRUNK = 1 << 11,
CONDITION_EXHAUST_WEAPON = 1 << 12, // unused
CONDITION_REGENERATION = 1 << 13,
CONDITION_SOUL = 1 << 14,
CONDITION_DROWN = 1 << 15,
CONDITION_MUTED = 1 << 16,
CONDITION_CHANNELMUTEDTICKS = 1 << 17,
CONDITION_YELLTICKS = 1 << 18,
CONDITION_ATTRIBUTES = 1 << 19,
CONDITION_FREEZING = 1 << 20,
CONDITION_DAZZLED = 1 << 21,
CONDITION_CURSED = 1 << 22,
CONDITION_EXHAUST_COMBAT = 1 << 23, // unused
CONDITION_EXHAUST_HEAL = 1 << 24, // unused
CONDITION_PACIFIED = 1 << 25, -- unable to melee attack during the debuff
CONDITION_SPELLCOOLDOWN = 1 << 26,
CONDITION_SPELLGROUPCOOLDOWN = 1 << 27,
CONDITION_DAMAGE_IMMUNE = 1 << 28,
CONDITION_IMMUNE = 1 << 29,
CONDITION_PARAM_OWNER = 1,
CONDITION_PARAM_TICKS = 2, -- timer to execute a condition
//CONDITION_PARAM_OUTFIT = 3,
CONDITION_PARAM_HEALTHGAIN = 4, -- gain hp
CONDITION_PARAM_HEALTHTICKS = 5, -- gain hp per sec
CONDITION_PARAM_MANAGAIN = 6, -- gain mana
CONDITION_PARAM_MANATICKS = 7, -- gain mana per sec
CONDITION_PARAM_DELAYED = 8,
CONDITION_PARAM_SPEED = 9, -- gain speed (100 = ingame 50)
CONDITION_PARAM_LIGHT_LEVEL = 10, -- light size
CONDITION_PARAM_LIGHT_COLOR = 11, -- light color
CONDITION_PARAM_SOULGAIN = 12,
CONDITION_PARAM_SOULTICKS = 13,
CONDITION_PARAM_MINVALUE = 14,
CONDITION_PARAM_MAXVALUE = 15,
CONDITION_PARAM_STARTVALUE = 16,
CONDITION_PARAM_TICKINTERVAL = 17,
CONDITION_PARAM_FORCEUPDATE = 18,
CONDITION_PARAM_SKILL_MELEE = 19, -- gain to melee
CONDITION_PARAM_SKILL_FIST = 20, -- gain to fist
CONDITION_PARAM_SKILL_CLUB = 21, -- gain to club
CONDITION_PARAM_SKILL_SWORD = 22, -- gain to sword
CONDITION_PARAM_SKILL_AXE = 23, -- gain to axe
CONDITION_PARAM_SKILL_DISTANCE = 24, -- gain to distance
CONDITION_PARAM_SKILL_SHIELD = 25, -- gain to shield
CONDITION_PARAM_SKILL_FISHING = 26, -- gain to fishing
CONDITION_PARAM_STAT_MAXHITPOINTS = 27, -- gain to max hp
CONDITION_PARAM_STAT_MAXMANAPOINTS = 28, -- gain to max mana
// CONDITION_PARAM_STAT_SOULPOINTS = 29,
CONDITION_PARAM_STAT_MAGICPOINTS = 30,
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = 31,
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = 32,
// CONDITION_PARAM_STAT_SOULPOINTSPERCENT = 33,
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = 34,
CONDITION_PARAM_PERIODICDAMAGE = 35,
CONDITION_PARAM_SKILL_MELEEPERCENT = 36,
CONDITION_PARAM_SKILL_FISTPERCENT = 37,
CONDITION_PARAM_SKILL_CLUBPERCENT = 38,
CONDITION_PARAM_SKILL_SWORDPERCENT = 39,
CONDITION_PARAM_SKILL_AXEPERCENT = 40,
CONDITION_PARAM_SKILL_DISTANCEPERCENT = 41,
CONDITION_PARAM_SKILL_SHIELDPERCENT = 42,
CONDITION_PARAM_SKILL_FISHINGPERCENT = 43,
CONDITION_PARAM_BUFF_SPELL = 44,
CONDITION_PARAM_SUBID = 45,
CONDITION_PARAM_FIELD = 46,
CONDITION_PARAM_IMMUNE_PARALYZE = 47,
,[/CODE]
CONDITION_NONE,
CONDITION_POISON = 1 << 0,
CONDITION_FIRE = 1 << 1,
CONDITION_ENERGY = 1 << 2,
CONDITION_BLEEDING = 1 << 3,
CONDITION_HASTE = 1 << 4,
CONDITION_PARALYZE = 1 << 5,
CONDITION_OUTFIT = 1 << 6,
CONDITION_INVISIBLE = 1 << 7,
CONDITION_LIGHT = 1 << 8,
CONDITION_MANASHIELD = 1 << 9,
CONDITION_INFIGHT = 1 << 10,
CONDITION_DRUNK = 1 << 11,
CONDITION_EXHAUST_WEAPON = 1 << 12, // unused
CONDITION_REGENERATION = 1 << 13,
CONDITION_SOUL = 1 << 14,
CONDITION_DROWN = 1 << 15,
CONDITION_MUTED = 1 << 16,
CONDITION_CHANNELMUTEDTICKS = 1 << 17,
CONDITION_YELLTICKS = 1 << 18,
CONDITION_ATTRIBUTES = 1 << 19,
CONDITION_FREEZING = 1 << 20,
CONDITION_DAZZLED = 1 << 21,
CONDITION_CURSED = 1 << 22,
CONDITION_EXHAUST_COMBAT = 1 << 23, // unused
CONDITION_EXHAUST_HEAL = 1 << 24, // unused
CONDITION_PACIFIED = 1 << 25, -- unable to melee attack during the debuff
CONDITION_SPELLCOOLDOWN = 1 << 26,
CONDITION_SPELLGROUPCOOLDOWN = 1 << 27,
CONDITION_DAMAGE_IMMUNE = 1 << 28,
CONDITION_IMMUNE = 1 << 29,
CONDITION_PARAM_OWNER = 1,
CONDITION_PARAM_TICKS = 2, -- timer to execute a condition
//CONDITION_PARAM_OUTFIT = 3,
CONDITION_PARAM_HEALTHGAIN = 4, -- gain hp
CONDITION_PARAM_HEALTHTICKS = 5, -- gain hp per sec
CONDITION_PARAM_MANAGAIN = 6, -- gain mana
CONDITION_PARAM_MANATICKS = 7, -- gain mana per sec
CONDITION_PARAM_DELAYED = 8,
CONDITION_PARAM_SPEED = 9, -- gain speed (100 = ingame 50)
CONDITION_PARAM_LIGHT_LEVEL = 10, -- light size
CONDITION_PARAM_LIGHT_COLOR = 11, -- light color
CONDITION_PARAM_SOULGAIN = 12,
CONDITION_PARAM_SOULTICKS = 13,
CONDITION_PARAM_MINVALUE = 14,
CONDITION_PARAM_MAXVALUE = 15,
CONDITION_PARAM_STARTVALUE = 16,
CONDITION_PARAM_TICKINTERVAL = 17,
CONDITION_PARAM_FORCEUPDATE = 18,
CONDITION_PARAM_SKILL_MELEE = 19, -- gain to melee
CONDITION_PARAM_SKILL_FIST = 20, -- gain to fist
CONDITION_PARAM_SKILL_CLUB = 21, -- gain to club
CONDITION_PARAM_SKILL_SWORD = 22, -- gain to sword
CONDITION_PARAM_SKILL_AXE = 23, -- gain to axe
CONDITION_PARAM_SKILL_DISTANCE = 24, -- gain to distance
CONDITION_PARAM_SKILL_SHIELD = 25, -- gain to shield
CONDITION_PARAM_SKILL_FISHING = 26, -- gain to fishing
CONDITION_PARAM_STAT_MAXHITPOINTS = 27, -- gain to max hp
CONDITION_PARAM_STAT_MAXMANAPOINTS = 28, -- gain to max mana
// CONDITION_PARAM_STAT_SOULPOINTS = 29,
CONDITION_PARAM_STAT_MAGICPOINTS = 30,
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = 31,
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = 32,
// CONDITION_PARAM_STAT_SOULPOINTSPERCENT = 33,
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = 34,
CONDITION_PARAM_PERIODICDAMAGE = 35,
CONDITION_PARAM_SKILL_MELEEPERCENT = 36,
CONDITION_PARAM_SKILL_FISTPERCENT = 37,
CONDITION_PARAM_SKILL_CLUBPERCENT = 38,
CONDITION_PARAM_SKILL_SWORDPERCENT = 39,
CONDITION_PARAM_SKILL_AXEPERCENT = 40,
CONDITION_PARAM_SKILL_DISTANCEPERCENT = 41,
CONDITION_PARAM_SKILL_SHIELDPERCENT = 42,
CONDITION_PARAM_SKILL_FISHINGPERCENT = 43,
CONDITION_PARAM_BUFF_SPELL = 44,
CONDITION_PARAM_SUBID = 45,
CONDITION_PARAM_FIELD = 46,
CONDITION_PARAM_IMMUNE_PARALYZE = 47,
,[/CODE]
i tried to figure it out using spells scripts that has multiple Conditions. (protector.lua has 3 conditions)
but after few days of non stop fails i figure i'll ask for help maybe someone can explain it and save me from some future heart problems. LOL
this potion is just a multiple condition potion for testing.
i want to be able to code them on my own so once i know how it works properly ill release a list of advanced potions to the community
(it has huge unused potential).
any help will be greatly appreciated.
Last edited: