Apoccalypse
New Member
- Joined
- Apr 15, 2017
- Messages
- 114
- Solutions
- 2
- Reaction score
- 4
Hello Guys,
I have a problem with my BH script:
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.
Using this script I was also unable to set it on hotkeys.
If anyone would help that would be great
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