mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Merge branch 'develop' into ioncannon/crafting_and_localleves
This commit is contained in:
		| @@ -4,20 +4,149 @@ MarketEntrance Script | ||||
|  | ||||
| Functions: | ||||
|  | ||||
| eventPushChoiceAreaOrQuest(gcLeaderPlaceName[Fronds, etc], showMarketWards/Houses (must be 0xc1a), gcHQPlaceName, anotherPlaceName, showItemSearchCounter, stopSearchingItemId) -  | ||||
| eventPushStepPrvMarket(?, ?, ?) - | ||||
| Parameters mostly rely on the xtx_placeName sheet for its strings. | ||||
|  | ||||
| eventPushChoiceAreaOrQuest( | ||||
|     exitPlaceName[Fronds, etc],     - Retail only showed it when inside a Market Ward/Office  Set to 0 to hide the menu. | ||||
|     showMarketWards/Houses          - If > 0, client script adds nation-specific Mercentile Houses as well. | ||||
|     gcHQPlaceName,                  - Set to the placeName id for the Grand Company office of that city | ||||
|     questAreaName,                  - Set to the placeName id of applicable quest instance, ex. Sailors Ward. | ||||
|     showItemSearchCounter,          - If true, shows the Item Search menu | ||||
|     itemSearchId                    - If > 0 & showItemSearchCounter = true, displays the item name with a "Stop Searching" | ||||
| ) | ||||
| eventPushStepPrvMarket( | ||||
|     staringWard,                    - Sets the starting placeName id | ||||
|     wardCount,                      - Valid number 1-20. Sets the amount of market ward entries. Client continues sequentially from startingWard id. | ||||
|     excludeWard                     - Hides the ward in the list that matches the id.  Use on the ward you're currently in. | ||||
| )  | ||||
|    | ||||
|    | ||||
| MarketEntrance City TriggerBox details | ||||
| Limsa    - !warp 230 -416.5 40 446              ActorClass Id = 1090238 | ||||
|     bgObj  Id - [0xB3B] 2875 | ||||
|     Layout Id - [0x79 ] 121  (0x29d90001) | ||||
|     Condition - in | ||||
|     reactName - dwti    - Not a typo compared to the other cities | ||||
| Gridania - !warp 206 -192.57 23.48 -1407.58     ActorClass Id = 1090264 | ||||
|  | ||||
|     bgObj  Id - [0xCFA] 3322 | ||||
|     Layout Id - [0x141]  321 (0x29b00001) | ||||
|     Condition - in | ||||
|     reactName - dtwi | ||||
| Ul'dah   - !warp 175 -235 189 50.5              ActorClass Id = 1500394 | ||||
|     bgObj  Id - [0x102F] 4143 | ||||
|     Layout Id - [0x1A5] 421  (0x615a0001) | ||||
|     Condition - in | ||||
|     reactName - dtwi | ||||
|  | ||||
| --]] | ||||
|  | ||||
| require ("global") | ||||
|  | ||||
| local MARKETWARD_ENTRANCE = {-201.0, 0.0, -160.0, 1.5}; | ||||
|  | ||||
| function init(npc) | ||||
| 	return false, false, 0, 0; | ||||
| end | ||||
|  | ||||
|  | ||||
| CITY_INFO = { -- wardPlaceName, exitPlaceName, gcHQPlaceName, questAreaName, wardListStart, wardListCount | ||||
|     {1093, 1087, 1512, 1091, 1261, 20}, -- Limsa | ||||
|     {2099, 2091, 2526, 2095, 2261, 20}, -- Gridania | ||||
|     {3098, 3091, 3514, 3095, 3261, 20}, -- Ul'dah | ||||
| } | ||||
|  | ||||
| -- TO-DO:  Add some X/Z pos jitter to Entrances/Exits when called | ||||
| MARKETWARD_ENTRANCE = { | ||||
|     {134, 160, 0, 135}, -- Limsa Market | ||||
|     {160, 160, 0, 138}, -- Gridania Market | ||||
|     {180, 160, 0, 185}  -- Ul'dah Market | ||||
| } | ||||
|  | ||||
| MARKETWARD_EXIT = { | ||||
|     {230, -420, 41, 435, -3.14},  -- Educated guess for Limsa, need video reference to confirm | ||||
|     {206, -180, 22, -1408, 1.5}, | ||||
|     {175, -210, 190, 25, 0.65} | ||||
| } | ||||
|  | ||||
| GC_ENTRANCE = {  | ||||
|     [1512] = {232, 160, 0, -155}, -- Maelstrom Command | ||||
|     [2526] = {234, 160, 0, -155}, -- Adders' Nest | ||||
|     [3514] = {233, 160, 0, -155}  -- Hall of Flames | ||||
| } | ||||
|  | ||||
| city = { | ||||
|     [1090238] = 1, -- Limsa Market Ward Entrance | ||||
|     [1090264] = 2, -- Gridania Market Ward Entrance | ||||
|     [1090265] = 3, -- Ul'dah Market Ward Entrance | ||||
|     [1500392] = 1, -- Limsa     : M'septha | ||||
|     [1500393] = 2, -- Gridania  : Torsefers | ||||
|     [1500394] = 3, -- Ul'dah    : Edine | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| function onEventStarted(player, npc, triggerName)	 | ||||
| 	callClientFunction(player, "eventPushChoiceAreaOrQuest", 0xc13, 0xc1a, 0xdba, 0, true, 1); | ||||
|  | ||||
|     local npcCity = city[npc:GetActorClassId()] or 1; | ||||
|     local wardPlaceName = CITY_INFO[npcCity][1];        -- Market Wards category name. Identical in all languages except Japanese | ||||
|     local exitPlaceName = CITY_INFO[npcCity][2];        -- Central Limsa Lominsa / Heartstream / The Fronds | ||||
|     local gcHQPlaceName = CITY_INFO[npcCity][3];        -- Maelstrom Command / Adders' Nest / Hall of Flames | ||||
|     local questAreaName = 0; --CITY_INFO[npcCity][4];   -- Sailors Ward / Peasants Ward / Merchants Ward | ||||
|     local wardListStart = CITY_INFO[npcCity][5];        -- Starting id for the market wards | ||||
|     local wardListCount = CITY_INFO[npcCity][6];        -- Amount of wards in the list | ||||
|     local showItemSearchCounter = false; | ||||
|     local itemSearchId = 11000125;    | ||||
|      | ||||
|     local worldMaster = GetWorldMaster();  | ||||
|     local pos = player:GetPos(); | ||||
|     local currZone = pos[4]; | ||||
|      | ||||
|     if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then  | ||||
|         exitPlaceName = 0;  -- If in city, hide city menu option | ||||
|     elseif (currZone == 232 or currZone == 234 or currZone == 233) then  | ||||
|         gcHQPlaceName = 0;  -- If in GC Office, hide office menu option | ||||
|     end | ||||
|  | ||||
|     choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); | ||||
|          | ||||
|     while (true) do | ||||
|          | ||||
|         if choice == wardPlaceName then -- Market Wards | ||||
|             wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0); | ||||
|              | ||||
|             if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then | ||||
|                 player:SendGameMessage(player, worldMaster, 60004, 0x20, wardSelect); | ||||
|                 warp = MARKETWARD_ENTRANCE[npcCity]; | ||||
|                 playerRot = math.random(-3.14, 3.14); | ||||
|                 wait(1); | ||||
|                 GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], playerRot); | ||||
|                 player:SendDataPacket("attention", worldMaster, "", 60003, wardSelect); | ||||
|                 -- Temp: Pop-up display after Ward zone-in.  Client should automate this with PrivateArea's properly setup | ||||
|  | ||||
|                 break; | ||||
|             end | ||||
|              | ||||
|         elseif (choice == 1519 or choice == 2534 or choice == 3533) then -- Mercentile Wards | ||||
|                 player:SendMessage(0x20, "", "[MarketEntrance] DEBUG: "..choice); | ||||
|         elseif (choice == 1512 or choice == 2526 or choice == 3514) then -- GC Office | ||||
|                 warp = GC_ENTRANCE[choice]; | ||||
|                 player:SendGameMessage(player, worldMaster, 60004, 0x20, choice); | ||||
|                 wait(1); | ||||
|                 GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], math.pi); | ||||
|                 break; | ||||
|         elseif (choice == 1087 or choice == 2091 or choice == 3091) then -- Exiting to City | ||||
|                 player:SendGameMessage(player, worldMaster, 60004, 0x20, choice); | ||||
|                 warp = MARKETWARD_EXIT[npcCity]; | ||||
|                 wait(1); | ||||
|                 GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]);           | ||||
|                 break; | ||||
|         elseif (choice == 0 or choice == -3) then -- Menu Closed | ||||
|             break;   | ||||
|         end  | ||||
|          | ||||
|         choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); | ||||
|            | ||||
|     end | ||||
|      | ||||
| 	player:EndEvent();	 | ||||
|      | ||||
| end | ||||
| @@ -413,7 +413,6 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ) | ||||
|         local qltyDiff = math.random(0,2); | ||||
|  | ||||
|         if progress >= 100 then | ||||
|          | ||||
|             player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8);  -- "You create <#3 quantity> <#1 item> <#2 quality>." | ||||
|             callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor); | ||||
|              | ||||
| @@ -467,5 +466,5 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ) | ||||
|         end | ||||
|     end | ||||
|  | ||||
|     return -1;  | ||||
| end | ||||
|     return -1; | ||||
| end | ||||
|   | ||||
| @@ -125,8 +125,6 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg | ||||
|     --callClientFunction(player, "delegateCommand", harvestJudge, "turnToTarget", commandActor, harvestType, nodeGrade); | ||||
|  | ||||
|     player:ChangeState(50); | ||||
| 	 | ||||
|      | ||||
|      | ||||
|     if harvestType == commandMine then | ||||
|         player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, nodeGrade); | ||||
| @@ -154,8 +152,7 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg | ||||
|                     -- "Strike" 0 = Empty, 100 = Filled.   Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining | ||||
|                     chosenCommand, currentPower = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike | ||||
|      | ||||
|                     if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end | ||||
|                      | ||||
|                     if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end                     | ||||
|                      | ||||
|                     if chosenCommand == 22702 then      -- Cancel. | ||||
|                         harvestAttempts = harvestAttempts - 1; | ||||
| @@ -170,14 +167,11 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg | ||||
|                         break; | ||||
|                     elseif chosenCommand == 22703 then  -- Strike. | ||||
|                      | ||||
|                         player:PlayAnimation(minerAnim[math.random(1,3)]); | ||||
|                      | ||||
|                         player:PlayAnimation(minerAnim[math.random(1,3)]);                    | ||||
|                         nodeRemainder = nodeRemainder - 20; | ||||
|                         if nodeRemainder < 0 then  | ||||
|                             nodeRemainder = 0;   | ||||
|                         end | ||||
|                          | ||||
|                         | ||||
|                         end          | ||||
|  | ||||
|                         --player:SendGameMessage(harvestJudge, 25, MESSAGE_TYPE_SYSTEM, item, 4, 1); | ||||
|                         callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType); | ||||
| @@ -199,7 +193,6 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg | ||||
|                             wait(2); | ||||
|                             break; | ||||
|                         end | ||||
|                      | ||||
|                     elseif chosenCommand == 22710 then -- "Strike" Tutorial.                     | ||||
|                         SendTutorial(player, harvestJudge, 2); | ||||
|                     end | ||||
| @@ -246,5 +239,4 @@ function SendTutorial(player, harvestJudge, id) | ||||
|         wait(3); | ||||
|         player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM);   | ||||
|     end | ||||
|  | ||||
| end | ||||
| @@ -1,6 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 94, | ||||
| shopPack = 0x67, | ||||
| shopCurrancy = nil | ||||
| } | ||||
| @@ -1,6 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 69, | ||||
| shopPack = 3020, | ||||
| tutorialId = 35 | ||||
| } | ||||
| @@ -1,6 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 64, | ||||
| shopPack = 3021, | ||||
| tutorialId = 34 | ||||
| } | ||||
| @@ -1,6 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 76, | ||||
| shopPack = 3022, | ||||
| tutorialId = 39 | ||||
| } | ||||
| @@ -1,6 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 54, | ||||
| shopPack = 3019, | ||||
| tutorialId = 32 | ||||
| } | ||||
| @@ -1,5 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 265, | ||||
| shopPack = 3024	 | ||||
| } | ||||
| @@ -1,5 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 111, | ||||
| shopPack = 3003 | ||||
| } | ||||
| @@ -1,5 +0,0 @@ | ||||
|  | ||||
| shopInfo = { | ||||
| welcomeText = 110, | ||||
| shopPack = 3002	 | ||||
| } | ||||
		Reference in New Issue
	
	Block a user