Tudo que BennyDz postou
-
(Resolvido)apoio para a criação de itens no chão
function onUse(cid, item, fromPosition, itemEx, toPosition) doCreateItem(9565, 1, toPosition) end want: function onUse(cid, item, fromPosition, itemEx, toPosition) if iswalkeable then doCreateItem(9565, 1, toPosition) else doSendMagicEffect(toPosition, 2) end how? function isWalkable(pos) pos.stackpos = 0 local tile = getThingfromPos(pos, false) if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then return true end end solved
-
Get Level Total Guild
function getGuildLevel(cid) local Info = db.getResult("SELECT SUM(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = "..getPlayerGuildId(cid)..") ") local level= Info:getDataInt("level") return level end soma nivel de membros de uma aliança exemplo: function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Guild Level Total: "..getGuildLevel(cid).." .") return true end
-
galera ajuda em mysql level guild total Acabei de resolver
Acabei de resolver. e eu criei uma função e eu criei uma função. se alguém serve deixo aqui. todos os créditos são para mim. function getGuildLevel(cid) local Info = db.getResult("SELECT SUM(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = "..getPlayerGuildId(cid)..") ") local level= Info:getDataInt("level") return level end
- sistema mercenário
- sistema mercenário
- sistema mercenário
-
sistema mercenário
Olá amigos , pode ser um NPC mercenário toda vocação é alugado ? você alugar um cavaleiro mercenário que você acompanha onde quer que vá , e você cobra por este tempo com você , o cavaleiro mercenário teria a capacidade: knight: estar sempre dois quadros à frente de você e se eles atacarem sua raiva mestre fazer " exeta res " para bloquear inimigo. druid: mercenários druida , que será sempre sendo abrigados atrás de seu mestre. sempre curar seu mestre. sorcerer: Este mercenário só teria a capacidade de bater duro com Sd e varinha. também estar sempre atrás de seu mestre paladin: Este mercenário terá habilidades paladino com estrela assassino como um paladino kkk
-
ajuda editar esse script pequenas modificações Eu é urgente para mim, estou desesperado :(
thanks friend xD! Eu quero continuar com uma idéia que eu tenho em mente, mas eu estou preso com esse problema resuelto solved xD
-
ajuda editar esse script pequenas modificações Eu é urgente para mim, estou desesperado :(
TFS 0.4 English: Hello Good evening , I'm trying to edit the system of mock. I want only the hp and mp are in % I know I only have to remove PERCENT on conditions. but my problem is in the name of the item: You see a demon armor [mp.+43%] [ml.+3] [dist.+3] (Arm:16). It weighs 80.00 oz. I modify the action for mp and hp only get the % sign. but only receives the attributes with the% sign: 21:51 You have: 43% more of mp as modified creaturescript? to read all attributes , even without the % sign. português: Eu estou tentando este sistema apenas o HP e MP em % as skills não em % Eu sei que a mudança remove PERCENT em conditions mas o meu problema é que, se os atributos não carregam asim: You see a demon armor [mp.+43%] [ml.+3] [dist.+3] (Arm:16). It weighs 80.00 oz. o creaturescript não carregar os atributos sem o sinal % apenas: 21:51 You have: 43% more of mp creaturescript complete: ---Script by mock the bear! local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{} for i=1,100 do ---Carrega as conditions --- HP conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+i) setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50) --MANA conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANAPERCENT, 100+i) setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51) --Magic level conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICLEVEL, 100+i) setConditionParam(conditionML[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52) --club axe sword conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_CLUBPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_SWORDPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_AXEPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53) --- shield conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i) setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54) --- dist conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i) setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55) end function getSlotType(n) --By mock the bear if not n then return false end if n:match('%[(.+)%]') then n = n:match('%[(.+)%]') if n == '?' then return 0,n else return n:match('(.-)%.([+-])(%d+)%%') end else return false end end local function loadSet(cid) local t = {} for slot=1,9 do t[slot] = '' local s = getPlayerSlotItem(cid,slot).uid if s ~= 0 then t[slot] = getItemName(s) end end return t end function isInArray2(arr,var) -- Because in some servers it return 1 and 0 and others true and false for i,b in pairs(arr) do if var == b then return true end end return false end function check2(cid,i) if i == 5 or i == 6 then if isInArray({'head','necklace','backpack','body','legs','feet','ring'},getItemValue(getPlayerSlotItem(cid,i).itemid,'slotType') or '') then return false end end return true end function chk(cid,f) if not isPlayer(cid) then return end local t = loadSet(cid) for i=1,#f do if f[i] ~= t[i] then equip(cid,nil,slot) break end end addEvent(chk,2000,cid,t) end items = { ---- Only to get attr: slotType because getItemName dont return it -.-' _VERSION='1.0 By mock', XML_DIR='data/items/items.xml', } do local ia = os.clock() io.write('Loading items') local i = io.open(items.XML_DIR,'r') local u = i:read(-1) i:close() local u = u:match('<items>(.+)</items>') for mi,id,mid,name,data,me in u:gmatch('<(%a-)%s*id%s*=%s*"(%d+)"%s*(.-)%s*name%s*=%s*"(.-)"%s*>(.-)</(%a*)>') do if mi == 'item' and me == 'item' then local td = {name=name,id=id,type=1} for key,value in data:gmatch('<attribute key="(.-)" value="(.-)"/>') do td[key] = value end for key,value in mid:gmatch('(.-)="(.-)"') do td[key] = value end items[tonumber(id)] = td items[name] = td end end for mi,id,mid,name,data in u:gmatch('<(%a-)%s*id%s*=%s*"(%d*)"%s*(.-)%s*name%s*=%s*"(%a+)"%s*/>') do if mi == 'item' then local td = {name=name,id=id,type=2} for key,value in mid:gmatch('(.-)="(.-)"') do td[key] = value end items[tonumber(id)] = td items[name] = td end end io.write('[done '..os.clock()-ia..']\n') end function getItemValue(item,value) return items[item] and items[item][value] end function equip(cid,item,slot) --By mock the bear local HP = getCreatureHealth(cid) local MP = getCreatureMana(cid) local t = {} if item then local mm,sinal,qto = getSlotType(getItemName(item.uid)) t[mm] = tonumber(qto) end for i=1,9 do -- Not on slot 10 > arrow if i ~= slot then if getPlayerSlotItem(cid,i).itemid ~= 0 then local aab = getPlayerSlotItem(cid,i).uid if aab and check2(cid,i) then for _ in getItemName(aab):gmatch('(%[.-%])') do local mm,sinal,qto2 = getSlotType(_) if mm then if not t[mm] then t[mm] = 0 end t[mm] = t[mm]+tonumber(qto2) t[mm] = t[mm] > 100 and 100 or t[mm] end end end end end end local fu = 0 local ca = {} local s = '' for sl,n in pairs(t) do fu = fu+1 s = s..''..n..'% more of '..sl..'\n' if sl == 'hp' then doAddCondition(cid,conditionHP[tonumber(n)]) doCreatureAddHealth(cid,HP-getCreatureHealth(cid)) ca[50] = 1 doPlayerSendTutorial(cid,19) elseif sl == 'mp' then doAddCondition(cid,conditionMP[tonumber(n)]) doCreatureAddMana(cid,HP-getCreatureMana(cid)) ca[51] = 1 doPlayerSendTutorial(cid,19) elseif sl == 'ml' then doAddCondition(cid,conditionML[tonumber(n)]) ca[52] = 1 elseif sl == 'cas' then doAddCondition(cid,conditionCLUB[tonumber(n)]) ca[53] = 1 elseif sl == 'shield' then doAddCondition(cid,conditionSHI[tonumber(n)]) ca[54] = 1 elseif sl == 'dist' then doAddCondition(cid,conditionDIST[tonumber(n)]) ca[55] = 1 end end if fu > 0 then addEvent(doPlayerSendTextMessage,100,cid,24,'You have:\n'..s) for i=50,55 do if not ca[i] then doRemoveCondition(cid,CONDITION_ATTRIBUTES,i) end end else for i=50,55 do doRemoveCondition(cid,CONDITION_ATTRIBUTES,i) end end return true end function onLogin(cid) ---Script by mock the bear! equip(cid,nil,slot) addEvent(chk,2000,cid,loadSet(cid)) -- Here we check! return TRUE end action com algumas modificações: --[[ Slot system 100% by mock \o ]] ---Config local conf = { maxSlotCount=1, ignoredIds={} } --End function choose(...) --- Function by mock. local arg = {...} return arg[math.random(1,#arg)] end if not getItemAttack then function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end end local function isArmor(uid) -- Function by Mock the bear. if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 and not isItemStackable(uid) then return true end return false end function onUse(cid, item, fromPosition, itemEx, toPosition) -- Script by mock the bear (MTB) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(conf.ignoredIds, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.") return TRUE end if isCreature(itemEx.uid) then return FALSE end local nam = getItemName(itemEx.uid) function getper() local n = 1 for i=1,10 do n = n+math.random(0,10) if n < 8*i then break end end return n end function getSlotCount(nam) local c = 0 for _ in nam:gmatch('%[(.-)%]') do c = c+1 end return c end if getSlotCount(nam) >= conf.maxSlotCount then doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.") return true end xl1 = choose('hp','mp','ml','cas','shield','dist') xp1 = getper() if xl1 == "hp" or xl1 == "mp" then xvalor1 = "%" else xvalor1 = "" end doSendMagicEffect(toPosition,30) nam = nam..' [***] ['..xl1..'.+'..xp1..''..xvalor1..']' doSendAnimatedText(toPosition,'RARE',TEXTCOLOR_YELLOW) doItemSetAttribute(itemEx.uid,'name',nam) doRemoveItem(item.uid,1) end return true end se você pode me ajudar a adicionar atributos como "velocidade", "regeneração" "protecfire" etc. ajuda
-
[Action] Error script addon
local config = { [4001] = { name = "First Citizen Addon", -- name addon_type = 1, -- addon outfit = {136,128}, -- female / male cost = 0, -- cost items = {{5878,100}}, -- items }, [4002] = { name = "Second Citizen Addon", addon_type = 2, outfit = {136,128}, cost = 0, items = {{5890,100},{5902,50},{2480,1}}, }, [4003] = { name = "First Hunter Addon", addon_type = 1, outfit = {137,129}, cost = 0, items = {{5947,1},{5876,100},{5948,100},{5889,1},{5887,1},{5888,1},{5891,5}}, }, [4004] = { name = "Second Hunter Addon", addon_type = 2, outfit = {137,129}, cost = 0, items = {{5875,1}}, }, [4005] = { name = "First Mage Addon", addon_type = 1, outfit = {138,130}, cost = 0, items = {{5958,1}}, }, [4006] = { name = "Second Mage Addon", addon_type = 2, outfit = {138,130}, cost = 0, items = {{5903,1}}, }, [4007] = { name = "First Knight Addon", addon_type = 1, outfit = {139,131}, cost = 0, items = {{5880,100}}, }, [4008] = { name = "Second Knight Addon", addon_type = 2, outfit = {139,131}, cost = 0, items = {{5893,100},{5924,1},{5885,1},{5887,1}}, }, [4009] = { name = "First Nobleman Addon", addon_type = 1, outfit = {140,132}, cost = 150000, items = {}, }, [4010] = { name = "Second Nobleman Addon", addon_type = 2, outfit = {140,132}, cost = 150000, items = {}, }, [4011] = { name = "First Summoner Addon", addon_type = 1, outfit = {141,133}, cost = 0, items = {{5958,1}}, }, [4012] = { name = "Second Summoner Addon", addon_type = 2, outfit = {141,133}, cost = 0, items = {{5894,70},{5911,20},{5883,40},{5905,30},{5904,15},{5882,40},{5881,60},{5886,10},{5922,35}}, }, [4013] = { name = "First Warrior Addon", addon_type = 1, outfit = {142,134}, cost = 0, items = {{5899,100},{5925,100},{5884,1},{5919,1}}, }, [4014] = { name = "Second Warrior Addon", addon_type = 2, outfit = {142,134}, cost = 0, items = {{5887,1},{5880,100}}, }, [4015] = { name = "First Barbarian Addon", addon_type = 1, outfit = {147,143}, cost = 0, items = {{5885,1},{5884,1},{5911,50},{5910,50},{5886,10}}, }, [4016] = { name = "Second Barbarian Addon", addon_type = 2, outfit = {147,143}, cost = 0, items = {{5892,1},{5880,100},{5893,50},{5876,50}}, }, [4017] = { name = "First Druid Addon", addon_type = 1, outfit = {148,144}, cost = 0, items = {{5897,50},{5896,50}}, }, [4018] = { name = "Second Druid Addon", addon_type = 2, outfit = {148,144}, cost = 0, items = {{5940,1},{5938,1},{5937,1},{5942,1},{5906,100}}, }, [4019] = { name = "First Wizard Addon", addon_type = 1, outfit = {149,145}, cost = 0, items = {{2488,1},{2123,1},{2492,1},{2536,1}}, }, [4020] = { name = "Second Wizard Addon", addon_type = 2, outfit = {149,145}, cost = 0, items = {{5922,50},}, }, [4021] = { name = "First Oriental Addon", addon_type = 1, outfit = {150,146}, cost = 0, items = {{5945,1}}, }, [4022] = { name = "Second Oriental Addon", addon_type = 2, outfit = {150,146}, cost = 0, items = {{5883,100},{5895,100},{5891,2},{5912,100}}, }, [4023] = { name = "First Pirate Addon", addon_type = 1, outfit = {155,151}, cost = 0, items = {{6126,100},{6097,100},{6098,100}}, }, [4024] = { name = "Second Pirate Addon", addon_type = 2, outfit = {155,151}, cost = 0, items = {{2385,1},{6098,1},{6095,1},{6096,1}}, }, [4025] = { name = "First Assassin Addon", addon_type = 1, outfit = {156,152}, cost = 0, items = {{5898,30},{5882,10},{5881,30},{5895,20},{5905,20},{5906,10},{5885,1}}, }, [4026] = { name = "Second Assassin Addon", addon_type = 2, outfit = {156,152}, cost = 0, items = {{5909,50},{5910,50},{5911,50},{5912,50},{5913,50},{5914,50},{5886,10}}, }, [4027] = { name = "First Beggar Addon", addon_type = 1, outfit = {157,153}, cost = 20000, items = {{5883,100}}, }, [4028] = { name = "Second Beggar Addon", addon_type = 2, outfit = {157,153}, cost = 0, items = {{6107,1}}, }, [4029] = { name = "First Shaman Addon", addon_type = 1, outfit = {158,154}, cost = 0, items = {{3955,5},{5015,1}}, }, [4030] = { name = "Second Shaman Addon", addon_type = 2, outfit = {158,154}, cost = 0, items = {{3966,5},{3967,5}}, }, [4031] = { name = "First Norseman Addon", addon_type = 1, outfit = {252,251}, cost = 0, items = {{7290,5}}, }, [4032] = { name = "Second Norseman Addon", addon_type = 2, outfit = {252,251}, cost = 0, items = {{7290,10}}, }, [4033] = { name = "First Nightmare Addon", addon_type = 1, outfit = {269,268}, cost = 0, items = {{6500,500}}, }, [4034] = { name = "Second Nightmare Addon", addon_type = 2, outfit = {269,268}, cost = 0, items = {{6500,1500}}, }, [4035] = { name = "First Jester Addon", addon_type = 1, outfit = {270,273}, cost = 0, items = {{5879,1},{5878,4}}, }, [4036] = { name = "Second Jester Addon", addon_type = 2, outfit = {270,273}, cost = 0, items = {{5909,5}}, }, [4037] = { name = "First Brotherhood Addon", addon_type = 1, outfit = {279,278}, cost = 0, items = {{6500,500}}, }, [4038] = { name = "Second Brotherhood Addon", addon_type = 2, outfit = {279,278}, cost = 0, items = {{6500,1500}}, }, [4039] = { name = "First Demonhunter Addon", addon_type = 1, outfit = {288,289}, cost = 150000, items = {}, }, [4040] = { name = "Second Demonhunter Addon", addon_type = 2, outfit = {288,289}, cost = 150000, items = {}, }, [4041] = { name = "First Yalaharian Addon", addon_type = 1, outfit = {324,325}, cost = 150000, items = {}, }, [4042] = { name = "Second Yalaharian Addon", addon_type = 2, outfit = {324,325}, cost = 150000, items = {}, }, } -------- config end ------- local storage = 14000 function onUse(cid, item, fromPosition, itemEx, toPosition) local addon, removeItems, removeMoney = config[item.actionid], 0, 0 if getPlayerStorageValue(cid, storage + item.actionid) ~= 1 then if getPlayerMoney(cid) >= addon.cost then removeMoney = 1 end if #addon.items > 0 then for i = 1, #addon.items do if getPlayerItemCount(cid, addon.items[i][1]) >= addon.items[i][2] then removeItems = removeItems+1 end end end if removeMoney == 1 and removeItems == #addon.items then for i = 1, #addon.items do doPlayerRemoveItem(cid, addon.items[i][1], addon.items[i][2]) end doPlayerRemoveMoney(cid, addon.cost) doPlayerAddOutfit(cid, addon.outfit[1], addon.addon_type) doPlayerAddOutfit(cid, addon.outfit[2], addon.addon_type) setPlayerStorageValue(cid, storage + item.actionid, 1) doPlayerSendTextMessage(cid, 21, "Now you can use the "..addon.name..".") else if addon.cost ~= 0 then msg = "You need "..addon.cost.." gold coins and " else msg = "You need " end if #addon.items > 0 then for i = 1, #addon.items do msg = msg..""..addon.items[i][2].."x "..getItemNameById(addon.items[i][1]).." " end end doPlayerSendTextMessage(cid, 21, msg.."for the "..addon.name..".") end else doPlayerSendTextMessage(cid, 21, "You already have the "..addon.name..".") end return TRUE end <action actionid="4001-4042" event="script" value="addons.lua"/> for yuur all addons.
-
[Action] Error script addon
try this: function onUse(cid, item, frompos, item2, topos) local itens = {2160} ----dinheiro necessário local itens2 = {2189, 2191, 2187, 2190, 2181, 2188, 8921} ---- items necessários local storageaddon = 100003 -- change storage for diferent addons. local cantidadcc = 25 --- candidad do cc if getPlayerStorageValue(cid,storageaddon) >= 1 then --- check if you have the addon doPlayerSendTextMessage(cid,22,"You own this addon!") return 1 end if getPlayerItemCount(cid, itens) >= cantidadcc and getPlayerItemCount(cid, itens2) >= 1 then doPlayerRemoveItem(cid, itens, cantidadcc) doPlayerRemoveItem(cid, itens2, 1) doPlayerSendTextMessage(cid,22,"You won a full mage addon!") -- msg ao ganhar addon doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE) doPlayerAddOutfit(cid,138,3) doPlayerAddOutfit(cid,120,3) setPlayerStorageValue(cid,storageaddon,1) else doPlayerSendTextMessage(cid,22,"You need 1 wand of cosmic energy, 1 wand of draconia, 1 wand of dragonbreath, 1 wanf of inferno, 1 wand of vortex, 1 terra rod, 1 common akilles wand and more 250.000 cash for this addon!") -- msg dos items necessários pro addon return 1 end end
-
CAST SYSTEM TFS 1.0
work em tfs 1.0?
-
como começar em OTClient?
e eu aprendi .lua................... minha única questão é saber qual a versão do Otclient. comensar favorese me para editar ..... e saber se alguém tem links. ou algo semelhante .......
-
como começar em OTClient?
Olá amigos, eu quero alguém para me dar uma base para trabalhar comensar meu cliente ser tibia 8.6 com alguns sprites custum. e baixe alguns arquivos, mas não quero estar errado e eu quero começar e editar o meu cliente.
-
duvida Otclient Bots Tibia
Olá amigos , " Otclient " suporta algumas bot ? o que acontece que eu tenho uma guerra servidor, e eu quero meus players usem Magebot , etc.