Aqui não funfou, dá um erro assim, saca:
[01/01/2012 11:48:43] [Error - TalkAction Interface] [01/01/2012 11:48:43] data/talkactions/scripts/player/dive.lua:onSay [01/01/2012 11:48:43] Description: [01/01/2012 11:48:43] data/talkactions/scripts/player/dive.lua:3: attempt to compare number with boolean [01/01/2012 11:48:43] stack traceback: [01/01/2012 11:48:43] data/talkactions/scripts/player/dive.lua:3: in function <data/talkactions/scripts/player/dive.lua:1>






info
Grupo: Campones
Registrado: 17/12/06
Posts: 16
Reputação: +13
Char no Tibia: Nem fudeno
Essa é uma Talk que adiciona Dive em todos pokemons de surf. A função é minha, do Pokemon Fight V3, adptei-la para o Dash Advance. Vamos lá.
------------------------------------------------------------------------------------------------------------------------------------------------
LIB:
------------------------------------------------------------------------------------------------------------------------------------------------
. Abra
. Procure por
local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "ghostwalk"}.adicione substituindo tudo em baixo
.ficando assim
local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "ghostwalk", "dive"}
local skilldescr = {
["fly"] = " • Fly:\nYou can mount this pokemon and fly with it to reach other places through the sky (use order on yourself).\n-------------------------",
["ghostwalk"] = " • Ghost Walk:\nThis pokemon can walk through walls and unpassable terrain. This pokemon is also invulnerable to physical attacks.",
["ride"] = " • Ride:\nYou can mount this pokemon to move faster on land (use order on yourself).\n-------------------------",
["rock smash"] = " • Rock Smash:\nThis pokemon is able to break smashable rocks (use order on rock).\n-------------------------",
["cut"] = " • Cut:\nThis pokemon is able to cut cuttable bushes (use order on bush).\n-------------------------",
["dig"] = " • Dig:\nThis pokemon is able to dig holes and make them exploitable (use order on a closed hole).\n-------------------------",
["light"] = " • Flash:\nThis pokemon is able to illuminate a place (use order on pokemon).\n-------------------------",
["blink"] = " • Blink:\nThis pokemon can teleport itself to another place (use order on desired place).\n-------------------------",
["teleport"] = " • Teleport:\nThis pokemon can teleport itself and it's trainer to another city (type either h\" or /h).\n-------------------------",
["surf"] = " • Surf:\nYou can mount this pokemon and swim with it (just walk into water).\n-------------------------",
["dive"] = " • Dive:\nAllows your pokemon to dive into deep water, when it is possible (say !down to dive and !up to come back).\n-------------------------",
}
------------------------------------------------------------------------------------------------------------------------------------------------
TALKACTIONS:
------------------------------------------------------------------------------------------------------------------------------------------------
. Abra
. Adicione as Tags
<talkaction words="!down;!dive" event="script" value="player/!dive.lua"/>
<talkaction words="!up;!back" event="script" value="player/!back.lua"/>
. Crie
function onSay(cid, words, param, channel)
divepos = getCreaturePosition(cid)
npos2 = getPlayerMasterPos(cid)
poszao = {x=divepos.x, y=divepos.y, z=7}
pos = getCreaturePosition(cid)
local waters = {11756, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
local poke = {'Poliwag', 'Poliwhirl', 'Seaking', 'Dewgong', 'Blastoise', 'Tentacruel', 'Lapras', 'Gyarados', 'Omastar', 'Kabutops', 'Vaporeon', 'Staryu', 'Starmie', 'Goldeen', 'Seadra', 'Golduck', 'Squirtle', 'Wartortle', 'Tentacool', 'Snorlax', 'Poliwrath',
"Mantine", "Totodile", "Croconow", "Feraligatr", "Marill", "Azumarill", "Quagsire", "Wooper", "Octillery", "Kingdra"}
if getCreatureOutfit(cid).lookType == 316 or getCreatureOutfit(cid).lookType == 648 then
doSendMagicEffect(fromPosition, 136)
end
if (getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1) then
return true
end
if #getCreatureSummons(cid) == 0 then
doPlayerSendCancel(cid, "You need a pokemon to dive.")
doTeleportThing(cid, fromPosition, false)
return true
end
if (not isInArray(poke, getPokemonName(getCreatureSummons(cid)[1]))) then
doPlayerSendCancel(cid, "This pokemon cannot dive.")
doTeleportThing(cid, fromPosition, false)
return true
end
if (not isInArray(waters, getTileThingByPos(poszao).itemid)) then
doPlayerSendCancel(cid, "You cant up here.")
doTeleportThing(cid, fromPosition, false)
return true
end
if pos.z >= 8 then
if doTeleportThing(cid, poszao) == true then
doSendMagicEffect(poszao, 14)
end
else return print("Erro ao utilizar comando !back")
end
end
. Crie
function onSay(cid, words, param, channel)
if (not getPlayerStorageValue(cid, 63215) >= 1) then return false end
pos = getCreaturePosition(cid)
if pos.z ~= 7 then return false end
npos = {x=pos.x, y=pos.y, z=pos.z + 7}
local grounds = {5405, 5406, 5407, 5408, 5409, 5410}
if (not isInArray(grounds, getTileThingByPos(npos).itemid)) then
return doPlayerSendCancel(cid, "You cannot dive here.")
end
if doTeleportThing(cid, npos) then
doSendMagicEffect(npos, 14)
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 63215, 0)
local item = getPlayerSlotItem(cid, 8)
local pokemon = getItemAttribute(item.uid, "poke")
local x = pokes[pokemon]
if getItemAttribute(item.uid, "nick") then
doCreatureSay(cid, "".."Good job "..getItemAttribute(item.uid, "nick").." !", 1)
else
doCreatureSay(cid, "".."Good job "..getItemAttribute(item.uid, "poke").." !", 1)
end
doSummonMonster(cid, pokemon)
local pk = getCreatureSummons(cid)[1]
doChangeSpeed(pk, getCreatureSpeed(cid))
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, PlayerSpeed)
doTeleportThing(pk, getThingPos(cid), true)
doCreatureSetLookDir(pk, getCreatureLookDir(cid))
adjustStatus(pk, item.uid, true, false, true)
end
return TRUE
end
------------------------------------------------------------------------------------------------------------------------------------------------
OBS: Vc deve mergulhar usando surf no ground (nivel 7), o piso de underwater que o player será teleportado é o nivel 14, para subir basta o jogador estar em um piso underwater de qualquer nivel (8-15) e deve haver water em cima.
------------------------------------------------------------------------------------------------------------------------------------------------
Pra mais actions e scripts de pokemon dash veja minha assinatura!
Editado Dezembro 31 por Spiga