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

Exura sio heal more hp From knight! how to make?

wesleyt10

Well-Known Member
Joined
Dec 15, 2012
Messages
73
Reaction score
71
hello guys!
I need help!
how to make an heal friend custom?
i need this magic to heal 20% more hp of knights!


Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 10, 10, 20, 24)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Solution
so I want it to increase the healing of the knights with promotion vocation 8
just add the id? right? but in case i want it to be the knight vocation 4 too?
thanks

You could grab vocation info of the target rather than vocation ID and check the fromVocation field, or more conveniently, change
Lua:
local knightVocationID = 1
to an array containing all the vocations which you want to boost with the other combat, like
Lua:
local boostedVocationIDs = {1,2,3,4}

and then change

Lua:
if getPlayerVocation(variantToNumber(var)) == knightVocationID then
to
Lua:
if isInArray(boostedVocationIDs, getPlayerVocation(variantToNumber(var))) then
so it checks if the target's vocation is found in that array.
hello guys!
I need help!
how to make an heal friend custom?
i need this magic to heal 20% more hp of knights!


Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 10, 10, 20, 24)

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

By looking at the code, I'm guessing you're using some older distro so something like this should work:
As far as I know, you can't create or modify combat objects during runtime, so we'll just have to create 2 combats, one for each case, and apply the appropriate one based on the target's vocation.

Make sure to edit that combat's setHealingFormula function and tweak the values to what you think is appropriate, and edit the knightVocationID variable.

Lua:
-- Combat to be used for Sorc, Druid, Paladin:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 10, 10, 20, 24)

-- Combat to be used only for Knights:
local combatKnight = createCombatObject()
setCombatParam(combatKnight, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combatKnight, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatKnight, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combatKnight, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combatKnight, COMBAT_FORMULA_LEVELMAGIC, 12, 12, 24, 29)

local knightVocationID = 1 -- Edit this.

function onCastSpell(cid, var)
  if getPlayerVocation(variantToNumber(var)) == knightVocationID then
    return doCombat(cid, combatKnight, var)
  else
    return doCombat(cid, combat, var)
  end
end
 
By looking at the code, I'm guessing you're using some older distro so something like this should work:
As far as I know, you can't create or modify combat objects during runtime, so we'll just have to create 2 combats, one for each case, and apply the appropriate one based on the target's vocation.

Make sure to edit that combat's setHealingFormula function and tweak the values to what you think is appropriate, and edit the knightVocationID variable.

Lua:
-- Combat to be used for Sorc, Druid, Paladin:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 10, 10, 20, 24)

-- Combat to be used only for Knights:
local combatKnight = createCombatObject()
setCombatParam(combatKnight, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combatKnight, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combatKnight, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combatKnight, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combatKnight, COMBAT_FORMULA_LEVELMAGIC, 12, 12, 24, 29)

local knightVocationID = 1 -- Edit this.

function onCastSpell(cid, var)
  if getPlayerVocation(variantToNumber(var)) == knightVocationID then
    return doCombat(cid, combatKnight, var)
  else
    return doCombat(cid, combat, var)
  end
end


so I want it to increase the healing of the knights with promotion vocation 8
just add the id? right? but in case i want it to be the knight vocation 4 too?
thanks
 
so I want it to increase the healing of the knights with promotion vocation 8
just add the id? right? but in case i want it to be the knight vocation 4 too?
thanks

You could grab vocation info of the target rather than vocation ID and check the fromVocation field, or more conveniently, change
Lua:
local knightVocationID = 1
to an array containing all the vocations which you want to boost with the other combat, like
Lua:
local boostedVocationIDs = {1,2,3,4}

and then change

Lua:
if getPlayerVocation(variantToNumber(var)) == knightVocationID then
to
Lua:
if isInArray(boostedVocationIDs, getPlayerVocation(variantToNumber(var))) then
so it checks if the target's vocation is found in that array.
 
Solution
You could grab vocation info of the target rather than vocation ID and check the fromVocation field, or more conveniently, change
Lua:
local knightVocationID = 1
to an array containing all the vocations which you want to boost with the other combat, like
Lua:
local boostedVocationIDs = {1,2,3,4}

and then change

Lua:
if getPlayerVocation(variantToNumber(var)) == knightVocationID then
to
Lua:
if isInArray(boostedVocationIDs, getPlayerVocation(variantToNumber(var))) then
so it checks if the target's vocation is found in that array.


Youre The best!!!
 
Back
Top