mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Finished off the teleport script. Still requires all the aetheryte positions filled out.
This commit is contained in:
		| @@ -109,5 +109,5 @@ aetheryteChildLinks = { | ||||
| } | ||||
|  | ||||
| aetheryteTeleportPositions = { | ||||
| 	[1280001] = {0.0, 0.0, 0.0} | ||||
| 	[1280002] = {128, 29.97, 45.83, -35.47} | ||||
| } | ||||
| @@ -11,6 +11,45 @@ eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly) | ||||
| --]] | ||||
|  | ||||
| require ("global") | ||||
| require ("aetheryte") | ||||
|  | ||||
| teleportMenuToAetheryte = { | ||||
| 	[1] = { | ||||
| 		[1] = 1280001, | ||||
| 		[2] = 1280002, | ||||
| 		[3] = 1280003, | ||||
| 		[4] = 1280004, | ||||
| 		[5] = 1280005, | ||||
| 		[6] = 1280006 | ||||
| 	}, | ||||
| 	[2] = { | ||||
| 		[1] = 1280092, | ||||
| 		[2] = 1280093, | ||||
| 		[3] = 1280094, | ||||
| 		[4] = 1280095, | ||||
| 		[5] = 1280096 | ||||
| 	}, | ||||
| 	[3] = { | ||||
| 		[1] = 1280061, | ||||
| 		[2] = 1280062, | ||||
| 		[3] = 1280063, | ||||
| 		[4] = 1280064, | ||||
| 		[5] = 1280065, | ||||
| 		[6] = 1280066 | ||||
| 	}, | ||||
| 	[4] = { | ||||
| 		[1] = 1280031, | ||||
| 		[2] = 1280032, | ||||
| 		[3] = 1280033, | ||||
| 		[4] = 1280034, | ||||
| 		[5] = 1280035, | ||||
| 		[6] = 1280036 | ||||
| 	}, | ||||
| 	[5] = { | ||||
| 		[1] = 1280121, | ||||
| 		[2] = 1280122		 | ||||
| 	} | ||||
| } | ||||
|  | ||||
| function onEventStarted(player, actor, triggerName, isTeleport) | ||||
|  | ||||
| @@ -28,14 +67,17 @@ function onEventStarted(player, actor, triggerName, isTeleport) | ||||
| 				if (aetheryteChoice == nil) then break end | ||||
| 				 | ||||
| 				player:PlayAnimation(0x4000FFA); | ||||
| 				player:SendGameMessage(worldMaster, 34101, 0x20, 2, 0x13883d, 100, 100);	 | ||||
| 				player:SendGameMessage(worldMaster, 34101, 0x20, 2, teleportMenuToAetheryte[regionChoice][aetheryteChoice], 100, 100);	 | ||||
| 				confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);				 | ||||
| 				if (confirmChoice == 1) then | ||||
| 					player:PlayAnimation(0x4000FFB); | ||||
| 					player:SendGameMessage(worldMaster, 34105, 0x20);			 | ||||
| 					--Do teleport					 | ||||
| 					--Do teleport		 | ||||
| 					destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]];			 | ||||
| 					if (destination ~= nil) then | ||||
| 						GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, destination[2], destination[3], destination[4], 0.0); | ||||
| 					end | ||||
| 				end | ||||
| 				 | ||||
| 				player:endEvent(); | ||||
| 				return; | ||||
| 			end | ||||
| @@ -43,15 +85,26 @@ function onEventStarted(player, actor, triggerName, isTeleport) | ||||
| 		end | ||||
| 	else | ||||
| 		player:PlayAnimation(0x4000FFA); | ||||
| 		local choice, wasMulti = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);		 | ||||
| 		if (wasMulti and choice == 1 or choice == 2) then | ||||
| 		local choice, isInn = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);		 | ||||
| 		if (choice == 1) then | ||||
| 			player:PlayAnimation(0x4000FFB); | ||||
| 			player:SendGameMessage(worldMaster, 34104, 0x20); | ||||
| 			--Do return | ||||
| 		elseif (not wasMulti and choice == 1) then | ||||
| 			player:PlayAnimation(0x4000FFB); | ||||
| 			player:SendGameMessage(worldMaster, 34104, 0x20); | ||||
| 			--Do return | ||||
| 			player:SendGameMessage(worldMaster, 34104, 0x20);	 | ||||
| 			if (isInn) then | ||||
| 				--Return to Inn		 | ||||
| 				if (player:GetHomePointInn() == 1) then | ||||
| 					GetWorldManager():DoZoneChange(player, 12); | ||||
| 				elseif (player:GetHomePointInn() == 3) then | ||||
| 					GetWorldManager():DoZoneChange(player, 13); | ||||
| 				elseif (player:GetHomePointInn() == 3) then | ||||
| 					GetWorldManager():DoZoneChange(player, 11); | ||||
| 				end			 | ||||
| 			elseif (choice == 1 and isInn == nil) then			 | ||||
| 				--Return to Homepoint | ||||
| 				destination = aetheryteTeleportPositions[player:GetHomePoint()]; | ||||
| 				if (destination ~= nil) then | ||||
| 					GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, destination[2], destination[3], destination[4], 0.0); | ||||
| 				end | ||||
| 			end | ||||
| 		end | ||||
| 	end	 | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user