Fala Galera do XTibia ~~
Meu script era em action..
Agora é talkaction
VIDEO DE DEMONSTRADÂO:
-> Crie um arquivo ride.lua em talkaction/scripts , e cole isso dentro:
function onSay(cid, words, param, channel) local pokes = { ['Tauros'] = {128, 200}, ['Ninetales'] = {129, 300}, ['Rapidash'] = {130, 350}, } local old_speed = getCreatureBaseSpeed(cid) local summons = getCreatureSummons(cid) if getPlayerStorageValue(cid, 20000) == 10 then local nome = getItemName(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid) local poke_name = nome:match('(.-) Pokeball') local action_id = getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid") doChangeSpeed(cid, -(getCreatureSpeed(cid) - getCreatureBaseSpeed(cid))) doRemoveCondition(cid, CONDITION_OUTFIT) setPlayerStorageValue(cid, 20000, 7) setPlayerStorageValue(cid, 26000, 6) local monster = doCreateMonster(poke_name, getCreaturePosition(cid)) doConvinceCreature(cid, monster) doPlayerSay(cid, poke_name .. ", Stop Ride!", TALKTYPE_SAY) return true end if #getCreatureSummons(cid) < 1 then return doPlayerSendCancel(cid, "You dont have pokemon") end local pokemon = pokes[getCreatureName(getCreatureSummons(cid)[1])] local name = getCreatureName(getCreatureSummons(cid)[1]) if not pokes[name] then return doPlayerSendCancel(cid, "Pokemon not allowed.") end doChangeSpeed(cid, pokemon[2]) setPlayerStorageValue(cid, 20000, 10) setPlayerStorageValue(cid, 26000, 5) doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1])) function getPokemonId(summons) for _, pid in ipairs(summons) do return pid end end doRemoveCreature(getPokemonId(summons)) doPlayerSay(cid, name .. ", Let's go Ride!", TALKTYPE_SAY) end
E em talkaction.xml, add essa tag:
<talkaction words="/ride" hide="yes" event="script" value="ride.lua"/>
Explicando :
['Rapidash'] = {130, 350},
Vermelho: Nome do Pokemon que podera dar ride
Azul: ID da outfit da montaria
Verde: Velocidade que o player ganhará ao montar
Espero que tenham gostado =D
Ride System 1.0