Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 01/11/11 em todas áreas

  1. masterzs

    [Movement] Portrait System

    Se ouver algum erro no topico Por Favor me avise é meu primeiro topico. Olá hoje postarei o movement Portrait System! Muito util para servidores de poketibia. Descrição Do Movement: É um movement que ele quando usa pokeball do pokemon exato ele aparece a foto dele... Nome:Portrait System Versão:8.54 Testado em: [8.54]Pokeserver Tfs 0.3.6 [V4.1] Versão 4.0, Bugs Corrigidos Movement: Crie um arquivo lua chamado Portrait na pasta movements/scripts e ponha isso: Na parte : local idballs = { [2532] = "Pokeball", [2653] = "Superball", [2652] = "Greatball", [2654] = "Ultraball", [2195] = "Masterball", [2531] = "Pokeball", [2557] = "Superball", [2524] = "Greatball", [2525] = "Ultraball", [2523] = "Masterball", } Significa: [2532] = "Pokeball", = Ball Acesa [2531] = "Pokeball", = Ball Apagada E Vai... Em movements.xml ponha isso: Você tambêm prescisara da items.otb que o link esta abaixo dessa frase.Muito importante usar ela POIS se não ira bugar o portrait... Portrait System Creditos: 60% Para quem fez o script : YahooABC. 40% para min por organizar o topico configurar o script e configurar a items.otb.
    2 pontos
  2. Tryller

    Arrumando Bug Dos Npcs

    >.< + 1 Ripper omg Isos é credito da OpenTibia SVN, você só deu ctrl + c e v da source do TFS u.u Você não fez nada além de dar ctrl c + v e postar aqui, coloque os créditos, vou reportar para a moderação edit: link http://otland.net/subversion.php?svn=public&file=filedetails.php&repname=forgottenserver&path=%2Ftags%2F0.2.9%2Fnpc.cpp
    2 pontos
  3. (8.60) mysql serv. :withstupidsmiley: rep+ por mim restaurar esse belo trabalho. |!buyvip uniqueid 13700 Ot igual ao 8.40 de bekman que atualizei para 8.60 e agora com armas vip. tah mto legal baixem ae. xtreme wand xtreme sword xtreme axe xtreme arrow xtreme bow InvaSOES POR COMANDO /mr. punish /dracola /massacre /handmaiden /orshabaal /demodras /necropharus /the old widow /zarabustor /xenia /yalchal /ferumbras /morgaroth /ghazbaran Cidades: ____________________ * Carlin * AB'Dendriel * Kazordoon * Port Hope * Edron * Ankrahmun * Venore * New Island * Svargrond * Ilha Dos Eventos * Thais * Yalahar ____________________ Quest's: ____________________ * Banshee Quest -- (LV 60) * Demon Helmet -- (LV 100) * Anihilator -- (LV 100) * Ancient Helmet -- (LV 100) * DSM -- (LV 95) * Demona Quest -- (LV 80) * RH -- (LV 30) * Behe Quest -- (LV 80) * Ring of the sky -- (LV 85) * Bright Sowrd -- (LV 45) * Banshee Quest -- (LV 60) * Crown Legs -- (LV 8) * Blue <> BOH <> SS -- (LV 60) * Warlock Quest -- (LV 70) * Knight Armor -- (LV 8) * Teddy Bear -- (LV 135) * Mms and Giant Sword -- (LV 100) * Fire Sowrd -- (LV 20) * Warrior Helmet -- (LV 8) * 4 Itens Raros -- (LV 210) <> Crystal Arrow <> Gold Ring <> Dragon Scale Legs <> Great Shield * 4 Itens Raros -- (LV 220) <> Magic Plate Armor <> Great Axe <> Horned Helmet <> Golden Boots * POI (Pits of Inferno) -- (LV 100) Descrição breve: A melhor quest do serv a mais demorada a mais aventurada a melhor =D. <> Avenger <> 100 platinum coins <> Frozen Starlight <> Boots of Waterwalking <> Stuffed Dragon <> Sprite Wand <> Arbalest * The Inquisition Quest. -- (LV 100) <> Royal Crossbow <> Warsinger Bow <> Spellbook of Dark Mysteries <> Emerald Sword <> Hellforged Axe <> Obsidian Truncheon <> Master Archer's Armor <> Fireborn Giant Armor <> Robe of The Underworld Credito: Natan beckman (90%) a mim(10%) a senha do god voce poem no sql studio. link para download: http://www.4shared.c...lobal_full.html :XTibia_smile: Nao sou obrigado a postar scans malz. Net lerda Para o bug das potions é só baixar este arquivo e por em scripts actions substituindo a que ja tem la >link > http://www.4shared.c...nE/Potions.html em actions.xml: <!-- Potions --> <action itemid="7439" script="liquids/berserk_potion.lua"/> <action itemid="7440" script="liquids/mastermind_potion.lua"/> <action itemid="7443" script="liquids/bullseye_potion.lua"/> <action itemid="7588" script="liquids/strong_health.lua" allowfaruse="1"/> <action itemid="7589" script="liquids/strong_mana.lua" allowfaruse="1"/> <action itemid="7590" script="liquids/great_mana.lua" allowfaruse="1"/> <action itemid="2281" script="liquids/mana rune.lua" allowfaruse="1"/> <action itemid="7591" script="liquids/great_health.lua" allowfaruse="1"/> <action itemid="8472" script="liquids/great_spirit.lua" allowfaruse="1"/> <action itemid="8473" script="liquids/ultimate_health.lua" allowfaruse="1"/> <action itemid="7618" script="liquids/health_potion.lua" allowfaruse="1"/> <action itemid="7620" script="liquids/mana_potion.lua" allowfaruse="1"/> <action itemid="8704" script="liquids/small_health.lua" allowfaruse="1"/> <action itemid="8474" script="liquids/antidote_potion.lua" allowfaruse="1"/> REP + AE E COMENTEM OQUE ACHRAM OU OQUE FLTA MUDAR.
    1 ponto
  4. E ae galera tudo bem, estamos ai com um Script muito bom de um novo Dinheiro em seu OT, para fazer esse Script eu fui lendo uns tutoriais e juntando, mas não vou esquecer de botar os créditos, e pessoal vocês podem copiar meu tutorial mais botem créditos fazendo favor. Script com Tutorial Logo Abaixo: Para começar abre a pasta data/action/scripts procure pelo o arquivo crystal.lua , depois abram ela apague tudo que esta lá e cole isso, e salve. Traduzindo: Vermelho: É o id da crystal coin, e a quantidade a ser trocada por 1 pepita de ouro. Azul: É o id da pepita de ouro, e a quantidade de pepita de ouro. Depois disso copie e cole um arquivo qualquer .lua, abra ele como bloco de notas e apague tudo que estiver dentro e cole isso, e salve com o nome Pepita de Ouro Traduzindo: Laranja: É o que vai dizer quando o player trocar 1 pepita de ouro por 100 crystal coins. Verde: É o id da crystal coin, e a quantidade equivalente a 1 pepita de ouro. Depois disso abra data/actions/actions.xml , pule uma linha qualquer e cole isso, e salve. Traduzindo: Rosa: É o id da pepita de ouro. Azul: O nome do arquivo .lua que salvou. Depois disso abra data/items/items.xml , aperte CTRL + F , e digite 2157 , ai você vai acha o item Golden Nugget que vai estar assim. Mas nós não queremos ele assim, subistitua ele por isso, e salve. Traduzindo: Vermelho: Peso do item Azul: Valor do item (como 1 crystal coin = 10k , 1 pepita de ouro = 1kk) Depois disso vá data/actions/scripts/other e abra o arquivo changegold.lua , susbistitua tudo oque está la dentro por esse script a seguir, e salve. Traduzindo: Vermelho: É o id da pepita de ouro. Depois abra data/actions/actions.xml , pule uma linha qualquer e cole isso, e salve. Traduzindo: Azul: É o id da pepita de ouro. Verde: O nome do arquivo que você salvou. E pronto seu novo dinheiro estará funcionando perfeitamente, eu testei em meu OT 8.60 e deu 100% Certo. Obrigado pela Atenção. Créditos para @maximusot por uma parte do tutorial e também a @tavax pelo script de changegold.
    1 ponto
  5. MatheusGlad

    [Systems] Pokemon Systems

    Scripts para TFS 0.3.6pl1 NAO FOI TESTADO EM OUTRA! Preview: Antes de tudo, va na pasta data/lib e adicione um script.lua com o nome de pokeLib e adicione isso: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- pokein, pokeout = 2222,2223 function doRemoveTile(pos)-- Script by mock pos.stackpos = 0 local sqm = getTileThingByPos(pos) doRemoveItem(sqm.uid,1) end function doCreateTile(id,pos) -- By mock doAreaCombatHealth(0,0,pos,0,0,0,CONST_ME_NONE) doCreateItem(id,1,pos) end function getPosDirs(p, dir) -- By MatheusMkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function doItem(pos,a,d)-- Script by mock doCreateTile(460,pos) pos.stackpos = 0 local c = getTileThingByPos(pos) doItemSetAttribute(c.uid, "aid", a) end function getDescription(uid) for i,x in pairs(getItemDescriptions(uid)) do if i == "special" then return x end end end function findLetter(string, letter) for i = 1, #string do if string:sub(i, i) == letter then return i end end end 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 getPosDirs(p, dir) return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function canSummon(cid) local pos = getCreaturePosition(cid) local state = false for i = 1, 8 do if isWalkable(getPosDirs(getCreaturePosition(cid), i)) then state = true end end return state end function isPlayerSummon(cid, uid) if getCreatureMaster(uid) == cid then return TRUE end return FALSE end function getSummonLifes(cid) for _,x in pairs(getCreatureSummons(cid)) do return getCreatureHealth(x), getCreatureMaxHealth(x) end end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function addPokeball(cid, pokename, maxh) local s = doPlayerAddItem(cid, pokein) doItemSetAttribute(s, "poke", "This is "..pokename.."'s pokeball. HP = ["..maxh.."/"..maxh.."]") doItemSetAttribute(s, "description", "Contains a " .. pokename) end function getPokeOutLive(cid) dat = {} for slot = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(cid, slot) if isContainer(item.uid) then local items = getItemsInContainerById(item.uid, pokeout) for _, ui in pairs(items) do if getItemAttribute(ui, "poke"):sub(#getItemAttribute(ui, "poke")) == "." then table.insert(dat, ui) end end end if item.itemid == pokeout then if getItemAttribute(item.uid, "poke"):sub(#getItemAttribute(item.uid, "poke")) == "." then table.insert(dat, item.uid) end end end return dat end Go/Back Pokeball System By: MatheusMkalo Vá em data/actions/scripts e adicione um arquivo.lua com o nome de goback.lua Depois de ter feito isso, adicione o seguinte script no arquivo goback.lua: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local pokes = { ["Dragon"] = {level = 1, go = "Vai Dragon", back = "Volte Dragon."}, ["Demon"] = {level = 8, go = "Vai Demon", back = "Volte Demon."}, ["Dragon Lord"] = {level = 8, go = "Vai Dragon Lord", back = "Volte Dragon Lord."}, ["Rat"] = {level = 8, go = "Vai Rat", back = "Volte Rat."}, } local msgunica = false function onUse(cid, item, frompos, item2, topos) local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")) local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/")) if item.itemid == pokeout then if health ~= nil and health <= 0 then return doPlayerSendCancel(cid, "This pokemon is dead.") end if #getCreatureSummons(cid) >= 1 then for _,z in pairs(getCreatureSummons(cid)) do if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then doTransformItem(item.uid, pokein) if msgunica then doCreatureSay(cid, "Back, " .. getCreatureName(z), TALKTYPE_SAY) else doCreatureSay(cid, pokes[getCreatureName(z)].back, TALKTYPE_SAY) end doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]") setPlayerStorageValue(cid, 61204, 0) doSendMagicEffect(getCreaturePosition(z), 10) return doRemoveCreature(z) end end end elseif item.itemid == pokein then if getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "You can't use pokeball in Protection Zones.") end if not canSummon(cid) then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) end if getPlayerStorageValue(cid, 63215) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while surfing.") end if getPlayerStorageValue(cid, 62314) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while flying.") end if getPlayerStorageValue(cid, 59987) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while riding.") end for i,x in pairs(pokes) do if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "You already summoned a pokemon.") end if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then if getPlayerLevel(cid) >= x.level then pk = doSummonCreature(i, getThingPosition(cid)) doConvinceCreature(cid, pk) setCreatureMaxHealth(pk, tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]"))) doCreatureAddHealth(pk, maxh) doCreatureAddHealth(pk, health-maxh) doTransformItem(item.uid, pokeout) if msgunica then doCreatureSay(cid, "Go, " .. i, TALKTYPE_SAY) else doCreatureSay(cid, x.go, TALKTYPE_SAY) end doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), "."))) doSendMagicEffect(getCreaturePosition(pk), 10) setPlayerStorageValue(cid, 61204, 1) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") break else doPlayerSendCancel(cid, "Only players level "..x.level.." or higher can use this pokemon.") end end end end return TRUE end Depois, va em actions.xml e adicione a seguinte tag: <action itemid="2222;2223" event="script" value="goback.lua"/> Sendo que 2222 e 2223 são, respectivamente, o id da pokeball que ira "chamar" o pokemon, e o outro o id da pokeball que ira retirar o pokemon. (Seriam as pokebolas acesas e apagadas do PO) Agora, para evitar alguns bugs, va em data/creaturescripts/scripts e crie um arquivo.lua com o nome goback.lua e bote o seguinte script dentro: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onLogout(cid) local health,maxhealth = getSummonLifes(cid) if getPlayerStorageValue(cid, 61204) >= 1 and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 and getPlayerStorageValue(cid, 59987) <= 0 then setPlayerStorageValue(cid, 61205, health) setPlayerStorageValue(cid, 61206, maxhealth) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 62314) >= 1 then pos = getCreaturePosition(cid) for i = 1,8 do doRemoveTile(getPosDirs(getCreaturePosition(cid), i)) end doRemoveTile(getCreaturePosition(cid)) setPlayerStorageValue(cid, 61941, pos.x) setPlayerStorageValue(cid, 61942, pos.y) setPlayerStorageValue(cid, 61943, pos.z) end return TRUE end function onLogin(cid) local pokes = { ["Dragon"] = {lookType=267, speed = 1500}, ["Rat"] = {lookType=267, speed = 500}, } local pokesfly = { ["Dragon"] = {lookType = 216, speed = 500}, } local pokesride = { ["Dragon Lord"] = {lookType=4, speed = 3000}, ["Dragon"] = {lookType=4, speed = 500}, } if getPlayerStorageValue(cid, 62314) >= 1 then doCreateTile(460, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)}) doTeleportThing(cid, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)}) for i = 1,8 do doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i) end local item = getPokeOutLive(cid)[1] local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.") doSetCreatureOutfit(cid, pokesfly[tostring(a)], -1) doChangeSpeed(cid, pokesfly[tostring(a)].speed) registerCreatureEvent(cid, "PlayerPokeDeath") end if getPlayerStorageValue(cid, 63215) >= 1 then local item = getPokeOutLive(cid)[1] local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.") doSetCreatureOutfit(cid, pokes[tostring(a)], -1) doChangeSpeed(cid, pokes[tostring(a)].speed) registerCreatureEvent(cid, "PlayerPokeDeath") end if getPlayerStorageValue(cid, 59987) >= 1 then local item = getPokeOutLive(cid)[1] local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.") doSetCreatureOutfit(cid, pokesride[tostring(a)], -1) doChangeSpeed(cid, pokesride[tostring(a)].speed) registerCreatureEvent(cid, "PlayerPokeDeath") end if getPlayerStorageValue(cid, 61207) >= 1 then local item = getPokeOutLive(cid)[1] doTransformItem(item, pokein) doRemoveCondition(cid, CONDITION_OUTFIT) doItemSetAttribute(item, "poke", getItemAttribute(item, "poke"):sub(#getItemAttribute(item, "poke")) ~= "]" and getItemAttribute(item, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]" or getItemAttribute(item, "poke")) setPlayerStorageValue(cid, 61207, 0) end return TRUE end function onDeath(cid, deathList) local owner = getCreatureMaster(cid) doPlayerSendTextMessage(owner, 22, "Your pokemon died.") for slot = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(owner, slot) if isContainer(item.uid) then local items = getItemsInContainerById(item.uid, pokeout) for _, ui in pairs(items) do if getItemAttribute(ui, "poke"):sub(#getItemAttribute(ui, "poke")) == "." then local maxh = tonumber(getItemAttribute(ui, "poke"):match("/(.+)]")) doItemSetAttribute(ui, "poke", getItemAttribute(ui, "poke"):sub(1, findLetter(getItemAttribute(ui, "poke"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]") end end end if item.itemid == pokeout then if getItemAttribute(item.uid, "poke"):sub(#getItemAttribute(item.uid, "poke")) == "." then local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")) doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]") end end end doRemoveCreature(cid) setPlayerStorageValue(owner, 61207, 0) setPlayerStorageValue(owner, 61204, 0) return FALSE end Agora adicione outro arquivo.lua na pasta data/creaturescripts/scripts com o nome de playerpdeath e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onDeath(cid) local health,maxhealth = getSummonLifes(cid) if #getCreatureSummons(cid) >= 1 then setPlayerStorageValue(cid, 61205, health) setPlayerStorageValue(cid, 61206, maxhealth) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 63215) >= 1 then setPlayerStorageValue(cid, 61205, getPlayerStorageValue(cid, 61210)) setPlayerStorageValue(cid, 61206, getPlayerStorageValue(cid, 61209)) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 63215, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 62314) >= 1 then setPlayerStorageValue(cid, 61205, getPlayerStorageValue(cid, 61262)) setPlayerStorageValue(cid, 61206, getPlayerStorageValue(cid, 61263)) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 62314, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 59987) >=1 then setPlayerStorageValue(cid, 61205, getPlayerStorageValue(cid, 59988)) setPlayerStorageValue(cid, 61206, getPlayerStorageValue(cid, 59989)) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 59987, 0) setPlayerStorageValue(cid, 61207, 1) end return TRUE end Depois va em creaturescripts.xml e adicione as seguintes TAGS: <event type="death" name="PlayerPokeDeath" event="script" value="playerpdeath.lua"/> <event type="death" name="DiePoke" event="script" value="goback.lua"/> <event type="logout" name="LogoutPoke" event="script" value="goback.lua"/> <event type="login" name="LoginPoke" event="script" value="goback.lua"/> Catch Pokemon System By: MatheusMkalo Vá em data/actions/scripts e adicione um arquivo.lua com o nome de catch.lua Depois adicione o seguinte script dentro dele: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local pokes = { ["Dragon"] = {corpseid = 5973, chance = 100, health = 12200, maxhealth = 12200}, ["Dragon Lord"] = {corpseid = 5984, chance = 100, health = 12200, maxhealth = 12200}, ["Demon"] = {corpseid = 5995, chance = 100, health = 12200, maxhealth = 12200}, } local time = 4 -- Tempo para mandar as mensagens e adiciona item function onUse(cid, item, frompos, item2, topos) for i,x in pairs(pokes) do if item2.itemid == x.corpseid then doRemoveItem(item.uid, 1) doRemoveItem(item2.uid, 1) if math.random(1,100) <= x.chance then function add() local s = doPlayerAddItem(cid, pokein) doItemSetAttribute(s, "poke", "This is "..i.."'s pokeball. HP = ["..x.health.."/"..x.maxhealth.."]") doItemSetAttribute(s, "description", "Contains a " .. i) end doSendMagicEffect(topos, 24) addEvent(add, time*1000) return addEvent(doPlayerSendTextMessage, time*1000, cid, 27, "You catch a " .. i .. ".") else addEvent(doPlayerSendTextMessage, time*1000, cid, 27, "Your pokeball broke.") return doSendMagicEffect(topos, 23) end end end return TRUE end Depois adicione a seguinte TAG no actions.xml: <action itemid="2147" event="script" value="catch.lua"/> Sendo 2147, o id da sua pokebola para capturar pokemons (NAO A DE CHAMAR O POKEMON) Npc Healler By: MatheusMkalo Vá em data/npc/scripts e adicione um arquivo.lua com o seguinte script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- 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 if msgcontains(msg, 'heal') then if #getCreatureSummons(cid) >= 1 then return selfSay('Voce precisa botar seus pokemons dentro da pokebola.', cid) end for slo = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(cid, slo) if isContainer(item.uid) then local items = getItemsInContainerById(item.uid, pokeout) for i,x in pairs(items) do local maxh = tonumber(getItemAttribute(x, "poke"):match("/(.+)]")) doItemSetAttribute(x, "poke", getItemAttribute(x, "poke"):sub(1, findLetter(getItemAttribute(x, "poke"), ".")) .. " HP = ["..maxh.."/"..maxh.."]") doTransformItem(x, pokein) end local items2 = getItemsInContainerById(item.uid, pokein) for i,x in pairs(items2) do local maxh = tonumber(getItemAttribute(x, "poke"):match("/(.+)]")) doItemSetAttribute(x, "poke", getItemAttribute(x, "poke"):sub(1, findLetter(getItemAttribute(x, "poke"), ".")) .. " HP = ["..maxh.."/"..maxh.."]") end elseif item.itemid == pokeout or item.itemid == pokein then local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")) doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..maxh.."/"..maxh.."]") doTransformItem(item.uid, pokein) end end selfSay('Pronto, voce e seus pokemons estao com a life maxima.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Depois va ate a pasta data/npc e adicione um arquivo.xml e bote isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Pokemon Healer" script="pokehealer.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Ola, diga {heal} para recuperar sua vida e a vida dos seus pokemons."/> </parameters> </npc> Surf System By: MatheusMkalo Vá em data/actions/scripts e crie um arquivo.lua com o nome de surf e bote esse script dentro: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onUse(cid, item, frompos, item2, topos) local configs = { [4647] = {x = -2, y = 0}, -- 4647 é o id da borda oeste (lado esquerdo do player) [4645] = {x = 2, y = 0}, -- 4645 é o id da borda leste (lado direito do player) [4646] = {x = 0, y = 2}, -- 4646 é o id da borda sul (abaixo do player) [4644] = {x = 0, y = -2}, -- 4644 é o id da borda norte (acima do player) } local playerpos = getCreaturePosition(cid) local pokes = { ["Dragon"] = {lookType=267, speed = 1500}, ["Rat"] = {lookType=267, speed = 500}, } if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then return doPlayerSendCancel(cid, "You need a pokemon to surf.") end l = false for i,x in pairs(pokes) do if getPlayerStorageValue(cid, 63215) <= 0 and i:lower() == getCreatureName(getCreatureSummons(cid)[1]):lower() then l = true end end if not l and getPlayerStorageValue(cid, 63215) <= 0 then return doPlayerSendCancel(cid, "This pokemon can't surf.") end if getPlayerStorageValue(cid, 63215) <= 0 then doTeleportThing(cid, {x=playerpos.x+configs[item2.itemid].x, y=playerpos.y+configs[item2.itemid].y, z=playerpos.z}) setPlayerStorageValue(cid, 63215, 1) doSetCreatureOutfit(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])], -1) doCreatureSay(cid, "Let's surf, "..getCreatureName(getCreatureSummons(cid)[1]), 1) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doChangeSpeed(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])].speed) doRemoveCreature(getCreatureSummons(cid)[1]) else doTeleportThing(cid, {x=playerpos.x-configs[item2.itemid].x, y=playerpos.y-configs[item2.itemid].y, z=playerpos.z}) setPlayerStorageValue(cid, 63215, 0) doRemoveCondition(cid, CONDITION_OUTFIT) local item = getPokeOutLive(cid)[1] doCreatureSay(cid, "Im tired of surf, " .. getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1) pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid)) doConvinceCreature(cid, pk) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 61209)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61209)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61210)-getPlayerStorageValue(cid, 61209)) doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid)) end return TRUE end Depois va em actions.xml e adicione essa tag: <action itemid="4647;4645;4646;4644" event="script" value="surf.lua"/> Ensinarei nos tutorias como adicionar novas bordas e botar cada pokemon com seu proprio outfit na agua. OBS:Todos os scripts mudaram para implementar o surf, atualize-os OBS2: Para funcionar o id da agua tem que ser 4820. Para usar basta clicar na borda da agua. Evolution System By: MatheusMkalo Vá em data/actions/scripts e adicione um script.lua com o nome de evolution.lua e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local pokes = { ["Dragon"] = {level = 1, evolution = "Dragon Lord", maxh = 2000}, } local types = { ["Water"] = {itemid = 2277, "Horsea", "Goldeen", "Magikarp"}, ["Venom"] = {itemid = 2278, "Zubat", "Ekans"}, ["Thunder"] = {itemid = 2279, "Magnemite", "Pikachu"}, ["Rock"] = {itemid = 2280, "Geodude", "Graveler"}, ["Punch"] = {itemid = 2281, "Machop", "Machoke"}, ["Leaf"] = {itemid = 2276, "Ivysaur"}, ["Fire"] = {itemid = 2283, "Charmander", "Charmeleon", "Dragon"}, ["Coccon"] = {itemid = 2284, "Caterpie", "Metapod"}, ["Crystal"] = {itemid = 2285, "Dratini", "Dragonair"}, ["Darkness"] = {itemid = 2286, "Gastly", "Haunter"}, ["Earth"] = {itemid = 2287, "Cubone"}, ["Enigma"] = {itemid = 2288, "Abra", "Kadabra"}, ["Heart"] = {itemid = 2289, "Rattata", "Pidgey"}, ["Ice"] = {itemid = 2290, "Seel"}, } function onUse(cid, item, frompos, item2, topos) for i,x in pairs(types) do if item.itemid == x.itemid then if isCreature(item2.uid) then if isPlayerSummon(cid, item2.uid) then if table.find(x, getCreatureName(item2.uid)) then if getPlayerLevel(cid) >= pokes[getCreatureName(item2.uid)].level then local pokeball = getPokeOutLive(cid)[1] local slo = pokes[getCreatureName(item2.uid)].maxh local sle = pokes[getCreatureName(item2.uid)].evolution doItemSetAttribute(pokeball, "description", "Contains a " .. pokes[getCreatureName(item2.uid)].evolution) doPlayerSendTextMessage(cid, 27, "Your "..getCreatureName(item2.uid).." evolued to a "..pokes[getCreatureName(item2.uid)].evolution) doSendMagicEffect(topos, 18) doItemSetAttribute(pokeball, "poke", "") doItemSetAttribute(pokeball, "poke", "This is "..pokes[getCreatureName(item2.uid)].evolution.."'s pokeball. HP = ["..pokes[getCreatureName(item2.uid)].maxh.."/"..pokes[getCreatureName(item2.uid)].maxh.."]") doRemoveCreature(item2.uid) local pk = doSummonCreature(sle, topos) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") doConvinceCreature(cid, pk) setCreatureMaxHealth(pk, slo) setPlayerStorageValue(cid, 61204, 1) doCreatureAddHealth(pk, slo) doRemoveItem(item.uid, 1) break else return doPlayerSendCancel(cid, "You need to be level "..pokes[getCreatureName(item2.uid)].level.." or higher to use this stone in this pokemon.") end end end end end end return TRUE end Depois vá em actions.xml e adicione esta tag: <action itemid="2276;2277;2278;2279;2280;2281;2283;2284;2285;2286;2287;2288;2289;2290" event="script" value="evolution.lua" allowfaruse="1"/> Fly System By: MatheusMkalo, Credits: Mock Vá em data/talkactions/scripts e adicione um arquivo.lua com o nome de fly e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon Systems by Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon Systems by Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onSay(cid, words, param) local pokes = { ["Dragon"] = {lookType = 216, speed = 500}, } if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 then doPlayerSendCancel(cid, "You need a pokemon to fly.") end if getPlayerStorageValue(cid, 62314) <= 0 and not pokes[getCreatureName(getCreatureSummons(cid)[1])] then return doPlayerSendCancel(cid, "This pokemon can't fly.") end if getPlayerStorageValue(cid, 62314) <= 0 then doSetCreatureOutfit(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])], -1) doChangeSpeed(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])].speed) setPlayerStorageValue(cid, 61263, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61262, getCreatureHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 62314, 1) registerCreatureEvent(cid, "LogoutPoke") doCreatureSay(cid, "Let's fly, "..getCreatureName(getCreatureSummons(cid)[1]), 1) doRemoveCreature(getCreatureSummons(cid)[1]) local ppos = getCreaturePos(cid) local newpos = {x=ppos.x, y=ppos.y, z = 0} doCreateTile(460, newpos) doTeleportThing(cid, newpos) for i = 1,8 do doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i) end elseif getPlayerStorageValue(cid, 62314) >= 1 then local ppos = getCreaturePosition(cid) p = true for i = 1,17 do if getTileThingByPos({x=ppos.x, y=ppos.y, z=ppos.z+i}).itemid ~= 0 and not isWalkable({x=ppos.x, y=ppos.y, z=ppos.z+i}) then p = false break end if isWalkable({x=ppos.x, y=ppos.y, z=ppos.z+i}) then l = ppos.z + i break end end if not p or getTileThingByPos({x=ppos.x, y=ppos.y, z=l}).itemid == 4820 then return doPlayerSendCancel(cid, "You can't down in there.") end for i = 1,8 do doRemoveTile(getPosDirs(getCreaturePosition(cid), i)) end setPlayerStorageValue(cid, 62314, 0) doTeleportThing(cid, {x=ppos.x, y=ppos.y, z=l}) doRemoveTile(ppos) local item = getPokeOutLive(cid)[1] pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid)) doConvinceCreature(cid, pk) doCreatureSay(cid, "I'm tired of fly, "..getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 61263)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61263)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61262)-getPlayerStorageValue(cid, 61263)) doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) end return TRUE end Depois bote essa tag no talkaction.xml: <talkaction words="!fly" event="script" value="fly.lua"/> Va em data/movements/scripts e crie um arquivo.lua com o nome de fly.lua e bote: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon Systems by Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon Systems by Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onStepIn(cid, item, position, fromPosition) local actions = { [65120] = {del = {4,5,6}, add = {1,2,8}}, [65121] = {del = {8,7,6,5,4}, add = {8,1,2,3,4}}, [65122] = {del = {8,7,6}, add = {2,3,4}}, [65123] = {del = {2,1,8,7,6}, add = {6,5,4,3,2}}, [65124] = {del = {2,1,8}, add = {4,5,6}}, [65125] = {del = {8,1,2,3,4}, add = {8,7,6,5,4}}, [65126] = {del = {2,3,4}, add = {8,7,6}}, [65127] = {del = {6,5,4,3,2}, add = {6,7,8,1,2}}, } local configs = actions[item.actionid] for i = 1,8 do if table.find(configs.del, i) then doRemoveTile(getPosDirs(fromPosition, i)) end doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i) end return TRUE end Depois va em movements.xml e adicione essa tag: <movevent type="StepIn" actionid="65120;65121;65122;65123;65124;65125;65126;65127" event="script" value="fly.lua"/> Para usar o fly diga !fly para descer e subir Ride System By: MatheusMkalo Vá em talkactions/scripts e crie um arquivo.lua com o nome de ride e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon Systems by Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon Systems by Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onSay(cid, words) local pokesride = { ["Dragon Lord"] = {lookType=4, speed = 3000}, ["Dragon"] = {lookType=4, speed = 500}, } if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 59987) <= 0 then return doPlayerSendCancel(cid, "You need a pokemon to ride.") end if not canSummon(cid) and getPlayerStorageValue(cid, 59987) >= 1 then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) end local sname = #getCreatureSummons(cid) >= 1 and getCreatureName(getCreatureSummons(cid)[1]) or nil if sname ~= nil and pokesride[sname] and getPlayerStorageValue(cid, 59987) <= 0 then doSetCreatureOutfit(cid, pokesride[sname], -1) doChangeSpeed(cid, pokesride[sname].speed) doCreatureSay(cid, "Let's ride, " .. sname, 1) setPlayerStorageValue(cid, 59987, 1) setPlayerStorageValue(cid, 59988, getCreatureHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 59989, getCreatureMaxHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) elseif getPlayerStorageValue(cid, 59987) >= 1 then setPlayerStorageValue(cid, 59987, 0) doRemoveCondition(cid, CONDITION_OUTFIT) local item = getPokeOutLive(cid)[1] doCreatureSay(cid, "Im tired of ride, " .. getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1) pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid)) doConvinceCreature(cid, pk) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 59989)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 59989)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 59988)-getPlayerStorageValue(cid, 59989)) doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid)) end return TRUE end Agora bote essa tag em talkactions.xml: <talkaction words="!ride" event="script" value="ride.lua"/> Pra usar o ride é so falar !ride. Para configurar os pokemons é praticamente igual ao surf. Configurando os scripts Como adicionar mais pokemons no go/back: No inicio do script, tem essa tabela com as informaçoes: Copie a ultima linha (vermelha) e cole logo abaixo, editando os nomes e as mensagens ficando assim: Voce pode configurar o level para usar o poke mudando o valor de level. Configurando pokemons para o catch:[/b] Olhe a tabela no inicio do script: Faça o mesmo processo do acima de copiar e colar embaixo e editar: Aonde as informaçoes corpseid, chance, health, maxhealth serao, respectivamente: Id do corpo do monstro, Chance de capturar em %, health que o pokemon iria ir pro player, e health maxima que o poke iria ir para o player. Como trocar os ids das pokebolas, acesas e apagadas. Para trocar o id da pokebola "acesa" e "apagada" basta mudar os ids 2222,2223 na lib sendo que 2222 eh o da acesa e o 2223 eh o id da apagada Mude tambem na tag do action.xml que seu script ira funcionar perfeitamente. Como adicionar mais bordas ao surf. Primeiramente va em actions.xml e adicione os ids das bordas na tag do surf: (Eu fiz com a borda de areia) Depois va no script surf.lua em actions e repare nessa parte: Copie todas as 4 bordas e cole abaixo ficando: Depois mude os ids das bordas do lado << conforme as informaçoes do lado >>, ficando: Como adicionar mais pokes ao surf: Va no script surf.lua em actions e repare nessa parte: Ai voce pode adicionar o pokemon pra surf e o outfit que ele vai te dar na agua copiando o de cima e colando logo abaixo e editando algumas coisas: Lembre-se de depois que acabar de editar toda a tabela no surf.lua, va no goback.lua em creaturescripts e substitua a tabela pokes, pela que esta na actions surf.lua: Como adicionar mais pokes no evolution: Repare nessa parte do script evolution.lua em actions: Bem voce deve copiar o primeiro monstro da tabela "pokes", e adicionar no final e mudar as configuraçoes: Sendo level,evolution,maxh respectivamente, o level pra evoluir o poke, o nome da evoluçao, e a health maxima do pokemon evoluido. Depois eh so adicionar o Nome do monstro que foi adicionado a tabela "pokes" na tabela "types", no lugar do type dele: Como adicionar mais pokes no fly: Repare nas partes iguais no fly.lua (talkaction) e no goback.lua(creaturescripts): fly.lua: goback.lua: A unica coisa que mudou foi o nome da tabela, "pokes" e "pokesfly", para adicionar mais pokes no fly basta adicionar no fly.lua e botar igual no goback.lua. Informaçoes Importantes!!! Para testar o script de catch que esta no topico, voce deve deletar as tags de encantamento de armas. Para poder summonar os pokemons com o go/back, voce precisa ir no arquivo.xml do monstro e editar essa linha: Se estiver convinceable="0", mude para convinceable="1" ficando: Creditos Especiais: Kydrai pela funçao "getItemsInContainerById" MarcelloMkez Mock por algumas funçoes do fly system dele. Agradecimentos: D3rs00n (Me ajudou a fazer sumir o corpo do pokemon) Julio Cezar (Ajudou reportando bugs e testando scripts) Miih (Ajudou reportando bugs e testando scripts) Arth3miS (Ajudou reportando bugs e testando scripts) E para todos que reportaram bugs. Bugs, erros, duvidas, elogios no topico[/b]
    1 ponto
  6. Tryller

    [Mysql] The Brazilian Server V0.1.4

    The Brazilian Server Este servidor é 100% baseado no OpenTibia SVN, ou sejá, este server não possui uma versão SQLite, este server não possui Accout Manager, ou seja... este server é apenas pra quem sabe mexer com xampp e website. Eu disponibilizarei aqui um Nicaw Website compativel com este servidor. Imagens http://img23.imageshack.us/gal.php?g=86807852.jpg [ CHANGELOG Project Name The Brazilian Server Version 0.1.4 License GNU GPLv2 ] [ Legenda A = Adicionado M = Modificado D = Deletado C = Corrigido ] [ v0.1.4 [ Updates M = Brazilian.exe M = data/global.lua M = data/talkactions/scrupts/reload.lua M = Arquivo de configuração (config.lua) M = data/npc/scripts/promotion.lua M = pasta game_classes M = data/npc/scripts/promotion.lua ] [ Charges A = Compatibilidade com script da quest Demon Oak (Tryller) A = Novas funções lua - doPlayerSetStorageValue(cid, key[, value]) e doCreateMonster(name, pos[, displayError = true]) (Tryller, TFS) M = alguns scripts (Tryller) M = Pasta "game_classes" foi renomeada para "classes" (Tryller) C = Erro em Global Save (Tryller) C = AutoSave de emergência (Tryller) C = Bug do NPC de promotion (Tryller) C = Npc da promotion (Tryller) ] ] [ v0.1.3 [ Updates Brazilian.exe data/global.lua data/XML/mounts.xml config.lua data/XML/motd.xml data/actions/scripts/liquids data/actions/actions/scripts/others/furniture_beds.lua data/npc/seller.xml, data/npc/perac.xml e data/npc/obi.xml data/talkactions/lib/talkactions.lua data/talkactions/scripts/createitembyname.lua ] [ Charges Adicionados mais NPC's Adicionado novas funções lua - getCreatureCondition(cid, conditionType, <optional: default: 0> subId, <optional: default: CONDITIONID_DEFAULT> conditionId) e getCreatureConditionInfo(cid, conditionType, <optional: default: 0> subId, <optional: default: CONDITIONID_DEFAULT> conditionId) (OpenTibia SVN) Adicionado attackSpeed para mounts (Tryller) Adicionado novo sistema de MOTD (Tryller, TFS) Corrigido monsterSpawnBack (OpenTibia SVN, Tryller) Corrigido reloads para outfits e mounts (OpenTibia SVN, Tryller) Corrigido exhausted bug (OpenTibia SVN, Tryller) Corrigido feetDamate e allowChangeOutfit (Tryller) Atualizações OpenTibia (OpenTibia SVN, Tryller) ] ] [ v0.1.2 Adicionado sistema de clean (Tryller) Adicionado spells.xml configurado com cooldown (Erimyth) Adicionado novos reloads, stages, vocations, quest, all (Tryller) Adicionado items 8.70 (OTB) (OpenTibia SVN) Adicionado comando /B (Tryller) Adicionado AOL (Tryller) Adicionado comando /skill (Tryller) Adicionado showMonstersHealing no config.lua (Tryller) Adicionado comando /newtype (Tryller) Adicionada novas funções lua doPlayerSetExtraAttackSpeed(cid, speed) - doPlayerFollowCreature(cid, target) - doPlayerSetAttackedCreature(cid, target) (Tryller) Adicionado novas configs para BLACK_SKULL, blackSkulledDeathHealth e blackSkulledDeathMana (Tryller, The Forgotten Server) Console mostrando quem entra e sai do server (Tryller) Corrigido problema de debug quando player morria (Tryller) Corrigido comando !serverinfo (Tryller) Corrigido erro em quests (Tryller) Removido Rule violation Window (Tryller, Erimyth) Atualizações OpenTibia (OpenTibia SVN, Tryller) ] [ v0.1.1 Protocolo 8.70 (OpenTibia SVN, Tryller) Adicionado comando para banir players (OpenTibia SVN) Cooldown 100% , porém não disponibilizei o spells.xml configurado (OpenTibia SVN, Tryller) Adicionada database do website (Tryller) Novo configuração para wands e rods no config.lua - wandsAndRodsInterruptSwing (OpenTibia SVN) Sistema de montaria (mount system) (OpenTibia SVN, Tryller) Spawns igual Tibia RL, configuravel no config.lua - monsterSpawnWalkBack (OpenTibia SVN, Tryller) Atualizado para a ultima revisão da OpenTibia SVN (Tryller) Soulfire spell suporte (OpenTibia SVN) Players não precisam mais ter item requerido nas mãos para conjurar (OpenTibia SVN, Tryller) Corrigidos alguns erros (Tryller) Corrigido erros no website (LucasBrahma, Tryller) ] [ v0.1.0 AutoSave nas sources configuravel no config.lua (Tryller) Configuravel sistema de cap no config.lua (Tryller) Optional pvp feature (OpenTibia SVN) Comando /invisible (OpenTibia SVN) Suporte para 8.62 (OpenTibia SVN) Suporte para items 8.62 Estabilidade perfeita (OpenTibia SVN) Muitos monstros adicionados (OpenTibia SVN) Exemplos de NPC's (OpenTibia SVN, Tryller) Sistema de compra e venda de casas (OpenTibia SVN) Suporte para waypoints (OpenTibia SVN) Sistema de Party (OpenTibia SVN) Sistema de camas (OpenTibia SVN) config.lua aceitando booleans "yes"/"no", true/false and 1/0 (OpenTibia SVN) Skull system configuravel no config.lua (OpenTibia SVN) XML files em data/XML (Tryller) Organizada pasta actions (Tryller) Server com suporte apenas para mapas OTBM (Tryller) Corrigido pequenos bugs (Tryller) Adicionado novos comandos - /pvp and /mc (Tryller) Adicionado sistema de stages (Tryller) Adicionado script para quests baseadas em uniquId (Tryller) Adicionado mapa Evolutions (Tryller) Adicionado basespeed em vocations.xml (Tryller) Numero maximos de summons configuravel no config,lua (Tryller) Server save igual Tibia global (Tryller, TFS) Adicionado 2 novos tipos de creatureevents - onThink(cid, interval), onAttack(cid, target) (Tryller) ] Download do Server http://www.speedyshare.com/files/26465402/thebrazilianserver_0.1.4.rar <-- 8.70 v0.1.4 http://www.4shared.com/file/9jCsEcRG/Brazilian_Installer_013.html <-- 8.70 v0.1.3 http://www.speedyshare.com/files/26049510/BrazilianInstaller.exe <-- 8.70 v0.1.2 http://www.speedyshare.com/files/25894175/BrazilianInstaller.exe <-- 870 v0.1.1 http://www.speedyshare.com/files/25853769/BrazilianInstaller.exe <--862 v0.1.0 Source Code - Rev 115 http://thebrazilianser.svn.sourceforge.net/viewvc/thebrazilianser/otserv/tags/ Download do Website http://thebrazilianser.svn.sourceforge.net/viewvc/thebrazilianser/website/ link alternativo: http://www.speedyshare.com/files/26587084/site.rar
    1 ponto
  7. meubk

    [Talkaction]System Moves [15/151]

    Moves System Pokemon O meu script de moves, foi atualizado, por enquanto está com esses pokemons, eu estárei adicionando os 151, aos pouco não tenha pressa e acompanhe todos dias avera atualização. Novidades : Crie um arquivo com nome de moves.lua e cole o new script : function getTime(s) local n = math.floor(s / 600) s = s - (600 * n) return n, s end function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers) local creaturesList = {} for x = -radiusx, radiusx do for y = -radiusy, radiusy do if not (x == 0 and y == 0) then creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = STACKPOS_TOP_CREATURE}) if (creature.type == 1 and showPlayers == 1) or (creature.type == 2 and showMonsters == 1) then table.insert(creaturesList, creature.uid) end end end end return creaturesList end -- CONDITIONS function Confused(inconfuse, rounds) if rounds == 0 then return false end if not inconfuse then return false end local c = {[1] = {x = 1, y = 0}, [2] = {x = 0, y = 1}, [3] = {x = -1, y = 0}, [4] = {x = 0, y = -1}} local p = getCreaturePosition(inconfuse) doSendMagicEffect(p, 31) local s = math.random(4) doTeleportThing(inconfuse, {x = p.x + c[s].x, y = p.y + c[s].y, z = p.z}) return addEvent(Confused, 400, inconfuse, rounds-1) end local paralize = createConditionObject(CONDITION_PARALYZE) setConditionParam(paralize, CONDITION_PARAM_TICKS, 5*1000) setConditionFormula(paralize, -0.7, 0, -0.8, 0) function Paralize(inparalize) doSendAnimatedText(getCreaturePosition(inparalize), "PAZ", 210) doAddCondition(inparalize , paralize) return true end local sleep = createConditionObject(CONDITION_PARALYZE) setConditionParam(sleep, CONDITION_PARAM_TICKS, 5*1000) setConditionFormula(sleep, -1.7, 0, -1.8, 0) function Sleep(insleep) doAddCondition(insleep , sleep) p = getCreaturePosition(insleep) doSendAnimatedText(p, "SLEEP", 154) for i = 1, 5 do if i == 1 then doSendMagicEffect(p, 32) else addEvent(doSendMagicEffect, i * 1000, p, 32) end end return true end function Poison(inpoison, ef, rounds) if rounds == 0 then return false end if not inpoison then return false end local p = getCreaturePosition(inpoison) doAreaCombatHealth(pet, COMBAT_EARTHDAMAGE, p, 0, -5, -10, ef) return addEvent(Poison, 800, inpoison, ef, rounds-1) end -- END CONDITIONS function getPosToStorm(posdecay) b = {x = posdecay.x-20, y = posdecay.y-20, z = posdecay.z} return b end local area1 = createCombatArea{ {0, 1, 1, 1, 0}, {1, 1, 1, 1, 1}, {1, 1, 2, 1, 1}, {1, 1, 1, 1, 1}, {0, 1, 1, 1, 0} } local area2 = createCombatArea{ {0, 0, 0, 0, 0}, {0, 1, 1, 1, 0}, {0, 1, 2, 1, 0}, {0, 1, 1, 1, 0}, {0, 0, 0, 0, 0} } local area3 = createCombatArea{ {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0} } local areadirecion1 = { [2] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {2, 1, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 1, 2}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} } } local areadirecion2 = { [2] = createCombatArea{ {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {2, 1, 1, 1, 1}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {1, 1, 1, 1, 2}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} } } local areadirecion3 = { [2] = createCombatArea{ {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 2}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0} } } local areadirecion4 = { [2] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {2, 1, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 1, 2}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0} } } local d = { ["Bulbasaur"] = { ["m1"] = {atk = "Quick Attack", minlvl = 20, st = 2000, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Razor Leaf", minlvl = 20, st = 2001, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Vine Whip", minlvl = 20, st = 2002, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Headbutt", minlvl = 20, st = 2003, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Leech Seed", minlvl = 20, st = 2004, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Solar Beam", minlvl = 20, st = 2005, cd = 3, min = 200, max = 400, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Stun Spore", minlvl = 20, st = 2006, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Poison Powder", minlvl = 20, st = 2007, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2008, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, }, ["Ivysaur"] = { ["m1"] = {atk = "Quick Attack", minlvl = 40, st = 2009, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Razor Leaf", minlvl = 40, st = 2010, cd = 3, min = 300, max = 400, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Vine Whip", minlvl = 40, st = 2011, cd = 3, min = 300, max = 440, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Headbutt", minlvl = 40, st = 2012, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Leech Seed", minlvl = 40, st = 2013, cd = 3, min =300, max = 400, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Solar Beam", minlvl = 40, st = 2014, cd = 3, min = 300, max = 400, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Stun Spore", minlvl = 40, st = 2015, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Poison Powder", minlvl = 40, st = 2016, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2017, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, }, ["Venusaur"] = { ["m1"] = {atk = "Quick Attack", minlvl = 80, st = 2018, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Razor Leaf", minlvl = 80, st = 2019, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Vine Whip", minlvl = 80, st = 2020, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Headbutt", minlvl = 80, st = 2021, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Leech Seed", minlvl = 80, st = 2022, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Solar Beam", minlvl = 80, st = 2023, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Stun Spore", minlvl = 80, st = 2024, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Poison Powder", minlvl = 80, st = 2025, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2026, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m10"] = {atk = "Leaf Storm", minlvl = 80, st = 2027, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, }, ["Charmander"] = { ["m1"] = {atk = "Scratch", minlvl = 20, st = 2028, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Ember", minlvl = 20, st = 2029, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Flamethrower", minlvl = 20, st = 2030, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Fire Ball", minlvl = 20, st = 2031, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Fire Blast", minlvl = 20, st = 2032, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Rage", minlvl = 20, st = 2033, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m7"] = {atk = "Fire Fang", minlvl = 20, st = 2034, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, }, ["Charmeleon"] = { ["m1"] = {atk = "Scratch", minlvl = 40, st = 2035, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Ember", minlvl = 40, st = 2036, cd = 3, min = 300, max = 400, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Flamethrower", minlvl = 40, st = 2037, cd = 3, min = 400, max = 500, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Fire Ball", minlvl = 40, st = 2038, cd = 3, min = 300, max =400, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Fire Blast", minlvl = 40, st = 2039, cd = 3, min = 300, max = 400, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Rage", minlvl = 40, st = 2040, cd = 3, min = 100, max = 300, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m7"] = {atk = "Fire Fang", minlvl = 40, st = 2041, cd = 3, min = 400, max = 800, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, }, ["Charizard"] = { ["m1"] = {atk = "Dragon Claw", minlvl = 80, st = 2042, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Ember", minlvl = 80, st = 2043, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Flamethrower", minlvl = 80, st = 2044, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Fire Ball", minlvl = 80, st = 2045, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Fire Blast", minlvl = 80, st = 2046, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Rage", minlvl = 80, st = 2047, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m7"] = {atk = "Magma Storm", minlvl = 80, st = 2048, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Wing Attack", minlvl = 80, st = 2049, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, }, ["Squirtle"] = { ["m1"] = {atk = "Headbutt", minlvl = 20, st = 2050, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Bubbles", minlvl = 20, st = 2051, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Water Gun", minlvl = 20, st = 2052, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Waterball", minlvl = 20, st = 2053, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Aqua Tail", minlvl = 20, st = 2054, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Hydro Cannon", minlvl = 20, st = 2055, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Harden", minlvl = 20, st = 2056, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, ["m8"] = {atk = "Surf", minlvl = 20, st = 2057, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, }, ["Wartortle"] = { ["m1"] = {atk = "Headbutt", minlvl = 40, st = 2058, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Bubbles", minlvl = 40, st = 2059, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Water Gun", minlvl = 40, st = 2060, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Waterball", minlvl = 40, st = 2061, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Aqua Tail", minlvl = 40, st = 2062, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Hydro Cannon", minlvl = 40, st = 2063, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Harden", minlvl = 40, st = 2064, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, ["m8"] = {atk = "Surf", minlvl = 40, st = 2065, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, }, ["Blastoise"] = { ["m1"] = {atk = "Headbutt", minlvl = 40, st = 2066, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Bubbles", minlvl = 40, st = 2067, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Water Gun", minlvl = 40, st = 2068, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Waterball", minlvl = 40, st = 2069, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Aqua Tail", minlvl = 40, st = 2070, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Hydro Cannon", minlvl = 40, st = 2071, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Harden", minlvl = 40, st = 2072, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, ["m8"] = {atk = "Surf", minlvl = 40, st = 2073, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Hydropump", minlvl = 40, st = 2074, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, }, ["Caterpie"] = { ["m1"] = {atk = "Headbutt", minlvl = 1, st = 2075, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 1, st = 2076, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Bug Bite", minlvl = 1, st = 2077, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, }, ["Metapod"] = { ["m1"] = {atk = "Headbutt", minlvl = 10, st = 2078, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 10, st = 2079, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Bug Bite", minlvl = 10, st = 2080, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Harden", minlvl = 10, st = 2081, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, }, ["Butterfree"] = { ["m1"] = {atk = "Headbutt", minlvl = 30, st = 2082, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Whirlwind", minlvl = 30, st = 2083, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Super Sonic", minlvl = 30, st = 2084, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Stun Spore", minlvl = 30, st = 2085, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m5"] = {atk = "Poison Powder", minlvl = 30, st = 2086, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Sleep Powder", minlvl = 30, st = 2087, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Psybeam", minlvl = 30, st = 2088, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Confusion", minlvl = 30, st = 2089, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, }, ["Weedle"] = { ["m1"] = {atk = "Horn Attack", minlvl = 1, st = 2090, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 1, st = 2091, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Poison Sting", minlvl = 1, st = 2092, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, }, ["Kakuna"] = { ["m1"] = {atk = "Bug Bite", minlvl = 10, st = 2093, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 10, st = 2094, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Poison Sting", minlvl = 10, st = 2095, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Harden", minlvl = 10, st = 2096, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = true}, }, ["Beedrill"] = { ["m1"] = {atk = "Fury Cutter", minlvl = 10, st = 2097, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 10, st = 2098, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Poison Sting", minlvl = 10, st = 2099, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Pin Missile", minlvl = 10, st = 2100, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Rage", minlvl = 10, st = 2101, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Strafe", minlvl = 10, st = 2102, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, }, } function onSay(cid, words, param) if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "You do not have any pokemon.") end local poke = d[getCreatureName(getCreatureSummons(cid)[1])][words] if not poke then return true end local storage = poke.st local exst = 16265 local cdexst = 0.5 local cd = math.ceil(poke.cd/2) local pet = getCreatureSummons(cid)[1] local target = getCreatureTarget(cid) local look = getCreatureLookDir(pet) local position = getThingPos(pet) if getTilePzInfo(getCreaturePosition(pet)) and poke.pz == false then return doPlayerSendCancel(cid, "Not Attack in protection zone.") end if getPlayerLevel(cid) < poke.minlvl then return doPlayerSendTextMessage(cid, 19, "Your need level "..poke.minlvl.." to use " ..poke.atk..".") end if os.time()-getPlayerStorageValue(cid, storage) <= cd then minutes,seconds = getTime(cd-(os.time()-getPlayerStorageValue(cid, storage))) return doPlayerSendTextMessage(cid, 27, "Wait "..seconds.." seconds to use "..poke.atk..".") end if target == 0 and poke.target then return doPlayerSendTextMessage(cid, 19, "This Pokemon Attack need any target.") end if os.time()-getPlayerStorageValue(cid, exst) <= cdexst then minutes,seconds = getTime(cdexst-(os.time()-getPlayerStorageValue(cid, exst))) return doPlayerSendCancel(cid, "Poke exhausted") end local critico = math.random(100) < 10 and 2 or 1 --ATTACKS if poke.atk == "Quick Attack" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 148) elseif poke.atk == "Razor Leaf" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 4) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 79) elseif poke.atk == "Vine Whip" then local effects = { [0] = 80, [1] = 83, [2] = 81, [3] = 82 } doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion1[look], -poke.min, -poke.max * critico, effects[look]) elseif poke.atk == "Headbutt" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 111) elseif poke.atk == "Leech Seed" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 6) doSendAnimatedText(getCreaturePosition(target), "POISON", 66) addEvent(Poison, 500, target, 45, 5) elseif poke.atk == "Solar Beam" then local a = { [0] = {x = 0, y = -1, effect={[1]=94,[2]=93,[3]=93,[4]=95}}, [1] = {x = 1, y = 0, effect={[1]=86,[2]=88,[3]=88,[4]=87}}, [2] = {x = 0, y = 1, effect={[1]=91,[2]=93,[3]=93,[4]=92}}, [3] = {x = -1, y = 0, effect={[1]=89,[2]=88,[3]=88,[4]=90}} } for i = 1,4 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Stun Spore" then local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0) for _,pid in pairs(d) do Paralize(pid) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 85) elseif poke.atk == "Poison Powder" then local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0) for _,pid in pairs(d) do doSendAnimatedText(getCreaturePosition(pid), "POISON", 66) Poison(pid, 8, 5) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 84) elseif poke.atk == "Sleep Powder" then local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0) for _,pid in pairs(d) do Sleep(pid) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 27) elseif poke.atk == "Leaf Storm" then local d = getCreaturesInRange(getThingPos(pet), 3, 3, 1, 0) for _,pid in pairs(d) do for i = 1, 4 do if i == 1 then addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(pid), 0, -poke.min, -poke.max * critico, 79) doSendDistanceShoot(getPosToStorm(getCreaturePosition(pid)), getCreaturePosition(pid), 4) else addEvent(doAreaCombatHealth, i*800 ,pet, poke.damage, getThingPos(pid), 0, -poke.min, -poke.max * critico, 79) addEvent(doSendDistanceShoot, i*600, getPosToStorm(getCreaturePosition(pid)), getCreaturePosition(pid), 4) end end end elseif poke.atk == "Scratch" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142) elseif poke.atk == "Ember" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 15) elseif poke.atk == "Flamethrower" then local effects = { [0] = 55, [1] = 58, [2] = 56, [3] = 57 } doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion1[look], -poke.min, -poke.max * critico, effects[look]) elseif poke.atk == "Fire Ball" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 3) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 5) elseif poke.atk == "Fire Blast" then local a = { [0] = {x = 0, y = -1, effect= 60}, [1] = {x = 1, y = 0, effect= 61}, [2] = {x = 0, y = 1, effect= 62}, [3] = {x = -1, y = 0, effect= 63} } for i = 1,8 do if i == 1 then doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 15) else addEvent(doSendMagicEffect, i*300, {x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) addEvent(doAreaCombatHealth, i*300, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 15) end end elseif poke.atk == "Rage" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end for i = 1,4 do if i == 1 then doSendMagicEffect(position, 168) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142) else addEvent(doAreaCombatHealth, i*500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142) end end elseif poke.atk == "Fire Fang" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 146) addEvent(doAreaCombatHealth, 200, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 15) addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 15) elseif poke.atk == "Dragon Claw" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 141) elseif poke.atk == "Magma Storm" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 36) addEvent(doAreaCombatHealth, 800, pet, poke.damage, getThingPos(pet), area1, -poke.min, -poke.max * critico, 6) elseif poke.atk == "Wing Attack" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 115) addEvent(doAreaCombatHealth, 500, pet, poke.damage, getThingPos(pet), area1, -poke.min, -poke.max * critico, 42) elseif poke.atk == "Bubbles" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 2) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68) elseif poke.atk == "Water Gun" then local a = { [0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=76}}, [1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=71}}, [2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=78}}, [3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=73}} } for i = 1,4 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Waterball" then for i = 1,5 do if i == 1 then addEvent(doAreaCombatHealth, 200 ,pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68) doSendDistanceShoot(getPosToStorm(getCreaturePosition(target)), getCreaturePosition(target), 2) else addEvent(doAreaCombatHealth, i*700 ,pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68) addEvent(doSendDistanceShoot, i*500, getPosToStorm(getCreaturePosition(target)), getCreaturePosition(target), 2) end end elseif poke.atk == "Aqua Tail" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 160) elseif poke.atk == "Hydro Cannon" then local a = { [0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[8]=76}}, [1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=71}}, [2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[4]=78}}, [3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=73}} } for i = 1,8 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Harden" then function Harden(cid, rounds) if rounds == 0 then return false end if #getCreatureSummons(cid) == 0 then return false end doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 144) return addEvent(Harden, 1000, cid, rounds-1) end addEvent(Harden, 500, cid, 40) elseif poke.atk == "Surf" then local a = { [0] = {x = 0, y = -1, effect= 66}, [1] = {x = 1, y = 0, effect= 67}, [2] = {x = 0, y = 1, effect= 64}, [3] = {x = -1, y = 0, effect= 65} } for i = 1,8 do if i == 1 then doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68) else addEvent(doSendMagicEffect, i*300, {x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) addEvent(doAreaCombatHealth, i*300, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68) end end elseif poke.atk == "Hydropump" then local a = { [0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[8]=76}}, [1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=71}}, [2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[4]=78}}, [3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=73}} } for i = 1,8 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68) addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 33) elseif poke.atk == "String Shot" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 23) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137) Paralize(target) elseif poke.atk == "Bug Bite" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 146) elseif poke.atk == "Whirlwind" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion4[look], -poke.min, -poke.max * critico, 42) elseif poke.atk == "Super Sonic" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end for i = 1, 3 do if i == 1 then doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 24) else addEvent(doSendDistanceShoot, i * 200, getCreaturePosition(pet), getCreaturePosition(target), 24) end end addEvent(doSendAnimatedText, 500, getCreaturePosition(target), "CONF", 210) addEvent(Confused, 500, target, 15) elseif poke.atk == "Psybeam" then local a = { [0] = {x = 0, y = -1, effect={[1]=108,[2]=109,[3]=109,[4]=108}}, [1] = {x = 1, y = 0, effect={[1]=106,[2]=107,[3]=107,[4]=106}}, [2] = {x = 0, y = 1, effect={[1]=109,[2]=108,[3]=108,[4]=109}}, [3] = {x = -1, y = 0, effect={[1]=107,[2]=106,[3]=106,[4]=107}} } for i = 1,4 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Confusion" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area3, -poke.min, -poke.max * critico, 136) elseif poke.atk == "Horn Attack" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 111) elseif poke.atk == "Poison Sting" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 15) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 9) elseif poke.atk == "Fury Cutter" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 110) addEvent(doAreaCombatHealth, 500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 110) elseif poke.atk == "Pin Missile" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end for i = 1, 3 do if i == 1 then doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 13) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137) else addEvent(doSendDistanceShoot, i * 200, getCreaturePosition(pet), getCreaturePosition(target), 13) addEvent(doAreaCombatHealth, i * 200, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137) end end elseif poke.atk == "Strafe" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end local dd = {142, 111, 110, 148} for i = 1,6 do af = math.random(4) if i == 1 then doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, dd[af]) else addEvent(doAreaCombatHealth, i*500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, dd[af]) end end end -- END ATTACKS doPlayerSay(cid, getCreatureName(pet)..", use "..poke.atk..".", 1) setPlayerStorageValue(cid, storage, os.time()+cd) setPlayerStorageValue(cid, exst, os.time()+cdexst) local atknotcritic = {"Harden", "Poison Powder", "Sleep Powder", "Super Sonic", "Stun Spore"} if critico == 2 and not isInArray(atknotcritic, poke.atk) then doSendAnimatedText(getCreaturePosition(cid), "CRITICAL", 144) end return true end New Tag : <talkaction words="m1;m2;m3;m4;m5;m6;m7;m8;m9;m10;m11;m12" hide="yes" event="script" value="moves.lua"/> Pokemons Configurados [15/151] :
    1 ponto
  8. Diego Skate

    [Action] Pokémon Move

    Nome: Pokémon MOVE (Order System) Autor: PoRaI ou PoPoRaI Server: Polska 8.42 - Acho que pode funcionar em versões novas. Como functiona? No Pokémon Online funciona da seguinte maneira: Clicando no botão order e em algum local que possa andar, o pokémon vai até o local, então esse sistema funciona igualzinho ao sistema do Pokémon Online. 1º - Adiciona na LIB (Data → lib → functions.lua), você ira adicionar uma função criada pelo DOKMOS, doPushCreature. ------------------ Function doPushCreature(uid,direction,distance,time) by Dokmos ------------------ function doPushCreature(uid,direction,distance,time) if isCreature(uid) == TRUE then local rand = (2*math.random(0,1))-1 local rand2 = math.random(-1,0) if direction == 0 then signal = {0,rand,-rand,rand,-rand,0,-1,-1,-1,0,0,0} elseif direction == 1 then signal = {1,1,1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 2 then signal = {0,rand,-rand,rand,-rand,0,1,1,1,0,0,0} elseif direction == 3 then signal = {-1,-1,-1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 4 then signal = {-1,rand2,(-rand2)-1,0,1,rand2+1,rand2,0} elseif direction == 5 then signal = {1,-rand2,-((-rand2)-1),0,1,rand2+1,rand2,0} elseif direction == 6 then signal = {-1,rand2,(-rand2)-1,0,-1,(-rand2)-1,rand2,0} else signal = {1,-rand2,-((-rand2)-1),0,-1,(-rand2)-1,rand2,0} end local pos = getThingPos(uid) nsig = #signal nvar = 0 repeat nvar = nvar+1 newpos = {x=pos.x+(signal[nvar]),y=pos.y+(signal[(nsig/2)+nvar]),z=pos.z} newtile = {x=newpos.x,y=newpos.y,z=newpos.z,stackpos=0} until getTileThingByPos(newtile).uid ~= 0 and hasProperty(getTileThingByPos(newtile).uid,3) == FALSE and queryTileAddThing(uid,newpos) == 1 or nvar == (nsig/2) if distance == nil or distance == 1 then doTeleportThing(uid,newpos,TRUE) else distance = distance-1 doTeleportThing(uid,newpos,TRUE) if time ~= nil then addEvent(doPushCreature,time,uid,direction,distance,time) else addEvent(doPushCreature,500,uid,direction,distance,500) end end end end 2º - Em actions.xml coloque: <action itemid="idaqui" script="move.lua" allowfaruse="1"/> 3º - Cria um arquivo em: Data → Actions → Scripts um novo arquivo chamado move.lua function onUse(cid, item, frompos, item2, toPosition) function doOrderMove(cid) -- By PoRaI. local creature = getCreatureSummons(cid)[1] local pokepos = getCreaturePosition(creature) local ir = toPosition if pokepos.x == ir.x and pokepos.y == ir.y then return TRUE end if pokepos.x ~= ir.x or pokepos.y ~= ir.y then if(pokepos.y - ir.y) >= 1 then addEvent(doPushCreature, 300, creature, NORTH, pokepos.y - ir.y) end if(ir.y - pokepos.y) >= 1 then addEvent(doPushCreature, 300, creature, SOUTH, ir.y - pokepos.y) end if(pokepos.x - ir.x) >= 1 then doPushCreature(creature, WEST, pokepos.x - ir.x) end if(ir.x - pokepos.x) >= 1 then addEvent(doPushCreature, 300, creature, EAST, ir.x - pokepos.x) end return FALSE end end if #getCreatureSummons(cid) == 1 then doOrderMove(cid) end end Créditos ao PoRaI & DOKMOS Só estou divulgando!
    1 ponto
  9. mininoloko

    [Vip] Legal

    Olá pessoal do xtibia, Hoje estou aki para postar um sistema vip Legal e Diferente. P:Oque Muda ? R:Quando o Player compra é adicionado automaticamente o [Vip] ao nome dele. Vamos lá . . . Primeiro vá até a pasta do OT/data/talkactions/script crie copie e cole um arquivo qualquer renomei para vip , apague tudo oque tem dentro e adicione : Depois em data/talkactions/talkactions.xml e adicione: Pronto talkactions pronta , agora data/movements/scripts copie e cole um arquivo qualquer renomei para vip , apague tudo q tem dentro e adicione: Script para quando o vip acaba o nome do cara mudar , va na pasta do ot/data/creaturescript copie e cole um arquivo qualquer,renomei para endvip e adicione: Depois va em creaturescript.xml e adicione: Pronto !! Agora abra o Map Editor , coloque a Action ID 13540 na entrada do Vip ou se você não tiver Map Editor vá na entrada do Vip e use o comando /attr action 13540 só que tera q fazer isso toda vez que ligar o OT . ~~Creditos: MininoLoko 10% (ecrevi o topico ) Vodkart 90% Rep ++ Pls
    1 ponto
  10. daniboy477

    (Pedido) Avatar

    Então Luan foi difícil achar um escudo vazio e sem titulo, mas consegui um aqui modifiquei e salvei, mais uma coisa, eu não sabia onde você gostaria que seu nome ficasse então se não gostar eu mudo...
    1 ponto
  11. @gremiista ficou bem bom porém muito pequena . @mapadetp oiaehoieh cara ta muito feio , botar piso de cave comessa nature e essse piso de town ? e aquele grav vita ? jesuis , ot 999x?
    1 ponto
  12. @Strayzer Valeu cara, mas isso que tu falou já tá tudo no segundo andar rs. Vou por uma mailbox ali embaixo. Valeu @edit Outra imagem *-*
    1 ponto
  13. romera

    Npc, Trade Com Linguagem Diferente

    Pera vou tentar te ajudar!! Va em data/npc/lib/npcsystem abra o modules: acho que é so muda o começo: FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} poe assim: FOCUS_GREETWORDS = {'oi', 'ola', 'hey'} e: SHOP_TRADEREQUEST = {'offer', 'trade'} para: SHOP_TRADEREQUEST = {'oferta', 'troca'} mas depois acho q tem que arruma nos npcs se falarem algo "para comprar diga |trade|" ai vc poe troca, como la emcima: Vo testa aki se de certo n vo edit esse topico. -- Advanced NPC System (Created by Jiddo), -- Modified by Talaturen. -- Modified by Elf. if(Modules == nil) then -- default words for greeting and ungreeting the npc. Should be a table containing all such words. FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The words for requesting trade window. SHOP_TRADEREQUEST = {'offer', 'troca'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! Should be a teble with a single string value. SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Constants used to separate buying from selling. SHOPMODULE_SELL_ITEM = 1 SHOPMODULE_BUY_ITEM = 2 SHOPMODULE_BUY_ITEM_CONTAINER = 3 -- Constants used for shop mode. Notice: addBuyableItemContainer is working on all modes SHOPMODULE_MODE_TALK = 1 -- Old system used before Tibia 8.2: sell/buy item name SHOPMODULE_MODE_TRADE = 2 -- Trade window system introduced in Tibia 8.2 SHOPMODULE_MODE_BOTH = 3 -- Both working at one time -- Used shop mode SHOPMODULE_MODE = SHOPMODULE_MODE_BOTH Modules = { parseableModules = {} } StdModule = {} -- These callback function must be called with parameters.npcHandler = npcHandler in the parameters table or they will not work correctly. -- Notice: The members of StdModule have not yet been tested. If you find any bugs, please report them to me. -- Usage: -- keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, text = 'I sell many powerful melee weapons.'}) function StdModule.say(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.say called without any npcHandler instance.') end local onlyFocus = (parameters.onlyFocus == nil or parameters.onlyFocus == true) if(not npcHandler:isFocused(cid) and onlyFocus) then return false end local parseInfo = {[TAG_PLAYERNAME] = getCreatureName(cid)} npcHandler:say(npcHandler:parseMessage(parameters.text or parameters.message, parseInfo), cid, parameters.publicize and true) if(parameters.reset == true) then npcHandler:resetNpc() elseif(parameters.moveup ~= nil and type(parameters.moveup) == 'number') then npcHandler.keywordHandler:moveUp(parameters.moveup) end return true end --Usage: -- local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) -- node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, promotion = 1, level = 20}, text = 'Congratulations! You are now promoted.') -- node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Alright then, come back when you are ready.'}, reset = true) function StdModule.promotePlayer(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.promotePlayer called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or getBooleanFromString(getConfigInfo('premiumForPromotion')) ~= TRUE or not(parameters.premium)) then if(getPlayerPromotionLevel(cid) >= parameters.promotion) then npcHandler:say('You are already promoted!', cid) elseif(getPlayerLevel(cid) < parameters.level) then npcHandler:say('Me desculpe, mas eu apenas posso promove-lo quando chegar no minimo level ' .. parameters.level .. '.', cid) elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then npcHandler:say('You do not have enough money!', cid) else setPlayerPromotionLevel(cid, parameters.promotion) npcHandler:say(parameters.text, cid) end else npcHandler:say("You need a premium account in order to get promoted.", cid) end npcHandler:resetNpc() return true end function StdModule.learnSpell(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.learnSpell called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then if getPlayerLearnedInstantSpell(cid, parameters.spellName) == TRUE then npcHandler:say('You already know this spell.', cid) elseif getPlayerLevel(cid) < parameters.level then npcHandler:say('You need to obtain a level of ' .. parameters.level .. ' or higher to be able to learn ' .. parameters.spellName .. '.', cid) elseif getPlayerVocation(cid) ~= parameters.vocation and getPlayerVocation(cid) ~= parameters.vocation + 4 and vocation ~= 9 then npcHandler:say('This spell is not for your vocation', cid) elseif doPlayerRemoveMoney(cid, parameters.price) == FALSE then npcHandler:say('You do not have enough money, this spell costs ' .. parameters.price .. ' gold.', cid) else npcHandler:say('You have learned ' .. parameters.spellName .. '.', cid) playerLearnInstantSpell(cid, parameters.spellName) end else npcHandler:say('You need a premium account in order to buy ' .. parameters.spellName .. '.', cid) end npcHandler:resetNpc() return true end function StdModule.bless(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.bless called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or getBooleanFromString(getConfigInfo('blessingsOnlyPremium')) ~= TRUE or not(parameters.premium)) then if getPlayerBlessing(cid, parameters.bless) then npcHandler:say("Gods have already blessed you with this blessing!", cid) elseif doPlayerRemoveMoney(cid, parameters.cost) == FALSE then npcHandler:say("You don't have enough money for blessing.", cid) else npcHandler:say("You have been blessed by one of the five gods!", cid) doPlayerAddBlessing(cid, parameters.bless) end else npcHandler:say('You need a premium account in order to be blessed.', cid) end npcHandler:resetNpc() return true end function StdModule.travel(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if(npcHandler == nil) then error('StdModule.travel called without any npcHandler instance.') end if(not npcHandler:isFocused(cid)) then return false end if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid) elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then npcHandler:say('You do not have enough money!', cid) else doTeleportThing(cid, parameters.destination, 0) doSendMagicEffect(parameters.destination, 10) end else npcHandler:say('I can only allow premium players to travel with me.', cid) end npcHandler:resetNpc() return true end FocusModule = { npcHandler = nil } -- Creates a new instance of FocusModule without an associated NpcHandler. function FocusModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end -- Inits the module and associates handler to it. function FocusModule:init(handler) self.npcHandler = handler for i, word in pairs(FOCUS_GREETWORDS) do local obj = {} table.insert(obj, word) obj.callback = FOCUS_GREETWORDS.callback or FocusModule.messageMatcher handler.keywordHandler:addKeyword(obj, FocusModule.onGreet, {module = self}) end for i, word in pairs(FOCUS_FAREWELLWORDS) do local obj = {} table.insert(obj, word) obj.callback = FOCUS_FAREWELLWORDS.callback or FocusModule.messageMatcher handler.keywordHandler:addKeyword(obj, FocusModule.onFarewell, {module = self}) end return true end -- Greeting callback function. function FocusModule.onGreet(cid, message, keywords, parameters) parameters.module.npcHandler:onGreet(cid) return true end -- UnGreeting callback function. function FocusModule.onFarewell(cid, message, keywords, parameters) if(parameters.module.npcHandler:isFocused(cid)) then parameters.module.npcHandler:onFarewell(cid) return true else return false end end -- Custom message matching callback function for greeting messages. function FocusModule.messageMatcher(keywords, message) for i, word in pairs(keywords) do if(type(word) == 'string') then if string.find(message, word) and not string.find(message, '[%w+]' .. word) and not string.find(message, word .. '[%w+]') then return true end end end return false end KeywordModule = { npcHandler = nil } -- Add it to the parseable module list. Modules.parseableModules['module_keywords'] = KeywordModule function KeywordModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function KeywordModule:init(handler) self.npcHandler = handler return true end -- Parses all known parameters. function KeywordModule:parseParameters() local ret = NpcSystem.getParameter('keywords') if(ret ~= nil) then self:parseKeywords(ret) end end function KeywordModule:parseKeywords(data) local n = 1 for keys in string.gmatch(data, '[^;]+') do local i = 1 local keywords = {} for temp in string.gmatch(keys, '[^,]+') do table.insert(keywords, temp) i = i+1 end if(i ~= 1) then local reply = NpcSystem.getParameter('keyword_reply' .. n) if(reply ~= nil) then self:addKeyword(keywords, reply) else print('[Warning] NpcSystem:', 'Parameter \'' .. 'keyword_reply' .. n .. '\' missing. Skipping...') end else print('[Warning] NpcSystem:', 'No keywords found for keyword set #' .. n .. '. Skipping...') end n = n+1 end end function KeywordModule:addKeyword(keywords, reply) self.npcHandler.keywordHandler:addKeyword(keywords, StdModule.say, {npcHandler = self.npcHandler, onlyFocus = true, text = reply, reset = true}) end TravelModule = { npcHandler = nil, destinations = nil, yesNode = nil, noNode = nil, } -- Add it to the parseable module list. Modules.parseableModules['module_travel'] = TravelModule function TravelModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function TravelModule:init(handler) self.npcHandler = handler self.yesNode = KeywordNode:new(SHOP_YESWORD, TravelModule.onConfirm, {module = self}) self.noNode = KeywordNode:new(SHOP_NOWORD, TravelModule.onDecline, {module = self}) self.destinations = {} return true end -- Parses all known parameters. function TravelModule:parseParameters() local ret = NpcSystem.getParameter('travel_destinations') if(ret ~= nil) then self:parseDestinations(ret) self.npcHandler.keywordHandler:addKeyword({'destination'}, TravelModule.listDestinations, {module = self}) self.npcHandler.keywordHandler:addKeyword({'where'}, TravelModule.listDestinations, {module = self}) self.npcHandler.keywordHandler:addKeyword({'travel'}, TravelModule.listDestinations, {module = self}) end end function TravelModule:parseDestinations(data) for destination in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local x = nil local y = nil local z = nil local cost = nil local premium = false for temp in string.gmatch(destination, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then x = tonumber(temp) elseif(i == 3) then y = tonumber(temp) elseif(i == 4) then z = tonumber(temp) elseif(i == 5) then cost = tonumber(temp) elseif(i == 6) then premium = temp == 'true' else print('[Warning] NpcSystem:', 'Unknown parameter found in travel destination parameter.', temp, destination) end i = i+1 end if(name ~= nil and x ~= nil and y ~= nil and z ~= nil and cost ~= nil) then self:addDestination(name, {x=x, y=y, z=z}, cost, premium) else print('[Warning] NpcSystem:', 'Parameter(s) missing for travel destination:', name, x, y, z, cost, premium) end end end function TravelModule:addDestination(name, position, price, premium) table.insert(self.destinations, name) local parameters = { cost = price, destination = position, premium = premium, module = self } local keywords = {} table.insert(keywords, name) local keywords2 = {} table.insert(keywords2, 'bring me to ' .. name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, TravelModule.travel, parameters) self.npcHandler.keywordHandler:addKeyword(keywords2, TravelModule.bringMeTo, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end function TravelModule.travel(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local npcHandler = module.npcHandler local cost = parameters.cost local destination = parameters.destination local premium = parameters.premium module.npcHandler:say('Do you want to travel to ' .. keywords[1] .. ' for ' .. cost .. ' gold coins?', cid) return true end function TravelModule.onConfirm(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local npcHandler = module.npcHandler local parentParameters = node:getParent():getParameters() local cost = parentParameters.cost local destination = parentParameters.destination local premium = parentParameters.premium if(isPlayerPremiumCallback(cid) or parameters.premium ~= true) then if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then npcHandler:say('You do not have enough money!', cid) else npcHandler:say('It was a pleasure doing business with you.', cid) npcHandler:releaseFocus(cid) doTeleportThing(cid, destination, 0) doSendMagicEffect(destination, 10) end else npcHandler:say('I can only allow premium players to travel there.', cid) end npcHandler:resetNpc() return true end -- onDecline keyword callback function. Generally called when the player sais 'no' after wanting to buy an item. function TravelModule.onDecline(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid), } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_DECLINE), parseInfo) module.npcHandler:say(msg, cid) module.npcHandler:resetNpc() return true end function TravelModule.bringMeTo(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local cost = parameters.cost local destination = parameters.destination local premium = parameters.premium if(isPlayerPremiumCallback(cid) or parameters.premium ~= true) then if(doPlayerRemoveMoney(cid, cost) == TRUE) then doTeleportThing(cid, destination, 0) doSendMagicEffect(destination, 10) end end return true end function TravelModule.listDestinations(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local msg = 'I can bring you to ' --local i = 1 local maxn = table.maxn(module.destinations) for i, destination in pairs(module.destinations) do msg = msg .. destination if(i == maxn -1) then msg = msg .. ' and ' elseif(i == maxn) then msg = msg .. '.' else msg = msg .. ', ' end i = i + 1 end module.npcHandler:say(msg, cid) module.npcHandler:resetNpc() return true end ShopModule = { npcHandler = nil, yesNode = nil, noNode = nil, noText = '', maxCount = 100, amount = 0 } -- Add it to the parseable module list. Modules.parseableModules['module_shop'] = ShopModule -- Creates a new instance of ShopModule function ShopModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end -- Parses all known parameters. function ShopModule:parseParameters() local ret = NpcSystem.getParameter('shop_buyable') if(ret ~= nil) then self:parseBuyable(ret) end local ret = NpcSystem.getParameter('shop_sellable') if(ret ~= nil) then self:parseSellable(ret) end local ret = NpcSystem.getParameter('shop_buyable_containers') if(ret ~= nil) then self:parseBuyableContainers(ret) end end -- Parse a string contaning a set of buyable items. function ShopModule:parseBuyable(data) for item in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local itemid = nil local cost = nil local subType = nil local realName = nil for temp in string.gmatch(item, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then itemid = tonumber(temp) elseif(i == 3) then cost = tonumber(temp) elseif(i == 4) then subType = tonumber(temp) elseif(i == 5) then realName = temp else print('[Warning] NpcSystem:', 'Unknown parameter found in buyable items parameter.', temp, item) end i = i + 1 end if(SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE) then if(itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else self:addBuyableItem(nil, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', itemid, cost) end else if(name ~= nil and itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else local names = {} table.insert(names, name) self:addBuyableItem(names, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, itemid, cost) end end end end -- Parse a string contaning a set of sellable items. function ShopModule:parseSellable(data) for item in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local itemid = nil local cost = nil local realName = nil for temp in string.gmatch(item, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then itemid = tonumber(temp) elseif(i == 3) then cost = tonumber(temp) elseif(i == 4) then realName = temp else print('[Warning] NpcSystem:', 'Unknown parameter found in sellable items parameter.', temp, item) end i = i + 1 end if(SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE) then if(itemid ~= nil and cost ~= nil) then self:addSellableItem(nil, itemid, cost, realName) else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', itemid, cost) end else if(name ~= nil and itemid ~= nil and cost ~= nil) then local names = {} table.insert(names, name) self:addSellableItem(names, itemid, cost, realName) else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, itemid, cost) end end end end -- Parse a string contaning a set of buyable items. function ShopModule:parseBuyableContainers(data) for item in string.gmatch(data, '[^;]+') do local i = 1 local name = nil local container = nil local itemid = nil local cost = nil local subType = nil local realName = nil for temp in string.gmatch(item, '[^,]+') do if(i == 1) then name = temp elseif(i == 2) then itemid = tonumber(temp) elseif(i == 3) then itemid = tonumber(temp) elseif(i == 4) then cost = tonumber(temp) elseif(i == 5) then subType = tonumber(temp) elseif(i == 6) then realName = temp else print('[Warning] NpcSystem:', 'Unknown parameter found in buyable items parameter.', temp, item) end i = i + 1 end if(name ~= nil and container ~= nil and itemid ~= nil and cost ~= nil) then if((isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE) and subType == nil) then print('[Warning] NpcSystem:', 'SubType missing for parameter item:', item) else local names = {} table.insert(names, name) self:addBuyableItemContainer(names, container, itemid, cost, subType, realName) end else print('[Warning] NpcSystem:', 'Parameter(s) missing for item:', name, container, itemid, cost) end end end -- Initializes the module and associates handler to it. function ShopModule:init(handler) self.npcHandler = handler self.yesNode = KeywordNode:new(SHOP_YESWORD, ShopModule.onConfirm, {module = self}) self.noNode = KeywordNode:new(SHOP_NOWORD, ShopModule.onDecline, {module = self}) self.noText = handler:getMessage(MESSAGE_DECLINE) if(SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK) then for i, word in pairs(SHOP_TRADEREQUEST) do local obj = {} table.insert(obj, word) obj.callback = SHOP_TRADEREQUEST.callback or ShopModule.messageMatcher handler.keywordHandler:addKeyword(obj, ShopModule.requestTrade, {module = self}) end end return true end -- Custom message matching callback function for requesting trade messages. function ShopModule.messageMatcher(keywords, message) for i, word in pairs(keywords) do if(type(word) == 'string') then if string.find(message, word) and not string.find(message, '[%w+]' .. word) and not string.find(message, word .. '[%w+]') then return true end end end return false end -- Resets the module-specific variables. function ShopModule:reset() self.amount = 0 end -- Function used to match a number value from a string. function ShopModule:getCount(message) local ret = 1 local b, e = string.find(message, PATTERN_COUNT) if b ~= nil and e ~= nil then ret = tonumber(string.sub(message, b, e)) end if(ret <= 0) then ret = 1 elseif(ret > self.maxCount) then ret = self.maxCount end return ret end -- Adds a new buyable item. -- names = A table containing one or more strings of alternative names to this item. Used only for old buy/sell system. -- itemid = The itemid of the buyable item -- cost = The price of one single item -- subType - The subType of each rune or fluidcontainer item. Can be left out if it is not a rune/fluidcontainer. Default value is 0. -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getItemNameById will be used) function ShopModule:addBuyableItem(names, itemid, cost, subType, realName) if(SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK) then if(self.npcHandler.shopItems[itemid] == nil) then self.npcHandler.shopItems[itemid] = {buyPrice = -1, sellPrice = -1, subType = 0, realName = ""} end self.npcHandler.shopItems[itemid].buyPrice = cost self.npcHandler.shopItems[itemid].realName = realName or getItemNameById(itemid) self.npcHandler.shopItems[itemid].subType = subType or 0 end if(names ~= nil and SHOPMODULE_MODE ~= SHOPMODULE_MODE_TRADE) then for i, name in pairs(names) do local parameters = { itemid = itemid, cost = cost, eventType = SHOPMODULE_BUY_ITEM, module = self, realName = realName or getItemNameById(itemid), subType = subType or 1 } keywords = {} table.insert(keywords, 'buy') table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- Adds a new buyable container of items. -- names = A table containing one or more strings of alternative names to this item. -- container = Backpack, bag or any other itemid of container where bought items will be stored -- itemid = The itemid of the buyable item -- cost = The price of one single item -- subType - The subType of each rune or fluidcontainer item. Can be left out if it is not a rune/fluidcontainer. Default value is 0. -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getItemNameById will be used) function ShopModule:addBuyableItemContainer(names, container, itemid, cost, subType, realName) if(names ~= nil) then for i, name in pairs(names) do local parameters = { container = container, itemid = itemid, cost = cost, eventType = SHOPMODULE_BUY_ITEM_CONTAINER, module = self, realName = realName or getItemNameById(itemid), subType = subType or 1 } keywords = {} table.insert(keywords, 'buy') table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- Adds a new sellable item. -- names = A table containing one or more strings of alternative names to this item. Used only by old buy/sell system. -- itemid = The itemid of the sellable item -- cost = The price of one single item -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getItemNameById will be used) function ShopModule:addSellableItem(names, itemid, cost, realName) if(SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK) then if(self.npcHandler.shopItems[itemid] == nil) then self.npcHandler.shopItems[itemid] = {buyPrice = -1, sellPrice = -1, subType = 0, realName = ""} end self.npcHandler.shopItems[itemid].sellPrice = cost self.npcHandler.shopItems[itemid].realName = realName or getItemNameById(itemid) end if(names ~= nil and SHOPMODULE_MODE ~= SHOPMODULE_MODE_TRADE) then for i, name in pairs(names) do local parameters = { itemid = itemid, cost = cost, eventType = SHOPMODULE_SELL_ITEM, module = self, realName = realName or getItemNameById(itemid) } keywords = {} table.insert(keywords, 'sell') table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- onModuleReset callback function. Calls ShopModule:reset() function ShopModule:callbackOnModuleReset() self:reset() return true end -- Callback onBuy() function. If you wish, you can change certain Npc to use your onBuy(). function ShopModule:callbackOnBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) if(self.npcHandler.shopItems[itemid] == nil) then error("[shopModule.onBuy]", "items[itemid] == nil") return false end if(self.npcHandler.shopItems[itemid].buyPrice == -1) then error("[shopModule.onSell]", "Attempt to buy a non-buyable item") return false end local backpack = 1988 local totalCost = amount * self.npcHandler.shopItems[itemid].buyPrice if(inBackpacks) then totalCost = totalCost + (math.max(1, math.floor(amount / getContainerCapById(backpack))) * 20) end local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = amount, [TAG_TOTALCOST] = totalCost, [TAG_ITEMNAME] = self.npcHandler.shopItems[itemid].realName } if(getPlayerMoney(cid) < totalCost) then local msg = self.npcHandler:getMessage(MESSAGE_NEEDMONEY) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendCancel(cid, msg) return false end local a, b = doNpcSellItem(cid, itemid, amount, subType, ignoreCap, inBackpacks, backpack) if(a < amount) then local msgId = MESSAGE_NEEDMORESPACE if(a == 0) then msgId = MESSAGE_NEEDSPACE end local msg = self.npcHandler:getMessage(msgId) parseInfo[TAG_ITEMCOUNT] = a msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendCancel(cid, msg) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end if(a > 0) then doPlayerRemoveMoney(cid, ((a * self.npcHandler.shopItems[itemid].buyPrice) + (b * 20))) return true end return false else local msg = self.npcHandler:getMessage(MESSAGE_BOUGHT) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg) doPlayerRemoveMoney(cid, totalCost) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end return true end end -- Callback onSell() function. If you wish, you can change certain Npc to use your onSell(). function ShopModule:callbackOnSell(cid, itemid, subType, amount, ignoreCap, inBackpacks) if(self.npcHandler.shopItems[itemid] == nil) then error("[shopModule.onSell]", "items[itemid] == nil") return false end if(self.npcHandler.shopItems[itemid].sellPrice == -1) then error("[shopModule.onSell]", "Attempt to sell a non-sellable item") return false end local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = amount, [TAG_TOTALCOST] = amount * self.npcHandler.shopItems[itemid].sellPrice, [TAG_ITEMNAME] = self.npcHandler.shopItems[itemid].realName } if(subType < 1) then subType = -1 end if(doPlayerRemoveItem(cid, itemid, amount, subType) == TRUE) then local msg = self.npcHandler:getMessage(MESSAGE_SOLD) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg) doPlayerAddMoney(cid, amount * self.npcHandler.shopItems[itemid].sellPrice) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end return true else local msg = self.npcHandler:getMessage(MESSAGE_NEEDITEM) msg = self.npcHandler:parseMessage(msg, parseInfo) doPlayerSendCancel(cid, msg) if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then self.npcHandler.talkStart[cid] = os.time() else self.npcHandler.talkStart = os.time() end return false end end -- Callback for requesting a trade window with the NPC. function ShopModule.requestTrade(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local itemWindow = {} for itemid, attr in pairs(module.npcHandler.shopItems) do local item = {id = itemid, buy = attr.buyPrice, sell = attr.sellPrice, subType = attr.subType, name = attr.realName} table.insert(itemWindow, item) end if(itemWindow[1] == nil) then local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_NOSHOP), parseInfo) module.npcHandler:say(msg, cid) return true end local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid) } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_SENDTRADE), parseInfo) openShopWindow(cid, itemWindow, function(cid, itemid, subType, amount, ignoreCap, inBackpacks) module.npcHandler:onBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) end, function(cid, itemid, subType, amount, ignoreCap, inBackpacks) module.npcHandler:onSell(cid, itemid, subType, amount, ignoreCap, inBackpacks) end) module.npcHandler:say(msg, cid) return true end -- onConfirm keyword callback function. Sells/buys the actual item. function ShopModule.onConfirm(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = module.amount, [TAG_TOTALCOST] = parentParameters.cost * module.amount, [TAG_ITEMNAME] = parentParameters.realName } if(parentParameters.eventType == SHOPMODULE_SELL_ITEM) then local ret = doPlayerSellItem(cid, parentParameters.itemid, module.amount, parentParameters.cost * module.amount) if(ret == LUA_NO_ERROR) then local msg = module.npcHandler:getMessage(MESSAGE_ONSELL) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGITEM) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end elseif(parentParameters.eventType == SHOPMODULE_BUY_ITEM) then local ret = doPlayerBuyItem(cid, parentParameters.itemid, module.amount, parentParameters.cost * module.amount, parentParameters.subType) if(ret == LUA_NO_ERROR) then if parentParameters.itemid == ITEM_PARCEL then doPlayerBuyItem(cid, ITEM_LABEL, module.amount, 0, parentParameters.subType) end local msg = module.npcHandler:getMessage(MESSAGE_ONBUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGMONEY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end elseif(parentParameters.eventType == SHOPMODULE_BUY_ITEM_CONTAINER) then local ret = doPlayerBuyItemContainer(cid, parentParameters.container, parentParameters.itemid, module.amount, parentParameters.cost * module.amount, parentParameters.subType) if(ret == LUA_NO_ERROR) then local msg = module.npcHandler:getMessage(MESSAGE_ONBUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGMONEY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end end module.npcHandler:resetNpc() return true end -- onDecliune keyword callback function. Generally called when the player sais 'no' after wanting to buy an item. function ShopModule.onDecline(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = module.amount, [TAG_TOTALCOST] = parentParameters.cost * module.amount, [TAG_ITEMNAME] = parentParameters.realName } local msg = module.npcHandler:parseMessage(module.noText, parseInfo) module.npcHandler:say(msg, cid) module.npcHandler:resetNpc() return true end -- tradeItem callback function. Makes the npc say the message defined by MESSAGE_BUY or MESSAGE_SELL function ShopModule.tradeItem(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local count = module:getCount(message) module.amount = count local parseInfo = { [TAG_PLAYERNAME] = getPlayerName(cid), [TAG_ITEMCOUNT] = module.amount, [TAG_TOTALCOST] = parameters.cost * module.amount, [TAG_ITEMNAME] = parameters.realName } if(parameters.eventType == SHOPMODULE_SELL_ITEM) then local msg = module.npcHandler:getMessage(MESSAGE_SELL) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) elseif(parameters.eventType == SHOPMODULE_BUY_ITEM) then local msg = module.npcHandler:getMessage(MESSAGE_BUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) elseif(parameters.eventType == SHOPMODULE_BUY_ITEM_CONTAINER) then local msg = module.npcHandler:getMessage(MESSAGE_BUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end return true end end --EDIT-- Para realmente pegar, tive que mudar outra coisa na mesma pasta chama-se npcsystem: aperta ctrl+f: trade, depois quando achar essa linha: SHOP_TRADEREQUEST = {'offer', 'trade'} troca para: SHOP_TRADEREQUEST = {'oferta', 'troca'} Com isso se pode mudar muitas coisas, Ex: SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} para isso: SHOP_YESWORD = {'sim'} SHOP_NOWORD = {'nao'} -- Advanced NPC System (Created by Jiddo), -- Modified by Talaturen. if(NpcSystem == nil) then -- Loads the underlying classes of the npcsystem. dofile('data/npc/lib/npcsystem/keywordhandler.lua') dofile('data/npc/lib/npcsystem/queue.lua') dofile('data/npc/lib/npcsystem/npchandler.lua') dofile('data/npc/lib/npcsystem/modules.lua') -- Global npc constants: -- Keyword nestling behavior. For more information look at the top of keywordhandler.lua KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED -- Greeting and unGreeting keywords. For more information look at the top of modules.lua FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The word for requesting trade window. For more information look at the top of modules.lua SHOP_TRADEREQUEST = {'offer', 'troca'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Talkdelay behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Conversation behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_PRIVATE -- Constant strings defining the keywords to replace in the default messages. -- For more information, look at the top of npchandler.lua... TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcSystem = {} -- Gets an npcparameter with the specified key. Returns nil if no such parameter is found. function NpcSystem.getParameter(key) local ret = getNpcParameter(tostring(key)) if((type(ret) == 'number' and ret == 0) or ret == nil) then return nil else return ret end end -- Parses all known parameters for the npc. Also parses parseable modules. function NpcSystem.parseParameters(npcHandler) local ret = NpcSystem.getParameter('idletime') if(ret ~= nil) then npcHandler.idleTime = tonumber(ret) end local ret = NpcSystem.getParameter('talkradius') if(ret ~= nil) then npcHandler.talkRadius = tonumber(ret) end local ret = NpcSystem.getParameter('message_greet') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_GREET, ret) end local ret = NpcSystem.getParameter('message_farewell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_FAREWELL, ret) end local ret = NpcSystem.getParameter('message_decline') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_DECLINE, ret) end local ret = NpcSystem.getParameter('message_needmorespace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMORESPACE, ret) end local ret = NpcSystem.getParameter('message_needspace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDSPACE, ret) end local ret = NpcSystem.getParameter('message_sendtrade') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SENDTRADE, ret) end local ret = NpcSystem.getParameter('message_noshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NOSHOP, ret) end local ret = NpcSystem.getParameter('message_oncloseshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONCLOSESHOP, ret) end local ret = NpcSystem.getParameter('message_onbuy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONBUY, ret) end local ret = NpcSystem.getParameter('message_onsell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONSELL, ret) end local ret = NpcSystem.getParameter('message_missingmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGMONEY, ret) end local ret = NpcSystem.getParameter('message_needmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMONEY, ret) end local ret = NpcSystem.getParameter('message_missingitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGITEM, ret) end local ret = NpcSystem.getParameter('message_needitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDITEM, ret) end local ret = NpcSystem.getParameter('message_idletimeout') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret) end local ret = NpcSystem.getParameter('message_walkaway') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_WALKAWAY, ret) end local ret = NpcSystem.getParameter('message_alreadyfocused') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret) end local ret = NpcSystem.getParameter('message_placedinqueue') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret) end local ret = NpcSystem.getParameter('message_buy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BUY, ret) end local ret = NpcSystem.getParameter('message_sell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SELL, ret) end local ret = NpcSystem.getParameter('message_bought') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BOUGHT, ret) end local ret = NpcSystem.getParameter('message_sold') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SOLD, ret) end -- Parse modules. for parameter, module in pairs(Modules.parseableModules) do local ret = NpcSystem.getParameter(parameter) if(ret ~= nil) then local number = tonumber(ret) if(number ~= 0 and module.parseParameters ~= nil) then local instance = module:new() npcHandler:addModule(instance) instance:parseParameters() end end end end end Testei aki 8.50, pego certinho!!! Ate++
    1 ponto
  14. Tryller

    [Mysql] The Brazilian Server V0.1.4

    Tryller To Usando O Gesior Cara... Mais N Tem Geito Até O TFS 0.29 ta Dando ACC OR PASS INVALID Gesior não é compativel com este sevidor, nem o TFS. Use o site que eu postei no topico e funcionara corretamente
    1 ponto
  15. bargolas

    Instalando Rme 8.60

    Aqui também. Entrei no ot server 8.6, desloguei e abri o RME coloquei o diretorio e ficou a mesma coisa... Já que nao estou conseguindo criar novo tópico aqui vou postar o link pra downlaod! Como fazer após baixar: 1) Abre a pasta que voce fez o downaload. 2)Copie os arquivos Tibia.dat; Tibia.spr 3)Cole no diretorio do tibia que pode ser esse -> C:\Arquivos de programas\Tibia 4) Abra o Mapa editor Obrigado! DOWNLOAD AQUI ! REP + PLS ! VALEEU !
    1 ponto
  16. tem as novidades Sim,e Tem algo que eu acho que nenhum Ot ainda tem,que é o NPC DE Addon,vendendo Wayfarer e warmaster Por Itens igual Global,isso eu fiz sozinho. ja coloquei o scan ali vlw.
    1 ponto
  17. Henrique Moura

    Mapa Vinigod Ot

    Membro Vinysla reputação perdida por flood.
    1 ponto
  18. Ae eu tenho um no meu ot , é 8.5 e funciona! Ot/data/npc copie qualquer script, renomeie pra trocadeitens , apague tud o que estiver dentro, e cole isto: <?xml version="1.0" encoding="UTF-8"?> <npc name="Nome do Npc" script="data/npc/scripts/troca.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="332" head="0" body="0" legs="0" feet="0"/> <parameters> <parameter key="message_greet" value="Aqui voce bota uma msg que voce quiser, poder ser informando os itens que poder sem trocados , voce escolhe" /> </parameters> </npc> depois em data/npc/scripts , copie qualquer script, renomeie pra troca , apague tud o que estiver dentro, e cole isto: local talk_state = 0 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 msgcontains(msg, 'nome do item') then if getPlayerItemCount(cid,6512) >= 1 then if doPlayerRemoveItem(cid,6512,1) then doPlayerAddItem(cid,1990,1) npcHandler:say('mensagem quando o item é trocado.') end else npcHandler:say('mensagem quando o player nao tem o item') talk_state = 0 end elseif msgcontains(msg, 'bye') then npcHandler:say('Até mais, ' .. getCreatureName(cid) .. '! Volte em breve...') talk_state = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) explicando: aonde ta ali "nome do item" é o que o player vai falar pra trocar os items! if getPlayerItemCount(cid,6512) >= 1 then << aqi voce muda o id do item que o player precisa ter, e 1 then é a quantidade if doPlayerRemoveItem(cid,6512,1) then << aqi pra remover o item, e a quantidade doPlayerAddItem(cid,1990,1) << aqi o tem que o player irá ganhar na troca ai voce muda pra o que voce quiser. Espero ter ajudado! ^^
    1 ponto
  19. Bruno1177

    Instalando Seu Rme - Passo A Passo!

    Nossa, realmente valeu pela força molecada! Abraços.
    1 ponto
  20. BlueSilver

    Arrumando Bug Dos Npcs

    Os NPCs não compravam items com charges, como as potions. Em npc.cpp procure por: li.itemId = intValue; Em baixo adicione: const ItemType& it = Item::items[li.itemId]; Ainda em npc.cpp procure por: if(readXMLInteger(tmpNode, "subtype", intValue)) li.subType = intValue; Em baixo adicione: else { if(it.stackable) li.subType = 1; else if(it.isFluidContainer() || it.isSplash()) li.subType = 0; } Créditos: http://otland.net/su...0.2.9%2Fnpc.cpp
    -1 pontos
Líderes está configurado para São Paulo/GMT-03:00
×
×
  • Criar Novo...