What's new

P?ywanie

Status
Not open for further replies.

Black Blade

Active User
Joined
Jun 6, 2008
Messages
113
Reaction score
5
Du?o os?b potrzebuje tego skryptu na tibie 7.x (bo na 8.x raczej s?) wi?c go wklejam na to forum:)

Wchodzimy w data/movements/scripts i robimy plik swim.lua a do niego wklejamy:
Code:
function onStepIn(cid, item, pos)

beachpos = {x=pos.x, y=pos.y, z=pos.z, stackpos=253}
getplayer = getThingfromPos(beachpos)

outfit = {lookType=267,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}
outfitTime = 9000000

swimstorage = 33

swimstatus = getPlayerStorageValue(cid,swimstorage)

	if item.itemid == 7944 then
		if swimstatus == -1 or swimstatus == 0 then
		          npos = {x=pos.x-1, y=pos.y, z=pos.z}
		          doTeleportThing(getplayer.uid,npos)
		          doSendMagicEffect(npos, 53)
			  doSetCreatureOutfit(cid, outfit, outfitTime)
			  setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
			  npos = {x=pos.x+1, y=pos.y, z=pos.z}
		          doTeleportThing(getplayer.uid,npos)
			  doRemoveCondition(cid, 6)
			  setPlayerStorageValue(cid,swimstorage,0)	
		end


	elseif item.itemid == 7946 then
		if swimstatus == -1 or swimstatus == 0 then
		          npos = {x=pos.x+1, y=pos.y, z=pos.z}
		          doTeleportThing(getplayer.uid,npos)
		          doSendMagicEffect(npos, 53)
			  doSetCreatureOutfit(cid, outfit, outfitTime)
			  setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
			  npos = {x=pos.x-1, y=pos.y, z=pos.z}
		          doTeleportThing(getplayer.uid,npos)
			  doRemoveCondition(cid, 6)
			  setPlayerStorageValue(cid,swimstorage,0)
		end


	elseif item.itemid == 7943 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
			  npos = {x=pos.x, y=pos.y+1, z=pos.z}
		          doTeleportThing(getplayer.uid,npos)
			  doRemoveCondition(cid, 6)
			  setPlayerStorageValue(cid,swimstorage,0)
		end


	elseif item.itemid == 7945 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7950 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x-1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x+1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7948 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x-1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x+1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7947 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x+1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x-1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

		
	elseif item.itemid == 7949 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x+1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x-1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7951 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x+1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x-1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7952 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x-1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x+1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7953 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x+1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x-1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end

	elseif item.itemid == 7954 then
		if swimstatus == -1 or swimstatus == 0 then
		         npos = {x=pos.x-1, y=pos.y-1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
		         doSendMagicEffect(npos, 53)
			 doSetCreatureOutfit(cid, outfit, outfitTime)
			 setPlayerStorageValue(cid,swimstorage,1)
			  doRemoveCondition(cid, 2)
		else
		         npos = {x=pos.x+1, y=pos.y+1, z=pos.z}
		         doTeleportThing(getplayer.uid,npos)
			 doRemoveCondition(cid, 6)
			 setPlayerStorageValue(cid,swimstorage,0)
		end


	end
	return 1
end

Teraz w data/movements i wchodzimy w movements.xml i dodajemy te linijki:
Code:
--------- swiming system ------

<movevent event="StepIn" itemid="7943" script="swim.lua" />
<movevent event="StepIn" itemid="7944" script="swim.lua" />
<movevent event="StepIn" itemid="7945" script="swim.lua" />
<movevent event="StepIn" itemid="7946" script="swim.lua" />

<movevent event="StepIn" itemid="7947" script="swim.lua" />
<movevent event="StepIn" itemid="7948" script="swim.lua" />
<movevent event="StepIn" itemid="7949" script="swim.lua" />
<movevent event="StepIn" itemid="7950" script="swim.lua" />

<movevent event="StepIn" itemid="7951" script="swim.lua" />
<movevent event="StepIn" itemid="7952" script="swim.lua" />
<movevent event="StepIn" itemid="7953" script="swim.lua" />
<movevent event="StepIn" itemid="7954" script="swim.lua" />

Mam nadziej? ?e si? przyda:)
 

ronida

User
Joined
Jul 5, 2008
Messages
16
Reaction score
1
Sorry, za od?wirzanie tematu, ale to nie dzia?a pod 7.x ;/
 

SoX

Active User
Joined
Apr 20, 2008
Messages
125
Reaction score
5
Odp: P?ywanie [7.x-8.x]

Odp: P?ywanie [7.x-8.x]

Na 8.1 nie chodzi ten script!
 

Adus41

Senior User
Joined
May 30, 2008
Messages
582
Reaction score
46
Age
32
Odp: P?ywanie [7.x-8.x]

Odp: P?ywanie [7.x-8.x]

@SoX jakiego u?ywasz silnika??
 

Eziu

User
Joined
Jun 25, 2008
Messages
40
Reaction score
3
Odp: P?ywanie [7.x-8.x]

Odp: P?ywanie [7.x-8.x]

W Remere Walkable sea to id od "4820" do "4825" wi?c nie dzia?a oO
 

dad

New User
Joined
Jan 11, 2009
Messages
8
Reaction score
1
Odp: P?ywanie [7.x-8.x]

Odp: P?ywanie [7.x-8.x]

Ja uzylem tego. To teraz mam caly czas outfit plywaka da rade zmienic ?
 

IceSkull OT

Active User
Joined
Mar 19, 2009
Messages
63
Reaction score
1
Odp: P?ywanie

Powiec prosze czy ten skrypt tez zadzia?a pod tibia 8.4, bo na moim servie nie dzia?a p?ywanie, a niby jest ^^.
 
Status
Not open for further replies.
Top