
Boush
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
Boush deu reputação a PsyMcKenzie em [Ajuda] Talkaction /clean não limpa pzIsso tem que alterar nas sources em map.cpp
uint32_t Map::clean() { uint64_t start = OTSYS_TIME(); uint32_t count = 0, tiles = 0; if (g_game.getGameState() == GAME_STATE_NORMAL) { g_game.setGameState(GAME_STATE_MAINTAIN); } for (int32_t z = 0; z < (int32_t)MAP_MAX_LAYERS; z++) { for (uint32_t y = 1; y <= mapHeight; y++) { for (uint32_t x = 1; x <= mapWidth; x++) { Tile* tile = getTile(x, y, z); if (!tile || tile->hasFlag(TILESTATE_HOUSE) || !tile->getItemList()) { continue; } ++tiles; TileItemVector* itemList = tile->getItemList(); ItemVector::iterator it = itemList->begin(), end = itemList->end(); while (it != end) { if ((*it)->isCleanable()) { g_game.internalRemoveItem(*it, -1); it = itemList->begin(); end = itemList->end(); ++count; } else { ++it; } } } } } if (g_game.getGameState() == GAME_STATE_MAINTAIN) { g_game.setGameState(GAME_STATE_NORMAL); } std::cout << "> CLEAN: Removed " << count << " item" << (count != 1 ? "s" : "") << " from " << tiles << " tile" << (tiles != 1 ? "s" : "") << " in " << (OTSYS_TIME() - start) / (1000.) << " seconds." << std::endl; return count; }
-
Boush deu reputação a Wakon em (Resolvido)NPC's que da storage para porta e item para portaAmigo, cuidado com os "UP" no tópico, leia as regras:
http://www.tibiaking.com/forum/topic/1281-regras-gerais/?p=7680
NPC que dá acesso:
XML do NPC que dá acesso:
NPC que dá acesso e item:
XML do npc que dá acesso e item:
Portal com acesso:
"Data/movements/scripts", nome_do_arquivo.lua:
"Data/movements", no arquivo movements.xml adicione a TAG:
<movevent type="StepIn" actionid="actionID_desejada" event="script" value="nome_do_arquivo.lua" /> Só colocar a actionID_desejada no teleport.
Não testei os NPC's, se der erro me avise.
-
Boush deu reputação a Sanieg em (Resolvido)[PEDIDO] NPC que da itens aleátorio diariamente.npc .xml:
-
Boush deu reputação a Snowsz em (Resolvido)[PEDIDO] NPC que da itens aleátorio diariamente.Mexi no seu script... Tinha muita coisa faltando e sem sentido.
Script lua:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local itens = { --{iddoitem, quantidade}, {2160, 15}, {2158, 10}, {2157, 2}, } local hours = 24 local level = 200 local storage = 9934 local effect = 10 function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return true end if msgcontains(msg, 'sim') or msgcontains(msg, 'yes') then if getPlayerLevel(cid) >= level then if getPlayerStorageValue(cid, storage) <= os.time() then local item = itens[math.random(1,#itens)] doPlayerAddItem(cid, item[1], item[2]) doSendMagicEffect(getThingPos(cid), effect) selfSay('Pronto, aqui esta seu premio! Aguarde '..hours..' hora'..(hours > 1 and "s" or "")..' para pegar seu premio denovo.', cid) setPlayerStorageValue(cid, storage, os.time() + (hours * 60 * 60)) else selfSay('Aguarde '..hours..' hora'..(hours > 1 and "s" or "")..' para pegar seu premio denovo.', cid) end else selfSay('Você precisa de level '..level..' para pegar seu prêmio', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) O XML, usa o dele mesmo.
-
Boush deu reputação a Caronte em (Resolvido)[AJUDA] Script de chavefunction onUse(cid, item, frompos, item2, topos) portafechada = 5105 -- coloque aqui o ID da porta fechada portaaberta = 5106 -- coloque aqui o ID da porta aberta uidporta = 5011 -- coloque aqui o UID da porta idkey = 2091 -- coloque aqui o id da key if item.itemid == idkey and item2.itemid == portafechada and item2.uid == uidporta then doTransformItem(item2.uid,portaaberta) addEvent(function() doTransformItem(item2.uid,portafechada) end, 1000 * 30) doRemoveItem(item.uid) elseif item.itemid == idkey and item2.itemid == portaaberta and item2.uid == uidporta then doTransformItem(item2.uid,portafechada) doRemoveItem(item.uid) else doPlayerSendTextMessage(cid,22,"Sorry, not possible.") end return 1 end
-
Boush recebeu reputação de demoniacs em [v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)Obrigado! rep+
-
Boush recebeu reputação de murilo103 em Wand of Elementsvai ter para tfs 1.0?
-
Boush deu reputação a Bruno Minervino em Wand of ElementsIntrodução:
É uma wand que ataca vários elementos aleatoriamente, porém não somente isso, você pode alterar o elemento dela com uma talkaction.
Instalação:
Vá até data/weapons/scripts e crie um arquivo chamando wandelementos.lua e coloque o seguinte conteúdo:
local min, max = 1700,1900 --Ataque mínino e ataque máximo local w = { [1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE}, [2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE}, [3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE}, [4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE}, [5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE}, [6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE}, [7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE} } function onUseWeapon(cid, var) local effect = getPlayerStorageValue(cid, 4561) local target = getCreatureTarget(cid) if target ~= 0 then local wx = w[effect] or w[math.random(#w)] doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh) addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef) end return true end Altere o min e max de acordo com sua necessidade.
Agora vá em data/weapons/weapons.xml e coloque o seguinte conteúdo:
<wand id="7424" level="100" mana="30" event="script" value="wandelementos.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="5" showInDescription="0"/> <vocation id="6" showInDescription="0"/> </wand> Altere o id, level e mana de acordo com sua necessidade.
Agora vamos configurar a talkaction que troca os elementos.
Vá até data/talkactions/scripts e crie um arquivo chamando elementos.lua e coloque o seguinte conteúdo:
local config = { wand_id = 7424, --ID da wand types = { ["all"] = -1, --Ataca os elementos aleatoriamente ["fire"] = 1, ["ice"] = 2, ["poison"] = 3, ["death"] = 4, ["energy"] = 5, ["physical"] = 6, ["holy"] = 7 } } function onSay(cid, words, param) local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid if wand_left ~= config.wand_id and wand_right ~= config.wand_id then doPlayerSendCancel(cid, "Voce deve estar equipado com uma ".. getItemNameById(config.wand_id) .." para usar este comando.") return true end if config.types[param] then setPlayerStorageValue(cid, 4561, config.types[param]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sua wand ira atacar ".. param .. ".") else local str = "" for i, _ in pairs(config.types) do str = str .. ", ".. i end doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Os elementos disponiveis sao: ".. string.sub(str, 3, #str) ..".") end return true end Altere o wand_id conforme configurado em weapons.
Agora vá em data/talkactions/talkactions.xml e coloque o seguinte conteúdo:
<talkaction words="!elemento;/elemento" event="script" value="elementos.lua"/> Exemplo de funcionamento:
https://www.youtube.com/watch?v=HHmZ1RpsrD0
Gostaria de deixar um agradecimento especial para MaXwEllDeN, pela ajuda.
-
Boush deu reputação a Wakon em [AJUDA] Unique ID que resete bau de quest todos os diasEm "Data/actions/scripts" adicione resetquest.lua e cole:
local t = { storage = 35350, -- Só mexa se necessário. temp = 24, -- Tempo em horas. reward = 2160, -- Item que irá ganhar. } function onUse(cid, item, fromPos, itemEx, toPos) if getPlayerStorageValue(cid, t.storage) < os.time() then doPlayerSendTextMessage(cid, 25, "Você encontrou um "..getItemNameById(t.reward)..".") doPlayerAddItem(cid, t.reward, 1) setPlayerStorageValue(cid, t.storage, os.time() + t.temp * 60 * 60) else doPlayerSendTextMessage(cid, 25, "Você precisa esperar ".. getPlayerStorageValue(cid, t.storage) - os.time() .." segundos para usar novamente.") end return true end Em "Data/actions" abra o actions.xml e adicione:
<action uniqueid="90004" script="resetquest.lua" /> Só colocar a unique 90004 ( pode mudar se quiser ) no baú.
-
Boush deu reputação a xWhiteWolf em [AJUDA] Unique ID que resete bau de quest todos os diasSó umas pequenas correções pra deixar o script mais bonitinho
local t = { storage = 35350, -- Soh mexa se necessario. temp = 24, -- Tempo em horas. count = 1, -- quantidade da reward que sera ganha reward = 2160 -- Item que irá ganhar. -- por ser o ultimo item do array nao necessita virgula } function onUse(cid, item, fromPos, itemEx, toPos) if getPlayerStorageValue(cid, t.storage) < os.time() then doPlayerSendTextMessage(cid, 25, "Você encontrou um "..getItemNameById(t.reward)..".") doPlayerAddItem(cid, t.reward, t.count) setPlayerStorageValue(cid, t.storage, os.time() + (t.temp * 60 * 60)) else doPlayerSendTextMessage(cid, 25, "Você precisa esperar ".. math.ceil((getPlayerStorageValue(cid, t.storage) - os.time())/3600) .." hora(s) para usar novamente.") end return true end @Topic: você quer que o mesmo player só passa fazer a cada 24h ou vc quer que a quest só possa ser feita a cada 24h (independente do player)?
-
Boush deu reputação a Nicrox em [v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)\spells\scripts\healing\
mass healing.lua
local combat = Combat() combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) local area = createCombatArea(AREA_CIRCLE3X3) combat:setArea(area) function onTargetCreature(creature, target) local player = Player(creature) local min = ((player:getLevel() / 5) + (player:getMagicLevel() * 4.6) + 100) local max = ((player:getLevel() / 5) + (player:getMagicLevel() * 9.6) + 125) if not Player(target) then return true end doTargetCombatHealth(0, target, COMBAT_HEALING, min, max, CONST_ME_NONE) return true end combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(creature, var) return combat:execute(creature, var) end
-
Boush deu reputação a Ceos em (Resolvido)[PEDIDO] NPC TowncryerTroque esse pelo seu e teste:
local voices = { "Hear me! Hear me! The mage Wyrdin in the Edron academy is looking for brave adventurers to undertake a task!", "Hear me! Hear me! The postmaster's guild has open spots for aspiring postmen! Contact Kevin Postner at the post office in the plains south of Kazordoon!", "Hear me! Hear me! The inquisition is looking for daring people to fight evil! Apply at the inquisition headquarters next to the Thaian jail!", "Hear me! Hear me! Stand and deliver! That's what they shout, robbing banks in main's coastal towns and then hide out. Catch the thieves and make us proud, bring back the gold to please the crowd!", "Hear me! Hear me! A river is flooding, south of the outlaw base. Explore a new isle, an unknown place. Don't be afraid, but ready your blade.", "Hear me! Hear me! The volcano on Goroma is spitting fire. Creatures are spawning, strong and dire. Lava is heading up the land. Adventurer, be careful or it will be your last stand!", "Hear me! Hear me! It is Kingsday, people, let us celebrate and sing! Decorate Thais and let the bells ring! Come to the arena to hear the swords cling. Let us rejoice! Hail to the King!", "Hear me! Hear me! North of the Queen's town, the royal trees are cut down. Will you deal with the suspect or report such kind of disrespect?", "Hear me! Hear me! Noodles is gone, the King in despair! Find the little rascal, look everywhere. Bring him back to get rewarded for your care!", "Hear me! Hear me! Ankrahmun's desert is the nomads' land. Find their camp in the golden sand, and a treasure may be close at hand!", "Hear me! Hear me! What a lucky and beautiful day! Visit Carlin, Ankrahmun, or Liberty Bay. Yasir, the oriental trader might be there. Gather your creature products, for this chance is rare.", "Hear me! Hear me! In Zao Steppe the river runs deep. If you catch a strange fish it is yours to keep.", "Hear me! Hear me! Tiquanda's elephants are terrified, the Ape God's footsteps are a scary sight. So hunt for theirs tusks while they are filled with fright!", "Hear me! Hear me! Mammoths silently watch as the snow melts away. It reveals special flowers which are not meant to stay. Grow their seeds to brighten up your day!", "Hear me! Hear me! The witch Wyda seems to be bored. Pay her a visit but sharpen your sword. She might come up with a terrible surprise, are you brave enough to believe your eyes?" } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local lastSound = 0 function onThink() if lastSound < os.time() then lastSound = (os.time() + 10) if math.random(100) < 25 then Npc():say(voices[math.random(#voices)], TALKTYPE_SAY) end end npcHandler:onThink() end -
Boush deu reputação a Wakon em [PEDIDO] [RESOLVIDO] Criar báu de quest [TFS 1.0]Você adiciona o script em "Data/actions/scripts", como um arquivo .lua e coloca o nome desejado, script.lua.
Depois adiciona a tag em "Data/actions" no arquivo actions.xml, não esqueça de mudar para o nome que você colocou:
<action actionid="54355" script="script.lua" /> Ai você coloca a actionid e adiciona ela no baú do RME, no exemplo ali é 54355.
-
Boush deu reputação a Summ em [PEDIDO] [RESOLVIDO] Criar báu de quest [TFS 1.0]function onUse(cid) local time = 60*60*24 -- 1 Dia local storage = 76464 local item = xxxx -- ID do item que vai ganhar. if getStorageGlobalValue(cid, storage) <= os.time() then doPlayerAddItem(cid, item, 1) setStorageGlobalValue(cid, storage, os.time()+ time) else doPlayerSendTextMessage(cid, 19, "Não se passou 1 dia desde que o baú foi aberto!!") end return true end
-
Boush deu reputação a Snowsz em (Resolvido)[PEDIDO] Criar NPC com função de teletransportar [TFS 1.0]No arquivo xml que você quer seu npc coloque isso:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Questeiro" script="questeiro.lua" walkinterval="0" speechbubble="1" floorchange="0"> <health now="100" max="100" /> <look typeex="9242" head="98" body="95" legs="115" feet="114" addons="0"/> <parameters> <parameter key="message_greet" value="Ola jogador voce deseja me ajudar? Diga {quest}" /> </parameters> </npc> No arquivo .lua que você vai utilizar no seu npc, coloque isso:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end msg = msg:lower() local config = { pos = {x = 1020, y = 1030, z = 7}, mensagens = { ["quest"] = "Então, você quer saber sobre a quest eim... Bom vou lhe contar blablablablablablablabla...", ["yes"] = "Você foi teleportado.", ["no"] = "Adeus então.", } } if msgcontains(msg, "quest") then npcHandler:say(config.mensagens["quest"], cid) elseif msgcontains(msg, "yes") then npcHandler:say(config.mensagens["yes"], cid) doTeleportThing(cid, config.pos) elseif msgcontains(msg, "no") then npcHandler:say(config.mensagens["no"], cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Configuração:
Troque o nome do seu npc aqui: name="Questeiro" e aqui script="questeiro.lua" você troca para o nome do arquivo.lua que criou para seu npc, não esqueça do ".lua" no final.
Acho o resto está obvio não?
-
Boush deu reputação a Wakon em [NPC] Papai Noel - Que dá presenteConfigurei pra você, se faltar algo me avise.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local t = { item = 7844, st = 121402, temp = 24*3600, -- Em 24 é o tempo em horas para usar novamente! level = 200 } function creatureSayCallback(cid, type, msg) msg = msg:lower() if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'sim') or msgcontains(msg, 'yes') then if getPlayerLevel(cid) >= t.level then if getPlayerStorageValue(cid, t.st) > os.time() then selfSay("Você precisa esperar " .. getPlayerStorageValue(cid, t.st) - os.time() .. ' segundo' .. (getPlayerStorageValue(cid, t.st) - os.time() == 1 and "" or "s") .. " para pegar o presente novamente.", cid) else setPlayerStorageValue(cid, t.st, os.time() + t.temp) doPlayerAddItem(cid, t.item) doSendMagicEffect(getThingPos(cid), 13) selfSay('Aqui está! Feliz natal!', cid) end else selfSay('Você precisa ser level '.. t.level ..' para pegar o presente.', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())