Ir para conteúdo
Entre para seguir isso  
OlhoHell

Surf Sistem :)

Recommended Posts

OlhoHell    1
OlhoHell

Author:Thiago Freitas - OlhoHell

 

Se for movido para Exclusivos eu Aceito :) - Bom vou disponibilizar o sistema surf para vocês que estão criando um serve de pokemon :)OBS. hj estou com pressa então só vou por vocês tentem arrumar ae :)

 

Para Que Serve?

serve para como botar o tipow de pokemon como usar em um item ou bixo para nadar e mudara a outfit dentro da agua :D

 

 

East

dofile(getDataDir() .. 'movements/scripts/swimming/swimlib.lua')

function onStepIn(cid, item, pos)
return checkSwim(cid, EAST, WEST)
end

 

North

dofile(getDataDir() .. 'movements/scripts/swimming/swimlib.lua')

function onStepIn(cid, item, pos)
return checkSwim(cid, NORTH, SOUTH)
end

 

Sul

dofile(getDataDir() .. 'movements/scripts/swimming/swimlib.lua')

function onStepIn(cid, item, pos)
return checkSwim(cid, SOUTH, NORTH)
end

 

West

dofile(getDataDir() .. 'movements/scripts/swimming/swimlib.lua')

function onStepIn(cid, item, pos)
return checkSwim(cid, WEST, EAST)
end

 

swimlib <-- aqui é onde vc escolhe a outift :)

local outfit = {lookType = 267, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local conditions =
{
CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY,
CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN,
CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED
}

function checkSwim(cid, swimDir, backDir)
local posNow = getThingPos(cid)

if(hasCondition(cid, CONDITION_OUTFIT) == TRUE and getCreatureOutfit(cid).lookType == outfit.lookType) then
	doMoveCreature(cid, backDir)
	doRemoveCondition(cid, CONDITION_OUTFIT)
elseif(doTileQueryAdd(cid, getPosByDir(posNow, swimDir), 4) ~= RETURNVALUE_NOERROR) then
	return FALSE
else
	-- Remove all bad conditions before swimming
	for i, v in ipairs(conditions) do
		if(hasCondition(cid, v) == TRUE) then
			doRemoveCondition(cid, v)
		end
	end

	doMoveCreature(cid, swimDir)
	doSetCreatureOutfit(cid, outfit, -1)
	doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
end
return TRUE
end

vai em movements/scripts/ cria uma pasta swimming dentro dela swimlib

local conditions =
{
CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY,
CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN,
CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED
}

local outfit = {lookType = 267, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}

function checkSwim(cid, swimDir, backDir)
local posNow = getThingPos(cid)

if(hasCondition(cid, CONDITION_OUTFIT) == TRUE and getCreatureOutfit(cid).lookType == outfit.lookType) then
	doMoveCreature(cid, backDir)
	doRemoveCondition(cid, CONDITION_OUTFIT)
else
	if(queryTileAddThing(cid, getPosByDir(posNow, swimDir), 4) ~= RETURNVALUE_NOERROR) then
		return FALSE
	end

	-- Remove all bad conditions before swimming
	for i, v in ipairs(conditions) do
		if(hasCondition(cid, v) == TRUE) then
			doRemoveCondition(cid, v)
		end
	end

	doMoveCreature(cid, swimDir)
	doSetCreatureOutfit(cid, outfit, -1)
	doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
end
return TRUE
end

 

swimming

local outfit = {lookType = 267, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}

local BORDERS = {
[7943] = {x = 0, y = -2, back = SOUTH},
[7944] = {x = -2, y = 0, back = EAST},
[7945] = {x = 0, y = 2, back = NORTH},
[7946] = {x = 2, y = 0, back = WEST},
[7947] = {x = 2, y = 1, back = WEST},
[7948] = {x = -2, y = 1, back = NORTH},
[7949] = {x = 2, y = -1, back = WEST},
[7950] = {x = -2, y = -1, back = EAST},
[7951] = {x = 2, y = 2, back = WEST},
[7952] = {x = -2, y = 2, back = NORTH},
[7953] = {x = 2, y = -2, back = WEST},
[7954] = {x = -2, y = -2, back = SOUTH}
}

BORDERS[4828] = BORDERS[7943]
BORDERS[4829] = BORDERS[7944]
BORDERS[4830] = BORDERS[7945]
BORDERS[4831] = BORDERS[7946]
BORDERS[7948] = BORDERS[7947]
BORDERS[7950] = BORDERS[7949]
BORDERS[7952] = BORDERS[7951]
BORDERS[7954] = BORDERS[7953]


function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
	return true
end

local border = BORDERS[item.itemid]
if(not border) then
	return false
end

local pos, newPos = getCreaturePosition(cid), {}
newPos = pos
newPos.x = pos.x + border.x
newPos.y = pos.y + border.y

if(hasCondition(cid, CONDITION_OUTFIT) and getCreatureOutfit(cid).lookType == outfit.lookType) then
	doMoveCreature(cid, border.back)
	doRemoveCondition(cid, CONDITION_OUTFIT)
else
	if(doTileQueryAdd(cid, pos, 4) ~= RETURNVALUE_NOERROR) then
		return false
	end

	local tmp = getCreaturePosition(cid)
	doTeleportThing(cid, newPos)

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(tmp, CONST_ME_POFF)
		doSendMagicEffect(newPos, CONST_ME_WATERSPLASH)
	end

	doRemoveConditions(cid, true)
	doSetCreatureOutfit(cid, outfit, -1)
end

return true
end

 

@Edit

eu para por todos os pokemons criei mais e pegou testem ae eu botei separado cada um para ficar facil de mexer :)

 

Ajudei? Posta :D e Aprova :D

Editado por OlhoHell

Compartilhar este post


Link para o post
Oneshot    24
Oneshot

Aprovado e Movido.

Compartilhar este post


Link para o post
Mesuko    0
Mesuko

Vai ajudar , quem não ter surf ,

Apesar de eu ja ter o meu ,

vo agredece pois vc coloko pra nos ae ^^

Compartilhar este post


Link para o post
xhaos    0
xhaos

@topic

ta bom o surf , mesmo eu tendo um muito parecido que ja veio com um TFS , e o meu de pokemon ser melhor

 

 

@off

 

caramba SISTEM é pra acaba ):

Compartilhar este post


Link para o post
OlhoHell    1
OlhoHell

Vlw ae gente :D

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×