Achei bem interessante. Seria tipo uma vassoura mágica que aparece em Harry Potter e no conceito estereotipado de bruxas?
SO
7
4.4k
13 de outubro de 2015 às 00:12
13 de outubro de 2015 às 00:39
isso mesmo Zipter98 voce ja conhece bem meu projeto hehe ja me ajudou tantas vezes ![]()
13 de outubro de 2015 às 17:08
data/movements/scripts:
local area = createCombatArea{
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
}
function onStepIn(cid, item, position, fromPosition)
doAreaCombatHealth(cid, 3080, getThingPos(cid), area, 0, 0, 255)
return true
end
function onStepOut(cid, item, position, fromPosition)
local oldtpos = fromPosition
oldtpos.stackpos = STACKPOS_GROUND
if getTileThingByPos(oldtpos).itemid >= 1 then
doRemoveItem(getTileThingByPos(oldtpos).uid, 1)
end
return true
end
function onEquip(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Now you can fly!")
doSetCreatureOutfit(cid, {lookType = FLY_OUTFIT}, -1)
setPlayerStorageValue(cid, 17000, 1)
return true
end
function onDeEquip(cid)
if getTileInfo(getThingPos(cid)).itemid == 460 then
doPlayerSendCancel(cid, "You can't stop flying here.")
elseif getTileInfo(getThingPos(cid)).itemid >= 4820 and getTileInfo(getThingPos(cid)).itemid <= 4825 then
doPlayerSendCancel(cid, "You can't stop flying here.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You stopped flying.")
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 17000, -1)
return true
end
end
Tags:
<movevent type="Equip" itemid="xxx" slot="ammo" event="script" value="nome_do_arquivo.lua"/> <movevent type="DeEquip" itemid="xxx" slot="ammo" event="script" value="nome_do_arquivo.lua"/> <movevent type="StepOut" itemid="460" event="script" value="nome_do_arquivo.lua"/> <movevent type="StepIn" itemid="460" event="script" value="nome_do_arquivo.lua"/>
data/talkactions/scripts:
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 2 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 onSay(cid)
if getPlayerStorageValue(cid, 17000) <= 0 then
return doPlayerSendCancel(cid, "You aren't flying.")
end
if words == "/up" then
if getThingPos(cid).z == 0 then
return doPlayerSendCancel(cid, "You can't go higher!")
end
local pos = getThingPos(cid)
pos.z = pos.z - 1
pos.stackpos = 0
if getTileThingByPos(pos).itemid >= 1 or getTileItemById(getThingPos(cid), 1386).itemid >= 1 then
return doPlayerSendCancel(cid, "You can\'t fly through constructions.")
end
doCombatAreaHealth(cid, 0, pos, 0, 0, 0, CONST_ME_NONE)
doCreateItem(11676, 1, pos)
elseif words == "/down" then
if getThingPos(cid).z == 7 then
return doPlayerSendCancel(cid, "You can\'t go lower!")
elseif not getTileInfo(getThingPos(cid)).itemid == 460 and getTileInfo(getThingPos(cid)).itemid >= 2 then
return doPlayerSendCancel(cid, "You can\'t go lower.")
end
local pos = getThingPos(cid)
pos.z = pos.z + 1
pos.stackpos = 0
if getTileThingByPos(pos).itemid >= 1 then
if getTilePzInfo(pos) == true then
return doPlayerSendCancel(cid, "You can't go down here.")
elseif not isWalkable(pos) then
return doPlayerSendCancel(cid, "You can't go down here.")
end
doTeleportThing(cid, pos)
else
doCombatAreaHealth(cid, 0, pos, 0, 0, 0, CONST_ME_NONE)
doCreateItem(11675, 1, pos)
doTeleportThing(cid, pos)
end
end
return true
endTag:
<talkaction words="/up;/down" case-sensitive="no" event="script" value="nome_do_arquivo.lua"/>
Editado Outubro 14 por zipter98
13 de outubro de 2015 às 22:43
obrigado zipter98 mas poderia me explicar melhor como funciona ?
criei os arquivos do jeito que esta ai so acrescentei o id do item que servira como vassoura e nao funcionou
14 de outubro de 2015 às 11:06
Ops, não li que a vassoura deve ficar no slot ammo. Tags do moveevent corrigidas.




info
Grupo: Campones
Registrado: 01/10/15
Posts: 72
Reputação: +4
Galero meu projeto eh com tfs 0.3.6 / 8.54.
Vamos la gostaria de um sistema de FLY estilo poketibia do qual o player monta eu seu pokemon e ele pode voar atravesando lagos, arvores, buracos etc...
da a entender que parece q ele fica 1 andar acima do normal... porem ele nao pode atravessar paredes...
ex:
Mas no meu caso seria assim...
gostaria que ao ekipar determinado item no slot AMMO, autifit muda-se para outra da qual ele estaria voando do mesmo sistema do pokemon e ao desekipar o item ele volta-se ao normal, porem nao da pra desekipar o item em cima de obstaculos e nem deslogar o char qndo estiver de fly...
valendo REPS+
Bump!
#bump