Tudo que warotserv postou
-
[Resolvido] [Pedido] Sistema de Times para PVP
Pronto, sistema testado e funcionando. em "data\creaturescripts\scripts" crie um arquivo chamado "pvpTeam.lua" e cole o seguinte código redTeamSpawn = { x = 100, y = 100, z = 7} -- red team spawn position blueTeamSpawn = { x = 200, y = 200, z = 7} -- blue team spawn position redTeamParticipants = {} blueTeamParticipants = {} function teamLength(team) -- return the number of players in team local count = 0 for _ in pairs(team) do count = count + 1 end return count end function playerJoin(cid) -- try to join player in event if ableToJoin(cid) then redTeamParticipantsLength = teamLength(redTeamParticipants) blueTeamParticipantsLength = teamLength(blueTeamParticipants) if redTeamParticipantsLength <= blueTeamParticipantsLength then redTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time vermelho.") else blueTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time azul.") end return TRUE else return FALSE end end function playerRemove(cid) -- remove player from event (if its participating) if isParticipating(cid) then if redTeamParticipants[cid] == true then redTeamParticipants[cid] = nil else blueTeamParticipants[cid] = nil end return TRUE else return FALSE end end function isParticipating (cid) -- verify if player is participating of the event if blueTeamParticipants[cid] == true or redTeamParticipants[cid] == true then return TRUE else return FALSE end end function ableToJoin (cid) -- checks if players are able to join if isPlayer(cid) and not isParticipating(cid) then return TRUE else return FALSE end end function arePlayersOfSameTeam (cid1, cid2) -- checks if the players are of the same team if ((blueTeamParticipants[cid1] == true and blueTeamParticipants[cid2] == true) or (redTeamParticipants[cid1] and redTeamParticipants[cid2])) then return TRUE else return FALSE end end function onLogin(cid) -- checks if it's really a player and if it's only if isPlayer(cid) then if isParticipating(cid) == true then return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong else if playerJoin(cid) == true then return TRUE -- everything gone as expected else return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong end end else return TRUE end end function onLogout(cid) -- this function is essential to not unbalance the teams if isParticipating (cid) then return playerRemove(cid) end return TRUE end function onAttack(cid, attacker) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- are those players participating of the event? if not isParticipating(cid) or not isParticipating (attacker) then return TRUE end if arePlayersOfSameTeam(cid, attacker) then -- a player of the same team cannot attack the other!! return FALSE else return TRUE end end function onStatsChange(cid, attacker, t, combat, value) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- verify if both are participating of PVP if isParticipating(cid) and isParticipating(attacker) then -- both are participating of event -- verify if both are of the same team if arePlayersOfSameTeam(cid, attacker) then -- they're of the same team. Only heals are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return TRUE else return FALSE end else -- they're not of the same team. Only damages are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return FALSE else return TRUE end end else -- one or both are not participating of event return TRUE end -- getting local player1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if player1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end agora, em "creaturescripts.xml" adicione o seguinte <event type="attack" name="PvpTeam1" event="script" value="pvpTeam.lua"/> <event type="statschange" name="PvpTeam2" event="script" value="pvpTeam.lua"/> <event type="login" name="PvpTeam3" event="script" value="pvpTeam.lua"/> <event type="logout" name="PvpTeam4" event="script" value="pvpTeam.lua"/> depois, no arquivo "login.lua" que se encontra em "data\creaturescripts\scripts" adicione registerCreatureEvent(cid, "PvpTeam1") registerCreatureEvent(cid, "PvpTeam2") registerCreatureEvent(cid, "PvpTeam3") registerCreatureEvent(cid, "PvpTeam4") Obs: use os spawn points apenas se desejar. Bom, é isso. Espero ter ajudado. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
-
[Resolvido] [Pedido] Sistema de Times para PVP
Segue o código abaixo (não testei) em "data\creaturescripts\scripts" crie um arquivo chamado "pvpTeam.lua" e cole o seguinte código redTeamSpawn = { x = 100, y = 100, z = 7} -- red team spawn position blueTeamSpawn = { x = 200, y = 200, z = 7} -- blue team spawn position redTeamParticipants = {} blueTeamParticipants = {} function teamLength(team) -- return the number of players in team local count = 0 for _ in pairs(T) do count = count + 1 end return count end function playerJoin(cid) -- try to join player in event if ableToJoin(cid) then redTeamParticipantsLength = teamLength(redTeamParticipants) blueTeamParticipantsLength = teamLength(blueTeamParticipants) if redTeamParticipantsLength <= blueTeamParticipantsLength then redTeamParticipants[cid] = true else blueTeamParticipants[cid] = true end return TRUE else return FALSE end end function playerRemove(cid) -- remove player from event (if its participating) if isParticipating(cid) then if redTeamParticipants[cid] == true then redTeamParticipants[cid] = nil else blueTeamParticipants[cid] = nil end return TRUE else return FALSE end end function isParticipating (cid) -- verify if player is participating of the event if blueTeamParticipants[cid] == true or redTeamParticipants[cid] == true then return FALSE else return TRUE end end function ableToJoin (cid) -- checks if players are able to join if isPlayer(cid) and not isParticipating(cid) then return TRUE else return FALSE end end function playersOfSameTeam (cid1, cid2) -- checks if the players are of the same team if ((blueTeamParticipants[cid1] == true and blueTeamParticipants[cid2] == true) or (redTeamParticipants[cid1] and redTeamParticipants[cid2])) then return TRUE else return FALSE end end function onLogout(cid) -- this function is essential to not unbalance the teams if isParticipating (cid) then return playerRemove(cid) end return TRUE end function onStatsChange(cid, attacker, t, combat, value) -- verify if both are logged in if not isPlayer(cid) or not isPlayer(attacker) then return FALSE end -- verify if both are participating of PVP if isParticipating(cid) and isParticipating(attacker) then -- both are participating of event -- verify if both are of the same team if playersOfSameTeam(cid, attacker) then -- they're of the same team. Only heals are acceptable if t == STATSCHANGE_HEALTHGAIN then return TRUE else return FALSE end else -- they're not of the same team. Only damages are acceptable if t == STATSCHANGE_HEALTHGAIN then return FALSE else return TRUE end end else -- one or both are not participating of event return TRUE end -- getting local player1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if player1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end agora, em "creaturescripts.xml" adicione o seguinte <event type="statschange" name="PvpTeam1" event="script" value="pvpTeam.lua"/> <event type="logout" name="PvpTeam2" event="script" value="pvpTeam.lua"/> depois, no arquivo "login.lua" que se encontra em "data\creaturescripts\scripts" adicione registerCreatureEvent(cid, "PvpTeam1") registerCreatureEvent(cid, "PvpTeam2") Lembrando que você tem que acoplar a sua função de participação do evento à este sistema que eu fiz (já possui as funções de adicionar e remover players). Caso dê algum problema, me fale, podemos testar o sistema mais tarde. Bom, é isso. Espero ter ajudado. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
-
[CreatureEvent] Monsters Team
Bom, o sistema que se segue eu criei com o intuito de não permitir que determinados monstros deem dano em outros. Primeiramente, crie um arquivo em "data\creaturescripts\scripts" chamado "monstersTeam.lua" e cole o seguinte conteúdo nele monstersTeam = { -- team 1 ["Dragon Hatchling" ] = 1, ["Dragon Lord Hatchling" ] = 1, ["Dragon Lord" ] = 1, ["Dragon" ] = 1, ["Frost Dragon" ] = 1, -- team 2 ["Dwarf Geomancer" ] = 2, ["Dwarf Guard" ] = 2, ["Dwarf Soldier" ] = 2, ["Dwarf" ] = 2 } function onStatsChange(cid, attacker, t, combat, value) if t == STATSCHANGE_HEALTHGAIN then return TRUE end -- getting monster being attacked team local monster1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if monster1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end Depois, em "creaturescripts.xml" adicione a seguinte linha de código <event type="statschange" name="MonstersTeam" event="script" value="monstersTeam.lua"/> Em seguida, em todos os monstros que você adicionar ao sistema, em seu arquivo .xml, após a tag de <loot>, adicione o seguinte código <script> <event name="MonstersTeam" /> </script> Bom, é isso. Espero ter ajudado. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
- [Actions] Sistema anti-pega-e-corre (quest)
-
[Actions] Sistema anti-pega-e-corre (quest)
Boa noite. Como muitos devem saber a prática de se completar uma quest de baú e depois sair correndo (sem matar os monstros por perto) é muito comum. Com isso, decidi implementar um sistema simples de impedir que isso aconteça. Primeiramente, darei uma visão geral do que é verificado para que o player tenha sucesso na quest. O player não poderá estar a X SQM de distância do baú de quest. O player não poderá estar em uma andar diferente do baú de quest. Agora explicando o que deve ser feito. No arquivo de sua quest, cole o seguinte código -- this table will store the players who are on delay to have their quest completed (successfully or not) playersCompletingQuests = {} local checkingEventDelay = 250 local checkingEventTimes = 60 local maxDistanceToBeCompleted = 7 -- SQM function getDistance (pos1, pos2) -- get distance between two positions (using tibia formula) local difX = pos1.x - pos2.x local difY = pos1.y - pos2.y local difZ = pos1.z - pos2.z -- math.abs() of difs if difX < 0 then difX = -difX end if difY < 0 then difY = -difY end if difZ < 0 then difZ = -difZ end -- using tibia formula local maxDif = difX if maxDif < difY then maxDif = difY end if maxDif < difZ then maxDif = difZ end -- return the result return maxDif end -- To be completed, it's essential that player stays nearby the chest AND at the same floor. function canBeCompleted(cid, item, topos) -- checks if player respected the delay and distance -- check if player is on-line or if it died during the delay time if not isPlayer(cid) then return false end -- store player position in a variable local playerPos = getCreaturePosition(cid) -- check if the distance between player and chest is below the maximum allowed if getDistance(playerPos, topos) > maxDistanceToBeCompleted then return false end -- check same floor condition if playerPos.z ~= topos.z then return false end -- reach here means the player can receive its awards return true end function completeQuest(cid, item, topos) --Event will call this -- remove the player from playersCompletingQuests playersCompletingQuests[cid] = nil -- give player it's awards!!! --double checking if the player hasn't done the quest yet if not questAlreadyCompleted(cid, item) then doCreatureSay(cid, "COMPLETEI UMA QUEST!!", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid,22,"Voce completou a quest, parabens!") -- AQUI VOCÊ IMPLEMENTARÁ A PARTE DE ENTREGAR O PRÊMIO AO PLAYER -- AQUI VOCÊ IMPLEMENTARÁ A PARTE DE ACRESCENTAR A STORAGE AO PLAYER else doPlayerSendTextMessage(cid,22,"Voce ja completou essa quest.") end end function checkingEvent(cid, item, topos, checkingsLeft) if checkingsLeft <= 0 then completeQuest(cid, item, topos) else if canBeCompleted(cid, item, topos) then doCreatureSay(cid, checkingsLeft, TALKTYPE_ORANGE_1) addEvent(checkingEvent, checkingEventDelay, cid, item, topos, checkingsLeft-1) else -- cannot be completed if isPlayer(cid) then -- is player online? doCreatureSay(cid, "fail", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid,22,"Voce falhou em completar a quest. tente novamente!") end -- remove the player from playersCompletingQuests playersCompletingQuests[cid] = nil end end end function questAlreadyCompleted(cid, item) local queststatus = getPlayerStorageValue(cid,STORAGE_NUMBER) -- COLOQUE O STORAGE NUMBER DA QUEST AQUI!!!!!! if queststatus == -1 then return false else return true end end function isOnAnotherQuest(cid) if playersCompletingQuests[cid] == true then return true else return false end end function onUse(cid, item, frompos, item2, topos) if questAlreadyCompleted(cid, item) then doPlayerSendTextMessage(cid,22,"Voce ja completou essa quest.") elseif isOnAnotherQuest(cid) then doPlayerSendTextMessage(cid,22,"Voce ja esta tentando completar uma outra quest. Aguarde!") else playersCompletingQuests[cid] = true -- player is now trying to achieve success in a quest addEvent(checkingEvent, 0, cid, item, topos, checkingEventTimes) end return true end Agora, faça as devidas mudanças, para se adaptar à sua quest, em: faça o que se pede. Agora, explicando o que pode ser configurado: checkingEventDelay representa de quanto em quanto tempo (em milissegundos) a função "checkingEvent" será chamada. checkingEventTimes representa quantas vezes a função "checkingEvent" será chamada. maxDistanceToBeCompleted representa qual é a distancia máxima que o player pode se distanciar do baú, para que a quest não falhe. Bom, é isso. Espero ter ajudado. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
- [Movement] Tile Trainer
-
[Movement] Tile Teleporter (random)
Boa noite novamente, agora vou postar outro script que fiz que faz com que, quando um player pisar em um tile com determinada action ID, seja teletransportado para uma lugar randômico. Primeiramente, crie um arquivo em "data\movements\scripts" chamado "tileTeleporter.lua" e copie o seguinte conteúdo para dentro dele local teleportPoints = { [ 0] = {x = 210, y = 190, z = 7}, [ 1] = {x = 233, y = 196, z = 7}, [ 2] = {x = 243, y = 188, z = 7}, [ 3] = {x = 254, y = 180, z = 7}, [ 4] = {x = 231, y = 160, z = 7}, [ 5] = {x = 212, y = 158, z = 7}, [ 6] = {x = 212, y = 170, z = 7}, [ 7] = {x = 227, y = 171, z = 7}, [ 8] = {x = 266, y = 149, z = 7}, [ 9] = {x = 234, y = 140, z = 7}, [10] = {x = 205, y = 143, z = 7}, [11] = {x = 177, y = 126, z = 7}, [12] = {x = 290, y = 177, z = 6}, [13] = {x = 219, y = 185, z = 6}, [14] = {x = 261, y = 167, z = 6}, [15] = {x = 270, y = 167, z = 8} } function onStepIn(cid, item, position) if isPlayer(cid) then local position = teleportPoints[math.random(0,15)] doTeleportThing(cid, position) end return true end agora, em "movements.xml" cole a seguinte linha de código <movevent type="StepIn" actionid="8586" script="tileTeleporter.lua"/> Bom, é isso. Acho que não precisa explicar, está bem fácil de entender e alterar o código. Espero ter ajudado. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
-
[Movement] Tile Trainer
Outro script que fiz e estou disponibilizando: Tile Trainer O que ele faz? Enquanto o player estiver em um tile que possui determinada action id, ele vai ficar treinando suas habilidades. Primeiro, em "movements\scripts" crie um arquivo chamado "skill.lua". Feito isso, coloque em seu conteúdo o seguinte texto: local delay = 200 local FIST = 0 local CLUB = 1 local SWORD = 2 local AXE = 3 local DISTANCE = 4 local SHIELDING = 5 local FISHING = 6 function samePos(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true else return false end end function addSkillFunction(cid, item, position) if not isPlayer(cid) == TRUE then return FALSE end local playerPos = getCreaturePosition(cid) if not samePos(position,playerPos) then return FALSE end if (isKnight(cid) == TRUE) then doPlayerAddSkillTry(cid, FIST, 1) doPlayerAddSkillTry(cid, CLUB, 1) doPlayerAddSkillTry(cid, SWORD, 1) doPlayerAddSkillTry(cid, AXE, 1) doPlayerAddSkillTry(cid, SHIELDING, 1) doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) doSendMagicEffect(position, 2) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end if (isPaladin(cid) == TRUE) then doPlayerAddSkillTry(cid, DISTANCE, 1) doPlayerAddSkillTry(cid, SHIELDING, 1) doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) doSendMagicEffect(position, 5) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end if (isSorcerer(cid) == TRUE or isDruid(cid)) then doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end return FALSE end function onStepIn(cid, item, position) if isPlayer(cid) then local playerPos = getCreaturePosition(cid) addEvent(addSkillFunction,delay,cid, item, position) doPlayerSendTextMessage(cid, 25, "TREINANDO") end return true end depois, em "movements.xml" adicione a seguinte linha: <movevent type="StepIn" actionid="8585" script="skill.lua"/> Bom, é isso. Acho que não precisa explicar, está bem fácil de entender e alterar o código. Espero ter ajudado. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
-
[CreatureEvent] Anti Fast-attack Elf Bot
Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack. Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo: -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione: <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável: local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante.... Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente. Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo. Por favor, testem e me falem o que acharam. Espero que ajude a tirar os botters de seu server. P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
- [Movements] Traning Invisivel
-
Quest Manager - organizando as suas quests.
Caro Daaniel, tentarei esclarecer suas dúvidas. Pense no "questsManager.lua" como se fosse uma classe que implemente uma interface "Quest" cuja única assinatura é "function onUse(cid, item, frompos, item2, topos)". Agora pense que cada quest seja uma classe que precise implementar a interface "Quest". Ao invés de implementar a interface "Quest" em cada uma dessas novas classes, não seria mais fácil extender a classe "questsManager.lua"? Então, é basicamente isso que o quest manager faz. Caso ainda possua dúvidas, por favor, pergunte.
-
Quest Manager - organizando as suas quests.
Créditos: 100% eu. Boa tarde, vim fazer um rápido tutorial de como se fazer um gerenciador de quests. Primeiro, crie um arquivo que lhe ajude a localizar as suas quests, exemplo: <quest recommendedLevel="80" desc="head" x="162" y="93" z="7" uniqueID="9006" storageID="40006"> <teleports> <teleport desc="city" fx="210" fy="158" fz="8" tx="146" ty="121" tz="7" /> <!-- f: from ; t: to --> <teleport desc="return" fx="161" fy="93" fz="7" tx="218" ty="176" tz="8" /><!-- f: from ; t: to --> </teleports> <prizes timeToReceive=""> <!-- anti sobe e desce --> <prize vocation="sorcerer" id="2323" count="1" experience="5250000" addon="" /> <prize vocation="druid" id="2323" count="1" experience="5250000" addon="" /> <prize vocation="paladin" id="7957" count="1" experience="5250000" addon="" /> <prize vocation="knight" id="2475" count="1" experience="5250000" addon="" /> </prizes> </quest> <quest recommendedLevel="80" desc="armor" x="153" y="103" z="7" uniqueID="9007" storageID="40007"> <teleports> <teleport desc="city" fx="210" fy="156" fz="8" tx="151" ty="106" tz="7" /> <!-- f: from ; t: to --> <teleport desc="return" fx="154" fy="103" fz="7" tx="218" ty="176" tz="8" /><!-- f: from ; t: to --> </teleports> <prizes timeToReceive=""> <!-- anti sobe e desce --> <prize vocation="sorcerer" id="8865" count="1" experience="2000000" addon="" /> <prize vocation="druid" id="8865" count="1" experience="2000000" addon="" /> <prize vocation="paladin" id="2660" count="1" experience="2000000" addon="" /> <prize vocation="knight" id="2483" count="1" experience="2000000" addon="" /> </prizes> </quest> <quest recommendedLevel="80" desc="legs" x="165" y="95" z="7" uniqueID="9008" storageID="40008"> <teleports> <teleport desc="city" fx="210" fy="154" fz="8" tx="176" ty="98" tz="5" /> <!-- f: from ; t: to --> <teleport desc="return" fx="167" fy="95" fz="7" tx="218" ty="176" tz="8" /><!-- f: from ; t: to --> </teleports> <prizes timeToReceive=""> <!-- anti sobe e desce --> <prize vocation="sorcerer" id="5918" count="1" experience="3000000" addon="" /> <prize vocation="druid" id="5918" count="1" experience="3000000" addon="" /> <prize vocation="paladin" id="8923" count="1" experience="3000000" addon="" /> <prize vocation="knight" id="2470" count="1" experience="3000000" addon="" /> </prizes> </quest> </quests> Em seguida, crie um arquivo chamado questsManager.lua na pasta "actions\scripts\quests" dentro deste arquivo, insira as constantes local V_S = 1 -- voc sorcerer local V_D = 2 -- voc druid local V_P = 3 -- voc paladin local V_K = 4 -- voc knight Insira também uma tabela que cotenha todas as quests, com os seus respectivos storages local allQuests = { -- quest UID with its STORAGE [7500] = 25001, [8000] = 30000, [8001] = 30001, [8002] = 30002, [8003] = 30003, [8004] = 30004, [8005] = 30005 } novamente, crie uma outra tabela que conterá um item de recompensa local setItemReward = { -- set piece reward or another item [7500] = {[V_S] = 2175, [V_D] = 2175, [V_P] = 2175, [V_K] = 2175}, [8000] = {[V_S] = nil, [V_D] = nil, [V_P] = nil, [V_K] = nil}, [8001] = {[V_S] = nil, [V_D] = nil, [V_P] = nil, [V_K] = nil}, [8002] = {[V_S] = nil, [V_D] = nil, [V_P] = nil, [V_K] = nil}, [8003] = {[V_S] = nil, [V_D] = nil, [V_P] = nil, [V_K] = nil}, [8004] = {[V_S] = nil, [V_D] = nil, [V_P] = nil, [V_K] = nil}, [8005] = {[V_S] = nil, [V_D] = nil, [V_P] = nil, [V_K] = nil} } e outra, para a recompensa de experiência local expReward = { -- set the amount of exp that player will gain [7500] = 50000, [8000] = 300000, [8001] = 300000, [8002] = 300000, [8003] = 300000, [8004] = 150000, [8005] = 750000 } e finalmente, outra para a recompensa de gold local platCoinsReward = { -- set money reward [7500] = 0, [8000] = 5, [8001] = 5, [8002] = 5, [8003] = 5, [8004] = 1, [8005] = 5 } agora, ainda em questsManager.lua, insira uma função para verificar se a determinada quest já foi completada function questAlreadyCompleted(cid, item) local queststatus = getPlayerStorageValue(cid,allQuests[item.uid]) if queststatus == -1 then return false else return true end end logo após a função acima, insira a função principal function onUse(cid, item, frompos, item2, topos) if not questAlreadyCompleted(cid, item) then -- getting player vocation local vocation = nil if isSorcerer(cid) then vocation = V_S end if isDruid(cid) then vocation = V_D end if isPaladin(cid) then vocation = V_P end if isKnight(cid) then vocation = V_K end -- adding rewards -- set item reward local setItemReward = setItemReward[item.uid][vocation] -- experience reward local experienceReward = expReward[item.uid] -- platinum coins reward local quantityOfPlatinumCoinsReward = platCoinsReward[item.uid] -- addon reward local addonReward = addonReward[item.uid] if setItemReward ~= nil then doPlayerAddItem(cid,setItemReward,1) end if experienceReward ~= nil and experienceReward > 0 then doPlayerAddExp(cid, experienceReward) end if quantityOfPlatinumCoinsReward ~= nil and quantityOfPlatinumCoinsReward> 0 then doPlayerAddItem(cid,2152,1) end setPlayerStorageValue(cid,allQuests[item.uid],1) else doPlayerSendTextMessage(cid,22,"Voce ja completou essa quest.") end end Agora, em "data\actions", abra o arquivo "actions.xml" e adicione a seguinte linha de código <action uniqueid="7500; 8000-8005" event="script" value="quests/questsManager.lua"/> Bom, é isso.
-
[Resolvido] Anti fast attack dos bots
Obrigado. É que desenvolvi um aqui. Assim que eu fechar o meu server estarei disponibilizando para vocês.
-
[Resolvido] Anti fast attack dos bots
Versão 8.60
-
[Resolvido] Anti fast attack dos bots
Alguém possui um sistema para barrar o fast attack dos botters? Obrigado.