mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Added changes to how zones/areas are accessed in the lua scripts too.
This commit is contained in:
		| @@ -107,7 +107,7 @@ function doLevequestInit(player, aetheryte) | ||||
| 			 | ||||
| 				player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); | ||||
| 				player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));				 | ||||
| 				director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player); | ||||
| 				director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player); | ||||
| 				player:AddDirector(director); | ||||
| 				director:StartDirector(true, glId) | ||||
| 			 | ||||
|   | ||||
| @@ -142,7 +142,7 @@ function doLevequestInit(player, aetheryte) | ||||
| 							 | ||||
| 				player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); | ||||
| 				player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));				 | ||||
| 				director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player); | ||||
| 				director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player); | ||||
| 				player:AddDirector(director); | ||||
| 				director:StartDirector(true, glId); | ||||
| 				 | ||||
|   | ||||
| @@ -19,7 +19,7 @@ function onBeginLogin(player) | ||||
| 	end | ||||
| 			 | ||||
| 	--For Opening. Set Director and reset position incase d/c | ||||
| 	if (player:HasQuest(110001) == true and player:GetZoneID() == 193) then | ||||
| 	if (player:HasQuest(110001) == true and player.CurrentArea.ZoneId == 193) then | ||||
| 		director = player:GetZone():CreateDirector("OpeningDirector", false);		 | ||||
| 		player:AddDirector(director); | ||||
| 		director:StartDirector(true); | ||||
| @@ -32,7 +32,7 @@ function onBeginLogin(player) | ||||
| 		player.rotation = 0.025; | ||||
| 		player:GetQuest(110001):ClearQuestData(); | ||||
| 		player:GetQuest(110001):ClearQuestFlags(); | ||||
| 	elseif (player:HasQuest(110005) == true and player:GetZoneID() == 166) then  | ||||
| 	elseif (player:HasQuest(110005) == true and player.CurrentArea.ZoneId == 166) then  | ||||
| 		director = player:GetZone():CreateDirector("OpeningDirector", false);		 | ||||
| 		player:AddDirector(director); | ||||
| 		director:StartDirector(false);		 | ||||
| @@ -45,7 +45,7 @@ function onBeginLogin(player) | ||||
| 		player.rotation = -1.26721; | ||||
| 		player:GetQuest(110005):ClearQuestData(); | ||||
| 		player:GetQuest(110005):ClearQuestFlags(); | ||||
| 	elseif (player:HasQuest(110009) == true and player:GetZoneID() == 184) then | ||||
| 	elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 184) then | ||||
| 		--director = player:GetZone():CreateDirector("OpeningDirector", false);		 | ||||
| 		--player:AddDirector(director); | ||||
| 		--director:StartDirector(false);		 | ||||
|   | ||||
| @@ -13,9 +13,9 @@ function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, baza | ||||
| 	local bazaarActor = nil; | ||||
|  | ||||
| 	if (name ~= nil) then | ||||
| 		bazaarActor = player:GetZone():FindPCInZone(name); | ||||
| 		bazaarActor = player.CurrentArea:FindPCInZone(name); | ||||
| 	elseif (bazaarActorId ~= nil) then | ||||
| 		bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); | ||||
| 		bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId); | ||||
| 	end | ||||
| 	 | ||||
| 	if (bazaarActor ~= nil) then | ||||
|   | ||||
| @@ -25,7 +25,7 @@ function onEventStarted(player, actor, triggerName, isGoobbue) | ||||
| 		player:ChangeSpeed(0.0, 5.0, 10.0, 10.0); | ||||
| 		player:ChangeState(15); | ||||
| 	else | ||||
| 		player:ChangeMusic(player:GetZone().bgmDay); | ||||
| 		player:ChangeMusic(player.CurrentArea.bgmDay); | ||||
| 		 | ||||
| 		worldMaster = GetWorldMaster(); | ||||
| 		 | ||||
|   | ||||
| @@ -12,10 +12,10 @@ function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, acto | ||||
|  | ||||
| 	--ActorID Search | ||||
| 	if (actorId ~= nil) then | ||||
| 		otherActor = player:GetZone():FindActorInArea(actorId); | ||||
| 		otherActor = player.CurrentArea):FindActorInArea(actorId); | ||||
| 	--Name Search | ||||
| 	elseif (name ~= nil) then | ||||
| 		otherActor = player:GetZone():FindPCInZone(name); | ||||
| 		otherActor = player.CurrentArea:FindPCInZone(name); | ||||
| 	end | ||||
| 	 | ||||
| 	if (otherActor ~= nil) then | ||||
|   | ||||
| @@ -8,9 +8,8 @@ properties = { | ||||
|  | ||||
| function onTrigger(player, argc, actorName) | ||||
|  | ||||
| 	if (actorName ~= nil) then		 | ||||
| 		zone = player:GetZone(); | ||||
| 		actor = zone:DespawnActor(actorName); | ||||
| 	if (actorName ~= nil) then | ||||
| 		actor = player.CurrentArea:DespawnActor(actorName); | ||||
| 	end | ||||
| 	 | ||||
| end; | ||||
| @@ -18,11 +18,11 @@ function onTrigger(player, argc, zone) | ||||
|      | ||||
|     if player then | ||||
|         local messageID = MESSAGE_TYPE_SYSTEM_ERROR; | ||||
|         zone = zone or player:GetZoneID(); | ||||
|         zone = zone or player.CurrentArea.ZoneId; | ||||
|         player:SendMessage(messageID, "[reloadzones] ", string.format("Reloading zone: %u", zone)); | ||||
|     --[[ todo: get this working legit | ||||
|         player:GetZone():Clear(); | ||||
|         player:GetZone():AddActorToZone(player); | ||||
|         player.CurrentArea:Clear(); | ||||
|         player.CurrentArea:AddActorToZone(player); | ||||
|         player:SendInstanceUpdate(); | ||||
|         ]] | ||||
|     end; | ||||
|   | ||||
| @@ -14,23 +14,22 @@ function onTrigger(player, argc, actorClassId, width, height) | ||||
| 	end	 | ||||
|  | ||||
|     local pos = player:GetPos(); | ||||
|     local x = pos[0]; | ||||
|     local y = pos[1]; | ||||
|     local z = pos[2]; | ||||
|     local rot = pos[3]; | ||||
|     local zone = pos[4]; | ||||
|     local x = pos[1]; | ||||
|     local y = pos[2]; | ||||
|     local z = pos[3]; | ||||
|     local rot = pos[4]; | ||||
|     local zone = pos[5]; | ||||
|           | ||||
| 	actorClassId = tonumber(actorClassId); | ||||
| 	 | ||||
| 	if (actorClassId ~= nil) then		 | ||||
| 		zone = player:GetZone(); | ||||
| 	if (actorClassId ~= nil) then | ||||
| 		local w = tonumber(width) or 0; | ||||
|         local h = tonumber(height) or 0; | ||||
|         printf("%f %f %f", x, y, z); | ||||
|         --local x, y, z = player.GetPos(); | ||||
|         for i = 0, w do | ||||
|             for j = 0, h do | ||||
| 				actor = zone:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]); | ||||
| 				actor = player.CurrentArea:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]); | ||||
| 				actor.SetAppearance(1001149) | ||||
| 			end | ||||
| 		end | ||||
|   | ||||
| @@ -108,7 +108,7 @@ function onTrigger(player, argc, name,  width, height, blockCount) | ||||
| 		for b = 0, blocks do | ||||
|             for i = 0, w do | ||||
|                 for j = 0, h do | ||||
|                     local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); | ||||
|                     local actor = player.CurrentArea:SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); | ||||
|                     actor.ChangeNpcAppearance(modelIds[name]); | ||||
|                     actor.SetMaxHP(5000); | ||||
|                     actor.SetHP(5000); | ||||
|   | ||||
| @@ -18,7 +18,7 @@ function onTrigger(player, argc) | ||||
| 		player:SendGameMessage(player, worldMaster, 34108, 0x20);	 | ||||
| 		player:SendGameMessage(player, worldMaster, 50011, 0x20);	 | ||||
|  | ||||
| 		director = player:GetZone():CreateDirector("Quest/QuestDirectorMan0l001"); | ||||
| 		director = player.CurrentArea:CreateDirector("Quest/QuestDirectorMan0l001"); | ||||
| 		player:AddDirector(director); | ||||
| 		player:SetLoginDirector(director); | ||||
| 		 | ||||
|   | ||||
| @@ -31,7 +31,7 @@ function onTrigger(player, argc, animation, regionId, layoutId, maxLayoutId) | ||||
| 		actorClassId = tonumber(actorClassId); | ||||
| 		 | ||||
| 		if (actorClassId ~= nil) then		 | ||||
| 			zone = player:GetZone(); | ||||
| 			zone = player.CurrentArea; | ||||
| 			actor = zone:SpawnActor(actorClassId, "mapobj", pos[1], pos[2], pos[3], tonumber(regionId), tonumber(layoutId)); | ||||
| 			 | ||||
| 			 print("test"); | ||||
|   | ||||
| @@ -24,13 +24,13 @@ function onTrigger(player, argc, weather, updateTime, zonewide) | ||||
|         message = string.format("changed weather to %u ", weather); | ||||
|          | ||||
|         if zonewide ~= 0 then | ||||
|             message = string.format(message.."for zone %u", player:GetZoneID()); | ||||
|             message = string.format(message.."for zone %u", player.CurrentArea.ZoneId); | ||||
|         else | ||||
|             message = message..player:GetName(); | ||||
|         end; | ||||
|          | ||||
|         -- weatherid, updateTime | ||||
|         player:GetZone():ChangeWeather(weather, updateTime, player, zonewide ~= 0); | ||||
|         player.CurrentArea:ChangeWeather(weather, updateTime, player, zonewide ~= 0); | ||||
|         player:SendMessage(messageID, sender, message); | ||||
|     end; | ||||
|     print(sender..message); | ||||
|   | ||||
| @@ -159,7 +159,7 @@ function onTrigger(player, argc, width, height, blockCount) | ||||
|         for b = 0, blocks do | ||||
|             for i = 0, w do | ||||
|                 for j = 0, h do | ||||
|                     local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); | ||||
|                     local actor = player.CurrentArea.SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); | ||||
|                     --actor.ChangeNpcAppearance(2200905); | ||||
|                     actor.SetMaxHP(500); | ||||
|                     actor.SetHP(500); | ||||
|   | ||||
| @@ -88,7 +88,7 @@ function onEventStarted(player, actor, triggerName) | ||||
| 	wait(5); | ||||
| 	 | ||||
| 	player:SendMessage(0x20, "", "ContentFinished"); | ||||
| 	player:GetZone():ContentFinished();	 | ||||
| 	player.CurrentArea:ContentFinished();	 | ||||
| 	wait(5); | ||||
| 	player:SendMessage(0x20, "", "Remove from party"); | ||||
| 	player:RemoveFromCurrentPartyAndCleanup(); | ||||
| @@ -136,5 +136,5 @@ function onCommand(player, command) | ||||
| end | ||||
|  | ||||
| function main(director, contentGroup) | ||||
|     onCreateContentArea(director:GetPlayerMembers(), director, director:GetZone(), contentGroup); | ||||
|     onCreateContentArea(director:GetPlayerMembers(), director, director.CurrentArea, contentGroup); | ||||
| end; | ||||
| @@ -73,7 +73,7 @@ function onEventStarted(player, director, triggerName) | ||||
| 	]] | ||||
| 	 | ||||
| 	man0l0Quest:StartSequence(10);	 | ||||
| 	player:GetZone():ContentFinished(); | ||||
| 	player.CurrentArea:ContentFinished(); | ||||
| 	GetWorldManager():DoZoneChange(player, 230, "PrivateAreaMasterPast", 1, 15, -826.868469, 6, 193.745865, -0.008368492); | ||||
| 	player:EndEvent(); | ||||
| end | ||||
|   | ||||
| @@ -59,6 +59,6 @@ function onEventStarted(player, actor, triggerName) | ||||
| 	man0u0Quest:NextPhase(10);	 | ||||
| 	player:EndEvent();	 | ||||
| 	 | ||||
| 	player:GetZone():ContentFinished(); | ||||
| 	player.CurrentArea:ContentFinished(); | ||||
| 	GetWorldManager():DoZoneChange(player, 175, "PrivateAreaMasterPast", 3, 15, -22.81, 196, 87.82, 2.98); | ||||
| end | ||||
|   | ||||
| @@ -263,7 +263,7 @@ function doExitDoor(player, quest, npc) | ||||
| 		 | ||||
| 		quest:StartSequence(SEQ_005); | ||||
| 		 | ||||
| 		contentArea = player:GetZone():CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0l01", "SimpleContent30002", "Quest/QuestDirectorMan0l001"); | ||||
| 		contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0l01", "SimpleContent30002", "Quest/QuestDirectorMan0l001"); | ||||
| 		 | ||||
| 		if (contentArea == nil) then | ||||
| 			return; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user