15 Commits

Author SHA1 Message Date
Filip Maj
85755985fa More shops added 2022-01-19 22:13:02 -05:00
Filip Maj
533777fb3a Changes 2022-01-19 22:11:25 -05:00
Filip Maj
9a47f47698 More cleanup of the craft command 2021-02-28 17:09:04 -05:00
Filip Maj
6d66f6aae3 Fixed command bug on class change. Implmented more of the local levequest errors and such. 2021-02-28 16:20:24 -05:00
Filip Maj
eca510c489 Removed unused var in ItemRefParam. Fixed up the tracked vars in PassiveGL 2021-02-28 11:19:49 -05:00
Filip Maj
29381431e7 Figured out type 8 (and more of type 7) lua params. Parses correctly now. 2021-02-26 23:43:40 -05:00
Filip Maj
8695deb880 Synth/Gather commands now appear automatically. 2021-02-26 21:46:47 -05:00
Filip Maj
8a5b97f5b2 Merge branch 'develop' into ioncannon/crafting_and_localleves 2021-02-26 21:20:37 -05:00
Filip Maj
df49eefadb Added recipe resolver 2021-02-26 21:10:01 -05:00
Filip Maj
2731124b44 Leftover 2021-02-26 21:09:21 -05:00
Filip Maj
7c144bd05a More documentation on gathering 2021-02-26 21:08:32 -05:00
Filip Maj
e030b14bf4 Sql fix again 2021-02-26 21:04:43 -05:00
Filip Maj
d59386e82a Busted the graphics sql 2021-02-26 21:00:09 -05:00
Filip Maj
605b4918e2 Finished the crafting start window system. Added PassiveGuildleveQuests and refactors the Quest object. Cleaned up how zone music is handled. 2021-02-26 20:53:42 -05:00
Filip Maj
f4e2280de8 Added recipe resolver 2021-02-23 15:39:46 -05:00
51 changed files with 7463 additions and 979 deletions

View File

@@ -267,7 +267,15 @@ namespace Meteor.Common
public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20) public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20)
{ {
return Encoding.ASCII.GetString(reader.ReadBytes(maxSize)).Trim(new[] { '\0' }); byte[] str = reader.ReadBytes(maxSize);
int i;
for (i = 0; i <= str.Length; i++)
{
if (str[i] == 0)
break;
}
return Encoding.ASCII.GetString(str, 0, i);
} }
public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20) public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20)

8
Data/guessed_npcs.txt Normal file
View File

@@ -0,0 +1,8 @@
---Iron Lake---
l'wonjhali
wymar
aylufa
ignemortel
ironlake battlewarden
storm sargeant nolan

View File

@@ -11,47 +11,36 @@ loadTextData()
Params: None Params: None
start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8) start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8)
Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another
for local leve "requested items" mode. for local leve "requested items" mode.
Params: * facility/widgetMode - The current facility id buff the player may have. After opening a recipe tab, start() has to be called with this Params: * facility - The current facility id buff the player may have.
set to -1. After the player chooses a recipe, start() has to be called with this set to -2. * requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode.
* requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode. * material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash.
* material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash.
closeCraftStartWidget() closeCraftStartWidget()
Desc: Closes the Craft Start widget. Desc: Closes the Craft Start widget.
Params: None Params: None
selectRcp(item1, item2, item3, item4, item5, item6, item7, item8) selectRcp(itemId)
Desc: Opens a recipe selection window. If one recipe is provided, automatically selects that recipe. Desc: Selects the recipe to be crafted. May be a legacy function but still required to properly initialize the UI. Requires start() to have
Params: * itemId1-8 - The itemIDs to show in the list. If only one provided, select it. been called.
Params: * itemId - The itemID of the item to be crafted.
confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility) confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility)
Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first. Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first.
Params: * craftedItem - The itemID of the item to be crafted. Params: * craftedItem - The itemID of the item to be crafted.
* quantity - Quantity of crafted items. * quantity - Quantity of crafted items.
* crystalItem1 - The first required crystal itemID for crafting. * crystalItem1 - The first required crystal itemID for crafting.
* crystalQuantity1 - Quantity of the first crystal. * crystalQuantity1 - Quantity of the first crystal.
* crystalItem2 - The second required crystal itemID for crafting. * crystalItem2 - The second required crystal itemID for crafting.
* crystalQuantity2 - Quantity of the second crystal. * crystalQuantity2 - Quantity of the second crystal.
* recommendedSkill - Which itemID to display under the "Recommended Skill" panel. * recommendedSkill - Which itemID to display under the "Recommended Skill" panel.
* recommendedFacility - Which facility to display under the "Recommended Facility" panel. * recommendedFacility - Which facility to display under the "Recommended Facility" panel.
selectCraftQuest() selectCraftQuest()
Desc: Opens the journal to select the local leve that the player would like to do. Desc: Opens the journal to select the local leve that the player would like to do.
Params: None Params: None
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID -
* craftedItem -
* ?
* ?
* itemsCompleted -
* remainingMaterials -
* ?
* ?
askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts) askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts)
Desc: Opens the dialog to continue crafting for a local leve after an item was completed. Desc: Opens the dialog to continue crafting for a local leve after an item was completed.
Params: * localLeveID - The id of the current leve in progress. Params: * localLeveID - The id of the current leve in progress.
@@ -79,7 +68,7 @@ craftCommandUI(classID, hasWait, command1, command2, command3, command4, command
* command1-5 - Five possible crafting commands (crafting skills). * command1-5 - Five possible crafting commands (crafting skills).
craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8) craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8)
Desc: Displays only the provided commands for the "Double Down" phase that happens after crafting. Desc: Displays a full list of commands for the legacy "Tuning" phase that happens after crafting. Deprecated in 1.23b.
Params: * command1-8 - The list of commands available. Params: * command1-8 - The list of commands available.
updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance) updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance)
@@ -100,6 +89,17 @@ cfmQst()
Desc: Quest confirmation window for when starting a crafting quest from the journal. Desc: Quest confirmation window for when starting a crafting quest from the journal.
Params: Params:
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID - The quest id of the leve you are confirming.
* difficulty - Changes the objective.
* craftedItem? -
* ? -
* numSuccess - The number of successful crafts you did.
* remainingMaterials - The number of materials you have left.
* hasMaterials - Shows the in-progress panel of successes and attempts left.
* ? -
startRepair(craftMode, item, quality, durability, hasMateria, spiritbind) startRepair(craftMode, item, quality, durability, hasMateria, spiritbind)
Desc: Opens the repair item widget. Desc: Opens the repair item widget.
Params: * craftMode - Either 0 or 1. Anything else crashes. Params: * craftMode - Either 0 or 1. Anything else crashes.
@@ -133,214 +133,292 @@ Class ID + Starting skill
35 ALC = 22586 35 ALC = 22586
36 CUL = 22592 36 CUL = 22592
Leve objectives/rewards are in passiveGL_craft.
* Index 1:
* Index 2: Recommended Class
* Index 3: Issuing Authority
* Index 7: Levequest Location
* Index 8: Deliver Display Name
* Starts at index 14. Four sections for the four difficulties.
* Required Item, Amount, ?, Recommended Level, , Reward Item, Reward Amount, |
--]] --]]
require ("global") require ("global")
local skillAnim = {
skillAnim = {
[22553] = 0x10002000; [22553] = 0x10002000;
[22554] = 0x10001000; [22554] = 0x10001000;
[22555] = 0x10003000; [22555] = 0x10003000;
[29531] = 0x10009002; [29531] = 0x10009002;
} }
local craftStartWidgetOpen = false;
materialSlots = {0,0,0,0,0,0,0,0}; -- The 8 slots
recentRecipe = {10008205, 4030706, 4070009} -- Recent Recipe list
awardedRecipe = {7020105, 7030011} -- Awarded Recipe list
materialRecipe = { -- Always 8 params because we can't have any nils here for "start" command
[6071007] = {4070402, 4070309,0,0,0,0,0,0},
[10008205] = {10008005,10008005,0,0,0,0,0,0},
[10009617] = {4040009, 4040010, 4040011,0,0,0,0,0},
[4070009] = {4070006, 10005401, 10008203,0,0,0,0,0},
[4070010] = {10008204,10008106,10005302,0,0,0,0,0}
}
materialQuest = { -- What a quest or leve will preload slots with, in addition to any extras the player does manual
[0] = {0,0,0,0,0,0,0,0},
[1] = {0,0,0,0,0,0,0,0},
[110442] = {11000075, 11000074, 0, 0, 0, 0, 0, 0}
}
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId) function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
local MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3;
MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3; local MENU_RECENT, MENU_AWARDED, MENU_RECENT_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
MENU_RECIPE, MENU_AWARDED, MENU_RECIPE_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
debugMessage = false; local debugMessage = true;
isRecipeRecentSent = false; local isRecipeRecentSent = false;
isRecipeAwardSent = false; local isRecipeAwardSent = false;
detailWindow = true;
isRequested = false; -- False = The default state. True = User picked a quest recipe/local leve local craftJudge = GetStaticActor("CraftJudge");
facilityId = 0; local recipeResolver = GetRecipeResolver();
chosenQuest = 0; -- Use this to store any chosen recipe/local leve
recipeDetail = 0;
detailWindowState = 0;
craftJudge = GetStaticActor("CraftJudge");
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
chosenOperation = -1;
while chosenOperation ~= 0 do local operationResult;
local operationMode = -1;
local recipeMode = -1;
local chosenMaterials;
local facilityId = 0;
local isRequestedItemsMode = false; -- False = The default state. True = User picked a quest recipe/local leve
local recentRecipes;
local awardedRecipes;
local currentCraftQuest = nil; -- Use this to store any chosen craft quest
local currentCraftQuestGuildleve = nil; -- Use this to store any chosen local leve
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
player:ChangeState(30);
while operationMode ~= 0 do
player:ChangeState(30); -- Operate the start crafting window... confusing shit
if (craftStartWidgetOpen == false) then
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: "..tostring(chosenOperation).." Recipe : "..tostring(recipeMode).." Quest : "..chosenQuest); end -- Shows the initial window
local startMats = {0, 0, 0, 0, 0, 0, 0, 0};
if (isRequestedItemsMode == true) then -- If requested items, preload the quest recipe materials
if materialQuest[chosenQuest] then startMats = recipeResolver.RecipeToMatIdTable(currentCraftQuestGuildleve.getRecipe());
if debugMessage then player:SendMessage(0x20, "", "Key is valid: "..chosenQuest); end end
materialSlots = materialQuest[chosenQuest]; operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequestedItemsMode, unpack(startMats))};
else craftStartWidgetOpen = true;
if debugMessage then player:SendMessage(0x20, "", "Key is not valid: "..chosenQuest); end elseif ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and recipeMode != 0) then
local prepedMaterials;
-- Recent Recipes/Awarded Recipes
if (operationMode == MENU_RECENT) then
prepedMaterials = recipeResolver.RecipeToMatIdTable(recentRecipes[recipeMode]);
else
prepedMaterials = recipeResolver.RecipeToMatIdTable(awardedRecipes[recipeMode]);
end
-- Causes the item info window to appear for recent/awarded recipes. Only happens if a recipe was chosen.
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequestedItemsMode, unpack(prepedMaterials))};
else
-- Keep window going if the user "returned" to the starting point
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequestedItemsMode)};
end end
operationMode = operationResult[1];
recipeMode = operationResult[2];
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: " .. tostring(operationMode) .. ", RecipeMode : " .. recipeMode); end
-- Operation
if operationMode == MENU_CANCEL then
closeCraftStartWidget(player, craftJudge, commandactor);
elseif (operationMode == MENU_MAINHAND or operationMode == MENU_OFFHAND) then
-- Recipe choosing loop
while (true) do
-- Figure out the number of preloaded mats
local numArgs = #operationResult;
local numMatArgs = numArgs - 2;
local materials;
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(numArgs));
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(numMatArgs));
-- Handle the possible args returned: Either 0 player items, 1 player item, 2+ palyer items. The rest is always the remaining prepped items.
if (numMatArgs == 8 and type(operationResult[3]) == "number") then
materials = {unpack(operationResult, 3)};
elseif (numMatArgs == 8 and type(operationResult[3]) ~= "number") then
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(player:GetItemPackage(operationResult[3].itemPackage):GetItemAtSlot(operationResult[3].slot).itemId));
materials = {player:GetItemPackage(operationResult[3].itemPackage):GetItemAtSlot(operationResult[3].slot).itemId, unpack(operationResult, 3)};
else
local itemIds = {};
for i=0,operationResult[3].itemSlots.length do
converted = player:GetItemPackage(operationResult[3].itemPackages[i]):GetItemAtSlot(operationResult[3].slots[i]).itemId
end
materials = {unpack(itemIds), unpack(operationResult, 4)};
end
-- Choosing a recipe from the given materials
local recipes = recipeResolver.GetRecipeFromMats(unpack(materials));
local itemIds = recipeResolver.RecipesToItemIdTable(recipes);
-- No recipes found
if (#itemIds == 0) then
player:SendGameMessage(GetWorldMaster(), 40201, 0x20); -- You cannot synthesize with those materials.
break;
end
local chosenRecipeIndex = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds));
-- Hit back on recipe list
if (chosenRecipeIndex <= 0) then break end;
chosenRecipe = recipes[chosenRecipeIndex-1];
if (chosenRecipe ~= nil) then
-- Player confirms recipe
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
chosenRecipe.resultItemID,
chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
if recipeConfirmed then
if isRecipeRecentSent == false then -- If Recipe button not hit, aka default state. closeCraftStartWidget(player, craftJudge, commandactor);
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequested, unpack(materialSlots)); -- Initial window isRecipeRecentSent = false;
isRecipeAwardSent = false;
elseif isRecipeRecentSent == true and recipeMode == 0 then -- If recipe window/award tab was hit
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequested, unpack(materialSlots)); -- Keep window going -- CRAFTING STARTED
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, currentCraftQuestGuildleve, 80, 100, 50);
elseif isRecipeRecentSent == true and recipeMode > 0 then -- If recipe item picked
if recipeDetail then --Once crafting is over, return to the original non-quest state.
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, unpack(recipeDetail)); -- Item mat(s) for picked item. isRequestedItemsMode = false;
else currentCraftQuestGuildleve = nil;
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, 10009617,0,0,0,0,0,0,0); -- Show dummy info for unfilled item currentCraftQuest = nil;
end
end break;
end
end
if chosenOperation == MENU_CANCEL then end
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor); -- End of Recipe choosing loops
elseif operationMode == MENU_REQUEST then -- Conditional button label based on isRequestedItemsMode
closeCraftStartWidget(player, craftJudge, commandactor);
elseif (chosenOperation == MENU_MAINHAND or chosenOperation == MENU_OFFHAND) then
if isRequestedItemsMode == false then -- "Request Items" hit, close Start and open up the Quest select
if isRequested == true then
recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617);
else
recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617,6071007,5030112,5030007,10009617,6071007,5030112,5030007);
end
if recipeResult == 0 then -- Closed/Return hit.
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
currentlyCrafting = -1;
elseif (recipeResult >= 1 or recipeResult <= 8) then
--item yld, xstal1, qty, xstal2, qty
recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0);
if recipeConfirmed then
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, chosenOperation, isRequested, 80, 100, 50);
end
end
elseif chosenOperation == MENU_REQUEST then -- Conditional button label based on isRequested
if isRequested == false then -- "Request Items" hit, close Start and open up the Quest select
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false; isRecipeRecentSent = false;
isRecipeAwardSent = false; isRecipeAwardSent = false;
local questConfirmed, returnedQuest = GetCraftQuest(player, craftjudge, commandactor); local quest = getCraftQuest(player, craftJudge, commandactor);
chosenQuest = tonumber(returnedQuest); if (quest ~= nil) then
isRequestedItemsMode = true;
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Chosen Quest: "..tostring(chosenQuest)); end if (quest.isCraftPassiveGuildleve()) then
currentCraftQuestGuildleve = quest;
if questConfirmed then else
isRequested = true; currentCraftQuest = quest;
end end
end
elseif isRequestedItemsMode == true then -- "Normal Synthesis" button hit
elseif isRequested == true then -- "Normal Synthesis" button hit isRequestedItemsMode = false;
isRequested = false; currentCraftQuestGuildleve = nil;
chosenQuest = 0; currentCraftQuest = nil;
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor); end
elseif operationMode == MENU_RECENT then -- "Recipes" button hit
end
elseif chosenOperation == MENU_RECIPE then -- "Recipes" button hit
if isRecipeRecentSent == false then if isRecipeRecentSent == false then
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(recentRecipe)); -- Load up recipe list recentRecipes = player.GetRecentRecipes();
local itemIds = recipeResolver.RecipesToItemIdTable(recentRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up recipe list
isRecipeRecentSent = true; isRecipeRecentSent = true;
end end
elseif operationMode == MENU_AWARDED then -- "Awarded Recipes" tab hit
recipeDetail = materialRecipe[recentRecipe[recipeMode]];
elseif chosenOperation == MENU_AWARDED then -- "Awarded Recipes" tab hit
if isRecipeAwardSent == false then if isRecipeAwardSent == false then
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(awardedRecipe)); -- Load up Award list awardedRecipes = player.GetAwardedRecipes();
local itemIds = recipeResolver.RecipesToItemIdTable(awardedRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up Award list
isRecipeAwardSent = true; isRecipeAwardSent = true;
end end
elseif ((operationMode == MENU_RECENT_DETAILED or operationMode == MENU_AWARDED_DETAILED) and recipeMode > 0) then -- Pop-up for an item's stats/craft mats on a recent recipe
recipeDetail = materialRecipe[awardedRecipe[recipeMode]]; local chosenRecipe = operationMode == MENU_RECENT_DETAILED and recentRecipes[recipeMode-1] or recentRecipes[awardedMode-1];
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
elseif (chosenOperation == MENU_RECIPE_DETAILED or chosenOperation == MENU_AWARDED_DETAILED) and recipeMode > 0 then -- Pop-up for an item's stats/craft mats chosenRecipe.resultItemID,
detailWindowState = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0); chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
-- This should never call? The window with this button only appears when you select a recent recipe with not enough materials. Otherwise it just auto-fills your "table".
if (recipeConfirmed) then
closeCraftStartWidget(player, craftJudge, commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
end
else else
break; break;
end end
end end
player:ChangeMusic(7); -- Need way to reset music back to the zone's default
player:ChangeState(0);
player:EndEvent();
player:ResetMusic();
player:ChangeState(0);
player:EndEvent();
end end
-- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command. -- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command.
-- Returns whether a quest was selected, and what id the quest is. -- Returns whether a quest was selected, and what id the quest is.
function GetCraftQuest(player, craftjudge, commandactor); function getCraftQuest(player, craftJudge, commandactor);
local questId = nil;
while (true) do
local questCommandId = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor);
if questCommandId then
questId = questCommandId - 0xA0F00000;
-- Craft Quest Chosen
if isCraftQuest(questId) then
local quest = player.GetQuest(questId);
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, quest.getQuestId(), 20, 1, 1, 1, 0, 0, "<Path Companion>");
if confirm == true then
player:SendGameMessage(craftJudge, 21, 0x20);
return quest;
end
-- PassiveGL Quest Chosen
elseif isLocalLeve(questId) then
local difficulty = 0;
local hasMaterials = 1;
local quest = player:getQuestGuildleve(questId);
if (quest ~= nil) then
-- Did they pickup the materials?
if (quest:hasMaterials() == false) then
player:SendGameMessage(GetWorldMaster(), 40210, 0x20); -- You have not obtained the proper materials from the client.
-- Did they use em all up?
elseif (quest:getRemainingMaterials() == 0) then
player:SendGameMessage(GetWorldMaster(), 40211, 0x20); -- You have used up all of the provided materials.
-- Confirm dialog
else
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor,
quest:getQuestId(),
quest:getCurrentDifficulty() + 1, -- Lua, 1-indexed
0,
quest:getCurrentCrafted(),
quest:getRemainingMaterials(),
quest:hasMaterials() and 1 or 0, -- Fucked up way of doing terneries on Lua
0
);
local questOffset = 0xA0F00000; -- Quest confirmed
local questId = 0; if (confirm == true) then
local requestState = false; return quest;
local requestedMenuChoice = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor); end
end
if requestedMenuChoice then else
questId = requestedMenuChoice - questOffset; return nil; -- Shouldn't happen unless db fucked with
end
if isCraftQuest(questId) then -- Scenario Quest Chosen
confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, questId, 20, 1, 1, 1, 0, 0, "<Path Companion>"); else
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
if confirm == true then player:SendGameMessage(GetWorldMaster(), 40209, 0x20); -- You cannot undertake that endeavor.
requestState = true; end
player:SendGameMessage(craftJudge, 21, 0x20); else
end return nil;
end
elseif isLocalLeve(questId) then end
confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor, questId, 0, 8030421, 5, 50, 0, 0);
if confirm == true then
requestState = true;
itemSlots = { unpack(materialRecipe[4070010])};
end
elseif isScenarioQuest(questId) == true then
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
player:SendGameMessage(GetWorldMaster(), 40209, 0x20);
end
end
return requestState, questId;
end end
function isScenarioQuest(id) function isScenarioQuest(id)
if (id >= 110001 and id <= 120026) then if (id >= 110001 and id <= 120026) then
return true; return true;
else else
@@ -359,7 +437,6 @@ end
function isLocalLeve(id) function isLocalLeve(id)
if (id >= 120001 and id <= 120452) then if (id >= 120001 and id <= 120452) then
return true; return true;
else else
@@ -367,58 +444,73 @@ function isLocalLeve(id)
end end
end end
function closeCraftStartWidget(player, craftJudge, commandactor)
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
craftStartWidgetOpen = false;
end
-- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level. -- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level.
function startCrafting(player, hand, quest, startDur, startQly, startHQ) function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, startDur, startQly, startHQ)
local worldMaster = GetWorldMaster(); local worldMaster = GetWorldMaster();
local craftProg = 0; local progress = 0;
local attempts = 5; local attempts = 5;
local craftedCount = 0; local craftedCount = 0;
local craftTotal = 2; local craftTotal = 2;
local itemId = 10009617;
player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out
player:ChangeMusic(73); player:ChangeMusic(73);
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
while true do while (true) do
local progDiff = math.random(30,50);
local progDiff = math.random(25,25);
local duraDiff = math.random(1,3); local duraDiff = math.random(1,3);
local qltyDiff = math.random(0,2); local qltyDiff = math.random(0,2);
if craftProg >= 100 then if (progress >= 100) then
testChoice2 = callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, 100, 10, 20, 5020111, 69, 70, 75);
-- From Lodestone: If the HQ odds are 1% or better, players will have the option of selecting either Finish or Double Down.
-- By electing to double down, the player takes a chance on creating an HQ item at the risk of losing the completed item if the attempt fails
testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 22503, 22504);
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8); -- "You create <#3 quantity> <#1 item> <#2 quality>."
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor); callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor);
if quest then -- Handle local levequest craft success
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalLeve", 120001, itemId, craftedCount, craftTotal, attempts); if quest then
quest:craftSuccess();
if (quest:getCurrentCrafted() >= quest:getObjectiveQuantity()) then
attentionMessage(player, 40121, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "All items for <QuestId> complete!"
else
attentionMessage(player, 40119, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "<QuestId> Successfull. (<crafted> of <attempts>)"
end
-- Continue local levequest (should this be in here??)
if (quest:getRemainingMaterials() ~= 0) then
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalleve", commandactor,
quest:getQuestId(),
quest:getRecipe().resultItemID,
quest:getCurrentCrafted(),
quest:getObjectiveQuantity(),
quest:getRemainingMaterials()
);
if continueLeve == true then if (continueLeve == 1) then
craftProg = 0; progress = 0;
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
else else
break; break;
end end
else else
break; break;
end
-- Normal synth craft success
else
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, recipe.resultItemID, 1, recipe.resultQuantity); -- "You create <#3 quantity> <#1 item> <#2 quality>."
player:getItemPackage(location):addItem(recipe.resultItemID, recipe.resultQuantity, 1);
break;
end end
end end
choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534); choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534);
--player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice); --player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice);
if (choice) then
if choice then
if skillAnim[choice] then if skillAnim[choice] then
player:PlayAnimation(skillAnim[choice]); player:PlayAnimation(skillAnim[choice]);
@@ -428,11 +520,11 @@ function startCrafting(player, hand, quest, startDur, startQly, startHQ)
player:SendGameMessage(worldMaster, 40108, 0x20, choice,2); player:SendGameMessage(worldMaster, 40108, 0x20, choice,2);
if choice ~= 29531 then if (choice ~= 29531) then
craftProg = craftProg + progDiff; progress = progress + progDiff;
if craftProg >= 100 then if (progress >= 100) then
craftProg = 100; progress = 100;
end end
startDur = startDur - duraDiff; startDur = startDur - duraDiff;
@@ -443,12 +535,9 @@ function startCrafting(player, hand, quest, startDur, startQly, startHQ)
player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff); player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff);
end end
--prg dur qly, ???, ???, ???, HQ --prg dur qly, ???, ???, ???, HQ
callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, craftProg, startDur, startQly, nil, nil, nil, nil, nil); callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, progress, startDur, startQly, nil, nil, nil, nil, nil);
--testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 29501, 24233, 29501,29501, 24223, 29501,12008,12004);
end end
end end
end
return -1;
end

View File

@@ -62,41 +62,38 @@ rangeInputWidget()
* goodMin * goodMin
* goodMax * goodMax
* bool * bool
Notes:
* Aim = Where on the aim gauge the player chose.
* Remainder = How many attempts you get on the section portion of the minigame
* Sweetspot = Where you hit on the second portion of the minigame
--]] --]]
minerAnim = {0x14001000, 0x14002000, 0x14003000}; minerAnim = {0x14001000, 0x14002000, 0x14003000};
--[[ Mooglebox - Aim --[[Mooglebox - Aim
+5 +4 +3 +2 +1 0 -1 -2 -3 -4 -5 +5 = 0
0 10 20 30 40 50 60 70 80 90 100 +4 = 10
+3 = 20
+2 = 30
+1 = 40
0 = 50
-1 = 60
-2 = 70
-3 = 80
-4 = 90
-5 = 100
Sweetspots 1=10 2=30 3=70 4=100 for Mining Sweetspots 1=10 2=30 3=70 4=100 for Mining
Remainder A=40 B=60 C=70 D=80 remainder A=40 B=60 C=70 D=80
--]] --]]
harvestNodeContainer = { -- nodeGrade, harvestAttempts, #ofItemsBecauseICantIntoIpairs, Item1, Item2, etc nodeContainer = { -- harvestAttempts, #ofItemsBecauseLuaIsShitAtTableLength, Item1, Item2, etc
[1001] = {2, 2, 3, 1, 2, 3}, [1] = {4, 3, 1, 2, 3}
[1002] = {2, 4, 5, 3005, 3003, 3002, 3001, 3004}
} }
harvestNodeItems = { nodeItems = {
--itemId, remainder, aim, sweetspot, max yield --itemId, remainder, aim, sweetspot, max yield
[1] = {10009104, 70, 30, 30, 4}, -- Rock Salt [1] = {10009104, 70, 30, 30, 4}, -- Rock Salt
[2] = {10006001, 80, 10, 30, 4}, -- Bone Chip [2] = {10006001, 80, 10, 30, 4}, -- Bone Chip
[3] = {10001006, 80, 20, 30, 3}, -- Copper Ore [3] = {10001006, 80, 20, 30, 3} -- Copper Ore
[3001] = {10001003, 80, 50, 30, 3},
[3002] = {10001006, 70, 70, 10, 4},
[3003] = {10001005, 80, 90, 70, 1},
[3004] = {10009104, 40, 10, 100, 2},
[3005] = {10001007, 40, 0, 30, 1}
} }
@@ -106,23 +103,18 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
debugMsg = false; debugMsg = false;
powerCurrent = 0;
powerLast = 0;
powerRange = 10; -- 'Feels' look a good amount compared to vids/ARR's minigame.
showTutorial = 0;
commandMine = 22002; commandMine = 22002;
commandLog = 22003; commandLog = 22003;
commandFish = 22004; commandFish = 22004;
remainderA, remainderB, remainderC, remainderD = 40, 60, 70, 80;
harvestNodeId = 1001; -- What the server should send eventually
harvestNode = BuildHarvestNode(player, harvestNodeId); -- [1-11] = {itemId, remainder, sweetspot, maxYield} currentPower = 0;
harvestGrade = harvestNodeContainer[harvestNodeId][1] or 0; nodeGrade = 3;
harvestAttempts = harvestNodeContainer[harvestNodeId][2] or 0; showTutorial = 0;
nodeRemainder = 0; harvestAttempts = 2;
nodeRemainder = remainderC;
item = 10001006;
harvestType = commandMine; harvestType = commandMine;
@@ -133,13 +125,11 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
--callClientFunction(player, "delegateCommand", harvestJudge, "turnToTarget", commandActor, harvestType, nodeGrade); --callClientFunction(player, "delegateCommand", harvestJudge, "turnToTarget", commandActor, harvestType, nodeGrade);
player:ChangeState(50); player:ChangeState(50);
if harvestType == commandMine then if harvestType == commandMine then
player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, harvestGrade); player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, nodeGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, harvestGrade); callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, nodeGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0); callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
@@ -147,43 +137,22 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
while harvestAttempts > 0 do while harvestAttempts > 0 do
-- "Aim", 0 = Top of bar, 100 = Bottom. -- "Aim", 0 = Top of bar, 100 = Bottom. Mooglebox conversion is +5 = 0, 0 = 50, -5 = 100
menuResult, sliderPhase, unk3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false); menuResult, sliderPhase, ret3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false);
if debugMsg then player:SendMessage(0x20, "", "menuResult: "..tostring(menuResult).." sliderPhase: "..tostring(sliderPhase).." Unk: "..tostring(unk3)); end
if debugMsg then player:SendMessage(0x20, "", tostring(menuResult).." unk: "..tostring(sliderPhase).." unk: "..tostring(ret3)); end
if menuResult == 22701 then -- Begin. if menuResult == 22701 then -- Begin.
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM);
local aimSlot = (sliderPhase/10)+1; -- Thanks LUA index = 1 nodeRemainder = remainderC;
local nodeDetails = harvestNode[aimSlot];
local nodeItem = nodeDetails[1];
local nodeRemainder = nodeDetails[2];
local nodeSweetspot = nodeDetails[3];
local nodeYield = nodeDetails[4];
local isFirstSwing = true;
local sweetspotDifference;
local sweetspotDifferencePrevious;
if debugMsg then
player:SendMessage(0x20, "", "aimSlot: "..(aimSlot).." itemId:"..tostring(nodeDetails[1]).." remainder: "..tostring(nodeDetails[2]));
end
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM); -- "You set your sights on an area."
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
while true do while true do
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
-- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining -- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining
chosenCommand, powerCurrent = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike 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(powerCurrent)); end if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end
if chosenCommand == 22702 then -- Cancel. if chosenCommand == 22702 then -- Cancel.
harvestAttempts = harvestAttempts - 1; harvestAttempts = harvestAttempts - 1;
@@ -196,64 +165,20 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
break; break;
elseif chosenCommand == 22703 then -- Strike. elseif chosenCommand == 22703 then -- Strike.
player:PlayAnimation(minerAnim[math.random(1,3)]);
nodeRemainder = nodeRemainder - 20; nodeRemainder = nodeRemainder - 20;
if nodeRemainder < 0 then if nodeRemainder < 0 then
nodeRemainder = 0; nodeRemainder = 0;
end end
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
player:PlayAnimation(minerAnim[math.random(1,3)]);
wait(2);
sweetspotDifference = math.abs(powerCurrent - nodeSweetspot);
if powerRange >= sweetspotDifference then
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
-- "You obtain <yield> <item> <quality>"
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, nodeItem, 0, nodeYield, 0);
player:SendGameMessage(player, worldMaster, 40301, MESSAGE_TYPE_SYSTEM, player, nodeItem, nodeYield); -- TODO: Refer to caps to see wtf is going on here
HarvestReward(player, nodeItem, nodeYield);
nodeRemainder = 0;
else
if isFirstSwing then
if sweetspotDifference < 19 then -- TODO: TWEAK THESE, likely need to be larger
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 45);
player:SendGameMessage(harvestJudge, 45, MESSAGE_TYPE_SYSTEM); -- "You feel something promising."
elseif sweetspotDifference > 20 then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
else
if sweetspotDifference > sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 43);
player:SendGameMessage(harvestJudge, 43, MESSAGE_TYPE_SYSTEM); -- "You are getting farther from the mark."
elseif sweetspotDifference < sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 44);
player:SendGameMessage(harvestJudge, 44, MESSAGE_TYPE_SYSTEM); -- "You are getting closer to the mark."
else
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
end
end
if not isFirstSwing then
powerLast = powerCurrent;
end;
--player:SendGameMessage(harvestJudge, 25, MESSAGE_TYPE_SYSTEM, item, 4, 1);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, item, 4, 1, 0);
if nodeRemainder == 0 then if nodeRemainder == 0 then
harvestAttempts = harvestAttempts - 1; harvestAttempts = harvestAttempts - 1;
@@ -262,20 +187,12 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts);
else else
-- There is nothing left to gather at this location. -- There is nothing left to gather at this location.
player:ChangeMusic(101);
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
wait(2); wait(2);
break; break;
end end
if isFirstSwing and debugMsg then player:SendMessage(0x20, "", "First swing"); end
isFirstSwing = false;
sweetspotDifferencePrevious = sweetspotDifference;
elseif chosenCommand == 22710 then -- "Strike" Tutorial. elseif chosenCommand == 22710 then -- "Strike" Tutorial.
SendTutorial(player, harvestJudge, 2); SendTutorial(player, harvestJudge, 2);
end end
@@ -295,12 +212,8 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
end end
player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM);
if harvestAttempts == 0 then if harvestAttempts == 0 then
player:SendGameMessage(player, worldMaster, 40310, 0x20); -- "The deposit has been exhausted." player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM);
--TO:DO Despawn node + whatever logic to respawn an exsiting expired node in the area.
end end
callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType);
@@ -311,67 +224,6 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
end end
-- Returns a table in the following format: nodeTable = { [1-11] = {itemId, remainder, sweetspot, maxYield} }
function BuildHarvestNode(player, sentNode)
if harvestNodeContainer[sentNode] then
local node = harvestNodeContainer[sentNode];
local nodeTable = {};
local nodeItems = {};
local nodeItemCount = node[3];
local grade = node[1];
local attempts = node[2];
-- Load up nodeItems[] with the harvestNodeItems{} key and Aim point
for i=1, nodeItemCount do
local nodeItemKey = node[3+i];
local item = harvestNodeItems[ node[3+i] ]
nodeItems[i] = { nodeItemKey, ((item[3] / 10)+1) };
if debugMsg then player:SendMessage(0x20, "", "nodeItems: "..nodeItems[i][1].." "..nodeItems[i][2]); end
end
-- Iterate through the 11 Aim spots
for i=1,11,1 do
local hasItem = false;
-- See if there's a nodeItems[] that has an Aim spot that matches the current loop
-- TODO: Just set nodeItems[] keys to the actual slots to skip this loop inside a loop
for j=1, nodeItemCount do
if nodeItems[j][2] == i then
hasItem = j;
break;
end
end
if hasItem then
local item = harvestNodeItems[ nodeItems[hasItem][1] ];
-- Assign itemId, remainder, sweetspot, yield to this slot
nodeTable[i] = {item[1], item[2], item[4], item[5] };
if debugMsg then
player:SendMessage(0x20, "", "nodeTable: "..i.." "..nodeTable[i][1].." "..nodeTable[i][2].." "..nodeTable[i][3].." "..nodeTable[i][3]);
end
else
nodeTable[i] = {0,0,0,0};
if debugMsg then player:SendMessage(0x20, "", "nodeTable: "..i); end
end
end
return nodeTable
end
end
function SendTutorial(player, harvestJudge, id) function SendTutorial(player, harvestJudge, id)
if id == 1 then if id == 1 then
@@ -387,25 +239,4 @@ function SendTutorial(player, harvestJudge, id)
wait(3); wait(3);
player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM); player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM);
end end
end
function HarvestReward(player, item, qty) -- Really should get a helper function for this
local worldMaster = GetWorldMaster();
local location = INVENTORY_NORMAL;
local invCheck = player:getItemPackage(location):addItem(item, qty, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, worldMaster, 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, worldMaster, 40279, MESSAGE_TYPE_SYSTEM_ERROR, item, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
--player:SendMessage(MESSAGE_TYPE_SYSTEM, "", message);
player:SendGameMessage(player, worldMaster, 25246, MESSAGE_TYPE_SYSTEM, item, qty);
end
end end

View File

@@ -174,7 +174,7 @@ function equipItem(player, equipSlot, item)
if (gItem:IsWeaverWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end if (gItem:IsWeaverWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end
if (gItem:IsGoldSmithWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end if (gItem:IsGoldSmithWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end
end end
--Graphic Slot was set, otherwise it's a special case --Graphic Slot was set, otherwise it's a special case
if (graphicSlot ~= nil) then if (graphicSlot ~= nil) then
player:GraphicChange(graphicSlot, item); player:GraphicChange(graphicSlot, item);

View File

@@ -11,13 +11,13 @@ require("global")
function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7) function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7)
actor = player:GetActorInInstance(ownerActorId); actor = player:GetActorInInstance(ownerActorId);
print("TESSSSSSSSSSSSSST");
harvestCommand = GetStaticActorById(0xA0F055F7);
if (actor != nil) then if (actor != nil) then
if (actor:GetActorClassId() == 1200052) then if (actor:GetActorClassId() == 1200052) then
player:kickEvent(actor, "commandJudgeMode", "commandJudgeMode"); player:KickEventSpecial(harvestCommand, 0, "commandJudgeMode", 0, 0, 0, 0, 0x4E26, 0, nil, 0xF, actor, nil, nil, nil, nil);
else else
printf("TEST"); --player:kickEvent(actor, "pushCommand", false);
player:kickEvent(actor, "pushCommand", "pushCommand");
end end
else else
player:endEvent(); player:endEvent();

View File

@@ -0,0 +1,30 @@
require("global");
properties = {
permissions = 0,
parameters = "ddd",
description =
[[
Sets anim id for current target
!anim <animID> |
]],
}
function onTrigger(player, argc, aType, a1, a2)
npc = player;--GetWorldManager():GetActorInWorldByUniqueId("test");
aType = tonumber(aType);
a1 = tonumber(a1);
a2 = tonumber(a2);
a1 = bit32.band(a1, 0xFFF);
a2 = bit32.band(a2, 0xFFF);
aType = bit32.band(aType, 0xFF);
animId = bit32.bor(bit32.lshift(a2, 12), a1);
animId = bit32.bor(bit32.lshift(aType, 24), animId);
print("AHHH");
player:PlayAnimation(0x10005000);
end;

View File

@@ -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);
@@ -46,9 +46,4 @@ function main(thisDirector)
wait(3); wait(3);
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

View File

@@ -52,7 +52,7 @@ function onEventStarted(player, director, triggerName)
wait(6); --Should be wait for mobkill wait(6); --Should be wait for mobkill
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
player:SendDataPacket("attention", worldMaster, "", 51073, 1); attentionMessage(player, 51073, 1);
wait(7); wait(7);
player:ChangeMusic(7); player:ChangeMusic(7);
player:ChangeState(0); player:ChangeState(0);

View File

@@ -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);

View File

@@ -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);

View File

@@ -0,0 +1,7 @@
require ("global")
function onEventStarted(player, npc)
defaultSea = GetStaticActor("DftSea");
callClientFunction(player, "delegateEvent", player, defaultSea, "defaultTalkWithKurtz_001");
player:endEvent();
end

View File

@@ -0,0 +1,6 @@
shopInfo = {
welcomeText = 94,
shopPack = 0x67,
shopCurrancy = nil
}

View File

@@ -0,0 +1,6 @@
shopInfo = {
welcomeText = 69,
shopPack = 3020,
tutorialId = 35
}

View File

@@ -0,0 +1,6 @@
shopInfo = {
welcomeText = 64,
shopPack = 3021,
tutorialId = 34
}

View File

@@ -0,0 +1,6 @@
shopInfo = {
welcomeText = 76,
shopPack = 3022,
tutorialId = 39
}

View File

@@ -0,0 +1,6 @@
shopInfo = {
welcomeText = 54,
shopPack = 3019,
tutorialId = 32
}

View File

@@ -0,0 +1,5 @@
shopInfo = {
welcomeText = 265,
shopPack = 3024
}

View File

@@ -0,0 +1,5 @@
shopInfo = {
welcomeText = 111,
shopPack = 3003
}

View File

@@ -0,0 +1,5 @@
shopInfo = {
welcomeText = 110,
shopPack = 3002
}

View File

@@ -1,54 +1,34 @@
-- MySQL dump 10.13 Distrib 5.7.10, for Win64 (x86_64) -- --------------------------------------------------------
-- -- Host: 127.0.0.1
-- Host: localhost Database: ffxiv_database -- Server version: 5.6.17 - MySQL Community Server (GPL)
-- ------------------------------------------------------ -- Server OS: Win64
-- Server version 5.7.10-log -- HeidiSQL Version: 10.1.0.5464
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */; /*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!50503 SET NAMES utf8mb4 */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `characters_quest_guildleve_local`
--
DROP TABLE IF EXISTS `characters_quest_guildleve_local`; -- Dumping database structure for ffxiv_server
/*!40101 SET @saved_cs_client = @@character_set_client */; CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET latin1 */;
/*!40101 SET character_set_client = utf8 */; USE `ffxiv_server`;
CREATE TABLE `characters_quest_guildleve_local` (
-- Dumping structure for table ffxiv_server.characters_quest_guildleve_local
CREATE TABLE IF NOT EXISTS `characters_quest_guildleve_local` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`characterId` int(10) unsigned NOT NULL, `characterId` int(10) unsigned NOT NULL,
`slot` smallint(5) unsigned NOT NULL, `slot` smallint(5) unsigned NOT NULL,
`questId` int(10) unsigned NOT NULL, `questId` int(10) unsigned NOT NULL,
`questData` longtext,
`abandoned` tinyint(1) unsigned DEFAULT '0', `abandoned` tinyint(1) unsigned DEFAULT '0',
`completed` tinyint(1) DEFAULT '0', `completed` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-- -- Data exporting was unselected.
-- Dumping data for table `characters_quest_guildleve_local` /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
-- /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
LOCK TABLES `characters_quest_guildleve_local` WRITE;
/*!40000 ALTER TABLE `characters_quest_guildleve_local` DISABLE KEYS */;
/*!40000 ALTER TABLE `characters_quest_guildleve_local` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-06-07 22:54:48

View File

@@ -11,6 +11,11 @@
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for ffxiv_server
CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ffxiv_server`;
-- Dumping structure for table ffxiv_server.gamedata_items_graphics -- Dumping structure for table ffxiv_server.gamedata_items_graphics
DROP TABLE IF EXISTS `gamedata_items_graphics`; DROP TABLE IF EXISTS `gamedata_items_graphics`;
CREATE TABLE IF NOT EXISTS `gamedata_items_graphics` ( CREATE TABLE IF NOT EXISTS `gamedata_items_graphics` (

View File

@@ -0,0 +1,236 @@
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.17 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.1.0.5464
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for ffxiv_server
CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ffxiv_server`;
-- Dumping structure for table ffxiv_server.gamedata_passivegl_craft
DROP TABLE IF EXISTS `gamedata_passivegl_craft`;
CREATE TABLE IF NOT EXISTS `gamedata_passivegl_craft` (
`id` int(11) unsigned NOT NULL,
`plateId` int(11) unsigned NOT NULL,
`borderId` int(11) unsigned NOT NULL,
`recommendedClass` int(11) NOT NULL,
`issuingLocation` int(11) NOT NULL,
`guildleveLocation` int(11) NOT NULL,
`deliveryDisplayName` int(11) NOT NULL,
`unk1` int(11) NOT NULL,
`unk2` int(11) NOT NULL,
`unk3` int(11) NOT NULL,
`unk4` int(11) NOT NULL,
`objectiveItemId1` int(11) NOT NULL,
`objectiveQuantity1` int(11) NOT NULL,
`numberOfAttempts1` int(11) NOT NULL,
`recommendedLevel1` int(11) NOT NULL,
`rewardItemId1` int(11) NOT NULL,
`rewardQuantity1` int(11) NOT NULL,
`objectiveItemId2` int(11) NOT NULL,
`objectiveQuantity2` int(11) NOT NULL,
`numberOfAttempts2` int(11) NOT NULL,
`recommendedLevel2` int(11) NOT NULL,
`rewardItemId2` int(11) NOT NULL,
`rewardQuantity2` int(11) NOT NULL,
`objectiveItemId3` int(11) NOT NULL,
`objectiveQuantity3` int(11) NOT NULL,
`numberOfAttempts3` int(11) NOT NULL,
`recommendedLevel3` int(11) NOT NULL,
`rewardItemId3` int(11) NOT NULL,
`rewardQuantity3` int(11) NOT NULL,
`objectiveItemId4` int(11) NOT NULL,
`objectiveQuantity4` int(11) NOT NULL,
`numberOfAttempts4` int(11) NOT NULL,
`recommendedLevel4` int(11) NOT NULL,
`rewardItemId4` int(11) NOT NULL,
`rewardQuantity4` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Data about passiveGuildleves AKA Local Guildleves';
-- Dumping data for table ffxiv_server.gamedata_passivegl_craft: ~169 rows (approximately)
/*!40000 ALTER TABLE `gamedata_passivegl_craft` DISABLE KEYS */;
INSERT INTO `gamedata_passivegl_craft` (`id`, `plateId`, `borderId`, `recommendedClass`, `issuingLocation`, `guildleveLocation`, `deliveryDisplayName`, `unk1`, `unk2`, `unk3`, `unk4`, `objectiveItemId1`, `objectiveQuantity1`, `numberOfAttempts1`, `recommendedLevel1`, `rewardItemId1`, `rewardQuantity1`, `objectiveItemId2`, `objectiveQuantity2`, `numberOfAttempts2`, `recommendedLevel2`, `rewardItemId2`, `rewardQuantity2`, `objectiveItemId3`, `objectiveQuantity3`, `numberOfAttempts3`, `recommendedLevel3`, `rewardItemId3`, `rewardQuantity3`, `objectiveItemId4`, `objectiveQuantity4`, `numberOfAttempts4`, `recommendedLevel4`, `rewardItemId4`, `rewardQuantity4`) VALUES
(120001, 20033, 20005, 1, 1, 1001, 1000333, 185, 186, 187, 188, 4040002, 2, 4, 5, 10002011, 3, 3910101, 72, 5, 10, 10002011, 3, 4030002, 4, 6, 15, 10002011, 3, 4040102, 5, 7, 25, 10002011, 3),
(120002, 20033, 20005, 1, 1, 1001, 1000333, 101, 102, 103, 104, 10303101, 2, 4, 1, 10002011, 3, 10300011, 3, 5, 15, 10002011, 3, 10303109, 4, 6, 1, 10002011, 3, 10303103, 5, 7, 20, 10002011, 3),
(120003, 20033, 20005, 1, 1, 1001, 1000333, 221, 222, 223, 224, 6020002, 2, 4, 5, 10002011, 3, 6021001, 3, 5, 10, 10002011, 3, 6020006, 4, 6, 5, 10002011, 3, 6020003, 5, 7, 25, 10002011, 3),
(120004, 20033, 20005, 1, 1, 1001, 1000333, 29, 30, 31, 32, 0, 0, 4, 1, 10001004, 8, 0, 0, 5, 1, 10001004, 8, 10002002, 48, 6, 10, 10001004, 8, 0, 0, 7, 10, 10001004, 8),
(120005, 20033, 20005, 30, 1051, 1014, 1400065, 361, 362, 363, 364, 4030001, 2, 4, 1, 6020004, 1, 4030001, 3, 5, 1, 8032501, 1, 4030001, 4, 6, 1, 8070320, 1, 4030001, 5, 7, 1, 8080615, 1),
(120006, 20033, 20005, 34, 1051, 1014, 1400065, 361, 362, 363, 364, 8031315, 2, 4, 1, 6060008, 1, 8031315, 3, 5, 1, 8032501, 1, 8031315, 4, 6, 1, 8070320, 1, 8031315, 5, 7, 1, 8080615, 1),
(120007, 20033, 20005, 29, 1051, 1014, 1400065, 361, 362, 363, 364, 10008203, 2, 4, 1, 6010009, 1, 10008203, 3, 5, 1, 8032501, 1, 10008203, 4, 6, 1, 8070320, 1, 10008203, 5, 7, 1, 8080615, 1),
(120008, 20033, 20005, 33, 1051, 1014, 1400065, 361, 362, 363, 364, 8080615, 2, 4, 1, 6050009, 1, 8080615, 3, 5, 1, 8032501, 1, 8080615, 4, 6, 1, 8070320, 1, 8080615, 5, 7, 1, 8080615, 1),
(120009, 20033, 20005, 31, 1051, 1014, 1400065, 361, 362, 363, 364, 10002071, 6, 4, 1, 6030009, 1, 10002071, 9, 5, 1, 8032501, 1, 10002071, 12, 6, 1, 8070320, 1, 10002071, 15, 7, 1, 8080615, 1),
(120010, 20033, 20005, 32, 1051, 1014, 1400065, 361, 362, 363, 364, 9050052, 2, 4, 1, 6040009, 1, 9050052, 3, 5, 1, 8032501, 1, 9050052, 4, 6, 1, 8070320, 1, 9050052, 5, 7, 1, 8080615, 1),
(120011, 20033, 20005, 35, 1051, 1014, 1400065, 361, 362, 363, 364, 10009308, 6, 4, 1, 6070009, 1, 10009308, 9, 5, 1, 8032501, 1, 10009308, 12, 6, 1, 8070320, 1, 10009308, 15, 7, 1, 8080615, 1),
(120012, 20033, 20005, 36, 1051, 1014, 1400065, 361, 362, 363, 364, 3010202, 12, 4, 1, 6080009, 1, 3010202, 18, 5, 1, 8032501, 1, 3010202, 24, 6, 1, 8070320, 1, 3010202, 30, 7, 1, 8080615, 1),
(120013, 20033, 20005, 30, 1051, 1510, 1400104, 333, 334, 335, 336, 10002012, 2, 4, 10, 10001004, 9, 10002013, 3, 5, 20, 10001004, 9, 10003015, 4, 6, 30, 10001010, 9, 10002015, 5, 7, 35, 10001013, 9),
(120014, 20033, 20005, 30, 1051, 1509, 1900094, 329, 330, 331, 332, 10002072, 6, 4, 15, 10002012, 3, 10002073, 9, 5, 25, 10002013, 3, 10003074, 12, 6, 35, 10003015, 3, 10002074, 15, 7, 40, 10002015, 3),
(120015, 20033, 20004, 30, 1051, 1509, 1000333, 325, 326, 327, 328, 4040106, 2, 4, 15, 10002012, 3, 4030115, 3, 5, 25, 10002013, 3, 4040206, 4, 6, 45, 10003015, 3, 4030506, 5, 7, 50, 10002015, 3),
(120016, 20033, 20005, 34, 1051, 1510, 1400104, 333, 334, 335, 336, 8012011, 2, 4, 10, 10005201, 6, 8010910, 3, 5, 20, 10005005, 3, 8012014, 4, 6, 35, 10005020, 3, 8010620, 5, 7, 45, 10005025, 3),
(120017, 20033, 20005, 29, 1051, 1510, 1400104, 333, 334, 335, 336, 7030009, 2, 4, 5, 10008203, 3, 7030104, 3, 5, 10, 10008205, 3, 3940107, 12, 6, 30, 10008207, 3, 7030107, 5, 7, 40, 10008211, 3),
(120018, 20033, 20005, 33, 1051, 1510, 1400104, 333, 334, 335, 336, 8090503, 2, 4, 10, 10007104, 3, 8091106, 3, 5, 15, 10007104, 3, 8090902, 4, 6, 20, 10007126, 3, 8090204, 5, 7, 35, 10007116, 3),
(120019, 20033, 20005, 31, 1051, 1510, 1400104, 333, 334, 335, 336, 8011605, 2, 4, 20, 10002022, 2, 8011606, 3, 5, 20, 10002022, 2, 8011607, 4, 6, 30, 10002023, 2, 8011607, 5, 7, 30, 10002023, 2),
(120020, 20033, 20005, 31, 1051, 1509, 1900094, 329, 330, 331, 332, 8011710, 2, 4, 45, 10003025, 2, 8011710, 3, 5, 45, 10003025, 2, 8011712, 4, 6, 50, 10002024, 2, 8011712, 5, 7, 50, 10002024, 2),
(120021, 20033, 20004, 31, 1051, 1509, 1000333, 325, 326, 327, 328, 8030320, 2, 4, 35, 10002053, 3, 8031720, 3, 5, 45, 10003055, 3, 8031722, 4, 6, 50, 10002054, 3, 8031722, 5, 7, 50, 10002054, 3),
(120022, 20033, 20005, 32, 1051, 1510, 1400104, 333, 334, 335, 336, 8010808, 2, 4, 25, 10003013, 3, 8010210, 3, 5, 30, 10002023, 2, 8010833, 4, 6, 40, 10003015, 3, 8010823, 5, 7, 50, 10003014, 3),
(120023, 20033, 20005, 35, 1051, 1510, 1400104, 333, 334, 335, 336, 10009314, 8, 4, 40, 3011224, 2, 10009314, 3, 5, 15, 3011102, 4, 10009315, 4, 6, 30, 10006005, 2, 10009315, 10, 7, 45, 10006007, 2),
(120024, 20033, 20005, 36, 1051, 1509, 1900094, 329, 330, 331, 332, 3010605, 12, 4, 5, 3011451, 9, 3010605, 18, 5, 5, 3011451, 9, 3010611, 20, 6, 20, 3011452, 18, 3010607, 15, 7, 40, 3011455, 18),
(120025, 20033, 20005, 36, 1051, 1509, 1900094, 329, 330, 331, 332, 3010007, 10, 4, 10, 3011309, 3, 3010108, 15, 5, 15, 3011101, 3, 3010010, 16, 6, 20, 3011006, 3, 3010308, 10, 7, 45, 3011310, 12),
(120026, 20033, 20004, 36, 1051, 1510, 1400104, 333, 334, 335, 336, 3011501, 12, 4, 10, 3010609, 12, 3011504, 18, 5, 1, 3010604, 3, 3011505, 48, 6, 20, 3011008, 3, 3011535, 60, 7, 10, 3011506, 3),
(120027, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120028, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120029, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120030, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120031, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120032, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120033, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120034, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120035, 20034, 20005, 30, 1051, 1018, 1900056, 105, 107, 108, 106, 6010009, 2, 4, 5, 10002011, 3, 7020104, 3, 5, 10, 10002011, 3, 6010013, 4, 6, 35, 10002013, 3, 7020107, 5, 7, 45, 10003015, 3),
(120036, 20034, 20005, 31, 1051, 1018, 1900056, 105, 107, 108, 106, 10002052, 2, 4, 15, 10002012, 3, 10002053, 3, 5, 25, 10002013, 3, 10002053, 4, 6, 25, 10002013, 3, 10003055, 5, 7, 35, 10003015, 3),
(120037, 20034, 20005, 36, 1051, 1018, 1900056, 105, 107, 108, 106, 3010104, 10, 4, 15, 3011213, 3, 3010105, 18, 5, 5, 3011112, 3, 3010311, 12, 6, 35, 3011316, 3, 3010107, 15, 7, 30, 3011217, 3),
(120038, 20034, 20005, 34, 1051, 1018, 1900056, 105, 107, 108, 106, 8031224, 2, 4, 10, 10005001, 3, 8031121, 3, 5, 15, 10005005, 3, 8031419, 4, 6, 30, 10005015, 3, 8032303, 5, 7, 45, 10005025, 3),
(120039, 20034, 20005, 29, 1051, 1018, 1900056, 105, 107, 108, 106, 10008205, 2, 4, 10, 10008005, 3, 10008204, 3, 5, 15, 10008004, 3, 10008207, 4, 6, 20, 10008007, 3, 10008211, 5, 7, 30, 10008011, 3),
(120040, 20034, 20005, 33, 1051, 1018, 1900056, 105, 107, 108, 106, 8081016, 2, 4, 10, 10007104, 3, 8081311, 3, 5, 15, 10007104, 3, 8080517, 4, 6, 35, 10007116, 3, 8080521, 5, 7, 40, 10007125, 3),
(120041, 20034, 20005, 32, 1051, 1018, 1900056, 105, 107, 108, 106, 5020108, 2, 4, 10, 10006003, 3, 5020212, 3, 5, 30, 10006005, 3, 5020109, 4, 6, 40, 10006005, 3, 5020214, 5, 7, 45, 10006005, 3),
(120042, 20034, 20005, 35, 1051, 1018, 1900056, 105, 107, 108, 106, 3011527, 24, 4, 10, 3011415, 8, 3011524, 36, 5, 1, 3011524, 8, 3011532, 48, 6, 10, 3011404, 8, 3011536, 60, 7, 20, 10009405, 8),
(120043, 20034, 20005, 30, 1051, 1022, 1400076, 61, 63, 64, 62, 4040009, 2, 4, 15, 10002012, 3, 4040405, 3, 5, 25, 10002012, 3, 4020302, 4, 6, 30, 10002013, 3, 4070107, 5, 7, 45, 10002015, 3),
(120044, 20034, 20005, 31, 1051, 1022, 1400076, 61, 63, 64, 62, 10002022, 6, 4, 15, 10002012, 3, 10002023, 9, 5, 25, 10002013, 3, 10002023, 12, 6, 25, 10002013, 3, 10003025, 5, 7, 35, 10003015, 3),
(120045, 20034, 20005, 36, 1051, 1022, 1400076, 61, 63, 64, 62, 3010001, 10, 4, 15, 3011003, 3, 3010017, 6, 5, 50, 3011012, 3, 3010008, 8, 6, 40, 3011002, 3, 3010011, 15, 7, 35, 3011004, 3),
(120046, 20034, 20005, 34, 1051, 1022, 1400076, 61, 63, 64, 62, 8030423, 2, 4, 20, 10005005, 3, 8031417, 3, 5, 25, 10005005, 3, 8030520, 4, 6, 45, 10005025, 3, 8032305, 5, 7, 50, 10005033, 3),
(120047, 20034, 20005, 29, 1051, 1022, 1400076, 61, 63, 64, 62, 10008207, 2, 4, 20, 10008007, 3, 10008211, 3, 5, 30, 10008011, 3, 10008216, 4, 6, 40, 10008016, 3, 10008214, 5, 7, 45, 10008014, 3),
(120048, 20034, 20005, 33, 1051, 1022, 1400076, 61, 63, 64, 62, 8080224, 2, 4, 20, 10007104, 3, 8080513, 3, 5, 25, 10007126, 3, 8080427, 4, 6, 45, 10007116, 3, 8080712, 5, 7, 50, 10007116, 3),
(120049, 20034, 20005, 32, 1051, 1022, 1400076, 61, 63, 64, 62, 5020210, 2, 4, 20, 10006006, 3, 5020211, 3, 5, 25, 10006006, 3, 5020213, 4, 6, 35, 10006005, 3, 5020215, 5, 7, 50, 10006005, 3),
(120050, 20034, 20005, 35, 1051, 1022, 1400076, 61, 63, 64, 62, 3020002, 8, 4, 20, 10009611, 2, 3020525, 9, 5, 25, 10009611, 2, 3020201, 4, 6, 50, 10009508, 2, 3020402, 15, 7, 30, 10009605, 6),
(120051, 20034, 20005, 30, 1051, 1020, 1300073, 141, 143, 144, 142, 4040108, 2, 4, 40, 10002013, 3, 7020014, 3, 5, 40, 10003015, 3, 6040015, 4, 6, 50, 10002015, 3, 4020309, 5, 7, 50, 10002015, 3),
(120052, 20034, 20005, 31, 1051, 1020, 1300073, 141, 143, 144, 142, 10003025, 2, 4, 35, 10003015, 3, 10003025, 3, 5, 35, 10003015, 3, 10002024, 4, 6, 45, 10002015, 3, 10002024, 5, 7, 45, 10002015, 3),
(120053, 20034, 20005, 36, 1051, 1020, 1300073, 141, 143, 144, 142, 3010011, 6, 4, 35, 3011004, 3, 3010017, 6, 5, 50, 3011012, 3, 3010008, 8, 6, 40, 3011002, 3, 3010002, 20, 7, 25, 3011001, 3),
(120054, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120055, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120056, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120057, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120058, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120059, 20034, 20005, 30, 1051, 1014, 1600125, 45, 47, 48, 46, 6020004, 2, 4, 5, 10002011, 3, 4030004, 3, 5, 10, 10002011, 3, 6030010, 4, 6, 15, 10002011, 3, 4030405, 5, 7, 35, 10002013, 3),
(120060, 20034, 20005, 34, 1051, 1014, 1600125, 45, 47, 48, 46, 8030819, 2, 4, 5, 10005001, 3, 8030821, 3, 5, 15, 10005005, 3, 8031224, 4, 6, 10, 10005001, 3, 8030220, 5, 7, 35, 10005020, 3),
(120061, 20034, 20005, 29, 1051, 1014, 1600125, 45, 47, 48, 46, 10008203, 2, 4, 1, 10008003, 3, 10008205, 3, 5, 10, 10008005, 3, 10008204, 4, 6, 15, 10008004, 3, 10008207, 5, 7, 20, 10008007, 3),
(120062, 20034, 20005, 33, 1051, 1014, 1600125, 45, 47, 48, 46, 8081118, 2, 4, 5, 10007101, 3, 8081120, 3, 5, 15, 10007126, 3, 8080529, 4, 6, 25, 10007126, 3, 8080541, 5, 7, 35, 10007116, 3),
(120063, 20034, 20005, 31, 1051, 1014, 1600125, 45, 47, 48, 46, 10002051, 2, 4, 5, 10002011, 3, 10002051, 3, 5, 5, 10002011, 3, 10002052, 4, 6, 15, 10002012, 3, 10002053, 5, 7, 25, 10002013, 3),
(120064, 20034, 20005, 32, 1051, 1014, 1600125, 45, 47, 48, 46, 5020106, 2, 4, 5, 10006003, 3, 5020108, 3, 5, 10, 10006003, 3, 5020011, 4, 6, 35, 10003013, 3, 5020109, 5, 7, 40, 10006005, 3),
(120065, 20034, 20005, 35, 1051, 1014, 1600125, 45, 47, 48, 46, 3011527, 24, 4, 10, 3011415, 8, 3011529, 36, 5, 1, 10009104, 2, 3011526, 48, 6, 1, 3011525, 8, 3011530, 60, 7, 1, 10009301, 6),
(120066, 20034, 20005, 36, 1051, 1014, 1600125, 45, 47, 48, 46, 3010301, 8, 4, 20, 3011301, 3, 3010303, 6, 5, 45, 10009502, 3, 3010305, 20, 6, 10, 3011303, 3, 3010308, 10, 7, 45, 3011310, 12),
(120067, 20034, 20005, 30, 1051, 1026, 2200258, 161, 163, 164, 162, 4030116, 2, 4, 40, 10003015, 3, 4020209, 3, 5, 45, 10002015, 3, 4040305, 4, 6, 45, 10002015, 3, 4030406, 5, 7, 50, 10002015, 3),
(120068, 20034, 20005, 31, 1051, 1026, 2200258, 161, 163, 164, 162, 10003055, 2, 4, 35, 10003015, 3, 10003055, 3, 5, 35, 10003015, 3, 10002054, 4, 6, 40, 10002015, 3, 10002054, 5, 7, 40, 10002015, 3),
(120069, 20034, 20005, 36, 1051, 1026, 2200258, 161, 163, 164, 162, 3010110, 4, 4, 45, 3011121, 3, 3010109, 6, 5, 40, 3011016, 3, 3010113, 16, 6, 25, 3011207, 3, 3010111, 10, 7, 50, 3011123, 3),
(120201, 20033, 20005, 30, 2001, 2017, 1300085, 365, 366, 367, 368, 10002011, 2, 4, 1, 6020004, 1, 10002011, 3, 5, 1, 8032501, 1, 10002011, 4, 6, 1, 8070320, 1, 10002011, 5, 7, 1, 8080615, 1),
(120202, 20033, 20005, 34, 2001, 2017, 1300085, 365, 366, 367, 368, 8030420, 2, 4, 1, 6060008, 1, 8030420, 3, 5, 1, 8032501, 1, 8030420, 4, 6, 1, 8070320, 1, 8030420, 5, 7, 1, 8080615, 1),
(120203, 20033, 20005, 29, 2001, 2017, 1300085, 365, 366, 367, 368, 10008203, 2, 4, 1, 6010009, 1, 10008203, 3, 5, 1, 8032501, 1, 10008203, 4, 6, 1, 8070320, 1, 10008203, 5, 7, 1, 8080615, 1),
(120204, 20033, 20005, 33, 2001, 2017, 1300085, 365, 366, 367, 368, 8080220, 2, 4, 1, 6050009, 1, 8080220, 3, 5, 1, 8032501, 1, 8080220, 4, 6, 1, 8070320, 1, 8080220, 5, 7, 1, 8080615, 1),
(120205, 20033, 20005, 31, 2001, 2017, 1300085, 365, 366, 367, 368, 10002071, 6, 4, 1, 6030009, 1, 10002071, 9, 5, 1, 8032501, 1, 10002071, 12, 6, 1, 8070320, 1, 10002071, 15, 7, 1, 8080615, 1),
(120206, 20033, 20005, 32, 2001, 2017, 1300085, 365, 366, 367, 368, 9050052, 2, 4, 1, 6040009, 1, 9050052, 3, 5, 1, 8032501, 1, 9050052, 4, 6, 1, 8070320, 1, 9050052, 5, 7, 1, 8080615, 1),
(120207, 20033, 20005, 35, 2001, 2017, 1300085, 365, 366, 367, 368, 3011530, 24, 4, 1, 6070009, 1, 3011530, 36, 5, 1, 8032501, 1, 3011530, 48, 6, 1, 8070320, 1, 3011530, 60, 7, 1, 8080615, 1),
(120208, 20033, 20005, 36, 2001, 2017, 1300085, 365, 366, 367, 368, 3010202, 12, 4, 1, 6080009, 1, 3010202, 18, 5, 1, 8032501, 1, 3010202, 24, 6, 1, 8070320, 1, 3010202, 30, 7, 1, 8080615, 1),
(120209, 20033, 20005, 30, 2001, 2001, 1100374, 337, 338, 339, 340, 6021003, 2, 4, 10, 10002011, 3, 6021004, 3, 5, 20, 10002012, 3, 6021005, 4, 6, 35, 10002013, 3, 6021007, 5, 7, 45, 10003015, 3),
(120210, 20033, 20005, 34, 2001, 2001, 1100374, 337, 338, 339, 340, 8030621, 2, 4, 45, 10005025, 3, 8030621, 3, 5, 45, 10005025, 3, 8030623, 4, 6, 50, 10005033, 3, 8030623, 5, 7, 50, 10005033, 3),
(120211, 20033, 20005, 29, 2001, 2001, 1100374, 337, 338, 339, 340, 4100604, 2, 4, 5, 10008203, 3, 4100605, 3, 5, 15, 10008205, 3, 4100110, 4, 6, 25, 10008207, 3, 4100111, 5, 7, 45, 10008216, 3),
(120212, 20033, 20005, 29, 2001, 2001, 1100374, 337, 338, 339, 340, 5030107, 2, 4, 15, 10008004, 3, 5030207, 3, 5, 25, 10008008, 3, 5030208, 4, 6, 35, 10008008, 3, 5030109, 5, 7, 40, 10008011, 3),
(120213, 20033, 20004, 29, 2001, 2001, 1100374, 337, 338, 339, 340, 4070204, 2, 4, 5, 10008203, 3, 4070208, 3, 5, 20, 10008205, 3, 4070212, 4, 6, 35, 10008211, 3, 4070213, 5, 7, 50, 10008214, 3),
(120214, 20033, 20005, 33, 2001, 2001, 1100374, 337, 338, 339, 340, 9010054, 2, 4, 5, 10007101, 3, 9010055, 3, 5, 15, 10007104, 3, 9010056, 4, 6, 25, 10007126, 3, 9010057, 5, 7, 40, 10007116, 3),
(120215, 20033, 20005, 33, 2001, 2001, 1100374, 337, 338, 339, 340, 10007104, 2, 4, 10, 10007003, 3, 10007126, 3, 5, 15, 10007016, 3, 10007116, 4, 6, 30, 10007018, 3, 10007127, 5, 7, 45, 10007020, 3),
(120216, 20033, 20004, 33, 2001, 2001, 1100374, 337, 338, 339, 340, 9040057, 2, 4, 15, 10007104, 3, 9040058, 3, 5, 25, 10007126, 3, 9040059, 4, 6, 35, 10007116, 3, 9040060, 5, 7, 45, 10007127, 3),
(120217, 20033, 20005, 31, 2001, 2001, 1100374, 337, 338, 339, 340, 8080819, 2, 4, 20, 10002012, 3, 8080821, 3, 5, 30, 10002023, 2, 8080823, 4, 6, 45, 10003025, 2, 8080825, 5, 7, 50, 10002024, 2),
(120218, 20033, 20005, 32, 2001, 2001, 1100374, 337, 338, 339, 340, 9010027, 2, 4, 15, 10003012, 3, 9010052, 3, 5, 30, 10006005, 3, 9010038, 4, 6, 40, 10003015, 3, 9010037, 5, 7, 40, 10003015, 3),
(120219, 20033, 20005, 35, 2001, 2001, 1100374, 337, 338, 339, 340, 3020102, 8, 4, 35, 10009507, 4, 3020102, 12, 5, 35, 10009507, 4, 3020519, 12, 6, 35, 10006010, 12, 3020519, 15, 7, 35, 10006010, 12),
(120220, 20033, 20005, 36, 2001, 2001, 1500110, 341, 342, 343, 344, 3010208, 6, 4, 35, 3011530, 12, 3010203, 15, 5, 20, 3010603, 12, 3010207, 16, 6, 25, 3011527, 3, 3010211, 10, 7, 50, 3011016, 3),
(120221, 20034, 20005, 30, 2001, 2017, 1100050, 181, 183, 184, 182, 7010004, 2, 4, 5, 10002011, 3, 6050012, 3, 5, 30, 10002012, 3, 7010010, 4, 6, 25, 10002012, 3, 6050014, 5, 7, 40, 10003015, 3),
(120222, 20034, 20005, 34, 2001, 2017, 1100050, 181, 183, 184, 182, 8070320, 2, 4, 1, 10005001, 3, 8070416, 3, 5, 5, 10005001, 3, 8070322, 4, 6, 15, 10005005, 3, 8070418, 5, 7, 20, 10005005, 3),
(120223, 20034, 20005, 29, 2001, 2017, 1100050, 181, 183, 184, 182, 4070006, 2, 4, 5, 10008203, 3, 4070009, 3, 5, 10, 10008203, 3, 4070011, 4, 6, 20, 10008204, 3, 4070104, 5, 7, 35, 10008205, 3),
(120224, 20034, 20005, 33, 2001, 2017, 1100050, 181, 183, 184, 182, 8070911, 2, 4, 20, 10007126, 3, 8070913, 3, 5, 30, 10007113, 3, 8070720, 4, 6, 45, 10007116, 3, 8070722, 5, 7, 50, 10007116, 3),
(120225, 20034, 20005, 31, 2001, 2017, 1100050, 181, 183, 184, 182, 4100709, 2, 4, 5, 10002021, 2, 8070606, 3, 5, 10, 10002021, 2, 5020306, 4, 6, 15, 10002011, 3, 8090105, 5, 7, 40, 10002023, 2),
(120226, 20034, 20005, 32, 2001, 2017, 1100050, 181, 183, 184, 182, 4020005, 2, 4, 5, 10006001, 3, 4020005, 3, 5, 5, 10006001, 3, 4020005, 4, 6, 5, 10006001, 3, 4020207, 5, 7, 15, 10003012, 3),
(120227, 20034, 20005, 35, 2001, 2017, 1100050, 181, 183, 184, 182, 10009208, 2, 4, 30, 10009502, 2, 10009206, 3, 5, 5, 3011407, 2, 10009207, 4, 6, 15, 3011011, 2, 10009207, 10, 7, 30, 3011117, 2),
(120228, 20034, 20005, 36, 2001, 2017, 1100050, 181, 183, 184, 182, 3010102, 12, 4, 1, 3011205, 3, 3010104, 15, 5, 15, 3011213, 3, 3010107, 12, 6, 30, 3011217, 3, 3010110, 10, 7, 45, 3011121, 3),
(120229, 20034, 20005, 29, 2001, 2021, 1600205, 185, 187, 188, 186, 5030029, 2, 4, 35, 10008109, 3, 5030031, 3, 5, 45, 10008112, 3, 5030209, 4, 6, 45, 10008016, 3, 5030035, 5, 7, 50, 10008115, 3),
(120230, 20034, 20005, 33, 2001, 2021, 1600205, 185, 187, 188, 186, 8031033, 2, 4, 45, 10007116, 3, 8031036, 3, 5, 45, 10007116, 3, 8031039, 4, 6, 45, 10007116, 3, 8031026, 5, 7, 50, 10007127, 3),
(120231, 20034, 20005, 30, 2001, 2021, 1600205, 185, 187, 188, 186, 6020012, 2, 4, 40, 10002013, 3, 6010014, 3, 5, 40, 10003015, 3, 7010013, 4, 6, 50, 10002015, 3, 6010015, 5, 7, 50, 10002015, 3),
(120232, 20034, 20005, 34, 2001, 2021, 1600205, 185, 187, 188, 186, 8070324, 2, 4, 45, 10005025, 3, 8070420, 3, 5, 45, 10005025, 3, 8070328, 4, 6, 50, 10005033, 3, 8070424, 5, 7, 50, 10005033, 3),
(120233, 20034, 20005, 31, 2001, 2033, 1200093, 197, 199, 200, 198, 8031609, 2, 4, 20, 10002022, 2, 8030320, 3, 5, 35, 10002053, 3, 8030109, 4, 6, 40, 10002023, 2, 8031610, 5, 7, 45, 10002013, 3),
(120234, 20034, 20005, 32, 2001, 2021, 1600205, 185, 187, 188, 186, 4020006, 2, 4, 35, 10006106, 3, 4020006, 3, 5, 35, 10006106, 3, 4020008, 4, 6, 45, 10006115, 3, 4020008, 5, 7, 45, 10006115, 3),
(120235, 20034, 20005, 35, 2001, 2033, 1200093, 197, 199, 200, 198, 10009208, 2, 4, 30, 10009502, 2, 10009207, 6, 5, 30, 3011117, 2, 10009207, 8, 6, 30, 3011117, 2, 10009208, 5, 7, 30, 10009502, 2),
(120236, 20034, 20005, 36, 2001, 2021, 1600205, 185, 187, 188, 186, 3010507, 4, 4, 40, 3011304, 6, 3010113, 12, 5, 25, 3011207, 3, 3010508, 8, 6, 45, 3011227, 3, 3010110, 10, 7, 45, 3011121, 3),
(120237, 20034, 20005, 29, 2001, 2025, 1400069, 189, 191, 192, 190, 4030706, 2, 4, 10, 10008205, 3, 4030707, 3, 5, 30, 10008204, 3, 4030708, 4, 6, 35, 10008207, 3, 4030709, 5, 7, 45, 10008211, 3),
(120238, 20034, 20005, 33, 2001, 2025, 1400069, 189, 191, 192, 190, 8031514, 2, 4, 10, 10007104, 3, 8031514, 3, 5, 10, 10007104, 3, 8031516, 4, 6, 40, 10007116, 3, 8031518, 5, 7, 45, 10007125, 3),
(120239, 20034, 20005, 30, 2001, 2025, 1400069, 189, 191, 192, 190, 4040103, 2, 4, 10, 10002011, 3, 4040304, 3, 5, 30, 10002013, 3, 4020307, 4, 6, 40, 10003015, 3, 4040207, 5, 7, 50, 10002015, 3),
(120240, 20034, 20005, 34, 2001, 2025, 1400069, 189, 191, 192, 190, 8070322, 2, 4, 15, 10005005, 3, 8070418, 3, 5, 20, 10005005, 3, 8071116, 4, 6, 30, 10005015, 3, 8071119, 5, 7, 40, 10005020, 3),
(120241, 20034, 20005, 31, 2001, 2025, 1400069, 189, 191, 192, 190, 8011106, 2, 4, 10, 10002021, 2, 8011404, 3, 5, 20, 10002022, 2, 8010005, 4, 6, 40, 10002023, 2, 8011406, 5, 7, 45, 10003025, 2),
(120242, 20034, 20005, 32, 2001, 2025, 1400069, 189, 191, 192, 190, 4020207, 2, 4, 15, 10003012, 3, 4020207, 3, 5, 15, 10003012, 3, 4020006, 4, 6, 35, 10006106, 3, 4020008, 5, 7, 45, 10006115, 3),
(120243, 20034, 20005, 35, 2001, 2025, 1400069, 189, 191, 192, 190, 3020002, 8, 4, 20, 10009611, 2, 3020522, 9, 5, 25, 10009210, 4, 3020201, 4, 6, 50, 10009508, 2, 3020515, 20, 7, 15, 10006104, 2),
(120244, 20034, 20005, 36, 2001, 2025, 1400069, 189, 191, 192, 190, 3010104, 10, 4, 15, 3011213, 3, 3010115, 12, 5, 25, 3011209, 3, 3010109, 8, 6, 40, 3011016, 3, 3010110, 10, 7, 45, 3011121, 3),
(120245, 20034, 20005, 29, 2001, 2029, 1900111, 193, 195, 196, 194, 5030030, 2, 4, 45, 10008112, 3, 5030032, 3, 5, 45, 10008112, 3, 5030033, 4, 6, 50, 10008115, 3, 5030034, 5, 7, 50, 10008115, 3),
(120246, 20034, 20005, 33, 2001, 2029, 1900111, 193, 195, 196, 194, 8031022, 2, 4, 45, 10007116, 3, 8031046, 3, 5, 50, 10007127, 3, 8031050, 4, 6, 50, 10007127, 3, 8031054, 5, 7, 50, 10007127, 3),
(120247, 20034, 20005, 29, 2001, 2033, 1200093, 197, 199, 200, 198, 4080406, 2, 4, 25, 10008205, 3, 4070306, 3, 5, 30, 10008205, 3, 4070307, 4, 6, 40, 10008211, 3, 4080407, 5, 7, 50, 10008214, 3),
(120248, 20034, 20005, 33, 2001, 2033, 1200093, 197, 199, 200, 198, 8031516, 2, 4, 40, 10007116, 3, 8031518, 3, 5, 45, 10007125, 3, 8031520, 4, 6, 50, 10007116, 3, 8031520, 5, 7, 50, 10007116, 3),
(120401, 20033, 20005, 30, 3051, 3011, 1200106, 369, 370, 371, 372, 4030110, 2, 4, 1, 6020004, 1, 4030110, 3, 5, 1, 8032501, 1, 4030110, 4, 6, 1, 8070320, 1, 4030110, 5, 7, 1, 8080615, 1),
(120402, 20033, 20005, 34, 3051, 3011, 1200106, 369, 370, 371, 372, 8050220, 2, 4, 1, 6060008, 1, 8050220, 3, 5, 1, 8032501, 1, 8050220, 4, 6, 1, 8070320, 1, 8050220, 5, 7, 1, 8080615, 1),
(120403, 20033, 20005, 29, 3051, 3011, 1200106, 369, 370, 371, 372, 10008203, 2, 4, 1, 6010009, 1, 10008203, 3, 5, 1, 8032501, 1, 10008203, 4, 6, 1, 8070320, 1, 10008203, 5, 7, 1, 8080615, 1),
(120404, 20033, 20005, 33, 3051, 3011, 1200106, 369, 370, 371, 372, 8080615, 2, 4, 1, 6050009, 1, 8080615, 3, 5, 1, 8032501, 1, 8080615, 4, 6, 1, 8070320, 1, 8080615, 5, 7, 1, 8080615, 1),
(120405, 20033, 20005, 31, 3051, 3011, 1200106, 369, 370, 371, 372, 10002071, 6, 4, 1, 6030009, 1, 10002071, 9, 5, 1, 8032501, 1, 10002071, 12, 6, 1, 8070320, 1, 10002071, 15, 7, 1, 8080615, 1),
(120406, 20033, 20005, 32, 3051, 3011, 1200106, 369, 370, 371, 372, 9050052, 2, 4, 1, 6040009, 1, 9050052, 3, 5, 1, 8032501, 1, 9050052, 4, 6, 1, 8070320, 1, 9050052, 5, 7, 1, 8080615, 1),
(120407, 20033, 20005, 35, 3051, 3011, 1200106, 369, 370, 371, 372, 3011529, 24, 4, 1, 6070009, 1, 3011529, 36, 5, 1, 8032501, 1, 3011529, 48, 6, 1, 8070320, 1, 3011529, 60, 7, 1, 8080615, 1),
(120408, 20033, 20005, 36, 3051, 3011, 1200106, 369, 370, 371, 372, 3010201, 12, 4, 1, 6080009, 1, 3010201, 18, 5, 1, 8032501, 1, 3010201, 24, 6, 1, 8070320, 1, 3010201, 30, 7, 1, 8080615, 1),
(120409, 20033, 20005, 30, 3051, 3509, 1600214, 357, 358, 359, 360, 4030203, 2, 4, 20, 10002012, 3, 4030008, 3, 5, 25, 10002012, 3, 4030304, 4, 6, 30, 10002013, 3, 4030204, 5, 7, 45, 10002015, 3),
(120410, 20033, 20005, 34, 3051, 3509, 1600214, 357, 358, 359, 360, 8050609, 2, 4, 5, 10005001, 3, 8050611, 3, 5, 25, 10005005, 3, 8050613, 4, 6, 45, 10005025, 3, 8050615, 5, 7, 50, 10005033, 3),
(120411, 20033, 20005, 34, 3051, 3509, 1600214, 357, 358, 359, 360, 8050712, 2, 4, 25, 10005015, 3, 8050716, 3, 5, 35, 10005020, 3, 8050741, 4, 6, 35, 10005020, 3, 8050720, 5, 7, 40, 10005025, 3),
(120412, 20033, 20004, 34, 3051, 3509, 1600214, 357, 358, 359, 360, 8050120, 2, 4, 35, 10005015, 3, 8050125, 3, 5, 40, 10005020, 3, 8050122, 4, 6, 45, 10005025, 3, 8050130, 5, 7, 50, 10005033, 3),
(120413, 20033, 20005, 29, 3051, 3509, 1300033, 353, 354, 355, 356, 8081404, 2, 4, 1, 10008203, 3, 8080320, 3, 5, 45, 10008211, 3, 8080320, 4, 6, 45, 10008211, 3, 8080324, 5, 7, 50, 10008216, 3),
(120414, 20033, 20005, 33, 3051, 3509, 1600214, 357, 358, 359, 360, 8050503, 2, 4, 10, 10007104, 3, 8050509, 3, 5, 40, 10007116, 3, 8050511, 4, 6, 45, 10007125, 3, 8050513, 5, 7, 50, 10007127, 3),
(120415, 20033, 20005, 31, 3051, 3509, 1600214, 357, 358, 359, 360, 4100709, 2, 4, 5, 10002021, 2, 4100307, 3, 5, 25, 10002022, 2, 4100711, 4, 6, 30, 10002023, 2, 4100204, 5, 7, 50, 10002024, 2),
(120416, 20033, 20005, 32, 3051, 3509, 1000213, 349, 350, 351, 352, 5020007, 2, 4, 5, 10003011, 3, 5020008, 3, 5, 15, 10003012, 3, 5020010, 4, 6, 30, 10003013, 3, 5020012, 5, 7, 45, 10003014, 3),
(120417, 20033, 20005, 32, 3051, 3509, 1000213, 349, 350, 351, 352, 9030022, 2, 4, 15, 10003012, 3, 9030048, 3, 5, 35, 10003015, 3, 9030038, 4, 6, 40, 10003015, 3, 9030041, 5, 7, 50, 10003014, 3),
(120418, 20033, 20004, 32, 3051, 3509, 1000213, 349, 350, 351, 352, 9040028, 2, 4, 20, 10003012, 3, 9040035, 3, 5, 30, 10003013, 3, 9040034, 4, 6, 30, 10003013, 3, 9040042, 5, 7, 40, 10003015, 3),
(120419, 20033, 20005, 35, 3051, 3509, 1300033, 353, 354, 355, 356, 10009313, 2, 4, 15, 10007001, 2, 10009302, 36, 5, 5, 10009301, 6, 10009307, 4, 6, 10, 10009306, 4, 10009201, 10, 7, 5, 10009108, 4),
(120420, 20033, 20005, 35, 3051, 3509, 1300033, 353, 354, 355, 356, 10009207, 4, 4, 30, 3011117, 2, 10009208, 3, 5, 30, 10009502, 2, 10009207, 8, 6, 30, 3011117, 2, 10009208, 5, 7, 30, 10009502, 2),
(120421, 20033, 20004, 35, 3051, 3509, 1300033, 353, 354, 355, 356, 3020308, 2, 4, 45, 3011133, 6, 3020303, 6, 5, 45, 10009406, 6, 3020304, 8, 6, 45, 10009606, 6, 3020307, 10, 7, 40, 3011212, 12),
(120422, 20033, 20005, 36, 3051, 3509, 1000213, 349, 350, 351, 352, 3010412, 10, 4, 10, 3011542, 3, 3010211, 6, 5, 50, 3011016, 3, 3010001, 20, 6, 15, 3011003, 3, 3010012, 10, 7, 45, 3011016, 3),
(120423, 20034, 20005, 30, 3051, 3011, 1500060, 201, 203, 204, 202, 7020009, 2, 4, 5, 10002011, 3, 6081005, 3, 5, 20, 10002012, 3, 6071006, 4, 6, 30, 10002013, 3, 6081007, 5, 7, 45, 10003015, 3),
(120424, 20034, 20005, 34, 3051, 3011, 1500060, 201, 203, 204, 202, 10005302, 2, 4, 15, 10005203, 12, 10005307, 3, 5, 25, 10005306, 12, 10005303, 4, 6, 30, 10005204, 12, 10005304, 5, 7, 40, 10005503, 12),
(120425, 20034, 20005, 29, 3051, 3011, 1500060, 201, 203, 204, 202, 4080205, 2, 4, 5, 10008203, 3, 4080206, 3, 5, 15, 10008204, 3, 4080208, 4, 6, 25, 10008207, 3, 4080209, 5, 7, 30, 10008207, 3),
(120426, 20034, 20005, 33, 3051, 3011, 1500060, 201, 203, 204, 202, 8071013, 2, 4, 1, 10007101, 3, 4020107, 3, 5, 5, 10007101, 3, 8030920, 4, 6, 20, 10007126, 3, 9010057, 5, 7, 40, 10007116, 3),
(120427, 20034, 20005, 31, 3051, 3011, 1500060, 201, 203, 204, 202, 6070009, 2, 4, 5, 10002021, 2, 4100504, 3, 5, 15, 10002021, 2, 6070012, 4, 6, 30, 10002013, 3, 6080014, 5, 7, 40, 10002023, 2),
(120428, 20034, 20005, 32, 3051, 3011, 1500060, 201, 203, 204, 202, 10004102, 2, 4, 15, 10004002, 3, 10004106, 3, 5, 15, 10004006, 3, 10004109, 4, 6, 25, 10004009, 3, 10004113, 5, 7, 40, 10004013, 3),
(120429, 20034, 20005, 35, 3051, 3011, 1500060, 201, 203, 204, 202, 3020002, 8, 4, 20, 10009611, 2, 3020525, 9, 5, 25, 10009611, 2, 3020528, 12, 6, 25, 10009507, 4, 3020522, 15, 7, 25, 10009210, 4),
(120430, 20034, 20005, 36, 3051, 3011, 1500060, 201, 203, 204, 202, 3010102, 12, 4, 1, 3011205, 3, 3010019, 6, 5, 40, 3011458, 3, 3010403, 16, 6, 20, 3011453, 3, 3010402, 20, 7, 20, 3011502, 12),
(120431, 20034, 20005, 35, 3051, 3014, 1100072, 205, 207, 208, 206, 3011536, 24, 4, 20, 10009405, 8, 3011536, 36, 5, 20, 10009405, 8, 3011536, 48, 6, 20, 10009405, 8, 3011536, 60, 7, 20, 10009405, 8),
(120432, 20034, 20005, 32, 3051, 3014, 1100072, 205, 207, 208, 206, 9050027, 2, 4, 5, 10003011, 3, 9050028, 3, 5, 15, 10003012, 3, 9050029, 4, 6, 25, 10003013, 3, 9050030, 5, 7, 40, 10003015, 3),
(120433, 20034, 20005, 34, 3051, 3014, 1100072, 205, 207, 208, 206, 10005005, 2, 4, 15, 10005302, 6, 10005015, 3, 5, 25, 10005307, 6, 10005020, 4, 6, 30, 10005303, 6, 10005025, 5, 7, 40, 10005304, 6),
(120434, 20034, 20005, 30, 3051, 3014, 1100072, 205, 207, 208, 206, 4020206, 2, 4, 10, 10002011, 3, 7010104, 3, 5, 20, 10002012, 3, 4020208, 4, 6, 25, 10002012, 3, 7010107, 5, 7, 45, 10003015, 3),
(120435, 20034, 20005, 29, 3051, 3014, 1100072, 205, 207, 208, 206, 4080008, 2, 4, 10, 10008203, 3, 4080304, 3, 5, 30, 10008207, 3, 4080009, 4, 6, 40, 10008207, 3, 4080305, 5, 7, 45, 10008211, 3),
(120436, 20034, 20005, 33, 3051, 3014, 1100072, 205, 207, 208, 206, 4070205, 2, 4, 10, 10007104, 3, 4070210, 3, 5, 25, 10007126, 3, 8030922, 4, 6, 30, 10007113, 3, 8070520, 5, 7, 40, 10007125, 3),
(120437, 20034, 20005, 31, 3051, 3014, 1100072, 205, 207, 208, 206, 8070606, 2, 4, 10, 10002021, 2, 8070218, 3, 5, 20, 10002022, 2, 8070109, 4, 6, 40, 10002023, 2, 8070610, 5, 7, 50, 10002024, 2),
(120438, 20034, 20005, 36, 3051, 3014, 1100072, 205, 207, 208, 206, 3010019, 4, 4, 40, 3011458, 3, 3010306, 9, 5, 35, 3011512, 3, 3010206, 16, 6, 20, 3011524, 12, 3010208, 15, 7, 35, 3011530, 12),
(120439, 20034, 20005, 35, 3051, 3018, 1600028, 209, 211, 212, 210, 3020409, 4, 4, 50, 10009508, 2, 3020003, 6, 5, 40, 10009402, 2, 3020404, 8, 6, 40, 10009606, 6, 3020403, 20, 7, 15, 10009406, 6),
(120440, 20034, 20005, 32, 3051, 3018, 1600028, 209, 211, 212, 210, 8010419, 2, 4, 15, 10003012, 3, 8010423, 3, 5, 15, 10003012, 3, 8010440, 4, 6, 30, 10003013, 3, 8010442, 5, 7, 30, 10003013, 3),
(120441, 20034, 20005, 34, 3051, 3018, 1600028, 209, 211, 212, 210, 8030717, 2, 4, 25, 10005015, 3, 8030728, 3, 5, 25, 10005015, 3, 8030730, 4, 6, 25, 10005015, 3, 8030720, 5, 7, 35, 10005020, 3),
(120442, 20034, 20005, 30, 3051, 3018, 1600028, 209, 211, 212, 210, 6051005, 2, 4, 20, 10002012, 3, 6031006, 3, 5, 35, 10002013, 3, 6051007, 4, 6, 45, 10003015, 3, 6030015, 5, 7, 50, 10002015, 3),
(120443, 20034, 20005, 29, 3051, 3018, 1600028, 209, 211, 212, 210, 4080104, 2, 4, 20, 10008203, 3, 4080105, 3, 5, 35, 10008207, 3, 4080106, 4, 6, 40, 10008211, 3, 4080210, 5, 7, 50, 10008216, 3),
(120444, 20034, 20005, 33, 3051, 3018, 1600028, 209, 211, 212, 210, 4020108, 2, 4, 20, 10007104, 3, 4100007, 3, 5, 30, 10007126, 3, 8071204, 4, 6, 35, 10007116, 3, 8050809, 5, 7, 45, 10007116, 3),
(120445, 20034, 20005, 31, 3051, 3018, 1600028, 209, 211, 212, 210, 6080011, 2, 4, 25, 10002022, 2, 8090804, 3, 5, 35, 10002023, 2, 8080109, 4, 6, 40, 10002023, 2, 8070224, 5, 7, 50, 10002024, 2),
(120446, 20034, 20005, 36, 3051, 3018, 1600028, 209, 211, 212, 210, 3010402, 8, 4, 20, 3011502, 12, 3010008, 6, 5, 40, 3011002, 3, 3010011, 12, 6, 35, 3011004, 3, 3010208, 15, 7, 35, 3011530, 12),
(120447, 20034, 20005, 35, 3051, 3022, 2200114, 213, 215, 216, 214, 3020526, 4, 4, 40, 10007024, 2, 3020517, 6, 5, 45, 10006015, 2, 3020103, 8, 6, 50, 10009508, 2, 3020514, 10, 7, 50, 10006005, 2),
(120448, 20034, 20005, 32, 3051, 3022, 2200114, 213, 215, 216, 214, 9050054, 2, 4, 45, 10006110, 3, 9050031, 3, 5, 50, 10003014, 3, 9050046, 4, 6, 50, 10003014, 3, 9050051, 5, 7, 50, 10003014, 3),
(120449, 20034, 20005, 34, 3051, 3022, 2200114, 213, 215, 216, 214, 10005025, 2, 4, 40, 10005304, 6, 10005025, 3, 5, 40, 10005304, 6, 10005033, 4, 6, 40, 10005504, 12, 10005033, 5, 7, 40, 10005504, 12),
(120450, 20034, 20005, 35, 3051, 3026, 1300070, 217, 219, 220, 218, 3020405, 6, 4, 30, 10009401, 6, 3020201, 3, 5, 50, 10009508, 2, 3020407, 8, 6, 35, 3011212, 8, 3020408, 10, 7, 45, 3011133, 6),
(120451, 20034, 20005, 32, 3051, 3026, 1300070, 217, 219, 220, 218, 8010446, 2, 4, 40, 10003015, 3, 8010447, 3, 5, 40, 10003015, 3, 8010449, 4, 6, 50, 10003014, 3, 8010454, 5, 7, 50, 10003014, 3),
(120452, 20034, 20005, 34, 3051, 3026, 1300070, 217, 219, 220, 218, 8030734, 2, 4, 35, 10005020, 3, 8030736, 3, 5, 35, 10005020, 3, 8030723, 4, 6, 40, 10005025, 3, 8030741, 5, 7, 40, 10005025, 3);
/*!40000 ALTER TABLE `gamedata_passivegl_craft` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

File diff suppressed because it is too large Load Diff

View File

@@ -363,7 +363,7 @@ namespace Meteor.Map.Actors
return packets; return packets;
} }
public override bool Equals(Object obj) public override bool Equals(object obj)
{ {
Actor actorObj = obj as Actor; Actor actorObj = obj as Actor;
if (actorObj == null) if (actorObj == null)
@@ -508,7 +508,7 @@ namespace Meteor.Map.Actors
.Replace("Object", "Obj") .Replace("Object", "Obj")
.Replace("Retainer", "Rtn") .Replace("Retainer", "Rtn")
.Replace("Standard", "Std"); .Replace("Standard", "Std");
className = Char.ToLowerInvariant(className[0]) + className.Substring(1); className = char.ToLowerInvariant(className[0]) + className.Substring(1);
//Format Zone Name //Format Zone Name
string zoneName = zone.zoneName.Replace("Field", "Fld") string zoneName = zone.zoneName.Replace("Field", "Fld")
@@ -524,7 +524,7 @@ namespace Meteor.Map.Actors
//Check if "normal" //Check if "normal"
zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P"; zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P";
} }
zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1); zoneName = char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1);
try try
{ {
@@ -542,7 +542,7 @@ namespace Meteor.Map.Actors
if (zone is PrivateArea) if (zone is PrivateArea)
privLevel = ((PrivateArea)zone).GetPrivateAreaType(); privLevel = ((PrivateArea)zone).GetPrivateAreaType();
actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); actorName = string.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel);
} }
public bool SetWorkValue(Player player, string name, string uiFunc, object value) public bool SetWorkValue(Player player, string name, string uiFunc, object value)
@@ -553,8 +553,8 @@ namespace Meteor.Map.Actors
if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork"))) if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork")))
return false; return false;
Object parentObj = null; object parentObj = null;
Object curObj = this; object curObj = this;
for (int i = 0; i < split.Length; i++) for (int i = 0; i < split.Length; i++)
{ {
//For arrays //For arrays
@@ -759,7 +759,7 @@ namespace Meteor.Map.Actors
{ {
if (target == null) if (target == null)
{ {
Program.Log.Error(String.Format("[{0} {1}] FindRandomPointAroundTarget: no target found!", this.actorId, this.customDisplayName)); Program.Log.Error(string.Format("[{0} {1}] FindRandomPointAroundTarget: no target found!", this.actorId, this.customDisplayName));
return GetPosAsVector3(); return GetPosAsVector3();
} }
return FindRandomPoint(target.positionX, target.positionY, target.positionZ, minRadius, maxRadius); return FindRandomPoint(target.positionX, target.positionY, target.positionZ, minRadius, maxRadius);

View File

@@ -48,7 +48,7 @@ namespace Meteor.Map.Actors
protected int halfWidth, halfHeight; protected int halfWidth, halfHeight;
private Dictionary<uint, Director> currentDirectors = new Dictionary<uint, Director>(); private Dictionary<uint, Director> currentDirectors = new Dictionary<uint, Director>();
private Object directorLock = new Object(); private object directorLock = new object();
private uint directorIdCount = 0; private uint directorIdCount = 0;
protected Director mWeatherDirector; protected Director mWeatherDirector;
@@ -77,7 +77,7 @@ namespace Meteor.Map.Actors
this.displayNameId = 0; this.displayNameId = 0;
this.customDisplayName = "_areaMaster"; this.customDisplayName = "_areaMaster";
this.actorName = String.Format("_areaMaster@{0:X5}", id << 8); this.actorName = string.Format("_areaMaster@{0:X5}", id << 8);
this.classPath = classPath; this.classPath = classPath;
this.className = classPath.Substring(classPath.LastIndexOf("/") + 1); this.className = classPath.Substring(classPath.LastIndexOf("/") + 1);
@@ -611,7 +611,7 @@ namespace Meteor.Map.Actors
public Director CreateGuildleveDirector(uint glid, byte difficulty, Player owner, params object[] args) public Director CreateGuildleveDirector(uint glid, byte difficulty, Player owner, params object[] args)
{ {
String directorScriptPath = ""; string directorScriptPath = "";
uint type = Server.GetGuildleveGamedata(glid).plateId; uint type = Server.GetGuildleveGamedata(glid).plateId;
@@ -677,6 +677,11 @@ namespace Meteor.Map.Actors
return null; return null;
} }
public ushort GetCurrentMusic()
{
return bgmDay;
}
public override void Update(DateTime tick) public override void Update(DateTime tick)
{ {
lock (mActorList) lock (mActorList)
@@ -691,6 +696,5 @@ namespace Meteor.Map.Actors
} }
} }
} }
} }
} }

View File

@@ -32,7 +32,7 @@ namespace Meteor.Map.actors.area
private Director currentDirector; private Director currentDirector;
private bool isContentFinished = false; private bool isContentFinished = false;
public static PrivateAreaContent CreateContentArea(String scriptPath) public static PrivateAreaContent CreateContentArea(string scriptPath)
{ {
return null; return null;
} }

View File

@@ -33,14 +33,14 @@ namespace Meteor.Map.actors.area
{ {
Dictionary<string, Dictionary<uint, PrivateArea>> privateAreas = new Dictionary<string, Dictionary<uint, PrivateArea>>(); Dictionary<string, Dictionary<uint, PrivateArea>> privateAreas = new Dictionary<string, Dictionary<uint, PrivateArea>>();
Dictionary<string, List<PrivateAreaContent>> contentAreas = new Dictionary<string, List<PrivateAreaContent>>(); Dictionary<string, List<PrivateAreaContent>> contentAreas = new Dictionary<string, List<PrivateAreaContent>>();
Object contentAreasLock = new Object(); object contentAreasLock = new object();
public SharpNav.TiledNavMesh tiledNavMesh; public SharpNav.TiledNavMesh tiledNavMesh;
public SharpNav.NavMeshQuery navMeshQuery; public SharpNav.NavMeshQuery navMeshQuery;
public Int64 pathCalls; public long pathCalls;
public Int64 prevPathCalls = 0; public long prevPathCalls = 0;
public Int64 pathCallTime; public long pathCallTime;
public Zone(uint id, string zoneName, ushort regionId, string classPath, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool isIsolated, bool isInn, bool canRideChocobo, bool canStealth, bool isInstanceRaid, bool loadNavMesh = false) public Zone(uint id, string zoneName, ushort regionId, string classPath, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool isIsolated, bool isInn, bool canRideChocobo, bool canStealth, bool isInstanceRaid, bool loadNavMesh = false)
: base(id, zoneName, regionId, classPath, bgmDay, bgmNight, bgmBattle, isIsolated, isInn, canRideChocobo, canStealth, isInstanceRaid) : base(id, zoneName, regionId, classPath, bgmDay, bgmNight, bgmBattle, isIsolated, isInn, canRideChocobo, canStealth, isInstanceRaid)

View File

@@ -152,7 +152,7 @@ namespace Meteor.Map.Actors
public uint extraUint; public uint extraUint;
public float extraFloat; public float extraFloat;
protected Dictionary<string, UInt64> tempVars = new Dictionary<string, UInt64>(); protected Dictionary<string, ulong> tempVars = new Dictionary<string, ulong>();
//Inventory //Inventory
protected Dictionary<ushort, ItemPackage> itemPackages = new Dictionary<ushort, ItemPackage>(); protected Dictionary<ushort, ItemPackage> itemPackages = new Dictionary<ushort, ItemPackage>();
@@ -227,8 +227,8 @@ namespace Meteor.Map.Actors
{ {
if (!effect.GetHidden()) if (!effect.GetHidden())
{ {
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i));
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i));
i++; i++;
} }
} }
@@ -908,9 +908,9 @@ namespace Meteor.Map.Actors
AddTP((int)Math.Ceiling(tpModifier * action.amount)); AddTP((int)Math.Ceiling(tpModifier * action.amount));
} }
public UInt64 GetTempVar(string name) public ulong GetTempVar(string name)
{ {
UInt64 retVal = 0; ulong retVal = 0;
if (tempVars.TryGetValue(name, out retVal)) if (tempVars.TryGetValue(name, out retVal))
return retVal; return retVal;
return 0; return 0;
@@ -923,7 +923,7 @@ namespace Meteor.Map.Actors
tempVars[name] = val; tempVars[name] = val;
} }
public void SetTempVar(string name, UInt64 val) public void SetTempVar(string name, ulong val)
{ {
if (tempVars.ContainsKey(name)) if (tempVars.ContainsKey(name))
tempVars[name] = val; tempVars[name] = val;
@@ -994,7 +994,7 @@ namespace Meteor.Map.Actors
{ {
shouldSend = true; shouldSend = true;
charaWork.battleTemp.timingCommandFlag[i] = false; charaWork.battleTemp.timingCommandFlag[i] = false;
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.timingCommandFlag[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.timingCommandFlag[{0}]", i));
} }
} }
@@ -1025,7 +1025,7 @@ namespace Meteor.Map.Actors
if (this is Player) if (this is Player)
{ {
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/timingCommand", this); var propPacketUtil = new ActorPropertyPacketUtil("charaWork/timingCommand", this);
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.timingCommandFlag[{0}]", procId)); propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.timingCommandFlag[{0}]", procId));
((Player)this).QueuePackets(propPacketUtil.Done()); ((Player)this).QueuePackets(propPacketUtil.Done());
} }
} }
@@ -1182,6 +1182,35 @@ namespace Meteor.Map.Actors
return targetFind.GetTargets(); return targetFind.GetTargets();
} }
public void GraphicChange(uint slot, uint graphicId)
{
appearanceIds[slot] = graphicId;
}
public void GraphicChange(uint slot, uint weapId, uint equipId, uint variantId, uint colorId)
{
uint mixedVariantId;
if (weapId == 0)
mixedVariantId = ((variantId & 0x1F) << 5) | colorId;
else
mixedVariantId = variantId;
uint graphicId =
(weapId & 0x3FF) << 20 |
(equipId & 0x3FF) << 10 |
(mixedVariantId & 0x3FF);
appearanceIds[slot] = graphicId;
}
public void SendAppearance()
{
zone.BroadcastPacketAroundActor(this, CreateAppearancePacket());
}
#region Inventory #region Inventory
public void SendItemPackage(Player player, uint id) public void SendItemPackage(Player player, uint id)
{ {

View File

@@ -26,7 +26,7 @@ namespace Meteor.Map.actors.chara
//These will need to be redone at some point. remember to update tables in db. //These will need to be redone at some point. remember to update tables in db.
//Consider using text_paramname sheet. that matches up with the stats on armor, but some things will need special handling //Consider using text_paramname sheet. that matches up with the stats on armor, but some things will need special handling
//Also, 0-35 should probably match with up BattleTemp //Also, 0-35 should probably match with up BattleTemp
enum Modifier : UInt32 enum Modifier : uint
{ {
//These line up with ParamNames starting at 15001 and appear on gear //These line up with ParamNames starting at 15001 and appear on gear
//Health //Health

View File

@@ -27,9 +27,9 @@ namespace Meteor.Map.actors.chara
class ModifierListEntry class ModifierListEntry
{ {
public uint id; public uint id;
public Int64 value; public long value;
public ModifierListEntry(uint id, Int64 value) public ModifierListEntry(uint id, long value)
{ {
this.id = id; this.id = id;
this.value = value; this.value = value;
@@ -47,13 +47,13 @@ namespace Meteor.Map.actors.chara
mobModList = new Dictionary<uint, ModifierListEntry>(); mobModList = new Dictionary<uint, ModifierListEntry>();
} }
public void AddModifier(uint id, Int64 val, bool isMobMod) public void AddModifier(uint id, long val, bool isMobMod)
{ {
var list = isMobMod ? mobModList : modList; var list = isMobMod ? mobModList : modList;
list.Add(id, new ModifierListEntry(id, val)); list.Add(id, new ModifierListEntry(id, val));
} }
public void SetModifier(uint id, Int64 val, bool isMobMod) public void SetModifier(uint id, long val, bool isMobMod)
{ {
var list = isMobMod ? mobModList : modList; var list = isMobMod ? mobModList : modList;
if (list.ContainsKey(id)) if (list.ContainsKey(id))
@@ -62,7 +62,7 @@ namespace Meteor.Map.actors.chara
list.Add(id, new ModifierListEntry(id, val)); list.Add(id, new ModifierListEntry(id, val));
} }
public Int64 GetModifier(uint id, bool isMobMod) public long GetModifier(uint id, bool isMobMod)
{ {
ModifierListEntry retVal; ModifierListEntry retVal;
var list = isMobMod ? mobModList : modList; var list = isMobMod ? mobModList : modList;

View File

@@ -83,7 +83,7 @@ namespace Meteor.Map.Actors
public ModifierList genusMods; public ModifierList genusMods;
public ModifierList spawnMods; public ModifierList spawnMods;
protected Dictionary<MobModifier, Int64> mobModifiers = new Dictionary<MobModifier, Int64>(); protected Dictionary<MobModifier, long> mobModifiers = new Dictionary<MobModifier, long>();
public BattleNpc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot, public BattleNpc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot,
ushort actorState, uint animationId, string customDisplayName) ushort actorState, uint animationId, string customDisplayName)
@@ -320,7 +320,7 @@ namespace Meteor.Map.Actors
} }
else else
{ {
var err = String.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, GetZone().GetName()); var err = string.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, GetZone().GetName());
Program.Log.Error(err); Program.Log.Error(err);
//throw new Exception(err); //throw new Exception(err);
} }
@@ -434,20 +434,20 @@ namespace Meteor.Map.Actors
this.bnpcId = id; this.bnpcId = id;
} }
public Int64 GetMobMod(MobModifier mobMod) public long GetMobMod(MobModifier mobMod)
{ {
return GetMobMod((uint)mobMod); return GetMobMod((uint)mobMod);
} }
public Int64 GetMobMod(uint mobModId) public long GetMobMod(uint mobModId)
{ {
Int64 res; long res;
if (mobModifiers.TryGetValue((MobModifier)mobModId, out res)) if (mobModifiers.TryGetValue((MobModifier)mobModId, out res))
return res; return res;
return 0; return 0;
} }
public void SetMobMod(uint mobModId, Int64 val) public void SetMobMod(uint mobModId, long val)
{ {
if (mobModifiers.ContainsKey((MobModifier)mobModId)) if (mobModifiers.ContainsKey((MobModifier)mobModId))
mobModifiers[(MobModifier)mobModId] = val; mobModifiers[(MobModifier)mobModId] = val;

View File

@@ -81,7 +81,7 @@ namespace Meteor.Map.Actors
LoadNpcAppearance(actorClass.actorClassId); LoadNpcAppearance(actorClass.actorClassId);
className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1); className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1);
this.classPath = String.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className); this.classPath = string.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className);
charaWork.battleSave.potencial = 1.0f; charaWork.battleSave.potencial = 1.0f;
@@ -109,8 +109,8 @@ namespace Meteor.Map.Actors
isMapObj = false; isMapObj = false;
else else
{ {
layout = (uint)(Int32)lParams[4].value; layout = (uint)(int)lParams[4].value;
instance = (uint)(Int32)lParams[5].value; instance = (uint)(int)lParams[5].value;
isStatic = true; isStatic = true;
} }
} }
@@ -236,7 +236,7 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.property.Length; i++) for (int i = 0; i < charaWork.property.Length; i++)
{ {
if (charaWork.property[i] != 0) if (charaWork.property[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.property[{0}]", i));
} }
//Parameters //Parameters
@@ -261,14 +261,14 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.statusShownTime.Length; i++) for (int i = 0; i < charaWork.statusShownTime.Length; i++)
{ {
if (charaWork.statusShownTime[i] != 0) if (charaWork.statusShownTime[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i));
} }
//General Parameters //General Parameters
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++) for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
{ {
if (charaWork.battleTemp.generalParameter[i] != 0) if (charaWork.battleTemp.generalParameter[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i));
} }
propPacketUtil.AddProperty("npcWork.hateType"); propPacketUtil.AddProperty("npcWork.hateType");
@@ -302,7 +302,7 @@ namespace Meteor.Map.Actors
public void LoadNpcAppearance(uint id) public void LoadNpcAppearance(uint id)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {

View File

@@ -39,7 +39,7 @@ namespace Meteor.Map.actors.chara.npc
{ {
this.retainerId = retainerId; this.retainerId = retainerId;
this.ownerPlayer = player; this.ownerPlayer = player;
this.actorName = String.Format("_rtnre{0:x7}", actorId); this.actorName = string.Format("_rtnre{0:x7}", actorId);
itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL); itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL);
itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS); itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS);

View File

@@ -46,6 +46,7 @@ using Meteor.Map.packets.send.actor.battle;
using Meteor.Map.packets.receive.events; using Meteor.Map.packets.receive.events;
using static Meteor.Map.LuaUtils; using static Meteor.Map.LuaUtils;
using Meteor.Map.packets.send.actor.events; using Meteor.Map.packets.send.actor.events;
using Meteor.Map.DataObjects;
namespace Meteor.Map.Actors namespace Meteor.Map.Actors
{ {
@@ -146,7 +147,7 @@ namespace Meteor.Map.Actors
//Quest Actors (MUST MATCH playerWork.questScenario/questGuildleve) //Quest Actors (MUST MATCH playerWork.questScenario/questGuildleve)
public Quest[] questScenario = new Quest[16]; public Quest[] questScenario = new Quest[16];
public uint[] questGuildleve = new uint[8]; public Quest[] questGuildleve = new Quest[8];
//Aetheryte //Aetheryte
public uint homepoint = 0; public uint homepoint = 0;
@@ -161,6 +162,10 @@ namespace Meteor.Map.Actors
public Retainer currentSpawnedRetainer = null; public Retainer currentSpawnedRetainer = null;
public bool sentRetainerSpawn = false; public bool sentRetainerSpawn = false;
//Crafting
public List<Recipe> recentRecipes = new List<Recipe>();
public List<Recipe> awardedRecipes = new List<Recipe>();
private List<Director> ownedDirectors = new List<Director>(); private List<Director> ownedDirectors = new List<Director>();
private Director loginInitDirector = null; private Director loginInitDirector = null;
@@ -173,7 +178,7 @@ namespace Meteor.Map.Actors
public Player(Session cp, uint actorID) : base(actorID) public Player(Session cp, uint actorID) : base(actorID)
{ {
playerSession = cp; playerSession = cp;
actorName = String.Format("_pc{0:00000000}", actorID); actorName = string.Format("_pc{0:00000000}", actorID);
className = "Player"; className = "Player";
moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP; moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP;
@@ -238,7 +243,7 @@ namespace Meteor.Map.Actors
charaWork.command[12] = 0xA0F00000 | 22012; charaWork.command[12] = 0xA0F00000 | 22012;
charaWork.command[13] = 0xA0F00000 | 22013; charaWork.command[13] = 0xA0F00000 | 22013;
charaWork.command[14] = 0xA0F00000 | 29497; charaWork.command[14] = 0xA0F00000 | 29497;
charaWork.command[15] = 0xA0F00000 | 22015; charaWork.command[15] = 0xA0F00000 | 22015;
charaWork.commandAcquired[27150 - 26000] = true; charaWork.commandAcquired[27150 - 26000] = true;
@@ -271,9 +276,22 @@ namespace Meteor.Map.Actors
Database.LoadPlayerCharacter(this); Database.LoadPlayerCharacter(this);
lastPlayTimeUpdate = Utils.UnixTimeStampUTC(); lastPlayTimeUpdate = Utils.UnixTimeStampUTC();
SetSpecialCommands(charaWork.parameterSave.state_mainSkill[0]);
this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this)); this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this));
allegiance = CharacterTargetingAllegiance.Player; allegiance = CharacterTargetingAllegiance.Player;
CalculateBaseStats(); CalculateBaseStats();
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(36));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(37));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(38));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(39));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(40));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(41));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(42));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(43));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(2));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(3));
} }
public List<SubPacket> Create0x132Packets() public List<SubPacket> Create0x132Packets()
@@ -402,7 +420,7 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.property.Length; i++) for (int i = 0; i < charaWork.property.Length; i++)
{ {
if (charaWork.property[i] != 0) if (charaWork.property[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.property[{0}]", i));
} }
//Parameters //Parameters
@@ -418,21 +436,21 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.statusShownTime.Length; i++) for (int i = 0; i < charaWork.statusShownTime.Length; i++)
{ {
if (charaWork.statusShownTime[i] != 0) if (charaWork.statusShownTime[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i));
} }
//General Parameters //General Parameters
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++) for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
{ {
if (charaWork.battleTemp.generalParameter[i] != 0) if (charaWork.battleTemp.generalParameter[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i));
} }
propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[0]"); propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[0]");
propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[1]"); propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[1]");
//Battle Save Skillpoint //Battle Save Skillpoint
propPacketUtil.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", charaWork.parameterSave.state_mainSkill[0] - 1)); propPacketUtil.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", charaWork.parameterSave.state_mainSkill[0] - 1));
//Commands //Commands
propPacketUtil.AddProperty("charaWork.commandBorder"); propPacketUtil.AddProperty("charaWork.commandBorder");
@@ -443,12 +461,12 @@ namespace Meteor.Map.Actors
{ {
if (charaWork.command[i] != 0) if (charaWork.command[i] != 0)
{ {
propPacketUtil.AddProperty(String.Format("charaWork.command[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.command[{0}]", i));
//Recast Timers //Recast Timers
if (i >= charaWork.commandBorder) if (i >= charaWork.commandBorder)
{ {
propPacketUtil.AddProperty(String.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", i - charaWork.commandBorder)); propPacketUtil.AddProperty(string.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", i - charaWork.commandBorder));
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i - charaWork.commandBorder)); propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i - charaWork.commandBorder));
} }
} }
} }
@@ -457,32 +475,32 @@ namespace Meteor.Map.Actors
{ {
charaWork.commandCategory[i] = 1; charaWork.commandCategory[i] = 1;
if (charaWork.commandCategory[i] != 0) if (charaWork.commandCategory[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.commandCategory[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.commandCategory[{0}]", i));
} }
for (int i = 0; i < charaWork.commandAcquired.Length; i++) for (int i = 0; i < charaWork.commandAcquired.Length; i++)
{ {
if (charaWork.commandAcquired[i] != false) if (charaWork.commandAcquired[i] != false)
propPacketUtil.AddProperty(String.Format("charaWork.commandAcquired[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.commandAcquired[{0}]", i));
} }
for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++) for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++)
{ {
if (charaWork.additionalCommandAcquired[i] != false) if (charaWork.additionalCommandAcquired[i] != false)
propPacketUtil.AddProperty(String.Format("charaWork.additionalCommandAcquired[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.additionalCommandAcquired[{0}]", i));
} }
for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++) for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++)
{ {
charaWork.parameterSave.commandSlot_compatibility[i] = true; charaWork.parameterSave.commandSlot_compatibility[i] = true;
if (charaWork.parameterSave.commandSlot_compatibility[i]) if (charaWork.parameterSave.commandSlot_compatibility[i])
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i));
} }
for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++) for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++)
{ {
if (charaWork.parameterSave.commandSlot_recastTime[i] != 0) if (charaWork.parameterSave.commandSlot_recastTime[i] != 0)
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i));
} }
//System //System
@@ -505,25 +523,25 @@ namespace Meteor.Map.Actors
for (int i = 0; i < playerWork.questScenario.Length; i++) for (int i = 0; i < playerWork.questScenario.Length; i++)
{ {
if (playerWork.questScenario[i] != 0) if (playerWork.questScenario[i] != 0)
propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", i)); propPacketUtil.AddProperty(string.Format("playerWork.questScenario[{0}]", i));
} }
//Guildleve - Local //Guildleve - Local
for (int i = 0; i < playerWork.questGuildleve.Length; i++) for (int i = 0; i < playerWork.questGuildleve.Length; i++)
{ {
if (playerWork.questGuildleve[i] != 0) if (playerWork.questGuildleve[i] != 0)
propPacketUtil.AddProperty(String.Format("playerWork.questGuildleve[{0}]", i)); propPacketUtil.AddProperty(string.Format("playerWork.questGuildleve[{0}]", i));
} }
//Guildleve - Regional //Guildleve - Regional
for (int i = 0; i < work.guildleveId.Length; i++) for (int i = 0; i < work.guildleveId.Length; i++)
{ {
if (work.guildleveId[i] != 0) if (work.guildleveId[i] != 0)
propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", i)); propPacketUtil.AddProperty(string.Format("work.guildleveId[{0}]", i));
if (work.guildleveDone[i] != false) if (work.guildleveDone[i] != false)
propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", i)); propPacketUtil.AddProperty(string.Format("work.guildleveDone[{0}]", i));
if (work.guildleveChecked[i] != false) if (work.guildleveChecked[i] != false)
propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", i)); propPacketUtil.AddProperty(string.Format("work.guildleveChecked[{0}]", i));
} }
//Bazaar //Bazaar
@@ -541,9 +559,9 @@ namespace Meteor.Map.Actors
for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++) for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++)
{ {
if (playerWork.npcLinkshellChatCalling[i] != false) if (playerWork.npcLinkshellChatCalling[i] != false)
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", i)); propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatCalling[{0}]", i));
if (playerWork.npcLinkshellChatExtra[i] != false) if (playerWork.npcLinkshellChatExtra[i] != false)
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", i)); propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatExtra[{0}]", i));
} }
propPacketUtil.AddProperty("playerWork.restBonusExpRate"); propPacketUtil.AddProperty("playerWork.restBonusExpRate");
@@ -560,7 +578,7 @@ namespace Meteor.Map.Actors
public void SendSeamlessZoneInPackets() public void SendSeamlessZoneInPackets()
{ {
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, SetMusicPacket.EFFECT_FADEIN)); QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), SetMusicPacket.EFFECT_FADEIN));
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1)); QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
} }
@@ -583,7 +601,7 @@ namespace Meteor.Map.Actors
} }
} }
else else
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, 0x01)); //Zone QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), 0x01)); //Zone
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1)); QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
@@ -806,11 +824,6 @@ namespace Meteor.Map.Actors
Database.SavePlayerStatusEffects(this); Database.SavePlayerStatusEffects(this);
} }
public Area GetZone()
{
return zone;
}
public void SendMessage(uint logType, string sender, string message) public void SendMessage(uint logType, string sender, string message)
{ {
QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message)); QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message));
@@ -895,6 +908,12 @@ namespace Meteor.Map.Actors
QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1)); QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1));
} }
public void ResetMusic()
{
if (zone != null)
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), 1));
}
public void SendMountAppearance() public void SendMountAppearance()
{ {
if (mountState == 1) if (mountState == 1)
@@ -959,29 +978,6 @@ namespace Meteor.Map.Actors
//zone.BroadcastPacketAroundActor(this, worldMasterMessage); //zone.BroadcastPacketAroundActor(this, worldMasterMessage);
} }
public void GraphicChange(uint slot, uint graphicId)
{
appearanceIds[slot] = graphicId;
}
public void GraphicChange(uint slot, uint weapId, uint equipId, uint variantId, uint colorId)
{
uint mixedVariantId;
if (weapId == 0)
mixedVariantId = ((variantId & 0x1F) << 5) | colorId;
else
mixedVariantId = variantId;
uint graphicId =
(weapId & 0x3FF) << 20 |
(equipId & 0x3FF) << 10 |
(mixedVariantId & 0x3FF);
appearanceIds[slot] = graphicId;
}
public void GraphicChange(int slot, InventoryItem invItem) public void GraphicChange(int slot, InventoryItem invItem)
{ {
@@ -1043,11 +1039,6 @@ namespace Meteor.Map.Actors
BroadcastPacket(CreateAppearancePacket(), true); BroadcastPacket(CreateAppearancePacket(), true);
} }
public void SendAppearance()
{
BroadcastPacket(CreateAppearancePacket(), true);
}
public void SendCharaExpInfo() public void SendCharaExpInfo()
{ {
if (lastStep == 0) if (lastStep == 0)
@@ -1193,7 +1184,7 @@ namespace Meteor.Map.Actors
propertyBuilder.NewTarget("playerWork/expBonus"); propertyBuilder.NewTarget("playerWork/expBonus");
propertyBuilder.AddProperty("playerWork.restBonusExpRate"); propertyBuilder.AddProperty("playerWork.restBonusExpRate");
propertyBuilder.NewTarget("charaWork/battleStateForSelf"); propertyBuilder.NewTarget("charaWork/battleStateForSelf");
propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1)); propertyBuilder.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
Database.LoadHotbar(this); Database.LoadHotbar(this);
var time = Utils.UnixTimeStampUTC(); var time = Utils.UnixTimeStampUTC();
@@ -1205,6 +1196,7 @@ namespace Meteor.Map.Actors
} }
} }
SetSpecialCommands(charaWork.parameterSave.state_mainSkill[0]);
UpdateHotbar(); UpdateHotbar();
List<SubPacket> packets = propertyBuilder.Done(); List<SubPacket> packets = propertyBuilder.Done();
@@ -1216,12 +1208,49 @@ namespace Meteor.Map.Actors
RecalculateStats(); RecalculateStats();
} }
private void SetSpecialCommands(byte classId)
{
//Added special commands for crafter/gatherer
charaWork.command[16] = 0;
charaWork.command[17] = 0;
if (classId >= 29 && classId <= 36)
{
charaWork.command[16] = 0xA0F00000 | 22001; //Synthesize
}
else if (classId == 39) //Miner
{
charaWork.command[16] = 0xA0F00000 | 22002; //Mine
charaWork.command[17] = 0xA0F00000 | 22006; //Quarry
}
else if (classId == 40) //Botanist
{
charaWork.command[16] = 0xA0F00000 | 22003; //Log
charaWork.command[17] = 0xA0F00000 | 22007; //Harvest
}
else if (classId == 41) //Fisher
{
charaWork.command[16] = 0xA0F00000 | 22004; //Fish
charaWork.command[17] = 0xA0F00000 | 22008; //Spearfish
}
else if (classId == 42) //Shepherd
{
charaWork.command[16] = 0xA0F00000 | 22005; //Herd
charaWork.command[17] = 0xA0F00000 | 22009; //Herd 2
}
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/command", this);
propertyBuilder.AddProperty(string.Format("charaWork.command[{0}]", 16));
propertyBuilder.AddProperty(string.Format("charaWork.commandCategory[{0}]", 17));
List<SubPacket> packets = propertyBuilder.Done();
QueuePackets(packets);
}
public void UpdateClassLevel(byte classId, short level) public void UpdateClassLevel(byte classId, short level)
{ {
Database.PlayerCharacterUpdateClassLevel(this, classId, level); Database.PlayerCharacterUpdateClassLevel(this, classId, level);
charaWork.battleSave.skillLevel[classId - 1] = level; charaWork.battleSave.skillLevel[classId - 1] = level;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId-1)); propertyBuilder.AddProperty(string.Format("charaWork.battleSave.skillLevel[{0}]", classId-1));
List<SubPacket> packets = propertyBuilder.Done(); List<SubPacket> packets = propertyBuilder.Done();
QueuePackets(packets); QueuePackets(packets);
} }
@@ -1363,6 +1392,16 @@ namespace Meteor.Map.Actors
return -1; return -1;
} }
public int GetFreeQuestGuildleveSlot()
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] == null)
return i;
}
return -1;
}
public int GetFreeGuildleveSlot() public int GetFreeGuildleveSlot()
{ {
@@ -1447,37 +1486,61 @@ namespace Meteor.Map.Actors
} }
} }
} }
public void AddQuest(string name, bool isSilent = false)
{
Actor actor = Server.GetStaticActors(name);
AddQuestInternal(actor as Quest, isSilent);
}
public void AddQuest(uint id, bool isSilent = false) public void AddQuest(uint id, bool isSilent = false)
{ {
Actor actor = Server.GetStaticActors((0xA0F00000 | id)); Actor actor = Server.GetStaticActors((0xA0F00000 | id));
AddQuest(actor.actorName, isSilent); AddQuestInternal(actor as Quest, isSilent);
} }
public void AddQuest(string name, bool isSilent = false) public void AddQuestGuildleve(uint id, byte difficulty)
{ {
Actor actor = Server.GetStaticActors(name); Quest staticQuest = (Quest) Server.GetStaticActors((0xA0F00000 | id));
if (staticQuest == null)
if (actor == null)
return; return;
uint id = actor.actorId; PassiveGuildleve newQuest = new PassiveGuildleve(staticQuest, this, difficulty);
int freeSlot = GetFreeQuestGuildleveSlot();
if (freeSlot == -1)
return;
playerWork.questGuildleve[freeSlot] = newQuest.actorId;
questGuildleve[freeSlot] = newQuest;
Database.SaveQuest(this, newQuest);
SendQuestGuildleveClientUpdate(freeSlot);
}
private void AddQuestInternal(Quest staticQuest, bool isSilent = false)
{
if (staticQuest == null)
return;
Scenario newQuest = new Scenario(staticQuest, this, null, 0, 0);
int freeSlot = GetFreeQuestSlot(); int freeSlot = GetFreeQuestSlot();
if (freeSlot == -1) if (freeSlot == -1)
return; return;
playerWork.questScenario[freeSlot] = id; playerWork.questScenario[freeSlot] = newQuest.actorId;
questScenario[freeSlot] = new Quest(this, playerWork.questScenario[freeSlot], name, null, 0, 0); questScenario[freeSlot] = newQuest;
Database.SaveQuest(this, questScenario[freeSlot]);
Database.SaveQuest(this, newQuest);
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); (questScenario[freeSlot] as Scenario).NextPhase(0);
} }
} }
public void CompleteQuest(uint id) public void CompleteQuest(uint id)
@@ -1541,9 +1604,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 quest = Server.GetStaticActors((0xA0F00000 | newId)) as Quest;
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 Scenario(quest, this, null, 0, 0);
Database.SaveQuest(this, questScenario[i]); Database.SaveQuest(this, questScenario[i]);
SendQuestClientUpdate(i); SendQuestClientUpdate(i);
break; break;
@@ -1598,6 +1661,16 @@ namespace Meteor.Map.Actors
return null; return null;
} }
public Quest GetQuestGuildleve(uint id)
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
return questGuildleve[i];
}
return null;
}
public bool HasQuest(string name) public bool HasQuest(string name)
{ {
@@ -1621,6 +1694,17 @@ namespace Meteor.Map.Actors
return false; return false;
} }
public bool HasQuestGuildleve(uint id)
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
return true;
}
return false;
}
public bool HasGuildleve(uint id) public bool HasGuildleve(uint id)
{ {
for (int i = 0; i < work.guildleveId.Length; i++) for (int i = 0; i < work.guildleveId.Length; i++)
@@ -1643,6 +1727,17 @@ namespace Meteor.Map.Actors
return -1; return -1;
} }
public int GetQuestGuildleveSlot(uint id)
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
return i;
}
return -1;
}
public void SetNpcLS(uint npcLSId, uint state) public void SetNpcLS(uint npcLSId, uint state)
{ {
bool isCalling, isExtra; bool isCalling, isExtra;
@@ -1679,30 +1774,36 @@ namespace Meteor.Map.Actors
Database.SaveNpcLS(this, npcLSId, isCalling, isExtra); Database.SaveNpcLS(this, npcLSId, isCalling, isExtra);
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this);
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId)); propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId));
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId)); propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
private void SendQuestClientUpdate(int slot) private void SendQuestClientUpdate(int slot)
{ {
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", slot)); propPacketUtil.AddProperty(string.Format("playerWork.questScenario[{0}]", slot));
QueuePackets(propPacketUtil.Done());
}
private void SendQuestGuildleveClientUpdate(int slot)
{
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
propPacketUtil.AddProperty(string.Format("playerWork.questGuildleve[{0}]", slot));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
private void SendGuildleveClientUpdate(int slot) private void SendGuildleveClientUpdate(int slot)
{ {
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", slot)); propPacketUtil.AddProperty(string.Format("work.guildleveId[{0}]", slot));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
private void SendGuildleveMarkClientUpdate(int slot) private void SendGuildleveMarkClientUpdate(int slot)
{ {
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", slot)); propPacketUtil.AddProperty(string.Format("work.guildleveDone[{0}]", slot));
propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", slot)); propPacketUtil.AddProperty(string.Format("work.guildleveChecked[{0}]", slot));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
@@ -2034,10 +2135,35 @@ namespace Meteor.Map.Actors
retainerMeetingGroup = null; retainerMeetingGroup = null;
} }
} }
public override void Update(DateTime tick) public void AddRecentRecipe(Recipe recipe)
{ {
recentRecipes.Remove(recipe);
if (recentRecipes.Count > 8)
recentRecipes.RemoveAt(7);
recentRecipes.Add(recipe);
}
public List<Recipe> GetRecentRecipes()
{
return recentRecipes;
}
public void AddAwardedRecipe(Recipe recipe)
{
awardedRecipes.Remove(recipe);
if (awardedRecipes.Count > 8)
awardedRecipes.RemoveAt(7);
awardedRecipes.Add(recipe);
}
public List<Recipe> GetAwardedRecipes()
{
return awardedRecipes;
}
public override void Update(DateTime tick)
{
// Chocobo Rental Expirey // Chocobo Rental Expirey
if (rentalExpireTime != 0) if (rentalExpireTime != 0)
{ {
@@ -2048,7 +2174,7 @@ namespace Meteor.Map.Actors
{ {
rentalExpireTime = 0; rentalExpireTime = 0;
rentalMinLeft = 0; rentalMinLeft = 0;
ChangeMusic(GetZone().bgmDay); ResetMusic();
SetMountState(0); SetMountState(0);
ChangeSpeed(0.0f, 2.0f, 5.0f, 5.0f); ChangeSpeed(0.0f, 2.0f, 5.0f, 5.0f);
ChangeState(0); ChangeState(0);
@@ -2102,7 +2228,7 @@ namespace Meteor.Map.Actors
if (GetMod(i) != charaWork.battleTemp.generalParameter[i]) if (GetMod(i) != charaWork.battleTemp.generalParameter[i])
{ {
charaWork.battleTemp.generalParameter[i] = (short)GetMod(i); charaWork.battleTemp.generalParameter[i] = (short)GetMod(i);
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i)); propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i));
} }
} }
@@ -2149,8 +2275,8 @@ namespace Meteor.Map.Actors
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/command", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/command", this);
foreach (ushort slot in slotsToUpdate) foreach (ushort slot in slotsToUpdate)
{ {
propPacketUtil.AddProperty(String.Format("charaWork.command[{0}]", slot)); propPacketUtil.AddProperty(string.Format("charaWork.command[{0}]", slot));
propPacketUtil.AddProperty(String.Format("charaWork.commandCategory[{0}]", slot)); propPacketUtil.AddProperty(string.Format("charaWork.commandCategory[{0}]", slot));
} }
propPacketUtil.NewTarget("charaWork/commandDetailForSelf"); propPacketUtil.NewTarget("charaWork/commandDetailForSelf");
@@ -2158,7 +2284,7 @@ namespace Meteor.Map.Actors
foreach (ushort slot in slotsToUpdate) foreach (ushort slot in slotsToUpdate)
{ {
charaWork.parameterSave.commandSlot_compatibility[slot - charaWork.commandBorder] = charaWork.command[slot] != 0; charaWork.parameterSave.commandSlot_compatibility[slot - charaWork.commandBorder] = charaWork.command[slot] != 0;
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", slot - charaWork.commandBorder)); propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", slot - charaWork.commandBorder));
} }
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
@@ -2172,8 +2298,8 @@ namespace Meteor.Map.Actors
foreach (ushort slot in slotsToUpdate) foreach (ushort slot in slotsToUpdate)
{ {
recastPacketUtil.AddProperty(String.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", slot - charaWork.commandBorder)); recastPacketUtil.AddProperty(string.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", slot - charaWork.commandBorder));
recastPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", slot - charaWork.commandBorder)); recastPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", slot - charaWork.commandBorder));
} }
QueuePackets(recastPacketUtil.Done()); QueuePackets(recastPacketUtil.Done());
@@ -2595,7 +2721,7 @@ namespace Meteor.Map.Actors
charaWork.battleSave.skillPoint[classId - 1] = 0; charaWork.battleSave.skillPoint[classId - 1] = 0;
//send new level //send new level
ActorPropertyPacketUtil levelPropertyPacket = new ActorPropertyPacketUtil("charaWork/stateForAll", this); ActorPropertyPacketUtil levelPropertyPacket = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
levelPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1)); levelPropertyPacket.AddProperty(string.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1));
levelPropertyPacket.AddProperty("charaWork.parameterSave.state_mainSkillLevel"); levelPropertyPacket.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
QueuePackets(levelPropertyPacket.Done()); QueuePackets(levelPropertyPacket.Done());
@@ -2606,7 +2732,7 @@ namespace Meteor.Map.Actors
charaWork.battleSave.skillPoint[classId - 1] = Math.Min(charaWork.battleSave.skillPoint[classId - 1] + exp, MAXEXP[GetLevel() - 1]); charaWork.battleSave.skillPoint[classId - 1] = Math.Min(charaWork.battleSave.skillPoint[classId - 1] + exp, MAXEXP[GetLevel() - 1]);
ActorPropertyPacketUtil expPropertyPacket = new ActorPropertyPacketUtil("charaWork/battleStateForSelf", this); ActorPropertyPacketUtil expPropertyPacket = new ActorPropertyPacketUtil("charaWork/battleStateForSelf", this);
expPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1)); expPropertyPacket.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
QueuePackets(expPropertyPacket.Done()); QueuePackets(expPropertyPacket.Done());
Database.SetExp(this, classId, charaWork.battleSave.skillPoint[classId - 1]); Database.SetExp(this, classId, charaWork.battleSave.skillPoint[classId - 1]);

View File

@@ -239,7 +239,7 @@ namespace Meteor.Map.actors.director
//Format Class Name //Format Class Name
string className = this.className; string className = this.className;
className = Char.ToLowerInvariant(className[0]) + className.Substring(1); className = char.ToLowerInvariant(className[0]) + className.Substring(1);
//Format Zone Name //Format Zone Name
string zoneName = zone.zoneName.Replace("Field", "Fld") string zoneName = zone.zoneName.Replace("Field", "Fld")
@@ -255,7 +255,7 @@ namespace Meteor.Map.actors.director
//Check if "normal" //Check if "normal"
zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P"; zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P";
} }
zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1); zoneName = char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1);
try try
{ {
@@ -273,7 +273,7 @@ namespace Meteor.Map.actors.director
if (zone is PrivateArea) if (zone is PrivateArea)
privLevel = ((PrivateArea)zone).GetPrivateAreaType(); privLevel = ((PrivateArea)zone).GetPrivateAreaType();
actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); actorName = string.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel);
} }
public string GetScriptPath() public string GetScriptPath()
@@ -283,7 +283,7 @@ namespace Meteor.Map.actors.director
private void LoadLuaScript() private void LoadLuaScript()
{ {
string luaPath = String.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath()); string luaPath = string.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath());
directorScript = LuaEngine.LoadScript(luaPath); directorScript = LuaEngine.LoadScript(luaPath);
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 +293,7 @@ namespace Meteor.Map.actors.director
{ {
if (directorScript != null) if (directorScript != null)
{ {
directorScript = LuaEngine.LoadScript(String.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath)); directorScript = LuaEngine.LoadScript(string.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath));
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);

View File

@@ -137,7 +137,7 @@ namespace Meteor.Map.actors.director
if (wasCompleted) if (wasCompleted)
{ {
Npc aetheryteNode = zone.SpawnActor(1200040, String.Format("{0}:warpExit", guildleveOwner.actorName), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ); Npc aetheryteNode = zone.SpawnActor(1200040, string.Format("{0}:warpExit", guildleveOwner.actorName), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ);
AddMember(aetheryteNode); AddMember(aetheryteNode);
foreach (Actor a in GetPlayerMembers()) foreach (Actor a in GetPlayerMembers())
@@ -168,7 +168,7 @@ namespace Meteor.Map.actors.director
foreach (Actor p in GetPlayerMembers()) foreach (Actor p in GetPlayerMembers())
{ {
Player player = (Player)p; Player player = (Player)p;
player.ChangeMusic(player.GetZone().bgmDay); player.ResetMusic();
} }
} }
@@ -210,7 +210,7 @@ namespace Meteor.Map.actors.director
{ {
guildleveWork.aimNumNow[index] = value; guildleveWork.aimNumNow[index] = value;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
propertyBuilder.AddProperty(String.Format("guildleveWork.aimNumNow[{0}]", index)); propertyBuilder.AddProperty(string.Format("guildleveWork.aimNumNow[{0}]", index));
SendPacketsToPlayers(propertyBuilder.Done()); SendPacketsToPlayers(propertyBuilder.Done());
} }
@@ -218,7 +218,7 @@ namespace Meteor.Map.actors.director
{ {
guildleveWork.uiState[index] = value; guildleveWork.uiState[index] = value;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
propertyBuilder.AddProperty(String.Format("guildleveWork.uiState[{0}]", index)); propertyBuilder.AddProperty(string.Format("guildleveWork.uiState[{0}]", index));
SendPacketsToPlayers(propertyBuilder.Done()); SendPacketsToPlayers(propertyBuilder.Done());
} }
@@ -228,9 +228,9 @@ namespace Meteor.Map.actors.director
guildleveWork.markerY[markerIndex] = y; guildleveWork.markerY[markerIndex] = y;
guildleveWork.markerZ[markerIndex] = z; guildleveWork.markerZ[markerIndex] = z;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/marker", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/marker", this);
propertyBuilder.AddProperty(String.Format("guildleveWork.markerX[{0}]", markerIndex)); propertyBuilder.AddProperty(string.Format("guildleveWork.markerX[{0}]", markerIndex));
propertyBuilder.AddProperty(String.Format("guildleveWork.markerY[{0}]", markerIndex)); propertyBuilder.AddProperty(string.Format("guildleveWork.markerY[{0}]", markerIndex));
propertyBuilder.AddProperty(String.Format("guildleveWork.markerZ[{0}]", markerIndex)); propertyBuilder.AddProperty(string.Format("guildleveWork.markerZ[{0}]", markerIndex));
SendPacketsToPlayers(propertyBuilder.Done()); SendPacketsToPlayers(propertyBuilder.Done());
} }

View File

@@ -0,0 +1,146 @@
/*
===========================================================================
Copyright (C) 2015-2019 Project Meteor Dev Team
This file is part of Project Meteor Server.
Project Meteor Server is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Meteor Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using Meteor.Map.dataobjects;
using Meteor.Map.DataObjects;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace Meteor.Map.Actors
{
class PassiveGuildleve : Quest
{
private Recipe targetRecipe;
private byte currentDifficulty;
private short currentCrafted;
private short currentAttempt;
private bool hasMaterials;
private PassiveGuildleveData passiveGLData;
public PassiveGuildleve(Quest staticQuest, Player owner, byte currentDifficulty)
: base(staticQuest, owner)
{
passiveGLData = Server.GetPassiveGLGamedata(GetQuestId());
targetRecipe = Server.ResolveRecipe().GetRecipeByItemID(passiveGLData.objectiveItemId[currentDifficulty]);
this.currentDifficulty = currentDifficulty;
currentAttempt = 0;
currentCrafted = 0;
hasMaterials = false;
}
public PassiveGuildleve(Quest staticQuest, Player owner, string questDataJson) : base(staticQuest, owner)
{
passiveGLData = Server.GetPassiveGLGamedata(GetQuestId());
Dictionary<string, object> questData = null;
if (questDataJson != null)
questData = JsonConvert.DeserializeObject<Dictionary<string, object>>(questDataJson);
if (questData == null)
questData = new Dictionary<string, object>();
currentDifficulty = questData.ContainsKey("currentDifficulty") ? (byte)Convert.ToByte(questData["currentDifficulty"]) : (byte)0;
currentAttempt = questData.ContainsKey("currentAttempt") ? (short)Convert.ToInt16(questData["currentAttempt"]) : (short)0;
currentCrafted = questData.ContainsKey("currentCrafted") ? (short)Convert.ToInt16(questData["currentCrafted"]) : (short)0;
hasMaterials = questData.ContainsKey("hasMaterials") ? (bool)questData["hasMaterials"] : false;
targetRecipe = Server.ResolveRecipe().GetRecipeByItemID(passiveGLData.objectiveItemId[currentDifficulty]);
}
public void CraftSuccess()
{
currentCrafted += (short) targetRecipe.resultQuantity;
currentAttempt++;
}
public void CraftFail()
{
currentAttempt++;
}
public Recipe GetRecipe()
{
return targetRecipe;
}
public int GetObjectiveQuantity()
{
return passiveGLData.objectiveQuantity[currentDifficulty];
}
public int getCurrentCrafted()
{
return currentCrafted;
}
public int GetRemainingMaterials()
{
return passiveGLData.numberOfAttempts[currentDifficulty] - currentAttempt;
}
public int GetCurrentAttempt()
{
return currentAttempt;
}
public int GetMaxAttempts()
{
return passiveGLData.numberOfAttempts[currentDifficulty];
}
public byte GetCurrentDifficulty()
{
return currentDifficulty;
}
public bool HasMaterials()
{
return hasMaterials;
}
public PassiveGuildleveData GetPassiveGLData()
{
return passiveGLData;
}
public override void SaveData()
{
Database.SaveQuest(owner, this);
}
public override string GetSerializedQuestData()
{
Dictionary<string, object> questData = new Dictionary<string, object>
{
{ "currentDifficulty", currentDifficulty },
{ "currentAttempt", currentAttempt },
{ "currentCrafted", currentCrafted },
{ "hasMaterials", hasMaterials }
};
return JsonConvert.SerializeObject(questData, Formatting.Indented);
}
}
}

View File

@@ -20,6 +20,7 @@ along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
*/ */
using Meteor.Map.lua; using Meteor.Map.lua;
using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -28,40 +29,18 @@ namespace Meteor.Map.Actors
{ {
class Quest : Actor class Quest : Actor
{ {
private Player owner; protected Player owner;
private uint currentPhase = 0;
private uint questFlags = 0;
private Dictionary<string, Object> questData = new Dictionary<string, object>();
public Quest(uint actorID, string name) public Quest(uint actorID, string name)
: base(actorID) : base(actorID)
{ {
actorName = name; actorName = name;
} }
public Quest(Player owner, uint actorID, string name, string questDataJson, uint questFlags, uint currentPhase) public Quest(Quest staticQuest, Player owner) : base(staticQuest.actorId)
: base(actorID)
{ {
this.owner = owner; this.owner = owner;
actorName = name; actorName = staticQuest.actorName;
this.questFlags = questFlags;
if (questDataJson != null)
this.questData = JsonConvert.DeserializeObject<Dictionary<string, Object>>(questDataJson);
else
questData = null;
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,81 +48,8 @@ namespace Meteor.Map.Actors
return actorId & 0xFFFFF; return actorId & 0xFFFFF;
} }
public object GetQuestData(string dataName) public virtual void SaveData() { }
{ public virtual string GetSerializedQuestData() { return null; }
if (questData.ContainsKey(dataName))
return questData[dataName];
else
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() public void DoCompletionCheck()
{ {
@@ -161,5 +67,45 @@ namespace Meteor.Map.Actors
owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId()); owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId());
} }
public static Quest LoadQuestDB(Player player, MySqlDataReader reader)
{
uint questID = 0xA0F00000 | reader.GetUInt32("questId");
Quest staticQuest = Server.GetStaticActors(questID) as Quest;
string questData = null;
if (!reader.IsDBNull(reader.GetOrdinal("questData")))
questData = reader.GetString("questData");
else
questData = "{}";
if (staticQuest.IsScenario())
{
uint questFlags = 0;
uint currentPhase = 0;
if (!reader.IsDBNull(reader.GetOrdinal("questFlags")))
questFlags = reader.GetUInt32("questFlags");
if (!reader.IsDBNull(reader.GetOrdinal("currentPhase")))
currentPhase = reader.GetUInt32("currentPhase");
return new Scenario(staticQuest, player, questData, questFlags, currentPhase);
}
else if (staticQuest.IsCraftPassiveGuildleve())
{
return new PassiveGuildleve(staticQuest, player, questData);
}
throw new NotImplementedException("Unknown quest type added");
}
public bool IsScenario()
{
return !IsCraftPassiveGuildleve();
}
public bool IsCraftPassiveGuildleve()
{
return GetQuestId() > 120000 && GetQuestId() < 121024;
}
} }
} }

View File

@@ -0,0 +1,140 @@
/*
===========================================================================
Copyright (C) 2015-2019 Project Meteor Dev Team
This file is part of Project Meteor Server.
Project Meteor Server is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Meteor Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using Meteor.Map.lua;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace Meteor.Map.Actors
{
class Scenario : Quest
{
private uint currentPhase = 0;
private uint questFlags = 0;
private Dictionary<string, object> questData = new Dictionary<string, object>();
public Scenario(uint actorID, string name)
: base(actorID, name)
{
actorName = name;
}
public Scenario(Quest staticQuest, Player owner, string questDataJson, uint questFlags, uint currentPhase)
: base(staticQuest, owner)
{
this.questFlags = questFlags;
if (questDataJson != null)
this.questData = JsonConvert.DeserializeObject<Dictionary<string, object>>(questDataJson);
else
questData = null;
if (questData == null)
questData = new Dictionary<string, object>();
this.currentPhase = currentPhase;
}
public void SetQuestData(string dataName, object data)
{
questData[dataName] = data;
//Inform update
}
public object GetQuestData(string dataName)
{
if (questData.ContainsKey(dataName))
return questData[dataName];
else
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 override string GetSerializedQuestData()
{
return JsonConvert.SerializeObject(questData, Formatting.Indented);
}
public override void SaveData()
{
Database.SaveQuest(owner, this);
}
}
}

View File

@@ -59,8 +59,8 @@ namespace Meteor.Map.Actors
try try
{ {
byte byteIn = binReader.ReadByte(); byte byteIn = binReader.ReadByte();
byte byteOut = (Byte)(byteIn ^ 0x73); byte byteOut = (byte)(byteIn ^ 0x73);
binWriter.Write((Byte)byteOut); binWriter.Write((byte)byteOut);
} }
catch (EndOfStreamException) { break; } catch (EndOfStreamException) { break; }
} }

View File

@@ -0,0 +1,92 @@
/*
===========================================================================
Copyright (C) 2015-2019 Project Meteor Dev Team
This file is part of Project Meteor Server.
Project Meteor Server is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Meteor Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using MySql.Data.MySqlClient;
namespace Meteor.Map.dataobjects
{
class PassiveGuildleveData
{
public readonly uint id;
public readonly uint plateId;
public readonly uint borderId;
public readonly uint recommendedClass;
public readonly uint issuingLocation;
public readonly uint leveLocation;
public readonly uint deliveryDisplayName;
public readonly int[] objectiveItemId;
public readonly int[] objectiveQuantity;
public readonly int[] rewardItemId;
public readonly int[] rewardQuantity;
public readonly int[] numberOfAttempts;
public readonly int[] recommendedLevel;
public PassiveGuildleveData(MySqlDataReader reader)
{
id = reader.GetUInt32("id");
plateId = reader.GetUInt32("plateId");
borderId = reader.GetUInt32("borderId");
recommendedClass = reader.GetUInt32("recommendedClass");
issuingLocation = reader.GetUInt32("issuingLocation");
leveLocation = reader.GetUInt32("guildleveLocation");
deliveryDisplayName = reader.GetUInt32("deliveryDisplayName");
objectiveItemId = new int[4];
objectiveQuantity = new int[4];
rewardItemId = new int[4];
rewardQuantity = new int[4];
numberOfAttempts = new int[4];
recommendedLevel = new int[4];
objectiveItemId[0] = reader.GetInt32("objectiveItemId1");
objectiveItemId[1] = reader.GetInt32("objectiveItemId2");
objectiveItemId[2] = reader.GetInt32("objectiveItemId3");
objectiveItemId[3] = reader.GetInt32("objectiveItemId4");;
objectiveQuantity[0] = reader.GetInt32("objectiveQuantity1");
objectiveQuantity[1] = reader.GetInt32("objectiveQuantity2");
objectiveQuantity[2] = reader.GetInt32("objectiveQuantity3");
objectiveQuantity[3] = reader.GetInt32("objectiveQuantity4");
rewardItemId[0] = reader.GetInt32("rewardItemId1");
rewardItemId[1] = reader.GetInt32("rewardItemId2");
rewardItemId[2] = reader.GetInt32("rewardItemId3");
rewardItemId[3] = reader.GetInt32("rewardItemId4");
rewardQuantity[0] = reader.GetInt32("rewardQuantity1");
rewardQuantity[1] = reader.GetInt32("rewardQuantity2");
rewardQuantity[2] = reader.GetInt32("rewardQuantity3");
rewardQuantity[3] = reader.GetInt32("rewardQuantity4");
numberOfAttempts[0] = reader.GetInt32("numberOfAttempts1");
numberOfAttempts[1] = reader.GetInt32("numberOfAttempts2");
numberOfAttempts[2] = reader.GetInt32("numberOfAttempts3");
numberOfAttempts[3] = reader.GetInt32("numberOfAttempts4");
recommendedLevel[0] = reader.GetInt32("recommendedLevel1");
recommendedLevel[1] = reader.GetInt32("recommendedLevel2");
recommendedLevel[2] = reader.GetInt32("recommendedLevel3");
recommendedLevel[3] = reader.GetInt32("recommendedLevel4");
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Meteor.Map.DataObjects
{
class Recipe
{
public readonly uint id;
public readonly uint resultItemID;
public readonly uint resultQuantity;
public readonly uint[] materials;
public readonly byte[] allowedCrafters;
public readonly uint crystalId1;
public readonly uint crystalId2;
public readonly uint crystalQuantity1;
public readonly uint crystalQuantity2;
public readonly byte tier;
public Recipe(uint id, uint resultItemID, uint resultQuantity, uint[] materials, uint crystalId1, uint crystalQuantity1, uint crystalId2, uint crystalQuantity2, byte[] allowedCrafters, byte tier)
{
this.id = id;
this.resultItemID = resultItemID;
this.resultQuantity = resultQuantity;
this.materials = materials;
this.allowedCrafters = allowedCrafters;
this.crystalId1 = crystalId1;
this.crystalId2 = crystalId2;
this.crystalQuantity1 = crystalQuantity1;
this.crystalQuantity2 = crystalQuantity2;
this.tier = tier;
}
}
}

View File

@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Linq;
using MoonSharp.Interpreter;
namespace Meteor.Map.DataObjects
{
class RecipeResolver
{
Dictionary<uint, Recipe> recipeList;
Dictionary<string, List<Recipe>> matsToRecipes;
private RecipeResolver(Dictionary<uint, Recipe> recipeList, Dictionary<string, List<Recipe>> matsToRecipes)
{
this.recipeList = recipeList;
this.matsToRecipes = matsToRecipes;
}
public static RecipeResolver Init()
{
var recipeList = new Dictionary<uint, Recipe>();
var matToRecipes = new Dictionary<string, List<Recipe>>();
Database.GetRecipeGamedata(recipeList, matToRecipes);
return new RecipeResolver(recipeList, matToRecipes);
}
public List<Recipe> GetRecipeFromMats(uint mat1 = 0, uint mat2 = 0, uint mat3 = 0, uint mat4 = 0, uint mat5 = 0, uint mat6 = 0, uint mat7 = 0, uint mat8 = 0)
{
uint[] mats = new uint[8];
mats[0] = mat1;
mats[1] = mat2;
mats[2] = mat3;
mats[3] = mat4;
mats[4] = mat5;
mats[5] = mat6;
mats[6] = mat7;
mats[7] = mat8;
byte[] result = new byte[8 * sizeof(int)];
Buffer.BlockCopy(mats, 0, result, 0, result.Length);
string hash;
using (MD5 md5 = MD5.Create())
{
hash = BitConverter.ToString(md5.ComputeHash(result));
}
if (matsToRecipes.ContainsKey(hash))
return matsToRecipes[hash];
else
return null;
}
public Recipe GetRecipeByItemID(int objectiveItemID)
{
return recipeList.Where(recipe => recipe.Value.resultItemID == objectiveItemID).FirstOrDefault().Value;
}
public DynValue RecipesToItemIdTable(List<Recipe> recipeList)
{
DynValue[] itemIDs = new DynValue[8];
for (int i = 0; i < 8; i++)
itemIDs[i] = recipeList != null && i < recipeList.Count ? DynValue.NewNumber(recipeList[i].resultItemID) : DynValue.NewNil();
return DynValue.NewTable(new Table(new Script(), itemIDs));
}
public DynValue RecipeToMatIdTable(Recipe recipe)
{
DynValue[] itemIDs = new DynValue[8];
for (int i = 0; i < 8; i++)
itemIDs[i] = DynValue.NewNumber(recipe.materials[i]);
return DynValue.NewTable(new Table(new Script(), itemIDs));
}
public Recipe GetRecipeByID(uint recipeID)
{
if (recipeID == 0)
return null;
if (recipeList.ContainsKey(recipeID))
return recipeList[recipeID];
else
return null;
}
public int GetNumRecipes()
{
return recipeList.Count;
}
}
}

View File

@@ -33,6 +33,8 @@ using Meteor.Map.packets.receive.supportdesk;
using Meteor.Map.actors.chara.npc; using Meteor.Map.actors.chara.npc;
using Meteor.Map.actors.chara.ai; using Meteor.Map.actors.chara.ai;
using Meteor.Map.packets.send.actor.battle; using Meteor.Map.packets.send.actor.battle;
using Meteor.Map.DataObjects;
using System.Security.Cryptography;
namespace Meteor.Map namespace Meteor.Map
{ {
@@ -40,10 +42,10 @@ namespace Meteor.Map
class Database class Database
{ {
public static uint GetUserIdFromSession(String sessionId) public static uint GetUserIdFromSession(string sessionId)
{ {
uint id = 0; uint id = 0;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -72,7 +74,7 @@ namespace Meteor.Map
public static Dictionary<uint, ItemData> GetItemGamedata() public static Dictionary<uint, ItemData> GetItemGamedata()
{ {
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
Dictionary<uint, ItemData> gamedataItems = new Dictionary<uint, ItemData>(); Dictionary<uint, ItemData> gamedataItems = new Dictionary<uint, ItemData>();
@@ -129,7 +131,7 @@ namespace Meteor.Map
public static Dictionary<uint, GuildleveData> GetGuildleveGamedata() public static Dictionary<uint, GuildleveData> GetGuildleveGamedata()
{ {
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
Dictionary<uint, GuildleveData> gamedataGuildleves = new Dictionary<uint, GuildleveData>(); Dictionary<uint, GuildleveData> gamedataGuildleves = new Dictionary<uint, GuildleveData>();
@@ -149,7 +151,6 @@ namespace Meteor.Map
{ {
while (reader.Read()) while (reader.Read())
{ {
uint id = reader.GetUInt32("id");
GuildleveData guildleve = new GuildleveData(reader); GuildleveData guildleve = new GuildleveData(reader);
gamedataGuildleves.Add(guildleve.id, guildleve); gamedataGuildleves.Add(guildleve.id, guildleve);
} }
@@ -168,12 +169,144 @@ namespace Meteor.Map
} }
} }
public static Dictionary<uint, PassiveGuildleveData> GetPassiveGuildleveGamedata()
{
using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
Dictionary<uint, PassiveGuildleveData> gamedataPassiveGuildleves = new Dictionary<uint, PassiveGuildleveData>();
try
{
conn.Open();
string query = @"
SELECT
*
FROM gamedata_passivegl_craft
";
MySqlCommand cmd = new MySqlCommand(query, conn);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
PassiveGuildleveData passiveGL = new PassiveGuildleveData(reader);
gamedataPassiveGuildleves.Add(passiveGL.id, passiveGL);
}
}
}
catch (MySqlException e)
{
Program.Log.Error(e.ToString());
}
finally
{
conn.Dispose();
}
return gamedataPassiveGuildleves;
}
}
public static bool GetRecipeGamedata(Dictionary<uint, Recipe> recipeList, Dictionary<string, List<Recipe>> matToRecipe)
{
using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
string query = @"
SELECT
id,
craftedItem,
craftedQuantity,
crystal0ID,
crystal0Quantity,
crystal1ID,
crystal1Quantity,
material0,
material1,
material2,
material3,
material4,
material5,
material6,
material7
FROM gamedata_recipes
ORDER BY craftedItem ASC
";
MySqlCommand cmd = new MySqlCommand(query, conn);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
uint recipeID = reader.GetUInt32("id");
uint craftedItem = reader.GetUInt32("craftedItem");
uint craftedQuantity = reader.GetUInt32("craftedQuantity");
uint crystal0ID = reader.GetUInt32("crystal0ID");
uint crystal0Quantity = reader.GetUInt32("crystal0Quantity");
uint crystal1ID = reader.GetUInt32("crystal1ID");
uint crystal1Quantity = reader.GetUInt32("crystal1Quantity");
uint[] mats = new uint[8];
mats[0] = reader.GetUInt32("material0");
mats[1] = reader.GetUInt32("material1");
mats[2] = reader.GetUInt32("material2");
mats[3] = reader.GetUInt32("material3");
mats[4] = reader.GetUInt32("material4");
mats[5] = reader.GetUInt32("material5");
mats[6] = reader.GetUInt32("material6");
mats[7] = reader.GetUInt32("material7");
//Hash for the Mat -> Recipe Dictionary
byte[] result = new byte[8 * sizeof(int)];
Buffer.BlockCopy(mats, 0, result, 0, result.Length);
string hash;
using (MD5 md5 = MD5.Create())
{
hash = BitConverter.ToString(md5.ComputeHash(result));
}
if (!matToRecipe.ContainsKey(hash))
matToRecipe.Add(hash, new List<Recipe>());
//Create obj
Recipe recipe = new Recipe(recipeID, craftedItem, craftedQuantity, mats, crystal0ID, crystal0Quantity, crystal1ID, crystal1Quantity, new byte[] { }, 1);
//Add to both Dictionaries
recipeList.Add(recipeID, recipe);
matToRecipe[hash].Add(recipe);
}
}
}
catch (MySqlException e)
{
Program.Log.Error(e.ToString());
return false;
}
finally
{
conn.Dispose();
}
return true;
}
}
public static void SavePlayerAppearance(Player player) public static void SavePlayerAppearance(Player player)
{ {
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -231,7 +364,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -267,7 +400,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -317,7 +450,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -351,7 +484,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -399,7 +532,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -418,9 +551,13 @@ namespace Meteor.Map
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("@questData", quest.GetSerializedQuestData()); cmd.Parameters.AddWithValue("@questData", quest.GetSerializedQuestData());
cmd.Parameters.AddWithValue("@questFlags", quest.GetQuestFlags());
if (quest.IsScenario())
{
cmd.Parameters.AddWithValue("@phase", (quest as Scenario).GetPhase());
cmd.Parameters.AddWithValue("@questFlags", (quest as Scenario).GetQuestFlags());
}
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -440,7 +577,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -476,7 +613,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -516,7 +653,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -549,7 +686,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -582,7 +719,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -616,7 +753,7 @@ namespace Meteor.Map
public static bool IsQuestCompleted(Player player, uint questId) public static bool IsQuestCompleted(Player player, uint questId)
{ {
bool isCompleted = false; bool isCompleted = false;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -643,7 +780,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1061,27 +1198,10 @@ namespace Meteor.Map
{ {
while (reader.Read()) while (reader.Read())
{ {
int index = reader.GetUInt16(0); int index = reader.GetUInt16(0);
player.playerWork.questScenario[index] = 0xA0F00000 | reader.GetUInt32(1); Quest quest = Quest.LoadQuestDB(player, reader);
string questData = null; player.questScenario[index] = quest;
uint questFlags = 0; player.playerWork.questScenario[index] = quest.actorId;
uint currentPhase = 0;
if (!reader.IsDBNull(2))
questData = reader.GetString(2);
else
questData = "{}";
if (!reader.IsDBNull(3))
questFlags = reader.GetUInt32(3);
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);
} }
} }
@@ -1090,6 +1210,7 @@ namespace Meteor.Map
SELECT SELECT
slot, slot,
questId, questId,
questData,
abandoned, abandoned,
completed completed
FROM characters_quest_guildleve_local WHERE characterId = @charId"; FROM characters_quest_guildleve_local WHERE characterId = @charId";
@@ -1101,7 +1222,9 @@ namespace Meteor.Map
while (reader.Read()) while (reader.Read())
{ {
int index = reader.GetUInt16(0); int index = reader.GetUInt16(0);
player.playerWork.questGuildleve[index] = 0xA0F00000 | reader.GetUInt32(1); Quest quest = Quest.LoadQuestDB(player, reader);
player.questGuildleve[index] = quest;
player.playerWork.questGuildleve[index] = quest.actorId;
} }
} }
@@ -1172,7 +1295,7 @@ namespace Meteor.Map
{ {
InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()]; InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()];
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1216,7 +1339,7 @@ namespace Meteor.Map
public static void EquipItem(Player player, ushort equipSlot, ulong uniqueItemId) public static void EquipItem(Player player, ushort equipSlot, ulong uniqueItemId)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1253,7 +1376,7 @@ namespace Meteor.Map
public static void UnequipItem(Player player, ushort equipSlot) public static void UnequipItem(Player player, ushort equipSlot)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1288,7 +1411,7 @@ namespace Meteor.Map
if (commandId > 0) if (commandId > 0)
{ {
using (MySqlConnection conn = new MySqlConnection( using (MySqlConnection conn = new MySqlConnection(
String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}",
ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_HOST,
ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_PORT,
ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_NAME,
@@ -1333,7 +1456,7 @@ namespace Meteor.Map
public static void UnequipAbility(Player player, ushort hotbarSlot) public static void UnequipAbility(Player player, ushort hotbarSlot)
{ {
using (MySqlConnection conn = new MySqlConnection( using (MySqlConnection conn = new MySqlConnection(
String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}",
ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_HOST,
ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_PORT,
ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_NAME,
@@ -1373,7 +1496,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1424,7 +1547,7 @@ namespace Meteor.Map
{ {
ushort slot = 0; ushort slot = 0;
using (MySqlConnection conn = new MySqlConnection( using (MySqlConnection conn = new MySqlConnection(
String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}",
ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_HOST,
ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_PORT,
ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_NAME,
@@ -1476,7 +1599,7 @@ namespace Meteor.Map
{ {
List<InventoryItem> items = new List<InventoryItem>(); List<InventoryItem> items = new List<InventoryItem>();
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1556,7 +1679,7 @@ namespace Meteor.Map
{ {
InventoryItem insertedItem = null; InventoryItem insertedItem = null;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1609,7 +1732,7 @@ namespace Meteor.Map
public static void AddItem(Character owner, InventoryItem addedItem, ushort itemPackage, ushort slot) public static void AddItem(Character owner, InventoryItem addedItem, ushort itemPackage, ushort slot)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1644,7 +1767,7 @@ namespace Meteor.Map
public static void RemoveItem(Character owner, ulong serverItemId) public static void RemoveItem(Character owner, ulong serverItemId)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1674,7 +1797,7 @@ namespace Meteor.Map
public static void UpdateItemPositions(List<InventoryItem> updated) public static void UpdateItemPositions(List<InventoryItem> updated)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1716,7 +1839,7 @@ namespace Meteor.Map
public static void SetQuantity(ulong serverItemId, int quantity) public static void SetQuantity(ulong serverItemId, int quantity)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1748,7 +1871,7 @@ namespace Meteor.Map
public static void SetDealingInfo(InventoryItem item) public static void SetDealingInfo(InventoryItem item)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1777,7 +1900,7 @@ namespace Meteor.Map
public static void ClearDealingInfo(InventoryItem item) public static void ClearDealingInfo(InventoryItem item)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1807,7 +1930,7 @@ namespace Meteor.Map
public static SubPacket GetLatestAchievements(Player player) public static SubPacket GetLatestAchievements(Player player)
{ {
uint[] latestAchievements = new uint[5]; uint[] latestAchievements = new uint[5];
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1849,7 +1972,7 @@ namespace Meteor.Map
{ {
SetCompletedAchievementsPacket cheevosPacket = new SetCompletedAchievementsPacket(); SetCompletedAchievementsPacket cheevosPacket = new SetCompletedAchievementsPacket();
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1894,7 +2017,7 @@ namespace Meteor.Map
public static SubPacket GetAchievementProgress(Player player, uint achievementId) public static SubPacket GetAchievementProgress(Player player, uint achievementId)
{ {
uint progress = 0, progressFlags = 0; uint progress = 0, progressFlags = 0;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1932,7 +2055,7 @@ namespace Meteor.Map
public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest) public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest)
{ {
bool success = false; bool success = false;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1972,7 +2095,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2012,7 +2135,7 @@ namespace Meteor.Map
MySqlCommand cmd; MySqlCommand cmd;
bool wasError = false; bool wasError = false;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2049,7 +2172,7 @@ namespace Meteor.Map
public static bool isTicketOpen(string playerName) public static bool isTicketOpen(string playerName)
{ {
bool isOpen = false; bool isOpen = false;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2090,7 +2213,7 @@ namespace Meteor.Map
public static void closeTicket(string playerName) public static void closeTicket(string playerName)
{ {
bool isOpen = false; bool isOpen = false;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2122,7 +2245,7 @@ namespace Meteor.Map
{ {
string[] faqs = null; string[] faqs = null;
List<string> raw = new List<string>(); List<string> raw = new List<string>();
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2165,7 +2288,7 @@ namespace Meteor.Map
public static string getFAQBody(uint slot, uint langCode = 1) public static string getFAQBody(uint slot, uint langCode = 1)
{ {
string body = string.Empty; string body = string.Empty;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2205,7 +2328,7 @@ namespace Meteor.Map
{ {
string[] issues = null; string[] issues = null;
List<string> raw = new List<string>(); List<string> raw = new List<string>();
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2246,7 +2369,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2284,7 +2407,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2318,7 +2441,7 @@ namespace Meteor.Map
{ {
var effects = new Dictionary<uint, StatusEffect>(); var effects = new Dictionary<uint, StatusEffect>();
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2366,7 +2489,7 @@ namespace Meteor.Map
{ {
string[] faqs = null; string[] faqs = null;
List<string> raw = new List<string>(); List<string> raw = new List<string>();
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2413,7 +2536,7 @@ namespace Meteor.Map
public static void LoadGlobalBattleCommandList(Dictionary<ushort, BattleCommand> battleCommandDict, Dictionary<Tuple<byte, short>, List<ushort>> battleCommandIdByLevel) public static void LoadGlobalBattleCommandList(Dictionary<ushort, BattleCommand> battleCommandDict, Dictionary<Tuple<byte, short>, List<ushort>> battleCommandIdByLevel)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2513,7 +2636,7 @@ namespace Meteor.Map
} }
} }
Program.Log.Info(String.Format("Loaded {0} battle commands.", count)); Program.Log.Info(string.Format("Loaded {0} battle commands.", count));
} }
catch (MySqlException e) catch (MySqlException e)
{ {
@@ -2528,7 +2651,7 @@ namespace Meteor.Map
public static void LoadGlobalBattleTraitList(Dictionary<ushort, BattleTrait> battleTraitDict, Dictionary<byte, List<ushort>> battleTraitJobDict) public static void LoadGlobalBattleTraitList(Dictionary<ushort, BattleTrait> battleTraitDict, Dictionary<byte, List<ushort>> battleTraitJobDict)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2567,7 +2690,7 @@ namespace Meteor.Map
count++; count++;
} }
} }
Program.Log.Info(String.Format("Loaded {0} battle traits.", count)); Program.Log.Info(string.Format("Loaded {0} battle traits.", count));
} }
catch (MySqlException e) catch (MySqlException e)
{ {
@@ -2582,13 +2705,13 @@ namespace Meteor.Map
public static void SetExp(Player player, byte classId, int exp) public static void SetExp(Player player, byte classId, int exp)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
conn.Open(); conn.Open();
var query = String.Format(@" var query = string.Format(@"
UPDATE characters_class_exp UPDATE characters_class_exp
SET SET
{0} = @exp {0} = @exp
@@ -2615,13 +2738,13 @@ namespace Meteor.Map
public static void SetLevel(Player player, byte classId, short level) public static void SetLevel(Player player, byte classId, short level)
{ {
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
conn.Open(); conn.Open();
var query = String.Format(@" var query = string.Format(@"
UPDATE characters_class_levels UPDATE characters_class_levels
SET SET
{0} = @lvl {0} = @lvl
@@ -2650,7 +2773,7 @@ namespace Meteor.Map
{ {
Retainer retainer = null; Retainer retainer = null;
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2748,13 +2871,13 @@ namespace Meteor.Map
"fsh" "fsh"
}; };
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
conn.Open(); conn.Open();
query = String.Format(@" query = string.Format(@"
UPDATE characters_class_levels UPDATE characters_class_levels
SET SET
{0}=@level {0}=@level
@@ -2777,6 +2900,6 @@ namespace Meteor.Map
} }
} }
} }
} }
} }

View File

@@ -37,6 +37,7 @@ using Meteor.Map.actors.area;
using System.Threading; using System.Threading;
using Meteor.Map.actors.chara.ai; using Meteor.Map.actors.chara.ai;
using Meteor.Map.actors.chara.ai.controllers; using Meteor.Map.actors.chara.ai.controllers;
using Meteor.Map.DataObjects;
namespace Meteor.Map.lua namespace Meteor.Map.lua
{ {
@@ -142,7 +143,7 @@ namespace Meteor.Map.lua
} }
catch (ScriptRuntimeException e) catch (ScriptRuntimeException e)
{ {
LuaEngine.SendError(player, String.Format("OnEventUpdated: {0}", e.DecoratedMessage)); LuaEngine.SendError(player, string.Format("OnEventUpdated: {0}", e.DecoratedMessage));
player.EndEvent(); player.EndEvent();
} }
} }
@@ -169,7 +170,7 @@ namespace Meteor.Map.lua
{ {
// todo: this is probably unnecessary as im not sure there were pets for players // todo: this is probably unnecessary as im not sure there were pets for players
if (!(actor.aiContainer.GetController<PetController>()?.GetPetMaster() is Player)) if (!(actor.aiContainer.GetController<PetController>()?.GetPetMaster() is Player))
path = String.Format("./scripts/unique/{0}/{1}/{2}.lua", actor.zone.zoneName, actor is BattleNpc ? "Monster" : "PopulaceStandard", ((Npc)actor).GetUniqueId()); path = string.Format("./scripts/unique/{0}/{1}/{2}.lua", actor.zone.zoneName, actor is BattleNpc ? "Monster" : "PopulaceStandard", ((Npc)actor).GetUniqueId());
} }
// dont wanna throw an error if file doesnt exist // dont wanna throw an error if file doesnt exist
if (File.Exists(path)) if (File.Exists(path))
@@ -357,7 +358,7 @@ namespace Meteor.Map.lua
{ {
if (target is Player) if (target is Player)
{ {
return String.Format(FILEPATH_PLAYER); return string.Format(FILEPATH_PLAYER);
} }
else if (target is Npc) else if (target is Npc)
{ {
@@ -365,25 +366,25 @@ namespace Meteor.Map.lua
} }
else if (target is Command) else if (target is Command)
{ {
return String.Format(FILEPATH_COMMANDS, target.GetName()); return string.Format(FILEPATH_COMMANDS, target.GetName());
} }
else if (target is Director) else if (target is Director)
{ {
return String.Format(FILEPATH_DIRECTORS, ((Director)target).GetScriptPath()); return string.Format(FILEPATH_DIRECTORS, ((Director)target).GetScriptPath());
} }
else if (target is PrivateAreaContent) else if (target is PrivateAreaContent)
{ {
return String.Format(FILEPATH_CONTENT, ((PrivateAreaContent)target).GetPrivateAreaName()); return string.Format(FILEPATH_CONTENT, ((PrivateAreaContent)target).GetPrivateAreaName());
} }
else if (target is Area) else if (target is Area)
{ {
return String.Format(FILEPATH_ZONE, ((Area)target).zoneName); return string.Format(FILEPATH_ZONE, ((Area)target).zoneName);
} }
else if (target is Quest) else if (target is Quest)
{ {
string initial = ((Quest)target).actorName.Substring(0, 3); string initial = ((Quest)target).actorName.Substring(0, 3);
string questName = ((Quest)target).actorName; string questName = ((Quest)target).actorName;
return String.Format(FILEPATH_QUEST, initial, questName); return string.Format(FILEPATH_QUEST, initial, questName);
} }
else else
return ""; return "";
@@ -409,18 +410,18 @@ namespace Meteor.Map.lua
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()));
} }
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()));
} }
if (parent == null && child == null) if (parent == null && child == null)
{ {
LuaEngine.SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName())); LuaEngine.SendError(player, string.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
} }
//Run Script //Run Script
@@ -457,18 +458,18 @@ namespace Meteor.Map.lua
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()));
} }
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()));
} }
if (parent == null && child == null) if (parent == null && child == null)
{ {
LuaEngine.SendError(player, String.Format("Could not find script for actor {0}.", target.GetName())); LuaEngine.SendError(player, string.Format("Could not find script for actor {0}.", target.GetName()));
return; return;
} }
@@ -524,13 +525,13 @@ namespace Meteor.Map.lua
else else
{ {
if (!optional) if (!optional)
SendError(player, String.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName())); SendError(player, string.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName()));
} }
} }
else else
{ {
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()));
} }
return null; return null;
} }
@@ -588,13 +589,13 @@ namespace Meteor.Map.lua
else else
{ {
if (!optional) if (!optional)
SendError(player, String.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName())); SendError(player, string.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName()));
} }
} }
else else
{ {
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()));
} }
} }
@@ -615,7 +616,7 @@ namespace Meteor.Map.lua
} }
catch (ScriptRuntimeException e) catch (ScriptRuntimeException e)
{ {
LuaEngine.SendError(player, String.Format("OnEventStarted: {0}", e.DecoratedMessage)); LuaEngine.SendError(player, string.Format("OnEventStarted: {0}", e.DecoratedMessage));
player.EndEvent(); player.EndEvent();
} }
} }
@@ -659,7 +660,7 @@ namespace Meteor.Map.lua
} }
#region RunGMCommand #region RunGMCommand
public static void RunGMCommand(Player player, String cmd, string[] param, bool help = false) public static void RunGMCommand(Player player, string cmd, string[] param, bool help = false)
{ {
bool playerNull = player == null; bool playerNull = player == null;
@@ -675,7 +676,7 @@ namespace Meteor.Map.lua
player = Server.GetWorldManager().GetPCInWorld(param[1] + " " + param[2]); player = Server.GetWorldManager().GetPCInWorld(param[1] + " " + param[2]);
// load from scripts/commands/gm/ directory // load from scripts/commands/gm/ directory
var path = String.Format("./scripts/commands/gm/{0}.lua", cmd.ToLower()); var path = string.Format("./scripts/commands/gm/{0}.lua", cmd.ToLower());
// check if the file exists // check if the file exists
if (File.Exists(path)) if (File.Exists(path))
@@ -746,7 +747,7 @@ namespace Meteor.Map.lua
// i hate to do this, but cant think of a better way to keep !help // i hate to do this, but cant think of a better way to keep !help
else if (help) else if (help)
{ {
player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, String.Format("[Commands] [{0}]", cmd), description); player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, string.Format("[Commands] [{0}]", cmd), description);
return; return;
} }
} }
@@ -850,6 +851,8 @@ 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["GetPassiveGLGamedata"] = (Func<uint, PassiveGuildleveData>)Server.GetPassiveGLGamedata;
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); };

View File

@@ -26,9 +26,9 @@ namespace Meteor.Map.lua
class LuaParam class LuaParam
{ {
public int typeID; public int typeID;
public Object value; public object value;
public LuaParam(int type, Object value) public LuaParam(int type, object value)
{ {
this.typeID = type; this.typeID = type;
this.value = value; this.value = value;

View File

@@ -25,6 +25,7 @@ using Meteor.Map.lua;
using MoonSharp.Interpreter; using MoonSharp.Interpreter;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
@@ -32,42 +33,41 @@ namespace Meteor.Map
{ {
class LuaUtils class LuaUtils
{ {
public class ItemRefParam public class ItemRefParam
{ {
public uint actorId; public uint actorId;
public byte unknown; public ushort slot;
public byte slot;
public byte itemPackage; public byte itemPackage;
public ItemRefParam(uint actorId, byte unknown, byte slot, byte itemPackage) public ItemRefParam(uint actorId, ushort slot, byte itemPackage)
{ {
this.actorId = actorId; this.actorId = actorId;
this.unknown = unknown;
this.slot = slot; this.slot = slot;
this.itemPackage = itemPackage; this.itemPackage = itemPackage;
} }
} }
public class ItemOfferParam public class MultiItemRefParam
{ {
public uint actorId; public readonly uint actorId;
public ushort offerSlot; public readonly ushort[] itemSlots;
public byte offerPackageId; public readonly byte[] itemPackages;
public byte unknown1; public readonly int numItems;
public ushort seekSlot;
public byte seekPackageId;
public byte unknown2;
public ItemOfferParam(uint actorId, ushort offerSlot, byte offerPackageId, byte unknown1, ushort seekSlot, byte seekPackageId, byte unknown2) public MultiItemRefParam(uint actorId, ushort[] itemSlots, byte[] itemPackages)
{ {
this.actorId = actorId; this.actorId = actorId;
this.offerSlot = offerSlot; this.itemSlots = itemSlots;
this.offerPackageId = offerPackageId; this.itemPackages = itemPackages;
this.unknown1 = unknown1; this.numItems = itemSlots.Length;
this.seekSlot = seekSlot; }
this.seekPackageId = seekPackageId;
this.unknown2 = unknown2; public MultiItemRefParam(uint actorId, ushort itemSlot, byte itemPackage)
{
this.actorId = actorId;
this.itemSlots = new ushort[] { itemSlot };
this.itemPackages = new byte[] { itemPackage };
numItems = 1;
} }
} }
@@ -126,23 +126,37 @@ namespace Meteor.Map
break; break;
case 0x7: //Item Reference to Inventory Spot case 0x7: //Item Reference to Inventory Spot
{ {
uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32()); uint actorId = Utils.SwapEndian(reader.ReadUInt32());
byte type7Unknown = reader.ReadByte(); ushort slot = Utils.SwapEndian(reader.ReadUInt16());
byte type7Slot = reader.ReadByte(); byte itemPackage = reader.ReadByte();
byte type7InventoryType = reader.ReadByte(); value = new MultiItemRefParam(actorId, slot, itemPackage);
value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
} }
break; break;
case 0x8: //Used for offering case 0x8: //Multi Item Reference to Inventory Spot
{ {
long currentPosition = reader.BaseStream.Position - 1;
uint actorId = Utils.SwapEndian(reader.ReadUInt32()); uint actorId = Utils.SwapEndian(reader.ReadUInt32());
ushort rewardSlot = Utils.SwapEndian(reader.ReadUInt16()); ushort itemSlot0 = Utils.SwapEndian(reader.ReadUInt16());
byte rewardPackageId = reader.ReadByte(); byte packageId0 = reader.ReadByte();
byte unk1 = reader.ReadByte(); //Always 0x2?
ushort seekSlot = Utils.SwapEndian(reader.ReadUInt16()); byte numberOfEntries = reader.ReadByte();
byte seekPackageId = reader.ReadByte();
byte unk2 = reader.ReadByte(); //Always 0xD? ushort[] itemSlots = new ushort[numberOfEntries];
value = new ItemOfferParam(actorId, rewardSlot, rewardPackageId, unk1, seekSlot, seekPackageId, unk2); byte[] packageIds = new byte[numberOfEntries];
itemSlots[0] = itemSlot0;
packageIds[0] = packageId0;
for (int i = 1; i < numberOfEntries; i++)
{
itemSlots[i] = Utils.SwapEndian(reader.ReadUInt16());
packageIds[i] = reader.ReadByte();
}
byte byteSize = reader.ReadByte();
reader.BaseStream.Seek(currentPosition + byteSize, SeekOrigin.Begin);
value = new MultiItemRefParam(actorId, itemSlots, packageIds);
} }
break; break;
case 0x9: //Two Longs (only storing first one) case 0x9: //Two Longs (only storing first one)
@@ -158,19 +172,13 @@ namespace Meteor.Map
isDone = true; isDone = true;
continue; continue;
default: default:
throw new ArgumentException("Unknown lua param..."); throw new ArgumentOutOfRangeException();
} }
if (isDone) if (isDone)
break; break;
//Special case cause fuck Type8 if (value != null)
if (value != null && value is ItemOfferParam)
{
luaParams.Add(new LuaParam(code, value));
luaParams.Add(new LuaParam(0x5, null)); //This is to clean up the seek script as it fucks with the args.
}
else if (value != null)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
else if (wasNil) else if (wasNil)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
@@ -225,23 +233,41 @@ namespace Meteor.Map
case 0x6: //Actor (By Id) case 0x6: //Actor (By Id)
value = Utils.SwapEndian(reader.ReadUInt32()); value = Utils.SwapEndian(reader.ReadUInt32());
break; break;
case 0x7: //Weird one used for inventory case 0x7: //Item Reference
uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32()); {
byte type7Unknown = reader.ReadByte(); uint actorId = Utils.SwapEndian(reader.ReadUInt32());
byte type7Slot = reader.ReadByte(); ushort slot = Utils.SwapEndian(reader.ReadUInt16());
byte type7InventoryType = reader.ReadByte(); byte itemPackage = reader.ReadByte();
value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType); value = new ItemRefParam(actorId, slot, itemPackage);
break; break;
case 0x8: }
uint actorId = Utils.SwapEndian(reader.ReadUInt32()); case 0x8: //Multi Item Reference
ushort rewardSlot = Utils.SwapEndian(reader.ReadUInt16()); {
byte rewardPackageId = reader.ReadByte(); long currentPosition = reader.BaseStream.Position - 1;
byte unk1 = reader.ReadByte(); //Always 0x2? uint actorId = Utils.SwapEndian(reader.ReadUInt32());
ushort seekSlot = Utils.SwapEndian(reader.ReadUInt16()); ushort itemSlot0 = Utils.SwapEndian(reader.ReadUInt16());
byte seekPackageId = reader.ReadByte(); byte packageId0 = reader.ReadByte();
byte unk2 = reader.ReadByte(); //Always 0xD?
value = new ItemOfferParam(actorId, rewardSlot, rewardPackageId, unk1, seekSlot, seekPackageId, unk2); byte numberOfEntries = reader.ReadByte();
break;
ushort[] itemSlots = new ushort[numberOfEntries];
byte[] packageIds = new byte[numberOfEntries];
itemSlots[0] = itemSlot0;
packageIds[0] = packageId0;
for (int i = 1; i < numberOfEntries; i++)
{
itemSlots[i] = Utils.SwapEndian(reader.ReadUInt16());
packageIds[i] = reader.ReadByte();
}
byte byteSize = reader.ReadByte();
reader.BaseStream.Seek(currentPosition + byteSize, SeekOrigin.Begin);
value = new MultiItemRefParam(actorId, itemSlots, packageIds);
break;
}
case 0x9: //Two Longs (only storing first one) case 0x9: //Two Longs (only storing first one)
value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64())); value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64()));
break; break;
@@ -261,12 +287,7 @@ namespace Meteor.Map
if (isDone) if (isDone)
break; break;
if (value != null && value is ItemOfferParam) if (value != null)
{
luaParams.Add(new LuaParam(code, value));
luaParams.Add(new LuaParam(0x5, null)); //This is to clean up the seek script as it fucks with the args.
}
else if (value != null)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
else if (wasNil) else if (wasNil)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
@@ -287,22 +308,22 @@ namespace Meteor.Map
foreach (LuaParam l in luaParams) foreach (LuaParam l in luaParams)
{ {
if (l.typeID == 0x1) if (l.typeID == 0x1)
writer.Write((Byte)0); writer.Write((byte)0);
else else
writer.Write((Byte)l.typeID); writer.Write((byte)l.typeID);
switch (l.typeID) switch (l.typeID)
{ {
case 0x0: //Int32 case 0x0: //Int32
writer.Write((Int32)Utils.SwapEndian((Int32)l.value)); writer.Write((int)Utils.SwapEndian((int)l.value));
break; break;
case 0x1: //Int32 case 0x1: //Int32
writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value)); writer.Write((uint)Utils.SwapEndian((uint)l.value));
break; break;
case 0x2: //Null Termed String case 0x2: //Null Termed String
string sv = (string)l.value; string sv = (string)l.value;
writer.Write(Encoding.ASCII.GetBytes(sv), 0, Encoding.ASCII.GetByteCount(sv)); writer.Write(Encoding.ASCII.GetBytes(sv), 0, Encoding.ASCII.GetByteCount(sv));
writer.Write((Byte)0); writer.Write((byte)0);
break; break;
case 0x3: //Boolean True case 0x3: //Boolean True
break; break;
@@ -311,21 +332,23 @@ namespace Meteor.Map
case 0x5: //Nil case 0x5: //Nil
break; break;
case 0x6: //Actor (By Id) case 0x6: //Actor (By Id)
writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value)); writer.Write((uint)Utils.SwapEndian((uint)l.value));
break; break;
case 0x7: //Weird one used for inventory case 0x7: //Weird one used for inventory
ItemRefParam type7 = (ItemRefParam)l.value; ItemRefParam type7 = (ItemRefParam)l.value;
writer.Write((UInt32)Utils.SwapEndian((UInt32)type7.actorId)); writer.Write((uint)Utils.SwapEndian((uint)type7.actorId));
writer.Write((Byte)type7.unknown); writer.Write((ushort)type7.slot);
writer.Write((Byte)type7.slot); writer.Write((byte)type7.itemPackage);
writer.Write((Byte)type7.itemPackage); break;
case 0x8:
//TODO: Fill it out even if not used
break; break;
case 0x9: //Two Longs (only storing first one) case 0x9: //Two Longs (only storing first one)
writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item1)); writer.Write((ulong)Utils.SwapEndian(((Type9Param)l.value).item1));
writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item2)); writer.Write((ulong)Utils.SwapEndian(((Type9Param)l.value).item2));
break; break;
case 0xC: //Byte case 0xC: //Byte
writer.Write((Byte)l.value); writer.Write((byte)l.value);
break; break;
case 0x1B: //Short? case 0x1B: //Short?
break; break;
@@ -334,7 +357,7 @@ namespace Meteor.Map
} }
} }
writer.Write((Byte)0xF); writer.Write((byte)0xF);
} }
public static List<LuaParam> CreateLuaParamList(DynValue fromScript) public static List<LuaParam> CreateLuaParamList(DynValue fromScript)
@@ -417,7 +440,7 @@ namespace Meteor.Map
{ {
luaParams.Add(new LuaParam(0x1, (uint)o)); luaParams.Add(new LuaParam(0x1, (uint)o));
} }
else if (o is Double) else if (o is double)
{ {
if (((double)o) % 1 == 0) if (((double)o) % 1 == 0)
luaParams.Add(new LuaParam(0x0, (int)(double)o)); luaParams.Add(new LuaParam(0x0, (int)(double)o));
@@ -445,9 +468,9 @@ namespace Meteor.Map
{ {
luaParams.Add(new LuaParam(0x7, (ItemRefParam)o)); luaParams.Add(new LuaParam(0x7, (ItemRefParam)o));
} }
else if (o is ItemOfferParam) else if (o is MultiItemRefParam)
{ {
luaParams.Add(new LuaParam(0x8, (ItemOfferParam)o)); luaParams.Add(new LuaParam(0x8, (MultiItemRefParam)o));
} }
else if (o is Type9Param) else if (o is Type9Param)
{ {
@@ -481,13 +504,13 @@ namespace Meteor.Map
switch (lParams[i].typeID) switch (lParams[i].typeID)
{ {
case 0x0: //Int32 case 0x0: //Int32
dumpString += String.Format("0x{0:X}", (int)lParams[i].value); dumpString += string.Format("0x{0:X}", (int)lParams[i].value);
break; break;
case 0x1: //Int32 case 0x1: //Int32
dumpString += String.Format("0x{0:X}", (uint)lParams[i].value); dumpString += string.Format("0x{0:X}", (uint)lParams[i].value);
break; break;
case 0x2: //Null Termed String case 0x2: //Null Termed String
dumpString += String.Format("\"{0}\"", (string)lParams[i].value); dumpString += string.Format("\"{0}\"", (string)lParams[i].value);
break; break;
case 0x3: //Boolean True case 0x3: //Boolean True
dumpString += "true"; dumpString += "true";
@@ -495,29 +518,39 @@ namespace Meteor.Map
case 0x4: //Boolean False case 0x4: //Boolean False
dumpString += "false"; dumpString += "false";
break; break;
case 0x5: //NULL??? case 0x5: //Null
dumpString += "nil"; dumpString += "nil";
break; break;
case 0x6: //Actor (By Id) case 0x6: //Actor (By Id)
dumpString += String.Format("0x{0:X}", (uint)lParams[i].value); dumpString += string.Format("0x{0:X}", (uint)lParams[i].value);
break; break;
case 0x7: //Weird one used for inventory case 0x7: //Single Item Reference
ItemRefParam type7Param = ((ItemRefParam)lParams[i].value); ItemRefParam type7Param = ((ItemRefParam)lParams[i].value);
dumpString += String.Format("Type7 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X})", type7Param.actorId, type7Param.unknown, type7Param.slot, type7Param.itemPackage); dumpString += string.Format("Item Ref: (0x{0:X}, 0x{1:X}, 0x{2:X})", type7Param.actorId, type7Param.slot, type7Param.itemPackage);
break; break;
case 0x8: //Weird one used for inventory case 0x8: //Multi Item Reference
ItemOfferParam itemOfferParam = ((ItemOfferParam)lParams[i].value); MultiItemRefParam multiItemRef = ((MultiItemRefParam)lParams[i].value);
dumpString += String.Format("Type8 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X}, 0x{4:X}, 0x{5:X}, 0x{6:X})", itemOfferParam.actorId, itemOfferParam.offerSlot, itemOfferParam.offerPackageId, itemOfferParam.unknown1, itemOfferParam.seekSlot, itemOfferParam.seekPackageId, itemOfferParam.unknown2); string array = "";
for (int j = 0; j < multiItemRef.itemSlots.Length; j++)
{
if (j + 1 != multiItemRef.itemSlots.Length)
array += string.Format("[0x{0:X}, 0x{1:X}], ", multiItemRef.itemSlots[j], multiItemRef.itemPackages[j]);
else
array += string.Format("[0x{0:X}, 0x{1:X}]", multiItemRef.itemSlots[j], multiItemRef.itemPackages[j]);
}
dumpString += string.Format("Item Ref: (0x{0:X}, [{1}])", multiItemRef.actorId, array);
break; break;
case 0x9: //Long (+ 8 bytes ignored) case 0x9: //Long (+ 8 bytes ignored)
Type9Param type9Param = ((Type9Param)lParams[i].value); Type9Param type9Param = ((Type9Param)lParams[i].value);
dumpString += String.Format("Type9 Param: (0x{0:X}, 0x{1:X})", type9Param.item1, type9Param.item2); dumpString += string.Format("Type9 Param: (0x{0:X}, 0x{1:X})", type9Param.item1, type9Param.item2);
break; break;
case 0xC: //Byte case 0xC: //Byte
dumpString += String.Format("0x{0:X}", (byte)lParams[i].value); dumpString += string.Format("0x{0:X}", (byte)lParams[i].value);
break; break;
case 0x1B: //Short? case 0x1B: //Short?
dumpString += String.Format("0x{0:X}", (ushort)lParams[i].value); dumpString += string.Format("0x{0:X}", (ushort)lParams[i].value);
break; break;
case 0xF: //End case 0xF: //End
break; break;

View File

@@ -164,10 +164,15 @@
<Compile Include="Actors\Group\Work\PartyWork.cs" /> <Compile Include="Actors\Group\Work\PartyWork.cs" />
<Compile Include="Actors\Group\Work\RelationWork.cs" /> <Compile Include="Actors\Group\Work\RelationWork.cs" />
<Compile Include="Actors\Judge\Judge.cs" /> <Compile Include="Actors\Judge\Judge.cs" />
<Compile Include="Actors\Quest\Scenario.cs" />
<Compile Include="Actors\Quest\PassiveGuildleve.cs" />
<Compile Include="Actors\Quest\Quest.cs" /> <Compile Include="Actors\Quest\Quest.cs" />
<Compile Include="Actors\StaticActors.cs" /> <Compile Include="Actors\StaticActors.cs" />
<Compile Include="Actors\World\WorldMaster.cs" /> <Compile Include="Actors\World\WorldMaster.cs" />
<Compile Include="DataObjects\PassiveGuildleveData.cs" />
<Compile Include="DataObjects\GuildleveData.cs" /> <Compile Include="DataObjects\GuildleveData.cs" />
<Compile Include="DataObjects\Recipe.cs" />
<Compile Include="DataObjects\RecipeResolver.cs" />
<Compile Include="DataObjects\TradeTransaction.cs" /> <Compile Include="DataObjects\TradeTransaction.cs" />
<Compile Include="DataObjects\ZoneConnection.cs" /> <Compile Include="DataObjects\ZoneConnection.cs" />
<Compile Include="CommandProcessor.cs" /> <Compile Include="CommandProcessor.cs" />

View File

@@ -27,6 +27,7 @@ using Meteor.Map.dataobjects;
using Meteor.Common; using Meteor.Common;
using Meteor.Map.Actors; using Meteor.Map.Actors;
using Meteor.Map.DataObjects;
namespace Meteor.Map namespace Meteor.Map
{ {
@@ -47,11 +48,15 @@ namespace Meteor.Map
private static CommandProcessor mCommandProcessor = new CommandProcessor(); private static CommandProcessor mCommandProcessor = new CommandProcessor();
private static ZoneConnection mWorldConnection = new ZoneConnection(); private static ZoneConnection mWorldConnection = new ZoneConnection();
private static WorldManager mWorldManager; private static WorldManager mWorldManager;
private static Dictionary<uint, ItemData> mGamedataItems;
private static Dictionary<uint, GuildleveData> mGamedataGuildleves;
private static StaticActors mStaticActors; private static StaticActors mStaticActors;
private PacketProcessor mProcessor; private PacketProcessor mProcessor;
//Game Data
private static Dictionary<uint, ItemData> gamedataItems;
private static Dictionary<uint, GuildleveData> gamedataGuildleves;
private static Dictionary<uint, PassiveGuildleveData> gamedataPassiveGL;
private static RecipeResolver gamedataRecipeResolver;
public Server() public Server()
{ {
@@ -62,10 +67,14 @@ namespace Meteor.Map
{ {
mStaticActors = new StaticActors(STATIC_ACTORS_PATH); mStaticActors = new StaticActors(STATIC_ACTORS_PATH);
mGamedataItems = Database.GetItemGamedata(); gamedataItems = Database.GetItemGamedata();
Program.Log.Info("Loaded {0} items.", mGamedataItems.Count); Program.Log.Info("Loaded {0} items.", gamedataItems.Count);
mGamedataGuildleves = Database.GetGuildleveGamedata(); gamedataGuildleves = Database.GetGuildleveGamedata();
Program.Log.Info("Loaded {0} guildleves.", mGamedataGuildleves.Count); Program.Log.Info("Loaded {0} guildleves.", gamedataGuildleves.Count);
gamedataPassiveGL = Database.GetPassiveGuildleveGamedata();
Program.Log.Info("Loaded {0} passive (local) guildleves.", gamedataPassiveGL.Count);
gamedataRecipeResolver = RecipeResolver.Init();
Program.Log.Info("Loaded {0} crafting recipes.", gamedataRecipeResolver.GetNumRecipes());
mWorldManager = new WorldManager(this); mWorldManager = new WorldManager(this);
mWorldManager.LoadZoneList(); mWorldManager.LoadZoneList();
@@ -299,7 +308,7 @@ namespace Meteor.Map
public static Dictionary<uint, ItemData> GetGamedataItems() public static Dictionary<uint, ItemData> GetGamedataItems()
{ {
return mGamedataItems; return gamedataItems;
} }
public static Actor GetStaticActors(uint id) public static Actor GetStaticActors(uint id)
@@ -314,19 +323,31 @@ namespace Meteor.Map
public static ItemData GetItemGamedata(uint id) public static ItemData GetItemGamedata(uint id)
{ {
if (mGamedataItems.ContainsKey(id)) if (gamedataItems.ContainsKey(id))
return mGamedataItems[id]; return gamedataItems[id];
else else
return null; return null;
} }
public static GuildleveData GetGuildleveGamedata(uint id) public static GuildleveData GetGuildleveGamedata(uint id)
{ {
if (mGamedataGuildleves.ContainsKey(id)) if (gamedataGuildleves.ContainsKey(id))
return mGamedataGuildleves[id]; return gamedataGuildleves[id];
else else
return null; return null;
} }
public static PassiveGuildleveData GetPassiveGLGamedata(uint id)
{
if (gamedataPassiveGL.ContainsKey(id))
return gamedataPassiveGL[id];
else
return null;
}
public static RecipeResolver ResolveRecipe()
{
return gamedataRecipeResolver;
}
} }
} }

View File

@@ -68,7 +68,7 @@ namespace Meteor.Map.utils
return faceInfo; return faceInfo;
} }
public static UInt32 GetTribeModel(byte tribe) public static uint GetTribeModel(byte tribe)
{ {
switch (tribe) switch (tribe)
{ {