Postado Agosto 13, 2015 9 anos Este é um post popular. Bom, procurei esse Castle por MUITO TEMPO, mas não achei em NENHUM LUGAR DA INTERNET. Ontem, eu estava vendo alguns mapas do @Deathrocks, e vi nos prints, que o mapa possuia o evento que eu queria! Então baixei o mapa e extrai o evento, então venho lhes trazer! Nome: Castle 24H Cliente: 8.6 Versão TFS: 0.4 Tipo: Evento Bom, para começar, vamos em actions/scripts e crie 2 arquivos: castledoor1.lua Spoiler function onUse(cid, item, frompos, item2, topos) local config = { STORAGE_GUILD = 123123, -- A 3ª storage configurada em Castle.lua MSG_WELCOME = "Seja bem vindo a vosso castelo!", MSG_FAIL = "Este castelo nao pertence a sua guild" } if getPlayerGuildId(cid) == getGlobalStorageValue(config.STORAGE_GUILD) then doTeleportThing(cid,getThingPos(item.uid)) doTransformItem(item.uid, 1230) doPlayerSendTextMessage(cid, 22, config.MSG_WELCOME) else doPlayerSendTextMessage(cid, 22, config.MSG_FAIL) end return true end castlewar1.lua Spoiler function onUse(cid, item, frompos, item2, topos) local castle_one_name = "Castle24h" -- Nome do castelo 1 local storages = {154154,54321,123123} -- Storages ( se vc eh iniciante, deixe como está...) local premio_por_vezes = 1 -- Premio por vezes de conquista de castelo. (1) = Ativo (0) = Desativa. local premio_vezes = 15 -- Caso ativo, a quantidade de conquista que o player tem, para ganhar PREMIO. local premio = 5468 -- ID do Premio local premio_cont = 1 -- Quantidade do Premio local premio_reset = 1 -- Resetar o contador do premio depois que atingir a meta?? (1) = SIM (0) = NAO local sto_ativ = getGlobalStorageValue(storages[2]) position = getCreaturePosition(cid) if isPlayerGuild(cid) == TRUE then if sto_ativ == 1 or sto_ativ == -1 then guildname = getPlayerGuildName(cid) guild = getPlayerGuildId(cid) guild_sto = getGlobalStorageValue(storages[3]) if guild ~= guild_sto then setPlayerStorageValue(cid,guild_sto,guild) if getPlayerStorageValue(cid,storages[1]) == -1 then setPlayerStorageValue(cid,storages[1],0) end sto_vezes = getPlayerStorageValue(cid,storages[1]) setGlobalStorageValue(storages[3],getPlayerGuildId(cid)) setPlayerStorageValue(cid,storages[1], sto_vezes + 1) sto_vezes_total = getPlayerStorageValue(cid,storages[1]) doBroadcastMessage("O(a) "..getCreatureName(cid).." acabou de conquistar o castelo "..castle_one_name.." para a guild \""..guildname.."\" pela "..sto_vezes_total.."ª vez(s).", 22) doSendMagicEffect(position, 39) if premio_por_vezes == 1 then if getPlayerStorageValue(cid,storages[1]) == premio_vezes then if getItemWeightById(premio,1) <= getPlayerFreeCap(cid) then doBroadcastMessage("O "..getCreatureName(cid).." ganhou uma(o) "..getItemNameById(premio).." como recompensa das suas "..premio_vezes.." conquistas!", 21) doPlayerAddItem(cid, premio,premio_cont) doPlayerSendTextMessage(cid, 18, "Voce recebeu o(a) "..getItemNameById(premio).." como recompensa das suas "..premio_vezes.." conquistas!") ----------------------------------------------- -- if premio_reset == 1 then -- setPlayerStorageValue(cid,storages[1],0) -- Resetar a contagem end -- ----------------------------------------------- -- else doPlayerSendTextMessage(cid, 18, "Voce nao tem capacidade para ganhar o item. Vamos verificar novamente em 10 segundos!") addEvent(additem,10000,cid,premio,premio_cont,premio_reset) end end end else doPlayerSendCancel(cid,"Este castelo ja foi conquistado pela sua guild!") doSendMagicEffect(position, 2) end else doPlayerSendCancel(cid,"O sistema está desativado") end else doPlayerSendCancel(cid,"É nescessario ter guild para dominar o castelo!") doSendMagicEffect(position, 2) end end function additem(cid,premio,premio_cont,premio_reset) if getItemWeightById(premio,1) <= getPlayerFreeCap(cid) then doPlayerAddItem(cid, premio,premio_cont) doPlayerSendTextMessage(cid, 18, "Voce recebeu o(a) "..getItemNameById(premio).." como recompensa das suas "..premio_vezes.." conquistas!") if premio_reset == 1 then setPlayerStorageValue(cid,storages[1],0) end stopEvent(additem) else doPlayerSendTextMessage(cid, 18, "Voce nao tem capacidade para ganhar o item. Verificando novamente em 10 segundos!") addEvent(additem,10000,cid) end end function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return TRUE else return FALSE end end Agora em actions.xml adicione as tags: Spoiler <!-- Castle 24Hrs --> <action actionid="9999" event="script" value="castlewar1.lua"/> <action actionid="4538" event="script" value="castledoor1.lua"/> Agora em monster/traps crie 3 arquivos: porta.xml Spoiler <?xml version="1.0" encoding="UTF-8"?> <monster name="Castle" nameDescription="a Gate" race="undead" experience="25000" speed="0" manacost="0"> <health now="400000" max="400000"/> <look typeex="9408"/> <targetchange interval="5000" chance="20"/> <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="0"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="100"/> <flag hidehealth="0"/> </flags> <attacks> <attack name="melee" interval="50000" skill="0" attack="0"/> </attacks> <defenses armor="1" defense="1"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity ice="0"/> <immunity holy="0"/> <immunity death="0"/> <immunity lifedrain="1"/> <immunity manadrain="1"/> <immunity paralyze="1"/> <immunity drunk="1"/> <immunity outfit="1"/> <immunity invisible="1"/> </immunities> <loot> <item id="2148" countmax="20" chance="100000"/><!-- gold coin --> </loot> </monster> protectcastle.xml Spoiler <?xml version="1.0" encoding="UTF-8"?> <monster name="Protect Castle" nameDescription="a Protect Castle" race="undead" experience="25000" speed="0" manacost="0"> <health now="110000" max="110000"/> <look typeex="9779"/> <targetchange interval="5000" chance="20"/> <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="0"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="100"/> <flag hidehealth="0"/> </flags> <attacks> <attack name="energy" interval="2000" chance="100" target="3" range="10" radius="3" min="-200" max="-250"> <attribute key="areaEffect" value="teleport"/> <attribute key="shootEffect" value="energyball"/> </attack> <attack name="fire" interval="2000" chance="100" target="3" range="10" radius="4" min="-200" max="-250"> <attribute key="areaEffect" value="fireattack"/> <attribute key="shootEffect" value="energyball"/> </attack> </attacks> <defenses armor="1" defense="1"/> <immunities> <immunity physical="0"/> <immunity energy="1"/> <immunity fire="1"/> <immunity poison="0"/> <immunity ice="0"/> <immunity holy="0"/> <immunity death="0"/> <immunity lifedrain="1"/> <immunity manadrain="1"/> <immunity paralyze="1"/> <immunity drunk="1"/> <immunity outfit="1"/> <immunity invisible="1"/> </immunities> <loot> <item id="10313" countmax="1" chance="100000000"/><!-- gold coin --> </loot> </monster> statue.xml Spoiler <?xml version="1.0" encoding="UTF-8"?> <monster name="Protect Statue" nameDescription="a Protect Statue" race="undead" experience="15000" speed="0" manacost="0"> <health now="100000" max="100000"/> <look typeex="11720"/> <targetchange interval="5000" chance="20"/> <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="0"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="100"/> <flag hidehealth="0"/> </flags> <attacks> <attack name="melee" interval="1000" skill="40" attack="40"/> <attack name="fire" interval="1000" chance="100" range="7" min="-50" max="-100"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="yellowspark"/> </attack> </attacks> <defenses armor="1" defense="1"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity ice="0"/> <immunity holy="0"/> <immunity death="0"/> <immunity lifedrain="1"/> <immunity manadrain="1"/> <immunity paralyze="1"/> <immunity drunk="1"/> <immunity outfit="1"/> <immunity invisible="1"/> </immunities> <loot> <item id="2148" countmax="20" chance="100000"/><!-- gold coin --> </loot> </monster> Agora em monsters.xml adicione as tags: Spoiler <monster name="Protect Statue" file="Traps/statue.xml"/> <monster name="Castle" file="Traps/porta.xml"/> <monster name="Protect Castle" file="Traps/protectcastle.xml"/> Vamos para movements/scripts e crie 2 arquivos: castlewar2.lua Spoiler function onStepIn(cid, item, position, fromPosition) local castle_one_name = "Castle24H" -- Nome do castelo 1 local storages = {154154,54321,123123} -- Storages ( se vc eh iniciante, deixe como está...) local sto_ativ = getGlobalStorageValue(storages[2]) position = getCreaturePosition(cid) if isPlayerGuild(cid) == TRUE then if sto_ativ == 1 or sto_ativ == -1 then guildname = getPlayerGuildName(cid) guild = getPlayerGuildId(cid) guild_sto = getGlobalStorageValue(storages[3]) if guild ~= guild_sto then doBroadcastMessage("O(a) Jogador "..getCreatureName(cid)..". Esta Tentando Invadir O "..castle_one_name.." Da Guild \""..guildname..". Aviso Donos Atuais", 22) else doPlayerSendCancel(cid,"Avance") end else doPlayerSendCancel(cid,"Avance") end else doPlayerSendCancel(cid,"Avance") end return true end function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return TRUE else return FALSE end end level.lua Spoiler function onStepIn(cid, item, position, fromPosition) level = 300 if getPlayerLevel(cid) < level then doTeleportThing(cid, fromPosition, true) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED) doPlayerSendCancel(cid,"Somente level " .. level .. " ou mais podem passar aqui.") end return TRUE end Agora em movements.xml adicione as tags: Spoiler <movevent type="StepIn" actionid="9998" event="script" value="castlewar2.lua"/> <movevent type="StepIn" actionid="9995" event="script" value="level.lua"/> Pronto. Agora você só precisa baixar o mapa, inserir o mesmo ao seu servidor, configurar os teleports, e as hunts dentro do castle etc. PRINTS: 1ª parte Spoiler 2ª parte: Spoiler Obs.: Todos os ActionID e monsters já estão no mapa! Você só precisa configurar as coordenadas dos teleports, e o que possui no castle! Obs².: Tudo o que você pode configurar, já está escrito em cada script! Créditos: @DeathRocks PC98 mapa.rar Editado Fevereiro 11, 2016 9 anos por Sekk (veja o histórico de edições) GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Agosto 16, 2015 9 anos Tópico aprovado, obrigado por compartilhar.Este tópico foi movido: Para: "OTServ → Scripting → Sistemas e MODs"Esta horrivel esse código, se possível indentar o código e usar o "code" do bbcode. STYLLER OT 2022
Postado Agosto 16, 2015 9 anos Autor Pow, movido pra área correta? Eu postei na sessão de avaliação de tópicos... Creio eu que seja a área correta sim viu! GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Agosto 17, 2015 9 anos Pow, movido pra área correta? Eu postei na sessão de avaliação de tópicos... Creio eu que seja a área correta sim viu! Se ele moveu é porque seu tópico foi aprovado e movido para área correta... meu deus. [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Agosto 17, 2015 9 anos Autor Pelo o que eu sei, quando é aprovado, ele fala num sei o que de ser aprovado, e n escreve a mensagem "preste mais atenção da próxma vez." Esquece, eu li errado.. Rep + pra vcs. :v Tópico aprovado, obrigado por compartilhar.Este tópico foi movido: Para: "OTServ → Scripting → Sistemas e MODs"Esta horrivel esse código, se possível indentar o código e usar o "code" do bbcode. Pelo o que eu sei, quando é aprovado, ele fala num sei o que de ser aprovado, e n escreve a mensagem "preste mais atenção da próxma vez." Esquece, eu li errado.. Rep + pra vcs. :v Tópico aprovado, obrigado por compartilhar.Este tópico foi movido: Para: "OTServ → Scripting → Sistemas e MODs"Esta horrivel esse código, se possível indentar o código e usar o "code" do bbcode. Desculpa, eu não entendi, e não sei nada sobre scripts.. Eu só trouxe pró TK um castle, que não achei em nenhum topico, apenas em um mapa. Editado Agosto 17, 2015 9 anos por jvcasarin (veja o histórico de edições) GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.