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

Lua Burning Heart --> Fast healing

Apoccalypse

New Member
Joined
Apr 15, 2017
Messages
114
Solutions
2
Reaction score
4
Hello Guys,
I have a problem with my BH script:

Lua:
function onUse(cid, item, frompos, item2, topos)
lvl = getPlayerLevel(cid)
local youv = getPlayerVocation(cid)

   if youv == 1 or youv == 2 or youv == 5 or youv == 6 or youv == 9 or youv == 10 then

local minhealth = (lvl*1.8*1.5+300.0) --- Min of mana can heal
local maxhealth = (lvl*2.1*1.5+400.0) ---- Max of mana can heal CONST_ME_MAGIC_RED 13 14 utani fast hur
local random = math.random(minhealth, maxhealth)
doCreatureAddHealth(cid, random)
doSendMagicEffect(getThingPos(cid),13 )

   elseif youv == 3 or youv == 7 or youv == 11 then
local minhealth = (lvl*1*2.5+50.0) --- Min of mana can heal
local maxhealth = (lvl*1.3*3.2+100.0) ---- Max of mana can heal
local random = math.random(minhealth, maxhealth)
doCreatureAddHealth(cid, random)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)

   elseif youv == 4 or youv == 8 or youv == 12 then
local minhealth = (lvl*1.0*2.5+150.0) --- Min of mana can heal
local maxhealth = (lvl*1.2*3.2+225.0) ---- Max of mana can heal
local random = math.random(minhealth, maxhealth)
doCreatureAddHealth(cid, random)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
end

return True
end

Generally it works, I mean when I am clicking on it with right button of the mouse it heals the character without exhaustion but when I set it on elfbot it has like 500 ms of exhaustion and I totally don't know why.
My elbot script is fine, because I used to use it on the other servers with such thing and it worked without the problem. [It starts "auto 100 (...)", so exhaustion should be 100 ms.]
An other problem is when I am clicking on it I gets the message "You can not use this object" , although it is no true and it is impossible to set it on hotkeys like for example UH rune. [with function "Use on yourself"]
I was also using this scrip with function onCastSpell but then exhaustion was even bigger and the first reaction on loosing hp was with delay.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 12)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)


function onCastSpell(cid, var)
doCombat(cid, combat, var)
lvl = getPlayerLevel(cid)
local youv = getPlayerVocation(cid)

if youv == 1 or youv == 2 or youv == 5 or youv == 6 or youv == 9 or youv == 10 then

local minhealth = (lvl*1.8*1.5+300.0) --- Min of mana can heal
local maxhealth = (lvl*2.1*1.5+400.0) ---- Max of mana can heal CONST_ME_MAGIC_RED 13 14 utani fast hur
local random = math.random(minhealth, maxhealth)
doCreatureAddHealth(cid, random)
doSendAnimatedText(getPlayerPosition(cid), random, 409)
doSendMagicEffect(getThingPos(cid),13 )

elseif youv == 3 or youv == 7 or youv == 11 then
local minhealth = (lvl*1*2.5+50.0) --- Min of mana can heal
local maxhealth = (lvl*1.3*3.2+100.0) ---- Max of mana can heal
local random = math.random(minhealth, maxhealth)
doCreatureAddHealth(cid, random)
doSendAnimatedText(getPlayerPosition(cid), random, 409)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)

elseif youv == 4 or youv == 8 or youv == 12 then
local minhealth = (lvl*1.0*2.5+150.0) --- Min of mana can heal
local maxhealth = (lvl*1.2*3.2+225.0) ---- Max of mana can heal
local random = math.random(minhealth, maxhealth)
doCreatureAddHealth(cid, random)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
end

return True
end

Code:
<rune name="Burning Heart" id="2353" aggressive="0" charges="0" needtarget="1" lvl="8" maglv="0" exhaustion="0" enabled="1" allowfaruse="1" script="New/Burning Heart.lua"/>

Using this script I was also unable to set it on hotkeys.

If anyone would help that would be great :)
 
I remake a script to make it optimally simple (the item which I am using is burning heart):

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        doSendMagicEffect(getCreaturePosition(cid),13)
        doCreatureAddHealth(cid, math.random(450,1350))
        return true
end

I can set it on hotkeys and then I have no exhaustion.By clicking on it with right button of the mouse I have no exhaustion, but if elfbot script is executing the healing I have like 500-750 ms of exhaustion and what is more strange when the bot is regenerating a player HP and I try to make it quicker by for example clicking on it or using hotkey with it I am simply no able to do that , just like there was an exhaustion but I have no freaking idea where this is coming from ;(
My elbot script is:

Code:
auto 100 if [$hppc < 95] useoncreature 3240 self

If anyone could take a look on it ,that would be awesome ,because I am totally loosing my mind by it.

---------------------------------------------------------------------------------------
Meaby it is not important but I noticed one thing on another script.

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 12)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)



function onCastSpell(cid, var)
doCombat(cid, combat, var)
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureAddHealth(cid, math.random(550,1350))
return true
end

With this script when I am using the item by clicking on it or with hotkeys I get the effect 13 from this line:
Lua:
doSendMagicEffect(getCreaturePosition(cid),13)

But when the bot is using the item I get the effect 12 from this line:
Code:
setCombatParam(combat, COMBAT_PARAM_EFFECT, 12)

I thought it would be a problem but after remaking it to onUse function I can not understand what the problem can be :(
 
Last edited:
Finally! I solved the problem by my own :D
It was a cause of my mysterious exhaustion ;p

Lua:
        timeBetweenActions = 25
    timeBetweenExActions = 100
    hotkeyAimbotEnabled = true
 
Back
Top