Você está desconectado.

Conecte-se e veja nossos conteúdos exclusivos!
 

  


Surf System - Parecido com o do otPokémon

Compartilhe
avatar
Death Gun
Administrador
Administrador

King Coin(s) King Coin(s) : 32
Reputação : 13014
Facebook : Facebook.com/Vitor.Eduardo.5567
OTServ Favorito : Pokémon Paraíso V3 - O Retorno
Meu Char : Zed Stars
Seção Favorita : Spriting
Eu sou : Scripter
Tópicos : 253
Data de Cadastro : 27/09/2015
Idade : 18
Localização : Florianópolis - SC

Surf System - Parecido com o do otPokémon

Mensagem por Death Gun em Qua Dez 02, 2015 9:23 pm

Eae galerinha, hoje venho trazer um sistema de surf parecido com o do otPokémon.

Primeiro vai na pasta actions/scripts e copia um arquivo la e renomeia para surf e adcione isso:
Spoiler:
local pokes = {

['Snorlax'] = {lookType=300, speed = 400},
['Vaporeon'] = {lookType=191, speed = 400}
}
local configs = {
[4647] = {x = -2, y = 0},
[4645] = {x = 2, y = 0},
[4646] = {x = 0, y = 2},
[4644] = {x = 0, y = -2},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerpos = getCreaturePosition(cid)
if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
return doPlayerSendCancel(cid, "You need a pokemon to surf.")
end
local 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[itemEx.itemid].x, y=playerpos.y+configs[itemEx.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[itemEx.itemid].x, y=playerpos.y-configs[itemEx.itemid].y, z=playerpos.z})
setPlayerStorageValue(cid, 63215, 0)
doRemoveCondition(cid, CONDITION_OUTFIT)

local item = getPlayerSlotItem(cid, 8)
doCreatureSay(cid, "" .. getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")..", Im tired of surfing!", 1)
pk = doSummonCreature(getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball."), getCreaturePosition(cid))
doConvinceCreature(cid, pk)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "Exp")
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
Agora volte a pasta e abre o arquivo actions.xml e adcione isso:
Spoiler:
<action itemid="4645;4646;4647;4644" event="script" value="surf.lua"/>
Explicando como Funciona:
Spoiler:
Explicando:<action itemid="ID DAS BORDAS PRA CLICAR" event="script" value="surf.lua"/>
['NOME DO POKEMON'] = {lookType=LOOKTYPE DE SURF, speed = VELOCIDADE},
['Vaporeon'] = {lookType=191, speed = 400}
}
local configs = {
[4644] = {x = -2, y = 0},ID DAS BORDAS PRA CLICAR MESMA DA ACTIONS.XML
[4645] = {x = 2, y = 0},ID DAS BORDAS PRA CLICAR MESMA DA ACTIONS.XML
[4646] = {x = 0, y = 2},ID DAS BORDAS PRA CLICAR MESMA DA ACTIONS.XML
[4644] = {x = 0, y = -2},ID DAS BORDAS PRA CLICAR MESMA DA ACTIONS.XML/>

Vídeo mostrando como funciona o sistema
Spoiler:

Créditos:
Leleke - Por desenvolver o sistema.

    Data/hora atual: Sab Abr 29, 2017 7:33 pm