Ir para conteúdo

Rafals

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Curtir
    Rafals deu reputação a Pedro. em [GESIOR] OTS Layouts - Yinz   
    Olá, estou trazendo diversos Layouts, organizados unicamente em um tópico. Todos estão no github, se você quiser poderá contribuir também. 
    Quando comecei a mexer com servidores, a questão de layouts era limitadíssima, não tinha quase nenhum Custom, e quando tinha ninguém codava pra gesior, nego simplesmente te dava os psds e se vira. 
    Eu sempre gostei de fazer mapa proprio, então mapa proprio com tibiarl é feio demais, hoje em dia você tem um caralhão de layouts, então boa sorte.
     
    - Layouts
    Aldora Kalaboka-Poke Ascar Nakjila GODLike Wondrous Underscore Envy Fibula Necronia Evoker AiretsamKit MaterialKit WOP Thora PokeStorm  
    você pode encontrar todos esses layouts no repositório no Github, clicando na branch você pode alterar o layout, ou pelo Readme os links estão organizados.
    Você poderá ver uma preview clicando em cada layout;
     

    https://github.com/pedrogiampietro/ots_layouts
  2. Curtir
    Rafals deu reputação a Yan Liima em [8.60] TFS 0.4 Rev3996 War & Cast   
    Salve salve pessoal, no inicio desse ano estava dando uma estudada e mexendo com a TFS 0.4 rev3884, e vi que havia alguns bugs e que não tinha Cast incluso. Com base nisso decidi atualizar e otimizar a source, já que ainda ela é uma das mais utilizadas no mundo de Otserv.  Decidi compartilhar esse meu trabalho com vocês! Acredito que possa ser uma das melhores REV atualmente.
     
    Conto com o seu feedback, caso haja algum bug, algo que tenha que mudar/optimizar, não exite em avisar aqui no tópico. Toda ajuda será bem vinda xD
     
    The Forgotten Server, Tibia Versão: 8.60
    O que contém nela?
     
    Dentro da pasta contém o config.lua com todas as tag já adicionadas.
     
    Não esquecam de executar a Query do Cast na sua DB:
     
    Downloads uint8(Effects até 255)
    Distro: TheForgottenServer.exe
    Src + datapack: Source & Data
    Recentes atualizações: GitHub
    Downloads uint8 sem o CAST incluso
    Distro: TheForgottenServer.exe
    Src + datapack: Source & Data
    -------------------------------------------------------
    Downloads uint16(Effects até 65534)
    Distro: TheForgottenServer.exe
    Src + datapack: Source & Data
    É necessário fazer a modificação do Hexadecimal no cliente. Aqui tem um já pronto: Cliente.exe(com mc) ou Cliente.exe(sem mc) (só será necessario se utilizar a src com o uint 16.)
    Lembrado também que precisa utilizar a lib 000-constant.lua deste datapack.
    -------------------------------------------------------
    Scans:
    Distro(uint8) & Distro(uint16)
    Source
    Cliente
     
    Obs: Os virus detectado é um falso positivo, então não se preocupem!
     
    A distro foi testada em Windows e em Linux Ubuntu 12.04, 14.04, em
    ambos funcionaram muito bem!
    É compatível com 16 também e o 18.04 é necessário fazer uma alteração que é possível encontrar no post desse tópico. 
     
    É possível compilar em Dev Cpp e Visual-Studio. 
     
    E para quem se interessa em saber onde se localiza os code do Cast, aqui está uma imagem. Você pode achar procurando por "//CAST"
     
    Façam um ótimo aproveito ?
  3. Curtir
    Rafals deu reputação a GBDias em Pergaminho de EXP com tempo!   
    Olá TK,
     
    Hoje trago para vocês um MOD bem interessante que encontrei na internet, a lógica é bem simples, você usa um item e ganha mais XP durante um tempo.
    O item, a XP e o tempo são totalmente configuráveis, vocês podem mudar como quiserem.
     
    FUNCIONA COM TFS 0.4 E DEVE FUNCIONAR COM 0.3.6 (NÃO TESTADO)
    Eu vou testar com a minha versão 0.3.7 quando chegar em casa e edito o post para vocês.
     
     
    Bem, então vamos ao script,
     
    Abra a pasta "mods" do seu servidor e crie um arquivo chamado expscroll.xml, abra e coloque o seguinte código:
    <?xml version="1.0" encoding="UTF-8"?> <mod name="Experience Stages Scroll" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes"> <action itemid="9004" event="script" value="expstagescroll.lua"/> <creatureevent type="think" name="ExpStage" event="script" value="expstagescroll.lua"/> <creatureevent type="login" name="ExpStageLogin" event="script" value="expstagescroll.lua"/> </mod> Agora em "mods/scripts", crie um arquivo chamado expstagescroll.lua e coloque este código:
    local config = { rate = 2, storage = 1000, expstorage = 1100, register = 1200, time = 14400, } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, config.storage) <= 0 then local rates = getPlayerRates(cid) setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL]) setPlayerStorageValue(cid, config.register, 1) itemEx=itemid == 9004 doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, os.time()+config.time) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+config.rate) doRemoveItem(item.uid,1) registerCreatureEvent(cid, "ExpStage") else doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid) end return true end function onThink(cid, interval) if getPlayerStorageValue(cid, config.register) == 1 then if getPlayerStorageValue(cid, config.storage) <= os.time() then doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, 0) setPlayerStorageValue(cid, config.register, 0) local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp) unregisterCreatureEvent(cid, "ExpStage") end end return true end function onLogin(cid) if getPlayerStorageValue(cid, config.register) == 1 then registerCreatureEvent(cid, "ExpStage") local rates = getPlayerRates(cid) doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) if getPlayerStorageValue(cid, config.storage) > os.time() then local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp+config.rate) end end return true end Configurando:
     
    rate = 2, -- número que irá ser multiplicado pela sua exp rate básica (funciona com números quebrados, tais como 1.5 ou 0.2).
    storage = 1000, -- storage que irá guardar o tempo
    expstorage = 1100, -- storage que irá guardar a xp
    register = 1200, -- storage que indica se o player está registrado no mod
    time = 14400, -- tempo que falta para o buff do scroll acabar (o tempo é calculado em segundos, ex: 14400 segundos = 24 horas)
     
    ___________________________________________________________________________________________________________________________________
     
    Créditos :
    TomCrusher (OTland) - Desenvolveu o sistema
    Eu - Traduzi e postei aqui.
  4. Curtir
    Rafals deu reputação a tetheuscunha em Teleport Falante 8.6 Igual 9.++   
    O script e basicamente um TP FALANTE, só que nada de ANIMATEDTEXT, ele e igual os TP FALANTE dos otserver 9++
     
    function onThink(interval, lastExecution) local name_of_monster = 'Training Monk'   ---  here put monster name or any npc name local texts = {   -- text              pos                effects               ["test1"] = {{x=1027, y=1021, z=7},CONST_ME_ENERGYAREA, 23},   ["test2"] = {{x=1028, y=1021, z=7},CONST_ME_ENERGYAREA, 23},   ["test3"] = {{x=1029, y=1021, z=7},CONST_ME_FIREWORK_YELLOW, 23}   }       for text, param in pairs(texts) do doCreatureSay(getCreatureByName(name_of_monster),text,TALKTYPE_ORANGE_1, false, 0,param[1])     doSendMagicEffect(param[1], param[2]) end return TRUE end  
    <globalevent name="texto" interval="3000" script="texto.lua"/>  
    EXPLICAÇÃO
     

    local name_of_monster = 'demon'   ---  here put monster name or any npc name
    Aqui você coloca o nome de um NPC ou de um Monster (se for utilizar de monster, coloque um monster que nunca morra, pois se ele morrer começara a dar erro na distro)
     
    #IMAGEM NÃO E MINHA, PEGUEI DO PEDIDO QUE UM CARA VEZ NA AREA DE PEDIDOS.

     
     
     
     
     
    #NÃO LEMBRO ONDE PEGUEI ESSE SCRIPT, TENHO ELE A MUITO TEMPO. SE EU ACHAR O DONO EU POSTAREI OS DEVIDOS CREDITOS.
  5. Curtir
    Rafals deu reputação a KekezitoLHP em Tirar Battle ao entrar em PZ   
    Autor: Eu mesmo
    Versão do tibia: 8.6
    Descrição: O script tira o battle ao entrar em alguma área pz. 
     
    1° Passo:
    Abra o arquivo creaturescripts.xml localizado em: PastaDoOT/data/creaturescripts/ adicione a linha:
    <event type="think" name="TiraBattle" event="script" value="tirabattle.lua"/>  
    2° Passo:
    Abra a pasta "scripts" e abra o arquivo login.lua
    E adicione:
     
    registerCreatureEvent(cid, "TiraBattle") 3° Passo:
    Ainda na pasta scripts, crie o arquivo: tirabattle.lua e adicione o seguinte:
     
    function onThink(cid, interval) if(getTilePzInfo(getCreaturePosition(cid))) then doRemoveCondition(cid, CONDITION_INFIGHT) end end Pronto, o script foi adicionado ao seu servidor!

    Qualquer dúvida poste aqui embaixo.

    Abraços!
  6. Gostei
    Rafals deu reputação a Huziwara em Promotion Item (MySQL)   
    Olá TKbianos,
    Estou aqui para postar pra vocês o script do item que quando usa, ganha a promotion 2 (Caso seu server tenha 3 niveis de vocação. Exemplo : Sorcerer > Master Sorcerer > Demigod.

    Tag XML :
    <action itemid="9971" event="script" value="promoitem.lua"/>

    Crie um arquivo .lua dentro da pasta scripts da pasta action e nomeie para promoitem.lua e coloque isso :

    function onUse(cid, item, fromPosition, itemEx, toPosition) local vocation = getPlayerVocation(cid) local id = getPlayerGUID(cid) if(item.itemid == 9971) then if(isInArray({5,6,7,8,9,10,11,12}, getPlayerVocation(cid)) == TRUE) then elseif vocation == 5 then db.executeQuery("UPDATE `players` SET `vocation` = 9 WHERE `id` ='"..id.."';") elseif vocation == 6 then db.executeQuery("UPDATE `players` SET `vocation` = 10 WHERE `id` ='"..id.."';") elseif vocation == 7 then db.executeQuery("UPDATE `players` SET `vocation` = 11 WHERE `id` ='"..id.."';") elseif vocation == 8 then db.executeQuery("UPDATE `players` SET `vocation` = 12 WHERE `id` ='"..id.."';") end doSendMagicEffect(fromPosition, CCONST_ME_MAGIC_RED) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, 20, "You are a ".. getPlayerVocationName(cid) ..".") return true end end

    Espero ter ajudado !

    Att. Huziwara no Mokou
  7. Gostei
    Rafals deu reputação a ViitinG em [PEDIDO] NPC que troca itens por Addon   
    Tenta assim :



  8. Gostei
    Rafals deu reputação a Vodkart em [MODS] - [8.6] Perfect Zombie System [Automático] [V1.0]   
    Qual dúvida ou erro poste no tópico que estarei respondendo.
     
     
    Obs: Antes que me falem besteiras, coloquei para os GM'S, CM'S E GOD'S não contarem no evento, então testem apenas com jogadores.
     
    Zombie.xml
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Perfect Zombie System" version="8.6" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="zombie_config"><![CDATA[ zombie_config = { storages = {172100, 172101, 172102}, -- n edite players = {min = 2, max = 30}, -- min, max players no evento rewards = {items ={{2160,10},{2494,1}}, trophy = 5805}, timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento teleport = {{x=147, y=55, z=7}, {x=125 , y=304, z=7}}, -- position do tp onde aparece, position para onde o jogador vai ao entrar no tp arena = {{x=110,y=297,z=7},{x=145,y=321,z=7}}, -- area positions monster_name = "Zombie Event", timeBetweenSpawns = 20, min_Level = 20 } zombie_days = { ["Monday"] = {"13:00","18:00","20:00","22:00"}, ["Tuesday"] = {"13:00","18:00","22:50","22:00"}, ["Wednesday"] = {"21:57","18:00","20:00","23:17"}, ["Thursday"] = {"13:00","18:00","20:00","22:00"}, ["Friday"] = {"13:00","18:00","21:45","22:00"}, ["Saturday"] = {"13:00","18:00","20:00","22:00"}, ["Sunday"] = {"13:00","18:00","20:00","22:00"} } function removeZombieTp() local t = getTileItemById(zombie_config.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(zombie_config.teleport[1], CONST_ME_POFF) end function ZerarStoragesZombie() for _, stor in pairs(zombie_config.storages) do setGlobalStorageValue(stor, 0) end end function getPlayersInZombieEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), zombie_config.arena[1], zombie_config.arena[2]) and getPlayerAccess(pid) < 3 then t[#t+1] = pid end end return t end function getZombieRewards(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function HaveCreatureZombie(area, remove) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end end function spawnZombie() if #getPlayersInZombieEvent() > 1 then local pos = {x=math.random(zombie_config.arena[1].x, zombie_config.arena[2].x), y=math.random(zombie_config.arena[1].y,zombie_config.arena[2].y), z=zombie_config.arena[1].z} if not isWalkable(pos, false, false, false) then spawnZombie() else doSummonCreature(zombie_config.monster_name, pos) doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(zombie_config.storages[2], getGlobalStorageValue(zombie_config.storages[2]) <= 0 and 1 or getGlobalStorageValue(zombie_config.storages[2])+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(zombie_config.storages[2]) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, zombie_config.timeBetweenSpawns *1000) end end end function CheckZombieEvent(delay) if getGlobalStorageValue(zombie_config.storages[1]) ~= (zombie_config.players.max+1) then if delay > 0 and getGlobalStorageValue(zombie_config.storages[1]) < zombie_config.players.max then doBroadcastMessage("Zombie event starting in " .. delay .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(zombie_config.storages[1]) < zombie_config.players.min then for _, cid in pairs(getPlayersInZombieEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) end removeZombieTp() doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. zombie_config.players.min .. " players is needed!", MESSAGE_STATUS_WARNING) ZerarStoragesZombie() elseif delay == 0 and getGlobalStorageValue(zombie_config.storages[1]) >= zombie_config.players.min then removeZombieTp() doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(zombie_config.storages[1]) .. " players]! The event will soon start.") for _, var in pairs(getPlayersInZombieEvent()) do doPlayerSendTextMessage(var, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. zombie_config.timeToStartEvent .. " seconds! Good luck!") end addEvent(spawnZombie, zombie_config.timeToStartEvent*1000) end addEvent(CheckZombieEvent, 60000, delay-1) end end]]></config> <event type="statschange" name="ZombieStats" event="script"><![CDATA[ domodlib('zombie_config') if isPlayer(cid) and isMonster(attacker) and getCreatureName(attacker) == zombie_config.monster_name then if isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then if #getPlayersInZombieEvent() > 1 then doBroadcastMessage(getPlayerName(cid) .. " have been eated by Zombies!", MESSAGE_STATUS_CONSOLE_RED) local corpse = doCreateItem(getPlayerSex(cid) == 1 and 3058 or 6081, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) if #getPlayersInZombieEvent() == 1 then local winner = getPlayersInZombieEvent()[1] doBroadcastMessage(getCreatureName(winner)..' has survived at zombie event!') local goblet = doPlayerAddItem(winner, zombie_config.rewards.trophy, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(winner) .. " for winning the Zombie event.") getZombieRewards(winner, zombie_config.rewards.items) doTeleportThing(winner, getTownTemplePosition(getPlayerTown(winner)), false) doSendMagicEffect(getPlayerPosition(winner), CONST_ME_TELEPORT) doBroadcastMessage(getPlayerName(winner).." won the Zombie event! Congratulations!") HaveCreatureZombie(zombie_config.arena, true) ZerarStoragesZombie() end else doBroadcastMessage("No one survived in the Zombie Event.", MESSAGE_EVENT_ADVANCE) HaveCreatureZombie(zombie_config.arena, true) ZerarStoragesZombie() end return false end end return true]]></event> <globalevent name="Zombie_Start" interval="60000" event="script"><![CDATA[ domodlib('zombie_config') function onThink(interval, lastExecution) if zombie_days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(zombie_days[os.date("%A")], hrs) and getGlobalStorageValue(zombie_config.storages[3]) <= 0 then local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45110) CheckZombieEvent(zombie_config.CheckTime) setGlobalStorageValue(zombie_config.storages[1], 0) setGlobalStorageValue(zombie_config.storages[2], 0) HaveCreatureZombie(zombie_config.arena, true) end end return true end]]></globalevent> <event type="login" name="Zombie_Login" event="script"><![CDATA[ domodlib('zombie_config') function onLogin(cid) registerCreatureEvent(cid, "ZombieBattle") registerCreatureEvent(cid, "ZombieStats") if isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="combat" name="ZombieBattle" event="script"><![CDATA[ domodlib('zombie_config') if isPlayer(cid) and isPlayer(target) and isInRange(getPlayerPosition(cid), zombie_config.arena[1], zombie_config.arena[2]) then doPlayerSendCancel(cid, "You may not attack this player.") return false end return true ]]></event> <movevent type="StepIn" actionid ="45110" event="script"><![CDATA[ domodlib('zombie_config') function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if getPlayerAccess(cid) > 3 then return doTeleportThing(cid, zombie_config.teleport[2]) end if getPlayerLevel(cid) < zombie_config.min_Level then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You need to be at least level " .. zombie_config.min_Level .. ".") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end if getGlobalStorageValue(zombie_config.storages[1]) <= zombie_config.players.max then doTeleportThing(cid, zombie_config.teleport[2]) setGlobalStorageValue(zombie_config.storages[1], getGlobalStorageValue(zombie_config.storages[1])+1) doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(zombie_config.storages[1]) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED) if getGlobalStorageValue(zombie_config.storages[1]) == zombie_config.players.max then setGlobalStorageValue(zombie_config.storages[1], getGlobalStorageValue(zombie_config.storages[1])+1) removeZombieTp() doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(zombie_config.storages[1])-1 .. " players]! The event will soon start.") for _, var in pairs(getPlayersInZombieEvent()) do doPlayerSendTextMessage(var, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. zombie_config.timeToStartEvent .. " seconds! Good luck!") end addEvent(spawnZombie, zombie_config.timeToStartEvent*1000) end end return true end]]></movevent> <talkaction words="/zombiestart;!zombiestart" access="5" event="buffer"><![CDATA[ domodlib('zombie_config') if getGlobalStorageValue(zombie_config.storages[3]) > 0 then doPlayerSendCancel(cid, "The event is already starting.") return true elseif not param or not tonumber(param) then doPlayerSendCancel(cid, "Use only numbers.") return true end local param = tonumber(param) <= 0 and 1 or tonumber(param) local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45110) CheckZombieEvent(tonumber(param)) ZerarStoragesZombie() setGlobalStorageValue(zombie_config.storages[3], 1) HaveCreatureZombie(zombie_config.arena, true) ]]></talkaction> <globalevent name="ZombieDebug-Start" type="start" event="buffer"><![CDATA[ domodlib('zombie_config') ZerarStoragesZombie() return true]]></globalevent> </mod>  
    OBS: Quem serve em milesegundos, mude essa parte:

     
    <globalevent name="Zombie_Start" interval="60" event="script"><![CDATA[  
     
    para
     
    <globalevent name="Zombie_Start" interval="60000" event="script"><![CDATA[  
     
     
    ----------------------------------------------------- // --------------------------------------------------
     
    o monstro você instala em data/monsters
     
    zombie event.xml
    <?xml version="1.0" encoding="UTF-8"?> <monster name="Zombie Event" nameDescription="an zombie event" race="undead" experience="280" speed="100" manacost="0"> <health now="500" max="500"/> <look type="311" corpse="9875"/> <targetchange interval="5000" chance="50"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="0"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-35000" max="-35000"/> </attacks> <defenses armor="15" defense="10"/> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="You wont last long!"/> <voice sentence="Mmmmh.. braains!"/> </voices> <loot> <item id="2148" countmax="1" chance="100000"/><!-- gold coin --> </loot> </monster>  
     
    e a tag em monsters.xml
    <monster name="Zombie Event" file="zombie event.xml"/>  
     Configuração 
     
     
     
     
    Sistema
     
    zombie_config = {
        storages = {172100, 172101}, -- não edite
        players = {min = 2, max = 30}, -- número minimo e máximo para jogadores no evento
        rewards = {items ={{2160,10},{2494,1}}, trophy = 5805}, -- premiações do jogador
        timeToStartEvent = 30, -- segundos para começar o evento após dar start
        CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento
        teleport = {{x=145, y=50, z=7}, {x=176 , y=54, z=5}}, -- posiçãodo tp onde aparece, posição para onde o jogador vai ao entrar no tp
        arena = {{x=173,y=52,z=5},{x=179,y=56,z=6}}, -- posição começo e final da area do evento
        monster_name = "Zombie Event", -- nome do monstro que será sumonado
        timeBetweenSpawns = 20, -- a cada quantos segundos é dado o respaw time do zombie no evento
        min_Level = 20 -- level minimo para participar do evento
    }
     
     
    Dia e Horário
     

    zombie_days = {
        ["Monday"] = {"13:00","18:00","20:00","22:00"},
        ["Tuesday"] = {"13:00","18:00","20:00","22:00"},
        ["Wednesday"] = {"13:00","18:00","20:00","22:00"},
        ["Thursday"] = {"13:00","18:00","20:00","22:00"},
        ["Friday"] = {"13:00","18:00","20:00","22:00"},
        ["Saturday"] = {"13:00","18:00","20:00","22:00"},
        ["Sunday"] = {"13:00","18:00","20:00","22:00"}
    }
     
     
    ["Dia em inglês"] = {"horário do evento"}
     
     
    Configurando a área:
     

     
    zombie lua.rar
  9. Gostei
    Eu já fiz uns 5 scripts desse, procura no fórum ai que você acha.
  10. Gostei
    Rafals deu reputação a Absolute em [Eject System] Expulsar Player Inativo da House   
    Salve galerinha do TK.
    Hoje vim trazer um script muito útil e buscado hoje em dia nos otservers, é o sistema de !eject.
    Como funciona ?
    Caso o player fica X dias sem logar (configurável) qualquer outro jogador pode chegar na porta da house dizendo o comando !eject, então a house ficará sem dono e em seugida o player poderá compra-la normalmente, dizendo !buyhouse.
     
    É um sript simples e que poderá dar lugar e novas houses a jogadores novos, expulsando os jogadores que não logam mais no seu servidor.
    Nota: o script é vendido em uma "empresa" de open tibia onde estou colocando os créditos , disponibilizando aqui minha adaptação e o scrpit para vocês, achou errado? não gostou? ENTÃO COMPRA LÁ =p

    Vamos ao que interessa;
     
    Abra sua pasta talkactions/scripts e dentro dela crie um arquivo .lua com o nome de: expulse_house.lua e dentro coloque:
    function onSay(cid, words, param) local position = getPlayerPosition(cid) if getPlayerLookDir(cid) == 0 then positions = {x=position.x, y=position.y-1, z=position.z} elseif getPlayerLookDir(cid) == 1 then positions = {x=position.x+1, y=position.y, z=position.z} elseif getPlayerLookDir(cid) == 2 then positions = {x=position.x, y=position.y+1, z=position.z} elseif getPlayerLookDir(cid) == 3 then positions = {x=position.x-1, y=position.y, z=position.z} end if getHouseFromPos(positions) == false then doPlayerSendTextMessage(cid, 27, "Voce precisa estar na frente a porta da casa para usar o comando.") return true end local days = 5*24*60*60 local own = getHouseOwner(getHouseFromPos(positions)) local qry = db.getResult("SELECT `lastlogin` FROM `players` WHERE `id` = "..own) if(qry:getID() ~= -1) then last = tonumber(qry:getDataInt("lastlogin")) if last < os.time() - days then setHouseOwner(getHouseFromPos(positions), NO_OWNER_PHRASE,true) doPlayerSendTextMessage(cid, 27, "A Casa agora esta sem dono, você ou outro jogador pode compra-la") end if last > os.time() - days then doPlayerSendTextMessage(cid, 27, "O proprierário desta casa ainda está ativo no servidor, tente outra casa.") end end return true end Pós ter feito isto, abra o seu arquivo talkactions.xml e coloque debaixo de uma linha qualquer a seguinte linha:
    <talkaction words="!eject" event="script" value="expulse_house.lua"/> Pronto. basta o player chegar na porta da casa e dizer !eject, caso o jogador esteja a 5 dias sem logar, os items do antigo dono irão para o DEPOT e a casa ficará sem dono.
     
     
    @Configuração do script:
      local days = 5*24*60*60 Onde está o número 5 é o tanto de dias que o player tem que ficar sem logar para outro jogador executar o comando.
     
     
    Para alterar para 3 dias, ficaria como exemplo:
        local days = 3*24*60*60 E assim sucessivamente.
     
     
    Qualquer dúvida não deixe de me comunicar, estarei disposto a ajuda-lo.
     
     
     
     
    Créditos:
    Keilost
  11. Gostei
    Rafals deu reputação a AgaSsI em [Gesior Acc] Guild War System Com Escudos   
    Vou postar o tão famoso Guild War System Com Escudos.

    Vou começar pelo site :

    Vá em Xampp/Htdocs e crie e um arquivo chamado wars.php,dentro add isto:


    <?php $main_content = "<h1 align=\"center\">Guild Wars</h1> <script type=\"text/javascript\"><!-- function show_hide(flip) { var tmp = document.getElementById(flip); if(tmp) tmp.style.display = tmp.style.display == 'none' ? '' : 'none'; } --></script> <a onclick=\"show_hide('information'); return false;\" style=\"cursor: pointer;\"><h1><center>&#187; Click to se the commands &#171;<center></h1></a> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"information\" style=\"display: none;\";> <tr align=\"center\"><b>You must send this commands in GUILD CHAT.</tr> <tr style=\"background: #512e0b;\"><td align=\"center\" class=\"white\"><b>Command</b></td><td colspan=\"2\" align=\"center\" class=\"white\"><b>Description</b></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war invite, guild name, fraglimit</b></td><td>Sends an invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150<BR></font><B>(Invite a guild to war with 150 frags count.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war invite, guild name, fraglimit, money</b></td><td>Send the invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150, 10000</font><br><B> (Invite a guild to war with 150 frags count and payment of 10000 gold coins <- you need donate to guild to use it.)<B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war accept, guild name</b></td><td>Accepts the invitation to start a war. Example: <font color=red><BR>/war accept, Chickens</font><BR><B>(Accept the war against guild \"Chickens\".)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war reject, guild name</b></td><td>Rejects the invitation to start a war. Example: <font color=red><BR>/war reject, Chickens</font><BR><B>(Reject a invitation to war from Chickens.)</B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war cancel, guild name</b></td><td>Cancels the invitation. Example: <font color=red><BR>/war cancel, Chickens</font><br><b>(Cancel my guild invitation to war with Chickens.)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance</b></td><td>See the guild balance - balance of money.</td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/balance donate value</b></td><td>Deposits money on the guild's bank account. All players can donate. Example: <font color=red><BR>/balance donate 100000 </font><BR><B>(You will donate 100k to your guild balance.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance pick value</b></td><td>Withdraws money from the guild's bank account. Can be used only by the guild leader. Example: <font color=red><BR>/balance pick 100000 </font><BR><B>(You will withdraw 100k from your guild balance.)</B></td></tr> </table> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"> <tr> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Aggressor</b></td> <td style=\"background: #512e0b\" class=\"white\"><b>Information</b></td> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Enemy</b></td> </tr><tr style=\"background: #F1E0C6;\">"; $count = 0; foreach($SQL->query('SELECT * FROM `guild_wars` WHERE `status` IN (1,4) OR ((`end` >= (UNIX_TIMESTAMP() - 604800) OR `end` = 0) AND `status` IN (0,5));') as $war) { $a = $ots->createObject('Guild'); $a->load($war['guild_id']); if(!$a->isLoaded()) continue; $e = $ots->createObject('Guild'); $e->load($war['enemy_id']); if(!$e->isLoaded()) continue; $alogo = $a->getCustomField('logo_gfx_name'); if(empty($alogo) || !file_exists('guilds/' . $alogo)) $alogo = 'default_logo.gif'; $elogo = $e->getCustomField('logo_gfx_name'); if(empty($elogo) || !file_exists('guilds/' . $elogo)) $elogo = 'default_logo.gif'; $count++; $main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a></td> <td align=\"center\">"; switch($war['status']) { case 0: { $main_content .= "<b>Pending acceptation</b><br />Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) : "unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.")."<br />Will expire in three days."; break; } case 3: { $main_content .= "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 2: { $main_content .= "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 1: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred; font-weight: bold;\">On a brutal war</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) : "") . ".<br />The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment."); break; } case 4: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred;\">Pending end</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".<br />Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." : "There's no payment set."); break; } case 5: { $main_content .= "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: <span style=\"color: red;\">" . $war['guild_kills'] . "</span> to <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span>."; break; } default: { $main_content .= "Unknown, please contact with gamemaster."; break; } } $main_content .= "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">&#187; Details &#171;</a></td> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$e->getId()."\"><img src=\"guilds/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td> </tr> <tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td colspan=\"3\">"; if(in_array($war['status'], array(1,4,5))) { $deaths = $SQL->query('SELECT `pd`.`id`, `pd`.`date`, `gk`.`guild_id` AS `enemy`, `p`.`name`, `pd`.`level` FROM `guild_kills` gk LEFT JOIN `player_deaths` pd ON `gk`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `gk`.`war_id` = ' . $war['id'] . ' AND `p`.`deleted` = 0 ORDER BY `pd`.`date` DESC')->fetchAll(); if(!empty($deaths)) { foreach($deaths as $death) { $killers = $SQL->query('SELECT `p`.`name` AS `player_name`, `p`.`deleted` AS `player_exists`, `k`.`war` AS `is_war` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `p`.`id` = `pk`.`player_id` WHERE `k`.`death_id` = ' . $death['id'] . ' ORDER BY `k`.`final_hit` DESC, `k`.`id` ASC')->fetchAll(); $count = count($killers); $i = 0; $others = false; $main_content .= date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span> <a href=\"index.php?subtopic=characters&name=" . urlencode($death['name']) . "\"><b>".$death['name']."</b></a> "; foreach($killers as $killer) { $i++; if($killer['is_war'] != 0) { if($i == 1) $main_content .= "killed at level <b>".$death['level']."</b> by "; else if($i == $count && $others == false) $main_content .= " and by "; else $main_content .= ", "; if($killer['player_exists'] == 0) $main_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">"; $main_content .= $killer['player_name']; if($killer['player_exists'] == 0) $main_content .= "</a>"; } else $others = true; if($i == $count) { if($others == true) $main_content .= " and few others"; $main_content .= ".<br />"; } } } } else $main_content .= "<center>There were no frags on this war so far.</center>"; } else $main_content .= "<center>This war did not began yet.</center>"; $main_content .= "</td> </tr>"; } if($count == 0) $main_content .= "<tr style=\"background: ".$config['site']['darkborder'].";\"> <td colspan=\"3\">Currently there are no active wars.</td> </tr>"; $main_content .= "</table>"; $main_content .= '<div align="right"><small><b>Customized by: <a href="http://www.tibiaking.com/forum/user/240289-walef-xavier">Walef Xavier</a></b></small></div><br />'; ?> Agora vá em Xampp/Htdocs/index.php e add o seguinte: case "wars"; $subtopic = "wars"; $topic = "Guild Wars"; include("wars.php"); break; Agora para finalizar a parte do site vá em Xampp/Htdocs/Layout/Tibiacom/layout.php e add o seguinte: <a href='?subtopic=wars'> <div id='submenu_wars' 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_polls' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>Guild Wars</font></div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a> Agora vamos para seu Ot: Va em GlobalEvents/scripts/start.lua e add o seguinte: executeQuery("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") db.executeQuery("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";") Agora vá em Lib e crie um arquivo .lua chamado 101-war,dentro add o seguinte: WAR_GUILD = 0 WAR_ENEMY = 1 Agora para finalizar vamos colocar os comandos em Talkactions ! Vá em Talkactions/scripts e crie dois arquivos chamados war.lua e balance.lua,dentro add o seguinte: War.lua function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true balance.lua local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(guild == 0) then return false end local t = string.explode(param, ' ', 1) if(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER and isInArray({ 'pick' }, t[1])) then if(t[1] == 'pick') then local money = { tonumber(t[2]) } if(not isValidMoney(money[1])) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end local result = db.getResult('SELECT `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end money[2] = result:getDataLong('balance') result:free() if(money[1] > money[2]) then doPlayerSendChannelMessage(cid, '', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_W, 0) return true end if(not db.query('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) doPlayerSendChannelMessage(cid, '', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_W, 0) else doPlayerSendChannelMessage(cid, '', 'Invalid sub-command.', TALKTYPE_CHANNEL_W, 0) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end if(getPlayerMoney(cid) < money) then doPlayerSendChannelMessage(cid, '', 'You don\'t have enough money.', TALKTYPE_CHANNEL_W, 0) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.query('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') doPlayerSendChannelMessage(cid, '', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_W, 0) else local result = db.getResult('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end doPlayerSendChannelMessage(cid, '', 'Current balance of guild ' .. result:getDataString('name') .. ' is: ' .. result:getDataLong('balance') .. ' bronze coins.', TALKTYPE_CHANNEL_W, 0) result:free() end return true end Agora vá em Talkactions/talkactions.xml e add as duas tags: <talkaction words="/war" channel="0" event="script" value="war.lua" desc="(Guild channel command) War management."/> <talkaction words="/balance" channel="0" event="script" value="balance.lua" desc="(Guild channel command) Balance management."/> Pronto,seu Guild War Systema está instalado...mas para funcionar necessitará das tabelas na sua database e do Tfs 0.4 .Vou posta-los abaixo,respectivamente. .:: Tabelas ::. Para quem ainda não sabe add tabelas a sua database,vou ensinar: Acesse seu phpmyadmin,digite sua senha (caso tenha),clique no nome da sua database a esquerda,assim que carregar a sua database clique em SQL lá em cima...Aparecerá um espaço em branco lá voce irá add as seguintes tabelas...e depois clicar em Executar. CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT '0', `end` BIGINT NOT NULL DEFAULT '0', `frags` INT UNSIGNED NOT NULL DEFAULT '0', `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0', `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0', `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0', `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`) ) ENGINE=InnoDB; ALTER TABLE `guild_wars` ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`; CREATE TABLE IF NOT EXISTS `guild_kills` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `guild_id` INT NOT NULL, `war_id` INT NOT NULL, `death_id` INT NOT NULL ) ENGINE = InnoDB; ALTER TABLE `guild_kills` ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;

    Pronto o Guild Wars System está totalmente instalado!

    Creditos: Walef Xavier
    sei que o topico ta ruim maiis ta aii o war system
  12. Gostei
    Rafals deu reputação a Lyon em (Resolvido)War System (Do Matheus) - Erro Distro 0.4   
    Tente trocar por este:
    function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end
  13. Gostei
    Rafals deu reputação a Natanael Beckman em ShopGuild Points 100% add em player offline. Atualizado   
    Obrigatoriamente leia tudo!
    Atualizado 01/07/2014
     
    Opa galera mais uma vez eu trazendo o melhor para todos.
    Hoje vou postar o sistema de Guild de Points que eu utilizo em meu OTserver, acredito que dificilmente será encontrado por ae um tão completo e sem bugs igual o que será postado logo abaixo, é um sistema completo que é utilizado pelo líder da guild executando um comando que, se tiver de acordo com as regras que seram feitas por você, todos os membros da guild iram receber os pontos uma unica vez, lembrando que quando os pontos são adicionados a um player ele não receberá entrando em outra guild e não receberá criando outro personagem na conta, resumindo ele só receberá uma unica vez na conta e com um player só. E um dos detalhes que me causava dor de cabeça era que quando um líder executava o comando, quem estava online recebia os pontos, mais quem estava offline não recebia, isso acontecia normalmente porque tem guilds que contém 50, 70, 100 players, portanto nem sempre todos estavam online. O comando só pode ser executado uma vez por dia cada guild, para não gerar processamentos desnecessários e assim um mal funcionamento do servidor.

    Cada administrador pode configurar seu sistema da forma que quiser, por ser um sistema muito simples, você pode bota que todos os players estejam no minimo level x, que a guild só possa executar o comando quando estiver quantidade x de players online, isso é bom porque traz um certa dificuldade para fraudes de pontos, e o sistema só vira bagunça dependendo do que você vai oferecer no seu shop guild, eu particularmente só utilizei esse comando porque muitas guilds grandes pediam pontos, eles me cobravam uma quantidade x de pontos e eu cobrava uma quantidade x de player então pra automatizar o processo e não ter dor de cabeça foi feito todo esse sistema. Se você analisar bem vai ver que tudo isso só gera mais crescimento ao seu servidor.
    Bom, vamos ao sistema:

    Em talkactions.xml, adicione a tag abaixo:
          <talkaction words="!guildpoints" event="script" value="guildpoints.lua"/> Na pasta talkactions/scripts faça um .lua com o nome guildpoints e dentro dele adicione os coder abaixo: GuildPointsConfigs = {         ExecuteIntervalHours = 24,         NeedPlayersOnline = 10,         NeedDiferentIps = 6,         MinLevel = 80,         AddPointsForAcc = 9 } function getGuildPlayersValidAccIDS(GuildID, MinLevel)         local RanksIDS = {}         local AccsID = {}         local ValidAccsID = {}         Query1 = db.getResult("SELECT `id` FROM `guild_ranks` WHERE guild_id = '".. GuildID .."'")         if(Query1:getID() == -1) then                 return ValidAccsID         end         for i = 1, Query1:getRows() do                 table.insert(RanksIDS, Query1:getDataInt("id"))                 Query1:next()         end         Query2 = db.getResult("SELECT `account_id` FROM `players` WHERE `rank_id` IN (".. table.concat(RanksIDS, ', ') ..") AND `level` >= ".. MinLevel .."")         if(Query2:getID() == -1) then                 return ValidAccsID         end         for i = 1, Query2:getRows() do                 local AccID = Query2:getDataInt("account_id")                 if #AccsID > 0 then                         for k = 1, #AccsID do                                 if AccID == AccsID[k] then                                         AddAccList = false                                         break                                 end                                 AddAccList = true                         end                         if AddAccList then                                 table.insert(AccsID, AccID)                         end                 else                         table.insert(AccsID, AccID)                 end                 Query2:next()         end         Query3 = db.getResult("SELECT `id` FROM `accounts` WHERE `guild_points_stats` = 0 AND `id` IN (".. table.concat(AccsID, ', ') ..")")         if(Query3:getID() == -1) then                 return ValidAccsID         end         for i = 1, Query3:getRows() do                 local AccID = Query3:getDataInt("id")                 if #ValidAccsID > 0 then                         for k = 1, #ValidAccsID do                                 if AccID == ValidAccsID[k] then                                         AddAccList = false                                         break                                 end                                 AddAccList = true                         end                         if AddAccList then                                 table.insert(ValidAccsID, AccID)                         end                 else                         table.insert(ValidAccsID, AccID)                 end                 Query3:next()         end         return ValidAccsID end function onSay(cid, words, param, channel)         if(getPlayerGuildLevel(cid) == 3) then                 local GuildID = getPlayerGuildId(cid)                 Query = db.getResult("SELECT `last_execute_points` FROM `guilds` WHERE id = '".. GuildID .."'")                 if(Query:getID() == -1) then                         return true                 end                 if Query:getDataInt("last_execute_points") < os.time() then                         local GuildMembers = {}                         local GuildMembersOnline = {}                         local PlayersOnline = getPlayersOnline()                         for i, pid in ipairs(PlayersOnline) do                                 if getPlayerGuildId(pid) == GuildID then                                         if getPlayerLevel(pid) >= GuildPointsConfigs.MinLevel then                                                 table.insert(GuildMembersOnline, pid)                                         end                                 end                         end                         if #GuildMembersOnline >= GuildPointsConfigs.NeedPlayersOnline then                                 local IPS = {}                                 for i, pid in ipairs(GuildMembersOnline) do                                         local PlayerIP = getPlayerIp(pid)                                         if #IPS > 0 then                                                 for k = 1, #IPS do                                                         if PlayerIP == IPS[k] then                                                                 AddIPList = false                                                                 break                                                         end                                                         AddIPList = true                                                 end                                                 if AddIPList then                                                         table.insert(IPS, PlayerIP)                                                 end                                         else                                                 table.insert(IPS, PlayerIP)                                         end                                 end                                 if #IPS >= GuildPointsConfigs.NeedDiferentIps then                                         local ValidAccounts = getGuildPlayersValidAccIDS(GuildID, GuildPointsConfigs.MinLevel)                                         db.executeQuery("UPDATE `guilds` SET `last_execute_points` = ".. os.time() +(GuildPointsConfigs.ExecuteIntervalHours * 3600) .." WHERE `guilds`.`id` = ".. GuildID ..";")                                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "".. #ValidAccounts .." Players received points")                                         if #ValidAccounts > 0 then                                                 db.executeQuery("UPDATE `accounts` SET `guild_points` = `guild_points` + " ..GuildPointsConfigs.AddPointsForAcc .. ", `guild_points_stats` = ".. os.time() .." WHERE `id` IN (" .. table.concat(ValidAccounts, ',') ..");")                                                 for i, pid in ipairs(GuildMembersOnline) do                                                         local PlayerMSGAccID = getPlayerAccountId(pid)                                                         for k = 1, #ValidAccounts do                                                                 if PlayerMSGAccID == ValidAccounts[k] then                                                                         doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "You received "..GuildPointsConfigs.AddPointsForAcc .." guild points.")                                                                         break                                                                 end                                                         end                                                 end                                         end                                 else                                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only ".. #IPS .." players are valid, you need ".. GuildPointsConfigs.NeedDiferentIps .." players with different ips.")                                 end                         else                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Has only ".. #GuildMembersOnline .." players online you need ".. GuildPointsConfigs.NeedPlayersOnline .." players online at least from level ".. GuildPointsConfigs.MinLevel ..".")                         end                 else                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The command can only be run once every "..GuildPointsConfigs.ExecuteIntervalHours .." hours.")                 end         else                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only guild leader can request points.")         end         return true end No coder acima bem no inicio tem as linhas seguintes para configurar:

    ExecuteIntervalHours = 24, ( Intervalo para execução do comando, ae está de 24 em 24hrs)
    NeedPlayersOnline = 10, (Quantos players é preciso está online para poder executar o comando.)
    NeedDiferentIps = 6, (Quantos IPS diferentes são necessários para executar o comando no exemplo ae tem 6.)
    MinLevel = 80, (Aqui adicione o level minimo, é necessário que todos os player da guild tenha o level pedido para o lider executar o comando.)
    AddPointsForAcc = 9, (Aqui é a quantidade de pontos para adicionar em cada player da guild.)
     
    Em data/globalevents/scripts crie um arquivo chamado shopguild.lua e adicione o code a seguir:
    local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE local SQL_interval = 30 function onThink(interval, lastExecution)         local result_plr = db.getResult("SELECT * FROM z_ots_guildcomunication WHERE `type` = 'login';")         if(result_plr:getID() ~= -1) then                 while(true) do                         local id = tonumber(result_plr:getDataInt("id"))                         local action = tostring(result_plr:getDataString("action"))                         local delete = tonumber(result_plr:getDataInt("delete_it"))                         local cid = getCreatureByName(tostring(result_plr:getDataString("name")))                         if isPlayer(cid) then                                 local itemtogive_id = tonumber(result_plr:getDataInt("param1"))                                 local itemtogive_count = tonumber(result_plr:getDataInt("param2"))                                 local container_id = tonumber(result_plr:getDataInt("param3"))                                 local container_count = tonumber(result_plr:getDataInt("param4"))                                 local add_item_type = tostring(result_plr:getDataString("param5"))                                 local add_item_name = tostring(result_plr:getDataString("param6"))                                 local received_item = 0                                 local full_weight = 0                                 if add_item_type == 'container' then                                         container_weight = getItemWeightById(container_id, 1)                                         if isItemRune(itemtogive_id) == TRUE then                                                 items_weight = container_count * getItemWeightById(itemtogive_id, 1)                                         else                                                 items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)                                         end                                         full_weight = items_weight + container_weight                                 else                                         full_weight = getItemWeightById(itemtogive_id, itemtogive_count)                                         if isItemRune(itemtogive_id) == TRUE then                                                 full_weight = getItemWeightById(itemtogive_id, 1)                                         else                                                 full_weight = getItemWeightById(itemtogive_id, itemtogive_count)                                         end                                 end                                 local free_cap = getPlayerFreeCap(cid)                                 if full_weight <= free_cap then                                         if add_item_type == 'container' then                                                 local new_container = doCreateItemEx(container_id, 1)                                                 local iter = 0                                                 while iter ~= container_count do                                                         doAddContainerItem(new_container, itemtogive_id, itemtogive_count)                                                         iter = iter + 1                                                 end                                                 received_item = doPlayerAddItemEx(cid, new_container)                                         else                                                 local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)                                                 doItemSetAttribute(new_item, "description", "This item can only be used by the player ".. getPlayerName(cid) .."!")                                                 doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000)                                                 received_item = doPlayerAddItemEx(cid, new_item)                                         end                                         if received_item == RETURNVALUE_NOERROR then                                                 doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS GuildShop.')                                                 db.executeQuery("DELETE FROM `z_ots_guildcomunication` WHERE `id` = " .. id .. ";")                                                 db.executeQuery("UPDATE `z_shopguild_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")                                         else                                                 doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS GuildShop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')                                         end                                 else                                         doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS GuildShop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')                                 end                         end                         if not(result_plr:next()) then                                 break                         end                 end                 result_plr:free()         end         return true end Em data/globalevents/globalevents.xml adicione a seguinte tag:
    <globalevent name="shopguild" interval="300" event="script" value="shopguild.lua"/> Certo, a parte do servidor é esta, ta feita, vamos adicionar a database o coder a seguir:
                      ALTER TABLE `accounts` ADD `guild_points` INTEGER(11) NOT NULL DEFAULT 0;                   ALTER TABLE `accounts` ADD `guild_points_stats` INT NOT NULL DEFAULT '0';                   ALTER TABLE `guilds` ADD `last_execute_points` INT NOT NULL DEFAULT '0';                   CREATE TABLE `z_shopguild_offer` (                         `id` int(11) NOT NULL auto_increment,                         `points` int(11) NOT NULL default '0',                         `itemid1` int(11) NOT NULL default '0',                         `count1` int(11) NOT NULL default '0',                         `itemid2` int(11) NOT NULL default '0',                         `count2` int(11) NOT NULL default '0',                         `offer_type` varchar(255) default NULL,                         `offer_description` text NOT NULL,                         `offer_name` varchar(255) NOT NULL,                         `pid` INT(11) NOT NULL DEFAULT '0',                   PRIMARY KEY (`id`))                   CREATE TABLE `z_shopguild_history_item` (                         `id` int(11) NOT NULL auto_increment,                         `to_name` varchar(255) NOT NULL default '0',                         `to_account` int(11) NOT NULL default '0',                         `from_nick` varchar(255) NOT NULL,                         `from_account` int(11) NOT NULL default '0',                         `price` int(11) NOT NULL default '0',                         `offer_id` int(11) NOT NULL default '0',                         `trans_state` varchar(255) NOT NULL,                         `trans_start` int(11) NOT NULL default '0',                         `trans_real` int(11) NOT NULL default '0',                   PRIMARY KEY (`id`))                   CREATE TABLE `z_shopguild_history_pacc` (                         `id` int(11) NOT NULL auto_increment,                         `to_name` varchar(255) NOT NULL default '0',                         `to_account` int(11) NOT NULL default '0',                         `from_nick` varchar(255) NOT NULL,                         `from_account` int(11) NOT NULL default '0',                         `price` int(11) NOT NULL default '0',                         `pacc_days` int(11) NOT NULL default '0',                         `trans_state` varchar(255) NOT NULL,                         `trans_start` int(11) NOT NULL default '0',                         `trans_real` int(11) NOT NULL default '0',                   PRIMARY KEY (`id`)) CREATE TABLE IF NOT EXISTS `z_ots_guildcomunication` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `name` varchar(255) NOT NULL,   `type` varchar(255) NOT NULL,   `action` varchar(255) NOT NULL,   `param1` varchar(255) NOT NULL,   `param2` varchar(255) NOT NULL,   `param3` varchar(255) NOT NULL,   `param4` varchar(255) NOT NULL,   `param5` varchar(255) NOT NULL,   `param6` varchar(255) NOT NULL,   `param7` varchar(255) NOT NULL,   `delete_it` int(2) NOT NULL DEFAULT '1',   PRIMARY KEY (`id`) ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13107; Olha estamos quase finalizando tudo, só precisamos terminar a parte de web.
    O meu GuildShop eu copiei meu shopsystem.php e fiz umas modificações, simples você pode fazer o mesmo é menos trabalhoso.
    Copie o shopsystem.php renomeie para shopguild.php, após abra-o e modifique como manda a seguir:

    shop_system para shopguild_system
    premium_points para guild_points
    premium points para guild points
    z_shop_offer para z_shopguild_offer
    shopsystem para shopguild
    z_shop_history_pacc para z_shopguild_history_pacc
    z_shop_history_item para z_shopguild_history_item
    z_ots_comunication para z_ots_guildcomunication
     
    Ou utilize este já pronto:
    shopguild.php
     
    O shopguildadmin.php está no link abaixo, basta fazer o mesmo procedimento:
    shopguildadmin.php
     
    Em index.php add:
    case "shopguild";    $topic = "Shop Guild";    $subtopic = "shopguild";    include("shopguild.php"); break; case "shopguildadmin";    $topic = "ShopGuild Admin";    $subtopic = "shopguildadmin";    include("shopguildadmin.php"); break; Vá em config.php adicione:
    $config['site']['shopguild_system'] = 1; $config['site']['access_adminguild_panel'] = 9; Vá em layouts.php adicione abaixo de buypoints:
                                    <a href='?subtopic=shopguild'>                                         <div id='submenu_shopguild' 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_shopguild' class='ActiveSubmenuItemIcon'style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>                                                 <div class='SubmenuitemLabel'>Shop Guild</div>                                                 <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>                                         </div>                                 </a> Em layouts.php add depois do shopadmin:
    if($group_id_of_acc_logged >= $config['site']['access_adminguild_panel'])   echo "<a href='?subtopic=shopadmin'>                                    <div id='submenu_shopguildadmin' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)'onMouseOut='MouseOutSubmenuItem(this)'>                                           <div class='LeftChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div>                                           <div id='ActiveSubmenuItemIcon_shopguildadmin' class='ActiveSubmenuItemIcon'style='background-image:url(".$layout_name."/images/menu/icon-activesubmenu.gif);'></div>                                           <div class='SubmenuitemLabel'><font color=red>! ShopGuild Admin !</font></div>                                          <div class='RightChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div>                                    </div>                             </a>"; Em shopsystem.php procure por:
            elseif($action == 'show_history') {                 if(!$logged) {                         $main_content .= 'Please login first.';                 } else{                         $items_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';');                         if(is_object($items_history_received)) {                                 foreach($items_history_received as $item_received) {                                         if($account_logged->getId() == $item_received['to_account'])                                                 $char_color = 'green';                                         else                                                 $char_color = 'red';                                                 $items_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$item_received['to_name'].'</font></td><td>';                                         if($account_logged->getId() == $item_received['from_account'])                                                 $items_received_text .= '<i>Your account</i>';                                         else                                                 $items_received_text .= $item_received['from_nick'];                                                                                                 $items_received_text .= '</td><td>'.$item_received['offer_id'].'</td><td>'.$item_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $item_received['trans_start']).'</td>';                                                                                                                                                                                                         if($item_received['trans_real'] > 0)                                                 $items_received_text .= '<td>'.date("j F Y, H:i:s",$item_received['trans_real']).'</td>';                                         else                                                 $items_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>';                                                 $items_received_text .= '</tr>';                                 }                         }                         $paccs_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_pacc').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';');                         if(is_object($paccs_history_received)) {                                 foreach($paccs_history_received as $pacc_received) {                                         if($account_logged->getId() == $pacc_received['to_account'])                                                 $char_color = 'green';                                         else                                                 $char_color = 'red';                                                 $paccs_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$pacc_received['to_name'].'</font></td><td>';                                         if($account_logged->getId() == $pacc_received['from_account'])                                                 $paccs_received_text .= '<i>Your account</i>';                                         else                                                 $paccs_received_text .= $pacc_received['from_nick'];                                                 $paccs_received_text .= '</td><td>'.$pacc_received['pacc_days'].' days</td><td>'.$pacc_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $pacc_received['trans_real']).'</td></tr>';                                 }                         }                         $main_content .= '<center><h1>Transactions History</h1></center>';                         if(!empty($items_received_text))                                 $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="6"><font color="white" size="4"><b>&nbsp;Item Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Cost</b></td><td><b>Bought on page</b></td><td><b>Received on '.$config['server']['serverName'].'</b></td></tr>'.$items_received_text.'</table><br />';                         if(!empty($paccs_received_text))                                 $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Pacc Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Duration</b></td><td><b>Cost</b></td><td><b>Added:</b></td></tr>'.$paccs_received_text.'</table><br />';                         if(empty($paccs_received_text) && empty($items_received_text))                                 $main_content .= 'You did not buy/receive any items or PACC.';                 }         } Troque por:
            elseif($action == 'show_history') {                 if(!$logged) {                         $main_content .= 'Please login first.';                 } else{                         $items_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';');                         if(is_object($items_history_received)) {                                 foreach($items_history_received as $item_received) {                                         if($account_logged->getId() == $item_received['to_account'])                                                 $char_color = 'green';                                         else                                                 $char_color = 'red';                                                 $items_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$item_received['to_name'].'</font></td><td>';                                         if($account_logged->getId() == $item_received['from_account'])                                                 $items_received_text .= '<i>Your account</i>';                                         else                                                 $items_received_text .= $item_received['from_nick'];                                                                                                 $items_received_text .= '</td><td>'.$item_received['offer_id'].'</td><td>'.$item_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $item_received['trans_start']).'</td>';                                                                                                                                                                                                         if($item_received['trans_real'] > 0)                                                 $items_received_text .= '<td>'.date("j F Y, H:i:s",$item_received['trans_real']).'</td>';                                         else                                                 $items_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>';                                                 $items_received_text .= '</tr>';                                 }                         }                         $itemsguild_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shopguild_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';');                         if(is_object($itemsguild_history_received)) {                                 foreach($itemsguild_history_received as $itemguild_received) {                                         if($account_logged->getId() == $itemguild_received['to_account'])                                                 $char_color = 'green';                                         else                                                 $char_color = 'red';                                                 $itemsguild_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$itemguild_received['to_name'].'</font></td><td>';                                         if($account_logged->getId() == $itemguild_received['from_account'])                                                 $itemsguild_received_text .= '<i>Your account</i>';                                         else                                                 $itemsguild_received_text .= $itemguild_received['from_nick'];                                                                                                 $itemsguild_received_text .= '</td><td>'.$itemguild_received['offer_id'].'</td><td>'.$itemguild_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $itemguild_received['trans_start']).'</td>';                                                                                                                                                                                                         if($itemguild_received['trans_real'] > 0)                                                 $itemsguild_received_text .= '<td>'.date("j F Y, H:i:s",$itemguild_received['trans_real']).'</td>';                                         else                                                 $itemsguild_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>';                                                 $itemsguild_received_text .= '</tr>';                                 }                         }                         $paccs_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_pacc').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';');                         if(is_object($paccs_history_received)) {                                 foreach($paccs_history_received as $pacc_received) {                                         if($account_logged->getId() == $pacc_received['to_account'])                                                 $char_color = 'green';                                         else                                                 $char_color = 'red';                                                 $paccs_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$pacc_received['to_name'].'</font></td><td>';                                         if($account_logged->getId() == $pacc_received['from_account'])                                                 $paccs_received_text .= '<i>Your account</i>';                                         else                                                 $paccs_received_text .= $pacc_received['from_nick'];                                                 $paccs_received_text .= '</td><td>'.$pacc_received['pacc_days'].' days</td><td>'.$pacc_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $pacc_received['trans_real']).'</td></tr>';                                 }                         }                         $paccsguild_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shopguild_history_pacc').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';');                         if(is_object($paccsguild_history_received)) {                                 foreach($paccsguild_history_received as $paccguild_received) {                                         if($account_logged->getId() == $paccguild_received['to_account'])                                                 $char_color = 'green';                                         else                                                 $char_color = 'red';                                                 $paccsguild_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$paccguild_received['to_name'].'</font></td><td>';                                         if($account_logged->getId() == $paccguild_received['from_account'])                                                 $paccsguild_received_text .= '<i>Your account</i>';                                         else                                                 $paccsguild_received_text .= $paccguild_received['from_nick'];                                                 $paccsguild_received_text .= '</td><td>'.$paccguild_received['pacc_days'].' days</td><td>'.$paccguild_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $paccguild_received['trans_real']).'</td></tr>';                                 }                         }                         $main_content .= '<center><h1>Transactions History</h1></center>';                         if(!empty($items_received_text))                                 $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="6"><font color="white" size="4"><b>&nbsp;ShopServer Item Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Cost</b></td><td><b>Bought on page</b></td><td><b>Received on '.$config['server']['serverName'].'</b></td></tr>'.$items_received_text.'</table><br />';                         if(!empty($itemsguild_received_text))                                 $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="6"><font color="white" size="4"><b>&nbsp;ShopGuild Item Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Cost</b></td><td><b>Bought on page</b></td><td><b>Received on '.$config['server']['serverName'].'</b></td></tr>'.$itemsguild_received_text.'</table><br />';                         if(!empty($paccs_received_text))                                 $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;ShopServer VIP Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Duration</b></td><td><b>Cost</b></td><td><b>Added:</b></td></tr>'.$paccs_received_text.'</table><br />';                         if(!empty($paccsguild_received_text))                                 $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;ShopGuild VIP Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Duration</b></td><td><b>Cost</b></td><td><b>Added:</b></td></tr>'.$paccsguild_received_text.'</table><br />';                         if(empty($paccs_received_text) && empty($items_received_text))                                 $main_content .= 'You did not buy/receive any items or PACC.';                         if(empty($paccsguild_received_text) && empty($itemsguild_received_text))                                 $main_content .= 'You did not buy/receive any items or PACC.';                 }         } Finalmente terminamos!
    Bom todo esse processo é feito só para facilitar tudo pra você e o player e pra diferenciar o Shop System do Shop Guild, porque um sustenta as despesas do server e o outro atrai player, porque pra conseguir player é preciso ter player.

    Galera acredito que não esteja faltando nada, espero que gostem e tudo que eu poder fazer para nossas melhoras estarei postando, me desculpem meus erros de português mais o que importa aqui é o script está correto, abraços!


    Créditos:
    Natanael Beckman
    LukeSkywalker (Raphael Luiz) .lua 100%
    Não proíbo ninguém de copia o tópico só peço que onde você adicione inclua os créditos mencionados.
  14. Gostei
    Rafals deu reputação a Helliab em [Gesior ACC] Compra e Venda de personagens por pontos   
    Compra e venda de personagens por pontos para Gesior ACC.
    Vamos lá..
     
    FOTOS:
     
    Venda:

     
     
    Compra:

     

     
     
    Crie um arquivo dentro do htdocs, chamado buychar.php e dentro dele coloque:
     
    <?PHP if($logged) { if ($action == '') { $main_content .= '<center>Here is the list of the current characters that are in the shop!</center>'; $main_content .= '<BR>'; $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Name</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Vocation</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Level</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Price</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Buy it</B></CENTER></TD></TR>'; $getall = $SQL->query('SELECT `id`, `name`, `price`, `status` FROM `sellchar` ORDER BY `id`')or die(mysql_error()); foreach ($getall as $tt) { $namer = $tt['name']; $queryt = $SQL->query("SELECT `name`, `vocation`, `level` FROM `players` WHERE `name` = '$namer'"); foreach ($queryt as $ty) { if ($ty['vocation'] == 1) { $tu = 'Sorcerer'; } else if ($ty['vocation'] == 2) { $tu = 'Druid'; } else if ($ty['vocation'] == 3) { $tu = 'Paladin'; } else if ($ty['vocation'] == 4) { $tu = 'Knight'; } else if ($ty['vocation'] == 5) { $tu = 'Sorcerer'; } else if ($ty['vocation'] == 6) { $tu = 'Druid'; } else if ($ty['vocation'] == 7) { $tu = 'Paladin'; } else if ($ty['vocation'] == 8) { $tu = 'Knight'; } $ee = $tt['name']; $ii = $tt['price']; $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><CENTER><B><a href="index.php?subtopic=characters&name='.$tt['name'].'">'.$tt['name'].'</a></B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tu.'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$ty['level'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tt['price'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B> <form action="?subtopic=buychar&action=buy" method="POST"> <input type="hidden" name="char" value="'.$ee.'"> <input type="hidden" name="price" value="'.$ii.'"> <input type="submit" name="submit" value="Buy it"></B></CENTER></TD></TR></form>'; } } $main_content .= '</TABLE>'; } if ($action == 'buy') { $name = $_POST['char']; $price = $_POST['price']; $ceh = $SQL->query("SELECT `name` FROM `sellchar` WHERE `name` = '$name'"); if ($ceh) { if ($name == '') { $main_content .= '<b><center>Select a character to buy first/b>'; } else { $user_premium_points = $account_logged->getCustomField('premium_points'); $user_id = $account_logged->getCustomField('id'); if ($user_premium_points >= $price) { $check = $SQL->query("SELECT * FROM `sellchar` WHERE `name` = '$name'") or die(mysql_error()); $check1 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$name'") or die(mysql_error()); $check2 = $SQL->query("SELECT `oldid` FROM `sellchar` WHERE `name` = '$name'"); foreach ($check as $result) { foreach($check1 as $res) { foreach($check2 as $ress) { $oid = $ress['oldid']; $main_content .= '<center>You bought<b> '.$name.' ( '.$res['level'].' ) </b>for <b>'.$result['price'].' points.</b><br></center>'; $main_content .= '<br>'; $main_content .= '<center><b>The character is in your account, have fun!</b></center>'; $execute1 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` - '$price' WHERE `id` = '$user_id'"); $execute2 = $SQL->query("UPDATE `players` SET `account_id` = '$user_id' WHERE `name` = '$name'"); $execute2 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '$price' WHERE `id` = '$oid'"); $execute3 = $SQL->query("DELETE FROM `sellchar` WHERE `name` = '$name'"); } } } } else { $main_content .= '<center><b>You dont have enought premium points</b></center>'; } } } else { $main_content .= '<center><b>Character cannot be buyed</b></center>'; } } } else { $main_content .= '<center>Please log in first!</center>'; } ?>  
    depois crie um chamado sellchar.php e coloque isso:
    <?PHP if($logged) { $main_content .= '<center><b>Here you can put your character on sale!</center></b><br>'; $main_content .= 'If you put your character on sale anyone can buy it, you will lose acces to that character and you wont be able to log in with that character until someone buys it, you can also delete your offer by talking to an admin!<br><b>when someone buys your character you will get the price in points!</b>'; $main_content .= '<br>'; $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Sell your characters</B></CENTER></TD></TR>'; $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><B></B>'; $players_from_logged_acc = $account_logged->getPlayersList(); $players_from_logged_acc->orderBy('name'); $main_content .= '<form action="" method="post"><select name="char">'; foreach($players_from_logged_acc as $player) { $main_content .= '<option>'.$player->getName().'</option>'; } $main_content .= '</select>Select a character to sell<br>'; $main_content .= '<input type="text" name="price" maxlength="10" size="4" >Select the price of the character<br>'; $main_content .= '<input type="submit" name="submit" value="Sell character"></TD></TR>'; $main_content .= '</form></table>'; if (isset($_POST['submit'])) { $char = stripslashes($_POST['char']); $price = stripslashes($_POST['price']); if ($char && $price) { if(is_numeric(trim($_POST['price']))) { $check2 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$char'") or die(mysql_error()); foreach ($check2 as $re) { $voc = $re['vocation']; $oid = $re['account_id']; } $check1 = $SQL->query("UPDATE `players` SET `account_id` = 1 WHERE `name` = '$char'") or die(mysql_error()); $check3 = $SQL->query("INSERT INTO `sellchar` VALUES ('','$char','$voc','$price','1','$oid')"); $main_content .= '<b><center>You added your character correctly, thanks!</b></center>'; header("Location: index.php?subtopic=buychar"); } else { $main_content .= '<b><center>Set a numeric price!!</b></center>'; } } else { $main_content .= '<b><center>Fill out all fields!</b></center>'; } } } else { $main_content .= '<b><center>Please log in first!</b></center>'; } ?>  
    depois disso vá em htdocs/layouts/layout que você usa/layouts e insira as duas páginas aonde você bem querer(sugiro que seja na aba shop, pois é venda e compra).. caso alguém não saiba posta aqui no tópico que eu ensino.
     
    Agora adicione isso no index.php
    case "sellchar";                 $topic = "Sell Char";                 $subtopic = "sellchar";                 include("sellchar.php");     break;          case "buychar";                 $topic = "Buy Char";                 $subtopic = "buychar";                 include("buychar.php");     break;  
    Agora acesse a database do OT e insira este comando SQL
    CREATE TABLE IF NOT EXISTS `sellchar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL, `vocation` int(11) NOT NULL, `price` int(11) NOT NULL, `status` varchar(40) NOT NULL, `oldid` varchar(40) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Pronto para ser usado!!
     
     
     
     
    obs1: Caso você não adicionou a página no layouts acesse assim:
     
    127.0.0.1/?subtopic=sellchar
    127.0.0.1/?subtopic=buychar
     
    obs2: não tem como a pessoa que colocou a venda tirá-lo depois, se algum programador se habilitar a fazer o esquema aí para nós, fico grato.
     
     
     
     
    --- Créditos ---
    Raggaer
    Helliab por trazer ao TK.
     
    REP++
     
    @helliabsantana
  15. Gostei
    Rafals deu reputação a Dean183 em Aumentando attackspeed por fist(sem usar sources)   
    Olá criançada do tibiaking.
     
            Durante muito tempo, várias pessoas vieram me perguntar como colocar o attackspeed por fist fighting e a resposta sempre foi a mesma:
     
    "Tendo as sources é só dar uma procurada no tibiaking que lá tem(Jabá)"
     
            Mas parando para pensar um pouco e sendo criativo, elaborei 1 jeito(incrivelmente fácil) de imitar esse sistema apenas em LUA.
     
     
     
    Nota1: Como a estrutura lua apresenta certas limitações infelizmente o sistema também, será necessário um item na mão para se treinar o fist (se você bater em algum target sem items, a velocidade do ataque ira parecer a original mesmo tendo 5k de fist fighting.
     
    Nota2: Caso você tenha acesso as sources do seu ot e saiba como compilar etc, é melhor que você use o sistema nas sources vide: Attackspeed por Fist
     
    Nota3: Se você não tiver acesso as sources(elas são sempre um problema não é mesmo)e a velocidade de ataque aumente muito, a mudança no attackspeed só será visível se o player estiver usando bot.
     
     
     
     
           Então vamos logo ao que interessa a todos:
     
     
                    Primeiro: criei um arquivo lua em data\creaturescripts\scripts como o nome de  attackspeed.lua  e coloque o seguinte dentro:
     
    function onAttack(cid, target) --------Fist fighting decreasing/increasing attackspeed in lua by MMF--------     local skill = getPlayerSkill(cid, 0)     local velocidade = math.floor(20000/(1.35*skill)) -- altere aqui para aumentar/diminuir a quantidade de ataques por segundo!     local item = getPlayerWeapon(cid)     if item.itemid == 0 then         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ter uma arma em sua mão para atacar!")     return false     end         doItemSetAttribute(item.uid,'attackspeed', velocidade)      return true end Lembre-se que para aumentar a quantidade de ataques por segundo a variável velocidade tem de ficar MENOR e o contrário para diminuir a velocidade.
     
     
     Adicione a seguinte tag no XML:
    <event type="attack" name="attackspeed" script="attackspeed.lua"/>  
     
    Agora vá em  data\creaturescripts\scripts, encontre o login.lua e adicione:
    registerCreatureEvent(cid, "attackspeed") Agora vá em data\items, encontre o items.xml e escolha o item que será usado para treinar o fist no meu caso escolhi uma blue rose.
     
    no item que você escolher adicione os seguintes atributos:
    <attribute key="attack" value="1" /> <attribute key="weaponType" value="fist" />  
     
    no meu caso a blue rose ficou assim, mas você pode fazer com qualquer item que possa ser colocado na mão do personagem.
        </item>     <item id="2745" article="a" name="blue rose">         <attribute key="weight" value="80" />         <attribute key="attack" value="1" />         <attribute key="weaponType" value="fist" />     </item>  
    E é isso(se eu não me esqueci de nada). Se você for utilizar esse sistema em seu servidor lembre-se de avisar aos players que precisa de 1 item para treinar o fist!
     
    Dúvidas/edições é só postar nos comentários ou me chamar nos comentários que farei o possível para ajudar!
     
    meu skype: john.winchester8
  16. Gostei
    Rafals deu reputação a Luquinha em War Of Emperium   
    DOWNLOAD 
  17. Gostei
    Rafals deu reputação a Dudu Ruller em Offline player to player item trader (Auction System)   
    Boa Noite Galera, Trago a voces Hoje o sistema Auction System (Vender items mesmo estando offline), Espero que Gostem.

    Informaçoes deste Script:

    *Visualizaçao de Items na Pagina do Gesior.
    *Outros Jogadores podem comprar usando o AuctionID.
    *Lembrese de Bloquear todos os Items com tempo de Duraçao.

    Changelog:

    v1.0 - Primeiro Relase
    v1.1 - Corrigido falhas de memória, acrescentou levelRequiredToAdd
    v1.1a - Fixed bug crítico com maxOffersPerPlayer verificação
    V1.1B - Corrigido o erro com números negativos
    v1.2 - Novo comando "retirar", correções para 0.3.6pl1
    v1.2a - Fixed bug clone itens

    Fotos:



    Database Querys:

    Va Na sua database e depois clique em SQL, e Execute essa Query:


    ALTER TABLE `players` ADD `auction_balance` INT( 11 ) NOT NULL DEFAULT '0'; e Depois essa: 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 ; e Depois va ate a pasta onde fica seu website e crie a seguinte pagina para o Gesior ACC: <?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="http://otland.net/images/items/'.$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/">vDk</a>.</small></p>'; } ?> Agora va ate pasta do seu ot/data/talkactions/talkactions.xml e abra: Adicione a seguinte tinha: <talkaction words="!offer" event="script" value="auctionsystem.lua"/> Agora crie um arquivo .lua chamado auctionsystem.lua e adicione isso dentro, depois salve e largue dentro do data/talkactions/scripts: --[[ Offline player to player item trader (Auction System) by vDk Script version: 1.2a [ -- FIXED CLONE ITEMS BUG -- ] ]]-- 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], false) 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

    Bem e isso, Comentem!
  18. Gostei
    Rafals deu reputação a Natanael Beckman em Trade OFF - Shop Offline   
    Esse 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.
     
  19. Gostei
    Rafals recebeu reputação de Vodkart em [MODS] [8.6] Fire Storm Event - Automático   
    Mano perfeito o sistema funciona 100% sem nem um erro testado e aprovado aqui na v. 0.3.6 rodou lizinho sem nem um problema recomendo evento bem divertido =), obrigado pelo trabalho em desenvolver o script e por disponibilizar para gente muito grato =)
  20. Gostei
    Rafals deu reputação a Absolute em [Castle War 24H] Conquiste o trono!   
    Fala galera linduxa do TK; hoje trago a vocês o tão desejado CASTLE WAR 24 HORAS, isto gera disputa intensa entre as guilds de seu servidor, atraindo assim mais jogadores que se interessam por guerras e seus demais sistemas! Modificado e com funções diferentes, no tópico ensinarei como instalar e como funciona.
     
     

     
     
    Como funciona? WOOOOOOOOW!
     
    Há um portal 24h aberto em algum lugar do seu mapa que ficará com o castle disponível 24h (avá).
    Quando uma guild qualquer acessar o portal do castelo, irá aparecer para o servidor que a X guild está tentando dominar o castelo, então o líde da guild dominante atual irá dizer !gocastle para teleportar ao castelo e defende-lo.
    O Objetivo para conquista do mesmo é invadi-lo derrotar os defensor da guild atual para abrir passagem, digamos assim, e subir ao trono, quando um membro da guild invadir o templo do trono e subir no mesmo a antiga guild dominadora é teleportada para o templo e o castelo fica sob domínio da nova guild.
    Você poderá colocar como premiação acesso a áreas exclusivas do castelo, no caso hunts e cia. (Fica a vosso critério)
     
    Evento testado nas versões 8.6; 9.6; 9.83; 9.86!
     
    Observação: 
    Comando !gocastle faz com que o líder possa teleportar todos os membros da sua guild online para perto dele, desde que ele esteja no castle. Comando pode ser usado a cada 3 horas (exhausted).  
     
     
     
     
    Vamos aos scripts do sistema;
     
    Em data/actions/scripts crie um arquivo com o nome de naviocastle.lua e coloque dentro:
    function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.actionid == 65500) then if getTopCreature({x=32464,y=32378,z=5}).uid > 0 then doTeleportThing(getTopCreature({x=32464,y=32378,z=5}).uid, {x=32526,y=32421,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerSendCancel(cid, "Você precisa estar em cima do tapete.") return true end elseif (item.actionid == 65501) then if getTopCreature({x=32526,y=32421,z=5}).uid > 0 then doTeleportThing(getTopCreature({x=32526,y=32421,z=5}).uid, {x=32464,y=32378,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerSendCancel(cid, "Você precisa estar em cima do tapete.") end end return true end


     
     
     
    Em actions.xml adicione a seguinte linha:
    <action actionid="65500-65501" event="script" value="naviocastle.lua"/> Pós feito isto, em data/lib crie um arquivo com o nome de 015-COH e adicione dentro dele:
    -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // COH_PUSHTIME = 10800 -- Tempo (em segundos) de exhausted para usar o comando !gocastle - Padrão (3 horas) COH_AREA = {{x = 32458, y = 32332, z = 7}, {x = 32558, y = 32429, z = 7}} -- Canto superior esquerdo / inferior direito do Castle -- // Não mexa daqui para baixo COH_STATUS = 201320111714 COH_PREPARE1 = 201320111715 COH_PUSHSTOR = 201320111716 COH_PREPARE2 = 201320111717 function doCastleRemoveEnemies() for index, creature in ipairs(getPlayersOnline()) do if isInArea(getThingPos(creature), COH_AREA[1], COH_AREA[2]) then if getPlayerGuildName(creature) ~= getGlobalStorageValue(COH_STATUS) then doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature))) end end end return true end Proximo passo, em data/monster.xml adicione a seguinte linha:
    <monster name="Castle Guardian" file="Castle Guardian.xml"/> Em data/monsters crie um arquivo com o nome de Castle Guardian.xml e adicione o seguinte:
    <?xml version="1.0" encoding="UTF-8"?> <monster name="Castle Guardian" nameDescription="a castle guardian" race="blood" experience="0" speed="0" manacost="0"> <health now="800000" max="800000"/> <look type="131" head="57" body="19" legs="57" feet="95" addons="1" corpse="6080"/> <targetchange interval="5000" chance="30"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="4"/> <flag staticattack="90"/> <flag runonhealth="800"/> </flags> <attacks> <attack name="melee" interval="2000" min="-60" max="-180"/> <attack name="physical" interval="1000" chance="35" range="7" min="-205" max="-385"> <attribute key="shootEffect" value="energy"/> </attack> <attack name="manadrain" interval="1000" chance="17" range="7" min="-205" max="-560"/> <attack name="speed" interval="1000" chance="12" range="7" speedchange="-600" duration="40000"> <attribute key="areaEffect" value="redshimmer"/> </attack> <attack name="fire" interval="2000" chance="45" range="7" radius="3" target="1" min="-250" max="-420"> <attribute key="shootEffect" value="burstarrow"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="firefield" interval="1000" chance="20" range="7" radius="2" target="1"> <attribute key="shootEffect" value="fire"/> </attack> <attack name="energy" interval="2000" chance="25" length="8" spread="0" min="-265" max="-445"> <attribute key="areaEffect" value="energy"/> </attack> <attack name="speed" interval="6000" chance="10" range="5" speedchange="-600" duration="20000"> <attribute key="areaEffect" value="redshimmer"/> </attack> </attacks> <defenses armor="1" defense="1"/> <elements> <element firePercent="100"/> <element energyPercent="100"/> <element icePercent="100"/> <element earthPercent="90"/> <element holyPercent="-25"/> <element physicalPercent="-33"/> </elements> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <summons maxSummons="2"> <summon name="deathspawn" interval="1500" chance="0" max="0"/> </summons> <loot> <item id="2148" countmax="20" chance1="100000" chancemax="0"/> </loot> </monster> Pós isto;
     
     
    Em data/movements/scripts crie um arquivo com o nome de COH.lua e adicione o seguinte:
    -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "CoH", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "CoH", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "CoH", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!") end end return true end Em data/movements/movements.xml adicione a seguinte linha:
    <movevent type="StepIn" actionid="16200-16203" event="script" value="COH.lua"/> Próximo passo:
     
    Em data/talkactions/scripts crie um arquivo com o nome de COHABSOLUTE.lua e adicione o seguinte:
    -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // function onSay(cid, words, param) if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then if getPlayerStorageValue(cid, COH_PUSHSTOR) < os.time() then if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then if isInArea(getThingPos(cid), COH_AREA[1], COH_AREA[2]) then if #getMembersOnline(getPlayerGuildId(cid)) > 0 then for index, creature in ipairs(getMembersOnline(getPlayerGuildId(cid))) do if (getTileInfo(getThingPos(creature)).protection ~= true) then return doPlayerSendCancel(cid, "[CoH] Os membros devem estar em área PZ.") end doTeleportThing(creature, getThingPos(cid)) end setPlayerStorageValue(cid, COH_PUSHSTOR, os.time() + COH_PUSHTIME) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "[Castle of Honor] Você teleportou seus membros, comando pode ser usado a cada "..tostring(COH_PUSHTIME / 60).." minuto(s).") else doPlayerSendCancel(cid, "[CoH] Para executar isso, sua guild deve ter 2 ou mais membros online.") end else doPlayerSendCancel(cid, "[CoH] Você deve estar no castelo.") end else doPlayerSendCancel(cid, "[CoH] Sua guild não é dona do castelo.") end else doPlayerSendCancel(cid, "[CoH] Você deve aguardar "..tostring(math.ceil((getPlayerStorageValue(cid, COH_PUSHSTOR) - os.time()) / 60)).." minuto(s) para usar este comando.") end else doPlayerSendCancel(cid, "[CoH] Você deve ser líder de uma guild para executar este comando.") end return true end function getMembersOnline(id) local mbr = {} for index, creature in ipairs(getPlayersOnline()) do if getPlayerGuildId(creature) == id then if getCreatureSkullType(creature) < 3 then table.insert(mbr, creature) end end end return mbr or #mbr end Em data/talkactions/talkactions.xml adicione a seguinte linha:
    <talkaction words="!castlepush;!pushmembers;!gocastle" event="script" value="COHABSOLUTE.lua"/> Quem disponibiliza o mapa do castelo a vocês é nosso amigo ViitinG, segue o link do tópico para download do mesmo já adaptado para este Castle:
    http://www.tibiaking.com/forum/topic/35730-mapa-evento-war-castle/
     
     
     
    Explicação das actions e demais (caso não use o mapa disponibilizado pelo Viiting lembre de adicionar ao castelo);
    ActionID 16200 - No meio do caminho para o castelo, ActionID 16201 - Perto do castelo, ActionID 16202 - No piso, trono que faz com que domine, e ActionID 16203 - Para a passagem de acesso ás hunts / city exclusivas da guild vencedora. Importante: Para colocar uma passagem para as hunts ou o que for a premiação da guild vencedora, coloque um caminho único com os actionIDS 16203, assim só a guild dominante do castelo poderá passar neste local. É importante lembrar que este script é de autoria do Roksas Nunez, ex scripter da empresa chaitosoft, fiz simples modificações de otimização.
     
     
    Qualquer dúvida peço que entre em contato comigo e poste aqui no tópico.
     
     
     
    Créditos:
    Absolute
    Roksas
    ViitinG
     
     
    Espero que gostem, afinal raro alguém disponibilizar algo tão desejado e útil assim!
     
     
     
    Até o próximo sistema.
     
     
     
     
    Absolute on tibiaking =p
  21. Gostei
    Rafals deu reputação a Vodkart em [MODS] [8.6] Fire Storm Event - Automático   
    Evento for fun para colocar no seu ot, quem é atingido pelo fogo morre, o último a sobreviver ganha.
     
    O evento é automático, mas também possui um comando para dar inicio ao evento, só usar /firestart minutos
     
    exemplo: /firestart 1
     
     
     
     
    Fire_Storm_Event.xml
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Fire Storm Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="fire_config"><![CDATA[ Fire = { storages = {172354, 172355}, -- storage Count players = {min = 2, max = 50}, -- min, max players no evento minLevel = 20, -- level minimo para entrar no event rewards = {{2160,10},{2494,1}}, -- premios que vai receber timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- time to check event teleport = {{x=158, y=53, z=7}, {x=189 , y=58, z=7}}, -- posição do teleport, posição para onde o jogador vai arena = {{x=186,y=54,z=7},{x=193,y=60,z=7}} -- posição começo e final da area } Fire_Days = { ["Monday"] = {"13:00","18:00","20:00","22:00"}, ["Tuesday"] = {"13:00","18:00","20:00","22:00"}, ["Wednesday"] = {"13:00","18:00","20:00","22:00"}, ["Thursday"] = {"13:00","18:00","20:00","22:00"}, ["Friday"] = {"13:00","18:00","20:00","22:00"}, ["Saturday"] = {"13:00","18:00","20:00","22:00"}, ["Sunday"] = {"13:00","18:00","20:00","22:00"} } function removeFireTp() local t = getTileItemById(Fire.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(Fire.teleport[1], CONST_ME_POFF) end function ZerarStorFire() setGlobalStorageValue(Fire.storages[1], 0) setGlobalStorageValue(Fire.storages[2], 0) end function getPlayersInFireEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), Fire.arena[1], Fire.arena[2]) then t[#t+1] = pid end end return t end function getFireRewards(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end end end function doFireInArea(n) if #getPlayersInFireEvent() > 1 then for i = 1, n do local pos = {x=math.random(Fire.arena[1].x, Fire.arena[2].x), y=math.random(Fire.arena[1].y,Fire.arena[2].y), z=Fire.arena[1].z} local m = getTopCreature(pos).uid doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) if m ~= 0 and isPlayer(m) then doSendMagicEffect(getCreaturePosition(m), CONST_ME_FIREAREA) doCreatureSay(m, "Ooh Burn Burn", TALKTYPE_ORANGE_1) local corpse = doCreateItem(3058, 1, getPlayerPosition(m)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(m) .. ". He was killed by Fire Field.") doSendMagicEffect(getPlayerPosition(m), CONST_ME_POFF) doTeleportThing(m, getTownTemplePosition(getPlayerTown(m))) doPlayerSendTextMessage(m, MESSAGE_EVENT_ADVANCE, "[Fire Storm Event] You died burned out.") end end local x = 2700-(200*n) addEvent(doFireInArea, x <= 0 and 500 or x, n+1) elseif #getPlayersInFireEvent() == 1 then local cid = getPlayersInFireEvent()[1] doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) getFireRewards(cid, Fire.rewards) doBroadcastMessage("Fire Storm Event have finished. The winner is ".. getCreatureName(cid).. ". Congratulations.", MESSAGE_EVENT_ADVANCE) ZerarStorFire() else doBroadcastMessage("No one Won the Fire Storm Event.", MESSAGE_EVENT_ADVANCE) ZerarStorFire() end end function CheckFireEvent(delay) if getGlobalStorageValue(Fire.storages[1]) ~= (Fire.players.max+1) then if delay > 0 and getGlobalStorageValue(Fire.storages[1]) < Fire.players.max then doBroadcastMessage("[Fire Stortm Event] Starting in " .. delay .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) elseif delay == 0 and getGlobalStorageValue(Fire.storages[1]) < Fire.players.min then for _, cid in pairs(getPlayersInFireEvent()) do doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end removeFireTp() doBroadcastMessage("The Fire Storm event could not start because of to few players participating.\n At least " .. Fire.players.min .. " players is needed!", MESSAGE_STATUS_WARNING) ZerarStorFire() elseif delay == 0 and getGlobalStorageValue(Fire.storages[1]) >= Fire.players.min then removeFireTp() doBroadcastMessage("Good Lucky! The event will start on "..Fire.timeToStartEvent.." seconds. get ready!") addEvent(doFireInArea, Fire.timeToStartEvent*1000, 1) end addEvent(CheckFireEvent, 60000, delay-1) end end ]]></config> <globalevent name="Storm_Fire_Start" interval="60" event="script"><![CDATA[ domodlib('fire_config') function onThink(interval, lastExecution) if Fire_Days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(Fire_Days[os.date("%A")], hrs) and getGlobalStorageValue(Fire.storages[2]) <= 0 then local tp = doCreateItem(1387, 1, Fire.teleport[1]) doItemSetAttribute(tp, "aid", 45111) CheckFireEvent(Fire.CheckTime) setGlobalStorageValue(Fire.storages[1], 0) end end return true end]]></globalevent> <event type="login" name="Storm_Fire_Login" event="script"><![CDATA[ domodlib('fire_config') function onLogin(cid) registerCreatureEvent(cid, "FireStormBatle") if isInRange(getPlayerPosition(cid), Fire.arena[1], Fire.arena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="combat" name="FireStormBatle" event="script"><![CDATA[ domodlib('fire_config') if isPlayer(cid) and isPlayer(target) and isInRange(getPlayerPosition(cid), Fire.arena[1], Fire.arena[2]) then doPlayerSendCancel(cid, "You may not attack this player.") return false end return true ]]></event> <movevent type="StepIn" actionid ="45111" event="script"><![CDATA[ domodlib('fire_config') function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if getPlayerAccess(cid) > 3 then return doTeleportThing(cid, Fire.teleport[2]) end if getPlayerLevel(cid) < Fire.minLevel then doTeleportThing(cid, fromPosition, true) doPlayerSendCancel(cid, "You need to be at least level " .. Fire.minLevel .. ".") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end if getGlobalStorageValue(Fire.storages[1]) <= Fire.players.max then doTeleportThing(cid, Fire.teleport[2]) setGlobalStorageValue(Fire.storages[1], getGlobalStorageValue(Fire.storages[1])+1) doBroadcastMessage(getPlayerName(cid) .. " entered the fire stortm event! Currently " .. getGlobalStorageValue(Fire.storages[1]) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED) if getGlobalStorageValue(Fire.storages[1]) == Fire.players.max then setGlobalStorageValue(Fire.storages[1], getGlobalStorageValue(Fire.storages[1])+1) removeFireTp() doBroadcastMessage("The event will start on "..Fire.timeToStartEvent.." seconds. get ready!") addEvent(doFireInArea, Fire.timeToStartEvent*1000, 1) end end return true end]]></movevent> <talkaction words="/firestart;!firestart" access="5" event="buffer"><![CDATA[ domodlib('fire_config') if getGlobalStorageValue(Fire.storages[2]) > 0 then doPlayerSendCancel(cid, "The event is already starting.") return true elseif not param or not tonumber(param) then doPlayerSendCancel(cid, "Use only numbers.") return true end local param = tonumber(param) <= 0 and 1 or tonumber(param) local tp = doCreateItem(1387, 1, Fire.teleport[1]) doItemSetAttribute(tp, "aid", 45111) CheckFireEvent(tonumber(param)) setGlobalStorageValue(Fire.storages[1], 0) setGlobalStorageValue(Fire.storages[2], 1) ]]></talkaction> <globalevent name="FireDebug-Start" type="start" event="buffer"><![CDATA[ domodlib('fire_config') ZerarStorFire() return true]]></globalevent> </mod>  
    A configuração está explicita na lib do mods... valeu!
     
    fire lua.rar
  22. Gostei
    Rafals deu reputação a ViitinG em Evento War Castle   
    Olá galera,vou disponibilizar o mapa para o evento War Castle feito pelo Absolute,espero que gostem !
    Link para o tópico do script do evento : http://www.tibiaking.com/forum/topic/35731-castle-war-24h-conquiste-o-trono/
     
    Imagens:
     
     
    Coordenada do mapa : {x = 1000, y = 1000, z = 7}
    Download : Link
    Scan : https://www.virustotal.com/pt/url/ab5a9f73db53a3cac3b1e624ccf1e7fe95caf378ef374a0fa260a896cba7f9e6/analysis/1403050891/
  23. Gostei
    Rafals recebeu reputação de Vodkart em [MODS] - [8.6] Perfect Zombie System [Automático] [V1.0]   
    Perfeito o sistema funcionou 100%, usei na versão 0.3.6 e está tudo ok =) muito agradecido por esse evento obrigado pelo trabalho
  24. Gostei
    Rafals deu reputação a Vodkart em [Sistema] Battlefield Event! V.1   
    Mapa BattleField Feito Por AnneMotta :

    Mapa Battlefield.rar

    Scan: https://www.virustot...sis/1346548669/


    Imagens do mapa



    Descrição:

    - O evento é automático e acontece em determinado dia e hora da semana
    - Logo após é aberto um teleport então apenar um número limitado de players entra no evento
    - São formados por dois times, os "Black Assassins" e os "Red Barbarians"
    - Os times são balanceados automaticamente, quando o último jogador entra, esse teleport é fechado e depois de 5 minutos o evento começa, os 5 minutos são para os players ter tempo de planejar um ataque.
    - O sistema tem por finalidade matar todos do time inimigo, e os players que sobreviverem recebem um prêmio.

    Bônus:

    - Durante o evento é mostrado na tela somente dos jogadores que estão no evento um placar de times.

    - Até o último player entrar no evento, ficam mandando broadcast dizendo quanto players faltam para dar inicio ao jogo.

    - Se o evento abrir e não atingir a meta de players colocada, o evento é finalizado e os players voltam para o templo.




    Lembre-se:

    - De colocar Pvp Tool na área
    - De colocar área NoLogout


    Imagens:




    Instalação:

     
    Data > Lib       Data > CreatureScript > Script     Data > GlobalEvents > Scripts       Data > Movements > Script             Configurações do evento
  25. Gostei
    Rafals deu reputação a KekezitoLHP em [Gesior] Widget Top Level BOX   
    Para quem deseja ter um box igual a este em seu site:
     

     
     
    1º Baixe o arquivo:
    http://www.sendspace.com/file/ejr1jt
     
    Virus Total:
    https://www.virustot...sis/1360784756/
     
    2º Extraia os arquivos na pasta do seu layout.

    3º Abra layout.php e procure por:
    <div id="Themeboxes">  
    4º Para quem tem pouco mais de experiencia vou falar da seguinte forma: Copie esta linha antes de fechar a div themeboxes.
     
    <?php include($layout_name.'/widget_rank.php'); ?> Para quem não entendeu o que eu disse, fica meio complicado explicar onde inserir a linha, então, depois desta linha que disse para pesquisar vá copiando a linha do passo 4º e atualizando o site até obter um resultado agradável.

    Meu layout.php fico assim:
     
    <div id="Themeboxes"> <div id="NewcomerBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/newcomer/newcomerbox.gif);"> <div class="ThemeboxButton" onClick="BigButtonAction('?subtopic=createaccount')" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?PHP echo $layout_name; ?>/images/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url(<?PHP echo $layout_name; ?>/images/buttons/sbutton_over.gif);"></div> <div class="ButtonText" style="background-image:url(<?PHP echo $layout_name; ?>/images/buttons/_sbutton_jointibia.gif);"></div> </div> <div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.gif);"></div> </div> <div id="PremiumBox" class="Themebox" style="background-image:url(layouts/tibiacom/images/themeboxes/premium/premiumbox.gif);"> <div class="ThemeboxButton" onClick="BigButtonAction('?subtopic=donate')" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(layouts/tibiacom/images/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url(layouts/tibiacom/images/buttons/sbutton_over.gif);"></div> <div class="ButtonText" style="background-image:url(http://i54.tinypic.com/25uqof8.gif);"></div> </div> <div class="Bottom" style="background-image:url(layouts/tibiacom/images/general/box-bottom.gif);"></div> </div> <?php include($layout_name.'/widget_rank.php'); ?> </div>  
    Creditos Kekezitolhp Duvidas ou erros só pergunta

Informação Importante

Confirmação de Termo