Ir para conteúdo

JcA

Membro
  • Registro em

  • Última visita

Tudo que JcA postou

  1. Se você ir no config.lua e por accountManager = false, não da certo?
  2. JcA postou uma resposta no tópico em Suporte Tibia OTServer
    ou tem outro que o @KotZletY fez mas nao achei o link, depois ele posta ai
  3. Desse jeito funciona, obrigado! Não tem problema, preguiça é o de menos! Valeu!
  4. Ué, ta igual o que você postou domodlib('Loot_func') function onSay(cid, words, param, channel) local list = "" for id, price in pairs(info.items_price) do list = list .. getItemNameById(id) .. " - [" .. (price/1000) .."] K\n" end doPlayerPopupFYI(cid, list) return true end A não ser que era para acrescentar algo nele, e eu não sabia kkk
  5. Fiz conforme orientado, isso funciona em qualquer TFS? Não citei, mas sendo ou não, TFS 0.4. E a tabela esta como no mod, enfim, é serio, não fiz nada errado aqui,
  6. Sim, fiz tudo isso, não deu aqui, se quiser testa ai e me fala
  7. Usa esse datapack http://www.tibiaking.com/forum/forums/topic/67233-860-the-forgotten-server-04-sqlite-e-mysql/
  8. Conversão das Querrys do SQL para o MYSQL CREATE TABLE death_list ( id INTEGER NOT NULL, player_id INTEGER NOT NULL, date INTEGER NOT NULL, level INTEGER NOT NULL, killer_name INTEGER NOT NULL, PRIMARY KEY ( id ) ); ALTER TABLE `players` ADD `ot_points` INTEGER NOT NULL DEFAULT 0 ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0; ALTER TABLE `accounts` ADD `vip_time` INT NOT NULL DEFAULT 0; ALTER TABLE `accounts` ADD loot_time INT(15) NOT NULL DEFAULT 0; CREATE TABLE marriage_system ( id INTEGER NOT NULL, player_id INTEGER NOT NULL, partner VARCHAR( 255 ) NOT NULL, marriage_date INTEGER NOT NULL, PRIMARY KEY ( id ) ); CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT 0, `end` BIGINT NOT NULL DEFAULT 0, `frags` INT NOT NULL DEFAULT 0, `payment` BIGINT NOT NULL DEFAULT 0, `guild_kills` INT NOT NULL DEFAULT 0, `enemy_kills` INT NOT NULL DEFAULT 0, `status` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) );
  9. Quando tenta deslogar no server, da esse erro de creaturescript: Quando começa o evento, não cria o teleport, e da esse erro: --[[ <!-- DUCA Event --> <event type="login" name="Duca-Login" event="script" value="DUCA_creaturescript.lua"/> <event type="logout" name="Duca-Logout" event="script" value="DUCA_creaturescript.lua"/> <event type="preparedeath" name="Duca-Death" event="script" value="DUCA_creaturescript.lua"/> <event type="combat" name="Duca-Combat" event="script" value="DUCA_creaturescript.lua"/> ]]-- dofile('data/lib/DUCA.lua') function onLogin(cid) if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then DUCA.removePlayer(cid) end return true end function onLogout(cid) if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not logout now!") return false end return true end function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) local pontos = {[1] = 1, [2] = 1, [3] = 10, [4] = 30,} if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then local pontos_ganhos = pontos[getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)] setPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS, getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) + pontos_ganhos) doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_BLUE, "You have ".. getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) .." duca points.") DUCA.removePlayer(cid) DUCA.updateRank() end return false end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) == getPlayerStorageValue(target, DUCA.STORAGE_TEAM) then return false end end end return true end --[[ <!-- DUCA Event --> <movevent event="StepIn" actionid="48000" script="DUCA_movements.lua"/> ]]-- dofile('data/lib/DUCA.lua') function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return false end if getPlayerLevel(cid) < DUCA.LEVEL_MIN then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need level " .. DUCA.LEVEL_MIN .. " to enter in Duca event.") doTeleportThing(cid, fromPosition) return false end if getPlayerItemCount(cid, 2165) >= 1 or getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == 2202 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not enter stealth ring in the event.") doTeleportThing(cid, fromPosition) return false end for _, uid in pairs(getPlayersOnline()) do if getPlayerIp(cid) == getPlayerIp(uid) and getPlayerStorageValue(uid, DUCA.STORAGE_TEAM) > 0 then doTeleportThing(cid, fromPosition) return false end end local team = DUCA.balanceTeam() DUCA.addPlayerinTeam(cid, team) doTeleportThing(cid, DUCA.TEAMS[team].temple) setPlayerStorageValue(cid, DUCA.TOTAL_PONTOS, 0) registerCreatureEvent(cid, "Duca-Death") registerCreatureEvent(cid, "Duca-Combat") setGlobalStorageValue(DUCA.TOTAL_PLAYERS, getGlobalStorageValue(DUCA.TOTAL_PLAYERS) + 1) return true end -- DUCA EVENTO by luanluciano93 DUCA = { EVENT_MINUTES = 15, TELEPORT_POSITION = {x = 1102, y = 987, z = 7}, STORAGE_TEAM = 27000, TOTAL_PONTOS = 27001, TOTAL_PLAYERS = 27003, -- global storage LEVEL_MIN = 300, REWARD_FIRST = {11773, 1}, REWARD_SECOND = {9971, 15}, TEAMS = { [1] = {color = "Black", temple = {x = 2248, y = 1251, z = 7}}, [2] = {color = "White", temple = {x = 2206, y = 1192, z = 7}}, [3] = {color = "Red"}, [4] = {color = "Green"}, }, } local conditioBlack = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditioBlack, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditioBlack, {lookType = 128, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditioWhite = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditioWhite, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditioWhite, {lookType = 128, lookHead = 19, lookBody = 19, lookLegs = 19, lookFeet = 19}) local conditioRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditioRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditioRed, {lookType = 134, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) local conditioGreen = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditioGreen, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditioGreen, {lookType = 134, lookHead = 101, lookBody = 101, lookLegs = 101, lookFeet = 101}) -- function DUCA.teleportCheck() DUCA.teleportCheck = function() local item = getTileItemById(DUCA.TELEPORT_POSITION, 1387).uid if item > 0 then doRemoveItem(item) DUCA.finishEvent() print(">>> Duca Event was finished. <<<") else doBroadcastMessage("Duca Event was started and will close in ".. DUCA.EVENT_MINUTES .." minutes.") print(">>> Duca Event was started. <<<") local teleport = doCreateItem(1387, 1, DUCA.TELEPORT_POSITION) doItemSetAttribute(teleport, "aid", 48000) setGlobalStorageValue(DUCA.TOTAL_PLAYERS, 0) addEvent(DUCA.teleportCheck, DUCA.EVENT_MINUTES * 60 * 1000) end end -- function DUCA.addPlayerinTeam(cid, team) DUCA.addPlayerinTeam = function(cid, team) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INVISIBLE) if team == 1 then doAddCondition(cid, conditioBlack) elseif team == 2 then doAddCondition(cid, conditioWhite) elseif team == 3 then doAddCondition(cid, conditioRed) elseif team == 4 then doAddCondition(cid, conditioGreen) end setPlayerStorageValue(cid, DUCA.STORAGE_TEAM, team) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will join the " .. DUCA.TEAMS[team].color .. " Team.") doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) end -- function DUCA.balanceTeam() DUCA.balanceTeam = function() local time1, time2 = 0, 0 for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) == 1 then time1 = time1 + 1 elseif getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) == 2 then time2 = time2 + 1 end end return (time1 <= time2) and 1 or 2 end -- function DUCA.removePlayer(cid) DUCA.removePlayer = function(cid) doRemoveCondition(cid, CONDITION_OUTFIT) --doRemoveCondition(cid, CONDITION_HUNTING) --doRemoveCondition(cid, CONDITION_INFIGHT) --doRemoveCondition(cid, CONDITIONID_COMBAT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are dead in Duca Event and your Duca points is set to 0!") doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) setPlayerStorageValue(cid, DUCA.STORAGE_TEAM, 0) setPlayerStorageValue(cid, DUCA.TOTAL_PONTOS, 0) unregisterCreatureEvent(cid, "Duca-Death") unregisterCreatureEvent(cid, "Duca-Combat") doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setGlobalStorageValue(DUCA.TOTAL_PLAYERS, getGlobalStorageValue(DUCA.TOTAL_PLAYERS) - 1) end -- function DUCA.updateRank() DUCA.updateRank = function() local participantes = {} for _, uid in pairs(getPlayersOnline()) do if getPlayerStorageValue(uid, DUCA.STORAGE_TEAM) > 0 then table.insert(participantes, uid) end end table.sort(participantes, function(a, b) return getPlayerStorageValue(a, DUCA.TOTAL_PONTOS) > getPlayerStorageValue(b, DUCA.TOTAL_PONTOS) end) for x = 1, #participantes do if getPlayerStorageValue(participantes[x], DUCA.STORAGE_TEAM) >= 3 then DUCA.addPlayerinTeam(participantes[x], DUCA.balanceTeam()) end end if (#participantes >= 1) then DUCA.addPlayerinTeam(participantes[1], 4) end if (#participantes >= 11) then for i = 2, 11 do DUCA.addPlayerinTeam(participantes[i], 3) end end end -- function DUCA.finishEvent() DUCA.finishEvent = function() DUCA.updateRank() for _, uid in pairs(getPlayersOnline()) do if getPlayerStorageValue(uid, DUCA.STORAGE_TEAM) == 4 then local winner = getCreatureName(uid) doBroadcastMessage("Congratulation ".. winner .."!! Duca Event is finish. ".. winner .." win reward.") doPlayerAddItem(uid, DUCA.REWARD_FIRST[1], DUCA.REWARD_FIRST[2]) elseif getPlayerStorageValue(uid, DUCA.STORAGE_TEAM) == 3 then doPlayerAddItem(uid, DUCA.REWARD_SECOND[1], DUCA.REWARD_SECOND[2]) end if getPlayerStorageValue(uid, DUCA.STORAGE_TEAM) > 0 then DUCA.removePlayer(uid) end end end
  10. Eu so tenho uma coisa a dizer a você, obrigado fofinho
  11. Error while executing query: near "ENGINE": syntax error Preciso para SQL
  12. Preciso de ajudar para modificar o mod de autoloot para que, o premium seja meu sistema de vip. E o pedido de uma talk !loot list que pegue os dados do mod, e mostre em pop up, o nome do item, e seu valor. items_price = {[2498] = 40000,[2523] = 150000, [2656] = 15000,[2195] = 40000,[2520] = 40000,[2492] = 60000, [2466] = 30000,[2646] = 100000,[2470] = 80000, [2522] = 100000, [2472] = 100000, [2514] = 80000, [2645] = 40000, [2528] = 8000} Ficando da seguinte forma na talk (exemplo): ROYAL HELMET - [40K ] ou 40000 DEMON SHIELD - [40K] MASTERMIND SHIELD - [80K] ou ROYAL HELMET 40K ou 40000 DEMON SHIELD 40K <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="none.com" enabled="yes"> <config name="Loot_func"><![CDATA[ info = { AutomaticDeposit = true, BlockMonsters = {}, BlockItemsList = {2123,2515}, Max_Slots = {free = 2, premium = 5}, Storages = {27000,28008,28006,28007}, items_price = {[2498] = 40000,[2523] = 150000, [2656] = 15000,[2195] = 40000,[2520] = 40000,[2492] = 60000, [2466] = 30000,[2646] = 100000,[2470] = 80000, [2522] = 100000, [2472] = 100000, [2514] = 80000, [2645] = 40000, [2528] = 8000} } function setPlayerStorageTable(cid, storage, tab) local tabstr = "&" for i,x in pairs(tab) do tabstr = tabstr .. i .. "," .. x .. ";" end setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1)) end function getPlayerStorageTable(cid, storage) local tabstr = getPlayerStorageValue(cid, storage) local tab = {} if type(tabstr) ~= "string" then return {} end if tabstr:sub(1,1) ~= "&" then return {} end local tabstr = tabstr:sub(2, #tabstr) local a = string.explode(tabstr, ";") for i,x in pairs(a) do local b = string.explode(x, ",") tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2] end return tab end function isInTable(cid, item) for _,i in pairs(getPlayerStorageTable(cid, info.Storages[1]))do if tonumber(i) == tonumber(item) then return true end end return false end function addItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do table.insert(x,getPlayerStorageTable(cid, info.Storages[1])[i]) end if x ~= 0 then table.insert(x,tonumber(item)) setPlayerStorageTable(cid, info.Storages[1], x) else setPlayerStorageTable(cid, info.Storages[1], {item}) end end function removeItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do table.insert(x,getPlayerStorageTable(cid, info.Storages[1])[i]) end for i,v in ipairs(x) do if tonumber(v) == tonumber(item) then table.remove(x,i) end end return setPlayerStorageTable(cid, info.Storages[1], x) end function ShowItemsTabble(cid) local n,str = 0,"[+] Auto Loot Commands [+]\n\n!autoloot item name --> To add ou Remove item from list.\n!autoloot money --> To collect gold automatically.\n!autoloot clear --> To clear the list.\n!autoloot on/off --> To enable or disable the collecting of items in the system.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nGold Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nAutomatic Item Selling: "..(getPlayerStorageValue(cid, info.Storages[4]) > 0 and "Activated" or "Disabled")..".\nBalance Total: ["..getPlayerBalance(cid).."] gp's.\nMaximum Slots: ["..#getPlayerStorageTable(cid, info.Storages[1]).."/"..(isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n" for i = 1,#getPlayerStorageTable(cid, info.Storages[1]) do n = n + 1 str = str.."Slot "..n.." - "..getItemNameById(getPlayerStorageTable(cid, info.Storages[1])[i]).."\n" end return doPlayerPopupFYI(cid, str) end function getContainerItems(containeruid) local items = {} local containers = {} if type(getContainerSize(containeruid)) ~= "number" then return false end for slot = 0, getContainerSize(containeruid)-1 do local item = getContainerItem(containeruid, slot) if item.itemid == 0 then break end if isContainer(item.uid) then table.insert(containers, item.uid) end table.insert(items, item) end if #containers > 0 then for i,x in ipairs(getContainerItems(containers[1])) do table.insert(items, x) end table.remove(containers, 1) end return items end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, amount) -- revisado local item, _G = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid), 0 if #item > 0 then for _ ,x in pairs(item) do local ret = getThing(x) if ret.type < 100 then doTransformItem(ret.uid, itemid, ret.type+amount) if ret.type+amount > 100 then doPlayerAddItem(cid, itemid, ret.type+amount-100) end break else _G = _G+1 end end if _G == #item then doPlayerAddItem(cid, itemid, amount) end else return doPlayerAddItem(cid, itemid, amount) end end function AutomaticDeposit(cid,item,n) local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1) return doPlayerDepositMoney(cid, deposit) end function AutomaticItensSelling(cid, x) return doPlayerAddMoney(cid, x) and doPlayerDepositMoney(cid, x) end function corpseRetireItems(cid, pos) local check = false for i = 0, 255 do pos.stackpos = i tile = getTileThingByPos(pos) if tile.uid > 0 and isCorpse(tile.uid) then check = true break end end if check == true then local items = getContainerItems(tile.uid) for i,x in pairs(items) do if isInArray(getPlayerStorageTable(cid, info.Storages[1]), tonumber(x.itemid)) or getPlayerStorageValue(cid, info.Storages[2]) > 0 and isInArray({2148,2152,2160},tonumber(x.itemid)) then if isItemStackable(x.itemid) then if getPlayerStorageValue(cid, info.Storages[4]) > 0 and info.items_price[tonumber(x.itemid)] then AutomaticItensSelling(cid, (info.items_price[tonumber(x.itemid)]*x.type)) else doPlayerAddItemStacking(cid, x.itemid, x.type) if info.AutomaticDeposit == true and isInArray({2148,2152,2160}, tonumber(x.itemid)) then AutomaticDeposit(cid,x.itemid,x.type) end end else if getPlayerStorageValue(cid, info.Storages[4]) > 0 and info.items_price[tonumber(x.itemid)] then AutomaticItensSelling(cid, info.items_price[tonumber(x.itemid)]) else doPlayerAddItem(cid, x.itemid) end end doRemoveItem(x.uid) end end end end]]></config> <event type="login" name="LootLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "LootEventKIll") if isPremium(cid) and getPlayerStorageValue(cid, 27001) <= 0 then setPlayerStorageValue(cid, 27001, 1) elseif getPlayerStorageValue(cid, 27001) > 0 and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Auto Loot] You premium is Over, Start a new list!") setPlayerStorageValue(cid, 27001, -1) setPlayerStorageValue(cid, info.Storages[1], -1) end return true end]]></event> <event type="kill" name="LootEventKIll" event="script"><![CDATA[ domodlib('Loot_func') function onKill(cid, target, lastHit) if isPlayer(cid) and getPlayerStorageValue(cid, info.Storages[3]) <= 0 and isMonster(target) and not isInArray(info.BlockMonsters, getCreatureName(target):lower()) then addEvent(corpseRetireItems, 0, cid ,getThingPos(target)) end return true end]]></event> <talkaction words="!autoloot" event="buffer"><![CDATA[ domodlib('Loot_func') local param, slots = param:lower(), isPremium(cid) and info.Max_Slots.premium or info.Max_Slots.free if not param or param == "" then ShowItemsTabble(cid) return true elseif tonumber(param) then doPlayerSendCancel(cid, "enter commands: !autoloot item name [+] !autoloot clean [+] !autoloot money [+] !autoloot on/off") return true elseif isInArray({"clean","limpar", "clear"}, param) then setPlayerStorageValue(cid, info.Storages[1], -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Your list has been cleaned.") return true elseif isInArray({"start","stop","on","off"}, param) then setPlayerStorageValue(cid, info.Storages[3], getPlayerStorageValue(cid, info.Storages[3]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] "..(getPlayerStorageValue(cid, info.Storages[3]) > 0 and "Stopped" or "Started")..".") return true elseif isInArray({"money","gold","gps","dinheiro"}, param) then setPlayerStorageValue(cid, info.Storages[2], getPlayerStorageValue(cid, info.Storages[2]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Gold Colleting "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "disabled")..".") return true elseif isInArray({"selling","autosell","sell","vender"}, param) then setPlayerStorageValue(cid, info.Storages[4], getPlayerStorageValue(cid, info.Storages[4]) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Auto Loot] Automatic Itens Selling "..(getPlayerStorageValue(cid, info.Storages[4]) > 0 and "Activated" or "disabled")..".") return true end local item = getItemIdByName(param, false) if not item then doPlayerSendCancel(cid, "This item does not exist.") return true end local var = isInTable(cid, item) if isInArray({2148,2152,2160},item) then doPlayerSendCancel(cid, "Enter !autoloot money to add money in your list!") return true elseif isInArray(info.BlockItemsList, item) then doPlayerSendCancel(cid, "You can not add this item in the list!") return true elseif not var and #getPlayerStorageTable(cid, info.Storages[1]) >= slots then doPlayerSendCancel(cid, "max "..slots.." from auto loot") return true end if not var then addItemTable(cid, item) else removeItemTable(cid, item) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,not var and "you added the item "..param.." in the list" or "you removed the item "..param.." from the list") return true]]></talkaction> </mod> Sistema VIP:
  13. Do MysQL para o SQL CREATE TABLE IF NOT EXISTS `players_dtk` ( `name` varchar(30) NOT NULL, `group_name` varchar(10) NOT NULL, `escolhido` int(2) NOT NULL DEFAULT '0', `town` int(4) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  14. Deu certo, faz no outro script também, no critical
  15. doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!") ESSA MENSAGEM /\ SÓ DEVE APARECER QUANDO O PLAYER USAR O ITEM, OK, ISSO JA FUNCIONA NO SCRIPT doBroadcastMessage("The player ".. getCreatureName(cid).. " conquered the 100 critical stone. Congratulations!") ESSA MENSAGEM /\ FOI O QUE EU COLOQUEI NO SCRIPT, O PROBLEMA É QUE, EU QUERO QUE ELA FUNCIONE APENAS UMA VEZ QUANDO O PLAYER ALCANÇAR OS 100 ITENS CONQUISTADOS. SÓ ISSO.
  16. Mais explicado que isso? Quando essa action funciona, quando o player alcança o 100/100 vai emitir a mensagem broadcast apenas uma vez, só quando chegar 100/100. e essa outra mensagem, aparece pro player só quando ele tentar usar o item, e ja tiver 100/100
  17. Ajuda para sair a mensagem do broadcast apenas uma unica vez, só a broadcast local config = { effectonuse = 13, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 48903 -- storage que será verificado } local notallowed = {1,2,3,4} function onUse(cid, item, frompos, item2, topos) if not isInArray(notallowed, getPlayerVocation(cid)) then if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"You've Leveled your Critical Skill to ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!") doBroadcastMessage("The player ".. getCreatureName(cid).. " conquered the 100 critical stone. Congratulations!") return 0 end else doPlayerSendTextMessage(cid,22,"You can't learn this skill because you're "..getPlayerVocationName(cid)..". Your need to promotion for use.") return 0 end return 1 end --- Dodge System by Night Wolf local config = { effectonuse = 14, -- efeito que sai levelsdodge = 100, --- leveis que terão storagedodge = 48902 -- storage que será verificado } local notallowed = {1,2,3,4} function onUse(cid, item, frompos, item2, topos) if not isInArray(notallowed, getPlayerVocation(cid)) then if getPlayerStorageValue(cid, config.storagedodge) < config.levelsdodge then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"You've Leveled your Dodge Skill to ["..(getPlayerStorageValue(cid, config.storagedodge)+1).."/100].") setPlayerStorageValue(cid, config.storagedodge, getPlayerStorageValue(cid, config.storagedodge)+1) elseif getPlayerStorageValue(cid, config.storagedodge) >= config.levelsdodge then doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Dodge Skill.\nCongratulations!!!!") doBroadcastMessage("The player ".. getCreatureName(cid).. " conquered the 100 dodge stone. Congratulations!") return 0 end else doPlayerSendTextMessage(cid,22,"You can't learn this skill because you're "..getPlayerVocationName(cid)..". Your need to promotion for use.") return 0 end return 1 end
  18. Arte da improvisation, tu faz o npc aqui aceitar o item como meio de compra tb? local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local t = { [10218] = {buyprice = 5}, -- [id do item] = {buyprice = preço} [10219] = {buyprice = 5}, [8300] = {buyprice = 5}, [8694] = {buyprice = 10}, [7697] = {buyprice = 10}, [3954] = {buyprice = 5}, -- [id do item] = {buyprice = preço} [11263] = {buyprice = 5}, [10141] = {buyprice = 5}, [2284] = {buyprice = 5}, [2263] = {buyprice = 5}, [9927] = {buyprice = 3}, -- [id do item] = {buyprice = preço} [9929] = {buyprice = 3}, [9928] = {buyprice = 3}, [2644] = {buyprice = 3}, [2527] = {buyprice = 3}, [7735] = {buyprice = 10}, -- [id do item] = {buyprice = preço} [12401] = {buyprice = 5}, [5907] = {buyprice = 5}, [7403] = {buyprice = 10}, [7436] = {buyprice = 10}, [2445] = {buyprice = 10} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and doPlayerRemovePoints(cid, t[item].buyprice) then doPlayerAddItem(cid, item) selfSay("Here you go.", cid) else selfSay("You don't have "..t[item].buyprice.." points.", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.buyprice, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  19. Qual é o erro torpe aqui na talk? local id = 9020 function onSay(cid, words, param, channel) local points = getPlayerPoints(cid, 45452) if points <= 0 then return true end doPlayerRemovePoints(cid, points) else doCreatureSay(cid, "You do not have donate points.", TALKTYPE_ORANGE_1) doPlayerAddPoints(cid, id, points) doCreatureSay(cid, "You converted points into coins", TALKTYPE_ORANGE_1) return true end function doPlayerRemovePoints(cid, amount) local current = getPlayerStorageValue(cid, 45452) if current - amount < 0 then return false else setPlayerStorageValue(cid, 45452, current - amount) end return true end E na Action: function onUse(cid, item, fromPosition, itemEx, toPosition) doPlayerAddEventPoints(cid, item.type) doRemoveItem(item.uid) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREATTACK) doSendAnimatedText(getPlayerPosition(cid), "d-coins", TEXTCOLOR_YELLOW) return true end function doPlayerAddEventPoints(cid, amount) local current = getPlayerStorageValue(cid, 45452) setPlayerStorageValue(cid, 45452, current + amount) return true end System
  20. Obrigado pelo apoio!
  21. Não deu certo, a mensagem 1, aparece para quem é vip, e a 2 para quem não é, entendeu? Me ajuda no script do movements tb...?
  22. Estou tentando implantar esse sistema que aumenta em 20% para quem é vip, adicionei o bloqueio do acc manager, e troquei as variaveis, porém não deu muito certo. O objetivo era aparecer apenas uma mensagem para quem não é vip, e 1 para quem é vip. function onLogin(cid) local rate = 1.2 -- 10% a mais de exp. local config = { hasVip = "You have "..((rate - 1)*100).."% rom exp! Enjoy the benefits vip donate!", -- mensagem apenas para vip hasVip = "Hello player enjoy the benefits vip, you will win "..((rate - 1)*100).."% more than xp!", -- mensagem para quem não é vip } if (string.find(tostring(getCreatureName(cid)),"Account Manager")) or getPlayerGroupId(cid) >= 3 then end if isPremium(cid) then doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.hasVip) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.hasVip) end return TRUE end Eu uso o sistema mock E ainda no mesmo, me fizeram o seguinte moveemente, só que da erros, e o padrão do sistema mock não funciona aqui. --[[ -- Script Vip Sytem 1.0 -- function onStepIn(cid, item, position, fromPosition) local config = { msgDenied = "You need to be a vip player to access this area.", msgWelcome = "Welcome to vip area!" } if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome) return TRUE end ]]-- function onStepIn(cid, item, position, fromPosition) local tileConfig = { kickPos = fromPosition, kickEffect = CONST_ME_POFF, kickMsg = "You need to be a vip player to access this area.", enterMsg = "Welcome to vip area!", enterEffect = CONST_ME_MAGIC_RED, } if isPlayer(cid) == true then if vip.hasVip(cid) == FALSE then doTeleportThing(cid, tileConfig.kickPos) doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect) doPlayerSendCancel(cid, tileConfig.kickMsg) return end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, tileConfig.enterMsg) doSendMagicEffect(position, tileConfig.enterEffect) return true end end
  23. JcA postou uma resposta no tópico em Suporte Tibia OTServer
    Não tem como, só em Linux, infelizmente.
  24. <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="First Items" version="1.0" author="Sekk" enabled="yes"> <event type="login" name="FirstItems" event="script"><![CDATA[ local firstItems = {} firstItems[0] = -- none { 2173, -- Amulet of Loss 2525, -- Dwarven Shield 3965, -- Hunting Spear 2124, -- Ring of Healing 2457, -- Steel Helmet 2647, -- Plate Legs 2463, -- Plate Armor 2195 -- Boots of Haste } firstItems[1] = -- sorcerer { 2173, -- Amulet of Loss 8902, -- Spellbook of Mind Control 2437, -- Start Staff 2214, -- Ring of Healing 7900, -- Magma Monocle 7894, -- Magma Legs 7899, -- Magma Armor 7891 -- Magma Boots } firstItems[2] = -- druid { 2173, -- Amulet of Loss 8901, -- Spellbook of Warding 2437, -- Start Staff 2214, -- Ring of Healing 7902, -- Glacier Mask 7896, -- Glacier Kilt 7897, -- Glacier Robe 7892 -- Glacier Shoes } firstItems[3] = -- paladin { 2173, -- Amulet of Loss 2535, -- Caslte Shield 2455, -- Start Crossbow 9008, -- Start Arrow 2214, -- Ring of Healing 2342, -- Helmet of the Ancients 2488, -- Crown Legs 2195, -- Boots of Haste 8891 -- Paladin Armor } firstItems[4] = -- knight { 2173, -- Amulet of Loss 2536, -- Medusa Shield 7385, -- crimson sword 2114, -- Ring of Healing 2497, -- Crusader Helmet 2477, -- Knight Legs 2195, -- Boots of Haste 2476 -- Knight Armor } function onLogin(cid) if getPlayerStorageValue(cid, 30001) <= 0 then for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1) end local bag = doPlayerAddItem(cid, 1988, 1) -- Backpack doAddContainerItem(bag, 2160, 100) -- 1kk doAddContainerItem(bag, 5710, 1) -- Light Shovel doAddContainerItem(bag, 7731, 1) -- Elvenhair Rope doAddContainerItem(bag, 7618, 1) -- Health Potion doAddContainerItem(bag, 7620, 1) -- Mana Potion doAddContainerItem(bag, 8601, 1) -- Start Axe doAddContainerItem(bag, 2423, 1) -- Start Club setPlayerStorageValue(cid, 30001, 1) end return true end ]]></event> </mod> Usa esse mod do mestre @Sekk

Informação Importante

Confirmação de Termo