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

Paladin rune

denkan97

Well-Known Member
Joined
Dec 27, 2011
Messages
327
Solutions
2
Reaction score
50
So i got my paladin rune to work but it only show +xxx mana and i want it to show hp to (like spirit rune) but i cant get it to do so

tfs 0.4 3887

XML:
local vocations = {3, 7}

function onUse(cid, item, frompos, item2, topos)
if isInArray(vocations,getPlayerVocation(cid)) then

doSendMagicEffect(topos,1)
doCreatureSay(cid,"Holy Spiritrune",19)
mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)

if doCreatureAddHealth(cid, math.random(mini, maxi)) == LUA_ERROR or doPlayerAddMana(cid, math.random(mini, maxi)) == LUA_ERROR then
return FALSE
end
else

doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
end
return true
end

anyone know what i need to add to this to get it show hp to?
 
Solution
Lua:
function onUse(cid, item, frompos, item2, topos)
local vocations = {3, 7}
   if isInArray(vocations, getPlayerVocation(cid)) then
       doSendMagicEffect(topos,1)
       doCreatureSay(cid, "Holy Spiritrune", 19)
       local mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
       local maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
       local amount = math.random(mini, maxi)
       addEvent(function() doSendAnimatedText(topos, "+"..amount.."", TEXTCOLOR_GREEN) end, 500)
       if doCreatureAddHealth(cid, amount) == LUA_ERROR or doPlayerAddMana(cid, amount) == LUA_ERROR then
           return false
       end
   else
       doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
   end...
Try this?

Lua:
local vocations = {3, 7}

function onUse(cid, item, frompos, item2, topos)
    if not isInArray(vocations,getPlayerVocation(cid)) then
        return doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
    end

mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)

local rand = math.random(mini, maxi)

doTargetCombatHealth(0, cid, COMBAT_HEALING, rand, rand, 1)
doPlayerAddMana(cid, rand)
doCreatureSay(cid,"Holy Spiritrune",19)
return true
end
 
Lua:
function onUse(cid, item, frompos, item2, topos)
local vocations = {3, 7}
   if isInArray(vocations, getPlayerVocation(cid)) then
       doSendMagicEffect(topos,1)
       doCreatureSay(cid, "Holy Spiritrune", 19)
       local mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
       local maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
       local amount = math.random(mini, maxi)
       doSendAnimatedText(topos, amount, TEXTCOLOR_RED)
       if doCreatureAddHealth(cid, amount) == LUA_ERROR or doPlayerAddMana(cid, amount) == LUA_ERROR then
           return false
       end
   else
       doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
   end
   return true
end
 
Lua:
function onUse(cid, item, frompos, item2, topos)
if isInArray(vocations,getPlayerVocation(cid)) then

mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
rand = math.random(mini, maxi)

doSendMagicEffect(topos,1)
doCreatureSay(cid,"Holy Spiritrune",19)
doCreatureSay(cid,rand,TALKTYPE_MONSTER_SAY)
if doCreatureAddHealth(cid, rand) == LUA_ERROR or doPlayerAddMana(cid, math.random(mini, maxi)) == LUA_ERROR then
return FALSE
end
else

doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
end
return true
end

scripting for 0.4 is lame as hell...
 
  • function onUse(cid, item, frompos, item2, topos)
  • if isInArray(vocations,getPlayerVocation(cid)) then
  • mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
  • maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
  • rand = math.random(mini, maxi)
  • doSendMagicEffect(topos,1)
  • doCreatureSay(cid,"Holy Spiritrune",19)
  • doCreatureSay(cid,rand,TALKTYPE_MONSTER_SAY)
  • if doCreatureAddHealth(cid, rand) == LUA_ERROR or doPlayerAddMana(cid, math.random(mini, maxi)) == LUA_ERROR then
  • return FALSE
  • end
  • else
  • doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
  • end
  • return true
  • end

No error but got debugg on both chars :D
 
Lua:
function onUse(cid, item, frompos, item2, topos)
local vocations = {3, 7}
   if isInArray(vocations, getPlayerVocation(cid)) then
       doSendMagicEffect(topos,1)
       doCreatureSay(cid, "Holy Spiritrune", 19)
       local mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
       local maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
       local amount = math.random(mini, maxi)
       addEvent(function() doSendAnimatedText(topos, "+"..amount.."", TEXTCOLOR_GREEN) end, 500)
       if doCreatureAddHealth(cid, amount) == LUA_ERROR or doPlayerAddMana(cid, amount) == LUA_ERROR then
           return false
       end
   else
       doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
   end
   return true
end
 
Last edited:
Solution
So change:

Code:
doCreatureSay(cid,rand,TALKTYPE_MONSTER_SAY)

To what ever talk type is the same as a creature talking...
 
  • function onUse(cid, item, frompos, item2, topos)
  • local vocations = {3, 7}
  • if isInArray(vocations, getPlayerVocation(cid)) then
  • doSendMagicEffect(topos,1)
  • doCreatureSay(cid, "Holy Spiritrune", 19)
  • local mini = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
  • local maxi = (getPlayerLevel(cid) * 2.4 + getPlayerMagLevel(cid) * 10)
  • local amount = math.random(mini, maxi)
  • topos.x = topos.x + 1
  • doSendAnimatedText(topos, amount, TEXTCOLOR_GREEN)
  • if doCreatureAddHealth(cid, amount) == LUA_ERROR or doPlayerAddMana(cid, amount) == LUA_ERROR then
  • return false
  • end
  • else
  • doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
  • end
  • return true
  • end

Now im only pitty but it shows the hp! but not the "+" in front of it :p

and for some reason i still got this shitt the hp and mana for some reason is 1 sqm from each other
Gyazo - e92748729512ed5f6ba5ce95c0d80140.png
 
Last edited:
Back
Top