Mock Fly System 1.0

Mock
Por Mock
em Actions e Talkactions
  • 1
  • 2

Mock

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 06/11/07Posts: 39Char no Tibia: degarox strain

  • Autor: Mock the bear
  • Servidor testado: TFS 0.3.6

 

Depois de muita espera eu dei a chance de liberar o script, disse que iria postar assim que descobrissem como criar um tile onde não tem. Pois bem um cara desse forum chamado kydrai descobriu e coube ao lucas123 mostrar. Parabens kydrai ;D

Script dedicado a vc.

A minnha funçao é essa:

function doCreateTile(id,pos) -- By mock
doAreaCombatHealth(0,0,pos,0,0,0,255)
doCreateItem(id,1,pos)
end

E a dele é essa:

function doCreateTile(cid, tileid, pos) -- by Kydrai
       doCombatAreaHealth(cid, 0, pos, 0, 0, 0, CONST_ME_NONE)
       doCreateItem(tileid, 1, pos)
end

O principio é o mesmo. Abusar de um bug do distro que cria um tile quando executa uma spell. E com o tile pode criar o SQM.

 

Bom vamos começar.

Primeiro crie um arquivo chamado flylib.lua na pasta data/lib do seu server e coloque isso:

CONST_FLYVOID = 460
CONT_FLYOUTFIT = 239
IGNORED = {6495,7096,7099,5167,5162,5163,405,7100,
5315,5521,5316,5193,5192,5191,945,5048,923,950,951,
952,953,3623,954,955,949,9101,3352,9106,9103,1524,
1111,437,433,443,434,442,436,445,941,444,435,943,
1027,925,930,926,928,922,921,1112,406,904,931,934,
932,933,5319} --- Config here


up = {}
down = {}
fly = {}
fly.win = function(cid)-- Script by mock
setPlayerStorageValue(cid, 102015,1)
doPlayerSendTextMessage(cid,27,'Now you can fly.')
end
fly.add = function(cid)-- Script by mock
if getPlayerStorageValue(cid, 102015) == -1 or getPlayerStorageValue(cid,13241) == 1 then
	return false
end
if getPlayerStorageValue(cid, 102059) <= 0 then
	local outfit = getCreatureOutfit(cid)
	outfit.lookType = CONT_FLYOUTFIT
	doSetCreatureOutfit(cid, outfit, -1)
	setPlayerStorageValue(cid, 102059,1)
	doChangeSpeed(cid, 390)
	doPlayerSendTextMessage(cid,27,'Fale \'up\' e \'down\'.' )
	return true
else
	doPlayerSendTextMessage(cid,27, "Você ja esta voando.")
	return false
end

end
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 3 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
fly.using=function(cid)-- Script by mock
  return getPlayerStorageValue(cid, 102059) > 0
end
fly.logout = function(cid)-- Script by mock
if fly.using(cid) then
	local p = getCreaturePosition(cid)
	setPlayerStorageValue(cid, 102010,1)
	setPlayerStorageValue(cid, 102011,p.x)
	setPlayerStorageValue(cid, 102012,p.y)
	setPlayerStorageValue(cid, 102013,p.z)
	deletarEmVolta(p)
	fly.del(cid)
end
return true
end
fly.login = function(cid)-- Script by mock
if getPlayerStorageValue(cid, 102010) ~= -1 then
	setPlayerStorageValue(cid, 102010,-1)
	local p = {}
	p.x = getPlayerStorageValue(cid, 102011)
	p.y = getPlayerStorageValue(cid, 102012)
	p.z = getPlayerStorageValue(cid, 102013)
	if not checkAround(p) then
		fly.add(cid)
		down.gerarEmVolta(p)
		doTeleportThing(cid,p)
	end
end
return true
end
fly.die = function(cid)-- Script by mock
if fly.using(cid) then
	local p = getCreaturePosition(cid)
	setPlayerStorageValue(cid, 102011,-1)
	setPlayerStorageValue(cid, 102012,-1)
	setPlayerStorageValue(cid, 102013,-1)
	deletarEmVolta(p)
	fly.del(cid)
end
return true
end
fly.del = function(cid)-- Script by mock
if getPlayerStorageValue(cid, 102059) > 0 then
	if getSqmId(getCreaturePosition(cid)).itemid == CONST_FLYVOID then
		return false
	end
	doRemoveCondition(cid, CONDITION_OUTFIT)
	setPlayerStorageValue(cid, 102059,-1)
	doChangeSpeed(cid, -390)
	return true
end
end
function hasSqm2(pos)-- Script by mock
local f = getTileThingByPos(pos)
if f.itemid ~= 0 and f.itemid ~= 1 and (not isWalkable(pos)  and not isInArray(IGNORED,f.itemid)) then
	return true
end
return false
end
function hasSqm3(pos)-- Script by mock
local f = getTileThingByPos(pos)
if f.itemid ~= 0 and f.itemid ~= 1 and f.itemid ~= CONST_FLYVOID and not isInArray(IGNORED,f.itemid)  then
	return true
end
return false
end
function deletar(pos)-- Script by mock
if hasSqm(pos) then
	local sqm = getSqmId(pos)
	if sqm.itemid == CONST_FLYVOID then
		doRemoveItem(sqm.uid,1)
	end
end
end
function deletarEmVolta(pos)
for x=-1,1 do
	for y=-1,1 do
		deletar({x=pos.x+x,y=pos.y+y,z=pos.z})
	end
end
end
function checkAround(pos)-- Script by mock
for x=-1,1 do
	for y=-1,1 do
		if hasSqm2({x=pos.x+x,y=pos.y+y,z=pos.z}) then
			return true
		end
	end
end
return false
end

function fly.checkAround(pos)-- Script by mock
local n = 0
for x=-1,1 do
	for y=-1,1 do
		local g = getTileThingByPos({x=pos.x+x,y=pos.y+y,z=pos.z})

		if g.itemid == CONST_FLYVOID then
			n = n+1
		end
		if isCreature(getTopCreature({x=pos.x+x,y=pos.y+y,z=pos.z}).uid) then
			return false
		end
	end
end
if n == 9 then
	return true
end
return false
end

function up.checkAround(pos)-- Script by mock
for x=-1,1 do
	for y=-1,1 do
	local g = getTileThingByPos({x=pos.x+x,y=pos.y+y,z=pos.z})
		if hasSqm3({x=pos.x+x,y=pos.y+y,z=pos.z}) or g.itemid == CONST_FLYVOID then
			return true
		end
	end
end
return false
end

function down.checkAround(pos,f)-- Script by mock
for x=-1,1 do
	for y=-1,1 do
	local g = getTileThingByPos({x=pos.x+x,y=pos.y+y,z=pos.z})
		if (not f and hasSqm2({x=pos.x+x,y=pos.y+y,z=pos.z})) or g.itemid == CONST_FLYVOID then
			return true
		end
	end
end
return false
end
function gerarEmVolta(pos)-- Script by mock
local n = 30000
for x=-1,1 do
	for y=-1,1 do
		n =n+1
		doItem({x=pos.x+x,y=pos.y+y,z=pos.z},n)
	end
end
end
function doItem(pos,a,d)-- Script by mock
if not hasSqm2(pos) then
	doCreateTile(CONST_FLYVOID,pos)
	pos.stackpos = 0
	local c = getTileThingByPos(pos)
	doSetItemActionId(c.uid, a)
end
end
function getSqmId(pos,t)-- Script by mock
if hasSqm(pos) or t then
	pos.stackpos = 0
	local i = getTileThingByPos(pos)
	return i
end
return nil
end

function down.doItem(pos,a)-- Script by mock
if not hasSqm(pos) then
	doCreateTile(CONST_FLYVOID,pos)
	pos.stackpos = 0
	local c = getTileThingByPos(pos)
	doSetItemActionId(c.uid, a)
end
end

function down.gerarEmVolta(pos)-- Script by mock
local n = 30000
for x=-1,1 do
	for y=-1,1 do
		n =n+1
		down.doItem({x=pos.x+x,y=pos.y+y,z=pos.z},n)
	end
end
end

function doCreateTile(id,pos) -- Script by mock
doAreaCombatHealth(0,0,pos,0,0,0,255)
doCreateItem(id,1,pos)
end

 

Agora é 1 scritp em creaturescripts, 3 em talkactions e 1 em movements.

Creaturescripts

Em seu login.lua coloque isso:

fly.login(cid)

no seu logout.lua coloque isso:

fly.logout(cid)

e no script que o player morre coloque isso:

fly.die(cid)

Isso é para quando o player entrar e sair do server pra voltar onde ele estava :coolface:

Movements

Em movements.xml:

<movevent type="StepIn" actionid="30001" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30002" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30003" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30004" event="script" value="fly.lua"/>
<movevent type="StepOut" actionid="30005" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30006" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30007" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30008" event="script" value="fly.lua"/>
<movevent type="StepIn" actionid="30009" event="script" value="fly.lua"/>
<movevent type="AddItem" tileitem="1" itemid="460" event="script" value="fly.lua"/>

E no script fly.lua

---Script by mock the bear
function doCopyItem(item,pos) ---Script by mock the bear
for i=1,6 do
	pos.z = pos.z+1
	if hasSqm(pos) and getSqmId(pos).itemid ~= 10217 then
			local i = doCreateItem(item.itemid,item.type,pos)
			if item.actionid ~= 0 then
				doSetItemActionid(i,item.actionid)
			end
			doSendMagicEffect(pos,9)
			return i
	else
		local p2 = {x=pos.x+1,y=pos.y+1,z=pos.z}
		doSendDistanceShoot(pos,p2,40)
		doSendMagicEffect(pos,2)
	end
end
end
function onAddItem(item,pos,k) ---Script by mock the bear
 doCopyItem(item,k)
 doRemoveItem(item.uid,item.type == 0 and 1 or item.type)
end
function onStepIn(cid, item, position, fromPosition) ---Script by mock the bear
local dir = {
[30004] = {0,6,7},
[30007] = {7,0,6,1,5},
[30008] = {1,5,7},
[30009] = {5,4,2,1,7},
[30006] = {2,5,4},
[30003] = {4,3,6,2,5},
[30002] = {3,4,6},
[30001] = {6,0,7,3,4},
}
if isPlayer(cid) then
	local chkps = {x=position.x,y=position.y,z=position.z}
	local ig = false
	for i,b in pairs(dir[item.actionid]) do
		local nw = getPosByDir(chkps,b)
		local g = getTileThingByPos(nw)
		if hasSqm3(nw) or g.itemid == CONST_FLYVOID or nw.x < 35 or nw.y < 35 then
			ig = true
			break
		end
	end
	if not ig then
		deletarEmVolta(fromPosition)
		gerarEmVolta(getCreaturePosition(cid))
	else
		doTeleportThing(cid,fromPosition,false)
		doPlayerSendTextMessage(cid,27, "Sorry, you cannot fly here.")
	end
end
end
function onStepOut(cid, item, position, fromPosition,q)
addEvent(function(pos) if fly.checkAround(pos) then deletarEmVolta(pos) end end,10000,position)
end

Talkactions

Em talkactions.xml

<talkaction words="up" case-sensitive="no" event="script" value="flyup.lua"/>
<talkaction words="down" case-sensitive="no" event="script" value="flydown.lua"/>
<talkaction words="!fly" case-sensitive="no" event="script" value="fly.lua"/>

Em fly.lua

function onSay(cid, words, param) --- By moc kthe bear (MTB)
if param ~= '' and getPlayerGroupId(cid) > 3 then
	local cida = getPlayerByName(param)
	if cida and isPlayer(cida) then
		fly.win(cida)
	end
	return true
end
if fly.using(cid)  then
	local p = getCreaturePosition(cid)
	p.stackpos = 0
	local f = getTileThingByPos(p)
	if fly.del(cid) then
		if f.itemid ~= 0 and f.itemid ~= 1 and f.itemid ~= CONST_FLYVOID then
			return true
		else
			setPlayerStorageValue(cid,10941,1)
			local p = getCreaturePosition(cid)
			setPlayerStorageValue(cid, 102011,p.x)
			setPlayerStorageValue(cid, 102012,p.y)
			setPlayerStorageValue(cid, 102013,p.z)
			return true
		end
	else
		doPlayerSendTextMessage(cid,27,'You cannot turn off the fly here.')
	end
else
	if fly.add(cid) then
		local pos = getCreaturePosition(cid)
		if getSqmId(pos).itemid == 10217 then
			down.gerarEmVolta(pos)
		end
		return true
	else
		doPlayerSendTextMessage(cid,27,'You cannot fly.')
		return true
	end
end
return true
end

Flyup.lua

function onSay(cid)--- By moc kthe bear (MTB)
local time = os.time()
if time < getPlayerStorageValue(cid, 102054) then
	doPlayerSendCancel(cid, "You are exhausted.")
	return true
end
if not fly.using(cid) then
	return false
end
local pos = getCreaturePosition(cid)
pos.z = pos.z-1
if hasSqm(pos) or pos.z < 0 or up.checkAround(pos) then
	doPlayerSendTextMessage(cid,27,'You cannot fly higger.')
	return true
else
	gerarEmVolta(pos)
	doTeleportThing(cid,pos)
	pos.z = pos.z+1
	deletarEmVolta(pos)
end
return true
end

Flydown.lua

function onSay(cid)--- By moc kthe bear (MTB)
local time = os.time()
if time < getPlayerStorageValue(cid, 102054) then
	doPlayerSendCancel(cid, "You are exhausted.")
	return true
end
if not fly.using(cid) then
	return false
end
local pos = getCreaturePosition(cid)
pos.stackpos = 0
local g = getTileThingByPos(pos)
pos.z = pos.z+1
local f = getTileThingByPos(pos)
if getSqmId(getCreaturePosition(cid)).itemid ~= CONST_FLYVOID
	or down.checkAround(pos)
	or (g.itemid ~= CONST_FLYVOID and f.itemid ~= CONST_FLYVOID and f.itemid ~= 0 and f.itemid ~= 1)
	or (not isWalkable(pos,true,false,false) and hasSqm(pos))
	or (hasSqm(pos) and not getTileHouseInfo(pos)) == 0 then
	doPlayerSendTextMessage(cid,27,'You cannot go to down here.')
	return true
else
	down.gerarEmVolta(pos)
	doTeleportThing(cid,pos)
	pos.z = pos.z-1
	deletarEmVolta(pos)
end
return true
end

 

E pronto. Esse não tem o recurso de cair que tem no video por que aquilo é do K.A junto do flysystem 2.0. Esse ja foi do K.A porem agora ele tem um melhor. Esse ai é bom sim porem não serve mais pro k.a entao ta liberado. Façam bom uso modifiquem da forma que quiserem corrijam os bugs e repostem melhorado contanto que nao tire meus creditos. Lembrando que nao precisa mudança na source.

 

 

Eu sei ta um pog do baralho nao tive paciencia pra faze um remake.

Se gostaram clica no meu ovinho da assinatura

 

wink.gif

 



fanmock.png

Kydrai

"Keep Your Mind Wide Open"
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 21/08/06Posts: 250

Esse fly realmente é bem melhor do que colocar tile no mapa todo.

Ótimo script.

~ Kydrai
Programador / Scripter

 

sign.png

Saymon14

.
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 05/05/10Posts: 544

u.u Sistemas novos me dão tesão

 

Cara muito legal o script, ja tinha visto a função do Kydrai tambem, ja esperava coisa boa de voce.



 

REP +

 

Edit--

 

Mock, que ovinho voce ta falando ?

 

- Att. Saymon, Abraços.

 

Não entro em equipes, já tenho meu projeto, não insista.

 

 

 

 

 

 

Easy Mapper Map Editor 8.60: Clique aqui

[8.60] BeastXHunter: Clique aqui

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

eu ja tinha acompanhado alguns dos seus script e um deles era esse sistema do fly,dei uma olhada pelo youtube em um dos seus videos realmente muito bom

parabens

 

 

REP +

bossisg.png

ABCDEFGHIJK

Odin
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/12/07Posts: 69

No Meu server nao deu certo, é o TFS 0.3.6 PL 1

Ele não tem o logout.lua e nem o script de morrer (creaturescript)

e quando eu falo !fly so aparece "You cannot fly."

 

Alguem poderia me ajudar?

___________________________________________________

 

 

Pokemon Challenge Online

21225_6.png

_____________________________________________________________

 

Meus trabalhos e ajudas:

 

 

coelho

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 22/08/07Posts: 3

tentei testar o system mais algo esta dando errado. ;/

é preciso ter algum item em especial? somente a outfit de wyvern?

ABCDEFGHIJK

Odin
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/12/07Posts: 69

ninguem pode me ajudar?

___________________________________________________

 

 

Pokemon Challenge Online

21225_6.png

_____________________________________________________________

 

Meus trabalhos e ajudas:

 

 

lucas2941

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/07/09Posts: 3Char no Tibia: GM Dark Lucas

aff seis ja pararam para ler o script? kkk

faz assim tipo o logout e o die la se vocês nao tem vocês criam..

 

é só coloca a function onLogout(cid)

o parametro que o mock pede

return true

end

 

msma coisa com o kill só que é function onDie(cid)

 

////////////

digita !fly e seu nick, você tem que setar a storage de quem vai poder voar com esse comando =d

 

// PS: sou o lucas123 =D

lais16gatinha

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 25/06/10Posts: 34Char no Tibia: Lais Figueiredo

Otimo Script

 

Porém prefiro o meu por talkactions, mais simples, tem comandos pra subir e pra descer ^^

:lol²:

 

@YahooABC

 

Coloque o Tile 460 (void), no seu map editor, no ultimo andar, onde os players poderão voar.

Mas no script dele não precisa :winksmiley02:

Mapper & Scripter Especialista em Templos Breve Site para Pedidos Gratuitos

Metas:

1 post [x] muleka

5 posts [x] estudante

10 posts [x] Gennin

30 posts [x] Chunnin

50 posts [ ] Anbu

60 posts [ ] Jounnin

80 posts [ ] Jounnin especial

200 posts [ ] Naruto Shippuden

500 posts [ ] Sannin

800 posts [ ] Kage

1000 posts [ ] Minato

 

Rumo a ANBU

 

 

 

Meuoserv

ADM Killer
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/10/09Posts: 29

olha gente fui testa ese script no mue ot e nao funfou tipow ele tem q diser !fly e o nome do char mas quando eu flao iso ele fala q é pra fal up ou down mas quando flao up ele da eror e nao sai do lugar alguam pode me ajuda????????? olha os eror no up e no down

 

 

 

up:

 

 [Error - TalkAction Interface] 
data/talkactions/scripts/fly/flyup.lua:onSay
Description: 
data/talkactions/scripts/fly/flyup.lua:12: attempt to call global 'hasSqm' (a nil value)
stack traceback:
data/talkactions/scripts/fly/flyup.lua:12: in function <data/talkactions/scripts/fly/flyup.lua:1>

 

down:

 

 [Error - TalkAction Interface] 
data/talkactions/scripts/fly/flydown.lua:onSay
Description: 
data/lib/flylib.lua:205: attempt to call global 'hasSqm' (a nil value)
stack traceback:
data/lib/flylib.lua:205: in function 'getSqmId'
data/talkactions/scripts/fly/flydown.lua:15: in function <data/talkactions/scripts/fly/flydown.lua:1>

 

gente quando eu logo ele da isto

 

 

[Error - CreatureScript Interface] 
data/creaturescripts/scripts/login.lua:onLogin
Description: 
data/lib/flylib.lua:214: attempt to call global 'hasSqm' (a nil value)
stack traceback:
	data/lib/flylib.lua:214: in function 'doItem'
	data/lib/flylib.lua:227: in function 'gerarEmVolta'
	data/lib/flylib.lua:76: in function 'login'
	data/creaturescripts/scripts/login.lua:17: in function <data/creaturescripts/scripts/login.lua:6>

 

 

 

 

 

AJUDEM PLEASEEE

 

Seja um mapper.



"Nós, mappers, somos deuses pois temos o dom de criar a partir de nossa imaginação.

Use e abuse da criatividade.

Nao faça mapas com sentido, dê seu propio sentido a eles.

Se supere em relação aos outros.

Nao siga os conceitos de mapping, de o seu conceito a tudo.

Nao seja um aprendiz, vire seu propio mestre.

Vire uma lenda nessa nobre arte."

 

 

 

[X]1post

[x]5 posts (SERVO)

[x]10 posts (CAMPONÊS)

[x]25 posts (CAÇADOR)

[x]50 posts (CAVALEIRO)

[]100 posts (BARONETE)

[ ]200 posts (BARÃO)

[ ]300 posts (VISCONDE)

[ ]400 posts (DUQUE)

[ ]600 posts (ARQUEDUQUE)

[ ]800 posts (ARISTOCRATA)

[ ]1000 posts (REGENTE)

 

 

Ajudei????? REP + :)

ABCDEFGHIJK

Odin
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/12/07Posts: 69

troque a sua "flylib" por essa aqui que da certo

 

CONST_FLYVOID = 460
CONT_FLYOUTFIT = 239
IGNORED = {6495,7096,7099,5167,5162,5163,405,7100,
5315,5521,5316,5193,5192,5191,945,5048,923,950,951,
952,953,3623,954,955,949,9101,3352,9106,9103,1524,
1111,437,433,443,434,442,436,445,941,444,435,943,
1027,925,930,926,928,922,921,1112,406,904,931,934,
932,933,5319} --- Config here


up = {}
down = {}
fly = {}
fly.win = function(cid)-- Script by mock
setPlayerStorageValue(cid, 102015,1)
doPlayerSendTextMessage(cid,27,'Now you can fly.')
end
fly.add = function(cid)-- Script by mock
if getPlayerStorageValue(cid, 102015) == -1 or getPlayerStorageValue(cid,13241) == 1 then
	return false
end
if getPlayerStorageValue(cid, 102059) <= 0 then
	local outfit = getCreatureOutfit(cid)
	outfit.lookType = CONT_FLYOUTFIT
	doSetCreatureOutfit(cid, outfit, -1)
	setPlayerStorageValue(cid, 102059,1)
	doChangeSpeed(cid, 390)
	doPlayerSendTextMessage(cid,27,'Fale \'up\' e \'down\'.' )
	return true
else
	doPlayerSendTextMessage(cid,27, "Você ja esta voando.")
	return false
end

end
function doSetItemActionId(uid,aid)
doItemSetAttribute(uid,'aid',aid)
end
function hasSqm(pos)-- by Mock
return getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpos=0}).itemid ~= 0
end
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 3 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
fly.using=function(cid)-- Script by mock
  return getPlayerStorageValue(cid, 102059) > 0
end
fly.logout = function(cid)-- Script by mock
if fly.using(cid) then
	local p = getCreaturePosition(cid)
	setPlayerStorageValue(cid, 102010,1)
	setPlayerStorageValue(cid, 102011,p.x)
	setPlayerStorageValue(cid, 102012,p.y)
	setPlayerStorageValue(cid, 102013,p.z)
	deletarEmVolta(p)
	fly.del(cid)
end
return true
end
fly.login = function(cid)-- Script by mock
if getPlayerStorageValue(cid, 102010) ~= -1 then
	setPlayerStorageValue(cid, 102010,-1)
	local p = {}
	p.x = getPlayerStorageValue(cid, 102011)
	p.y = getPlayerStorageValue(cid, 102012)
	p.z = getPlayerStorageValue(cid, 102013)
	if not checkAround(p) then
		fly.add(cid)
		down.gerarEmVolta(p)
		doTeleportThing(cid,p)
	end
end
return true
end
fly.die = function(cid)-- Script by mock
if fly.using(cid) then
	local p = getCreaturePosition(cid)
	setPlayerStorageValue(cid, 102011,-1)
	setPlayerStorageValue(cid, 102012,-1)
	setPlayerStorageValue(cid, 102013,-1)
	deletarEmVolta(p)
	fly.del(cid)
end
return true
end
fly.del = function(cid)-- Script by mock
if getPlayerStorageValue(cid, 102059) > 0 then
	if getSqmId(getCreaturePosition(cid)).itemid == CONST_FLYVOID then
		return false
	end
	doRemoveCondition(cid, CONDITION_OUTFIT)
	setPlayerStorageValue(cid, 102059,-1)
	doChangeSpeed(cid, -390)
	return true
end
end
function hasSqm2(pos)-- Script by mock
local f = getTileThingByPos(pos)
if f.itemid ~= 0 and f.itemid ~= 1 and (not isWalkable(pos)  and not isInArray(IGNORED,f.itemid)) then
	return true
end
return false
end
function hasSqm3(pos)-- Script by mock
local f = getTileThingByPos(pos)
if f.itemid ~= 0 and f.itemid ~= 1 and f.itemid ~= CONST_FLYVOID and not isInArray(IGNORED,f.itemid)  then
	return true
end
return false
end
function deletar(pos)-- Script by mock
if hasSqm(pos) then
	local sqm = getSqmId(pos)
	if sqm.itemid == CONST_FLYVOID then
		doRemoveItem(sqm.uid,1)
	end
end
end
function deletarEmVolta(pos)
for x=-1,1 do
	for y=-1,1 do
		deletar({x=pos.x+x,y=pos.y+y,z=pos.z})
	end
end
end
function checkAround(pos)-- Script by mock
for x=-1,1 do
	for y=-1,1 do
		if hasSqm2({x=pos.x+x,y=pos.y+y,z=pos.z}) then
			return true
		end
	end
end
return false
end

function fly.checkAround(pos)-- Script by mock
local n = 0
for x=-1,1 do
	for y=-1,1 do
		local g = getTileThingByPos({x=pos.x+x,y=pos.y+y,z=pos.z})

		if g.itemid == CONST_FLYVOID then
			n = n+1
		end
		if isCreature(getTopCreature({x=pos.x+x,y=pos.y+y,z=pos.z}).uid) then
			return false
		end
	end
end
if n == 9 then
	return true
end
return false
end

function up.checkAround(pos)-- Script by mock
for x=-1,1 do
	for y=-1,1 do
	local g = getTileThingByPos({x=pos.x+x,y=pos.y+y,z=pos.z})
		if hasSqm3({x=pos.x+x,y=pos.y+y,z=pos.z}) or g.itemid == CONST_FLYVOID then
			return true
		end
	end
end
return false
end

function down.checkAround(pos,f)-- Script by mock
for x=-1,1 do
	for y=-1,1 do
	local g = getTileThingByPos({x=pos.x+x,y=pos.y+y,z=pos.z})
		if (not f and hasSqm2({x=pos.x+x,y=pos.y+y,z=pos.z})) or g.itemid == CONST_FLYVOID then
			return true
		end
	end
end
return false
end
function gerarEmVolta(pos)-- Script by mock
local n = 30000
for x=-1,1 do
	for y=-1,1 do
		n =n+1
		doItem({x=pos.x+x,y=pos.y+y,z=pos.z},n)
	end
end
end
function doItem(pos,a,d)-- Script by mock
if not hasSqm2(pos) then
	doCreateTile(CONST_FLYVOID,pos)
	pos.stackpos = 0
	local c = getTileThingByPos(pos)
	doSetItemActionId(c.uid, a)
end
end
function getSqmId(pos,t)-- Script by mock
if hasSqm(pos) or t then
	pos.stackpos = 0
	local i = getTileThingByPos(pos)
	return i
end
return nil
end

function down.doItem(pos,a)-- Script by mock
if not hasSqm(pos) then
	doCreateTile(CONST_FLYVOID,pos)
	pos.stackpos = 0
	local c = getTileThingByPos(pos)
	doSetItemActionId(c.uid, a)
end
end

function down.gerarEmVolta(pos)-- Script by mock
local n = 30000
for x=-1,1 do
	for y=-1,1 do
		n =n+1
		down.doItem({x=pos.x+x,y=pos.y+y,z=pos.z},n)
	end
end
end

function doCreateTile(id,pos) -- Script by mock
doAreaCombatHealth(0,0,pos,0,0,0,255)
doCreateItem(id,1,pos)
end

 

Espero ter Ajudado

___________________________________________________

 

 

Pokemon Challenge Online

21225_6.png

_____________________________________________________________

 

Meus trabalhos e ajudas:

 

 

Meuoserv

ADM Killer
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/10/09Posts: 29

yahooABC

 

Funcionou tem alguns errors ainda mas esta funcionando posso voar se voce puder me add msn

 

Menino_5684@hotmail.com

 

add ai ;) dai nois se fala

 

Seja um mapper.



"Nós, mappers, somos deuses pois temos o dom de criar a partir de nossa imaginação.

Use e abuse da criatividade.

Nao faça mapas com sentido, dê seu propio sentido a eles.

Se supere em relação aos outros.

Nao siga os conceitos de mapping, de o seu conceito a tudo.

Nao seja um aprendiz, vire seu propio mestre.

Vire uma lenda nessa nobre arte."

 

 

 

[X]1post

[x]5 posts (SERVO)

[x]10 posts (CAMPONÊS)

[x]25 posts (CAÇADOR)

[x]50 posts (CAVALEIRO)

[]100 posts (BARONETE)

[ ]200 posts (BARÃO)

[ ]300 posts (VISCONDE)

[ ]400 posts (DUQUE)

[ ]600 posts (ARQUEDUQUE)

[ ]800 posts (ARISTOCRATA)

[ ]1000 posts (REGENTE)

 

 

Ajudei????? REP + :)

guixap

Beyond Sky
avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 30/09/08Posts: 174Char no Tibia: Knight do Momento

Funcionando 100% Mock

Coloquei tudo certin aki.

Deu e está muito bom. Eu estou imaginando

como está o do K.A. que você citou ser melhor

que esse jah. Vlws, esse fly system é o melhor

que com certeza a tanto por não precisar fica modificando

coisas no Mapa e por ser mais complexo contra os possiveis

bugs que os outros permitem.

Desvendando Scripting:



Thanks: Marcelin e Demonbholder

 

yeti.gif

Meuoserv

ADM Killer
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/10/09Posts: 29

Ou pessoal olha o que ta disendo no meu ot quando eu coloquei o fly

 

Quando o player loga aparece isto:

[21/10/2010  11:53:35] Lua Script Error: [CreatureScript Interface] 
[21/10/2010  11:53:35] data/creaturescripts/scripts/login.lua:onLogin

[21/10/2010  11:53:35] data/creaturescripts/scripts/login.lua:3: attempt to index global 'fly' (a nil value)

[21/10/2010  11:53:35] Lua Script Error: [CreatureScript Interface] 
[21/10/2010  11:53:35] data/creaturescripts/scripts/login.lua:onLogin

[21/10/2010  11:53:35] data/creaturescripts/scripts/login.lua:3: attempt to index global 'fly' (a nil value)

 

quando falo "UP"

[21/10/2010  11:54:21] Lua Script Error: [TalkAction Interface] 
[21/10/2010  11:54:21] data/talkactions/scripts/fly/flyup.lua:onSay

[21/10/2010  11:54:21] data/talkactions/scripts/fly/flyup.lua:7: attempt to index global 'fly' (a nil value)

 

Quando falo "DOWN"

 

[21/10/2010  11:54:48] Lua Script Error: [TalkAction Interface] 
[21/10/2010  11:54:48] data/talkactions/scripts/fly/flydown.lua:onSay

[21/10/2010  11:54:48] data/talkactions/scripts/fly/flydown.lua:7: attempt to index global 'fly' (a nil value)

 

 

quando eu falo !fly ele nao fas anda se alguem puder me ajudar eu agradeço estou usando um otserv 8.1

 

agradeço desde já !!!!

 

REP+ pra quem puder me ajudar :)

 

Seja um mapper.



"Nós, mappers, somos deuses pois temos o dom de criar a partir de nossa imaginação.

Use e abuse da criatividade.

Nao faça mapas com sentido, dê seu propio sentido a eles.

Se supere em relação aos outros.

Nao siga os conceitos de mapping, de o seu conceito a tudo.

Nao seja um aprendiz, vire seu propio mestre.

Vire uma lenda nessa nobre arte."

 

 

 

[X]1post

[x]5 posts (SERVO)

[x]10 posts (CAMPONÊS)

[x]25 posts (CAÇADOR)

[x]50 posts (CAVALEIRO)

[]100 posts (BARONETE)

[ ]200 posts (BARÃO)

[ ]300 posts (VISCONDE)

[ ]400 posts (DUQUE)

[ ]600 posts (ARQUEDUQUE)

[ ]800 posts (ARISTOCRATA)

[ ]1000 posts (REGENTE)

 

 

Ajudei????? REP + :)

mrleek

Mr Leek
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/03/11Posts: 29Char no Tibia: Zeiko Valentine

Caramba, desculpa mesmo gente, eu acho que esse negocio de postar em topicos muito antigos é reviver topicos e blablabla... Mas eu estou com um problema aqui e n sei aonde postar entao se alguem puder me dar uma ajudinha: É que eu peguei esse sistema ai so que eu consigo usar ele somente no meu char GOD, nos chars normais eu n consigo usar, porque sera isso? e se alguem souber por favor poste um ai que nao tenha esse problema, ou entao me diga oque esta aconteçendo com o meu.... Obrigado desde ja,

 

~~

~~

Att. :XTibia_smile:

1_Zeiko+Vallentine.png
  • 1
  • 2