Surf System - Parecido com o do otPokémon
2/12/2015, 18:23
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:
Vídeo mostrando como funciona o sistema
Créditos:
Leleke - Por desenvolver o sistema.
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
- Spoiler:
- <action itemid="4645;4646;4647;4644" event="script" value="surf.lua"/>
- 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.
Permissões neste sub-fórum
Não podes responder a tópicos
|
|