
Solutions
-
Snowsz's post in (Resolvido)[PEDIDO] NPC que da itens aleátorio diariamente. was marked as the answerMexi 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.
-
Snowsz's post in (Resolvido)Treiner - Aparecer was marked as the answerlocal pos = { [9000] = {monster = "Alvo", pos = {x = 0, y = -2, z = 0}}, [9001] = {monster = "Alvo", pos = {x = -1, y = 1, z = 0}}, [9002] = {monster = "Alvo", pos = {x = 0, y = -2, z = 0}}, [9003] = {monster = "Alvo", pos = {x = 0, y = 2, z = 0}}, [9004] = {monster = "Alvo", pos = {x = 2, y = -1, z = 0}}, } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) local p = getCreaturePosition(cid) if pos[getItemAttribute(item.uid, "aid")] then local np = pos[getItemAttribute(item.uid, "aid")] local s = {x = p.x + (np.pos.x), y = p.y + (np.pos.y), z = p.z + (np.pos.z)} doSummonCreature(np.monster, s) end return true end function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition) local p = getCreaturePosition(cid) if pos[getItemAttribute(item.uid, "aid")] then local np = pos[getItemAttribute(item.uid, "aid")] local s = {x = p.x + (np.pos.x), y = p.y + (np.pos.y), z = p.z + (np.pos.z)} for i = 1, 255 do local cre = getTopCreature({x = s.x, y = s.y, z = s.z, stackpos = i}).uid if cre then doRemoveCreature(cre) break end end doSendMagicEffect(s, 6) end return true end
-
Snowsz's post in (Resolvido)Stamina Potion TFS:1x? was marked as the answerUé, mas não tem erro algum ali, você fez alguma burrada...
local gain = 60 function onUse(cid, item, frompos, item2, topos) cid:setStamina(cid:getStamina()+gain) doSendMagicEffect(frompos, 1) -- Efeito, para mudar basta alterar o número 1 para o efeito que você quiser, /z 1 para ver o efeito no tibia. doRemoveItem(item.uid, 1) -- Se quiser que o item fique infinito, basta alterar o número 1 para 0 return true end -
Snowsz's post in (Resolvido)[Resolvido] Erro move1.lua was marked as the answerlocal msgs = {"use ", ""} function doAlertReady(cid, id, movename, n, cd) if not isCreature(cid) then return true end local myball = getPlayerSlotItem(cid, 8) if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(myball.uid).." - "..movename.." (m"..n..") esta pronto!") return true end local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid) if not p or #p <= 0 then return true end for a = 1, #p do if getItemAttribute(p[a], cd) == "cd:"..id.."" then if isInArray({"m1", "m2", "m3"}, n) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") esta pronto!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") esta pronto!") end return true end end end function onSay(cid, words, param, channel) local storage = 918271 if param ~= "" then return true end if string.len(words) > 3 then return true end if #getCreatureSummons(cid) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce precisa de um pokemon para usar as moves.") return 0 end --alterado v2.5 local mypoke = getCreatureSummons(cid)[1] if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end if getCreatureName(mypoke) == "Evolution" then return true end local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke) local it = string.sub(words, 2, 3) local move = movestable[name].move1 if getPlayerStorageValue(mypoke, 212123) >= 1 then cdzin = "cm_move"..it.."" else cdzin = "move"..it.."" --alterado v2.5 end if it == "2" then doPlayerSendTextMessage(cid, 26, "sounds/105.wav") move = movestable[name].move2 elseif it == "3" then move = movestable[name].move3 elseif it == "4" then move = movestable[name].move4 elseif it == "5" then move = movestable[name].move5 elseif it == "6" then move = movestable[name].move6 elseif it == "7" then move = movestable[name].move7 elseif it == "8" then move = movestable[name].move8 elseif it == "9" then move = movestable[name].move9 elseif it == "10" then move = movestable[name].move10 elseif it == "11" then move = movestable[name].move11 elseif it == "12" then move = movestable[name].move12 elseif it == "13" then move = movestable[name].move13 end if isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, it) then mLevel = move.level mCD = move.cd mName = move.name mTarget = move.target mDist = move.dist else m = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."") mLevel = tmList[m].level mCD = tmList[m].cd mName = m mTarget = tmList[m].target mDist = tmList[m].dist end if not move then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.") return true end --if false and getLevel(mypoke) < mLevel then if getLevel(mypoke) < mLevel then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu Pokemon ainda nao sabe usar essa move.") return 0 end if getPlayerStorageValue(mypoke, storage) > os.time() then return doPlayerSendCancel(cid, "You need wait "..(tonumber(getPlayerStorageValue(mypoke, storage)) - os.time()).." second"..((tonumber(getPlayerStorageValue(mypoke, storage)) - os.time()) > 1 and "s" or "").." to cast this spell.") end if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "voce deve esperar "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." segundos para usar "..mName.." novamente.") return 0 end if getTileInfo(getThingPos(mypoke)).protection then doPlayerSendCancel(cid, "Voce nao pode atacar em area protegida.") return 0 end if getPlayerStorageValue(mypoke, 3894) >= 1 then return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3 end if (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then --alterado v2.5 doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!") return 0 end --alterado v2.6 if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 then local target = getCreatureTarget(cid) if isCreature(getMasterTarget(target)) then --alterado v2.6 --alterado v2.5 doSendMagicEffect(getThingPos(target), 211) doSendAnimatedText(getThingPos(target), "TOO BAD", 215) doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false) doSendMagicEffect(getThingPos(target), 211) doFaceCreature(target, getThingPos(mypoke)) return true --alterado v2.6 end end if mTarget == 1 then if not isCreature(getCreatureTarget(cid)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Nao ha pokemon na mira.") return 0 end if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then return 0 end if getCreatureHealth(getCreatureTarget(cid)) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja derrotou seu oponente.") return 0 end if not isCreature(getCreatureSummons(cid)[1]) then return true end if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > mDist then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.") return 0 end if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then return 0 end end local newid = 0 if isSleeping(mypoke) or isSilence(mypoke) then --alterado v2.5 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.") return 0 else newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD) end doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY) local summons = getCreatureSummons(cid) --alterado v2.6 addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin) for i = 2, #summons do if isCreature(summons[i]) and getPlayerStorageValue(cid, 637501) >= 1 then docastspell(summons[i], mName) --alterado v2.6 end end docastspell(mypoke, mName) setPlayerStorageValue(mypoke, storage, os.time() + mCD) doCreatureAddCondition(cid, playerexhaust) if useKpdoDlls then doUpdateCooldowns(cid) end return 0 end
-
Snowsz's post in (Resolvido)[Pedido] Dar dano em determinaria área was marked as the answerlocal areas = { {leftUpPoint = {x = 1, y = 2, z = 3}, rightDownPoint = {x = 6, y = 7, z = 8}, minHit = 100, maxHit = 500, effect = 30}, } function onThink(interval, lastExecution, thinkInterval) for id, arr in pairs(areas) do for x = arr.leftUpPoint.x, arr.rightDownPoint.x do for y = arr.leftUpPoint.y, arr.rightDownPoint.y do for z = arr.leftUpPoint.z, arr.rightDownPoint.z do local pos = {x = x, y = y, z = z} local uid = getTopCreature(pos).uid doSendMagicEffect(pos, arr.effect) if isCreature(uid) then local random = math.random(arr.minHit, arr.maxHit) doCreatureAddHealth(uid, -random) doSendAnimatedText(pos,"-"..random, 180) end end end end end return true end
-
Snowsz's post in (Resolvido)[ERRO] Azerus was marked as the answerTenta trocar isso doSummonCreature por isso doCreateMonster.
-
Snowsz's post in (Resolvido)[AJUDA] Fury Gate só em carlin was marked as the answerSe quiser fazer mais um teste, aqui está:
math.randomseed(os.time()) local random = math.random(1,6) function onStartup(interval) if random == 1 then -- venore setGlobalStorageValue(9710, 1) doCreateItem(7853, {x = 32833, y = 32081, z = 7}) doCreateItem(7851, {x = 32834, y = 32081, z = 7}) doCreateItem(5066, {x = 32834, y = 32081, z = 7}) doCreateItem(5066, {x = 32833, y = 32081, z = 7}) local gate1 = doCreateItem(6116, {x = 32834, y = 32081, z = 7}) doSetItemActionId(gate1, 9710) print('>> Fury Gate hoje esta em venore.') elseif random == 2 then -- ab'dendriel setGlobalStorageValue(9711, 1) doCreateItem(7853, {x = 32679, y = 31719, z = 7}) doCreateItem(7851, {x = 32680, y = 31719, z = 7}) doCreateItem(5066, {x = 32680, y = 31719, z = 7}) doCreateItem(5066, {x = 32679, y = 31719, z = 7}) local gate2 = doCreateItem(6116, {x = 32680, y = 31719, z = 7}) doSetItemActionId(gate2, 9711) print('>> Fury Gate hoje esta em ab dendriel.') elseif random == 3 then -- thais setGlobalStorageValue(9712, 1) doCreateItem(5064, {x = 32264, y = 32163, z = 7}) doCreateItem(5064, {x = 32264, y = 32164, z = 7}) doCreateItem(7852, {x = 32264, y = 32164, z = 7}) doCreateItem(7853, {x = 32264, y = 32163, z = 7}) doCreateItem(5064, {x = 32265, y = 32163, z = 7}) doCreateItem(5064, {x = 32265, y = 32164, z = 7}) local gate3 = doCreateItem(6117, {x = 32264, y = 32164, z = 7}) doSetItemActionId(gate3, 9712) print('>> Fury Gate hoje esta em thais.') elseif random == 4 then -- carlin setGlobalStorageValue(9713, 1) doCreateItem(5066, {x = 32262, y = 31848, z = 7}) doCreateItem(5066, {x = 32263, y = 31848, z = 7}) doCreateItem(7853, {x = 32262, y = 31848, z = 7}) doCreateItem(7851, {x = 32263, y = 31848, z = 7}) local gate4 = doCreateItem(6116, {x = 32263, y = 31848, z = 7}) doSetItemActionId(gate4, 9713) print('>> Fury Gate hoje esta em carlin.') elseif random == 5 then -- edron setGlobalStorageValue(9714, 1) doCreateItem(5066, {x = 33220, y = 31922, z = 7}) doCreateItem(5066, {x = 33221, y = 31922, z = 7}) doCreateItem(7853, {x = 33220, y = 31922, z = 7}) doCreateItem(7851, {x = 33221, y = 31922, z = 7}) doCreateItem(5066, {x = 33220, y = 31923, z = 7}) doCreateItem(5066, {x = 33221, y = 31923, z = 7}) local gate5 = doCreateItem(6116, {x = 33221, y = 31922, z = 7}) doSetItemActionId(gate5, 9714) print('>> Fury Gate hoje esta em edron.') elseif random == 6 then -- kazordoon setGlobalStorageValue(9716, 1) doCreateItem(5066, {x = 32573, y = 31982, z = 7}) doCreateItem(5066, {x = 32574, y = 31982, z = 7}) doCreateItem(7853, {x = 32573, y = 31982, z = 7}) doCreateItem(7851, {x = 32574, y = 31982, z = 7}) local gate6 = doCreateItem(6116, {x = 32574, y = 31982, z = 7}) doSetItemActionId(gate6, 9716) print('>> Fury Gate hoje esta em kazordoon.') end end -
Snowsz's post in (Resolvido)[OTCLIENT]Como remover tela de escolha de idioma? was marked as the answerVá em modules e delete a pasta client_locales, após isso, continue em modules e abra a pasta client, abra o arquivo client.otmod e remova essa linha:
- client_locales -
Snowsz's post in (Resolvido)[Doubt] url/ip address was marked as the answerThe problem is that in no-ip this ip recognizes her as remote , that is, it does not accept your ip for redirection ;/
-
Snowsz's post in (Resolvido)Adicionar mais uma configuração nesse NPC was marked as the answerlocal spells_t = { -- all ["intense healing"] = {price = 350, vocations = {1,2,3,5,6,7}, level = 1, spell = "Exura Gran"}, -- exura gran } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg:lower(), "spells") then local str = {} local voc = getPlayerVocation(cid) for name, info in pairs(spells_t) do if isInArray(info.vocations, voc) and not getPlayerLearnedInstantSpell(cid, name) then table.insert(str, tostring(" {".. name .."}["..info.spell.."] for ".. info.price .." gold coins,\n") ) end end if next(str) == nil then npcHandler:say("I have no magic to sell you.", cid) else doShowTextDialog(cid, 2175, table.concat(str)) end elseif spells_t[msg:lower()] then if getPlayerLearnedInstantSpell(cid, msg) then npcHandler:say("You have already learned this spell.", cid) return true end if getPlayerLevel(cid) < spells_t[msg:lower()].level then npcHandler:say("You need to be level ".. spells_t[msg:lower()].level .." or older to purchase this spell.", cid) return true end if not isInArray(spells_t[msg:lower()].vocations, getPlayerVocation(cid)) then npcHandler:say("You do not have the vocation to buy is spell.", cid) return true end if doPlayerRemoveMoney(cid, spells_t[msg:lower()].price) then doPlayerLearnInstantSpell(cid, msg) npcHandler:say("You learned ".. msg .."["..spells_t[msg:lower()].spell.."].", cid) else npcHandler:say("You do not have "..spells_t[msg:lower()].price.." gold coins.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) O nome da magia você poe aqui:
spell = "Exura Gran" -
Snowsz's post in (Resolvido)[PEDIDO] "Mechanism" de yalahar sem missão was marked as the answerTenta assim:
local mechanisms = { [3091] = {pos = {x = 32744, y = 31161, z = 5}, value = 21}, -- Alchemist [3092] = {pos = {x = 32744, y = 31164, z = 5}, value = 21}, [3093] = {pos = {x = 32833, y = 31269, z = 5}, value = 24}, -- Trade [3094] = {pos = {x = 32833, y = 31266, z = 5}, value = 24}, [3095] = {pos = {x = 32729, y = 31200, z = 5}, value = 29}, -- Arena [3096] = {pos = {x = 32734, y = 31200, z = 5}, value = 29}, [3097] = {pos = {x = 32776, y = 31141, z = 5}, value = 35}, -- Cemetery [3098] = {pos = {x = 32776, y = 31145, z = 5}, value = 35}, [3099] = {pos = {x = 32874, y = 31202, z = 5}, value = 41}, -- Sunken [3100] = {pos = {x = 32869, y = 31202, z = 5}, value = 41}, [3101] = {pos = {x = 32856, y = 31251, z = 5}, value = 45}, -- Factory [3102] = {pos = {x = 32854, y = 31248, z = 5}, value = 45} } local mechanisms2 = { [9235] = {pos = {x = 32773, y = 31116, z = 7}}, [9236] = {pos = {x = 32780, y = 31115, z = 7}} } function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if(mechanisms[item.uid]) then --if(player:getStorageValue(30) >= mechanisms[item.uid].value) then player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(mechanisms[item.uid].pos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) --else --player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The gate mechanism won't move. You probably have to find a way around until you figure out how to operate the gate.") --end elseif(mechanisms2[item.uid]) then player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(mechanisms2[item.uid].pos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end return true end -
Snowsz's post in (Resolvido)[Talkaction] !frags was marked as the answerlocal config = { useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')), advancedFragList = getBooleanFromString(getConfigValue('advancedFragList')) } function onSay(cid, words, param, channel) if(not config.useFragHandler) then return true end local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = { name = result:getDataString("name"), level = result:getDataInt("level"), date = result:getDataInt("date") } if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } if(config.advancedFragList) then local result = "Frags gained today: " .. size.day .. "." result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "." result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "." local skullEnd = getPlayerSkullEnd(cid) if(skullEnd > 0) then result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd) end doPlayerSendTextMessage(cid, 18, result) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.") local skullEnd = getPlayerSkullEnd(cid) if(skullEnd > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)) end end return true end
-
Snowsz's post in (Resolvido)como tira opção de troca de idioma do OTclient? was marked as the answerNo seu otclient em \modules\client_options no arquivo game.otui remova isso e salve:
Button id: changeLocale !text: tr('Change language') @onClick: modules.client_locales.createWindow() anchors.top: prev.bottom anchors.left: prev.left margin-top: 5 width: 120 -
Snowsz's post in (Resolvido)[Pedido] Npcs Guild Points was marked as the answerQual sistema de guild points você usa ?
-
Snowsz's post in (Resolvido)Ajuda calculo de mana gasta spell was marked as the answerlocal manaporlevel = 3 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, maglevel) min = ( (maglevel * 30) * 0.5 ) * -1 max = ( (maglevel * 30) * 1.0 ) * -1 return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) if getPlayerMana(cid) >= (getPlayerLevel(cid)*manaporlevel) then doPlayerAddMana(cid, -(getPlayerLevel(cid)*manaporlevel)) return doCombat(cid, combat, var) end return doPlayerSendCancel(cid, "You don't have mana. ["..tostring(getPlayerLevel(cid)*manaporlevel).."]") end
-
Snowsz's post in (Resolvido)Comando !stamina was marked as the answerTag:
<talkaction words="!stamina" event="script" value="staminarefil.lua"/> Crie um arquivo com o nome staminarefil.lua em data/talkactions/scripts e troque tudo que tem dentro por isso:
local money = 5000 function onSay(cid, words, param) if getPlayerMoney(cid) >= money then doPlayerRemoveMoney(cid, money) setPlayerStamina(cid, 2880) else doPlayerSendCancel(cid, "You don't have money to refil your stamina.") end return true end -
Snowsz's post in (Resolvido)[Pedido] Efeitos texto animado ao upar skill,level,etc. was marked as the answerEm creaturescripts.xml adicione essa tag:
<event type="advance" name="SkillUpText" event="script" value="skilluptext.lua"/> Em creaturescripts/scripts crie um arquivo com o nome "skilluptext.lua" e troque tudo que tem dentro por isso:
local config = { [0] = {msg = "Fist UP!", textcolor = 0}, [1] = {msg = "Club UP!", textcolor = 0}, [2] = {msg = "Sword UP!", textcolor = 0}, [3] = {msg = "Axe UP!", textcolor = 0}, [4] = {msg = "Dist UP!", textcolor = 0}, [5] = {msg = "Shield UP!", textcolor = 0}, [6] = {msg = "Fish UP!", textcolor = 0}, [7] = {msg = "Magic UP!", textcolor = 0}, [8] = {msg = "Level UP!", textcolor = 0} } function onAdvance(cid, skill, oldlevel, newlevel) if config[skill] then doSendAnimatedText(getThingPos(cid), config[skill].msg, config[skill].textcolor) end return true end Em creaturescripts/scripts abra o login.lua e antes do último return true adicione essa função:
registerCreatureEvent(cid, "SkillUpText") -
Snowsz's post in (Resolvido)[PEDIDO] Criar NPC com função de teletransportar [TFS 1.0] was marked as the answerNo 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?
-
Snowsz's post in (Resolvido)(AJUDA) Começando com addons full was marked as the answerTenta isso:
Crie um arquivo chamado "loginaddon" em data/creaturescripts/scripts com a extensão ".lua", ficando: "loginaddon.lua" e troque tudo que tem dentro por isso:
local storage = 15984 function onLogin(cid) if getPlayerStorageValue(cid, storage) <= 0 then doPlayerAddAddons(cid, 1) doPlayerAddAddons(cid, 2) setPlayerStorageValue(cid, storage, 1) end return true end Em creaturescripts.xml adicione essa tag:
<event type="login" name="AddonLogin" event="script" value="loginaddon.lua"/> -
Snowsz's post in (Resolvido)[Resolvido] Loot Servidor was marked as the answerSeguinte, a chance de loot vai de 1 até 100000, ou seja, 100000 = 100%, 1 = 0,01%
Acho que é assim, se você quiser 50%, pode usar o valor dessa forma: 50000
-
Snowsz's post in (Resolvido)(Ajuda) Portal do Evento não fecha was marked as the answerPrimeiro, ele explicou perfeitamente o que precisava, se não entendeu você só leu o título, e só pelo título já da para saber...
Tenta:
local teleportPos = {x = 162, y = 47, z = 7, stackpos = 1} -- Posição em que se abre o teleport local teleportId = 1387 function onTime() for i = 1, 255 do teleportPos.stackpos = i if getThingFromPos(teleportPos).itemid == teleportId then doRemoveItem(getThingFromPos(teleportPos).uid, 1) break end end return true end Se não funcionar, manda o link do script de "event zombie" para eu analisar, ok?
-
Snowsz's post in (Resolvido)[Ajuda] Magia Bugada was marked as the answerTenta agora:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, true) arr = { {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) function spellCallback(param) local form = 100 if param.count > 0 or math.random(0, 1) == 1 then doSendMagicEffect(param.pos, CONST_ME_MORTAREA) doAreaCombatHealth(param.cid, COMBAT_DEATHDAMAGE, param.pos, 0, -(((form*getPlayerLevel(param.cid)/2)*getPlayerMagLevel(param.cid))/20)/2, -(((form*getPlayerLevel(param.cid)/2)*getPlayerMagLevel(param.cid))/20), CONST_ME_EXPLOSIONHIT) end if(param.count < 5) then param.count = param.count + 1 addEvent(spellCallback, math.random(1000, 3000), param) end end function onCastSpell(cid, var) doPlayerSetPzLocked(cid) return doCombat(cid, combat, var) end function onTargetTile(cid, pos) local param = {} param.cid = cid param.pos = pos param.count = 0 spellCallback(param) end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) doSetCreatureOutfit(cid,{lookType = 290, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}, 18 * 1000) return doCombat(cid, combat, var) end -
Snowsz's post in (Resolvido)[Stamina BUG] player morre = stamina full) was marked as the answerEu ia fazer o script assim , no seu ainda faltou um parâmetro "cid" na função que adiciona stamina, acho que isso resolve:
local storage = 5612 function onPrepareDeath(cid, deathList) if isPlayer(cid) then setPlayerStorageValue(cid, storage, getPlayerStamina(cid)) -- Salva a Stamina atual do player end return true end function onLogin(cid) local stamina = getPlayerStorageValue(cid, storage) if not stamina == -1 then local newStamina = stamina-getPlayerStamina(cid) --Pega a stamina salva e calcula a diferença com a atual setPlayerStamina(cid, newStamina) -- Adiciona a diferença calculada setPlayerStorageValue(cid, storage, -1) -- Remove o valor da storage end return true end E não há a necessidade de por um "isPlayer" no login, pois quem faz login é um jogador.
@Edit:
Também está errado outra coisa, não para adicionar stamina ao player, e sim setar, corrigi o script, tenta...
-
Snowsz's post in (Resolvido)Sistema de Preço quando da Look no Item (0.3.6) was marked as the answerTestado em TFS 0.4 Protocolo: 8.60
Vá em creaturescripts/creaturescripts.xml e adicione essa tag:
<event type="look" name="priceLook" event="script" value="priceLook.lua"/> Agora, em creaturescripts/scripts copie qualquer arquivo com extensão ".lua" e renomeie para "priceLook", ficando "priceLook.lua"(sem aspas) apague tudo que tem dentro e ponha isso:
function onLook(cid, thing, position, lookDistance) local items = { [7618] = 100, } local coin = "R$" if isCreature(thing.uid) or thing.itemid <= 0 then return true end if items[thing.itemid] then local desc = getItemAttribute(thing.uid, "description") or "" local str = "You see "..(thing.type > 1 and thing.type or getItemInfo(thing.itemid).article).." " str = str..(thing.type > 1 and getItemInfo(thing.itemid).plural:gsub("%a", string.upper, 1) or getItemInfo(thing.itemid).name:gsub("%a", string.upper, 1))..".\n"..(desc ~= "" and desc..'\n' or "") str = str.."Price: "..coin..(items[thing.itemid]*thing.type).."." if getPlayerAccess(cid) >= 3 then str = str.."\nItemID: ["..thing.itemid.."]." str = str.."\nPosition: [X: "..position.x.."] [Y: "..position.y.." [Z: "..position.z.."]." end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str) return false end return true end Agora, no login.lua, antes do último "return true", adicione isso:
registerCreatureEvent(cid, "priceLook") Script instalado, configuração:
Onde tem:
local items = { [7618] = 100, } Você pode adicionar/remover items, na parte dos colchetes "[]" você coloca o id do item, e onde fica o "=" você coloca o preço por unidade, ou seja, se você tem 1 health potion, ele vai valer 100, se você tem 2, ele vai valer 200, só copie a linha inteira e cole só edite o que foi dito, nunca esqueça de deixar a vírgula no final "[7618] = 100,".
Onde tem:
local coin = "R$" Seria a moeda do seu servidor, você pode mudar para qualquer simbolo.
Print:
-
Snowsz's post in (Resolvido)Gostaria de Ajuda Para Faser Jutsu Hirashin Seal Hirashin Teleport was marked as the answerEu fiz sem dar dano e do jeito que entendi, então:
Tag:
<instant name="Hirashin Seal" words="hirashin seal" lvl="12" mana="20" prem="0" range="10" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="hirashin seal.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> </instant> Cria um arquivo com o nome hirashin seal.lua na pasta spells/scripts e poe isso dentro:
function onCastSpell(cid, var) --{itemcriado, efeitoquevaisair, naomexa:P} local config = {2160, 30, getCreatureTarget(cid)} local pos = {x = getPlayerStorageValue(cid, "hirashinposx"), y = getPlayerStorageValue(cid, "hirashinposy"), z = getPlayerStorageValue(cid, "hirashinposz")} if config[3] <= 0 and getPlayerStorageValue(cid, "hirashinpos") <= 0 then doPlayerSendCancel(cid, "To mark the seal, you need a target.") return true end if getPlayerStorageValue(cid, "hirashinpos") <= 0 then setPlayerStorageValue(cid, "hirashinposx", getCreaturePosition(config[3]).x) setPlayerStorageValue(cid, "hirashinposy", getCreaturePosition(config[3]).y) setPlayerStorageValue(cid, "hirashinposz", getCreaturePosition(config[3]).z) setPlayerStorageValue(cid, "hirashinpos", 1) doCreateItem(config[1], 1, getCreaturePosition(config[3])) doPlayerSendCancel(cid, "Marked, use again to teleport.") doSendMagicEffect(getThingPos(config[3]), config[2]) else setPlayerStorageValue(cid, "hirashinpos", 0) doTeleportThing(cid, pos, true) doRemoveItem(getTileItemById(pos, config[1]).uid, 1) doSendMagicEffect(getThingPos(cid), config[2]) end return true end Já tem explicação de alterar o item e o efeito.