
ikaroangelo21
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
ikaroangelo21 recebeu reputação de Joaogabriel em (Resolvido)Erro stamina systemeventsId = {} local function rechargeStamina(cid) if not isPlayer(cid) then eventsId[cid] = nil return end doPlayerAddStamina(cid, 1) eventsId[cid] = addEvent(rechargeStamina, 3 * 60 * 1000, cid) end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then eventsId[cid] = addEvent(rechargeStamina, 3 * 60 * 1000, cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bem vindo aos trainers VIP's " .. getCreatureName(cid) .."! Você receberá 1 minuto de stamina a cada 3 minutos nos trainers VIP's.") end return true end function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then stopEvent(eventsId[cid]) eventsId[cid] = nil end return true end Onde tem 1 = ganho de stamina.
Onde tem 3 = o tempo para ganhar 1 minuto.
Somente modificar, testado em otx 8.60.
-
ikaroangelo21 recebeu reputação de cs007 em (Resolvido)COMO COMPILAR OTX OU TFS NO UBUNTU 16.04sudo apt-get install libboost-all-dev @robson pablo dos san
-
ikaroangelo21 recebeu reputação de Pifafa em (Resolvido)Erro de Exasuted?!exhaustion = { check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end return getPlayerStorageValue(cid, storage) >= os.time() end, get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time() if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time() + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end }
-
ikaroangelo21 recebeu reputação de poko360 em [Action] script de exp potionUsa esse MOD, melhor.
<?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppotion"><![CDATA[ exp_info = {rate = 0.2, storage = {354870,354871,354872}, minutes = 30} -- rate 0.2 = 20% function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") local rates = getPlayerRates(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Exp Potion.") doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate) setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) if getPlayerStorageValue(cid, exp_info.storage[3]) > 0 and getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua Exp Potion acabou!") -- doPlayerSetExperienceRate(cid, getPlayerStorageValue(cid, exp_info.storage[2])) local rates = getPlayerRates(cid) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]-exp_info.rate) setPlayerStorageValue(cid, exp_info.storage[3], 0) -- registro end return true end]]></event> <talkaction words="!exppotion;/exppotion;!exp;/exp" event="buffer"><![CDATA[ domodlib('exppotion') return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 and "Você não possui Exp Potion ativa no momento." or "Você tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de exp potion.")]]></talkaction> <action itemid="12698" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra Exp Potion pois ainda possui uma ativa. Ainda restam: "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time())..".") return true end local rates = getPlayerRates(cid) -- setPlayerStorageValue(cid, exp_info.storage[2], rates[SKILL__LEVEL]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou Exp potion por "..exp_info.minutes.." minutos! Durante este tempo, você receberá +20% exp de monstros. Para saber o tempo, digite: /exppotion") setPlayerStorageValue(cid, exp_info.storage[1], os.time()+exp_info.minutes*60) setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate) registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid,1) return true end]]></action> </mod>
-
ikaroangelo21 recebeu reputação de subhe em (Resolvido)Erro stamina systemeventsId = {} local function rechargeStamina(cid) if not isPlayer(cid) then eventsId[cid] = nil return end doPlayerAddStamina(cid, 1) eventsId[cid] = addEvent(rechargeStamina, 3 * 60 * 1000, cid) end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then eventsId[cid] = addEvent(rechargeStamina, 3 * 60 * 1000, cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bem vindo aos trainers VIP's " .. getCreatureName(cid) .."! Você receberá 1 minuto de stamina a cada 3 minutos nos trainers VIP's.") end return true end function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then stopEvent(eventsId[cid]) eventsId[cid] = nil end return true end Onde tem 1 = ganho de stamina.
Onde tem 3 = o tempo para ganhar 1 minuto.
Somente modificar, testado em otx 8.60.
-
ikaroangelo21 recebeu reputação de Mathias Kenfi em (Resolvido)Erro stamina systemeventsId = {} local function rechargeStamina(cid) if not isPlayer(cid) then eventsId[cid] = nil return end doPlayerAddStamina(cid, 1) eventsId[cid] = addEvent(rechargeStamina, 3 * 60 * 1000, cid) end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then eventsId[cid] = addEvent(rechargeStamina, 3 * 60 * 1000, cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bem vindo aos trainers VIP's " .. getCreatureName(cid) .."! Você receberá 1 minuto de stamina a cada 3 minutos nos trainers VIP's.") end return true end function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then stopEvent(eventsId[cid]) eventsId[cid] = nil end return true end Onde tem 1 = ganho de stamina.
Onde tem 3 = o tempo para ganhar 1 minuto.
Somente modificar, testado em otx 8.60.
-
ikaroangelo21 recebeu reputação de Jeff Delay em Guild House@jeffersson s2
guildHalls = false para guildHalls = true, resto e no rme editor.
-
ikaroangelo21 recebeu reputação de Kitsune Shiro em (Resolvido)[Duvida] Broadcast bugadoesqueci isso de inicio, atualizei o código, com a função, faça o teste @Kitsune Shiro
local items = { {itemId = 12377, count = 1, chance = 30}, {itemId = 11987, count = 1, chance = 20}, {itemId = 12338, count = 1, chance = 20}, {itemId = 12032, count = 1, chance = 20}, {itemId = 12031, count = 1, chance = 20}, {itemId = 12030, count = 1, chance = 20}, {itemId = 12547, count = 1, chance = 10}, {itemId = 15685, count = 1, chance = 1}, } function onUse(cid, item, frompos, item2, topos) local config = { pos = getCreaturePosition(cid), exhaustionSeconds = 3600, storageUse = 44231, } if(exhaustion.check(cid, config.storageUse)) then if (exhaustion.get(cid, config.storageUse) >= 60) then doPlayerSendCancel(cid, "Voce so poderar abrir o bau novamente em " .. math.floor(exhaustion.get(cid, config.storageUse) / 60 + 1) .." minutos.") end if (exhaustion.get(cid, config.storageUse) <= 60) then doPlayerSendCancel(cid, "Voce precisa esperar " .. exhaustion.get(cid, config.storageUse).." segundos.") end return true end local totalChance, randomTable, randomNumber = 0, {}, 0 addEvent(doPlayerSendTextMessage, 1*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 2*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 3*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 4*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 5*1000, cid, 27, "Procurando algo...") addEvent(doSendAnimatedText, 1*1000, config.pos, "[5]", 180) addEvent(doSendAnimatedText, 2*1000, config.pos, "[4]", 180) addEvent(doSendAnimatedText, 3*1000, config.pos, "[3]", 180) addEvent(doSendAnimatedText, 4*1000, config.pos, "[2]", 180) addEvent(doSendAnimatedText, 5*1000, config.pos, "[1]", 180) addEvent(doSendAnimatedText, 6*1000, config.pos, "DONE!", 180) for _, itemInfo in pairs (items) do randomTable[itemInfo.itemId] = {min = totalChance + 1, max = itemInfo.chance, count = itemInfo.count or 1} totalChance = totalChance + itemInfo.chance end randomNumber = math.random(1, totalChance) for itemId, itemInfo in pairs (randomTable) do local min, max = itemInfo.min, itemInfo.min + itemInfo.max if randomNumber >= min and randomNumber <= max then local newItem = addEvent(doPlayerAddItem, 6*1000, cid, itemId, itemInfo.count, false) if not newItem then return doPlayerSendCancel(cid, "Voce nao tem espaco para receber o item!") end doRemoveItem(item.uid, 1) exhaustion.set(cid, config.storageUse, config.exhaustionSeconds) local iInfo = getItemInfo(itemId) if itemId == 2160 then addEvent(doBroadcastMessage, 6*1000, getCreatureName(cid) .. " recebeu NOMEDOITEM.") end addEvent(doPlayerSendTextMessage, 6*1000, cid, 27, "Voce achou ("..iInfo.name..")!") break end end return true end
-
ikaroangelo21 recebeu reputação de Kitsune Shiro em (Resolvido)[Duvida] Broadcast bugadolocal items = { {itemId = 12377, count = 1, chance = 30}, {itemId = 11987, count = 1, chance = 20}, {itemId = 12338, count = 1, chance = 20}, {itemId = 12032, count = 1, chance = 20}, {itemId = 12031, count = 1, chance = 20}, {itemId = 12030, count = 1, chance = 20}, {itemId = 12547, count = 1, chance = 10}, {itemId = 15685, count = 1, chance = 1}, } function onUse(cid, item, frompos, item2, topos) local config = { pos = getCreaturePosition(cid), exhaustionSeconds = 3600, storageUse = 44231, } if(exhaustion.check(cid, config.storageUse)) then if (exhaustion.get(cid, config.storageUse) >= 60) then doPlayerSendCancel(cid, "Voce so poderar abrir o bau novamente em " .. math.floor(exhaustion.get(cid, config.storageUse) / 60 + 1) .." minutos.") end if (exhaustion.get(cid, config.storageUse) <= 60) then doPlayerSendCancel(cid, "Voce precisa esperar " .. exhaustion.get(cid, config.storageUse).." segundos.") end return true end local totalChance, randomTable, randomNumber = 0, {}, 0 addEvent(doPlayerSendTextMessage, 1*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 2*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 3*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 4*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 5*1000, cid, 27, "Procurando algo...") addEvent(doSendAnimatedText, 1*1000, config.pos, "[5]", 180) addEvent(doSendAnimatedText, 2*1000, config.pos, "[4]", 180) addEvent(doSendAnimatedText, 3*1000, config.pos, "[3]", 180) addEvent(doSendAnimatedText, 4*1000, config.pos, "[2]", 180) addEvent(doSendAnimatedText, 5*1000, config.pos, "[1]", 180) addEvent(doSendAnimatedText, 6*1000, config.pos, "DONE!", 180) for _, itemInfo in pairs (items) do randomTable[itemInfo.itemId] = {min = totalChance + 1, max = itemInfo.chance, count = itemInfo.count or 1} totalChance = totalChance + itemInfo.chance end randomNumber = math.random(1, totalChance) for itemId, itemInfo in pairs (randomTable) do local min, max = itemInfo.min, itemInfo.min + itemInfo.max if randomNumber >= min and randomNumber <= max then local newItem = addEvent(doPlayerAddItem, 6*1000, cid, itemId, itemInfo.count, false) if not newItem then return doPlayerSendCancel(cid, "Voce nao tem espaco para receber o item!") end doRemoveItem(item.uid, 1) exhaustion.set(cid, config.storageUse, config.exhaustionSeconds) local iInfo = getItemInfo(itemId) if itemId == 2160 then addEvent(doBroadcastMessage, 6*1000, getCreatureName(cid) .. " recebeu NOMEDOITEM.") end addEvent(doPlayerSendTextMessage, 6*1000, cid, 27, "Voce achou ("..iInfo.name..")!") break end end return true end Atualizado
-
ikaroangelo21 recebeu reputação de Diego767 em (Resolvido)(Ajuda) Items e Movements<movevent event="Equip" itemid="36759" slot="feet" level="500" function="onEquipItem"> <vocation id="1" /> <vocation id="5" showInDescription="0" /> <vocation id="2" /> <vocation id="6" showInDescription="0" /> </movevent> <movevent type="DeEquip" itemid="36759" slot="feet" level="500" function="onDeEquipItem" />
-
ikaroangelo21 recebeu reputação de fininhuloko em OTXServer Global Full by ADM Kaboqual erro?
-
ikaroangelo21 deu reputação a alexpaimel em ESCOLHER CAVE POR ALAVANCA E MOSTRAR MINUTOS E SEGUNDOS NO PISO.Amigo, não é 100% da forma que deseja.. porém é 80%. Segue.
data/actions/actions.xml
data/actions/scripts
Crie um arquivo com o nome do script
É um sistema de hunt exclusiva por alavanca, o sistema remove X itens da BP do Jogador e ele tem acesso a cave, durante 1h30. Caso outro player clique la alavanca, avisará que já tem um membro dentro dela e faltam Xh + Xmin + Xsec para acabar. Ou que mesmo caso o player não esteja dentro dela, a cave possui um dono e ele pode voltar durante seu tempo.
O script já está autoexplicativo, você consegue ler e configurar.
-
ikaroangelo21 recebeu reputação de kinomoto em Npc bank não funcionalocal keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local Topic, count, transfer = {}, {}, {} 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 local function getCount(s) local b, e = s:find('%d+') return b and e and math.min(4294967295, tonumber(s:sub(b, e))) or -1 end local function findPlayer(name) local q = db.getResult('SELECT name FROM players WHERE name=' .. db.escapeString(name) .. ' LIMIT 1'), nil if q:getID() == -1 then return end local r = q:getDataString('name') q:free() return r end function greet(cid) Topic[cid], count[cid], transfer[cid] = nil, nil, nil return true end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false elseif msgcontains(msg, 'balance') then npcHandler:say('Your account balance is ' .. getPlayerBalance(cid) .. ' gold.', cid) Topic[cid] = nil elseif msgcontains(msg, 'deposit') and msgcontains(msg, 'all') then if getPlayerMoney(cid) == 0 then npcHandler:say('You don\'t have any gold with you.', cid) Topic[cid] = nil else count[cid] = getPlayerMoney(cid) npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid) Topic[cid] = 2 end elseif msgcontains(msg, 'deposit') then if getCount(msg) == 0 then npcHandler:say('You are joking, aren\'t you??', cid) Topic[cid] = nil elseif getCount(msg) ~= -1 then if getPlayerMoney(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid) Topic[cid] = 2 else npcHandler:say('You do not have enough gold.', cid) Topic[cid] = nil end elseif getPlayerMoney(cid) == 0 then npcHandler:say('You don\'t have any gold with you.', cid) Topic[cid] = nil else npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid) Topic[cid] = 1 end elseif Topic[cid] == 1 then if getCount(msg) == -1 then npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid) Topic[cid] = 1 elseif getPlayerMoney(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid) Topic[cid] = 2 else npcHandler:say('You do not have enough gold.', cid) Topic[cid] = nil end elseif msgcontains(msg, 'yes') and Topic[cid] == 2 then if doPlayerRemoveMoney(cid, count[cid]) then doPlayerSetBalance(cid, getPlayerBalance(cid) + count[cid]) npcHandler:say('Alright, we have added the amount of ' .. count[cid] .. ' gold to your balance. You can withdraw your money anytime you want to.', cid) else npcHandler:say('I am inconsolable, but it seems you have lost your gold. I hope you get it back.', cid) end Topic[cid] = nil elseif msgcontains(msg, 'no') and Topic[cid] == 2 then npcHandler:say('As you wish. Is there something else I can do for you?', cid) Topic[cid] = nil elseif msgcontains(msg, 'withdraw') then if getCount(msg) == 0 then npcHandler:say('Sure, you want nothing you get nothing!', cid) Topic[cid] = nil elseif getCount(msg) ~= -1 then if getPlayerBalance(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Are you sure you wish to withdraw ' .. count[cid] .. ' gold from your bank account?', cid) Topic[cid] = 4 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end elseif getPlayerBalance(cid) == 0 then npcHandler:say('You don\'t have any money on your bank account.', cid) Topic[cid] = nil else npcHandler:say('Please tell me how much gold you would like to withdraw.', cid) Topic[cid] = 3 end elseif Topic[cid] == 3 then if getCount(msg) == -1 then npcHandler:say('Please tell me how much gold you would like to withdraw.', cid) Topic[cid] = 3 elseif getPlayerBalance(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Are you sure you wish to withdraw ' .. count[cid] .. ' gold from your bank account?', cid) Topic[cid] = 4 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end elseif msgcontains(msg, 'yes') and Topic[cid] == 4 then if getPlayerBalance(cid) >= count[cid] then doPlayerAddMoney(cid, count[cid]) doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid]) npcHandler:say('Here you are, ' .. count[cid] .. ' gold. Please let me know if there is something else I can do for you.', cid) else npcHandler:say('There is not enough gold on your account.', cid) end Topic[cid] = nil elseif msgcontains(msg, 'no') and Topic[cid] == 4 then npcHandler:say('The customer is king! Come back anytime you want to if you wish to withdraw your money.', cid) Topic[cid] = nil elseif msgcontains(msg, 'transfer') then if getCount(msg) == 0 then npcHandler:say('Please think about it. Okay?', cid) Topic[cid] = nil elseif getCount(msg) ~= -1 then count[cid] = getCount(msg) if getPlayerBalance(cid) >= count[cid] then npcHandler:say('Who would you like to transfer ' .. count[cid] .. ' gold to?', cid) Topic[cid] = 6 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end else npcHandler:say('Please tell me the amount of gold you would like to transfer.', cid) Topic[cid] = 5 end elseif Topic[cid] == 5 then if getCount(msg) == -1 then npcHandler:say('Please tell me the amount of gold you would like to transfer.', cid) Topic[cid] = 5 else count[cid] = getCount(msg) if getPlayerBalance(cid) >= count[cid] then npcHandler:say('Who would you like to transfer ' .. count[cid] .. ' gold to?', cid) Topic[cid] = 6 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end end elseif Topic[cid] == 6 then local v = getPlayerByName(msg) if getPlayerBalance(cid) >= count[cid] then if v then transfer[cid] = msg npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '?', cid) Topic[cid] = 7 elseif findPlayer(msg):lower() == msg:lower() then transfer[cid] = msg npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. findPlayer(msg) .. '?', cid) Topic[cid] = 7 else npcHandler:say('This player does not exist.', cid) Topic[cid] = nil end else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end elseif Topic[cid] == 7 and msgcontains(msg, 'yes') then if getPlayerBalance(cid) >= count[cid] then local v = getPlayerByName(transfer[cid]) if v then doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid]) doPlayerSetBalance(v, getPlayerBalance(v) + count[cid]) npcHandler:say('Very well. You have transferred ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '.', cid) elseif findPlayer(transfer[cid]):lower() == transfer[cid]:lower() then doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid]) db.executeQuery('UPDATE players SET balance=balance+' .. count[cid] .. ' WHERE name=' .. db.escapeString(transfer[cid]) .. ' LIMIT 1') npcHandler:say('Very well. You have transferred ' .. count[cid] .. ' gold to ' .. findPlayer(transfer[cid]) .. '.', cid) else npcHandler:say('This player does not exist.', cid) end else npcHandler:say('There is not enough gold on your account.', cid) end Topic[cid] = nil elseif Topic[cid] == 7 and msgcontains(msg, 'no') then npcHandler:say('Alright, is there something else I can do for you?', cid) Topic[cid] = nil elseif msgcontains(msg, 'change gold') then npcHandler:say('How many platinum coins would you like to get?', cid) Topic[cid] = 8 elseif Topic[cid] == 8 then if getCount(msg) < 1 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] * 100 .. ' of your gold coins into ' .. count[cid] .. ' platinum coins?', cid) Topic[cid] = 9 end elseif Topic[cid] == 9 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2148, count[cid] * 100) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2152, count[cid]) else npcHandler:say('Sorry, you do not have enough gold coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif msgcontains(msg, 'change platinum') then npcHandler:say('Would you like to change your platinum coins into gold or crystal?', cid) Topic[cid] = 10 elseif Topic[cid] == 10 then if msgcontains(msg, 'gold') then npcHandler:say('How many platinum coins would you like to change into gold?', cid) Topic[cid] = 11 elseif msgcontains(msg, 'crystal') then npcHandler:say('How many crystal coins would you like to get?', cid) Topic[cid] = 13 else npcHandler:say('Well, can I help you with something else?', cid) Topic[cid] = nil end elseif Topic[cid] == 11 then if getCount(msg) < 1 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] .. ' of your platinum coins into ' .. count[cid] * 100 .. ' gold coins for you?', cid) Topic[cid] = 12 end elseif Topic[cid] == 12 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, count[cid]) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2148, count[cid] * 100) else npcHandler:say('Sorry, you do not have enough platinum coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif Topic[cid] == 13 then if getCount(msg) < 1 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] * 100 .. ' of your platinum coins into ' .. count[cid] .. ' crystal coins for you?', cid) Topic[cid] = 14 end elseif Topic[cid] == 14 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, count[cid] * 100) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2160, count[cid]) else npcHandler:say('Sorry, you do not have enough platinum coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif msgcontains(msg, 'change crystal') then npcHandler:say('How many crystal coins would you like to change into platinum?', cid) Topic[cid] = 15 elseif Topic[cid] == 15 then if getCount(msg) == -1 or getCount(msg) == 0 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] .. ' of your crystal coins into ' .. count[cid] * 100 .. ' platinum coins for you?', cid) Topic[cid] = 16 end elseif Topic[cid] == 16 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2160, count[cid]) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2152, count[cid] * 100) else npcHandler:say('Sorry, you do not have enough crystal coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif msgcontains(msg, 'change') then npcHandler:say('There are three different coin types in Tibia: 100 gold coins equal 1 platinum coin, 100 platinum coins equal 1 crystal coin. So if you\'d like to change 100 gold into 1 platinum, simply say \'{change gold}\' and then \'1 platinum\'.', cid) Topic[cid] = nil elseif msgcontains(msg, 'bank') then npcHandler:say('We can change money for you. You can also access your bank account.', cid) Topic[cid] = nil end return true end npcHandler:setCallback(CALLBACK_GREET, greet) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -- function maded by Gesior-- function getNumber(txt) --return number if its number and is > 0, else return 0 x = string.gsub(txt,"%a","") x = tonumber(x) if x ~= nill and x > 0 then return x else return 0 end end
-
ikaroangelo21 recebeu reputação de kinomoto em Function não existeSomente clicar na seta no campo direito inferior :), boa sorte com seu Otserv, precisando somente falar ^^.
-
ikaroangelo21 recebeu reputação de kinomoto em Function não existeBom dia, poste o script, para darmos uma lida !