• 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!

TFS 0.X Poison arrow poisoning 0.5~2.0 * skill

fyalhed

Member
Joined
Nov 18, 2017
Messages
156
Reaction score
20
What do i doing wrong?

I'm trying to make poison from poison arrow, do the poison based on skills
poison = skills * 0.5~2.0

Code:
-- Poison
local combat2 = {}
local poison = {}
function DoPoison(cid)
    combat2 = createCombatObject()
    poison = createConditionObject(CONDITION_POISON)
    setConditionParam(poison, CONDITION_PARAM_DELAYED, 15)
    -- 10 ???
    -- after 2 seconds start the poison
    -- poison = skill / 2 ~ skill * 2
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    print("[0.5-2.0]: " .. from_half_to_double)
    addDamageCondition(poison, 10, 2000, -(skill * from_half_to_double) )
    setCombatCondition(combat2, poison)
end

function onUseWeapon(cid, var)
    autoRechargeAmmo(cid)
    DoPoison(cid)
    doCombat(cid, combat2, var) -- applies the poison
    return doCombat(cid, combat, var) -- applies the damage
end


error on console
Code:
[10:43:30.184] [Error - Weapon Interface] 
[10:43:30.184] data/weapons/scripts/distance_weapons/arrows/poison_arrow.lua:onUseWeapon
[10:43:30.184] Description: 
[10:43:30.184] (luaCreateCombatObject) This function can only be used while loading the script.
[0.5-2.0]: 1.7

[10:43:30.184] [Error - Weapon Interface] 
[10:43:30.184] data/weapons/scripts/distance_weapons/arrows/poison_arrow.lua:onUseWeapon
[10:43:30.184] Description: 
[10:43:30.184] (luaSetCombatCondition) Combat not found

[10:43:30.184] [Error - Weapon Interface] 
[10:43:30.185] data/weapons/scripts/distance_weapons/arrows/poison_arrow.lua:onUseWeapon
[10:43:30.185] Description: 
[10:43:30.185] (luaDoCombat) Combat not found

how should i do this?
 
Solution
It works, but the poison dmg is not actually being dealt by the player (cid).
So, depending of what you're planning to do (statschange wise), it might not be the solution.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " ...
this scripts looks like mine

idk what to do, but could help if anyone want to help me :(
 
Lua:
    combat2 = createCombatObject()
    poison = createConditionObject(CONDITION_POISON)

Those 2 cannot be executed inside the main function, just move them above doPoison func
 
Lua:
    combat2 = createCombatObject()
    poison = createConditionObject(CONDITION_POISON)

Those 2 cannot be executed inside the main function, just move them above doPoison func

Oh, ty...
It almost work now, but idk why this almost...


print on console: [0.5-2.0]: 1.8
poison: 108

it should be
108

ok,

but second print 0.5
and first poison got 108

third prints [0.5-2.0]: 0.9
but also poison starts with 108

why?
Post automatically merged:

Oh, ty...
It almost work now, but idk why this almost...


print on console: [0.5-2.0]: 1.8
poison: 108

it should be
108

ok,

but second print 0.5
and first poison got 108

third prints [0.5-2.0]: 0.9
but also poison starts with 108

why?

I did

Code:
-- Poison
local combat2 = createCombatObject()
local poison = createConditionObject(CONDITION_POISON)
function DoPoison(cid)
setConditionParam(poison, CONDITION_PARAM_DELAYED, 15)
-- 10 ???
-- after 2 seconds start the poison
-- poison = skill / 2 ~ skill * 2
local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
local from_half_to_double = (math.random(5, 20)) / 10
print("[0.5-2.0]: " .. from_half_to_double)
addDamageCondition(poison, 10, 2000, -(skill * from_half_to_double) )
setCombatCondition(combat2, poison)
end

function onUseWeapon(cid, var)
autoRechargeAmmo(cid)
DoPoison(cid)
doCombat(cid, combat2, var) -- applies the poison
return doCombat(cid, combat, var) -- applies the damage
end
 
Last edited:
Did you wait for the first 'poison' to finish ticking, before applying the 2nd poison?

If not, it's possible that the 'stronger' poison stayed on the character instead of applying the weaker one.

In either case, you can figure out what's going on by simply adding more prints. xD

Lua:
-- Poison
local combat2 = createCombatObject()
local poison = createConditionObject(CONDITION_POISON)

function DoPoison(cid)
	setConditionParam(poison, CONDITION_PARAM_DELAYED, 15)
	-- 10 ???
	-- after 2 seconds start the poison
	-- poison = skill / 2 ~ skill * 2
	local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
	local from_half_to_double = (math.random(5, 20)) / 10
	local poisonDamage = skill * from_half_to_double
	print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
	addDamageCondition(poison, 10, 2000, -poisonDamage)
	setCombatCondition(combat2, poison)
end

function onUseWeapon(cid, var)
	autoRechargeAmmo(cid)
	DoPoison(cid)
	doCombat(cid, combat2, var) -- applies the poison
	return doCombat(cid, combat, var) -- applies the damage
end
 
Did you wait for the first 'poison' to finish ticking, before applying the 2nd poison?

If not, it's possible that the 'stronger' poison stayed on the character instead of applying the weaker one.

In either case, you can figure out what's going on by simply adding more prints. xD

Lua:
-- Poison
local combat2 = createCombatObject()
local poison = createConditionObject(CONDITION_POISON)

function DoPoison(cid)
    setConditionParam(poison, CONDITION_PARAM_DELAYED, 15)
    -- 10 ???
    -- after 2 seconds start the poison
    -- poison = skill / 2 ~ skill * 2
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = skill * from_half_to_double
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(poison, 10, 2000, -poisonDamage)
    setCombatCondition(combat2, poison)
end

function onUseWeapon(cid, var)
    autoRechargeAmmo(cid)
    DoPoison(cid)
    doCombat(cid, combat2, var) -- applies the poison
    return doCombat(cid, combat, var) -- applies the damage
end


i atk 3 times

2 times the training monk blocked the damage
Code:
Skill: 50 | from_half_to_double: 0.6 | poisonDamage: 30
Skill: 50 | from_half_to_double: 0.6 | poisonDamage: 30

the last (3) damage it hits, so starts the poison
Code:
Skill: 50 | from_half_to_double: 1.9 | poisonDamage: 95

but the poison hits 30 instead of 95
 
i hit 4 times, 3 puffs (0 dmg), but the last make a damage
Code:
Skill: 50 | from_half_to_double: 0.9 | poisonDamage: 45
Skill: 50 | from_half_to_double: 1.9 | poisonDamage: 95
Skill: 50 | from_half_to_double: 1 | poisonDamage: 50
Skill: 50 | from_half_to_double: 1.2 | poisonDamage: 60

the last damage did 45 of poison
and every other atk make 45 of poison
why?
 
I think you need combat2 to actually deal damage.

and/or its delay of 15 seconds is confusing you into thinking its not working as intended.

tbh I'm not sure how the script doesn't error since 'combat' doesn't exist.. Only combat2 exists
 
I think you need combat2 to actually deal damage.
what are u mean?

i didn't create this, i take this base:
 
what are u mean?

i didn't create this, i take this base:
I give up trying to use your code as a base. lmao

Try this
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    local poisonDamage = (getPlayerSkillLevel(cid, SKILL_DISTANCE) * ((math.random(5, 20)) / 10)) * -1
    addDamageCondition(condition, 10, 2000, poisonDamage)
    return doCombat(cid, combat, var)
end

-- edit

Sorry, forgot to separate everything for you
here
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    return doCombat(cid, combat, var)
end
 
I give up trying to use your code as a base. lmao

Try this
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    local poisonDamage = (getPlayerSkillLevel(cid, SKILL_DISTANCE) * ((math.random(5, 20)) / 10)) * -1
    addDamageCondition(condition, 10, 2000, poisonDamage)
    return doCombat(cid, combat, var)
end

-- edit

Sorry, forgot to separate everything for you
here
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    return doCombat(cid, combat, var)
end

np bro
it was just the only way i found to do damage+poison
if u know some way better pls tell me :)

using your last idea ->

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    return doCombat(cid, combat, var)
end

1 hit prints:
Code:
Skill: 50 | from_half_to_double: 0.5 | poisonDamage: -25
with puff 0 dmg

2 hit prints:
Code:
Skill: 50 | from_half_to_double: 0.5 | poisonDamage: -25
deals a 30 dmg type poison without poisoning


2 hit prints:
Code:
Skill: 50 | from_half_to_double: 1 | poisonDamage: -50
deals a 62 dmg type poison without poisoning
 
np bro
it was just the only way i found to do damage+poison
if u know some way better pls tell me :)

using your last idea ->

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    return doCombat(cid, combat, var)
end

1 hit prints:
Code:
Skill: 50 | from_half_to_double: 0.5 | poisonDamage: -25
with puff 0 dmg

2 hit prints:
Code:
Skill: 50 | from_half_to_double: 0.5 | poisonDamage: -25
deals a 30 dmg type poison without poisoning


2 hit prints:
Code:
Skill: 50 | from_half_to_double: 1 | poisonDamage: -50
deals a 62 dmg type poison without poisoning
Okay, this is ridiculous. lmao

Here is an Unedited version of poison arrow.

Does it poison someone?
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 10, 2000, -1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end

If yes.. then it's probably just a matter of moving the setCombatCondition?
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    setCombatCondition(combat, condition)
    return doCombat(cid, combat, var)
end

lmao
If the above code doesn't work.. I have literally no idea.
 
Okay, this is ridiculous. lmao

Here is an Unedited version of poison arrow.

Does it poison someone?
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 10, 2000, -1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end

If yes.. then it's probably just a matter of moving the setCombatCondition?
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    setCombatCondition(combat, condition)
    return doCombat(cid, combat, var)
end

lmao
If the above code doesn't work.. I have literally no idea.


Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 10, 2000, -1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end


it hits poison (1)
10 times


---

so

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    setCombatCondition(combat, condition)
    return doCombat(cid, combat, var)
end


Skill: 50 | from_half_to_double: 1.6 | poisonDamage: -80
first hit deals 80 right

second hit in other monk (2 puffs - 0 hit)
Skill: 50 | from_half_to_double: 1.4 | poisonDamage: -70
Skill: 50 | from_half_to_double: 0.5 | poisonDamage: -25
Skill: 50 | from_half_to_double: 1.7 | poisonDamage: -85

i think it deals the 3 poisons...
first 70, after 25 in the end 85

did u know a way to don't store the damage when hit blocks?
 
Sorry, I really don't.
I've never understood how the default damage/spell system works.

Someone else would have to help further.
 
Sorry, I really don't.
I've never understood how the default damage/spell system works.

Someone else would have to help further.

It is not the block stuff, i tried to do:
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)

first monk:
Skill: 50 | from_half_to_double: 1.5 | poisonDamage: -75
deals right poison, 75 for 10 secs

hit other monk
Skill: 50 | from_half_to_double: 1.6 | poisonDamage: -80
so deals 75 until the end, after ends starts to deal the 80 poison

:(
 
It is not the block stuff, i tried to do:
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)

first monk:
Skill: 50 | from_half_to_double: 1.5 | poisonDamage: -75
deals right poison, 75 for 10 secs

hit other monk
Skill: 50 | from_half_to_double: 1.6 | poisonDamage: -80
so deals 75 until the end, after ends starts to deal the 80 poison

:(

bump
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 10, 2000, -1)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end


it hits poison (1)
10 times


---

so

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)

function onUseWeapon(cid, var)
    local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
    local from_half_to_double = (math.random(5, 20)) / 10
    local poisonDamage = (skill * from_half_to_double) * -1
    print("Skill: " .. skill .. " | from_half_to_double: " .. from_half_to_double .. " | poisonDamage: " .. poisonDamage)
    addDamageCondition(condition, 10, 2000, poisonDamage)
    setCombatCondition(combat, condition)
    return doCombat(cid, combat, var)
end


Skill: 50 | from_half_to_double: 1.6 | poisonDamage: -80
first hit deals 80 right

second hit in other monk (2 puffs - 0 hit)
Skill: 50 | from_half_to_double: 1.4 | poisonDamage: -70
Skill: 50 | from_half_to_double: 0.5 | poisonDamage: -25
Skill: 50 | from_half_to_double: 1.7 | poisonDamage: -85

i think it deals the 3 poisons...
first 70, after 25 in the end 85

did u know a way to don't store the damage when hit blocks?



It is not the block stuff, i tried to do:
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)

first monk:
Skill: 50 | from_half_to_double: 1.5 | poisonDamage: -75
deals right poison, 75 for 10 secs

hit other monk
Skill: 50 | from_half_to_double: 1.6 | poisonDamage: -80
so deals 75 until the end, after ends starts to deal the 80 poison

:(


could someone more experienced help me please?
i have a lot ideas to do with this base, when it starts to work right :(
 
Back
Top