• 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 How to Create a New Skill Bar

renancs

New Member
Joined
Jul 8, 2008
Messages
252
Reaction score
3
How can i create a new skill bar for a lumberjacking skill...
I want to use this script from mock: here.

I want for play now how many % he need to advance level of lumberjacking,
to facility him life :D.



" Im aware, i need to create a new client, but where i need edit/create to put the new
skillbar interacting with a script."

Thanks!
 
You can enter an 5 year long course of Information of Techonoly in a good university and postgraduate on programming, then you can start think about how to do it
 
You can enter an 5 year long course of Information of Techonoly in a good university and postgraduate on programming, then you can start think about how to do it
ON TOPIC PLEASE
Sorry i cant help ;/ , maybe check around ? Maybe some of our fellow otlanders has one released lol
 
dankoo, cuz i see various server with news skill bars, for alchemist and others...
So i think this is don't very hard...

help plx =D
 
They don't add new ones

They edit, like instead "Fist fighting" they put "Lumberjacking"

Just open tibia client with an HEX editor and use Search.

@Umbrella Corp.

I'm on topic
 
Hmm, but if i edit first fight and put lumberjack, how i go put to when the player going
cutting the trees, go advance the skill bar?
i need change storage id or something like?
 
Dtk...

Lua:
--Lumberjack by: Lwkass
--Version: 1.1.5

--Configs--
local configs = {
 sign = {{level = {0,9}, quant = {1,2}, percent = 40},
         {level = {10,19}, quant = {2,4}, percent = 45},
         {level = {20,29}, quant = {3,6}, percent = 50},
         {level = {30,39}, quant = {4,8}, percent = 55},
         {level = {40,49}, quant = {5,10}, percent = 60},
         {level = {50,59}, quant = {6,12}, percent = 65},
         {level = {60,69}, quant = {7,14}, percent = 70},
         {level = {70,79}, quant = {8,16}, percent = 75},
         {level = {80,89}, quant = {9,18}, percent = 80},
         {level = {90,99}, quant = {10,20}, percent = 85},
         {level = {100}, quant = {11,22}, percent = 90}},
 trees = {2707, 2704},
 woods = {{5901, 'all'}},
 tree_delay = 10,
 MaxLevel = 100
}
--END Configs--
function onUse(cid, item, fromPosition, itemEx, toPosition)
local STORAGE_SKILL_LEVEL = 10000
local STORAGE_SKILL_TRY = 10001  
local skillLevel = getPlayerStorageValue(cid,STORAGE_SKILL_LEVEL)
local skillTry = getPlayerStorageValue(cid,STORAGE_SKILL_TRY)
local objeto2 = getThingFromPos(toPosition)
local player = getCreaturePosition(cid)

  if skillLevel == -1 then 
   setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,1)
  end
  for Q = 1, #configs.sign do
    if configs.sign[Q].level[2] == nil then
    configs.sign[Q].level[2] = configs.sign[Q].level[1]
    end
     if skillLevel >= configs.sign[Q].level[1] and skillLevel <= configs.sign[Q].level[2] then
     quant = math.random(configs.sign[Q].quant[1],configs.sign[Q].quant[2])
     percent = configs.sign[Q].percent
      break
     end
  end
 for i = 1, #configs.trees do
  if objeto2.itemid == configs.trees[i] then
    if math.random(1,100) <= percent then
    possible_woods = {{},{}}
        for h = 1, #configs.woods do
          if configs.woods[h][2] == objeto2.itemid then
           possible_woods[1][#possible_woods[1]+1] = configs.woods[h][1] 
          else
            if configs.woods[h][2] == 'all' then
             possible_woods[2][#possible_woods[2]+1] = configs.woods[h][1]
            end
          end
        end
      if possible_woods[1][1] == nil and possible_woods[2][1] == nil then    
       doPlayerSendTextMessage(cid,22,"This tree can not be cut.")
      elseif possible_woods[1][1] ~= nil then    
        doPlayerAddItem(cid,possible_woods[1][math.random(1,#possible_woods[1])],quant)
      elseif possible_woods[1][1] == nil and possible_woods[2][1] ~= nil then    
        doPlayerAddItem(cid,possible_woods[2][math.random(1,#possible_woods[2])],quant)    
      end
     if possible_woods[1][1] ~= nil or possible_woods[2][1] ~= nil then
      if skillTry >= 0 then
        setPlayerStorageValue(cid,STORAGE_SKILL_TRY,skillTry + 1) 
        doPlayerAddSkillTry(cid, 1, 20)
      else 
       setPlayerStorageValue(cid,STORAGE_SKILL_TRY,1)
      end
      doSendMagicEffect(getCreaturePosition(cid), 12)
      doPlayerSendTextMessage(cid,22,"You got "..quant.." wood "..getItemNameById(objeto2.itemid)..".")
      doSendAnimatedText(getCreaturePosition(cid), ''..quant..'', 192, cid) 
      setItemName(objeto2.uid, 'A trunk of '..getItemNameById(objeto2.itemid))
      doSendMagicEffect(toPosition, 3)
      addEvent(doTreeReturn,configs.tree_delay * 1000,toPosition,objeto2.itemid)
      doTransformItem(objeto2.uid, 8792)
      break
     end
    else
     doPlayerSendCancel(cid,"You got nothing") 
     doSendMagicEffect(toPosition, 3)
     setItemName(objeto2.uid, 'A trunk of '..getItemNameById(objeto2.itemid))
     doSendAnimatedText(getCreaturePosition(cid), 'Fail!', 180, cid)
     addEvent(doTreeReturn,configs.tree_delay * 1000,toPosition,objeto2.itemid)
     doTransformItem(objeto2.uid, 8792)
     break
    end
  else
   doPlayerSendCancel(cid,"You can only cut trees")
  end
 end
  if skillTry >= ((skillLevel+1)*3)  then
    if skillLevel == configs.MaxLevel then
     doPlayerSendTextMessage(cid, 22, "Max level reached in lumberjacking.")
     setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)
    else
     setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,skillLevel + 1)
     setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)
     doPlayerSendTextMessage(cid, 22, "You advanced from level ".. skillLevel .." to level ".. skillLevel + 1 .." in Lumberjacking.")
     doSendMagicEffect(getCreaturePosition(cid),14)
     doSendAnimatedText(getCreaturePosition(cid), 'Advance!', 18, cid)
    end
  end
end

 function doTreeReturn(itemposition,oldid)
 local pos = getThingfromPos(itemposition)
  doTransformItem(pos.uid,oldid)
  setItemName(pos.uid, getItemNameById(oldid))
  doSendMagicEffect(itemposition,math.random(28,30))
 end
--Lumberjack by: Lwkass

I've added

Lua:
doPlayerAddSkillTry(cid, 1, 20)

Under

Lua:
setPlayerStorageValue(cid,STORAGE_SKILL_TRY,skillTry + 1)

This way, when player lumberjacks, he get "tries" on fist fighting...

Adjust the number 20 (wich is the amount of "tries" he get when uses) to your needs lol, to see if you can make it similar to the original script, advancing like one u know?
 
*line 28 : local objeto2 = getThingFromPos(toPosition)
*line 23: function onUse(cid, item, fromPosition, itemEx, toPosition)


i have this problem, what is?

(im using tfs 8.50)
 
Stop bumping 1 year old threads.

This is encouragement to stop doing it.
2nsvyhi.gif
 
Back
Top