Ir para conteúdo

vankk

Membro
  • Registro em

  • Última visita

Tudo que vankk postou

  1. Como o título do tópico já diz tudo sobre o script, créditos a mim. local k = { ["Demon"] = { items = { {2160,10} -- item } } } function onKill(cid, target) for name, pos in pairs(k) do if (name == getCreatureName(target)) then doPlayerAddItem(cid, k.items[1], k.items[2]) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) end end return true end
  2. vankk postou uma resposta no tópico em Suporte Tibia OTServer
    @Henriquegb provável que não precise editar outras coisas a não ser o player.cpp, acho que não causaria nenhum conflito. Corrija-me alguém se eu estiver errado.
  3. Tente utilizar isso, um script feito para 1.2 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end local config = { bonusPercent = 2, minimumBet = 100, maximumBet = 10000000 } local storeMoneyAmount = 0 -- Do not touch [We store the amount cash which got betted here] local ITEM_BLOCKING = 8046 local function getMoneyAmount(position) local moneyAmount = 0 for _, item in ipairs(Tile(position):getItems()) do local itemId = item:getId() if itemId == ITEM_GOLD_COIN then moneyAmount = moneyAmount + item.type elseif itemId == ITEM_PLATINUM_COIN then moneyAmount = moneyAmount + item.type * 100 elseif itemId == ITEM_CRYSTAL_COIN then moneyAmount = moneyAmount + item.type * 10000 end end return moneyAmount end local function handleMoney(cid, position, bonus) local npc = Npc(cid) if not npc then return end -- Lets remove the cash which was betted for _, item in ipairs(Tile(position):getItems()) do if isInArray({ITEM_GOLD_COIN, ITEM_PLATINUM_COIN, ITEM_CRYSTAL_COIN, ITEM_BLOCKING}, item:getId()) then item:remove() end end -- We lost, no need to continue if bonus == 0 then npc:say("You lost!", TALKTYPE_SAY) position:sendMagicEffect(CONST_ME_POFF) return end -- Cash calculator local goldCoinAmount = storeMoneyAmount * bonus local crystalCoinAmount = math.floor(goldCoinAmount / 10000) goldCoinAmount = goldCoinAmount - crystalCoinAmount * 10000 local platinumCoinAmount = math.floor(goldCoinAmount / 100) goldCoinAmount = goldCoinAmount - platinumCoinAmount * 100 if goldCoinAmount ~= 0 then Game.createItem(ITEM_GOLD_COIN, goldCoinAmount, position) end if platinumCoinAmount ~= 0 then Game.createItem(ITEM_PLATINUM_COIN, platinumCoinAmount, position) end if crystalCoinAmount ~= 0 then Game.createItem(ITEM_CRYSTAL_COIN, crystalCoinAmount, position) end position:sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE)) npc:say("You Win!", TALKTYPE_SAY) end local function startRollDice(cid, position, number) for i = 5792, 5797 do local dice = Tile(position):getItemById(i) if dice then dice:transform(5791 + number) break end end local npc = Npc(cid) if npc then npc:say(string.format("%s rolled a %d", npc:getName(), number), TALKTYPE_MONSTER_SAY) end end local function executeEvent(cid, dicePosition, number, moneyPosition, bonus) local npc = Npc(cid) if not npc then return end if getMoneyAmount(moneyPosition) ~= storeMoneyAmount then npc:say("Where is the money?!", TALKTYPE_SAY) return end -- Roll Dice addEvent(startRollDice, 400, cid, dicePosition, number) dicePosition:sendMagicEffect(CONST_ME_CRAPS) -- Handle Money addEvent(handleMoney, 600, cid, moneyPosition, bonus) end local function creatureSayCallback(cid, type, msg) if not isInArray({"high", "low"}, msg) then -- Ignore other replies return false end -- Npc Variables local npc = Npc() local npcPosition = npc:getPosition() -- Check if player stand in position local playerPosition = Position(npcPosition.x + 2, npcPosition.y, npcPosition.z) local topCreature = Tile(playerPosition):getTopCreature() if not topCreature then npc:say("Please go stand next to me.", TALKTYPE_SAY) playerPosition:sendMagicEffect(CONST_ME_TUTORIALARROW) playerPosition:sendMagicEffect(CONST_ME_TUTORIALSQUARE) return false end -- Make sure also the player who stand there, is the one who is betting. To keep out people from disturbing if topCreature:getId() ~= cid then return false end -- High or Low numbers local rollType = 0 if msgcontains(msg, "low") then rollType = 1 elseif msgcontains(msg, "high") then rollType = 2 else return false end -- Check money Got betted local moneyPosition = Position(npcPosition.x + 1, npcPosition.y - 1, npcPosition.z) storeMoneyAmount = getMoneyAmount(moneyPosition) if storeMoneyAmount < config.minimumBet or storeMoneyAmount > config.maximumBet then npc:say(string.format("You can only bet min: %d and max: %d gold coins.", config.minimumBet, config.maximumBet), TALKTYPE_SAY) return false end -- Money is betted, lets block them from getting moved // This is one way, else we can set actionid, on the betted cash. Game.createItem(ITEM_BLOCKING, 1, moneyPosition) -- Roll Number local rollNumber = math.random(6) -- Win or Lose local bonus = 0 if rollType == 1 and isInArray({1, 2, 3}, rollNumber) then bonus = config.bonusPercent elseif rollType == 2 and isInArray({4, 5, 6}, rollNumber) then bonus = config.bonusPercent end -- Money handle and roll dice addEvent(executeEvent, 100, npc:getId(), Position(npcPosition.x, npcPosition.y - 1, npcPosition.z), rollNumber, moneyPosition, bonus) return true end function onThink() -- Anti trash local npcPosition = Npc():getPosition() local moneyPosition = Position(npcPosition.x + 1, npcPosition.y - 1, npcPosition.z) for _, item in ipairs(Tile(moneyPosition):getItems()) do local itemId = item:getId() if not isInArray({ITEM_GOLD_COIN, ITEM_PLATINUM_COIN, ITEM_CRYSTAL_COIN, ITEM_BLOCKING}, itemId) and ItemType(itemId):isMovable() then item:remove() end end local dicePosition = Position(npcPosition.x, npcPosition.y - 1, npcPosition.z) for _, item in ipairs(Tile(dicePosition):getItems()) do local itemId = item:getId() if not isInArray({5792, 5793, 5794, 5795, 5796, 5797}, itemId) and ItemType(itemId):isMovable() then item:remove() end end npcHandler:onThink() end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  4. vankk postou uma resposta no tópico em Ouvidoria
    Utilize questlog site:tibiaking.com simples, problema resolvido.
  5. Cria um tópico ai que eu tento fazer daqui a pouco.
  6. vankk postou uma resposta no tópico em Suporte Tibia OTServer
    Isso é um problema em suas libs, tente atualiza-las novamente.
  7. vankk postou uma resposta no tópico em Suporte Tibia OTServer
    Se você utilizar TFS 0.4 nas sources, acredito eu que seja em player.cpp. Posso estar errado também..
  8. local k = { ["Demon"] = { items = { {2160,10} -- item } } } function onKill(cid, target) for name, pos in pairs(k) do if (name == getCreatureName(target)) then doPlayerAddItem(cid, k.items[1], k.items[2]) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) end end return true end
  9. vankk postou uma resposta no tópico em Suporte Tibia OTServer
    Sem o script não tem muita coisa o que eu/alguém fazer alguma coisa.
  10. Qual TFS você está usando?
  11. Eu achei um script na internet, e dei uma leve editada, da uma conferida, porém, é NPC: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local Topic = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function getPoints(cid) local res = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."' LIMIT 1 ;") local value = 0 if(res:getID() ~= -1) then value = res:getDataInt("premium_points") res:free() end return value end function transfer(from,to,amount) local pid = (getAccountIdByName(string.lower(to))) local player = getAccountIdByName(string.lower(getCreatureName(from))) db.executeQuery("UPDATE `accounts` set `premium_points`=`premium_points` - '"..amount.."' WHERE `id` = '"..player.."' ;") db.executeQuery("UPDATE `accounts` set `premium_points`=`premium_points` + '"..amount.."' WHERE `id` = '"..pid.."' ;") end function greetCallback(cid) Topic[cid] = 0 return true end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if (msgcontains(msg, 'transfere') or msgcontains(msg, 'yes')) and Topic[cid] ~= 1 and Topic[cid] ~= 2 then selfSay("Ok, You have "..getPoints(cid).." premium points, how much you want to transfer?",cid) Topic[cid] = 1 elseif Topic[cid] == 1 then if not tonumber(msg) then selfSay("You must type the amount of points, try again!",cid) else msg = math.floor(math.abs(msg)) t= {} if tonumber(msg) > getPoints(cid) then return selfSay("You only have "..getPoints(cid)..", try again!",cid) end table.insert(t,msg) selfSay("To who this will be transfered?",cid) Topic[cid] = 2 end elseif Topic[cid] == 2 then if getPoints(cid) < t[2] then selfSay("You only have "..getPoints(cid)..", try again!",cid) Topic[cid] = 1 return true end if getAccountIdByName(msg) > 0 then transfer(cid, msg, t[1]) selfSay("You have successfuly transfered "..t[2].." points to "..msg..".",cid) Topic[cid] = 0 else selfSay("Player doesnt exist, try again!",cid) end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  12. @BielZet Posso colocar esse servidor no GitHub e ir arrumando os bugs que as pessoas irem reportando nele? E você da o link no tópico falando disso?
  13. Pelo o que eu entendi, acho que foi isso que você queria.. 1 minuto e meio para fazer isso, credo. local k = { itemID = 9999, -- id do item countID = 3, -- quantidade de frutas que pode dar monster = "Kongra" -- monster } function onUse(cid, item, fromPosition, itemEx, toPosition) if math.random (100) == 40 then doPlayerAddItem(cid, k.itemID, k.countID) else doSendMagicEffect(toPosition, 10) doSummonCreature(k.monster, toPosition) end return TRUE end E só você configurar o uniqueid/action no actions.xml, e colocar aonde que você quiser.
  14. Você está com problema com rings que não funcionam em certas vocations, e esses rings que não dão atributos? Você tem certeza que é por vocation? Pode confirmar isso? E também pode conferir se esse problema pode acontecer com outros items também?
  15. vankk postou uma resposta no tópico em Playground (Off-topic)
    Se eu responder sua mãe liga acho que vou tomar ban de novo, então deixo passar. E já vou fazendo minha declaração.. @Wakon NÃO COMENTEI NADA DE DESRESPEITOSO COM ESSE NEWFAG.
  16. Eu sou carioca, falo doente para tudo, mas vejo que aqui realmente você é.
  17. E nem vai resolver se você não postar o code, doente.
  18. Se resolveu porque não compartilha no fórum a solução? Vai ver que outras pessoas venham a ter o mesmo problema daqui uns anos, e poderiam utilizar esse tópico
  19. Ninguém aqui tem o poder de adivinhar o código que está dando problema.
  20. Voltei e já vou começar a dar rage de novo!! Os créditos não seriam apenas pelo cliente do Tibia, devido a o servidor ser rl map, então os créditos da CipSoft deveria continuar, porque se não fosse a CipSoft, não teríamos um servidor rl map, não é mesmo meu caro? Só alertando hehe. Abraço.
  21. vankk postou uma resposta no tópico em Playground (Off-topic)
    E AGR VÃO TER QUE ME ENGOLIR!
  22. vankk postou uma resposta no tópico em Playground (Off-topic)
    vai toma no meu cu, ficou irado!!! Combinou com a outfit, e blabla. Obrigado pela sugestão. e @Heyron alguns até utilizam, mas eu acho que não fica maneiro, devido a eu jogar LoL, ai acho que não é legal/interessante misturar as duas coisas.
  23. vankk postou uma resposta no tópico em Playground (Off-topic)
    Nomes de champions de LoL não combinam em Tibia.
  24. Adiciona um , no final da linha 7, e sim.

Informação Importante

Confirmação de Termo