
Solutions
-
.Smile's post in (Resolvido)Alguém poderia me fornecer esse script? was marked as the answerEssa Spell já foi feita pelo membro @xWhiteWolf
Link do tópico:
copie algum arquivo .lua da sua pasta data/spells/scripts e renomeie para flightkubu.lua, apague tudo e cole isso dentro:
-- dash as it was in avaOT by Night Wolf local damage = 0 -- dano que toma qnd bate em algum obstáculo local speed = 500 -- velocidade do player ao usar o dash (vai de 0 a mil) local pzprotect = true -- nao deixa entrar em pz com a spell local distance = 15 -- quantos sqms anda local 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 onWalk(cid) if isCreature(cid) then local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, pzprotect) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), 14) else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end end return true end function onCastSpell(cid, var) for i = 0, distance do addEvent(onWalk, (1001- math.min(speed, 1000)) *i, cid) end return true end em data/spells/spells.xml adicione essa tag:
<instant name="Flight Kubu" words="Flight Kubu" direction="1" lvl="100" mana="200" prem="0 exhaustion="7000" event="script" value="flightkubu.lua"> <vocation id="7"/> <vocation id="6"/> <vocation id="5"/> </instant>
-
.Smile's post in (Resolvido)NPC Teleporta Storange e Level, Ajuda por favor was marked as the answerlocal DESTINO = {x = 160, y = 54, z = 7} -- POSIÇÃO DE DESTINO 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:lower()) end function onThink() npcHandler:onThink() end local talkState = {} 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 getPlayerStorageValue(cid, 12345) > 0 then -- STORAGE selfSay('Você já fez a quest',cid) return false end if msgcontains(msg, "tentar") then selfSay("Você realmente deseja tentar obter aprovação, achar o caminho de volta pode ser muito dificil se não conseguir?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerLevel(cid) >= 400 then selfSay("Boa sorte!", cid) doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) else selfSay("Me desculpe, mas você não tem level necessario para obter aprovação. Volte quando atingir level 400.", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
.Smile's post in (Resolvido)Nao poder usar o comando em "X" lugares was marked as the answerfunction onSay(cid, words, param) local from,to = {x=1001, y=705, z=7},{x=1031, y=737, z=7} local from2,to2 = {x=1011, y=705, z=6},{x=1031, y=738, z=6} local from3,to3 = {x=1012, y=706, z=5},{x=1032, y=739, z=5} local pos = {x=99, y=188, z=7} if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) or isInRange(getCreaturePosition(cid), from3, to3) then doPlayerSendCancel(cid, "Voce nao pode fazer isso nessa area!") return true end if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "Voce nao pode fazer isso em luta") else doSendMagicEffect(getPlayerPosition(cid),53) doPlayerSendCancel(cid,"Voce foi teleportado Com Sucesso") doTeleportThing(cid,pos) end return true end local from,to = {x=1001, y=705, z=7},{x=1031, y=737, z=7} = aqui você edita as posições do mapa sendo o primeiro valor a posição superior esquerda e segundo a posição inferior direita.
-
.Smile's post in (Resolvido)Colocar storage e exausted nessa script was marked as the answerlocal combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -110.0, 0, -125.0, 0) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 301) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, 301) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat4, COMBAT_PARAM_EFFECT, 301) local combat5 = createCombatObject() setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat5, COMBAT_PARAM_EFFECT, 301) arr1 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 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, 2, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0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0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } arr5 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) local area3 = createCombatArea(arr3) local area4 = createCombatArea(arr4) local area5 = createCombatArea(arr5) setCombatArea(combat1, area1) setCombatArea(combat2, area2) setCombatArea(combat3, area3) setCombatArea(combat4, area4) setCombatArea(combat5, area5) local function onCastSpell1(parameters) return isCreature(parameters.cid) and doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) return isCreature(parameters.cid) and doCombat(parameters.cid, parameters.combat2, parameters.var) end local function onCastSpell3(parameters) return isCreature(parameters.cid) and doCombat(parameters.cid, parameters.combat3, parameters.var) end local function onCastSpell4(parameters) return isCreature(parameters.cid) and doCombat(parameters.cid, parameters.combat4, parameters.var) end local function onCastSpell5(parameters) return isCreature(parameters.cid) and doCombat(parameters.cid, parameters.combat5, parameters.var) end function onCastSpell(cid, var) local waittime = 1.5 -- tempo de exhaustion em segundos local storage = 115818 -- storage do exhaustion if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "You are exhausted") return false end local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 } addEvent(onCastSpell1, 0, parameters) addEvent(onCastSpell2, 0, parameters) addEvent(onCastSpell3, 150, parameters) addEvent(onCastSpell4, 300, parameters) addEvent(onCastSpell5, 450, parameters) exhaustion.set(cid, storage, waittime) if not isPlayer(parameters.cid) then return true end return true end
-
.Smile's post in (Resolvido)Money Por Vip Coins was marked as the answerCorrigido, lembre-se de editar o valor minimo e o fee na lib e veja se tem os requisitos.
npc
--[[ SISTEMA DE CAÇADOR DE RECOMPENSAS FEITO POR LEORIC [OMEGA] ]]-- 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 local moneyId = 11192 -- ID da moeda local playerReward = getPlayerStorageValue(cid, bountyReward) local points = getPlayerStorageValue(cid, bountyPoints) > 0 and getPlayerStorageValue(cid, bountyPoints) or 0 if msgcontains(msg,'assassin guild') then selfSay('Yess, I am the masster of the assasssinsss. What do you want with the guild? {Post} a bounty on someone? Get your {reward}, check the {most wanted} or your {points}? Or maybe some {information} about our bounty system?',cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if msgcontains(msg,'post') then selfSay('Yesss, a bounty?! Good for businessss. The death of whom do you wish? Give me a {name}.',cid) talkState[talkUser] = 2 elseif msgcontains(msg,'information') then selfSay('It isss very sssimple. You give me a name and money and I\'ll put it at the bounty board. You can check who hasss an active bounty there too. Who kills that person, gets the money. Ssssimple. And, of course, you don\'t get paid to kill a person whose bounty you posted.',cid) elseif msgcontains(msg, 'points') then if bountyConfig.points == false and bountyConfig.omegaPointSystem == false then selfSay('Point system is currently disabled.',cid) else selfSay('You have '..points..' bounty points.',cid) end elseif msgcontains(msg,'reward') then if playerReward > 0 then doPlayerAddItem(cid, moneyId, playerReward) selfSay('Here you go, my bounty hunter friend, '..playerReward..' gps.', cid) setPlayerStorageValue(cid, bountyReward, 0) talkState[talkUser] = 1 else selfSay('Nope, you have no reward to collect.',cid) talkState[talkUser] = 1 end elseif msgcontains(msg, 'most wanted') then local players = getTopBounties(10) local names = {} local str = '' if not players then selfSay('There are no active bounties at this moment.',cid) return true end for index, pid in ipairs(players) do table.insert(names,'{'..index..'} '..getPlayerNameByGUID(pid)..' ['..getPlayerBounty(getPlayerNameByGUID(pid))..']\n') end str = table.concat(names) doPlayerPopupFYI(cid, str) end elseif talkState[talkUser] == 2 then if not playerExist(msg) then selfSay('No, no, no. That is not a valid target. Give me a {name}!',cid) elseif string.lower(msg) == string.lower(getCreatureName(cid)) then selfSay('You can\'t post a bounty on yourself, stupid!', cid) else playername = {} playername[cid] = msg selfSay('Very well. The service has a minimum cost of '..bountyConfig.min..' and we take a '..bountyConfig.fee..'% fee of your bounty. How much do you want to deposit on your bounty?',cid) talkState[talkUser] = 3 end elseif talkState[talkUser] == 3 then if tonumber(msg) ~= nil and tonumber(msg) and tonumber(msg) >= bountyConfig.min then bounty = tonumber(msg) if doPlayerRemoveItem(cid, moneyId, bounty) then doPlayerAddBounty(playername[cid], math.ceil(((1-(bountyConfig.fee/100))*bounty))) setGlobalStorageValue(getPlayerGUIDByName(playername[cid])+20000, getPlayerGUIDByName(getCreatureName(cid))) selfSay('You have sssuccessfully posted a bounty for '..playername[cid]..'.',cid) selfSay('Would you like anything else? Maybe {post} a bounty on someone, check the {most wand} or your {points}? Get your {reward}? Or maybe some {information} about our bounty system?',cid) playername[cid] = nil talkState[talkUser] = 1 else selfSay('You can\'t fool me, you basssstard! You don\'t pay, I add no bounty!',cid) talkState[talkUser] = 1 end else selfSay('I\'m still expecting a real bounty, my friend... it has to be bigger than '..bountyConfig.min..'.',cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
.Smile's post in (Resolvido)Trocar Money Por Item was marked as the answerlocal moneyId = 11192 -- ID do item que ira remover local moneyRed = 5 -- Quatidade de item para remover o frag e red skull local moneyBlack = 3 -- Quatidade de item para remover o frag e black skull local moneySkullNone = 1 -- Quatidade de item para remover o frag function onSay(cid, words, param, channel) if not getTileInfo(getThingPos(cid)).protection then return doPlayerSendCancel(cid, "You must be in a Protection Zone.") end pid = getPlayerGUID(cid) if getCreatureSkullType(cid) == 4 then if doPlayerRemoveItem(cid, moneyId, moneyRed) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags and red skull were removed for '.. doNumberFormat(moneyRed) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyRed) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end if getCreatureSkullType(cid) == 5 then if doPlayerRemoveItem(cid, moneyId, moneyBlack) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags and black skull were removed for '.. doNumberFormat(moneyBlack) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyBlack) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end if getCreatureSkullType(cid) <= 3 then if doPlayerRemoveItem(cid, moneyId, moneySkullNone) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags were removed for '.. doNumberFormat(moneySkullNone) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneySkullNone) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end end
-
.Smile's post in (Resolvido)Ajuda Exp Ring Por Stages was marked as the answerfunction onEquip(cid, item, slot) if getPlayerStorageValue(cid, 120365) - os.time() <= 0 then doTransformItem(item.uid, 10502, 1) doPlayerSendTextMessage(cid, 22, 'Agora ganha 3x mais experiencia!') doPlayerSetExperienceRate(cid, 3.0) setPlayerStorageValue(cid, 120365, os.time()+2) end return true end function onDeEquip(cid, item, slot) doPlayerSendTextMessage(cid, 22, 'Experiencia extra cancelada.') doPlayerSetExperienceRate(cid, 1) return true end Se possível teste em diferentes leveis do stages pra ver se está tudo funcionando corretamente.
-
.Smile's post in (Resolvido)Error #2030 Object Builder was marked as the answerNa hora de abrir o Client você precisa marcar a opção Transparency pois esse servidor utilizava Transparência no seu OTClient.
-
.Smile's post in (Resolvido)Exp ring dando mta exp was marked as the answerEntão o problema é o seguinte, esse Script ele pega o rateExperience que está no seu config.lua e ignora as rate que está no stages.xml
function onEquip(cid, item, slot) doTransformItem(item.uid, 2206, 1) doPlayerSendTextMessage(cid, 22, 'Agora ganha 2x mais experiencia!') doPlayerSetExperienceRate(cid, 2.0) return TRUE end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 2169, 1) doPlayerSendTextMessage(cid, 22, 'Experiencia extra cancelada.') doPlayerSetExperienceRate(cid, 1) return TRUE end
Testa agora e vê se funciona, e testa em leveis que a exp dos stages mudam também pra ver se ta tudo certo e está funcionando corretamente.
-
.Smile's post in (Resolvido)Dano conforme sword skill was marked as the answerOps :S acabei me confundindo, testa ai.
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 9) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 3) function onGetFormulaValues(cid, level) local skill = getPlayerSkill(cid, 2) -- "2" é o ID DA SKILL local min = -((level*skill*10)+2500) -- O DANO MINIMO DA ARMA É O LEVEL DO JOGADOR * A SKILL DO JOGADOR * 10 + 2500 local max = -((level*skill*10)+5000) -- O DANO MINIMO DA ARMA É O LEVEL DO JOGADOR * A SKILL DO JOGADOR * 10 + 5000 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var) local skillmin = 30 -- MINIMO DE SKILL PRA LANÇAR A MAGIA if getPlayerSkillLevel(cid, skill) < skillmin then return doPlayerSendCancel(cid, "You must have at least ".. skillmin .." of sword skill to use this spell.") end return doCombat(cid, combat, var) end