mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Started mass overhaul of quests and related components like small talk. Fixed some scripts. More fixes required.
This commit is contained in:
		| @@ -8,7 +8,7 @@ Fired when you try to abandon a quest | |||||||
|  |  | ||||||
| --]] | --]] | ||||||
|  |  | ||||||
| function onEventStarted(player, command, triggerName, questId)		 | function onEventStarted(player, command, eventType, eventName, questId)		 | ||||||
| 	 | 	 | ||||||
| 	player:AbandonQuest(questId); | 	player:AbandonQuest(questId); | ||||||
| 	player:EndEvent(); | 	player:EndEvent(); | ||||||
|   | |||||||
| @@ -32,6 +32,7 @@ local npcLsHandlers = { | |||||||
| } | } | ||||||
|  |  | ||||||
| function onEventStarted(player, command, triggerName, npcLsId)		 | function onEventStarted(player, command, triggerName, npcLsId)		 | ||||||
|  | 	player:OnNpcLS(npcLsId); | ||||||
| 	 | 	 | ||||||
| 	if (npcLsHandlers[npcLsId] ~= nil) then | 	if (npcLsHandlers[npcLsId] ~= nil) then | ||||||
| 		npcLsHandlers[npcLsId](player); | 		npcLsHandlers[npcLsId](player); | ||||||
|   | |||||||
| @@ -1,23 +1,30 @@ | |||||||
| --[[ | --[[ | ||||||
|  |  | ||||||
|  | RequestQuestJournalCommand Script | ||||||
|  |  | ||||||
|  | Functions: None | ||||||
|  |  | ||||||
|  | Notes: | ||||||
|  |  | ||||||
|  | Fires when the player looks at a quest's journal entry and the map section. Check the quest sheet and quest_marker sheet | ||||||
|  | for valid entries for your quest. | ||||||
|  |  | ||||||
| --]] | --]] | ||||||
|  |  | ||||||
| function onEventStarted(player, actor, trigger, questId, mapCode) | function onEventStarted(player, command, eventType, eventName, questId, mapCode) | ||||||
|  | 	local quest = player:GetQuest(questId); | ||||||
| 	 | 	 | ||||||
| 	quest = player:GetQuest(questId); | 	if (quest ~= nil) then	 | ||||||
| 	 | 		if (mapCode == nil) then | ||||||
| 	if (quest == nil) then	 | 			-- Get Quest Journal Data | ||||||
| 		player:EndEvent(); | 			local journalInfo = quest:GetJournalInformation(); | ||||||
| 		return; | 			player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetSequence(), unpack(journalInfo)); | ||||||
| 	end | 		else | ||||||
| 	 | 			-- Get Quest Map Data | ||||||
| 	if (mapCode == nil) then	 | 			local mapMarkers = quest:GetJournalMapMarkerList(); | ||||||
| 		player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase()); | 			player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId(), unpack(mapMarkers)); | ||||||
| 		player:EndEvent(); | 		end | ||||||
| 	else |  | ||||||
| 		player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId()); |  | ||||||
| 		player:EndEvent(); |  | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
|  | 	player:EndEvent(); | ||||||
| end | end | ||||||
|   | |||||||
| @@ -52,7 +52,7 @@ teleportMenuToAetheryte = { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| function onEventStarted(player, actor, triggerName, isTeleport) | function onEventStarted(player, actor, eventType, eventName, isTeleport) | ||||||
|  |  | ||||||
| 	local worldMaster = GetWorldMaster(); | 	local worldMaster = GetWorldMaster(); | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										21
									
								
								Data/scripts/commands/gm/addquest.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Data/scripts/commands/gm/addquest.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | require("global"); | ||||||
|  |  | ||||||
|  | properties = { | ||||||
|  |     permissions = 0, | ||||||
|  |     parameters = "s", | ||||||
|  |     description = "Adds a quest by <id>.", | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function onTrigger(player, argc, glId)     | ||||||
|  |     if player then | ||||||
|  | 		local glIdAsNumber = tonumber(glId); | ||||||
|  | 		 | ||||||
|  | 		if (glIdAsNumber == nil) then | ||||||
|  | 			player:AddQuest(glId); | ||||||
|  | 		else | ||||||
|  | 			player:AddQuest(glIdAsNumber); | ||||||
|  | 		end | ||||||
|  | 	else | ||||||
|  |         print(sender.."unable to add guildleve, ensure player name is valid."); | ||||||
|  |     end; | ||||||
|  | end; | ||||||
							
								
								
									
										29
									
								
								Data/scripts/commands/gm/getinfo.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								Data/scripts/commands/gm/getinfo.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | require("global"); | ||||||
|  |  | ||||||
|  | properties = { | ||||||
|  |     permissions = 0, | ||||||
|  |     parameters = "ssss", | ||||||
|  |     description = | ||||||
|  | [[ | ||||||
|  | Gets the info about the current target | ||||||
|  | ]], | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function onTrigger(player) | ||||||
|  |  | ||||||
|  | 	local messageID = MESSAGE_TYPE_SYSTEM_ERROR; | ||||||
|  |     local sender = "[Info] "; | ||||||
|  |  | ||||||
|  | 	local targetActor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; | ||||||
|  | 	 | ||||||
|  |     if not targetActor then | ||||||
|  |         player:SendMessage(messageID, sender, "No target selected"); | ||||||
|  |         return | ||||||
|  |     end | ||||||
|  |      | ||||||
|  | 	 | ||||||
|  | 	player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation)); | ||||||
|  | 	player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.actorId)); | ||||||
|  | 	player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId())); | ||||||
|  | 	player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));	 | ||||||
|  | end | ||||||
| @@ -21,7 +21,7 @@ function main(thisDirector) | |||||||
| 	if (members ~= nil and #members ~= 0) then | 	if (members ~= nil and #members ~= 0) then | ||||||
| 		player = members[0]; | 		player = members[0]; | ||||||
| 		player:SendGameMessage(GetWorldMaster(), 50036, 0x20, thisDirector.guildleveId, player, 0); --"You have started the leve..." | 		player:SendGameMessage(GetWorldMaster(), 50036, 0x20, thisDirector.guildleveId, player, 0); --"You have started the leve..." | ||||||
| 		player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, false)); | 		player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.plateId, guildleveData.borderId, false)); | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| 	wait(3); | 	wait(3); | ||||||
| @@ -47,8 +47,3 @@ function main(thisDirector) | |||||||
| 	thisDirector:UpdateAimNumNow(0, 3); | 	thisDirector:UpdateAimNumNow(0, 3); | ||||||
| 	 | 	 | ||||||
| end | end | ||||||
|  |  | ||||||
| function attentionMessage(player, textId, ...) |  | ||||||
| 	player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...); |  | ||||||
| 	player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...); |  | ||||||
| end |  | ||||||
|   | |||||||
| @@ -132,13 +132,13 @@ CLASSID_THM = 22; | |||||||
| CLASSID_CNJ = 23; | CLASSID_CNJ = 23; | ||||||
|  |  | ||||||
| -- SPAWNS | -- SPAWNS | ||||||
| SPAWN_NO_ANIM = 0x00; | SPAWN_NO_ANIM1 = 0x00; | ||||||
| SPAWN_ANIM1 = 0x02; | SPAWN_ANIM1 = 0x02; | ||||||
| SPAWN_RETAINER = 0x03; | SPAWN_RETAINER = 0x03; | ||||||
| SPAWN_POPMOB = 0x4; | SPAWN_POPMOB = 0x4; | ||||||
| SPAWN_UKN1 = 0x5; | SPAWN_UKN1 = 0x5; | ||||||
| SPAWN_UKN2 = 0x7; | SPAWN_UKN2 = 0x7; | ||||||
| SPAWN_LOADING1 = 0x0F; | SPAWN_NO_ANIM = 0x0F; | ||||||
| SPAWN_LOADING2 = 0x10; | SPAWN_LOADING2 = 0x10; | ||||||
| SPAWN_INSTANCE_ERROR = 0x12; | SPAWN_INSTANCE_ERROR = 0x12; | ||||||
| SPAWN_CHOCOBO_GET = 0x13; | SPAWN_CHOCOBO_GET = 0x13; | ||||||
| @@ -146,8 +146,13 @@ SPAWN_CHOCOBO_RENTAL = 0x14; | |||||||
| SPAWN_CUTTER_SANDS = 0x17; | SPAWN_CUTTER_SANDS = 0x17; | ||||||
| SPAWN_NIGHTMARE = 0x18; | SPAWN_NIGHTMARE = 0x18; | ||||||
|  |  | ||||||
| --UTILS | -- Common Helper Functions | ||||||
|  | function attentionMessage(player, textId, ...) | ||||||
|  | 	player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...); | ||||||
|  | 	player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Core Event Functions | ||||||
| function kickEventContinue(player, actor, trigger, ...) | function kickEventContinue(player, actor, trigger, ...) | ||||||
| 	player:kickEvent(actor, trigger, ...); | 	player:kickEvent(actor, trigger, ...); | ||||||
| 	return coroutine.yield("_WAIT_EVENT", player); | 	return coroutine.yield("_WAIT_EVENT", player); | ||||||
|   | |||||||
| @@ -14,11 +14,11 @@ function glPlateIconIDToAnimID(iconId) | |||||||
| 	return iconId - 20020; | 	return iconId - 20020; | ||||||
| end | end | ||||||
|  |  | ||||||
| function getGLStartAnimationFromSheet(border, plate, isBoost) | function getGLStartAnimationFromSheet(plate, border, isBoost) | ||||||
| 	return getGLStartAnimation(glBorderIconIDToAnimID(border), glPlateIconIDToAnimID(plate), isBoost); | 	return getGLStartAnimation(glPlateIconIDToAnimID(plate), glBorderIconIDToAnimID(border), isBoost); | ||||||
| end | end | ||||||
|  |  | ||||||
| function getGLStartAnimation(border, plate, isBoost) | function getGLStartAnimation(plate, border, isBoost) | ||||||
| 	borderBits = border; | 	borderBits = border; | ||||||
| 	plateBits = bit32.lshift(plate, 7); | 	plateBits = bit32.lshift(plate, 7); | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										0
									
								
								Data/scripts/guildtask.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								Data/scripts/guildtask.lua
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										33
									
								
								Data/scripts/quests/dft/DftFst.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								Data/scripts/quests/dft/DftFst.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | |||||||
|  | require ("global") | ||||||
|  |  | ||||||
|  | --[[ | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
|  | Name: 	Small Talk | ||||||
|  | Code: 	DftFst | ||||||
|  | Id: 	110542 | ||||||
|  |  | ||||||
|  | Contains all default lines for talkable npcs in the Forest Region (aka Black Shroud). | ||||||
|  | * NOTE: This quest is active for all players at all times. | ||||||
|  | ]] | ||||||
|  |  | ||||||
|  | -- [ActorClassId] = "client_function_name" | ||||||
|  | local defaultTalkFst = {	 | ||||||
|  | 	[1000821] = "defaultTalkWithNellaure_001",				-- Nellaure | ||||||
|  | 	[1001081] = "defaultTalkWithKhumamoshroca_001",			-- Khuma Moshroca | ||||||
|  | 	[1001103] = "defaultTalkWithMestonnaux_001", 			-- Mestonnaux | ||||||
|  | 	[1001396] = "defaultTalkWithLefwyne_001",				-- Lefwyne | ||||||
|  | 	[1001430] = "defaultTalkWithKinnison_001",				-- Kinnison | ||||||
|  | 	[1001437] = "defaultTalkWithSybell_001", 				-- Sybell	 | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | 	local clientFunc = defaultTalkFst[npc:GetActorClassId()]; | ||||||
|  | 	callClientFunction(player, "delegateEvent", player, quest, clientFunc); | ||||||
|  | 	player:EndEvent(); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function IsQuestENPC(player, quest, npc) | ||||||
|  | 	return defaultTalkFst[npc:GetActorClassId()] ~= nil; | ||||||
|  | end | ||||||
							
								
								
									
										26
									
								
								Data/scripts/quests/dft/DftSea.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Data/scripts/quests/dft/DftSea.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | |||||||
|  | --[[ | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
|  | Name: 	Small Talk | ||||||
|  | Code: 	DftSea | ||||||
|  | Id: 	110540 | ||||||
|  |  | ||||||
|  | Contains all default lines for talkable npcs in the Sea Region (aka La Noscea). | ||||||
|  | * NOTE: This quest is active for all players at all times. | ||||||
|  | ]] | ||||||
|  |  | ||||||
|  | -- [ActorClassId] = "client_function_name" | ||||||
|  | local defaultTalkSea = { | ||||||
|  | 	[1234] = "defaultTalkWithLefchild_001" -- Lefchild | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | 	local clientFunc = defaultTalkSea[npc.GetActorClassId()];	 | ||||||
|  | 	callClientFunction(player, "delegateEvent", player, quest, clientFunc); | ||||||
|  | 	player:EndEvent(); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function IsQuestENPC(player, quest, npc) | ||||||
|  | 	return defaultTalkSea[npc.GetActorClassId()] ~= nil; | ||||||
|  | end | ||||||
							
								
								
									
										29
									
								
								Data/scripts/quests/dft/DftWil.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								Data/scripts/quests/dft/DftWil.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | require ("global") | ||||||
|  |  | ||||||
|  | --[[ | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
|  | Name: 	Small Talk | ||||||
|  | Code: 	DftWil | ||||||
|  | Id: 	110543 | ||||||
|  |  | ||||||
|  | Contains all default lines for talkable npcs in the Wilderness Region (aka Thanalan). | ||||||
|  | * NOTE: This quest is active for all players at all times. | ||||||
|  | ]] | ||||||
|  |  | ||||||
|  | -- [ActorClassId] = "client_function_name" | ||||||
|  | local defaultTalkWil = { | ||||||
|  | 	[1000841] = "defaultTalkWithMomodi_001", -- Momodi | ||||||
|  | 	[1000994] = "defaultTalkWithLefchild_001" -- Lefchild | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | 	local clientFunc = defaultTalkWil[npc:GetActorClassId()]; | ||||||
|  | 	callClientFunction(player, "delegateEvent", player, quest, clientFunc); | ||||||
|  | 	player:EndEvent(); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function IsQuestENPC(player, quest, npc) | ||||||
|  | 	return defaultTalkWil[npc:GetActorClassId()] ~= nil; | ||||||
|  | end | ||||||
| @@ -1,61 +1,149 @@ | |||||||
| -- Level requirement is 5 on any class.  Set to 1 for testing | require ("global") | ||||||
| -- TODO:  Reward handling |  | ||||||
|  |  | ||||||
| --Actor Scripts | --[[ | ||||||
| --unique/fst0Town01a/PopulaceStandard/kinnison |  | ||||||
| --unique/fst0Town01a/PopulaceStandard/mestonnaux |  | ||||||
| --unique/fst0Town01a/PopulaceStandard/sybell |  | ||||||
| --unique/fst0Town01a/PopulaceStandard/khuma_moshroca |  | ||||||
| --unique/fst0Town01a/PopulaceStandard/lefwyne |  | ||||||
| --unique/fst0Town01a/PopulaceStandard/nellaure |  | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
| --Quest Flags | Name: 	Seeing the Seers | ||||||
| FLAG_TALKED_MESTONNAUX = 0; | Code: 	Etc3g0 | ||||||
| FLAG_TALKED_SYBELL = 1; | Id: 	110674 | ||||||
| FLAG_TALKED_NELLAURE = 2; | Prereq: Level 5, Any Class | ||||||
| FLAG_TALKED_KHUMA_MOSHROCA = 4; |  | ||||||
| FLAG_TALKED_LEFWYNE = 8; |  | ||||||
|  |  | ||||||
| function checkNextPhase(player) | ]] | ||||||
|     ownedQuest = player:GetQuest("Etc3g0"); |  | ||||||
|     if ( | -- Sequence Numbers | ||||||
|         ownedQuest:GetQuestFlag(FLAG_TALKED_MESTONNAUX) == true and  | SEQ_000	= 0;  -- Talk to all the seers. | ||||||
|         ownedQuest:GetQuestFlag(FLAG_TALKED_SYBELL) == true and  | SEQ_001	= 1;  -- Return to Kinnison. | ||||||
|         ownedQuest:GetQuestFlag(FLAG_TALKED_NELLAURE) == true and  |  | ||||||
|         ownedQuest:GetQuestFlag(FLAG_TALKED_KHUMA_MOSHROCA) == true and  | -- Actor Class Ids | ||||||
|         ownedQuest:GetQuestFlag(FLAG_TALKED_LEFWYNE) == true | KINNISON 		= 1001430; | ||||||
|         ) then | SYBELL 			= 1001437; | ||||||
|         ownedQuest:NextPhase(243); | KHUMA_MOSHROCA	= 1001081; | ||||||
|     end | NELLAURE 		= 1000821; | ||||||
|  | MESTONNAUX 		= 1001103; | ||||||
|  | LEFWYNE 		= 1001396; | ||||||
|  |  | ||||||
|  | -- Quest Markers | ||||||
|  | MRKR_KINNISON		= 11080001 | ||||||
|  | MRKR_SYBELL			= 11080002 | ||||||
|  | MRKR_KHUMA_MOSHROCA	= 11080003 | ||||||
|  | MRKR_NELLAURE		= 11080004 | ||||||
|  | MRKR_MESTONNAUX		= 11080005 | ||||||
|  | MRKR_LEFWYNE		= 11080006 | ||||||
|  |  | ||||||
|  | -- Quest Flags | ||||||
|  | FLAG_TALKED_MESTONNAUX 		= 0; | ||||||
|  | FLAG_TALKED_SYBELL 			= 1; | ||||||
|  | FLAG_TALKED_NELLAURE 		= 2; | ||||||
|  | FLAG_TALKED_KHUMA_MOSHROCA 	= 3; | ||||||
|  | FLAG_TALKED_LEFWYNE 		= 4; | ||||||
|  |  | ||||||
|  | --offerQuestResult = callClientFunction(player, "delegateEvent", player, quest, "processEventOffersStart"); | ||||||
|  |  | ||||||
|  | function onStart(player, quest)	 | ||||||
|  | 	quest:StartSequence(SEQ_000); | ||||||
| end | end | ||||||
|  |  | ||||||
|  | function onFinish(player, quest) | ||||||
| function canAcceptQuest(player) |  | ||||||
| 	return (player:HasQuest("Etc3g0") == false and player:IsQuestCompleted("Etc3g0") == false and player:GetHighestLevel() >= 1); |  | ||||||
| end | end | ||||||
|  |  | ||||||
| function isObjectivesComplete(player, quest) | function onSequence(player, quest, sequence)	 | ||||||
| 	return (quest:GetPhase() == 243); | 	quest:ClearENpcs();	 | ||||||
|  | 	 | ||||||
|  | 	if (sequence == SEQ_000) then | ||||||
|  | 		quest:AddENpc(SYBELL, qflag(quest, FLAG_TALKED_SYBELL)); | ||||||
|  | 		quest:AddENpc(KHUMA_MOSHROCA, qflag(quest, FLAG_TALKED_KHUMA_MOSHROCA)); | ||||||
|  | 		quest:AddENpc(NELLAURE, qflag(quest, FLAG_TALKED_NELLAURE)); | ||||||
|  | 		quest:AddENpc(MESTONNAUX, qflag(quest, FLAG_TALKED_MESTONNAUX)); | ||||||
|  | 		quest:AddENpc(LEFWYNE, qflag(quest, FLAG_TALKED_LEFWYNE)); | ||||||
|  | 	elseif (sequence == SEQ_001) then | ||||||
|  | 		quest:AddENpc(KINNISON); | ||||||
|  | 	end	 | ||||||
| end | end | ||||||
|  |  | ||||||
|  | function qflag(quest, flag) | ||||||
|  | 	return quest:GetFlag(flag) and QFLAG_ALL or QFLAG_NONE; | ||||||
|  | end | ||||||
|  |  | ||||||
| function onAbandonQuest(player, quest)	 | function onTalk(player, quest, npc, eventName) | ||||||
| 	kinnison = GetWorldManager():GetActorInWorldByUniqueId("kinnison"); | 	local npcClassId = npc.GetActorClassId(); | ||||||
| 	mestonnaux = GetWorldManager():GetActorInWorldByUniqueId("mestonnaux"); | 	local seq = quest:GetSequence(); | ||||||
| 	sybell = GetWorldManager():GetActorInWorldByUniqueId("sybell"); |  | ||||||
| 	khuma_moshroca = GetWorldManager():GetActorInWorldByUniqueId("khuma_moshroca"); |  | ||||||
| 	lefwyne = GetWorldManager():GetActorInWorldByUniqueId("lefwyne"); |  | ||||||
| 	nellaure = GetWorldManager():GetActorInWorldByUniqueId("nellaure");	 |  | ||||||
| 	 | 	 | ||||||
| 	if (kinnison ~= nil and canAcceptQuest(player)) then | 	if (seq == SEQ_000) then | ||||||
| 		kinnison:SetQuestGraphic(player, 0x2);		 | 		if (npcClassId == SYBELL) then | ||||||
|  | 			if (not quest:GetFlag(FLAG_TALKED_SYBELL)) then | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeak"); | ||||||
|  | 				quest:SetFlag(FLAG_TALKED_SYBELL); | ||||||
|  | 				--quest:UpdateENpc(SYBELL, QFLAG_NONE);				 | ||||||
|  | 			else | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventSybellSpeakAfter"); | ||||||
|  | 			end | ||||||
|  | 		elseif (npcClassId == KHUMA_MOSHROCA) then | ||||||
|  | 			if (not quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA)) then | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeak"); | ||||||
|  | 				quest:SetFlag(FLAG_TALKED_KHUMA_MOSHROCA); | ||||||
|  | 				--quest:UpdateENpc(KHUMA_MOSHROCA, QFLAG_NONE);				 | ||||||
|  | 			else | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventKhumaSpeakAfter"); | ||||||
|  | 			end | ||||||
|  | 		elseif (npcClassId == NELLAURE) then | ||||||
|  | 			if (not quest:GetFlag(FLAG_TALKED_NELLAURE)) then | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeak"); | ||||||
|  | 				quest:SetFlag(FLAG_TALKED_NELLAURE); | ||||||
|  | 				--quest:UpdateENpc(NELLAURE, QFLAG_NONE);				 | ||||||
|  | 			else | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventNellaureSpeakAfter"); | ||||||
|  | 			end | ||||||
|  | 		elseif (npcClassId == MESTONNAUX) then | ||||||
|  | 			if (not quest:GetFlag(FLAG_TALKED_MESTONNAUX)) then | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeak"); | ||||||
|  | 				quest:SetFlag(FLAG_TALKED_MESTONNAUX); | ||||||
|  | 				--quest:UpdateENpc(MESTONNAUX, QFLAG_NONE);				 | ||||||
|  | 			else | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventMestonnauxSpeakAfter"); | ||||||
|  | 			end | ||||||
|  | 		elseif (npcClassId == LEFWYNE) then | ||||||
|  | 			if (not quest:GetFlag(FLAG_TALKED_LEFWYNE)) then | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeak"); | ||||||
|  | 				quest:SetFlag(FLAG_TALKED_LEFWYNE); | ||||||
|  | 				--quest:UpdateENpc(LEFWYNE, QFLAG_NONE);				 | ||||||
|  | 			else | ||||||
|  | 				callClientFunction(player, "delegateEvent", player, quest, "processEventLefwyneSpeakAfter"); | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
|  | 		 | ||||||
|  | 		-- Check condition to go to the next sequence | ||||||
|  | 		if (seq000_checkCondition(quest)) then | ||||||
|  | 			quest:StartSequence(SEQ_001); | ||||||
|  | 		end | ||||||
|  | 	elseif (seq == SEQ_001) then | ||||||
|  | 		--Quest Complete | ||||||
|  | 		if (npcClassId == KINNISON) then | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, quest, "processEventClear"); | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, quest, "sqrwa", 200, 1, 1, 9); | ||||||
|  | 		end | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| 	if (mestonnaux ~= nil) then mestonnaux:SetQuestGraphic(player, 0x0); end | 	player:EndEvent(); | ||||||
| 	if (sybell ~= nil) then sybell:SetQuestGraphic(player, 0x0); end | end | ||||||
| 	if (khuma_moshroca ~= nil) then khuma_moshroca:SetQuestGraphic(player, 0x0); end |  | ||||||
| 	if (lefwyne ~= nil) then lefwyne:SetQuestGraphic(player, 0x0); end | -- Check if all seers are talked to | ||||||
| 	if (nellaure ~= nil) then nellaure:SetQuestGraphic(player, 0x0); end | function seq000_checkCondition(quest) | ||||||
| 	 | 	return (quest:GetFlag(FLAG_TALKED_SYBELL) and | ||||||
|  | 			quest:GetFlag(FLAG_TALKED_KHUMA_MOSHROCA) and | ||||||
|  | 			quest:GetFlag(FLAG_TALKED_NELLAURE) and | ||||||
|  | 			quest:GetFlag(FLAG_TALKED_MESTONNAUX) and | ||||||
|  | 			quest:GetFlag(FLAG_TALKED_LEFWYNE)); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- This is called by the RequestQuestJournalCommand when map markers are request. | ||||||
|  | -- Check quest_marker for valid values. This should return a table of map markers. | ||||||
|  | function getJournalMapMarkerList(player, quest) | ||||||
|  | 	local seq = quest:GetSequence(); | ||||||
|  | 	 | ||||||
|  | 	if (seq == SEQ_000) then | ||||||
|  | 		return MRKR_SYBELL, MRKR_KHUMA_MOSHROCA, MRKR_NELLAURE, MRKR_MESTONNAUX, MRKR_LEFWYNE; | ||||||
|  | 	elseif (seq == SEQ_001) then | ||||||
|  | 		return MRKR_KINNISON; | ||||||
|  | 	end | ||||||
| end | end | ||||||
| @@ -1,7 +1,221 @@ | |||||||
|  | -- Sequence Numbers | ||||||
|  | SEQ_000	= 0;  -- On the boat interior; contains the basics tutorial. | ||||||
|  | SEQ_005	= 5;  -- Combat on the top of the boat. | ||||||
|  | SEQ_010	= 10; -- In Limsa Lominsa's port. | ||||||
|  |  | ||||||
| --Quest Flags | -- Quest Flags | ||||||
| MAN0L0_FLAG_STARTED_TALK_TUT = 0; | seq000_Flag_MainTut0	= false; | ||||||
|  | seq000_Flag_MiniTut1 	= false; | ||||||
|  | seq000_Flag_MiniTut2 	= false; | ||||||
|  | seq000_Flag_MiniTut3 	= false; | ||||||
|  |  | ||||||
| MAN0L0_FLAG_MINITUT_DONE1 = 4; | -- Map Markers | ||||||
| MAN0L0_FLAG_MINITUT_DONE2 = 8; | local seq000_Markers = { | ||||||
| MAN0L0_FLAG_MINITUT_DONE3 = 16; | 	11000203, -- Rostnsthal | ||||||
|  | 	11000204, -- Voluptuous Vixen | ||||||
|  | 	11000205, -- Baby-faced Adventurer | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | -- Actors in this quest | ||||||
|  | NPC_WELLTRAVELED_MERCHANT = 0; | ||||||
|  | NPC_TIPSY_ADVENTURER = 0; | ||||||
|  | NPC_CULTIVATED_TENDER = 0; | ||||||
|  | NPC_ANXIOUS_ADVENTURER = 0; | ||||||
|  | NPC_BABYFACED_ADVENTURER = 0; | ||||||
|  | NPC_AUSTERE_ADVENTURER = 0; | ||||||
|  | NPC_UNDIGNIFIED_ADVENTURER = 0; | ||||||
|  | NPC_SHADOWY_TRAVELER = 0; | ||||||
|  | NPC_ASTUTE_MERCHANT = 0; | ||||||
|  | NPC_VOLUPTUOUS_VIXEN = 0; | ||||||
|  | NPC_INDIFFERENT_PASSERBY = 0; | ||||||
|  | NPC_PRATTLING_ADVENTURER = 0; | ||||||
|  | NPC_GRINNING_ADVENTURER = 0; | ||||||
|  | NPC_ROSTNSTHAL = 0; | ||||||
|  | NPC_EXIT_TRIGGER = 0; | ||||||
|  |  | ||||||
|  | function onStart(player, quest)	 | ||||||
|  | 	quest::StartSequence(SEQ_000); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onFinish(player, quest) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onSequence(player, quest, seqNum) | ||||||
|  | 	quest::ClearENpcs(); | ||||||
|  | 	 | ||||||
|  | 	if (sequence == SEQ_000) then | ||||||
|  | 		-- Setup states incase we loaded in. | ||||||
|  | 		local rostnsthalQuestFlag = QFLAG_NONE; | ||||||
|  | 		local rostnsthalCanPush = true; | ||||||
|  | 		local rostnsthalCanTalk = false; | ||||||
|  | 		if (seq000_Flag_MainTut0 == true) then | ||||||
|  | 			rostnsthalCanTalk = true; | ||||||
|  | 			rostnsthalCanPush = false; | ||||||
|  | 			if (seq000_Flag_MiniTut1 == false) then				 | ||||||
|  | 				rostnsthalQuestFlag = QFLAG_BOTH; | ||||||
|  | 			end | ||||||
|  | 		else | ||||||
|  | 			rostnsthalCanTalk = false; | ||||||
|  | 			rostnsthalCanPush = true; | ||||||
|  | 		end				 | ||||||
|  | 	 | ||||||
|  | 		quest::AddENpc | ||||||
|  | 		quest::AddENpc(NPC_WELLTRAVELED_MERCHANT); | ||||||
|  | 		quest::AddENpc(NPC_TIPSY_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_CULTIVATED_TENDER); | ||||||
|  | 		quest::AddENpc(NPC_ANXIOUS_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_BABYFACED_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_AUSTERE_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_UNDIGNIFIED_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_SHADOWY_TRAVELER); | ||||||
|  | 		quest::AddENpc(NPC_ASTUTE_MERCHANT); | ||||||
|  | 		quest::AddENpc(NPC_VOLUPTUOUS_VIXEN); | ||||||
|  | 		quest::AddENpc(NPC_INDIFFERENT_PASSERBY); | ||||||
|  | 		quest::AddENpc(NPC_PRATTLING_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_GRINNING_ADVENTURER); | ||||||
|  | 		quest::AddENpc(NPC_ROSTNSTHAL, rostnsthalQuestFlag, rostnsthalCanTalk, false, rostnsthalCanPush); | ||||||
|  | 		quest::AddENpc(NPC_EXIT_TRIGGER); | ||||||
|  | 	elseif (sequence == SEQ_005) then | ||||||
|  | 	elseif (sequence == SEQ_010) then | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc) | ||||||
|  | 	local sequence = quest::getSequence(); | ||||||
|  | 	local classId = npc::GetActorClassId(); | ||||||
|  | 	 | ||||||
|  | 	if (sequence == SEQ_000) then | ||||||
|  | 		seq000_onTalk(player, quest, npc, classId); | ||||||
|  | 	elseif (sequence == SEQ_005) then | ||||||
|  | 		sequence005_onTalk(player, quest, npc, classId); | ||||||
|  | 	elseif (sequence == SEQ_010) then | ||||||
|  | 		sequence010_onTalk(player, quest, npc, classId); | ||||||
|  | 	end | ||||||
|  | 	 | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function seq000_onTalk(player, quest, npc, classId) | ||||||
|  | 	if (classId == NPC_WELLTRAVELED_MERCHANT) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_4", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_TIPSY_ADVENTURER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_5", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_CULTIVATED_TENDER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_6", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_ANXIOUS_ADVENTURER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_7", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_BABYFACED_ADVENTURER) then | ||||||
|  | 		if (seq000_Flag_MiniTut3 == false) then | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, man0l0Quest, "processTtrMini003", nil, nil, nil); | ||||||
|  | 			quest::UpdateENpc(FLAG, QFLAG_NONE); | ||||||
|  | 			seq000_Flag_MiniTut3 = true; | ||||||
|  | 		else | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, quest, "processEvent000_8", nil, nil, nil); | ||||||
|  | 		end | ||||||
|  | 	elseif (classId == NPC_AUSTERE_ADVENTURER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_9", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_UNDIGNIFIED_ADVENTURER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_10", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_SHADOWY_TRAVELER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_11", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_ASTUTE_MERCHANT) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_12", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_VOLUPTUOUS_VIXEN) then | ||||||
|  | 		if (seq000_Flag_MiniTut2 == false) then | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, man0l0Quest, "processTtrMini002", nil, nil, nil); | ||||||
|  | 			quest::UpdateENpc(classId, FLAG, QFLAG_NONE); | ||||||
|  | 			seq000_Flag_MiniTut2 = true; | ||||||
|  | 		else | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, quest, "processEvent000_13", nil, nil, nil); | ||||||
|  | 		end | ||||||
|  | 	elseif (classId == NPC_INDIFFERENT_PASSERBY) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_14", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_PRATTLING_ADVENTURER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_15", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_LANKY_TRAVELER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_16", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_GRINNING_ADVENTURER) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent000_17", nil, nil, nil); | ||||||
|  | 	elseif (classId == NPC_ROSTNSTHAL) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processTtrMini001", nil, nil, nil); | ||||||
|  | 		if (seq000_Flag_MiniTut1 == false) then | ||||||
|  | 			quest::UpdateENpc(classId, FLAG, QFLAG_NONE); | ||||||
|  | 			seq000_Flag_MiniTut1 = true; | ||||||
|  | 		end | ||||||
|  | 	elseif (classId == NPC_EXIT_TRIGGER) then | ||||||
|  | 		doExitDoor(player, quest, npc); | ||||||
|  | 		return; | ||||||
|  | 	end	 | ||||||
|  | 	player:EndEvent(); | ||||||
|  | 	 | ||||||
|  | 	if (seq000_Flag_MiniTut1 == true && seq000_Flag_MiniTut2 == true && seq000_Flag_MiniTut3 == true) then | ||||||
|  | 		quest::UpdateENpc(NPC_EXIT_TRIGGER, FLAG, QFLAG_BOTH); | ||||||
|  | 		quest::UpdateENpc(NPC_EXIT_TRIGGER, CANPUSH, true); | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function sequence005_onTalk(player, quest, npc, classId) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function sequence010_onTalk(player, quest, npc, classId) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onEmote(player, quest, npc, emote) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onPush(player, quest, npc) | ||||||
|  | 	local sequence = quest::getSequence(); | ||||||
|  | 	local classId = npc::GetActorClassId(); | ||||||
|  | 	 | ||||||
|  | 	if (sequence == SEQ_000) then | ||||||
|  | 		if (classId == NPC_EXIT_TRIGGER) then | ||||||
|  | 			doExitDoor(player, quest, npc); | ||||||
|  | 			return; | ||||||
|  | 		elseif (classId == NPC_ROSTNSTHAL) then | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, man0l0Quest, "processTtrNomal002", nil, nil, nil); | ||||||
|  | 			quest::UpdateENpc(NPC_ROSTNSTHAL, CANPUSH, false); | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onNotice(player, quest, npc) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function getJournalInformation(player, quest) | ||||||
|  | 	return {}; | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function getJournalMapMarkerList(player, quest) | ||||||
|  | 	local sequence = quest::getSequence(); | ||||||
|  | 	 | ||||||
|  | 	if (sequence == SEQ_000) then | ||||||
|  | 		return seq000_Markers; | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function doExitDoor(player, quest, npc) | ||||||
|  | 		local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventNewRectAsk", nil);	 | ||||||
|  | 		if (choice == 1) then | ||||||
|  | 			callClientFunction(player, "delegateEvent", player, quest, "processEvent000_2", nil, nil, nil, nil); | ||||||
|  | 			player:EndEvent(); | ||||||
|  | 			 | ||||||
|  | 			quest::StartSequence(SEQ_005); | ||||||
|  | 			 | ||||||
|  | 			contentArea = player:GetZone():CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0l01", "SimpleContent30002", "Quest/QuestDirectorMan0l001"); | ||||||
|  | 			 | ||||||
|  | 			if (contentArea == nil) then | ||||||
|  | 				return; | ||||||
|  | 			end | ||||||
|  | 			 | ||||||
|  | 			director = contentArea:GetContentDirector();		 | ||||||
|  | 			player:AddDirector(director);		 | ||||||
|  | 			director:StartDirector(false); | ||||||
|  | 			 | ||||||
|  | 			player:KickEvent(director, "noticeEvent", true); | ||||||
|  | 			player:SetLoginDirector(director);		 | ||||||
|  | 			 | ||||||
|  | 			GetWorldManager():DoZoneChangeContent(player, contentArea, -5, 16.35, 6, 0.5, 16);		 | ||||||
|  | 			return; | ||||||
|  | 		else | ||||||
|  | 			player::EndEvent(); | ||||||
|  | 		end | ||||||
|  | end | ||||||
							
								
								
									
										36
									
								
								Data/scripts/quests/man/man2l0.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Data/scripts/quests/man/man2l0.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | require("global.lua") | ||||||
|  |  | ||||||
|  | function onStart(player, quest)	 | ||||||
|  | 	quest:StartSequence(SEQ_000); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onFinish(player, quest) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onSequence(player, quest, seqNum) | ||||||
|  | 	quest:ClearENpcs();	 | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc) | ||||||
|  | 	local sequence = quest:getSequence(); | ||||||
|  | 	local classId = npc:GetActorClassId(); | ||||||
|  | 	 | ||||||
|  | 	 | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onEmote(player, quest, npc, emote) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onPush(player, quest, npc) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function onNotice(player, quest, npc) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function getJournalInformation(player, quest) | ||||||
|  | 	return {}; | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function getJournalMapMarkerList(player, quest) | ||||||
|  | 	return 11000105, 11000106; | ||||||
|  | end | ||||||
							
								
								
									
										86
									
								
								Data/scripts/quests/quest_template.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								Data/scripts/quests/quest_template.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,86 @@ | |||||||
|  | -- Sequence Numbers | ||||||
|  | --[[ | ||||||
|  | The current section of the quest the player is on. Quests are divided into "sequences" with a different  | ||||||
|  | objective for each one. Depending on the sequence # the journal log will have text appeneded to it. | ||||||
|  | Check xtx/quest for valid sequence values. | ||||||
|  | ]] | ||||||
|  | SEQ_000	= 0; | ||||||
|  | SEQ_005	= 5; | ||||||
|  | SEQ_010	= 10; | ||||||
|  |  | ||||||
|  | -- Quest Variables | ||||||
|  | --[[ | ||||||
|  | Locally stored variables, up to the script writer to make them up but use these to track things the player | ||||||
|  | has done. | ||||||
|  | ]] | ||||||
|  | local questFlag1 = false; | ||||||
|  | local questFlag2 = false; | ||||||
|  | local questFlag3 = false; | ||||||
|  | local killCounter1 = 0; | ||||||
|  | local killCounter2 = 0; | ||||||
|  | local killCounter3 = 0; | ||||||
|  |  | ||||||
|  | -- Map Markers | ||||||
|  | --[[ | ||||||
|  | A list of markers to show when the player opens the journal and clicks "View Map". References the  | ||||||
|  | quest_marker sheet. | ||||||
|  | ]] | ||||||
|  | local seq000_Markers = { | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | -- Actors in this quest | ||||||
|  | --[[ | ||||||
|  | A list of actor class ids that the quest will use. Good for adding it to the ENPC list and checking against | ||||||
|  | them when events are triggered. | ||||||
|  | ]] | ||||||
|  | NPC_SOMEACTOR = 0; | ||||||
|  |  | ||||||
|  | -- Called when a quest is started. Initialize any global variables across all phases here and always start | ||||||
|  | -- the first sequence (usually SEQ_000). | ||||||
|  | function onStart(player, quest)	 | ||||||
|  | 	quest::StartSequence(SEQ_000); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Called when the quest is finished, either from abandonment or completion. Clean up quest items or w.each | ||||||
|  | -- here. | ||||||
|  | function onFinish(player, quest) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Called when a sequence starts, either from the quest progressing to the next sequence, or from the  | ||||||
|  | -- player loading in with an already in progress quest. This class should add all appropriate ENPCs and  | ||||||
|  | -- configure them to the current quest state (flags, counters, etc). | ||||||
|  | function onSequence(player, quest, seqNum) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Called when an ENPC is talked to; only ENPCs that are currently added to the quest will trigger this. | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Called when an ENPC is emoted to; only ENPCs that are currently added to the quest will trigger this. | ||||||
|  | function onEmote(player, quest, npc, emote, eventName) | ||||||
|  | end | ||||||
|  |  | ||||||
|  |  | ||||||
|  | -- Called when an ENPC is pushed; only ENPCs that are currently added to the quest will trigger this. | ||||||
|  | function onPush(player, quest, npc, eventName) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Called when an ENPC is kicked; only ENPCs that are currently added to the quest will trigger this. | ||||||
|  | function onNotice(player, quest, npc, eventName) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Called when the player clicks on an NPC Linkshell. Check the id and send a message if there is one. | ||||||
|  | function onNpcLS(player, npcLSId) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- This is called by the RequestQuestJournalCommand to retrieve any extra information about the quest. | ||||||
|  | -- Check xtx/quest for valid values. | ||||||
|  | function getJournalInformation(player, quest) | ||||||
|  | 	return {}; | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- This is called by the RequestQuestJournalCommand when map markers are request. | ||||||
|  | -- Check quest_marker for valid values. This should return a table of map markers. | ||||||
|  | function getJournalMapMarkerList(player, quest) | ||||||
|  | 	return {}; | ||||||
|  | end | ||||||
							
								
								
									
										29
									
								
								Data/scripts/quests/trl/Trl0g1.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								Data/scripts/quests/trl/Trl0g1.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | require ("global") | ||||||
|  |  | ||||||
|  | --[[ | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
|  | Name: 	Getting Started (Mother Miounne) | ||||||
|  | Code: 	Trl0g1 | ||||||
|  | Id: 	110141 | ||||||
|  |  | ||||||
|  | Enables the "Getting Started" option on Miounne. | ||||||
|  | * NOTE: This quest is active for all players at all times. | ||||||
|  | ]] | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | 	local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventMiounneStart");	 | ||||||
|  | 	 | ||||||
|  | 	if (choice == 1) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent225"); | ||||||
|  | 	elseif (choice == 2) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent230"); | ||||||
|  | 	end | ||||||
|  | 	 | ||||||
|  | 	player:EndEvent(); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function IsQuestENPC(player, quest, npc) | ||||||
|  | 	return npc:GetActorClassId()] == 1000230; | ||||||
|  | end | ||||||
							
								
								
									
										29
									
								
								Data/scripts/quests/trl/Trl0l1.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								Data/scripts/quests/trl/Trl0l1.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | require ("global") | ||||||
|  |  | ||||||
|  | --[[ | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
|  | Name:	Getting Started (Baderon) | ||||||
|  | Code:	Trl0l1 | ||||||
|  | Id:		110140 | ||||||
|  |  | ||||||
|  | Enables the "Getting Started" option on Baderon. | ||||||
|  | * NOTE: This quest is active for all players at all times. | ||||||
|  | ]] | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | 	local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventBaderonStart");	 | ||||||
|  | 	 | ||||||
|  | 	if (choice == 1) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent640"); | ||||||
|  | 	elseif (choice == 2) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent650"); | ||||||
|  | 	end | ||||||
|  | 	 | ||||||
|  | 	player:EndEvent(); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function IsQuestENPC(player, quest, npc) | ||||||
|  | 	return npc:GetActorClassId()] == 1000137; | ||||||
|  | end | ||||||
							
								
								
									
										29
									
								
								Data/scripts/quests/trl/Trl0u1.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								Data/scripts/quests/trl/Trl0u1.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | require ("global") | ||||||
|  |  | ||||||
|  | --[[ | ||||||
|  |  | ||||||
|  | Quest Script | ||||||
|  |  | ||||||
|  | Name:	Getting Started (Momodi) | ||||||
|  | Code:	Trl0u1 | ||||||
|  | Id:		110142 | ||||||
|  |  | ||||||
|  | Enables the "Getting Started" option on Momodi. | ||||||
|  | * NOTE: This quest is active for all players at all times. | ||||||
|  | ]] | ||||||
|  |  | ||||||
|  | function onTalk(player, quest, npc, eventName) | ||||||
|  | 	local choice = callClientFunction(player, "delegateEvent", player, quest, "processEventMomodiStart");	 | ||||||
|  | 	 | ||||||
|  | 	if (choice == 1) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent235"); | ||||||
|  | 	elseif (choice == 2) then | ||||||
|  | 		callClientFunction(player, "delegateEvent", player, quest, "processEvent240"); | ||||||
|  | 	end | ||||||
|  | 	 | ||||||
|  | 	player:EndEvent(); | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function IsQuestENPC(player, quest, npc) | ||||||
|  | 	return npc:GetActorClassId() == 1000841; | ||||||
|  | end | ||||||
| @@ -256,7 +256,7 @@ namespace Meteor.Map.Actors | |||||||
|             return subpackets; |             return subpackets; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public List<SubPacket> GetSetEventStatusPackets() |         public List<SubPacket> GetSetEventStatusPackets(bool talkEnabled = true, bool emoteEnabled = true, bool pushEnabled = true, bool noticeEnabled = true) | ||||||
|         { |         { | ||||||
|             List<SubPacket> subpackets = new List<SubPacket>(); |             List<SubPacket> subpackets = new List<SubPacket>(); | ||||||
|  |  | ||||||
| @@ -267,37 +267,37 @@ namespace Meteor.Map.Actors | |||||||
|             if (eventConditions.talkEventConditions != null) |             if (eventConditions.talkEventConditions != null) | ||||||
|             { |             { | ||||||
|                 foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) |                 foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) | ||||||
|                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 1, condition.conditionName)); |                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, talkEnabled, 1, condition.conditionName)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (eventConditions.noticeEventConditions != null) |             if (eventConditions.noticeEventConditions != null) | ||||||
|             { |             { | ||||||
|                 foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) |                 foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) | ||||||
|                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 5, condition.conditionName)); |                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, noticeEnabled, 5, condition.conditionName)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (eventConditions.emoteEventConditions != null) |             if (eventConditions.emoteEventConditions != null) | ||||||
|             { |             { | ||||||
|                 foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) |                 foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) | ||||||
|                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 3, condition.conditionName)); |                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, emoteEnabled, 3, condition.conditionName)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (eventConditions.pushWithCircleEventConditions != null) |             if (eventConditions.pushWithCircleEventConditions != null) | ||||||
|             { |             { | ||||||
|                 foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) |                 foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) | ||||||
|                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 2, condition.conditionName)); |                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, pushEnabled, 2, condition.conditionName)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (eventConditions.pushWithFanEventConditions != null) |             if (eventConditions.pushWithFanEventConditions != null) | ||||||
|             { |             { | ||||||
|                 foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) |                 foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) | ||||||
|                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 2, condition.conditionName)); |                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, pushEnabled, 2, condition.conditionName)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (eventConditions.pushWithBoxEventConditions != null) |             if (eventConditions.pushWithBoxEventConditions != null) | ||||||
|             { |             { | ||||||
|                 foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) |                 foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) | ||||||
|                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 2, condition.conditionName)); |                     subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, pushEnabled, 2, condition.conditionName)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             return subpackets; |             return subpackets; | ||||||
|   | |||||||
| @@ -31,6 +31,7 @@ using Newtonsoft.Json; | |||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using Meteor.Map.actors.chara.ai; | using Meteor.Map.actors.chara.ai; | ||||||
|  | using Meteor.Map.packets.send.actor.events; | ||||||
|  |  | ||||||
| namespace Meteor.Map.Actors | namespace Meteor.Map.Actors | ||||||
| { | { | ||||||
|   | |||||||
| @@ -1456,27 +1456,24 @@ namespace Meteor.Map.Actors | |||||||
|  |  | ||||||
|         public void AddQuest(string name, bool isSilent = false) |         public void AddQuest(string name, bool isSilent = false) | ||||||
|         { |         { | ||||||
|             Actor actor = Server.GetStaticActors(name); |             Quest baseQuest = (Quest) Server.GetStaticActors(name); | ||||||
|  |  | ||||||
|             if (actor == null) |             if (baseQuest == null) | ||||||
|                 return; |                 return; | ||||||
|  |  | ||||||
|             uint id = actor.actorId; |  | ||||||
|  |  | ||||||
|             int freeSlot = GetFreeQuestSlot(); |             int freeSlot = GetFreeQuestSlot(); | ||||||
|  |  | ||||||
|             if (freeSlot == -1) |             if (freeSlot == -1) | ||||||
|                 return; |                 return; | ||||||
|  |  | ||||||
|             playerWork.questScenario[freeSlot] = id; |             playerWork.questScenario[freeSlot] = baseQuest.actorId; | ||||||
|             questScenario[freeSlot] = new Quest(this, playerWork.questScenario[freeSlot], name, null, 0, 0); |             questScenario[freeSlot] = new Quest(this, baseQuest); | ||||||
|             Database.SaveQuest(this, questScenario[freeSlot]); |             Database.SaveQuest(this, questScenario[freeSlot]); | ||||||
|             SendQuestClientUpdate(freeSlot); |             SendQuestClientUpdate(freeSlot); | ||||||
|  |  | ||||||
|             if (!isSilent) |             if (!isSilent) | ||||||
|             { |             { | ||||||
|                 SendGameMessage(Server.GetWorldManager().GetActor(), 25224, 0x20, (object)questScenario[freeSlot].GetQuestId()); |                 SendGameMessage(Server.GetWorldManager().GetActor(), 25224, 0x20, (object)questScenario[freeSlot].GetQuestId()); | ||||||
|                 questScenario[freeSlot].NextPhase(0); |  | ||||||
|             } |             } | ||||||
|         }         |         }         | ||||||
|  |  | ||||||
| @@ -1541,9 +1538,9 @@ namespace Meteor.Map.Actors | |||||||
|                 { |                 { | ||||||
|                     if (questScenario[i] != null && questScenario[i].GetQuestId() == oldId) |                     if (questScenario[i] != null && questScenario[i].GetQuestId() == oldId) | ||||||
|                     { |                     { | ||||||
|                         Actor actor = Server.GetStaticActors((0xA0F00000 | newId)); |                         Quest baseQuest = (Quest) Server.GetStaticActors((0xA0F00000 | newId)); | ||||||
|                         playerWork.questScenario[i] = (0xA0F00000 | newId); |                         playerWork.questScenario[i] = (0xA0F00000 | newId); | ||||||
|                         questScenario[i] = new Quest(this, playerWork.questScenario[i], actor.actorName, null, 0, 0); |                         questScenario[i] = new Quest(this, baseQuest); | ||||||
|                         Database.SaveQuest(this, questScenario[i]); |                         Database.SaveQuest(this, questScenario[i]); | ||||||
|                         SendQuestClientUpdate(i); |                         SendQuestClientUpdate(i); | ||||||
|                         break; |                         break; | ||||||
| @@ -1643,6 +1640,65 @@ namespace Meteor.Map.Actors | |||||||
|             return -1; |             return -1; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         public Quest GetDefaultTalkQuest(Npc npc) | ||||||
|  |         { | ||||||
|  |             Quest defaultTalk = null; | ||||||
|  |  | ||||||
|  |             switch (npc.zone.regionId) | ||||||
|  |             { | ||||||
|  |                 case 101: | ||||||
|  |                     defaultTalk = (Quest) Server.GetStaticActors("DftSea"); | ||||||
|  |                     break; | ||||||
|  |                 case 102: | ||||||
|  |                     defaultTalk = (Quest) Server.GetStaticActors("DftRoc"); | ||||||
|  |                     break; | ||||||
|  |                 case 103: | ||||||
|  |                     defaultTalk = (Quest) Server.GetStaticActors("DftFst"); | ||||||
|  |                     break; | ||||||
|  |                 case 104: | ||||||
|  |                     defaultTalk = (Quest) Server.GetStaticActors("DftWil"); | ||||||
|  |                     break; | ||||||
|  |                 case 105: | ||||||
|  |                     defaultTalk = (Quest) Server.GetStaticActors("DftLak"); | ||||||
|  |                     break; | ||||||
|  |                 case 805: | ||||||
|  |                     defaultTalk = (Quest) Server.GetStaticActors("DftSrt"); | ||||||
|  |                     break; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             if (defaultTalk != null && defaultTalk.IsQuestENPC(this, npc)) | ||||||
|  |                 return defaultTalk; | ||||||
|  |             return null; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public Quest GetTutorialQuest(Npc npc) | ||||||
|  |         { | ||||||
|  |             switch (npc.GetActorClassId()) | ||||||
|  |             { | ||||||
|  |                 case 1000137: | ||||||
|  |                     return (Quest)Server.GetStaticActors("Trl0l1"); | ||||||
|  |                 case 1000230: | ||||||
|  |                     return (Quest)Server.GetStaticActors("Trl0g1"); | ||||||
|  |                 case 1000841: | ||||||
|  |                     return (Quest)Server.GetStaticActors("Trl0u1"); | ||||||
|  |             } | ||||||
|  |             return null; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public Quest[] GetQuestsForNpc(Npc npc) | ||||||
|  |         { | ||||||
|  |             return Array.FindAll(questScenario, e => e != null && e.IsQuestENPC(this, npc)); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void HandleNpcLS(uint id) | ||||||
|  |         { | ||||||
|  |             foreach (Quest quest in questScenario) | ||||||
|  |             { | ||||||
|  |                 if (quest != null) | ||||||
|  |                     quest.OnNpcLS(this, id); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|         public void SetNpcLS(uint npcLSId, uint state) |         public void SetNpcLS(uint npcLSId, uint state) | ||||||
|         {             |         {             | ||||||
|             bool isCalling, isExtra; |             bool isCalling, isExtra; | ||||||
| @@ -1847,7 +1903,7 @@ namespace Meteor.Map.Actors | |||||||
|  |  | ||||||
|         public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte type) |         public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte type) | ||||||
|         { |         { | ||||||
|             SetEventStatusPacket.BuildPacket(actor.actorId, enabled, type, conditionName); |             QueuePacket(SetEventStatusPacket.BuildPacket(actor.actorId, enabled, type, conditionName)); | ||||||
|         }        |         }        | ||||||
|  |  | ||||||
|         public void RunEventFunction(string functionName, params object[] parameters) |         public void RunEventFunction(string functionName, params object[] parameters) | ||||||
|   | |||||||
| @@ -283,8 +283,9 @@ namespace Meteor.Map.actors.director | |||||||
|  |  | ||||||
|         private void LoadLuaScript() |         private void LoadLuaScript() | ||||||
|         { |         { | ||||||
|  |             string errorMsg = ""; | ||||||
|             string luaPath = String.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath()); |             string luaPath = String.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath()); | ||||||
|             directorScript = LuaEngine.LoadScript(luaPath); |             directorScript = LuaEngine.LoadScript(luaPath, ref errorMsg); | ||||||
|             if (directorScript == null) |             if (directorScript == null) | ||||||
|                 Program.Log.Error("Could not find script for director {0}.", GetName());           |                 Program.Log.Error("Could not find script for director {0}.", GetName());           | ||||||
|         } |         } | ||||||
| @@ -293,7 +294,8 @@ namespace Meteor.Map.actors.director | |||||||
|         { |         { | ||||||
|             if (directorScript != null) |             if (directorScript != null) | ||||||
|             { |             { | ||||||
|                 directorScript = LuaEngine.LoadScript(String.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath)); |                 string errorMsg = ""; | ||||||
|  |                 directorScript = LuaEngine.LoadScript(String.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath), ref errorMsg); | ||||||
|                 if (!directorScript.Globals.Get(funcName).IsNil()) |                 if (!directorScript.Globals.Get(funcName).IsNil()) | ||||||
|                 { |                 { | ||||||
|                     DynValue result = directorScript.Call(directorScript.Globals[funcName], args); |                     DynValue result = directorScript.Call(directorScript.Globals[funcName], args); | ||||||
|   | |||||||
| @@ -28,10 +28,257 @@ namespace Meteor.Map.Actors | |||||||
| { | { | ||||||
|     class Quest : Actor |     class Quest : Actor | ||||||
|     { |     { | ||||||
|         private Player owner; |         public const ushort SEQ_NOT_STARTED = ushort.MaxValue; | ||||||
|         private uint currentPhase = 0; |  | ||||||
|         private uint questFlags = 0; |         public class ENpcQuestInstance | ||||||
|         private Dictionary<string, Object> questData = new Dictionary<string, object>(); |         { | ||||||
|  |             public readonly uint actorClassId; | ||||||
|  |             public byte questFlagType { set; get; } | ||||||
|  |             public bool isSpawned { set; get; } | ||||||
|  |             public bool isTalkEnabled { set; get; } | ||||||
|  |             public bool isEmoteEnabled { set; get; } | ||||||
|  |             public bool isPushEnabled { set; get; } | ||||||
|  |  | ||||||
|  |             public ENpcQuestInstance(uint actorClassId, byte questFlagType, bool isSpawned, bool isTalkEnabled, bool isEmoteEnabled, bool isPushEnabled) | ||||||
|  |             { | ||||||
|  |                 this.actorClassId = actorClassId; | ||||||
|  |                 this.questFlagType = questFlagType; | ||||||
|  |                 this.isSpawned = isSpawned; | ||||||
|  |                 this.isTalkEnabled = isTalkEnabled; | ||||||
|  |                 this.isEmoteEnabled = isEmoteEnabled; | ||||||
|  |                 this.isPushEnabled = isPushEnabled; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         private struct QuestData | ||||||
|  |         { | ||||||
|  |             public UInt32 flags; | ||||||
|  |             public UInt16 counter1; | ||||||
|  |             public UInt16 counter2; | ||||||
|  |             public UInt16 counter3; | ||||||
|  |             public UInt16 counter4; | ||||||
|  |  | ||||||
|  |             public QuestData(uint flags, ushort counter1, ushort counter2, ushort counter3) : this() | ||||||
|  |             { | ||||||
|  |                 this.flags = flags; | ||||||
|  |                 this.counter1 = counter1; | ||||||
|  |                 this.counter2 = counter2; | ||||||
|  |                 this.counter3 = counter3; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         private Player Owner; | ||||||
|  |         private ushort currentSequence; | ||||||
|  |         private QuestData data = new QuestData(); | ||||||
|  |         private Dictionary<uint, ENpcQuestInstance> ActiveENpcs = new Dictionary<uint, ENpcQuestInstance>(); | ||||||
|  |  | ||||||
|  |         public void AddENpc(uint classId, byte flagType = 0, bool isTalkEnabled = false, bool isEmoteEnabled = false, bool isPushEnabled = false, bool isSpawned = false) | ||||||
|  |         { | ||||||
|  |             if (ActiveENpcs.ContainsKey(classId)) | ||||||
|  |                 return; | ||||||
|  |  | ||||||
|  |             ENpcQuestInstance instance = new ENpcQuestInstance(classId, flagType, isSpawned, isTalkEnabled, isEmoteEnabled, isPushEnabled); | ||||||
|  |             ActiveENpcs.Add(classId, instance);            | ||||||
|  |             Owner.playerSession.UpdateQuestNpcInInstance(instance); | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         public void ClearENpcs() | ||||||
|  |         { | ||||||
|  |             foreach (ENpcQuestInstance instance in ActiveENpcs.Values)             | ||||||
|  |                 Owner.playerSession.UpdateQuestNpcInInstance(instance, true);                 | ||||||
|  |              | ||||||
|  |             ActiveENpcs.Clear(); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void UpdateENpc(uint classId, int param, object value) | ||||||
|  |         { | ||||||
|  |             if (!ActiveENpcs.ContainsKey(classId)) | ||||||
|  |                 return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public ENpcQuestInstance GetENpcInstance(uint classId) | ||||||
|  |         { | ||||||
|  |             if (ActiveENpcs.ContainsKey(classId)) | ||||||
|  |                 return ActiveENpcs[classId]; | ||||||
|  |             return null; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void OnTalk(Player caller, Npc npc) | ||||||
|  |         {         | ||||||
|  |             LuaEngine.GetInstance().CallLuaFunction(caller, this, "onTalk", true, npc);             | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void OnEmote(Player caller, Npc npc, Command command) | ||||||
|  |         { | ||||||
|  |             LuaEngine.GetInstance().CallLuaFunction(caller, this, "onEmote", true, npc, command); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void OnPush(Player caller, Npc npc) | ||||||
|  |         { | ||||||
|  |             LuaEngine.GetInstance().CallLuaFunction(caller, this, "onPush", true, npc); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void OnNotice(Player caller, Npc npc) | ||||||
|  |         { | ||||||
|  |             LuaEngine.GetInstance().CallLuaFunction(caller, this, "onNotice", true, npc); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void OnNpcLS(Player caller, uint npcLSId) | ||||||
|  |         { | ||||||
|  |             LuaEngine.GetInstance().CallLuaFunction(caller, this, "onNpcLS", true, npcLSId); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public bool IsQuestENPC(Player caller, Npc npc) | ||||||
|  |         { | ||||||
|  |             List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(caller, this, "IsQuestENPC", true, npc, this); | ||||||
|  |             bool scriptReturned = returned != null && returned.Count != 0 && returned[0].typeID == 3; | ||||||
|  |             return scriptReturned || ActiveENpcs.ContainsKey(npc.GetActorClassId()); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         public object[] GetJournalInformation() | ||||||
|  |         { | ||||||
|  |             List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(Owner, this, "getJournalInformation", true); | ||||||
|  |             if (returned != null && returned.Count != 0) | ||||||
|  |                 return LuaUtils.CreateLuaParamObjectList(returned); | ||||||
|  |             else | ||||||
|  |                 return new object[0]; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public object[] GetJournalMapMarkerList() | ||||||
|  |         { | ||||||
|  |             List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(Owner, this, "getJournalMapMarkerList", true); | ||||||
|  |             if (returned != null && returned.Count != 0) | ||||||
|  |                 return LuaUtils.CreateLuaParamObjectList(returned); | ||||||
|  |             else | ||||||
|  |                 return new object[0]; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public ushort GetSequence() | ||||||
|  |         { | ||||||
|  |             return currentSequence; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void StartSequence(ushort sequence) | ||||||
|  |         {             | ||||||
|  |             if (sequence == SEQ_NOT_STARTED) | ||||||
|  |                 return; | ||||||
|  |  | ||||||
|  |             // Send the message that the journal has been updated | ||||||
|  |             if (currentSequence != SEQ_NOT_STARTED) | ||||||
|  |                 Owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId()); | ||||||
|  |  | ||||||
|  |             currentSequence = sequence; | ||||||
|  |             LuaEngine.GetInstance().CallLuaFunction(Owner, this, "onSequence", false, currentSequence); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void ClearData() | ||||||
|  |         { | ||||||
|  |             data.flags = data.counter1 = data.counter2 = data.counter3 = data.counter4 = 0; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void SetFlag(int index) | ||||||
|  |         { | ||||||
|  |             if (index >= 0 && index < 32) | ||||||
|  |                 data.flags |= (uint)(1 << index); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void ClearFlag(int index) | ||||||
|  |         { | ||||||
|  |             if (index >= 0 && index < 32) | ||||||
|  |                 data.flags &= (uint)~(1 << index); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void IncCounter(int num) | ||||||
|  |         { | ||||||
|  |             switch (num) | ||||||
|  |             { | ||||||
|  |                 case 0: | ||||||
|  |                     data.counter1++; | ||||||
|  |                     break; | ||||||
|  |                 case 1: | ||||||
|  |                     data.counter2++; | ||||||
|  |                     break; | ||||||
|  |                 case 2: | ||||||
|  |                     data.counter3++; | ||||||
|  |                     break; | ||||||
|  |                 case 3: | ||||||
|  |                     data.counter4++; | ||||||
|  |                     break; | ||||||
|  |             }     | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void DecCounter(int num) | ||||||
|  |         { | ||||||
|  |             switch (num) | ||||||
|  |             { | ||||||
|  |                 case 0: | ||||||
|  |                     data.counter1--; | ||||||
|  |                     break; | ||||||
|  |                 case 1: | ||||||
|  |                     data.counter2--; | ||||||
|  |                     break; | ||||||
|  |                 case 2: | ||||||
|  |                     data.counter3--; | ||||||
|  |                     break; | ||||||
|  |                 case 3: | ||||||
|  |                     data.counter4--; | ||||||
|  |                     break; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void SetCounter(int num, ushort value) | ||||||
|  |         { | ||||||
|  |             switch (num) | ||||||
|  |             { | ||||||
|  |                 case 0: | ||||||
|  |                     data.counter1 = value; | ||||||
|  |                     break; | ||||||
|  |                 case 1: | ||||||
|  |                     data.counter2 = value; | ||||||
|  |                     break; | ||||||
|  |                 case 2: | ||||||
|  |                     data.counter3 = value; | ||||||
|  |                     break; | ||||||
|  |                 case 3: | ||||||
|  |                     data.counter4 = value; | ||||||
|  |                     break; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public bool GetFlag(int index) | ||||||
|  |         { | ||||||
|  |             if (index >= 0 && index < 32) | ||||||
|  |                 return (data.flags & (uint) (1 << index)) != 0; | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public uint GetFlags() | ||||||
|  |         { | ||||||
|  |             return data.flags; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public ushort GetCounter(int num) | ||||||
|  |         { | ||||||
|  |             switch (num) | ||||||
|  |             { | ||||||
|  |                 case 0: | ||||||
|  |                     return data.counter1; | ||||||
|  |                 case 1: | ||||||
|  |                     return data.counter2; | ||||||
|  |                 case 2: | ||||||
|  |                     return data.counter3; | ||||||
|  |                 case 3: | ||||||
|  |                     return data.counter4; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             return 0; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         public void SaveData() | ||||||
|  |         {             | ||||||
|  |             Database.SaveQuest(Owner, this); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         public Quest(uint actorID, string name) |         public Quest(uint actorID, string name) | ||||||
|             : base(actorID) |             : base(actorID) | ||||||
| @@ -39,29 +286,23 @@ namespace Meteor.Map.Actors | |||||||
|             actorName = name;             |             actorName = name;             | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public Quest(Player owner, uint actorID, string name, string questDataJson, uint questFlags, uint currentPhase) |         public Quest(Player owner, Quest baseQuest): this(owner, baseQuest, SEQ_NOT_STARTED, 0, 0, 0, 0) | ||||||
|             : base(actorID) |         {} | ||||||
|         { |  | ||||||
|             this.owner = owner; |  | ||||||
|             actorName = name;             |  | ||||||
|             this.questFlags = questFlags; |  | ||||||
|  |  | ||||||
|             if (questDataJson != null) |         public Quest(Player owner, Quest baseQuest, ushort sequence, uint flags, ushort counter1, ushort counter2, ushort counter3) | ||||||
|                 this.questData = JsonConvert.DeserializeObject<Dictionary<string, Object>>(questDataJson); |             : base(baseQuest.actorId) | ||||||
|  |         { | ||||||
|  |             Owner = owner; | ||||||
|  |             actorName = baseQuest.actorName; | ||||||
|  |             className = baseQuest.className; | ||||||
|  |             classPath = baseQuest.classPath; | ||||||
|  |             currentSequence = sequence; | ||||||
|  |             data = new QuestData(flags, counter1, counter2, counter3); | ||||||
|  |  | ||||||
|  |             if (currentSequence == SEQ_NOT_STARTED) | ||||||
|  |                 LuaEngine.GetInstance().CallLuaFunction(Owner, this, "onStart", false); | ||||||
|             else |             else | ||||||
|                 questData = null; |                 StartSequence(currentSequence); | ||||||
|  |  | ||||||
|             if (questData == null) |  | ||||||
|                 questData = new Dictionary<string, object>(); |  | ||||||
|  |  | ||||||
|             this.currentPhase = currentPhase; |  | ||||||
|         } |  | ||||||
|         |  | ||||||
|         public void SetQuestData(string dataName, object data) |  | ||||||
|         {             |  | ||||||
|                 questData[dataName] = data; |  | ||||||
|  |  | ||||||
|             //Inform update |  | ||||||
|         } |         } | ||||||
|         |         | ||||||
|         public uint GetQuestId() |         public uint GetQuestId() | ||||||
| @@ -69,97 +310,17 @@ namespace Meteor.Map.Actors | |||||||
|             return actorId & 0xFFFFF; |             return actorId & 0xFFFFF; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public object GetQuestData(string dataName) |         public void DoComplete() | ||||||
|         { |         { | ||||||
|             if (questData.ContainsKey(dataName)) |             LuaEngine.GetInstance().CallLuaFunctionForReturn(Owner, this, "onFinish", true); | ||||||
|                 return questData[dataName]; |             Owner.SendDataPacket("attention", Server.GetWorldManager().GetActor(), "", 25225, (object)GetQuestId()); | ||||||
|             else |             Owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25225, 0x20, (object)GetQuestId()); | ||||||
|                 return null; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public void ClearQuestData() |  | ||||||
|         { |  | ||||||
|             questData.Clear(); |  | ||||||
|         }        |  | ||||||
|  |  | ||||||
|         public void ClearQuestFlags() |  | ||||||
|         { |  | ||||||
|             questFlags = 0; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public void SetQuestFlag(int bitIndex, bool value) |  | ||||||
|         { |  | ||||||
|             if (bitIndex >= 32) |  | ||||||
|             { |  | ||||||
|                 Program.Log.Error("Tried to access bit flag >= 32 for questId: {0}", actorId); |  | ||||||
|                 return; |  | ||||||
|             } |  | ||||||
|              |  | ||||||
|             int mask = 1 << bitIndex; |  | ||||||
|  |  | ||||||
|             if (value) |  | ||||||
|                 questFlags |= (uint)(1 << bitIndex); |  | ||||||
|             else |  | ||||||
|                 questFlags &= (uint)~(1 << bitIndex); |  | ||||||
|  |  | ||||||
|             DoCompletionCheck(); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public bool GetQuestFlag(int bitIndex) |  | ||||||
|         { |  | ||||||
|             if (bitIndex >= 32) |  | ||||||
|             { |  | ||||||
|                 Program.Log.Error("Tried to access bit flag >= 32 for questId: {0}", actorId); |  | ||||||
|                 return false; |  | ||||||
|             } |  | ||||||
|             else |  | ||||||
|             return (questFlags & (1 << bitIndex)) == (1 << bitIndex); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public uint GetPhase() |  | ||||||
|         { |  | ||||||
|             return currentPhase; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public void NextPhase(uint phaseNumber) |  | ||||||
|         { |  | ||||||
|             currentPhase = phaseNumber; |  | ||||||
|             owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId()); |  | ||||||
|             SaveData(); |  | ||||||
|  |  | ||||||
|             DoCompletionCheck(); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public uint GetQuestFlags() |  | ||||||
|         { |  | ||||||
|             return questFlags; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public string GetSerializedQuestData() |  | ||||||
|         { |  | ||||||
|             return JsonConvert.SerializeObject(questData, Formatting.Indented); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public void SaveData() |  | ||||||
|         { |  | ||||||
|             Database.SaveQuest(owner, this); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         public void DoCompletionCheck() |  | ||||||
|         { |  | ||||||
|             List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(owner, this, "isObjectivesComplete", true); |  | ||||||
|             if (returned != null && returned.Count >= 1 && returned[0].typeID == 3) |  | ||||||
|             { |  | ||||||
|                 owner.SendDataPacket("attention", Server.GetWorldManager().GetActor(), "", 25225, (object)GetQuestId()); |  | ||||||
|                 owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25225, 0x20, (object)GetQuestId());	 |  | ||||||
|             } |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public void DoAbandon() |         public void DoAbandon() | ||||||
|         { |         { | ||||||
|             LuaEngine.GetInstance().CallLuaFunctionForReturn(owner, this, "onAbandonQuest", true); |             LuaEngine.GetInstance().CallLuaFunctionForReturn(Owner, this, "onFinish", false); | ||||||
|             owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId()); |             Owner.SendGameMessage(Owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -94,15 +94,22 @@ namespace Meteor.Map.Actors | |||||||
|                             string actorType = output.Split('/')[1]; |                             string actorType = output.Split('/')[1]; | ||||||
|                             string actorName = output.Substring(1 + output.LastIndexOf("/")); |                             string actorName = output.Substring(1 + output.LastIndexOf("/")); | ||||||
|  |  | ||||||
|  |                             Actor actor = null; | ||||||
|                             if (actorType.Equals("Command")) |                             if (actorType.Equals("Command")) | ||||||
|                                 mStaticActors.Add(id, new Command(id, actorName)); |                                 actor = new Command(id, actorName); | ||||||
|                             else if (actorType.Equals("Quest")) |                             else if (actorType.Equals("Quest")) | ||||||
|                                 mStaticActors.Add(id, new Quest(id, actorName)); |                                 actor = new Quest(id, actorName); | ||||||
|                             //else if (actorType.Equals("Status")) |                             //else if (actorType.Equals("Status")) | ||||||
|                             //mStaticActors.Add(id, new Status(id, actorName)); |                             //mStaticActors.Add(id, new Status(id, actorName)); | ||||||
|                             else if (actorType.Equals("Judge")) |                             else if (actorType.Equals("Judge")) | ||||||
|                                 mStaticActors.Add(id, new Judge(id, actorName)); |                                 actor = new Judge(id, actorName); | ||||||
|  |  | ||||||
|  |                             if (actor != null) | ||||||
|  |                             { | ||||||
|  |                                 actor.className = actorName; | ||||||
|  |                                 actor.classPath = output; | ||||||
|  |                                 mStaticActors.Add(id, actor); | ||||||
|  |                             } | ||||||
|                         } |                         } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -25,6 +25,7 @@ using Meteor.Map.Actors; | |||||||
| using Meteor.Map.packets.send.actor; | using Meteor.Map.packets.send.actor; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using Meteor.Map.actors.chara.npc; | using Meteor.Map.actors.chara.npc; | ||||||
|  | using static Meteor.Map.Actors.Quest; | ||||||
|  |  | ||||||
| namespace Meteor.Map.dataobjects | namespace Meteor.Map.dataobjects | ||||||
| { | { | ||||||
| @@ -110,10 +111,6 @@ namespace Meteor.Map.dataobjects | |||||||
|             if (isUpdatesLocked && !force) |             if (isUpdatesLocked && !force) | ||||||
|                 return; |                 return; | ||||||
|  |  | ||||||
|             List<BasePacket> basePackets = new List<BasePacket>(); |  | ||||||
|             List<SubPacket> RemoveActorSubpackets = new List<SubPacket>(); |  | ||||||
|             List<SubPacket> posUpdateSubpackets = new List<SubPacket>(); |  | ||||||
|  |  | ||||||
|             //Remove missing actors |             //Remove missing actors | ||||||
|             for (int i = 0; i < actorInstanceList.Count; i++) |             for (int i = 0; i < actorInstanceList.Count; i++) | ||||||
|             { |             { | ||||||
| @@ -157,27 +154,54 @@ namespace Meteor.Map.dataobjects | |||||||
|                 else |                 else | ||||||
|                 { |                 { | ||||||
|                     QueuePacket(actor.GetSpawnPackets(playerActor, 1)); |                     QueuePacket(actor.GetSpawnPackets(playerActor, 1)); | ||||||
|  |  | ||||||
|                     QueuePacket(actor.GetInitPackets()); |                     QueuePacket(actor.GetInitPackets()); | ||||||
|                     QueuePacket(actor.GetSetEventStatusPackets()); |                     QueuePacket(actor.GetSetEventStatusPackets()); | ||||||
|                     actorInstanceList.Add(actor); |  | ||||||
|  |  | ||||||
|                     if (actor is Npc) |                     if (actor is Npc npc) | ||||||
|                     { |                     { | ||||||
|                         ((Npc)actor).DoOnActorSpawn(playerActor); |                         npc.DoOnActorSpawn(playerActor); | ||||||
|  |  | ||||||
|  |                         // Quest Instance related | ||||||
|  |                         Quest[] quests = playerActor.GetQuestsForNpc(npc); | ||||||
|  |                         if (quests.Length != 0) | ||||||
|  |                         { | ||||||
|  |                             ENpcQuestInstance questInstance = quests[0].GetENpcInstance(npc.GetActorClassId()); | ||||||
|  |                             QueuePacket(npc.GetSetEventStatusPackets()); | ||||||
|  |                             QueuePacket(SetActorQuestGraphicPacket.BuildPacket(npc.actorId, questInstance.questFlagType));                             | ||||||
|  |                         } | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |                     actorInstanceList.Add(actor); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         public void UpdateQuestNpcInInstance(ENpcQuestInstance questInstance, bool clearInstance = false) | ||||||
|  |         { | ||||||
|  |             LockUpdates(true); | ||||||
|  |             Actor actor = actorInstanceList.Find(x => x is Npc npc && npc.GetActorClassId().Equals(questInstance.actorClassId)); | ||||||
|  |             if (actor != null) | ||||||
|  |             { | ||||||
|  |                 if (!clearInstance) | ||||||
|  |                 { | ||||||
|  |                     QueuePacket(actor.GetSetEventStatusPackets()); | ||||||
|  |                     QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actor.actorId, questInstance.questFlagType)); | ||||||
|  |                 } | ||||||
|  |                 else | ||||||
|  |                 { | ||||||
|  |                     QueuePacket(actor.GetSetEventStatusPackets()); | ||||||
|  |                     QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actor.actorId, 0)); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             LockUpdates(false); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         public void ClearInstance() |         public void ClearInstance() | ||||||
|         { |         { | ||||||
|             actorInstanceList.Clear(); |             actorInstanceList.Clear(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|         public void LockUpdates(bool f) |         public void LockUpdates(bool f) | ||||||
|         { |         { | ||||||
|             isUpdatesLocked = f; |             isUpdatesLocked = f; | ||||||
|   | |||||||
| @@ -502,20 +502,22 @@ namespace Meteor.Map | |||||||
|  |  | ||||||
|                     query = @" |                     query = @" | ||||||
|                     INSERT INTO characters_quest_scenario  |                     INSERT INTO characters_quest_scenario  | ||||||
|                     (characterId, slot, questId, currentPhase, questData, questFlags) |                     (characterId, slot, questId, sequence, flags, counter1, counter2, counter3) | ||||||
|                     VALUES |                     VALUES | ||||||
|                     (@charaId, @slot, @questId, @phase, @questData, @questFlags) |                     (@charaId, @slot, @questId, @sequence, @flags, @counter1, @counter2, @counter3) | ||||||
|                     ON DUPLICATE KEY UPDATE |                     ON DUPLICATE KEY UPDATE | ||||||
|                     questId = @questId, currentPhase = @phase, questData = @questData, questFlags = @questFlags |                     questId = @questId, sequence = @sequence, flags = @flags, counter1 = @counter1, counter2 = @counter2, counter3 = @counter3 | ||||||
|                     "; |                     "; | ||||||
|  |  | ||||||
|                     cmd = new MySqlCommand(query, conn); |                     cmd = new MySqlCommand(query, conn); | ||||||
|                     cmd.Parameters.AddWithValue("@charaId", player.actorId); |                     cmd.Parameters.AddWithValue("@charaId", player.actorId); | ||||||
|                     cmd.Parameters.AddWithValue("@slot", slot); |                     cmd.Parameters.AddWithValue("@slot", slot); | ||||||
|                     cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.actorId); |                     cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.actorId); | ||||||
|                     cmd.Parameters.AddWithValue("@phase", quest.GetPhase()); |                     cmd.Parameters.AddWithValue("@sequence", quest.GetSequence()); | ||||||
|                     cmd.Parameters.AddWithValue("@questData", quest.GetSerializedQuestData()); |                     cmd.Parameters.AddWithValue("@flags", quest.GetFlags()); | ||||||
|                     cmd.Parameters.AddWithValue("@questFlags", quest.GetQuestFlags()); |                     cmd.Parameters.AddWithValue("@counter1", quest.GetCounter(1)); | ||||||
|  |                     cmd.Parameters.AddWithValue("@counter2", quest.GetCounter(2)); | ||||||
|  |                     cmd.Parameters.AddWithValue("@counter3", quest.GetCounter(3)); | ||||||
|  |  | ||||||
|                     cmd.ExecuteNonQuery(); |                     cmd.ExecuteNonQuery(); | ||||||
|                 } |                 } | ||||||
| @@ -1145,9 +1147,11 @@ namespace Meteor.Map | |||||||
|                         SELECT  |                         SELECT  | ||||||
|                         slot, |                         slot, | ||||||
|                         questId, |                         questId, | ||||||
|                         questData, |                         sequence, | ||||||
|                         questFlags, |                         flags, | ||||||
|                         currentPhase |                         counter1, | ||||||
|  |                         counter2, | ||||||
|  |                         counter3 | ||||||
|                         FROM characters_quest_scenario WHERE characterId = @charId"; |                         FROM characters_quest_scenario WHERE characterId = @charId"; | ||||||
|  |  | ||||||
|                     cmd = new MySqlCommand(query, conn); |                     cmd = new MySqlCommand(query, conn); | ||||||
| @@ -1156,27 +1160,18 @@ namespace Meteor.Map | |||||||
|                     { |                     { | ||||||
|                         while (reader.Read()) |                         while (reader.Read()) | ||||||
|                         { |                         { | ||||||
|                             int index = reader.GetUInt16(0); |                             int index = reader.GetUInt16("slot"); | ||||||
|                             player.playerWork.questScenario[index] = 0xA0F00000 | reader.GetUInt32(1); |                             uint questId = 0xA0F00000 | reader.GetUInt32("questId"); | ||||||
|                             string questData = null; |                             ushort sequence = reader.GetUInt16("sequence"); | ||||||
|                             uint questFlags = 0; |                             uint flags = reader.GetUInt32("flags"); | ||||||
|                             uint currentPhase = 0; |                             ushort counter1 = reader.GetUInt16("counter1"); | ||||||
|  |                             ushort counter2 = reader.GetUInt16("counter2"); | ||||||
|  |                             ushort counter3 = reader.GetUInt16("counter3"); | ||||||
|  |  | ||||||
|                             if (!reader.IsDBNull(2)) |                             Quest baseQuest = (Quest) Server.GetStaticActors(questId); | ||||||
|                                 questData = reader.GetString(2); |  | ||||||
|                             else |  | ||||||
|                                 questData = "{}"; |  | ||||||
|  |  | ||||||
|                             if (!reader.IsDBNull(3)) |                             player.playerWork.questScenario[index] = questId; | ||||||
|                                 questFlags = reader.GetUInt32(3); |                             player.questScenario[index] = new Quest(player, baseQuest, sequence, flags, counter1, counter2, counter3); | ||||||
|                             else |  | ||||||
|                                 questFlags = 0; |  | ||||||
|  |  | ||||||
|                             if (!reader.IsDBNull(4)) |  | ||||||
|                                 currentPhase = reader.GetUInt32(4); |  | ||||||
|  |  | ||||||
|                             string questName = Server.GetStaticActors(player.playerWork.questScenario[index]).actorName; |  | ||||||
|                             player.questScenario[index] = new Quest(player, player.playerWork.questScenario[index], questName, questData, questFlags, currentPhase); |  | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -61,10 +61,16 @@ namespace Meteor.Map.lua | |||||||
|  |  | ||||||
|         private LuaEngine() |         private LuaEngine() | ||||||
|         { |         { | ||||||
|             UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic; |  | ||||||
|  |  | ||||||
|             luaTimer = new Timer(new TimerCallback(PulseSleepingOnTime), |             luaTimer = new Timer(new TimerCallback(PulseSleepingOnTime), | ||||||
|                            null, TimeSpan.Zero, TimeSpan.FromMilliseconds(50)); |                            null, TimeSpan.Zero, TimeSpan.FromMilliseconds(50)); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |             UserData.RegisterType<Player>(); | ||||||
|  |             UserData.RegisterType<Command>(); | ||||||
|  |             UserData.RegisterType<Npc>(); | ||||||
|  |             UserData.RegisterType<Quest>(); | ||||||
|  |             UserData.RegisterType<WorldManager>(); | ||||||
|  |             UserData.RegisterType<WorldMaster>(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public static LuaEngine GetInstance() |         public static LuaEngine GetInstance() | ||||||
| @@ -403,20 +409,24 @@ namespace Meteor.Map.lua | |||||||
|                 args2[0] = target; |                 args2[0] = target; | ||||||
|  |  | ||||||
|             LuaScript parent = null, child = null; |             LuaScript parent = null, child = null; | ||||||
|  |             string errorMsg = ""; | ||||||
|  |  | ||||||
|             if (File.Exists("./scripts/base/" + target.classPath + ".lua")) |             if (File.Exists("./scripts/base/" + target.classPath + ".lua")) | ||||||
|                 parent = LuaEngine.LoadScript("./scripts/base/" + target.classPath + ".lua"); |                 parent = LuaEngine.LoadScript("./scripts/base/" + target.classPath + ".lua", ref errorMsg); | ||||||
|  |  | ||||||
|  |             if (!errorMsg.Equals("")) | ||||||
|  |                 SendError(player, errorMsg); | ||||||
|  |  | ||||||
|             Area area = target.zone; |             Area area = target.zone; | ||||||
|             if (area is PrivateArea) |             if (area is PrivateArea) | ||||||
|             { |             { | ||||||
|                 if (File.Exists(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()))) |                 if (File.Exists(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()))) | ||||||
|                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId())); |                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()), ref errorMsg); | ||||||
|             } |             } | ||||||
|             else |             else | ||||||
|             { |             { | ||||||
|                 if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()))) |                 if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()))) | ||||||
|                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId())); |                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()), ref errorMsg); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (parent == null && child == null) |             if (parent == null && child == null) | ||||||
| @@ -451,20 +461,21 @@ namespace Meteor.Map.lua | |||||||
|                 args2[0] = target; |                 args2[0] = target; | ||||||
|  |  | ||||||
|             LuaScript parent = null, child = null; |             LuaScript parent = null, child = null; | ||||||
|  |             string errorMsg = ""; | ||||||
|  |  | ||||||
|             if (File.Exists("./scripts/base/" + target.classPath + ".lua")) |             if (File.Exists("./scripts/base/" + target.classPath + ".lua")) | ||||||
|                 parent = LuaEngine.LoadScript("./scripts/base/" + target.classPath + ".lua"); |                 parent = LuaEngine.LoadScript("./scripts/base/" + target.classPath + ".lua", ref errorMsg); | ||||||
|  |  | ||||||
|             Area area = target.zone; |             Area area = target.zone; | ||||||
|             if (area is PrivateArea) |             if (area is PrivateArea) | ||||||
|             { |             { | ||||||
|                 if (File.Exists(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()))) |                 if (File.Exists(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()))) | ||||||
|                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId())); |                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()), ref errorMsg); | ||||||
|             } |             } | ||||||
|             else |             else | ||||||
|             { |             { | ||||||
|                 if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()))) |                 if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()))) | ||||||
|                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId())); |                     child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()), ref errorMsg); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (parent == null && child == null) |             if (parent == null && child == null) | ||||||
| @@ -493,6 +504,8 @@ namespace Meteor.Map.lua | |||||||
|                     SendError(player, e.DecoratedMessage); |                     SendError(player, e.DecoratedMessage); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |             if (!errorMsg.Equals("")) | ||||||
|  |                 SendError(player, errorMsg); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public List<LuaParam> CallLuaFunctionForReturn(Player player, Actor target, string funcName, bool optional, params object[] args) |         public List<LuaParam> CallLuaFunctionForReturn(Player player, Actor target, string funcName, bool optional, params object[] args) | ||||||
| @@ -511,8 +524,10 @@ namespace Meteor.Map.lua | |||||||
|             else |             else | ||||||
|                 args2[0] = target; |                 args2[0] = target; | ||||||
|  |  | ||||||
|  |             string errorMsg = ""; | ||||||
|  |  | ||||||
|             string luaPath = GetScriptPath(target); |             string luaPath = GetScriptPath(target); | ||||||
|             LuaScript script = LoadScript(luaPath); |             LuaScript script = LoadScript(luaPath, ref errorMsg); | ||||||
|             if (script != null) |             if (script != null) | ||||||
|             { |             { | ||||||
|                 if (!script.Globals.Get(funcName).IsNil()) |                 if (!script.Globals.Get(funcName).IsNil()) | ||||||
| @@ -533,13 +548,16 @@ namespace Meteor.Map.lua | |||||||
|                 if (!optional) |                 if (!optional) | ||||||
|                     SendError(player, String.Format("Could not find script for actor {0}.", target.GetName())); |                     SendError(player, String.Format("Could not find script for actor {0}.", target.GetName())); | ||||||
|             } |             } | ||||||
|  |             if (!errorMsg.Equals("")) | ||||||
|  |                 SendError(player, errorMsg); | ||||||
|             return null; |             return null; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public List<LuaParam> CallLuaFunctionForReturn(string path, string funcName, bool optional, params object[] args) |         public List<LuaParam> CallLuaFunctionForReturn(string path, string funcName, bool optional, params object[] args) | ||||||
|         { |         { | ||||||
|             string luaPath = path; |             string luaPath = path; | ||||||
|             LuaScript script = LoadScript(luaPath); |             string errorMsg = ""; | ||||||
|  |             LuaScript script = LoadScript(luaPath, ref errorMsg); | ||||||
|             if (script != null) |             if (script != null) | ||||||
|             { |             { | ||||||
|                 if (!script.Globals.Get(funcName).IsNil()) |                 if (!script.Globals.Get(funcName).IsNil()) | ||||||
| @@ -567,8 +585,9 @@ namespace Meteor.Map.lua | |||||||
|             args2[0] = player; |             args2[0] = player; | ||||||
|             args2[1] = target; |             args2[1] = target; | ||||||
|  |  | ||||||
|  |             string errorMsg = ""; | ||||||
|             string luaPath = GetScriptPath(target); |             string luaPath = GetScriptPath(target); | ||||||
|             LuaScript script = LoadScript(luaPath); |             LuaScript script = LoadScript(luaPath, ref errorMsg); | ||||||
|             if (script != null) |             if (script != null) | ||||||
|             { |             { | ||||||
|                 if (!script.Globals.Get(funcName).IsNil()) |                 if (!script.Globals.Get(funcName).IsNil()) | ||||||
| @@ -597,13 +616,16 @@ namespace Meteor.Map.lua | |||||||
|                 if (!(target is Area) && !optional) |                 if (!(target is Area) && !optional) | ||||||
|                     SendError(player, String.Format("Could not find script for actor {0}.", target.GetName())); |                     SendError(player, String.Format("Could not find script for actor {0}.", target.GetName())); | ||||||
|             } |             } | ||||||
|  |             if (!errorMsg.Equals("")) | ||||||
|  |                 SendError(player, errorMsg); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public void EventStarted(Player player, Actor target, EventStartPacket eventStart) |         public void EventStarted(Player player, Actor target, EventStartPacket eventStart) | ||||||
|         { |         { | ||||||
|             List<LuaParam> lparams = new List<LuaParam>(); |             List<LuaParam> lparams = new List<LuaParam>(); | ||||||
|             lparams.AddRange(eventStart.luaParams); |             lparams.AddRange(eventStart.luaParams); | ||||||
|             lparams.Insert(0, new LuaParam(2, eventStart.eventName)); |             lparams.Insert(0, new LuaParam(0, eventStart.eventType)); | ||||||
|  |             lparams.Insert(1, new LuaParam(2, eventStart.eventName)); | ||||||
|             if (mSleepingOnPlayerEvent.ContainsKey(player.actorId)) |             if (mSleepingOnPlayerEvent.ContainsKey(player.actorId)) | ||||||
|             { |             { | ||||||
|                 Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId]; |                 Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId]; | ||||||
| @@ -820,7 +842,7 @@ namespace Meteor.Map.lua | |||||||
|         } |         } | ||||||
|         #endregion |         #endregion | ||||||
|          |          | ||||||
|         public static LuaScript LoadScript(string path) |         public static LuaScript LoadScript(string path, ref string errorMsg) | ||||||
|         { |         { | ||||||
|             if (!File.Exists(path)) |             if (!File.Exists(path)) | ||||||
|                 return null; |                 return null; | ||||||
| @@ -834,6 +856,7 @@ namespace Meteor.Map.lua | |||||||
|             catch (SyntaxErrorException e) |             catch (SyntaxErrorException e) | ||||||
|             { |             { | ||||||
|                 Program.Log.Error("{0}.", e.DecoratedMessage); |                 Program.Log.Error("{0}.", e.DecoratedMessage); | ||||||
|  |                 errorMsg = e.DecoratedMessage; | ||||||
|                 return null; |                 return null; | ||||||
|             } |             } | ||||||
|             return script; |             return script; | ||||||
| @@ -851,7 +874,7 @@ namespace Meteor.Map.lua | |||||||
|             script.Globals["GetWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor; |             script.Globals["GetWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor; | ||||||
|             script.Globals["GetItemGamedata"] = (Func<uint, ItemData>)Server.GetItemGamedata; |             script.Globals["GetItemGamedata"] = (Func<uint, ItemData>)Server.GetItemGamedata; | ||||||
|             script.Globals["GetGuildleveGamedata"] = (Func<uint, GuildleveData>)Server.GetGuildleveGamedata; |             script.Globals["GetGuildleveGamedata"] = (Func<uint, GuildleveData>)Server.GetGuildleveGamedata; | ||||||
|             script.Globals["GetRecipeResolver"] = (Func<RecipeResolver>)Server.ResolveRecipe; |             //script.Globals["GetRecipeResolver"] = (Func<RecipeResolver>)Server.ResolveRecipe; | ||||||
|             script.Globals["GetLuaInstance"] = (Func<LuaEngine>)LuaEngine.GetInstance; |             script.Globals["GetLuaInstance"] = (Func<LuaEngine>)LuaEngine.GetInstance; | ||||||
|  |  | ||||||
|             script.Options.DebugPrint = s => { Program.Log.Debug(s); }; |             script.Options.DebugPrint = s => { Program.Log.Debug(s); }; | ||||||
|   | |||||||
| @@ -67,8 +67,8 @@ | |||||||
|       <HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath> |       <HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath> | ||||||
|       <Private>True</Private> |       <Private>True</Private> | ||||||
|     </Reference> |     </Reference> | ||||||
|     <Reference Include="MoonSharp.Interpreter"> |     <Reference Include="MoonSharp.Interpreter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=921e73ce94aa17f8, processorArchitecture=MSIL"> | ||||||
|       <HintPath>..\packages\MoonSharp.1.2.1.0\lib\net40-client\MoonSharp.Interpreter.dll</HintPath> |       <HintPath>..\packages\MoonSharp.2.0.0.0\lib\net40-client\MoonSharp.Interpreter.dll</HintPath> | ||||||
|     </Reference> |     </Reference> | ||||||
|     <Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> |     <Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> | ||||||
|       <HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath> |       <HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath> | ||||||
|   | |||||||
| @@ -207,9 +207,9 @@ namespace Meteor.Map | |||||||
|                             //Is it a instance actor? |                             //Is it a instance actor? | ||||||
|                             if (ownerActor == null) |                             if (ownerActor == null) | ||||||
|                                 ownerActor = session.GetActor().zone.FindActorInArea(eventStart.ownerActorID); |                                 ownerActor = session.GetActor().zone.FindActorInArea(eventStart.ownerActorID); | ||||||
|  |                             //Is it a Director? | ||||||
|                             if (ownerActor == null) |                             if (ownerActor == null) | ||||||
|                             { |                             { | ||||||
|                                 //Is it a Director? |  | ||||||
|                                 Director director = session.GetActor().GetDirector(eventStart.ownerActorID); |                                 Director director = session.GetActor().GetDirector(eventStart.ownerActorID); | ||||||
|                                 if (director != null) |                                 if (director != null) | ||||||
|                                     ownerActor = director; |                                     ownerActor = director; | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| <packages> | <packages> | ||||||
|   <package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" /> |   <package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" /> | ||||||
|   <package id="Microsoft.Net.Compilers" version="2.0.0-beta3" targetFramework="net45" developmentDependency="true" /> |   <package id="Microsoft.Net.Compilers" version="2.0.0-beta3" targetFramework="net45" developmentDependency="true" /> | ||||||
|   <package id="MoonSharp" version="1.2.1.0" targetFramework="net45" /> |   <package id="MoonSharp" version="2.0.0.0" targetFramework="net451" /> | ||||||
|   <package id="MySql.Data" version="6.9.8" targetFramework="net45" /> |   <package id="MySql.Data" version="6.9.8" targetFramework="net45" /> | ||||||
|   <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net451" /> |   <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net451" /> | ||||||
|   <package id="NLog" version="4.5.0" targetFramework="net451" /> |   <package id="NLog" version="4.5.0" targetFramework="net451" /> | ||||||
|   | |||||||
							
								
								
									
										40
									
								
								Meteor.sln
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								Meteor.sln
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
|  |  | ||||||
| Microsoft Visual Studio Solution File, Format Version 12.00 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||||||
| # Visual Studio 15 | # Visual Studio Version 16 | ||||||
| VisualStudioVersion = 15.0.28307.168 | VisualStudioVersion = 16.0.30406.217 | ||||||
| MinimumVisualStudioVersion = 10.0.40219.1 | MinimumVisualStudioVersion = 10.0.40219.1 | ||||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Map Server", "Map Server\Map Server.csproj", "{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}" | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Map Server", "Map Server\Map Server.csproj", "{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}" | ||||||
| 	ProjectSection(ProjectDependencies) = postProject | 	ProjectSection(ProjectDependencies) = postProject | ||||||
| @@ -24,6 +24,10 @@ Global | |||||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||||
| 		Debug|Any CPU = Debug|Any CPU | 		Debug|Any CPU = Debug|Any CPU | ||||||
| 		Debug|x64 = Debug|x64 | 		Debug|x64 = Debug|x64 | ||||||
|  | 		Dev|Any CPU = Dev|Any CPU | ||||||
|  | 		Dev|x64 = Dev|x64 | ||||||
|  | 		Devp4|Any CPU = Devp4|Any CPU | ||||||
|  | 		Devp4|x64 = Devp4|x64 | ||||||
| 		Release|Any CPU = Release|Any CPU | 		Release|Any CPU = Release|Any CPU | ||||||
| 		Release|x64 = Release|x64 | 		Release|x64 = Release|x64 | ||||||
| 	EndGlobalSection | 	EndGlobalSection | ||||||
| @@ -32,6 +36,14 @@ Global | |||||||
| 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Debug|Any CPU.Build.0 = Debug|Any CPU | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
| 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Debug|x64.ActiveCfg = Debug|x64 | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Debug|x64.ActiveCfg = Debug|x64 | ||||||
| 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Debug|x64.Build.0 = Debug|x64 | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Debug|x64.Build.0 = Debug|x64 | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Dev|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Dev|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Dev|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Dev|x64.Build.0 = Debug|x64 | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Devp4|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Devp4|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Devp4|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Devp4|x64.Build.0 = Debug|x64 | ||||||
| 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Release|Any CPU.ActiveCfg = Release|Any CPU | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
| 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Release|Any CPU.Build.0 = Release|Any CPU | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
| 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Release|x64.ActiveCfg = Release|x64 | 		{E8FA2784-D4B9-4711-8CC6-712A4B1CD54F}.Release|x64.ActiveCfg = Release|x64 | ||||||
| @@ -40,6 +52,14 @@ Global | |||||||
| 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Any CPU.Build.0 = Debug|Any CPU | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
| 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|x64.ActiveCfg = Debug|x64 | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|x64.ActiveCfg = Debug|x64 | ||||||
| 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|x64.Build.0 = Debug|x64 | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Debug|x64.Build.0 = Debug|x64 | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Dev|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Dev|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Dev|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Dev|x64.Build.0 = Debug|x64 | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Devp4|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Devp4|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Devp4|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Devp4|x64.Build.0 = Debug|x64 | ||||||
| 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Any CPU.ActiveCfg = Release|Any CPU | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
| 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Any CPU.Build.0 = Release|Any CPU | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
| 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|x64.ActiveCfg = Release|x64 | 		{703091E0-F69C-4177-8FAE-C258AC6A65AA}.Release|x64.ActiveCfg = Release|x64 | ||||||
| @@ -48,6 +68,14 @@ Global | |||||||
| 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Debug|Any CPU.Build.0 = Debug|Any CPU | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
| 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Debug|x64.ActiveCfg = Debug|x64 | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Debug|x64.ActiveCfg = Debug|x64 | ||||||
| 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Debug|x64.Build.0 = Debug|x64 | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Debug|x64.Build.0 = Debug|x64 | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Dev|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Dev|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Dev|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Dev|x64.Build.0 = Debug|x64 | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Devp4|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Devp4|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Devp4|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Devp4|x64.Build.0 = Debug|x64 | ||||||
| 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Release|Any CPU.ActiveCfg = Release|Any CPU | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
| 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Release|Any CPU.Build.0 = Release|Any CPU | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
| 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Release|x64.ActiveCfg = Release|x64 | 		{3A3D6626-C820-4C18-8C81-64811424F20E}.Release|x64.ActiveCfg = Release|x64 | ||||||
| @@ -56,6 +84,14 @@ Global | |||||||
| 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Debug|Any CPU.Build.0 = Debug|Any CPU | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
| 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Debug|x64.ActiveCfg = Debug|x64 | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Debug|x64.ActiveCfg = Debug|x64 | ||||||
| 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Debug|x64.Build.0 = Debug|x64 | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Debug|x64.Build.0 = Debug|x64 | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Dev|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Dev|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Dev|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Dev|x64.Build.0 = Debug|x64 | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Devp4|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Devp4|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Devp4|x64.ActiveCfg = Debug|x64 | ||||||
|  | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Devp4|x64.Build.0 = Debug|x64 | ||||||
| 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Release|Any CPU.ActiveCfg = Release|Any CPU | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
| 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Release|Any CPU.Build.0 = Release|Any CPU | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
| 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Release|x64.ActiveCfg = Release|x64 | 		{3067889D-8A50-40D6-9CD5-23AA8EA96F26}.Release|x64.ActiveCfg = Release|x64 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user