
Duality
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
Duality deu reputação a Albeck em [RESOLVIDO] Remover Frag@Duality Acabei de testar e funcionou.
Se deu erro é só postar o erro.
UPDATE `players` SET `skull`=0; UPDATE `players` SET `skulltime`=0; UPDATE `killers` SET `unjustified`=0;
-
Duality deu reputação a KotZletY em Level Max [Vocação]@Duality que não ia funcionar eu já sabia, mas queria saber da função.... Use este:
-
Duality deu reputação a KotZletY em Level Max [Vocação]@luangop faz toda diferença, muitos checks, então você arruma um jeito de comprar, puxar essa comparação e fazer 1 check só. Menos processo a ser usado na hora de realizar a mágica.
@Duality impedi o up não tem, mas impedi o ganho de xp tem:
no seu login.lua adicione isso:
local storage = 23423 -- max level storage if getPlayerStorageValue(cid, storage) == 1 then doPlayerSetExperienceRate(cid, 0.0) end
Como eu falei, não tem como impedi o up, então o que eu fiz foi, na hora que ele upar pro level máximo, ele dará um storage ao player, e na mesma hora irá setar a rate de exp em 0, e então ele não vai ganhar exp quando matar algum monstro, porém se ele relogar, o rate setado irá sumir, então é ae que o code do login entra,
ao logar e se ele tiver a storage ganha no up do level máx, então irá setar a rate sempre em 0, impedindo ele ganhar exp e upar.
-
Duality deu reputação a luangop em [Talkactions] !flyfunction onSay(cid, words, param) pos = {x=1054, y=1050, z=7} if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "Nao ira fugir quando estiver de battle!") return true end if getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone!") return true end doSendMagicEffect(getPlayerPosition(cid),19) doPlayerSendCancel(cid,"Teleportado!") doTeleportThing(cid,pos) return true end
-
Duality deu reputação a KotZletY em (Resolvido)Mudando vocação@Duality
Em vocNeed você altera para a vocação que pode mudar, caso a vocação for diferente da que está ali, o npc não irá mudar.
-
Duality deu reputação a thelifeofpbion em [Exp Potion] BugandoErro meu, tem que colocar o onLogout
Já Modifiquei ali no post que fiz, só você trocar a tag do creaturesscript.xml para logout inves de login
e modificar o script, pelo que editei ali em cima ali em cima
-
Duality deu reputação a mateusmoretti em [Exp Potion] Bugandovo te ajuda, tenta aiii
faz todo o procedimento ai
mods/
creaturescripts/perderefeito
creaturescripts/perderefeito.xml
creaturescripts/loguim
-
Duality deu reputação a psychonaut em pod deletasaushusaush
-
Duality deu reputação a luangop em [Talkactions] !flySó modificar a coordenada ali pra onde deve teleportar...
function onSay(cid, words, param) pos = {x=1054, y=1050, z=7} if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "Nao ira fugir quando estiver de battle!") return true end doSendMagicEffect(getPlayerPosition(cid),19) doPlayerSendCancel(cid,"Teleportado!") doTeleportThing(cid,pos) return true end
-
Duality deu reputação a THGSanttos em Servidor sem BUG?Atualmente tem 2 servs sem muitos bugs rodando por aí, são eles:
Dbo rox
Dbo Hunter
-
Duality recebeu reputação de ismaeldias2 em Criar aba website gesiorVamos la, abre: htdocs/layout e abre layout.php
procure Server Info e vai começar assim
Embaixo da ultima linha do server info ou seja abaixo de </a> você coloca:
após feito esse passo, você já pode dar f5 no navegador com o site aberto para atualizar e visualizar que a nova aba Iniciante vai aparecer no site a baixo de server info, agora para finalizar vá em htdocs/pages
copia e cola qualquer bloco de notas que seja arquivo php e renomei para iniciante, agora só abrir esse bloco de notas e editar da sua preferencia.
-
Duality deu reputação a Vodkart em (Resolvido)[REBORN] Npc cobrando itemera só colocar 'and doPlayerRemoveItem(cid, ITEMID,QUANTIDADE) '
coloquei 2160,10
só trocar.
o certo era refazer o npc, mas ta ai:
local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('???') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Olá! Se voce está pronto, diga "reborn".') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Hey!.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30024) == 4 then selfSay('Desculpe, mas voce já é rebornado.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') and (getPlayerLevel(cid) < 200 and getPlayerStorageValue(cid,30024) ~= 4) or (getPlayerLevel(cid) > 2000 and getPlayerStorageValue(cid,30024) ~= 4) then selfSay('Apenas level 200 até 2000 podem rebornar.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') then selfSay('Realmente quer isto?') talk_state = 2 --_GOKU_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 2000 and getPlayerVocation(cid) == 15 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,10, 501) talk_state = 0 --_VEGETA_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 30 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,25,510) talk_state = 0 --_PICCOLO_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 43 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,38,519) talk_state = 0 --_C17_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 56 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,50,528) talk_state = 0 --_GOHAN_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 70 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,561,537) talk_state = 0 --_TRUNKS_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 82 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,74,546) talk_state = 0 --_CELL_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 94 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,81,555) talk_state = 0 --_FREEZA_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 110 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,88,564) talk_state = 0 --_MAJIN BOO_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 126 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,98,573) talk_state = 0 --_BROLY_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 138 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,113,582) talk_state = 0 --_C18_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 151 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,50,591) talk_state = 0 --_UUB_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 163 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,128,600) talk_state = 0 --_GOTEN_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 177 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,142,609) talk_state = 0 --_CHIBI TRUNKS_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 191 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,151,611) talk_state = 0 --_COOLER_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 205 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,153,620) talk_state = 0 --_DENDE_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 217 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,169,630) talk_state = 0 --_TSUFUL_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 229 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,180,639) talk_state = 0 --_BARDOCK_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 242 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,194,648) talk_state = 0 --_KURIRIN_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 255 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,205,657) talk_state = 0 --_PAN_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 267 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,212,666) talk_state = 0 --_KAIO_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 279 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,221,675) talk_state = 0 --_VIDEL_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 291 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,227,684) talk_state = 0 --_JANEMBA_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 303 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,234,693) talk_state = 0 --_TENSHINHAN_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 315 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,246,702) talk_state = 0 --_JENK_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 327 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,257,711) talk_state = 0 --_RADITZ_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 339 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,265,720) talk_state = 0 --_C16_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 351 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,277,729) talk_state = 0 --_TURLES_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 363 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,285,738) talk_state = 0 --_BULMA_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 375 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,296,747) talk_state = 0 --_SHENRON_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 387 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,302,756) talk_state = 0 --_VEGETTO_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 392 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,308,393) talk_state = 0 --_TAPION_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 411 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,321,765) talk_state = 0 --_KAME_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 424 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,335,774) talk_state = 0 --_KING VEGETA_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 436 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,347,792) talk_state = 0 --_KAGOME_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 448 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,357,783) talk_state = 0 --_ZAIKO_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 453 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,368,454) talk_state = 0 --_LORD CHILLED_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 472 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,375,801) talk_state = 0 --_C8_-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 50000 and getPlayerVocation(cid) == 489 and doPlayerRemoveItem(cid, 2160,10) then doReborn(cid,1,517,810) talk_state = 0 elseif msgcontains(msg, 'yes') and talk_state == 2 then selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Voce deve estar na ultima transformação.') elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Adeus!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Próximo por favor...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Adeus!') focus = 0 end end end
-
Duality deu reputação a Sekk em [AJUDA] Acesso a novo mapaNão sei se é exatamente o que quer, mas tenta ai:
Obs.: A porta precisa ser 'Gate of Expertise'!
data/actions/scripts crie um arquivo chamado porta.lua e coloque isso dentro:
ainda na mesma pasta scripts adicione outro arquivo chamado items.lua e coloque isso dentro:
Em actions.xml adicione essas tags:
<action itemid="YYYY" script="item.lua"/> <action actionid="XXXX" script="porta.lua"/> YYYY - ID do item para usar
XXXX - Action ID que você escolher para colocar na porta pelo RME
Lembrando, sinta-se livre para editar as frases, e também para mudar o nome dos arquivos, é só um exemplo!!
-
Duality deu reputação a Garou em Forge SystemADVANCED FORGE SYSTEM
O SISTEMA DE CRIAÇÃO DE ITENS PARA SEU SERVIDOR
Creio que muitos já conhecem o sistema de forja criado por mim, acontece que o código já estava um pouco obsoleto, então resolvi reescrever ele do 0.
Simplesmente consiste em um sistema de criação de itens avançado que ressuscita um pouco do RPG perdido nos servidores de hoje em dia. O jogador poderá criar itens através de forja, agindo como um verdadeiro ferreiro medieval. Adiciona itens em cima de uma bigorna previamente colocada no mapa e com um martelo cria um item totalmente novo.
CARACTERÍSTICAS DA VERSÃO FINAL:
- Configuração intuitiva e fácil de compreender;
- Mini-tutorial auxiliando criação de novas receitas;
- Receitas podem conter até 250 itens diferentes com suas respectivas quantidades;
- Sistema inteligente que identifica uma receita em qualquer ordem;
- Código totalmente orientado a objetos;
- Possibilidade de configurar diferentes requerimentos, diferentes skills, magic level e level
Há dois modos de instalar o Advanced Forge System, o primeiro é seguir os passos deste tópico e o segundo e baixar pasta data/ anexada no tópico com os arquivos em seus respectivos diretórios, precisando apenas o registro das chaves nos arquivos XML.
Escolha o modo que mais convém a você.
Crie um arquivo em data/lib chamado forgesystem.lua e cole o conteúdo abaixo:
--[[ ADVANCED FORGE SYSTEM FINAL Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- RecipeHandler = { itemtype = 0, items = {}, level = 1, maglevel = 0, skills = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0, [6] = 0} } Forge = { type = nil, position = nil, magicEffect = CONST_ME_MAGIC_GREEN, messages = { class = MESSAGE_STATUS_DEFAULT, success = "You have successfully forged a %s.", needskill = "You don't have enough %s to create a %s.", needlevel = "You need level %s to create a %s.", needmaglevel = "You need magic level %s to create a %s." } } function RecipeHandler:new(itemtype, items, level, maglevel, skills) local obj = { itemtype = (itemtype or 0), items = (items or {}), level = (level or 1), maglevel = (maglevel or 0), skills = (skills or {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0, [6] = 0}) } table.insert(Recipes, obj) return setmetatable(obj, {__index = self}) end function RecipeHandler:setItem(itemtype) self.itemtype = (itemtype or 0) end function RecipeHandler:setRecipe(...) self.items = {...} end function RecipeHandler:setRecipeItem(itemid, amount) table.insert(self.items, {itemid, amount}) end function RecipeHandler:setSkill(skillid, value) self.skills[skillid] = value end function RecipeHandler:setLevel(value) self.level = value end function RecipeHandler:setMagLevel(value) self.maglevel = value end function RecipeHandler:check(position) local match = false for n, item in ipairs(self.items) do local thing = getTileItemById(position, item[1]) if thing.uid > 0 and math.max(1, thing.type) >= item[2] then if n == #self.items then match = true end else break end end return match end function RecipeHandler:get(position) if self:check(position) == true then return setmetatable({type = self, position = position}, {__index = Forge}) end return false end function Forge:create(cid) if self.type.itemid == 0 then print("[FORGE SYSTEM - ERROR] ATTEMPT TO CREATE A RECIPE ITEMID 0") return end local status = true if(cid) then if getPlayerLevel(cid) < self.type.level then doPlayerSendTextMessage(cid, self.messages.class, self.messages.needlevel:format(self.type.level, getItemNameById(self.type.itemtype))) return end if getPlayerMagLevel(cid) < self.type.maglevel then doPlayerSendTextMessage(cid, self.messages.class, self.messages.needmaglevel:format(self.type.maglevel, getItemNameById(self.type.itemtype))) return end for skillid, value in pairs(self.type.skills) do if getPlayerSkillLevel(cid, skillid) < value then status = false doPlayerSendTextMessage(cid, self.messages.class, self.messages.needskill:format(SKILL_NAMES[skillid], getItemNameById(self.type.itemtype))) break end end end if status == true then for _, item in ipairs(self.type.items) do local thing = getTileItemById(self.position, item[1]) doRemoveItem(thing.uid, item[2]) end doSendMagicEffect(self.position, self.magicEffect) doPlayerSendTextMessage(cid, self.messages.class, self.messages.success:format(getItemNameById(self.type.itemtype))) doCreateItem(self.type.itemtype, self.position) end end dofile(getDataDir() .."/lib/recipes.lua") Crie um arquivo em data/lib chamado recipes.lua e adicione o conteúdo abaixo:
---------------------------------------- -----** TUTORIAL DE CONFIGURAÇÃO **----- ---------------------------------------- --[[ O 'ADVANCED FORGE SYSTEM' é muito fácil e intuitivo de configurar, você só precisa chamar a função RecipeHandler:new(...), sendo que você já configurar os atributos da receita nela ou usar outras funções para isso. Por exemplo, quero criar uma Magic Sword que precise de 100 Gold Nuggets. RecipeHandler:new(2400, {{2157, 100}}) Ou então Magic_Sword = RecipeHandler:new() Magic_Sword:setItem(2400) Magic_Sword:setRecipe({2157, 100}) Funções do Sistema: RecipeHandler:new(itemtype, items, level, maglevel, skills) --> Cria uma nova instância de forja. RecipeHandler:setItem(itemtype) --> Atribui um certo itemid como resultado da receita. RecipeHandler:setRecipe(recipe) --> Atribui uma receita. RecipeHandler:setRecipeItem(itemid, amount) --> Adiciona um itemid e sua quantidade a receita. RecipeHandler:setSkill(skillid, value) --> Atribui um valor necessário de uma certa skill para poder criar a receita. RecipeHandler:setLevel(value) --> Atribui o level necessário para criar uma receita. RecipeHandler:setMagLevel(value) --> Atribui o magic level necessário para criar uma receita. ]]-- --[[ Este é um exemplo de receita usando algumas funções. É uma Magic Sword (ITEMID: 2400) que precisa de 100 Gold Nuggets (ITEMID: 2157), além disso, o personagem que tentar forjar, precisa ter Level 100 e Sword Fighting 50. ]]-- Recipes = {} magicsword = RecipeHandler:new() magicsword:setItem(2400) magicsword:setRecipeItem(2157, 100) magicsword:setLevel(100) magicsword:setSkill(2, 50) Agora em data/actions/scripts, crie um arquivo chamado iron_hammer.lua e adicione o conteúdo abaixo:
function onUse(cid, item, fromPosition, itemEx, toPosition) local recipe = nil for _, v in ipairs(Recipes) do recipe = v:get(toPosition) if(recipe ~= false) then break end end if(recipe) then recipe:create(cid) else doPlayerSendCancel(cid, "This is not a valid recipe.") end return true end E por fim em actions.xml, adicione a seguinte linha:
<action itemid="4846" event="script" value="iron_hammer.lua"/> OPCIONAL - TALKACTION A talkaction abaixo mostra ao jogadoras receitas configuradas no servidor que ele pode fazer. Em data/talkactions/scripts, crie um arquivo chamado recipes.lua e adicione o conteúdo abaixo:
function onSay(cid, words, param, channel) local ret = {} local msg = " ADVANCED FORGE SYSTEM\n" for _, recipe in ipairs(Recipes) do local skills = true for skillid, value in pairs(recipe.skills) do if getPlayerSkillLevel(cid, skillid) < value then skills = false break end end if skills == true then if getPlayerLevel(cid) >= recipe.level and getPlayerMagLevel(cid) >= recipe.maglevel then table.insert(ret, {recipe, true}) else table.insert(ret, {recipe, false}) end else table.insert(ret, {recipe, false}) end end for _, recipe in ipairs(ret) do msg = msg .."\nRecipe for ".. getItemNameById(recipe[1].itemtype) ..":\n\n" if recipe[2] == true then for _, item in ipairs(recipe[1].items) do msg = msg .."* ".. getItemNameById(item[1]) .." [".. math.min(item[2], math.max(0, getPlayerItemCount(cid, item[1]))) .."/".. item[2] .."]\n" end else msg = msg .."[LOCKED]\n" end end doShowTextDialog(cid, 2555, msg) return true end Em data/talkactions/talkactions.xml, adicione a linha:
<talkaction words="/recipes" event="script" value="recipes.lua"/> Siga as instruções para configuração de novas receitas.
Em breve vídeo de funcionamento
Advanced Forge System.rar -
Duality deu reputação a KotZletY em Tutorial 2 em 1 - Magic e Shoot EffectsBom galera, o Tópico já diz tudo, irei explicar como mudar para Uint16 dessa vez nas Source, para quem não sabe. Irei explicar como aumentar em Magic Effects, para assim você seu Server usar mais de 255, e ShootEffects para usar mais de 41 Distance efeitos(muito mais). Existe Tópicos no Tk, porém não é a mesma coisa, esse é diferente pois você irá alterá o valor dos uint's disparados para o Client, para assim então usar além do Padrão!
Abaixo umas informações essenciais !
Esse Tópico é especifico para TFS 0.4, para que assim você possa aumentar o limite de efeitos no Client, e usar mais de 255 efeitos, e mais de 41 efeitos em Distância. Vale lembra também que você não é obrigado a mudar em ambos, se você quiser apenas aumentar o Limite de Efeitos para mais de 255, então mude apenas ele, caso queria aumentar apenas os Efeitos que são lançados a distância(ShootEffects ou Distance Effects), caso queria os dois, use ambos.
Vamos começar primeiramente com os Magic Effects:
Agora vamos mudar o ShootEffects para uint16.
Bom não adianta mudar isso se não fizer alteração no Client, então deixarei aqui, dois Tópicos de como mudar de uint8 para uint16 no Client em em ShootEffects e MagicEffect.
Mudando os Efeitos de uint8 a 16 para Magic Effects
Mudando os Efeitos de uint8 a 16 para Shoot Effects
Então é isso ae, qualquer erro só comentar para que eu possar tentar ajudar.
Tópico exclusivo do Tk, proibido posta em outro site, blog ou fórum!
xD
-
Duality deu reputação a MaTTch em [SCRIPT] Magia com SQM certo
-
Duality deu reputação a KotZletY em [ERRO] in funcitonNão, essas source está limpa, totalmente zerada, mais nada que 5 minutinhos do seu tempo, não faça você usa 65k de effectts ou 65k de shooteffects, ou usa 65k nos dois! xD
Muda a source para uint16 para poder usar os 65k em ambos:
Muda de uint8 para uint16 no client, para aceitar os 65k de magic effects:
E pra finalizar, mudar de uint8 para uint16 no client, para aceitar 65k de shooteffects:
-
Duality deu reputação a Tibia2015br em Chase opponentLOL.
Isso é normal do Tibia!...
Se quiser que quando você ande ele não desmarque, vai no teu Tibia em, Options>General>Auto Chase você desmarca a caixinha
se te ajudei mi ajuda da um like
-
Duality recebeu reputação de ivomastre em Projeto DBO&NTO&BleachProgejo DBO & NTO & Bleach
Projeto já esta com quase todas vocações completas porém preciso de um sprite para arrumar algumas sprites, não vou da muita explicação do ot, mas ele vai ser com dedicado e sério, serviço será pago caso servidor fica online com donates.
Vaga:
Sprite (Corrigir algumas sprites e criar)
Mapper
Cliente Maker
Contato:
Skype: bru.niiinho1
Face: [email protected]
-
Duality deu reputação a luanluciano93 em (Resolvido)Colocar imagem no gesior<img src="./layouts\tibiacom\images\menu/anthack.jpg">
ou
<img src="./'.$layout_name.'\images\menu/anthack.jpg"> [se tiver dentro do php]
<img src="./<?php $layout_name ?>\images\menu/anthack.jpg"> [se tiver fora do php]
-
Duality deu reputação a Natanael Beckman em Trade OFF - Shop OfflineEsse sistema disponibiliza uma negociação offline, onde você oferta um item e esse item é divulgado no site do server e qualquer player pode comprar o item utilizando um comando especificado.
Crie uma arquivo .lua dentro da pasta data/talkactions/scripts com o nome auctionsystem.lua, dentro do mesmo adicione o code:
local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = string.explode(param, ",") if(t[1] == "add") then if((not t[2]) or (not t[3]) or (not t[4])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if(not tonumber(t[3]) or (not tonumber(t[4]))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2]) if(not item) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if(getPlayerLevel(cid) < config.levelRequiredToAdd) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if(isInArray(config.blocked_items, item)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if(getPlayerItemCount(cid, item) < (tonumber(t[4]))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";") if(check:getID() == -1) then elseif(check:getRows(true) >= config.maxOffersPerPlayer) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(getPlayerPosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) doPlayerRemoveItem(cid, item, itemcount) db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if(t[1] == "buy") then if(not tonumber(t[2])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";") if(buy:getID() ~= -1) then if(getPlayerMoney(cid) < buy:getDataInt("cost")) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.") buy:free() return true end if(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("player"))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if(getPlayerFreeCap(cid) < getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")))then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getDataString("item_name") .. ". It weight " .. getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end if(isItemStackable((buy:getDataString("item_id")))) then doPlayerAddItem(cid, buy:getDataString("item_id"), buy:getDataInt("count")) else for i = 1, buy:getDataInt("count") do doPlayerAddItem(cid, buy:getDataString("item_id"), 1) end end doPlayerRemoveMoney(cid, buy:getDataInt("cost")) db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") .. " gps!") db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("player") .. ";") buy:free() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if(t[1] == "remove") then if((not tonumber(t[2]))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(getPlayerPosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";") if(delete:getID() ~= -1) then if(getPlayerGUID(cid) == delete:getDataInt("player")) then db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") if(isItemStackable(delete:getDataString("item_id"))) then doPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count")) else for i = 1, delete:getDataInt("count") do doPlayerAddItem(cid, delete:getDataString("item_id"), 1) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if(t[1] == "withdraw") then local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";") if(balance:getDataInt("auction_balance") < 1) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. balance:getDataInt("auction_balance") .. " gps from auction system!") doPlayerAddMoney(cid, balance:getDataInt("auction_balance")) db.executeQuery("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. getPlayerGUID(cid) .. ";") balance:free() end return true end Em seguida em talkactions.xml adicione a tag:
<talkaction words="!offer" event="script" value="auctionsystem.lua"/> No banco de dados execute as querys:
CREATE TABLE `auction_system` ( `id` int(11) NOT NULL auto_increment, `player` int(11), `item_id` int(11), `item_name` varchar(255), `count` int(11), `cost` int(11), `date` int(11), PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ALTER TABLE `players` ADD `auction_balance` INT( 11 ) NOT NULL DEFAULT '0'; Na pasta do seu site crie um arquivo chamado tradeoff.php, em seguida adicione o code:
<?PHP $auctions = $SQL->query('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC')->fetchAll(); $players = 0; $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Instruction<b></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><center><h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br /><small>example: !offer add, plate armor, 500, 1</small><br /><br /><B>!offer buy, AuctionID</b><br /><small>example: !offer buy, 1943</small><br /><br /><b>!offer remove, AuctionID</b><br /><small>example: !offer remove, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Use this command to get money for sold items.</small></center></TR></TD></TABLE><br />'; if(empty($auctions)) { $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>'; $main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>'; } else { foreach($auctions as $auction) { $players++; if(is_int($players / 2)) $bgcolor = $config['site']['lightborder']; else $bgcolor = $config['site']['darkborder']; $cost = round($auction['cost']/1000, 2); $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$auction['id'].'</center></TD><TD><center><img src="/item_images/'.$auction['item_id'].'.gif"/></center></TD><TD><center>'.$auction['item_name'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($auction['name']).'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.'k<br /><small>'.$auction['cost'].'gp</small></center></TD><TD><center>!offer buy, '.$auction['id'].'</center></TR>'; } $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>#</center></b></TD><TD class="white"><b><center>Item Name</center></b></TD><TD class="white"><b><center>Player</center></b></TD><TD class="white"><b><center>Count</center></b></TD><TD class="white"><b><center>Cost</center></b></td><TD class="white"><b><center>Buy</center></b></td></TR>'.$content.'</TABLE>'; $main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vdk.1553/">vDk</a>.</small></p>'; } ?> Em layouts.php adcione o code:
<a href="?subtopic=tradeoff"> <div id="submenu_tradeoff" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)"> <div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div> <div id="ActiveSubmenuItemIcon_tradeoff" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div> <div id="ActiveSubmenuItemLabel_tradeoff" class="SubmenuitemLabel">Trade Off</div> <div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div> </div> </a> Pra finalizar em index.php adicione esse code:
case "tradeoff"; $topic = "Trade Off"; $subtopic = "tradeoff"; include("tradeoff.php"); break;
-
E pronto galera clica em GOSTEI e comenta no tópico.
-
Duality deu reputação a Natanael Beckman em [GlobalEvents] Perfect Lottery System (MySql) - AtualizadoSistema de Loterias por globalevents.
Crie um arquivo .lua com o nome lottery dentro da pasta data/globalevents/scripts/loterry.lua, adicione dentro do arquivo o seguinte code:
local config = { lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message) rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160). website = "yes", -- Only if you have php scripts and table `lottery` in your database! days = { "Monday-08:00", "Monday-13:00", "Monday-19:30", "Tuesday-08:00", "Tuesday-13:00", "Tuesday-19:30", "Wednesday-08:00", "Wednesday-13:00", "Wednesday-19:30", "Thursday-08:00", "Thursday-13:00", "Thursday-19:30", "Friday-01:22", "Friday-13:00", "Friday-19:30", "Saturday-21:27", "Saturday-21:28", "Saturday-21:29", "Sunday-08:00", "Sunday-13:00", "Sunday-19:30" } } local function getPlayerWorldId(cid) if not(isPlayer(cid)) then return false end local pid = getPlayerGUID(cid) local worldPlayer = 0 local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";") if(result_plr:getID() ~= -1) then worldPlayer = tonumber(result_plr:getDataInt("world_id")) result_plr:free() return worldPlayer end return false end local function getOnlineParticipants() local players = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then table.insert(players, pid) end end if #players > 0 then return players end return false end function onThink(cid, interval) if table.find(config.days, os.date("%A-%H:%M")) then if(getWorldCreatures(o) <= 0)then return true end local query = db.query or db.executeQuery local random_item = config.rewards_id[math.random(1, #config.rewards_id)] local item_name = getItemNameById(random_item) local data = os.date("%d/%m/%Y - %H:%M:%S") local online = getOnlineParticipants() if online then local winner = online[math.random(1, #online)] local world = tonumber(getPlayerWorldId(winner)) if(random_item == 2160) then doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") else doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(config.website == "yes") then query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');") end else print("Ninguem OnLine pra ganhar na loteria") end end return true end Recomendamos modificar: - rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria Recomendo de item count apenas o 2160, outros podem bugar. - crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160). Altere pra mais ou menos o dinheiro. - "Monday-08:00", Ajuste os dias e horários como desejado. Em globalevents.xml, adicione:
<!-- Lottery --> <globalevent name="lottery" interval="60000" event="script" value="lottery.lua"/> Não mexa no code acima.
Certo, essa é a parte do servidor, agora vamos adicionar as querys necessárias no MySql:
CREATE TABLE `lottery` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `item` varchar(255) NOT NULL, `world_id` tinyint(2) unsigned NOT NULL default '0', `item_name` varchar(255) NOT NULL, `date` varchar(256) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; Caso você queria adicionar uma query pra testar o site, veja:
INSERT INTO `lottery` (`id`, `name`, `item`, `world_id`, `item_name`, `date`) VALUES(NULL, 'Character', '2470', '0', 'golden legs', '22/05/2014 - 04:49:50'); Agora vamos pra parte do site, crie um arquivo .php com o nome lottery, adicione dentro do arquivo o seguinte code:
<?PHP $main_content .= '<center><h1>Lottery</h1><h3>Lotterys held at 09:00, 14:00 and 20:30 hour, brazil time.</h3></center><br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr BGCOLOR="'.$config['site']['vdarkborder'].'"><td CLASS=white><center><b>Player Name</b></center></td><td CLASS=white width=184 colspan=2><center><b>Winning Item</b></center></td><td width=50 CLASS=white><center><b>World</b></center></td><td width=100 CLASS=white><center><b>Date and Time</b></center></td></tr>'; $lottery = $SQL->query('SELECT id, name, item, world_id, item_name, date FROM lottery WHERE world_id = 0 ORDER BY id DESC;'); foreach($lottery as $result) { $players++; if(is_int($players / 2)) $bgcolor = $config['site']['lightborder']; else $bgcolor = $config['site']['darkborder']; $main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=35%><center><a href="?subtopic=characters&name='.urlencode($result['name']).'">'.$result['name'].'</a></center></td><TD WIDTH=5%><img src=\'/item_images/'.urlencode($result['item']).'.gif\'></td><TD WIDTH=30%><center>'.$result['item_name'].'</center></td><TD WIDTH=7%><center>MegaTibia</center></td></td><TD WIDTH=30%><center>'.$result['date'].'</center></td></tr>'; } $main_content .= '</table>'; ?> Em index.php adicione:
case "lottery"; $topic = "Lottery"; $subtopic = "lottery"; include("lottery.php"); break; Em layouts.php adicione o code abaixo:
<a href="?subtopic=lottery"> <div id="submenu_lottery" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)"> <div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div> <div id="ActiveSubmenuItemIcon_lottery" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div> <div id="ActiveSubmenuItemLabel_lottery" class="SubmenuitemLabel">Lottery</div> <div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div> </div> </a> Pronto galera só isso, não esqueça clica em GOSTEI! Comente, participe do tópico, isso nos ajuda muito.
Créditos:
.lua - Killua e Matheus
.php - Matheus e Natanael Beckman
querys - Natanael Beckman e Matheus
Atualização 24/05/2014 - Adicionado regras pra não sorteá membro da staff(GM, GOD) - Adicionando sistema de Storage pra não correr o risco de um player ganhar 2x no mesmo dia. -
Duality deu reputação a Rusherzin em (Resolvido)[PEDIDO] Pic EditorEu uso esse AQUI em 8.54 e é só colocar a imagem no formato e tamanho original que fica certinho.
-
Duality recebeu reputação de ViitinG em Duvida ClienteEstou criando uma vocação no meu servidor derivado que é do sasuke, porém a sprite que eu quero passar ela é dividida em 108 partes, nao teria como eu passar a sprite completa toda editada para um outro cliente?