Ir para conteúdo

MatheusGlad

Conde
  • Total de itens

    528
  • Registro em

  • Última visita

  • Dias Ganhos

    30

Histórico de Reputação

  1. Upvote
    MatheusGlad recebeu reputação de Bluetooth em Item Ou Potion De Double Exp.   
    Item ou potion de double exp.

    By: MatheusMkalo


    Primeiramente vamos ver oque o script tem de diferente dos outros:

    Se voce sair com o efeito da exp potion o tempo da potion continuara passando, se voce logar antes que ele acabe voce ainda vai poder aproveitar umpouco da double exp. Voce pode escolher varias opçoes, como escolher se so premium accounts podem usar o item, quanta mana vai gasta, se vai remover quando usar e outros
    AGORA O SCRIPT SOH ESTA DISPONIVEL EM MOD:

    Vá na pasta mods e adicione um arquivo.xml com o nome de ExpPotion.xml e bote isso:

    <?xml version="1.0" encoding="UTF-8"?> <mod name="AdvancedExpPotionSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com"> <!-- Configs and Functions --> <config name="PotionExpConfigs"><![CDATA[ ------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE configs = { time = 1, ---- TIME IN MINUTES needpa = TRUE, needlvl = {TRUE, level = 50}, costmana = {TRUE, mana = 300}, addrate = 20, -- Exp que vai adicionar em % removeonuse = TRUE } function getTime(s) local n = math.floor(s / 60) s = s - (60 * n) return n, s end CreatureEventChecker = function(event, ...) -- Colex if isCreature(arg[1]) then event(unpack(arg)) end end creatureEvent = function(event, delay, ...) -- Colex addEvent(CreatureEventChecker, delay, event, unpack(arg)) end function getPlayerExtraExpRate(cid) -- By MatheusMkalo return (getPlayerRates(cid)[8]-1)*100 end ]]></config> <!-- exppotion.lua --> <action itemid="7440" event="script"><![CDATA[ domodlib('PotionExpConfigs') if getPlayerStorageValue(cid, 62164) >= 1 then return doPlayerSendCancel(cid, "You are already taking effect from this item.") end if configs.needpa and not isPremium(cid) then return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.") end if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.") end if configs.costmana[1] then if getCreatureMana(cid) < configs.costmana.mana then return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.") else doCreatureAddMana(cid, -configs.costmana.mana) end end if configs.removeonuse then doRemoveItem(item.uid, 1) end for i = configs.time*60, 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == configs.time*60 then creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the exp potion end.") end creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "The effect of the exp potion will end in "..a..".") end doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) doPlayerSendTextMessage(cid, 22, "Agora voce ira receber mais exp por matar os mosntros.") setPlayerStorageValue(cid, 62164, os.time()) creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0) return TRUE ]]></action> <creaturescript type="login" name="ExpPotion" event="script"><![CDATA[ domodlib('PotionExpConfigs') local time = configs.time if os.time()-getPlayerStorageValue(cid, 62164) < time *60 then doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000 , cid, 62164, 0) for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62164))), 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) then creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62164)))*1000, cid, "The effect of the exp potion end.") end creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "The effect of the exp potion will end in "..a..".") end end return TRUE ]]></creaturescript> </mod>
    Tudo pronto, exp potion funcionando!

    O ID da potion usada no script foi o: 7440 (Mastermind Potion)
    Para usa-lo voce precisa tirar a linha no actions.xml da potion porque se nao vai bugar.

    Para trocar o id da potion eh so mudar essa linha:
    <action itemid="7440" event="script"><![CDATA[



    Resposta para o Topico: Aew Galera Preciso Scripting Da Double Exp
    Potion
  2. Upvote
    MatheusGlad recebeu reputação de VaizardX em [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]
  3. Upvote
    MatheusGlad recebeu reputação de dully em War Arena System.   
    Todos os scripts foram testados em um ot 8.6
     
    Bem o script é auto-explicativo, e ainda tem um video do sistema, acho que nao preciso explicar o que faz ne?
     
    AGORA EM MOD, MUITO MAIS PRATICO DE INSTALAR. SE FOR USAR O MOD VA ATE O FINAL DO POST, É EXATAMENTE IGUAL A VERSAO NORMAL, SO QUE MAIS PRATICO. FUNCIONA DO MESMO JEITO.
     
    Video:


    obs: Veja em fullscreen para ver melhor as msgs que retornam.
     
    Vá em data/lib e adicione esse script.lua com o nome de WarArenaLib:

    -- [[ Area and Positions Infos ]] -- areaplayersteam = { {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} } areateam1ext = {x=80, y=305, z=7} -- Ponta superior esquerda da area do time um areateam2ext = {x=87, y=305, z=7} -- Ponta superior esquerda da area do time dois leaderteam1pos = {x=83, y=307, z=7, stackpos=255} -- Posição do lider do time um (que puxara a alavanca) leaderteam2pos = {x=87, y=307, z=7, stackpos=255} -- Posição do lider do time dois (que puxara a alavanca) newplayersposteam1 = {x=67, y=300, z=7} -- Posição para onde os players do time um serao teleportados newplayersposteam2 = {x=67, y=330, z=7} -- Posição para onde os players do time dois serao teleportados team1leverpos = {x=84, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time um puxara team2leverpos = {x=86, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time dois puxara leverafter, leverbefore = 9825, 9826 -- Ids das alavancas antes de puxadas e depois, consecutivamente (9825 = antes; 9826 = depois) posbenterteam1 = {x=78, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 1 posbenterteam2 = {x=92, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 2 backteampos = {x=77, y=307, z=7} -- [[ Storage Infos ]] -- team1leverstorage = 123497 -- Storage que sera usado quando puxarem a alavanca do time 1 team2leverstorage = 123498 -- Storage que sera usado quando puxarem a alavanca do time 2 haveteaminarena = 123499 -- Storage que sera usado para ve se tem algum time lutando na arena storageteam1death = 123500 -- Storage usado para ver quantos morreram do time 1 storageteam2death = 123501 -- Storage usado para ver quantos morreram do time 2 storageteam1 = 123502 -- Storage usado para ver quantas pessoas entraram na arena no time 1 storageteam2 = 123503 -- Storage usado para ver quantas pessoas entraram na arena no time 2 storageleader1 = 123504 -- Storage onde ficara guardado o uid do lider do time 1 storageleader2 = 123505 -- Storage onde ficara guardado o uid do lider do time 2 storageplayersteam1 = 123506 -- Storage que todos os players do team 1 iram ter. storageplatersteam2 = 123507 -- Storage que todos os players do team 2 iram ter. -- [[ Player Infos ]] -- needlevelarena = 20 -- Level que os outros jogadores sem ser o lider teram que ter. leaderlevel = 4000 -- Level que o lider tera que ter. onlyguildwars = true -- Se os membros de um time tem que ser da mesma guild do lider. (Nesse caso somente o lider da guild podera puxar a alavanca.) needplayers = 2 -- Quantidade de players que cada time tem que ter. -- [[ Functions ]] -- function getUidsFromArea(firstpos, area) local result = {} for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then table.insert(result, getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) end end end return result end function teleportUidsToPos(uids, pos) for i,x in pairs(uids) do doTeleportThing(x, pos) end end function isAllUidsSameGuild(uids, guildid) for i,x in pairs(uids) do if not (getPlayerGuildId(x) == guildid) then return false end end return true end function isAllUidsLevel(uids, level) for i,x in pairs(uids) do if not (getPlayerLevel(x) >= level) then return false end end return true end function haveQuantPlayersInArea(firstpos, area, quant) local result = 0 for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then result = result+1 end end end return result >= quant end function addStorageToUids(uids, storage, value) for i,x in pairs(uids) do setPlayerStorageValue(x, storage, value) end end function checkPoses(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true end return false end function startArena() setGlobalStorageValue(storageleader1, getThingFromPos(leaderteam1pos).uid) setGlobalStorageValue(storageleader2, getThingFromPos(leaderteam2pos).uid) addStorageToUids(team1uids, storageplayersteam1, 1) addStorageToUids(team2uids, storageplayersteam2, 1) teleportUidsToPos(team1uids, newplayersposteam1) teleportUidsToPos(team2uids, newplayersposteam2) setGlobalStorageValue(storageteam1, #team1uids) registerCreatureEventUids(team1uids, "DeathTeam1") registerCreatureEventUids(team2uids, "DeathTeam2") setGlobalStorageValue(storageteam2, #team2uids) setGlobalStorageValue(haveteaminarena, 1) setGlobalStorageValue(team1leverstorage, 0) setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end function haveTeamInArena() return getGlobalStorageValue(haveteaminarena) == 1 and true or false end function isSqmFromArea(firstpos, area, sqmpos) for i,x in pairs(area) do for s,z in pairs(x) do if sqmpos.x == firstpos.x+s-1 and sqmpos.y == firstpos.y+i-1 and sqmpos.z == firstpos.z then return true end end end return false end function registerCreatureEventUids(uids, event) for i,x in pairs(uids) do registerCreatureEvent(x, event) end end
     
    Agora vá em data/actions/scripts e adicione um script.lua com o nome de WarArenaLever:

    function onUse(cid, item, fromPosition, itemEx, toPosition) team1uids = getUidsFromArea(areateam1ext, areaplayersteam) team2uids = getUidsFromArea(areateam2ext, areaplayersteam) if haveTeamInArena() then return doPlayerSendCancel(cid, "Already have a team in arena.") end if checkPoses(toPosition, team1leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam1pos) then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) return doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team1uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team1uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team1leverstorage, 1) doTransformItem(getThingFromPos(team1leverpos).uid, leverbefore) if getGlobalStorageValue(team2leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end elseif checkPoses(toPosition, team2leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam2pos) then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) return doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team2uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team2uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team2leverstorage, 1) doTransformItem(getThingFromPos(team2leverpos).uid, leverbefore) if getGlobalStorageValue(team1leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end end return TRUE end
     
    E em actions.xml bote essa linha:

    <action actionid="12349" event="script" value="WarArenaLever.lua"/>
     
    Agora vá em data/creaturescripts/scripts e adicione dois scripts.lua com esses nomes:
     
    WarArenaDeathTeam1:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam1, 0) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    WarArenaDeathTeam2:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam2, 0) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    Agora abra o creaturescripts.xml e adicione essas linhas:

    <event type="death" name="DeathTeam1" event="script" value="WarArenaDeathTeam1.lua"/> <event type="death" name="DeathTeam2" event="script" value="WarArenaDeathTeam2.lua"/>
     
    Agora vá em data/movements/scripts e adicione tres scripts.lua com esses nomes:
     
    WarArenaMovement1:

    function onStepOut(cid, item, position, fromPosition) local team = (fromPosition.x == leaderteam1pos.x and fromPosition.y == leaderteam1pos.y and fromPosition.z == leaderteam1pos.z) and "team1" or (fromPosition.x == leaderteam2pos.x and fromPosition.y == leaderteam2pos.y and fromPosition.z == leaderteam2pos.z) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end
     
    WarArenaMovement2:

    function onStepIn(cid, item, position, fromPosition) local team = isSqmFromArea(areateam1ext, areaplayersteam, fromPosition) and "team1" or isSqmFromArea(areateam2ext, areaplayersteam, fromPosition) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end if getGlobalStorageValue(team1leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam1) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end elseif getGlobalStorageValue(team2leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam2) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end end end
     
    WarArenaMovement3:

    function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, storageplayersteam1) >= 1 then setPlayerStorageValue(cid, storageplayersteam1, 0) doTeleportThing(cid, posbenterteam1) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end elseif getPlayerStorageValue(cid, storageplayersteam2) >= 1 then setPlayerStorageValue(cid, storageplayersteam2, 0) doTeleportThing(cid, posbenterteam2) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end end return TRUE end
     
    E adicione essas linhas em movements.xml:

    <movevent type="StepOut" actionid="12350" event="script" value="WarArenaMovement1.lua"/> <movevent type="StepIn" actionid="12351" event="script" value="WarArenaMovement2.lua"/> <movevent type="StepIn" actionid="12352" event="script" value="WarArenaMovement3.lua"/>
     
     
    Pronto acabou rairiaria.
     
    Adicionando os Actions IDS:
    Nas 2 alavancas, adicione o actionid 12349.
    Nos 2 sqms que os players vao estar antes de entrar na arena adicione o actionid 12351.
    Nos 2 quadrados aonde os lideres irao ficar (na frente da alavanca) bote o actionid 12350.
    No sqm de sair da arena bote o actionid 12352.
     
    NA AREA DOS TIMES E NA ARENA, BOTE PELO MAP EDITOR PARA NAO PODER LOGAR. (Se voce nao fizer isso pode haver bugs.)
     
    Bem, se voce souber ler o script da lib, vai saber configura-lo para seu otserver.
     
     
    Versão MOD: (Abra o spoiler)
     
     
     
     
    O modo de configurar é exatamente igual ao normal. Flws.
     
    By MatheusMkalo
  4. Upvote
    MatheusGlad recebeu reputação de jamersonandres em War Arena System.   
    Todos os scripts foram testados em um ot 8.6
     
    Bem o script é auto-explicativo, e ainda tem um video do sistema, acho que nao preciso explicar o que faz ne?
     
    AGORA EM MOD, MUITO MAIS PRATICO DE INSTALAR. SE FOR USAR O MOD VA ATE O FINAL DO POST, É EXATAMENTE IGUAL A VERSAO NORMAL, SO QUE MAIS PRATICO. FUNCIONA DO MESMO JEITO.
     
    Video:


    obs: Veja em fullscreen para ver melhor as msgs que retornam.
     
    Vá em data/lib e adicione esse script.lua com o nome de WarArenaLib:

    -- [[ Area and Positions Infos ]] -- areaplayersteam = { {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} } areateam1ext = {x=80, y=305, z=7} -- Ponta superior esquerda da area do time um areateam2ext = {x=87, y=305, z=7} -- Ponta superior esquerda da area do time dois leaderteam1pos = {x=83, y=307, z=7, stackpos=255} -- Posição do lider do time um (que puxara a alavanca) leaderteam2pos = {x=87, y=307, z=7, stackpos=255} -- Posição do lider do time dois (que puxara a alavanca) newplayersposteam1 = {x=67, y=300, z=7} -- Posição para onde os players do time um serao teleportados newplayersposteam2 = {x=67, y=330, z=7} -- Posição para onde os players do time dois serao teleportados team1leverpos = {x=84, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time um puxara team2leverpos = {x=86, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time dois puxara leverafter, leverbefore = 9825, 9826 -- Ids das alavancas antes de puxadas e depois, consecutivamente (9825 = antes; 9826 = depois) posbenterteam1 = {x=78, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 1 posbenterteam2 = {x=92, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 2 backteampos = {x=77, y=307, z=7} -- [[ Storage Infos ]] -- team1leverstorage = 123497 -- Storage que sera usado quando puxarem a alavanca do time 1 team2leverstorage = 123498 -- Storage que sera usado quando puxarem a alavanca do time 2 haveteaminarena = 123499 -- Storage que sera usado para ve se tem algum time lutando na arena storageteam1death = 123500 -- Storage usado para ver quantos morreram do time 1 storageteam2death = 123501 -- Storage usado para ver quantos morreram do time 2 storageteam1 = 123502 -- Storage usado para ver quantas pessoas entraram na arena no time 1 storageteam2 = 123503 -- Storage usado para ver quantas pessoas entraram na arena no time 2 storageleader1 = 123504 -- Storage onde ficara guardado o uid do lider do time 1 storageleader2 = 123505 -- Storage onde ficara guardado o uid do lider do time 2 storageplayersteam1 = 123506 -- Storage que todos os players do team 1 iram ter. storageplatersteam2 = 123507 -- Storage que todos os players do team 2 iram ter. -- [[ Player Infos ]] -- needlevelarena = 20 -- Level que os outros jogadores sem ser o lider teram que ter. leaderlevel = 4000 -- Level que o lider tera que ter. onlyguildwars = true -- Se os membros de um time tem que ser da mesma guild do lider. (Nesse caso somente o lider da guild podera puxar a alavanca.) needplayers = 2 -- Quantidade de players que cada time tem que ter. -- [[ Functions ]] -- function getUidsFromArea(firstpos, area) local result = {} for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then table.insert(result, getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) end end end return result end function teleportUidsToPos(uids, pos) for i,x in pairs(uids) do doTeleportThing(x, pos) end end function isAllUidsSameGuild(uids, guildid) for i,x in pairs(uids) do if not (getPlayerGuildId(x) == guildid) then return false end end return true end function isAllUidsLevel(uids, level) for i,x in pairs(uids) do if not (getPlayerLevel(x) >= level) then return false end end return true end function haveQuantPlayersInArea(firstpos, area, quant) local result = 0 for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then result = result+1 end end end return result >= quant end function addStorageToUids(uids, storage, value) for i,x in pairs(uids) do setPlayerStorageValue(x, storage, value) end end function checkPoses(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true end return false end function startArena() setGlobalStorageValue(storageleader1, getThingFromPos(leaderteam1pos).uid) setGlobalStorageValue(storageleader2, getThingFromPos(leaderteam2pos).uid) addStorageToUids(team1uids, storageplayersteam1, 1) addStorageToUids(team2uids, storageplayersteam2, 1) teleportUidsToPos(team1uids, newplayersposteam1) teleportUidsToPos(team2uids, newplayersposteam2) setGlobalStorageValue(storageteam1, #team1uids) registerCreatureEventUids(team1uids, "DeathTeam1") registerCreatureEventUids(team2uids, "DeathTeam2") setGlobalStorageValue(storageteam2, #team2uids) setGlobalStorageValue(haveteaminarena, 1) setGlobalStorageValue(team1leverstorage, 0) setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end function haveTeamInArena() return getGlobalStorageValue(haveteaminarena) == 1 and true or false end function isSqmFromArea(firstpos, area, sqmpos) for i,x in pairs(area) do for s,z in pairs(x) do if sqmpos.x == firstpos.x+s-1 and sqmpos.y == firstpos.y+i-1 and sqmpos.z == firstpos.z then return true end end end return false end function registerCreatureEventUids(uids, event) for i,x in pairs(uids) do registerCreatureEvent(x, event) end end
     
    Agora vá em data/actions/scripts e adicione um script.lua com o nome de WarArenaLever:

    function onUse(cid, item, fromPosition, itemEx, toPosition) team1uids = getUidsFromArea(areateam1ext, areaplayersteam) team2uids = getUidsFromArea(areateam2ext, areaplayersteam) if haveTeamInArena() then return doPlayerSendCancel(cid, "Already have a team in arena.") end if checkPoses(toPosition, team1leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam1pos) then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) return doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team1uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team1uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team1leverstorage, 1) doTransformItem(getThingFromPos(team1leverpos).uid, leverbefore) if getGlobalStorageValue(team2leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end elseif checkPoses(toPosition, team2leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam2pos) then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) return doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team2uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team2uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team2leverstorage, 1) doTransformItem(getThingFromPos(team2leverpos).uid, leverbefore) if getGlobalStorageValue(team1leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end end return TRUE end
     
    E em actions.xml bote essa linha:

    <action actionid="12349" event="script" value="WarArenaLever.lua"/>
     
    Agora vá em data/creaturescripts/scripts e adicione dois scripts.lua com esses nomes:
     
    WarArenaDeathTeam1:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam1, 0) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    WarArenaDeathTeam2:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam2, 0) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    Agora abra o creaturescripts.xml e adicione essas linhas:

    <event type="death" name="DeathTeam1" event="script" value="WarArenaDeathTeam1.lua"/> <event type="death" name="DeathTeam2" event="script" value="WarArenaDeathTeam2.lua"/>
     
    Agora vá em data/movements/scripts e adicione tres scripts.lua com esses nomes:
     
    WarArenaMovement1:

    function onStepOut(cid, item, position, fromPosition) local team = (fromPosition.x == leaderteam1pos.x and fromPosition.y == leaderteam1pos.y and fromPosition.z == leaderteam1pos.z) and "team1" or (fromPosition.x == leaderteam2pos.x and fromPosition.y == leaderteam2pos.y and fromPosition.z == leaderteam2pos.z) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end
     
    WarArenaMovement2:

    function onStepIn(cid, item, position, fromPosition) local team = isSqmFromArea(areateam1ext, areaplayersteam, fromPosition) and "team1" or isSqmFromArea(areateam2ext, areaplayersteam, fromPosition) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end if getGlobalStorageValue(team1leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam1) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end elseif getGlobalStorageValue(team2leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam2) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end end end
     
    WarArenaMovement3:

    function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, storageplayersteam1) >= 1 then setPlayerStorageValue(cid, storageplayersteam1, 0) doTeleportThing(cid, posbenterteam1) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end elseif getPlayerStorageValue(cid, storageplayersteam2) >= 1 then setPlayerStorageValue(cid, storageplayersteam2, 0) doTeleportThing(cid, posbenterteam2) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end end return TRUE end
     
    E adicione essas linhas em movements.xml:

    <movevent type="StepOut" actionid="12350" event="script" value="WarArenaMovement1.lua"/> <movevent type="StepIn" actionid="12351" event="script" value="WarArenaMovement2.lua"/> <movevent type="StepIn" actionid="12352" event="script" value="WarArenaMovement3.lua"/>
     
     
    Pronto acabou rairiaria.
     
    Adicionando os Actions IDS:
    Nas 2 alavancas, adicione o actionid 12349.
    Nos 2 sqms que os players vao estar antes de entrar na arena adicione o actionid 12351.
    Nos 2 quadrados aonde os lideres irao ficar (na frente da alavanca) bote o actionid 12350.
    No sqm de sair da arena bote o actionid 12352.
     
    NA AREA DOS TIMES E NA ARENA, BOTE PELO MAP EDITOR PARA NAO PODER LOGAR. (Se voce nao fizer isso pode haver bugs.)
     
    Bem, se voce souber ler o script da lib, vai saber configura-lo para seu otserver.
     
     
    Versão MOD: (Abra o spoiler)
     
     
     
     
    O modo de configurar é exatamente igual ao normal. Flws.
     
    By MatheusMkalo
  5. Upvote
    MatheusGlad recebeu reputação de KingOFSkyer em War Arena System.   
    Todos os scripts foram testados em um ot 8.6
     
    Bem o script é auto-explicativo, e ainda tem um video do sistema, acho que nao preciso explicar o que faz ne?
     
    AGORA EM MOD, MUITO MAIS PRATICO DE INSTALAR. SE FOR USAR O MOD VA ATE O FINAL DO POST, É EXATAMENTE IGUAL A VERSAO NORMAL, SO QUE MAIS PRATICO. FUNCIONA DO MESMO JEITO.
     
    Video:


    obs: Veja em fullscreen para ver melhor as msgs que retornam.
     
    Vá em data/lib e adicione esse script.lua com o nome de WarArenaLib:

    -- [[ Area and Positions Infos ]] -- areaplayersteam = { {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} } areateam1ext = {x=80, y=305, z=7} -- Ponta superior esquerda da area do time um areateam2ext = {x=87, y=305, z=7} -- Ponta superior esquerda da area do time dois leaderteam1pos = {x=83, y=307, z=7, stackpos=255} -- Posição do lider do time um (que puxara a alavanca) leaderteam2pos = {x=87, y=307, z=7, stackpos=255} -- Posição do lider do time dois (que puxara a alavanca) newplayersposteam1 = {x=67, y=300, z=7} -- Posição para onde os players do time um serao teleportados newplayersposteam2 = {x=67, y=330, z=7} -- Posição para onde os players do time dois serao teleportados team1leverpos = {x=84, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time um puxara team2leverpos = {x=86, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time dois puxara leverafter, leverbefore = 9825, 9826 -- Ids das alavancas antes de puxadas e depois, consecutivamente (9825 = antes; 9826 = depois) posbenterteam1 = {x=78, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 1 posbenterteam2 = {x=92, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 2 backteampos = {x=77, y=307, z=7} -- [[ Storage Infos ]] -- team1leverstorage = 123497 -- Storage que sera usado quando puxarem a alavanca do time 1 team2leverstorage = 123498 -- Storage que sera usado quando puxarem a alavanca do time 2 haveteaminarena = 123499 -- Storage que sera usado para ve se tem algum time lutando na arena storageteam1death = 123500 -- Storage usado para ver quantos morreram do time 1 storageteam2death = 123501 -- Storage usado para ver quantos morreram do time 2 storageteam1 = 123502 -- Storage usado para ver quantas pessoas entraram na arena no time 1 storageteam2 = 123503 -- Storage usado para ver quantas pessoas entraram na arena no time 2 storageleader1 = 123504 -- Storage onde ficara guardado o uid do lider do time 1 storageleader2 = 123505 -- Storage onde ficara guardado o uid do lider do time 2 storageplayersteam1 = 123506 -- Storage que todos os players do team 1 iram ter. storageplatersteam2 = 123507 -- Storage que todos os players do team 2 iram ter. -- [[ Player Infos ]] -- needlevelarena = 20 -- Level que os outros jogadores sem ser o lider teram que ter. leaderlevel = 4000 -- Level que o lider tera que ter. onlyguildwars = true -- Se os membros de um time tem que ser da mesma guild do lider. (Nesse caso somente o lider da guild podera puxar a alavanca.) needplayers = 2 -- Quantidade de players que cada time tem que ter. -- [[ Functions ]] -- function getUidsFromArea(firstpos, area) local result = {} for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then table.insert(result, getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) end end end return result end function teleportUidsToPos(uids, pos) for i,x in pairs(uids) do doTeleportThing(x, pos) end end function isAllUidsSameGuild(uids, guildid) for i,x in pairs(uids) do if not (getPlayerGuildId(x) == guildid) then return false end end return true end function isAllUidsLevel(uids, level) for i,x in pairs(uids) do if not (getPlayerLevel(x) >= level) then return false end end return true end function haveQuantPlayersInArea(firstpos, area, quant) local result = 0 for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then result = result+1 end end end return result >= quant end function addStorageToUids(uids, storage, value) for i,x in pairs(uids) do setPlayerStorageValue(x, storage, value) end end function checkPoses(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true end return false end function startArena() setGlobalStorageValue(storageleader1, getThingFromPos(leaderteam1pos).uid) setGlobalStorageValue(storageleader2, getThingFromPos(leaderteam2pos).uid) addStorageToUids(team1uids, storageplayersteam1, 1) addStorageToUids(team2uids, storageplayersteam2, 1) teleportUidsToPos(team1uids, newplayersposteam1) teleportUidsToPos(team2uids, newplayersposteam2) setGlobalStorageValue(storageteam1, #team1uids) registerCreatureEventUids(team1uids, "DeathTeam1") registerCreatureEventUids(team2uids, "DeathTeam2") setGlobalStorageValue(storageteam2, #team2uids) setGlobalStorageValue(haveteaminarena, 1) setGlobalStorageValue(team1leverstorage, 0) setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end function haveTeamInArena() return getGlobalStorageValue(haveteaminarena) == 1 and true or false end function isSqmFromArea(firstpos, area, sqmpos) for i,x in pairs(area) do for s,z in pairs(x) do if sqmpos.x == firstpos.x+s-1 and sqmpos.y == firstpos.y+i-1 and sqmpos.z == firstpos.z then return true end end end return false end function registerCreatureEventUids(uids, event) for i,x in pairs(uids) do registerCreatureEvent(x, event) end end
     
    Agora vá em data/actions/scripts e adicione um script.lua com o nome de WarArenaLever:

    function onUse(cid, item, fromPosition, itemEx, toPosition) team1uids = getUidsFromArea(areateam1ext, areaplayersteam) team2uids = getUidsFromArea(areateam2ext, areaplayersteam) if haveTeamInArena() then return doPlayerSendCancel(cid, "Already have a team in arena.") end if checkPoses(toPosition, team1leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam1pos) then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) return doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team1uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team1uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team1leverstorage, 1) doTransformItem(getThingFromPos(team1leverpos).uid, leverbefore) if getGlobalStorageValue(team2leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end elseif checkPoses(toPosition, team2leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam2pos) then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) return doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team2uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team2uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team2leverstorage, 1) doTransformItem(getThingFromPos(team2leverpos).uid, leverbefore) if getGlobalStorageValue(team1leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end end return TRUE end
     
    E em actions.xml bote essa linha:

    <action actionid="12349" event="script" value="WarArenaLever.lua"/>
     
    Agora vá em data/creaturescripts/scripts e adicione dois scripts.lua com esses nomes:
     
    WarArenaDeathTeam1:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam1, 0) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    WarArenaDeathTeam2:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam2, 0) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    Agora abra o creaturescripts.xml e adicione essas linhas:

    <event type="death" name="DeathTeam1" event="script" value="WarArenaDeathTeam1.lua"/> <event type="death" name="DeathTeam2" event="script" value="WarArenaDeathTeam2.lua"/>
     
    Agora vá em data/movements/scripts e adicione tres scripts.lua com esses nomes:
     
    WarArenaMovement1:

    function onStepOut(cid, item, position, fromPosition) local team = (fromPosition.x == leaderteam1pos.x and fromPosition.y == leaderteam1pos.y and fromPosition.z == leaderteam1pos.z) and "team1" or (fromPosition.x == leaderteam2pos.x and fromPosition.y == leaderteam2pos.y and fromPosition.z == leaderteam2pos.z) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end
     
    WarArenaMovement2:

    function onStepIn(cid, item, position, fromPosition) local team = isSqmFromArea(areateam1ext, areaplayersteam, fromPosition) and "team1" or isSqmFromArea(areateam2ext, areaplayersteam, fromPosition) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end if getGlobalStorageValue(team1leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam1) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end elseif getGlobalStorageValue(team2leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam2) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end end end
     
    WarArenaMovement3:

    function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, storageplayersteam1) >= 1 then setPlayerStorageValue(cid, storageplayersteam1, 0) doTeleportThing(cid, posbenterteam1) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end elseif getPlayerStorageValue(cid, storageplayersteam2) >= 1 then setPlayerStorageValue(cid, storageplayersteam2, 0) doTeleportThing(cid, posbenterteam2) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end end return TRUE end
     
    E adicione essas linhas em movements.xml:

    <movevent type="StepOut" actionid="12350" event="script" value="WarArenaMovement1.lua"/> <movevent type="StepIn" actionid="12351" event="script" value="WarArenaMovement2.lua"/> <movevent type="StepIn" actionid="12352" event="script" value="WarArenaMovement3.lua"/>
     
     
    Pronto acabou rairiaria.
     
    Adicionando os Actions IDS:
    Nas 2 alavancas, adicione o actionid 12349.
    Nos 2 sqms que os players vao estar antes de entrar na arena adicione o actionid 12351.
    Nos 2 quadrados aonde os lideres irao ficar (na frente da alavanca) bote o actionid 12350.
    No sqm de sair da arena bote o actionid 12352.
     
    NA AREA DOS TIMES E NA ARENA, BOTE PELO MAP EDITOR PARA NAO PODER LOGAR. (Se voce nao fizer isso pode haver bugs.)
     
    Bem, se voce souber ler o script da lib, vai saber configura-lo para seu otserver.
     
     
    Versão MOD: (Abra o spoiler)
     
     
     
     
    O modo de configurar é exatamente igual ao normal. Flws.
     
    By MatheusMkalo
  6. Upvote
    MatheusGlad recebeu reputação de cadastro2005 em War Arena System.   
    Todos os scripts foram testados em um ot 8.6
     
    Bem o script é auto-explicativo, e ainda tem um video do sistema, acho que nao preciso explicar o que faz ne?
     
    AGORA EM MOD, MUITO MAIS PRATICO DE INSTALAR. SE FOR USAR O MOD VA ATE O FINAL DO POST, É EXATAMENTE IGUAL A VERSAO NORMAL, SO QUE MAIS PRATICO. FUNCIONA DO MESMO JEITO.
     
    Video:


    obs: Veja em fullscreen para ver melhor as msgs que retornam.
     
    Vá em data/lib e adicione esse script.lua com o nome de WarArenaLib:

    -- [[ Area and Positions Infos ]] -- areaplayersteam = { {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} } areateam1ext = {x=80, y=305, z=7} -- Ponta superior esquerda da area do time um areateam2ext = {x=87, y=305, z=7} -- Ponta superior esquerda da area do time dois leaderteam1pos = {x=83, y=307, z=7, stackpos=255} -- Posição do lider do time um (que puxara a alavanca) leaderteam2pos = {x=87, y=307, z=7, stackpos=255} -- Posição do lider do time dois (que puxara a alavanca) newplayersposteam1 = {x=67, y=300, z=7} -- Posição para onde os players do time um serao teleportados newplayersposteam2 = {x=67, y=330, z=7} -- Posição para onde os players do time dois serao teleportados team1leverpos = {x=84, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time um puxara team2leverpos = {x=86, y=307, z=7, stackpos=1} -- Posição da alavanca que o lider do time dois puxara leverafter, leverbefore = 9825, 9826 -- Ids das alavancas antes de puxadas e depois, consecutivamente (9825 = antes; 9826 = depois) posbenterteam1 = {x=78, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 1 posbenterteam2 = {x=92, y=307, z=7} -- Posiçao do sqm antes de entrar na arena do time 2 backteampos = {x=77, y=307, z=7} -- [[ Storage Infos ]] -- team1leverstorage = 123497 -- Storage que sera usado quando puxarem a alavanca do time 1 team2leverstorage = 123498 -- Storage que sera usado quando puxarem a alavanca do time 2 haveteaminarena = 123499 -- Storage que sera usado para ve se tem algum time lutando na arena storageteam1death = 123500 -- Storage usado para ver quantos morreram do time 1 storageteam2death = 123501 -- Storage usado para ver quantos morreram do time 2 storageteam1 = 123502 -- Storage usado para ver quantas pessoas entraram na arena no time 1 storageteam2 = 123503 -- Storage usado para ver quantas pessoas entraram na arena no time 2 storageleader1 = 123504 -- Storage onde ficara guardado o uid do lider do time 1 storageleader2 = 123505 -- Storage onde ficara guardado o uid do lider do time 2 storageplayersteam1 = 123506 -- Storage que todos os players do team 1 iram ter. storageplatersteam2 = 123507 -- Storage que todos os players do team 2 iram ter. -- [[ Player Infos ]] -- needlevelarena = 20 -- Level que os outros jogadores sem ser o lider teram que ter. leaderlevel = 4000 -- Level que o lider tera que ter. onlyguildwars = true -- Se os membros de um time tem que ser da mesma guild do lider. (Nesse caso somente o lider da guild podera puxar a alavanca.) needplayers = 2 -- Quantidade de players que cada time tem que ter. -- [[ Functions ]] -- function getUidsFromArea(firstpos, area) local result = {} for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then table.insert(result, getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) end end end return result end function teleportUidsToPos(uids, pos) for i,x in pairs(uids) do doTeleportThing(x, pos) end end function isAllUidsSameGuild(uids, guildid) for i,x in pairs(uids) do if not (getPlayerGuildId(x) == guildid) then return false end end return true end function isAllUidsLevel(uids, level) for i,x in pairs(uids) do if not (getPlayerLevel(x) >= level) then return false end end return true end function haveQuantPlayersInArea(firstpos, area, quant) local result = 0 for i,x in pairs(area) do for s,z in pairs(x) do if isPlayer(getThingFromPos({x=firstpos.x+s-1, y=firstpos.y+i-1, z=firstpos.z, stackpos=255}).uid) then result = result+1 end end end return result >= quant end function addStorageToUids(uids, storage, value) for i,x in pairs(uids) do setPlayerStorageValue(x, storage, value) end end function checkPoses(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true end return false end function startArena() setGlobalStorageValue(storageleader1, getThingFromPos(leaderteam1pos).uid) setGlobalStorageValue(storageleader2, getThingFromPos(leaderteam2pos).uid) addStorageToUids(team1uids, storageplayersteam1, 1) addStorageToUids(team2uids, storageplayersteam2, 1) teleportUidsToPos(team1uids, newplayersposteam1) teleportUidsToPos(team2uids, newplayersposteam2) setGlobalStorageValue(storageteam1, #team1uids) registerCreatureEventUids(team1uids, "DeathTeam1") registerCreatureEventUids(team2uids, "DeathTeam2") setGlobalStorageValue(storageteam2, #team2uids) setGlobalStorageValue(haveteaminarena, 1) setGlobalStorageValue(team1leverstorage, 0) setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end function haveTeamInArena() return getGlobalStorageValue(haveteaminarena) == 1 and true or false end function isSqmFromArea(firstpos, area, sqmpos) for i,x in pairs(area) do for s,z in pairs(x) do if sqmpos.x == firstpos.x+s-1 and sqmpos.y == firstpos.y+i-1 and sqmpos.z == firstpos.z then return true end end end return false end function registerCreatureEventUids(uids, event) for i,x in pairs(uids) do registerCreatureEvent(x, event) end end
     
    Agora vá em data/actions/scripts e adicione um script.lua com o nome de WarArenaLever:

    function onUse(cid, item, fromPosition, itemEx, toPosition) team1uids = getUidsFromArea(areateam1ext, areaplayersteam) team2uids = getUidsFromArea(areateam2ext, areaplayersteam) if haveTeamInArena() then return doPlayerSendCancel(cid, "Already have a team in arena.") end if checkPoses(toPosition, team1leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam1pos) then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) return doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team1uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team1uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team1leverstorage, 1) doTransformItem(getThingFromPos(team1leverpos).uid, leverbefore) if getGlobalStorageValue(team2leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end elseif checkPoses(toPosition, team2leverpos) then if checkPoses(getCreaturePosition(cid), leaderteam2pos) then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) return doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end if onlyguildwars and getPlayerGuildLevel(cid) < 3 then return doPlayerSendCancel(cid, "You need to be the leader of your guild.") end if onlyguildwars and not isAllUidsSameGuild(team2uids, getPlayerGuildId(cid)) then return doPlayerSendCancel(cid, "All of your team need to be in your guild.") end if not isAllUidsLevel(team2uids, needlevelarena) then return doPlayerSendCancel(cid, "All of your team need to be level " .. needlevelarena .. " or more.") end if getPlayerLevel(cid) < leaderlevel then return doPlayerSendCancel(cid, "You, the leader of the team, need to be level " .. leaderlevel .. " or more.") end if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then return doPlayerSendCancel(cid, "Your team need " .. tostring(needplayers) .. " players.") end setGlobalStorageValue(team2leverstorage, 1) doTransformItem(getThingFromPos(team2leverpos).uid, leverbefore) if getGlobalStorageValue(team1leverstorage) >= 1 then startArena() end else doPlayerSendCancel(cid, "You must be the leader of the team to pull the lever.") end end return TRUE end
     
    E em actions.xml bote essa linha:

    <action actionid="12349" event="script" value="WarArenaLever.lua"/>
     
    Agora vá em data/creaturescripts/scripts e adicione dois scripts.lua com esses nomes:
     
    WarArenaDeathTeam1:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam1, 0) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    WarArenaDeathTeam2:

    function onDeath(cid) setPlayerStorageValue(cid, storageplayersteam2, 0) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end return TRUE end
     
    Agora abra o creaturescripts.xml e adicione essas linhas:

    <event type="death" name="DeathTeam1" event="script" value="WarArenaDeathTeam1.lua"/> <event type="death" name="DeathTeam2" event="script" value="WarArenaDeathTeam2.lua"/>
     
    Agora vá em data/movements/scripts e adicione tres scripts.lua com esses nomes:
     
    WarArenaMovement1:

    function onStepOut(cid, item, position, fromPosition) local team = (fromPosition.x == leaderteam1pos.x and fromPosition.y == leaderteam1pos.y and fromPosition.z == leaderteam1pos.z) and "team1" or (fromPosition.x == leaderteam2pos.x and fromPosition.y == leaderteam2pos.y and fromPosition.z == leaderteam2pos.z) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end
     
    WarArenaMovement2:

    function onStepIn(cid, item, position, fromPosition) local team = isSqmFromArea(areateam1ext, areaplayersteam, fromPosition) and "team1" or isSqmFromArea(areateam2ext, areaplayersteam, fromPosition) and "team2" if team == "team1" then if getGlobalStorageValue(team1leverstorage) == 1 then if not haveQuantPlayersInArea(areateam1ext, areaplayersteam, needplayers) then setGlobalStorageValue(team1leverstorage, 0) doTransformItem(getThingFromPos(team1leverpos).uid, leverafter) end end elseif team == "team2" then if getGlobalStorageValue(team2leverstorage) == 1 then if not haveQuantPlayersInArea(areateam2ext, areaplayersteam, needplayers) then setGlobalStorageValue(team2leverstorage, 0) doTransformItem(getThingFromPos(team2leverpos).uid, leverafter) end end end if getGlobalStorageValue(team1leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam1) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end elseif getGlobalStorageValue(team2leverstorage) == 1 then if checkPoses(fromPosition, posbenterteam2) then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "You can't enter now.") end end end
     
    WarArenaMovement3:

    function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, storageplayersteam1) >= 1 then setPlayerStorageValue(cid, storageplayersteam1, 0) doTeleportThing(cid, posbenterteam1) setGlobalStorageValue(storageteam1death, getGlobalStorageValue(storageteam1death) >= 0 and getGlobalStorageValue(storageteam1death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam1death) >= getGlobalStorageValue(storageteam1) then if onlyguildwars then doBroadcastMessage("The Team 2 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader2)) .. ".") else doBroadcastMessage("The Team 2 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader2)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end elseif getPlayerStorageValue(cid, storageplayersteam2) >= 1 then setPlayerStorageValue(cid, storageplayersteam2, 0) doTeleportThing(cid, posbenterteam2) setGlobalStorageValue(storageteam2death, getGlobalStorageValue(storageteam2death) >= 0 and getGlobalStorageValue(storageteam2death)+1 or 1) if getGlobalStorageValue(haveteaminarena) >= 1 then if getGlobalStorageValue(storageteam2death) >= getGlobalStorageValue(storageteam2) then if onlyguildwars then doBroadcastMessage("The Team 1 won the war, guild " .. getPlayerGuildName(getGlobalStorageValue(storageleader1)) .. ".") else doBroadcastMessage("The Team 1 won the war, team leader name is " .. getCreatureName(getGlobalStorageValue(storageleader1)) .. ".") end setGlobalStorageValue(storageteam1death, 0) setGlobalStorageValue(storageteam2death, 0) setGlobalStorageValue(haveteaminarena, 0) end end end return TRUE end
     
    E adicione essas linhas em movements.xml:

    <movevent type="StepOut" actionid="12350" event="script" value="WarArenaMovement1.lua"/> <movevent type="StepIn" actionid="12351" event="script" value="WarArenaMovement2.lua"/> <movevent type="StepIn" actionid="12352" event="script" value="WarArenaMovement3.lua"/>
     
     
    Pronto acabou rairiaria.
     
    Adicionando os Actions IDS:
    Nas 2 alavancas, adicione o actionid 12349.
    Nos 2 sqms que os players vao estar antes de entrar na arena adicione o actionid 12351.
    Nos 2 quadrados aonde os lideres irao ficar (na frente da alavanca) bote o actionid 12350.
    No sqm de sair da arena bote o actionid 12352.
     
    NA AREA DOS TIMES E NA ARENA, BOTE PELO MAP EDITOR PARA NAO PODER LOGAR. (Se voce nao fizer isso pode haver bugs.)
     
    Bem, se voce souber ler o script da lib, vai saber configura-lo para seu otserver.
     
     
    Versão MOD: (Abra o spoiler)
     
     
     
     
    O modo de configurar é exatamente igual ao normal. Flws.
     
    By MatheusMkalo
  7. Upvote
    MatheusGlad recebeu reputação de bielwayne em Como Editar Magias [Novo Update]   
    Versao 0.1b Tutorial
    Voce nao Sabe nada sobre scripts e nem mesmo como funcionao e quer criar uma magia
    Voce pode ir no classico copy/paste:
    Primeiro Passo:
    Copie uma tag no spells.xml Exemplo:


    E cole logo a baixo uma identica.
    Agora edite certos campos:



    Vermelho Palavras a serem ditas para a magia sair
    Verde Level para Usar a magia
    Amarelo Mana pra Usar a magia

    Negrito Voce deve mudar para o nome do seu script, no caso usaremos eternal extreme winter

    Procure na pasta scripts/attack o bloco de notas chamado eternal winter copieo e cole renomeie-o para eternal extreme winter, abaixo ensino como editar.


    Em seguida voce pode editar certas coisas



    Azul Minimo Dano -- Leve em base que dakele geito que esta 2.7 ira dar 500 de dano se voce multiplicar por 2 o 2.7 ira ficar 5.4 e ira dar 1000 de dano
    Rosa Maximo Dano -- mesmo conceito de cima

    Laranja se voce nao conhece o comando pode ser !z 1,2,3...66 ou /z 1,2,3...66 useo no seu ot e veja um bem legal e apague toda a parte laranja e bote o efeito que voce quer no meu caso irei botar 61

    Conclusao a magia ira ficar com a forma do exevo gran mas frigo com otro dano e com otro efeito

    ___________
    Update 0.2a

    Usando tambem o comando !x ou /x 1,2,3...41

    Na linha da sua magia vai estar assim:




    Para usar os efeitos do /x ou !x voce deve botar antes do EFFECT a palavra DISTANCE e ficara assim:




    Negrito Como devera ficar para utilizar o comando !x ou /x

    Listinha de efeitos e seus devidos nomes:


    ___________________
    Update 0.2b

    Mudando a area da sua spell:

    Repare a linha da nossa primeira spell la em cima




    Neste local voce edita a area da sua magia vamos começar:

    Apague toda akela linha acima em negrito e bote isto:






    Legenda dos numeros:
    0 = nao vai acertar a magia
    1 = aonde a magia vai acertar
    2 = centro que eh o player (nao acertara tambem)

    Agora voce pode fazer uma area que voce queira de qualquer forma
    ___________________
    Update 0.3a

    Como Trocar o Dano da sua Magia:

    Para trocar o tipo de dano repare a linha da magia:



    Vermelho Eh o tipo de dano que ira dar eh so mudalo para outro tipo

    Listinha de Danos:

    COMBAT_PHYSICALDAMAGE - 1COMBAT_ENERGYDAMAGE - 2COMBAT_EARTHDAMAGE - 4COMBAT_POISONDAMAGE - 4COMBAT_FIREDAMAGE - 8COMBAT_UNDEFINEDDAMAGE - 16COMBAT_LIFEDRAIN - 32COMBAT_MANADRAIN - 64COMBAT_HEALING - 128COMBAT_DROWNDAMAGE - 256COMBAT_ICEDAMAGE - 512COMBAT_HOLYDAMAGE - 1024COMBAT_DEATHDAMAGE - 2048PS:Voce pode usar os numeros no lugar das palavras

    ___________________
    Update 0.3b
    Botando em pratica tudo que aprendemos!

    Neste update nos iremos usar todo o conteudo do tutorial para fazer uma magia com varios efeitos,danos e areas diferentes

    Aqui esta o script que criei para trabalharmos em cima dele:


    Legenda:
    Azul Dano de cada wave (onda) da sua magia
    Negrito Area das magias (arr)
    Vermelho Pausa de uma wave para outra, se quizer aumente bote 100,300,500...

    Pronto agora se voce viu os outros updates sabera mudar dano efeito e fazer uma otima magia bem louca

    Video de Demonstraçao:




    __________
    Fim dos Updates (Se voce tiver alguma opniao de update MP para mim que eu faço mais updates)
  8. Upvote
    MatheusGlad recebeu reputação de Raphaz2 em [Action] Trocando Crystals Por Moeda Vip   
    Pra que ele serve?

    Ele serve para quando você clicar nas crystal coins, se voce tiver a quantidade dita no script ele te dara a quantidade de moedas vip que voce botar.
     
    Va em actions.xml e bote esta tag:
     
    Agora va em actions/scripts e crie um arquivo lua chamado moedavipchange e bote isto dentro:
    Lembre-se de retirar o auto change da crystal coin para platinum, pois se nao ira bugar
     
    Script alto-explicativo, nao tem oque explicar.
    Duvidas, sugestões, elogios aceitos neste topico.
    OBS: NAO POSTE O SCRIPT EM OUTRO FORUM, CONTEUDO EXCLUSIVO PARA XTIBIA.
  9. Upvote
    MatheusGlad recebeu reputação de Wend ll em [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]
  10. Upvote
    MatheusGlad recebeu reputação de DaNDaNrOxX em [Resolvido] Sistema De Clean Na Hora Marcada!   
    E o miih sempre de brinks com a galeris.
     

    function executeClean() doCleanMap() doBroadcastMessage("Game map cleaned, next clean in 24 hours.") return true end function onTimer() doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!") addEvent(executeClean, 60000) return true end
     
    Roubei seu rep+ miih.
  11. Upvote
    MatheusGlad recebeu reputação de p3inn em Erros Em Algumas Spells.   
    Em todos os scripts bote essas funçoes:

    CreatureEventChecker = function(event, ...) -- Colex if isCreature(arg[1]) then event(unpack(arg)) end end creatureEvent = function(event, delay, ...) -- Colex addEvent(CreatureEventChecker, delay, event, unpack(arg)) end
     
    Mude todos addEvent por creatureEvent.
     
    Funções by Colex.
  12. Upvote
    MatheusGlad recebeu reputação de Daniel Bighouse em [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]
  13. Upvote
    MatheusGlad recebeu reputação de KingOFSkyer em Script Para Quests   
    Demonstraçao:


     
     
    data/movements/questname.lua:

    local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} } local extrtilepos = {x=88, y=310, z=7} -- Posiçao do tile << /\ local start = {x=87, y=312, z=7} -- Posiçao do tile que o cara vai estar antes de começar a pisar nos tiles pretos. local final = {x=97, y=312, z=7} -- Posiçao do tile que o cara vai estar dps de ter passado pelo percurso function isPosInRoute(tilesroutepos, tilepos) for i,s in pairs(tilesroutepos) do if s.x == tilepos.x and s.y == tilepos.y and s.z == tilepos.z then return TRUE end end return FALSE end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) local tilesroutepos = {} for i, t in pairs(route) do for s, p in pairs(t) do if p == 1 then table.insert(tilesroutepos, {x=extrtilepos.x+s-1, y=extrtilepos.y+i-1, z=extrtilepos.z}) end end end if toPosition.x == final.x and toPosition.y == final.y and toPosition.z == final.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if toPosition.x == start.x and toPosition.y == start.y and toPosition.z == start.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if fromPosition.x == final.x and fromPosition.y == final.y and fromPosition.z == final.z then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "Enter in the teleport.") end if isPosInRoute(tilesroutepos, toPosition) then local tilepos = toPosition tilepos.stackpos = 0 doTransformItem(getThingFromPos(tilepos).uid, 406) else doTeleportThing(cid, start) for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end end return TRUE end
     
    data/movements/movements.xml:

    <movevent type="StepIn" actionid="123666" event="script" value="questname.lua"/>
     
    Em quais tiles botar o actionid 123666:

     
    Editar a rota que o player tem que fazer:
     

    local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} }
     
     
    So mudar essa table. Aonde eh 1 eh por onde o player tem que passar.
  14. Upvote
    MatheusGlad recebeu reputação de Souronaldo2 em Script Para Quests   
    Demonstraçao:


     
     
    data/movements/questname.lua:

    local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} } local extrtilepos = {x=88, y=310, z=7} -- Posiçao do tile << /\ local start = {x=87, y=312, z=7} -- Posiçao do tile que o cara vai estar antes de começar a pisar nos tiles pretos. local final = {x=97, y=312, z=7} -- Posiçao do tile que o cara vai estar dps de ter passado pelo percurso function isPosInRoute(tilesroutepos, tilepos) for i,s in pairs(tilesroutepos) do if s.x == tilepos.x and s.y == tilepos.y and s.z == tilepos.z then return TRUE end end return FALSE end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) local tilesroutepos = {} for i, t in pairs(route) do for s, p in pairs(t) do if p == 1 then table.insert(tilesroutepos, {x=extrtilepos.x+s-1, y=extrtilepos.y+i-1, z=extrtilepos.z}) end end end if toPosition.x == final.x and toPosition.y == final.y and toPosition.z == final.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if toPosition.x == start.x and toPosition.y == start.y and toPosition.z == start.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if fromPosition.x == final.x and fromPosition.y == final.y and fromPosition.z == final.z then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "Enter in the teleport.") end if isPosInRoute(tilesroutepos, toPosition) then local tilepos = toPosition tilepos.stackpos = 0 doTransformItem(getThingFromPos(tilepos).uid, 406) else doTeleportThing(cid, start) for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end end return TRUE end
     
    data/movements/movements.xml:

    <movevent type="StepIn" actionid="123666" event="script" value="questname.lua"/>
     
    Em quais tiles botar o actionid 123666:

     
    Editar a rota que o player tem que fazer:
     

    local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} }
     
     
    So mudar essa table. Aonde eh 1 eh por onde o player tem que passar.
  15. Upvote
    MatheusGlad recebeu reputação de Vodkart em Script Para Quests   
    Demonstraçao:


     
     
    data/movements/questname.lua:

    local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} } local extrtilepos = {x=88, y=310, z=7} -- Posiçao do tile << /\ local start = {x=87, y=312, z=7} -- Posiçao do tile que o cara vai estar antes de começar a pisar nos tiles pretos. local final = {x=97, y=312, z=7} -- Posiçao do tile que o cara vai estar dps de ter passado pelo percurso function isPosInRoute(tilesroutepos, tilepos) for i,s in pairs(tilesroutepos) do if s.x == tilepos.x and s.y == tilepos.y and s.z == tilepos.z then return TRUE end end return FALSE end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) local tilesroutepos = {} for i, t in pairs(route) do for s, p in pairs(t) do if p == 1 then table.insert(tilesroutepos, {x=extrtilepos.x+s-1, y=extrtilepos.y+i-1, z=extrtilepos.z}) end end end if toPosition.x == final.x and toPosition.y == final.y and toPosition.z == final.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if toPosition.x == start.x and toPosition.y == start.y and toPosition.z == start.z then for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end return TRUE end if fromPosition.x == final.x and fromPosition.y == final.y and fromPosition.z == final.z then doTeleportThing(cid, fromPosition) return doPlayerSendCancel(cid, "Enter in the teleport.") end if isPosInRoute(tilesroutepos, toPosition) then local tilepos = toPosition tilepos.stackpos = 0 doTransformItem(getThingFromPos(tilepos).uid, 406) else doTeleportThing(cid, start) for i,x in pairs(tilesroutepos) do x.stackpos = 0 doTransformItem(getThingFromPos(x).uid, 407) end end return TRUE end
     
    data/movements/movements.xml:

    <movevent type="StepIn" actionid="123666" event="script" value="questname.lua"/>
     
    Em quais tiles botar o actionid 123666:

     
    Editar a rota que o player tem que fazer:
     

    local route = { {0,0,0,0,0,1,0,0,0}, {0,0,0,0,1,0,1,0,0}, {1,0,0,1,0,0,0,1,1}, {0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0} }
     
     
    So mudar essa table. Aonde eh 1 eh por onde o player tem que passar.
  16. Upvote
    MatheusGlad deu reputação a meubk em [Resolvido] Sistema De Clean Na Hora Marcada!   
    ai vai é um globalevent..
     
    script :
     

    function executeClean() doCleanMap() doBroadcastMessage("Game map cleaned, next clean in 24 hours.") return true end function onThink(interval, lastExecution, thinkInterval) doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!") addEvent(executeClean, 60000) return true end
     
    tag:
     

    <globalevent name="clean" time="23:58" event="script" value="nome do arquivo.lua"/>
  17. Upvote
    MatheusGlad recebeu reputação de LucasM010203 em Como Cria Uma Magia Que Cria Itens Em Volta De Você Por Um Tempo Para Trapar?   
    data/spells/scripts/trapw.lua:

    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1499) local area = { {0, 1, 1, 1, 1, 1, 0}, {1, 1, 0, 0, 0, 1, 1}, {1, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 3, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 1}, {1, 1, 0, 0, 0, 1, 1}, {0, 1, 1, 1, 1, 1, 0} } setCombatArea(combat, createCombatArea(area)) function onCastSpell(cid, var) return doCombat(cid, combat, var) end
     
    data/spells/spells.xml:

    <instant name="Trap Wild" words="exevo mas trap" lvl="50" mana="160" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="trapw.lua"> </instant>
     
    Nao precisa fazer a runa, pra isso existe o machete. Caso ainda queria a runa eh so falar.
  18. Upvote
    MatheusGlad recebeu reputação de LF12 em [Resolvido] Sistema De Clean Na Hora Marcada!   
    E o miih sempre de brinks com a galeris.
     

    function executeClean() doCleanMap() doBroadcastMessage("Game map cleaned, next clean in 24 hours.") return true end function onTimer() doBroadcastMessage("Game map cleaning within 1 minute, please pick up your items!") addEvent(executeClean, 60000) return true end
     
    Roubei seu rep+ miih.
  19. Upvote
    MatheusGlad recebeu reputação de ALLan162 em [Download]Quest Maker E Como Usar   
    Fikei em duvida se postava na aprovaçao de tutorial ou downloads, pois o meu contem os dois.
    Quest Maker Download: 4shared
     
    Virus Scan Virus Total
    Ps: So 1 antivirus achou, acho que inofensivo.
     
    Como usar:
    Ele e um programa muito simples de se usar porem algumas pessoas nao sabem, irei explicar.
     
    Apos baixar o Quest Maker bote-o na pasta "actions/scripts" do seu otserver.
    Em seguida,abra-o e espera carregar.
     
    Preencha todos os campos do quest maker. Use a ss como exemplo

     
    1 - Nome do Arquivo.lua onde ficara o script (dentro da pasta aonde botou o Quest Maker)
     
    2 - Comentarios (Nao ira modificar em nada seu script)
     
    3 - Unique ID que voce vai botar no bau da quest.(Sempre botar um numero qualquer que n tenha em actions.xml)
     
    4 - Storage ID. (Pode ser o mesmo do Unique ID, mais nao afetara se for diferente)
     
    5 - Mensagem que ira aparecer apos completar a quest.
     
    6 - Botao que cria o script em sua pasta.
     
    7 - ID do item que ira dar na quest.
     
    8 - Apaga todas as suas configuraçoes feitas no programa.
     
    9 - Cria Tag que voce ira botar em actions.xml
     
    10 - NAO USE ESTA BUGADO ELE TE DA OS IDS ERRADOS
    11 - Aonde aparece sua tag criada pelo botao numero 9
    Criando o Bau:
    Agora abra o seu mapa com o seu Map Editor e crie um bau.
    Adicione o UniqueId que voce colocou no Quest Maker.
    Salve e aproveite!
     
    Quest Criada com Sucesso
     
    Tutorial by MatheusMkalo, exclusivo para o Xtibia
    Copia Ilegal,PROIBIDA
     
    Sugestoes,Duvidas,Elogios aceitados nesse topico ou via MP.
  20. Upvote
    MatheusGlad recebeu reputação de Vodkart em Funçao Getuidsinarea(Extr1, Extr2)   
    Funçao:
    Pega os uids de criaturas de uma area quadrada.
     

    function getUidsInArea(extr1, extr2) local dat = {} for i = 1, (extr2.y-extr1.y)+1 do for s = 1, (extr2.x-extr1.x)+1 do if isCreature(getThingFromPos({x=extr1.x+s-1, y=extr1.y+i-1, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=extr1.x+s-1, y=extr1.y+i-1, z=extr1.z, stackpos=255}).uid) end end end return dat end
     
    Como usar:
     
    O parametro extr1 e extr2 sao as pos de 2 "vertices" opostos de uma area quadrada.

    local uids = getUidsInArea({x = 3, y = 5, z = 7}, {x = 17, y = 15, z = 7})
     
    Eu acho que tem uma funçao parecida no tibia, getSpectators, mas essa é mais facil de usar.
     
    OBS: Retorna uma table com todas as uids da pos.
  21. Upvote
    MatheusGlad recebeu reputação de marokinha em Funçao String.explode(Str, Sep)   
    function string.explode(str, sep) -- function by MatheusMkalo local dat = {} local lastsep = 0 for i = 1, #str do if str: sub(i, i+#sep-1) == sep then local addt = lastsep == 0 and str: sub(1, i-1) or str: sub(lastsep+#sep, i-1) if addt ~= "" then table.insert(dat, addt) end str = str:sub(1, i-1) .. str:sub(i+#sep-1) lastsep = i-#sep+1 end if #dat == 0 and i == #str then table.insert(dat, str) break end if i == #str then table.insert(dat, str: sub(lastsep+#sep, #str)) end end return dat end
     
    Funçao string.explode dos ots em lua...
     
    N funfa com pattern
  22. Upvote
    MatheusGlad recebeu reputação de Trueds em [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]
  23. Upvote
    MatheusGlad recebeu reputação de WOLFBAD em Mudar A Forma Do Seu Monstro   
    Mudar a Forma do seu monstro

     
    Para mudar a forma de seu monstro va na pasta data/monster e ache seu monstro, depois edite esta linha.
     
    Vermelho O visual do monstro (Mude o numero para algum da lista abaixo para obter o respectivo outfit do monstro)
     
    Azul Cores de cabeça,corpo,pernas,pe,e id do corpo (As vezes mudando as cores nao muda em nada)
     
    Agora uma lista dos numeros de looktypes e nome dos monstros:
     
     
     
    Lembre-se, se for tentar fazer /newtype e um numero da lista de 8.54 voce nao ira consiguir, pois a maioria dos otservers nao configurao ate esse numero.
     
    Configurando /newtype (SOMENTE PARA 8.54, NAO FAÇA ISSO EM 8.53):
     
     
     
    Obs: Em breve, estarei editando o topico e tera fotos de cada outfit
     
    Sugeito a sugestões,dicas,elogios e erros.
  24. Upvote
    MatheusGlad deu reputação a Demonbholder em Funções E Position Recorder   
    Faaala galera! Esses dias um parceiro meu me deu uma idéia e pediu para que eu fizesse um script para ele, assim surgiu o script que irei postar agora.
     
    Eu coloquei o nome de Position Recorder porque o script faz jus ao nome; ele funciona da seguinte maneira: Você tem um item, no caso o 2359 e quando você clica nele, a sua posição é gravada e o item se transforma para o 2356. Ai você pode usar o 2356 que você será teleportado para a posição que você estava quando usou o primeiro item.
     
    Well, como dito no título, eu fiz duas funções para o script funcionar; claro que não era necessário, mas as funções são úteis para outras coisas também. Darei mais exemplos no final. Bom, vamos as funções:
     
    Vá em data/lib, abra o arquivo functions.lua, e cole no final dele estas duas funções:
     

    function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end
     

    function getMarkPos(cid) return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)} end
     
    Certo, agora vamos ao script do position recorder.
     
    Opção 1: Apenas vips usam, Kydrai System Vip.
     
     
     
     
    Opção 2: Apenas vips usam, Perfect Vip System.
     
     
     
     
    Opção 3: Qualquer um usa.
     
     
     
     
    Outras possibilidades para as funções adicionadas:
     
    ~Quest: Terminar a quest e ganhar acesso a um lugar especial.
     
     
     
     
    Lembrando que o lugar fica gravado no jogador, e não no item. Os itens usados foram 2356 e 2359, no caso; você pode troca-los se souber como. É isso, postem o que acharam, até mais.
  25. Upvote
    MatheusGlad recebeu reputação de willscarlate em [Talkaction] Teleport Parecido Com Do P.o   
    Vá em talkactions/scripts e crie um arquivo.lua com o nome de poketeleport e bote o seguinte script dentro:

    function getTime(s) local n = math.floor(s / 60) s = s - (60 * n) return n, s end function onSay(cid, words, param) local configs = { needpa = TRUE, needlvl = {TRUE, level = 50}, } local cidades = { ["Carlin"] = {x=1000,y=1000,z=7, pokenames = {"Rat", "Bug"}, time = 1}, ["Thais"] = {x=1002,y=1000,z=7, pokenames = {"Rat", "Bug"}, time = 2}, } teleport = FALSE if configs.needpa and not isPremium(cid) then return doPlayerSendCancel(cid, "You need to be a premmium account to use teleport.") end if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then return doPlayerSendCancel(cid, "You need to be level "..configs.needlvl.level.." or higher to use teleport.") end if #getCreatureSummons(cid) <= 0 then return doPlayerSendCancel(cid, "You need to have a monster summoned.") end for i,x in pairs(cidades) do for _,z in pairs(getCreatureSummons(cid)) do if isInArray(x.pokenames, getCreatureName(z)) then if param:lower() == "\"" .. i:lower() then if os.time()-getPlayerStorageValue(cid, 64231) <= x.time*60 then minutes,seconds = getTime(x.time*60-(os.time()-getPlayerStorageValue(cid, 64231))) return doPlayerSendCancel(cid, "You need wait " .. minutes .. " minutes and " .. seconds .. " seconds.") else doTeleportThing(cid, x) doTeleportThing(z, x) setPlayerStorageValue(cid, 64231, os.time()) teleport = TRUE break end end end end end if not teleport then return doPlayerSendCancel(cid, "This city don't exists or not is able to go in there with teleport or this monster don't able to use teleport.") end return TRUE end
     
    Depois va em talkactions.xml e bote a seguinte TAG:

    <talkaction words="!teleport" event="script" value="poketeleport.lua"/>
     
    Como configurar o script:
    Mecha nessas partes:
     
    Legendas:
    -- Use TRUE ou FALSE --
    Vermelho - Se precisa de premmium account para usar a talkaction.
    Azul - Se precisa de level, e qual level precisa.
    Rosa - As informaçoes sao, respectivamente: A pos pra aonde o teleport vai levar, os nomes dos pokes que podem levar para akele local, o tempo em minutos que demorara para usar novamente o teleport para akele local.
     
    Como adicionar novos locais para teleport:
    Copie a ultima linha, no caso:
     
    Em seguida cole logo abaixo ficando assim:
     
    Depois eh so mudar para as informaçoes que voce queira...
     
    Como usar a talkaction in-game:
    Basta voce falar !teleport "NOMEDOLOCAL
     
     
     
    Bem nao deu pra explicar muito bem por causa do meu tempo, espero que voces consigam entender.
     
    De suas opnioes para as proximas versoes do script...
     
     
     
    Dica Importante!

    Se voce for botar o local de uma parte que for PROTECTION ZONE o seu pokemon ou summon nao ira andar e ficara preso, para que isso nao aconteça va em config.lua e procure por isso (CTRL+F):
     
    Se estiver false, mude para true para que o summon seja teleportado ate o player quando ele for para longe.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...