Tudo que cs007 postou
-
(Resolvido)Ajuda com porta automática
Ainda falta editar mais coisa mas testa aí para vê se vai funcionar... Vá em movements/scripts Crie um arquivo chamado autodoor.lua Cole isso dentro: local dooridopen = id_porta_aberta -- colocar o id da porta local dooridclose = id_porta_fechada -- colocar o id da porta fechada local pos1 = {x = 0000, y = 0000, z = 0} -- posição da primeira porta function onStepIn(cid, item, position, fromPosition) doTransformItem(uid, dooridopen, pos1) return true end No seu arquivo xml cole: <movevent type="StepIn" uniqueid="33560" event="script" value="autodoor.lua" /> no chão antes da porta coloque o uniqueid 33560
-
[DUVIDA] Problemas com script de Double Exp TFS 1.0
local rate = 100 --- porcentagem que irá ganhar a mais. function onKill(cid, target, lastHit) local thing = self:getStorageValue(80000) -- aqui ele pega a storage... if thing > os.time() then local monster = Monster(target) if not monster then return true end for id, damage in pairs(monster:getDamageMap()) do local player = Player(id) if player then local experience = damage.total / monster:getType():getHealth() * monster:getType():getExperience() local expFormula = ((experience / 100) * rate) player:addExperience(math.floor(expFormula), true) end end end return true end E está faltando script, esse aí ele verifica a storage 80000 tem que achar o outro script que da storage, se você usar o mesmo valor nas duas vai bugar o script.
-
NPC atacando monstro e players skulls
Serei algo bem interessante pois nunca vi um sistema assim...
-
Novo Erro Shop.lua
Explique melhor o que deseja para que possa ser ajudado.
-
Como colocar arma de paladin ou Kina atacar de acordo com Skill
Poste sua vocation.xml e o script do npc para que possa ver o motivo. Abraço
-
[DUVIDA] Problemas com script de Double Exp TFS 1.0
Tem que mudar a storage
-
TibiaKing Map Shape v1.0.3
Simplesmente perfeito.. Parabéns
-
Character Market ajuda
Data provided by Pastebin.com - Download Raw - See Original <?xml version="1.0" encoding="UTF-8"?> <mod name="Characters Market System" version="1.0" author="LuckOake" contact="none" enabled="yes"> ------------------------------------------------------------------------------------ <config name="market"><![CDATA[ price = 27112 owner = 27113 level = 30 -- Level mínimo que o character deve ter para ser vendido min_price = 100 -- Preço mínimo de um character max_price = 1000000 -- Preço máximo de um character function doTransferCharacter(cid, accId) return db.executeQuery("UPDATE `players` SET `account_id` = "..accId.." WHERE `id` = "..getPlayerGUIDByName(cid).."") end function doOfflinePlayerAddMoney(guid, money) return db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..money.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") end function setOfflinePlayerStorageValue(name, key, value) local result = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") if result:getID() == -1 then return db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (".. getPlayerGUIDByName(name) ..", ".. key ..", ".. value ..");") else result:free() return db.executeQuery("UPDATE `player_storage` SET `value` = ".. value .." WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") end end function getOfflinePlayerStorageValue(name, key) local result, ret = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = '".. getPlayerGUIDByName(name) .."' AND `key` = ".. key ..";") if result:getID() == -1 then return nil end end function getOfflinePlayerValue(name, value) local result, ret = db.getResult("SELECT `"..value.."` FROM `players` WHERE `id` = "..getPlayerGUIDByName(name)..";") end function isCharacterForSale(name) if not getOfflinePlayerStorageValue(name, price) or getOfflinePlayerStorageValue(name, price) < 1 then return false else return true end end ]]></config> ------------------------------------------------------------------------------------ <talkaction words="!character" event="buffer"><![CDATA[ domodlib('market') local t = string.explode(param, ",") if t[1] == "sell" then if not t[3] or not tonumber(t[3]) or t[4] or tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name and the price.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is already for sale.") return true elseif getPlayerGUIDByName(t[2]) == getPlayerGUID(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You cannot sell yourself.") return true elseif getPlayerByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The character must be offline to be sold.") return true elseif getOfflinePlayerValue(t[2], "level") < level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your character can't be sold until it has level "..level..".") return true elseif tonumber(t[3]) < min_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the minimum price for selling a character is "..min_price..".") return true elseif tonumber(t[3]) > max_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the maximum price for selling a character is "..max_price..".") return true end setOfflinePlayerStorageValue(t[2], price, t[3]) setOfflinePlayerStorageValue(t[2], owner, getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" is now for sale for the price of "'..t[3]..'" gold coins.') elseif t[1] == "buy" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif not playerExists(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character doesn't exist.") return true elseif getPlayerAccountId(cid) == getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't buy your own character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true elseif not db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` - '"..price.."';") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Not enough Points. This character's price is "..getOfflinePlayerStorageValue(t[2], price).." gold coins.") return true end if not getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)) then db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..price.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") setOfflinePlayerStorageValue(getPlayerNameByGUID(getOfflinePlayerStorageValue(t[2], owner)), 41792, getPlayerGUIDByName(t[2])) else db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..price.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") doPlayerSendTextMessage(getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)), MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" has been sold for the price of '..getOfflinePlayerStorageValue(t[2], price)..' gold coins.') end doTransferCharacter(t[2], getPlayerAccountId(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You bought the character "'..t[2]..'" for the price of '..getOfflinePlayerStorageValue(t[2], price)..' gold coins.') setOfflinePlayerStorageValue(t[2], owner, -1) setOfflinePlayerStorageValue(t[2], price, -1) return true elseif t[1] == "remove" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true end setOfflinePlayerStorageValue(t[2], price, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You removed the character "'..t[2]..'" from the Characters Market.') return true elseif t[1] == "list" then local result = db.getResult("SELECT `name` FROM `players`") if result:getID() == -1 then return true end local msg = "Characters for Sale:\n\n" while true do local name = result:getDataString("name") if isCharacterForSale(name) then local sex = getOfflinePlayerValue(name, "sex") == 1 and "Male" or "Female" msg = ""..msg.." - ".. name .." (Level: "..getOfflinePlayerValue(name, "level").." / Vocation: "..getVocationInfo(getOfflinePlayerValue(name, "vocation")).name.." / Sex: "..sex.." / Owner: "..getPlayerNameByGUID(getOfflinePlayerStorageValue(name, owner))..") [Price: "..getOfflinePlayerStorageValue(name, price).."] \n" end if not result:next() then break end end doPlayerPopupFYI(cid, msg) return true elseif not t[1] or t[1] ~= "buy" or t[1] ~= "sell" or t[1] ~= "remove" or t[1] ~= "list" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Incorrect params. You can only 'buy' or 'sell' a character, 'remove' it from the Characters Market or see the 'list' of characters for sale.") return true end return true ]]></talkaction> ------------------------------------------------------------------------------------ <event type="login" name="MarketLogin" event="script"><![CDATA[ function onLogin(cid) domodlib('market') if getPlayerStorageValue(cid, price) > 0 then return false elseif getPlayerStorageValue(cid, 41792) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sold the character "..getPlayerNameByGUID(getPlayerStorageValue(cid, 41792))..". The Points is in your bank account.") setPlayerStorageValue(cid, 41792, -1) end return true end ]]></event> </mod> Testá aí sangue se não for não vou poder ajudar.
-
como colocar outfit para vip?
Pode por um item que ao usar ele verifica se o player é vip e adiciona o outfit, e assim que acabar a vip o outfit seja removido.
-
Character Market ajuda
Testa ainda mano.. Abraço Data provided by Pastebin.com - Download Raw - See Original <?xml version="1.0" encoding="UTF-8"?> <mod name="Characters Market System" version="1.0" author="LuckOake" contact="none" enabled="yes"> ------------------------------------------------------------------------------------ <config name="market"><![CDATA[ price = 27112 owner = 27113 level = 30 -- Level mínimo que o character deve ter para ser vendido min_price = 100 -- Preço mínimo de um character max_price = 1000000 -- Preço máximo de um character function doTransferCharacter(cid, accId) return db.executeQuery("UPDATE `players` SET `account_id` = "..accId.." WHERE `id` = "..getPlayerGUIDByName(cid).."") end function doOfflinePlayerAddMoney(guid, money) return db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..money.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") end function setOfflinePlayerStorageValue(name, key, value) local result = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") if result:getID() == -1 then return db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (".. getPlayerGUIDByName(name) ..", ".. key ..", ".. value ..");") else result:free() return db.executeQuery("UPDATE `player_storage` SET `value` = ".. value .." WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") end end function getOfflinePlayerStorageValue(name, key) local result, ret = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = '".. getPlayerGUIDByName(name) .."' AND `key` = ".. key ..";") if result:getID() == -1 then return nil end ret = result:getDataInt("value") result:free() return ret end function getOfflinePlayerValue(name, value) local result, ret = db.getResult("SELECT `"..value.."` FROM `players` WHERE `id` = "..getPlayerGUIDByName(name)..";") ret = result:getDataInt("value") result:free() return ret end function isCharacterForSale(name) if not getOfflinePlayerStorageValue(name, price) or getOfflinePlayerStorageValue(name, price) < 1 then return false else return true end end ]]></config> ------------------------------------------------------------------------------------ <talkaction words="!character" event="buffer"><![CDATA[ domodlib('market') local t = string.explode(param, ",") if t[1] == "sell" then if not t[3] or not tonumber(t[3]) or t[4] or tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name and the price.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is already for sale.") return true elseif getPlayerGUIDByName(t[2]) == getPlayerGUID(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You cannot sell yourself.") return true elseif getPlayerByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The character must be offline to be sold.") return true elseif getOfflinePlayerValue(t[2], "level") < level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your character can't be sold until it has level "..level..".") return true elseif tonumber(t[3]) < min_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the minimum price for selling a character is "..min_price..".") return true elseif tonumber(t[3]) > max_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the maximum price for selling a character is "..max_price..".") return true end setOfflinePlayerStorageValue(t[2], price, t[3]) setOfflinePlayerStorageValue(t[2], owner, getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" is now for sale for the price of "'..t[3]..'" gold coins.') elseif t[1] == "buy" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif not playerExists(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character doesn't exist.") return true elseif getPlayerAccountId(cid) == getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't buy your own character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true elseif not db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` - '"..price.."';") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Not enough Points. This character's price is "..getOfflinePlayerStorageValue(t[2], price).." gold coins.") return true end if not getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)) then db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..price.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") setOfflinePlayerStorageValue(getPlayerNameByGUID(getOfflinePlayerStorageValue(t[2], owner)), 41792, getPlayerGUIDByName(t[2])) else db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..price.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") doPlayerSendTextMessage(getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)), MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" has been sold for the price of '..getOfflinePlayerStorageValue(t[2], price)..' gold coins.') end doTransferCharacter(t[2], getPlayerAccountId(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You bought the character "'..t[2]..'" for the price of '..getOfflinePlayerStorageValue(t[2], price)..' gold coins.') setOfflinePlayerStorageValue(t[2], owner, -1) setOfflinePlayerStorageValue(t[2], price, -1) return true elseif t[1] == "remove" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true end setOfflinePlayerStorageValue(t[2], price, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You removed the character "'..t[2]..'" from the Characters Market.') return true elseif t[1] == "list" then local result = db.getResult("SELECT `name` FROM `players`") if result:getID() == -1 then return true end local msg = "Characters for Sale:\n\n" while true do local name = result:getDataString("name") if isCharacterForSale(name) then local sex = getOfflinePlayerValue(name, "sex") == 1 and "Male" or "Female" msg = ""..msg.." - ".. name .." (Level: "..getOfflinePlayerValue(name, "level").." / Vocation: "..getVocationInfo(getOfflinePlayerValue(name, "vocation")).name.." / Sex: "..sex.." / Owner: "..getPlayerNameByGUID(getOfflinePlayerStorageValue(name, owner))..") [Price: "..getOfflinePlayerStorageValue(name, price).."] \n" end if not result:next() then break end end doPlayerPopupFYI(cid, msg) return true elseif not t[1] or t[1] ~= "buy" or t[1] ~= "sell" or t[1] ~= "remove" or t[1] ~= "list" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Incorrect params. You can only 'buy' or 'sell' a character, 'remove' it from the Characters Market or see the 'list' of characters for sale.") return true end return true ]]></talkaction> ------------------------------------------------------------------------------------ <event type="login" name="MarketLogin" event="script"><![CDATA[ function onLogin(cid) domodlib('market') if getPlayerStorageValue(cid, price) > 0 then return false elseif getPlayerStorageValue(cid, 41792) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sold the character "..getPlayerNameByGUID(getPlayerStorageValue(cid, 41792))..". The Points is in your bank account.") setPlayerStorageValue(cid, 41792, -1) end return true end ]]></event> </mod>
-
Character Market ajuda
testa lá...Editei o script
-
Map Changer só indo até 7 mapas Help
Tenta aí... -- config -- WAR_MAP_NAMES = {'FIBULA', 'VENORE','EDRON','THAIS1','CENTER','NOVA1','NOVA','nova3','DESERT1','DESERT2','DESERT3','DESERT4'} WAR_SPAWNS = {10} WAR_SPAWNS[1] = {{2,2},{3,3}} -- map 1 WAR_SPAWNS[2] = {{5,5},{6,6}} -- map 2 WAR_SPAWNS[3] = {{8,8},{9,9}} -- map 3 WAR_SPAWNS[4] = {{11,11},{12,12}} -- map 4 WAR_SPAWNS[5] = {{25,25},{26,26}} -- map 5 WAR_SPAWNS[6] = {{28,28},{29,29}} -- map 6 WAR_SPAWNS[7] = {{22,22},{23,23}} -- map 7 WAR_SPAWNS[8] = {{34,34},{35,35}} -- map 8 WAR_SPAWNS[9] = {{36,36},{37,37}} -- map 9 WAR_SPAWNS[10] = {{38,38},{39,39}} -- map 10 WAR_MAP_CYCLE = {{1,1},{2,2},{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9},{10,10}} WAR_COLORS = {{150,150,150,150},{114,114,114,114}} WAR_TEAM_NAMES = {'Team White','Team Black'} WAR_BROADCAST_INTERVAL_TOP5 = 213 WAR_START_LEVEL = 1000 WAR_TEAMS = 1 WAR_POINTS_FOR_KILL = 3 WAR_POINTS_FOR_KILL_ASSIST = 1 -------------------------------------------------------- STORAGE_LAST_KILLER_GUID = 10100 STORAGE_LAST_KILLER_GUID_TIMES = 10101 STORAGE_LAST_KILLER_IP = 10200 STORAGE_LAST_KILLER_IP_TIMES = 10201 STORAGE_LAST_KILLER_ACCOUNT = 10300 STORAGE_LAST_KILLER_ACCOUNT_TIMES = 10301 STORAGE_POINTS = 11000 STORAGE_TEAM_ID = 12000 STORAGE_SKULL = 13000 STORAGE_DEPOT = 14000 GLOBAL_STORAGE_MAP = 15000 GLOBAL_STORAGE_MAP_CHANGE_TIME = 15001 GLOBAL_STORAGE_TEAM_1_FRAGS = 600 GLOBAL_STORAGE_TEAM_2_FRAGS = 700 GLOBAL_STORAGE_BROADCAST_TOP5 = 800 warInitialized = 0 function getTime(s) local n = math. floor(s / 60) s = s - (60 * n) return n, s end function getSpawn(cid) local map_info = WAR_MAP_CYCLE[getGlobalStorageValue(GLOBAL_STORAGE_MAP)] local map_id = map_info[1] local map_spawns = WAR_SPAWNS[map_id] local team_spawns = map_spawns[getPlayerStorageValue(cid, STORAGE_TEAM_ID)] return getTownTemplePosition(team_spawns[math.random(1,#team_spawns)]) end function getTeamMembers(id) local players = getPlayersOnline() local team = {} if #players == 0 then return team end for i, cid in ipairs(players) do if getPlayerStorageValue(cid, STORAGE_TEAM_ID) == id and getPlayerGroupId(cid) <= 8 then table.insert(team, cid) end end return team end function updateOutfit(cid) if WAR_TEAMS == 1 then --outfit local colors = WAR_COLORS[getPlayerStorageValue(cid, STORAGE_TEAM_ID)] local outfit = getCreatureOutfit(cid) outfit.lookHead = colors[1] outfit.lookBody = colors[2] outfit.lookLegs = colors[3] outfit.lookFeet = colors[4] doCreatureChangeOutfit(cid, outfit) end end function setTeam(cid) if WAR_TEAMS ~= 1 then setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1) else local team1 = getTeamMembers(1) local team2 = getTeamMembers(2) if #team1 >= #team2 then setPlayerStorageValue(cid, STORAGE_TEAM_ID, 2) setPlayerStorageValue(cid, 6667, 1) else setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1) setPlayerStorageValue(cid, 6666, 1) end updateOutfit(cid) end end function cronWar() if getGlobalStorageValue(GLOBAL_STORAGE_MAP_CHANGE_TIME) < os.time() then -- change map local map_info = WAR_MAP_CYCLE[getNextMapId()] local map_id = map_info[1] doTeleportThing(pid,getTeamSpawn(pid),false) -- teleporta para a base if WAR_TEAMS == 1 then doBroadcastMessage(getTeamScore(), MESSAGE_STATUS_DEFAULT) end setMap(getNextMapId()) elseif getGlobalStorageValue(GLOBAL_STORAGE_BROADCAST_TOP5) < os.time() then -- broadcast top 5 setGlobalStorageValue(GLOBAL_STORAGE_BROADCAST_TOP5, os.time()+WAR_BROADCAST_INTERVAL_TOP5) addEvent(doBroadcastMessage, 1000, getTop5Players(), MESSAGE_STATUS_CONSOLE_ORANGE) end addEvent(cronWar, 1000) end function getNextMapId() if getGlobalStorageValue(GLOBAL_STORAGE_MAP) == #WAR_MAP_CYCLE then return 1 end return getGlobalStorageValue(GLOBAL_STORAGE_MAP)+1 end function getTop5Players() local players = getPlayersOnline() if #players == 0 then return top5text end local player1 = {0,-1} local player2 = {0,-1} local player3 = {0,-1} local player4 = {0,-1} local player5 = {0,-1} local top5text = "Top 5 Fragers Online" for i, cid in ipairs(players) do if getPlayerStorageValue(cid,19999) > player1[2] then player5 = {player4[1], player4[2]} player4 = {player3[1], player3[2]} player3 = {player2[1], player2[2]} player2 = {player1[1], player1[2]} player1 = {cid, getPlayerStorageValue(cid,19999)} elseif getPlayerStorageValue(cid,19999) > player2[2] then player5 = {player4[1], player4[2]} player4 = {player3[1], player3[2]} player3 = {player2[1], player2[2]} player2 = {cid, getPlayerStorageValue(cid,19999)} elseif getPlayerStorageValue(cid,19999) > player3[2] then player5 = {player4[1], player4[2]} player4 = {player3[1], player3[2]} player3 = {cid, getPlayerStorageValue(cid,19999)} elseif getPlayerStorageValue(cid,19999) > player4[2] then player5 = {player4[1], player4[2]} player4 = {cid, getPlayerStorageValue(cid,19999)} elseif getPlayerStorageValue(cid,19999) > player1[2] then player5 = {cid, getPlayerStorageValue(cid,19999)} end end if player1[1] > 0 then top5text = top5text .. "\n1. " .. getCreatureName(player1[1]) .. " - " .. player1[2]+1 .. " frags" end if player2[1] > 0 then top5text = top5text .. "\n2. " .. getCreatureName(player2[1]) .. " - " .. player2[2]+1 .. " frags" end if player3[1] > 0 then top5text = top5text .. "\n3. " .. getCreatureName(player3[1]) .. " - " .. player3[2]+1 .. " frags" end if player4[1] > 0 then top5text = top5text .. "\n4. " .. getCreatureName(player4[1]) .. " - " .. player4[2]+1 .. " frags" end if player5[1] > 0 then top5text = top5text .. "\n5. " .. getCreatureName(player5[1]) .. " - " .. player5[2]+1 .. " frags" end return top5text end function getTeamScore() return WAR_TEAM_NAMES[1] .. " - " .. getGlobalStorageValue(GLOBAL_STORAGE_TEAM_1_FRAGS) .. " : " .. getGlobalStorageValue(GLOBAL_STORAGE_TEAM_2_FRAGS) .. " - " .. WAR_TEAM_NAMES[2] end function setMap(id) local map_info = WAR_MAP_CYCLE[id] setGlobalStorageValue(GLOBAL_STORAGE_MAP,id) setGlobalStorageValue(GLOBAL_STORAGE_MAP_CHANGE_TIME,os.time()+60*40) local players = getPlayersOnline() for i, cid in ipairs(players) do setGlobalStorageValue(17778,0) -- ninguem ficar com bandeira time verde! setGlobalStorageValue(17779,0) -- ninguem ficar com bandeira time vermelho! setGlobalStorageValue(18888,0) -- ninguem ficar com bandeira time verde! setGlobalStorageValue(18889,0) -- ninguem ficar com bandeira time vermelho!! setGlobalStorageValue(5002,0) -- ninguem ficar com bandeira time verde! setGlobalStorageValue(5001,0) -- ninguem ficar com bandeira time verde! doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doTeleportThing(cid, getSpawn(cid), TRUE) removeConditions(cid) end end function removeConditions(cid) doRemoveCondition(cid, CONDITION_INFIGHT) doRemoveCondition(cid, CONDITION_PARALYZE) doRemoveCondition(cid, CONDITION_ENERGY) doRemoveCondition(cid, CONDITION_FIRE) doRemoveCondition(cid, CONDITION_POISON) doRemoveCondition(cid, CONDITION_DRUNK) end
-
(Resolvido)[Pedido] Dar dano em determinaria área
Em que local vai ocorrer esse dano? Vai ser somente um local?
-
Character Market ajuda
Tentei Adaptar ele testa aí... Data provided by Pastebin.com - Download Raw - See Original <?xml version="1.0" encoding="UTF-8"?> <mod name="Characters Market System" version="1.0" author="LuckOake" contact="none" enabled="yes"> ------------------------------------------------------------------------------------ <config name="market"><![CDATA[ price = 27112 owner = 27113 level = 30 -- Level mínimo que o character deve ter para ser vendido min_price = 100 -- Preço mínimo de um character max_price = 1000000 -- Preço máximo de um character function doTransferCharacter(cid, accId) return db.executeQuery("UPDATE `players` SET `account_id` = "..accId.." WHERE `id` = "..getPlayerGUIDByName(cid).."") end function doOfflinePlayerAddMoney(guid, money) return db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` + '"..money.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") end function setOfflinePlayerStorageValue(name, key, value) local result = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") if result:getID() == -1 then return db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (".. getPlayerGUIDByName(name) ..", ".. key ..", ".. value ..");") else result:free() return db.executeQuery("UPDATE `player_storage` SET `value` = ".. value .." WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") end end function getOfflinePlayerStorageValue(name, key) local result, ret = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = '".. getPlayerGUIDByName(name) .."' AND `key` = ".. key ..";") if result:getID() == -1 then return nil end ret = result:getDataInt("value") result:free() return ret end function getOfflinePlayerValue(name, value) local result, ret = db.getResult("SELECT `"..value.."` FROM `players` WHERE `id` = "..getPlayerGUIDByName(name)..";") ret = result:getDataInt(value) result:free() return ret end function isCharacterForSale(name) if not getOfflinePlayerStorageValue(name, price) or getOfflinePlayerStorageValue(name, price) < 1 then return false else return true end end ]]></config> ------------------------------------------------------------------------------------ <talkaction words="!character" event="buffer"><![CDATA[ domodlib('market') local t = string.explode(param, ",") if t[1] == "sell" then if not t[3] or not tonumber(t[3]) or t[4] or tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name and the price.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is already for sale.") return true elseif getPlayerGUIDByName(t[2]) == getPlayerGUID(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You cannot sell yourself.") return true elseif getPlayerByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The character must be offline to be sold.") return true elseif getOfflinePlayerValue(t[2], "level") < level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your character can't be sold until it has level "..level..".") return true elseif tonumber(t[3]) < min_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the minimum price for selling a character is "..min_price..".") return true elseif tonumber(t[3]) > max_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the maximum price for selling a character is "..max_price..".") return true end setOfflinePlayerStorageValue(t[2], price, t[3]) setOfflinePlayerStorageValue(t[2], owner, getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" is now for sale for the price of "'..t[3]..'" gold coins.') elseif t[1] == "buy" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif not playerExists(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character doesn't exist.") return true elseif getPlayerAccountId(cid) == getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't buy your own character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true elseif not doPlayerRemoveMoney(cid, db.executeQuery("UPDATE `accounts` SET `p_points` = `p_points` - '"..money.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") end, price)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Not enough Points. This character's price is "..getOfflinePlayerStorageValue(t[2], price).." gold coins.") return true end if not getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)) then doOfflinePlayerAddMoney(getPlayerNameByGUID(getOfflinePlayerStorageValue(t[2], owner)), getOfflinePlayerStorageValue(t[2], price)) setOfflinePlayerStorageValue(getPlayerNameByGUID(getOfflinePlayerStorageValue(t[2], owner)), 41792, getPlayerGUIDByName(t[2])) else doPlayerAddMoney(getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)), getOfflinePlayerStorageValue(t[2], price)) doPlayerSendTextMessage(getPlayerByGUID(getOfflinePlayerStorageValue(t[2], owner)), MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" has been sold for the price of '..getOfflinePlayerStorageValue(t[2], price)..' gold coins.') end doTransferCharacter(t[2], getPlayerAccountId(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You bought the character "'..t[2]..'" for the price of '..getOfflinePlayerStorageValue(t[2], price)..' gold coins.') setOfflinePlayerStorageValue(t[2], owner, -1) setOfflinePlayerStorageValue(t[2], price, -1) return true elseif t[1] == "remove" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true end setOfflinePlayerStorageValue(t[2], price, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You removed the character "'..t[2]..'" from the Characters Market.') return true elseif t[1] == "list" then local result = db.getResult("SELECT `name` FROM `players`") if result:getID() == -1 then return true end local msg = "Characters for Sale:\n\n" while true do local name = result:getDataString("name") if isCharacterForSale(name) then local sex = getOfflinePlayerValue(name, "sex") == 1 and "Male" or "Female" msg = ""..msg.." - ".. name .." (Level: "..getOfflinePlayerValue(name, "level").." / Vocation: "..getVocationInfo(getOfflinePlayerValue(name, "vocation")).name.." / Sex: "..sex.." / Owner: "..getPlayerNameByGUID(getOfflinePlayerStorageValue(name, owner))..") [Price: "..getOfflinePlayerStorageValue(name, price).."] \n" end if not result:next() then break end end doPlayerPopupFYI(cid, msg) return true elseif not t[1] or t[1] ~= "buy" or t[1] ~= "sell" or t[1] ~= "remove" or t[1] ~= "list" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Incorrect params. You can only 'buy' or 'sell' a character, 'remove' it from the Characters Market or see the 'list' of characters for sale.") return true end return true ]]></talkaction> ------------------------------------------------------------------------------------ <event type="login" name="MarketLogin" event="script"><![CDATA[ function onLogin(cid) domodlib('market') if getPlayerStorageValue(cid, price) > 0 then return false elseif getPlayerStorageValue(cid, 41792) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sold the character "..getPlayerNameByGUID(getPlayerStorageValue(cid, 41792))..". The Points is in your bank account.") setPlayerStorageValue(cid, 41792, -1) end return true end ]]></event> </mod>
-
Erro fechando o Server
Um erro na spells, me parece ser exevo gran mas res
- [v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)
-
[v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)
Ele quer para Ubuntu, nesse caso amigo você vai precisar compilar no ubuntu, pois precisa instalar as libs Para compilar em Linux basta... apt-get update apt-get install -y git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev git; cd pasta_source mkdir build && cd build cmake .. make
- [v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)
- [v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)
-
Adicionar função Movements
Eu postei o link do sistema acima, dessa forma não funciona.
-
Remover Talk Shop dos Npcs
Pode dar up 300 vezes que ninguém responde essa merda... Fórum abandonado, saudade da tibiaking.
-
Adicionar função Movements
up
-
Adicionar função Movements
up
-
Remover Talk Shop dos Npcs
Obrigado por responder, eu sei que dessa forma dá para fazer porém meu mapa é Global, e fazer isso em todos os NPCs é bem complicado. Eu testei aqui e mesmo dessa forma funciona o BUY up up
-
Adicionar função Movements
Esse é o sistema. http://www.tibiaking.com/forum/topic/45764-oelf-perfect-owner-system-v01/?hl=owner up