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

help with this script

falls13

New Member
Joined
Nov 3, 2015
Messages
29
Reaction score
1
I would like to fill the mana of the player who is using the weapon that is with this script.
but it is filling that of the target.



local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 10, 10, 10, 10)


function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
 
Try this, should work perfect and increase
doPlayerAddMana(cid, math.random(10, 11))
10, 11 are the mana gain.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function onUseWeapon(cid, var)
doPlayerAddMana(cid, math.random(10, 11))
    return doCombat(cid, combat, var)
end
 
it works !
just how would heal, percentage of the hit, that he took from the player or the creature?
 
I think you'll need to make creaturescripts with the weapon ID and so on take a look here and try lifesteal
 
has mana healing here. is healing the life. please ? tfs 0.3.6


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
local skill = getPlayerSkill(cid,SKILL_AXE) -- Change this to the type of weapon you are using
local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5) -- Change 50 to the attack of the weapon
local min = 25 -- this means 5% minimum healing
local max = 40 -- this means 15% maximum healing
local addhealth = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 5 then
doCreatureAddHealth(cid, addhealth)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end
 
has mana healing here. is healing the life. please ? tfs 0.3.6


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
local skill = getPlayerSkill(cid,SKILL_AXE) -- Change this to the type of weapon you are using
local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5) -- Change 50 to the attack of the weapon
local min = 25 -- this means 5% minimum healing
local max = 40 -- this means 15% maximum healing
local addhealth = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 5 then
doCreatureAddHealth(cid, addhealth)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end
I tried to understand and I think you wanna change the above script to add mana instead of adding health so I changed it, Try!
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
local skill = getPlayerSkill(cid,SKILL_AXE) -- Change this to the type of weapon you are using
local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5) -- Change 50 to the attack of the weapon
local min = 25 -- this means 5% minimum healing
local max = 40 -- this means 15% maximum healing
local addmana = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 5 then
doPlayerAddMana(cid, addmana)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end
 
Back
Top