mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Fixed command bug on class change. Implmented more of the local levequest errors and such.
This commit is contained in:
parent
eca510c489
commit
6d66f6aae3
@ -154,20 +154,22 @@ local skillAnim = {
|
|||||||
[29531] = 0x10009002;
|
[29531] = 0x10009002;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local craftStartWidgetOpen = false;
|
||||||
|
|
||||||
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;
|
local 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;
|
local MENU_RECENT, MENU_AWARDED, MENU_RECENT_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
|
||||||
|
|
||||||
local debugMessage = false;
|
local debugMessage = false;
|
||||||
|
|
||||||
local craftStartWidgetOpen = false;
|
|
||||||
local isRecipeRecentSent = false;
|
local isRecipeRecentSent = false;
|
||||||
local isRecipeAwardSent = false;
|
local isRecipeAwardSent = false;
|
||||||
|
|
||||||
local craftJudge = GetStaticActor("CraftJudge");
|
local craftJudge = GetStaticActor("CraftJudge");
|
||||||
local recipeResolver = GetRecipeResolver();
|
local recipeResolver = GetRecipeResolver();
|
||||||
|
|
||||||
local chosenOperation;
|
local operationResult;
|
||||||
|
local operationMode;
|
||||||
local recipeMode;
|
local recipeMode;
|
||||||
local chosenMaterials;
|
local chosenMaterials;
|
||||||
|
|
||||||
@ -183,9 +185,9 @@ function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg
|
|||||||
|
|
||||||
player:ChangeState(30);
|
player:ChangeState(30);
|
||||||
|
|
||||||
while chosenOperation ~= 0 do
|
while operationMode ~= 0 do
|
||||||
|
|
||||||
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: "..tostring(chosenOperation).." Recipe : "..tostring(recipeMode).." Quest : "..chosenQuest); end
|
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: "..tostring(operationMode).." Recipe : "..tostring(recipeMode).." Quest : "..chosenQuest); end
|
||||||
|
|
||||||
-- Operate the start crafting window... confusing shit
|
-- Operate the start crafting window... confusing shit
|
||||||
if (craftStartWidgetOpen == false) then
|
if (craftStartWidgetOpen == false) then
|
||||||
@ -194,32 +196,63 @@ function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg
|
|||||||
if (isRequestedItemsMode == true) then -- If requested items, preload the quest recipe materials
|
if (isRequestedItemsMode == true) then -- If requested items, preload the quest recipe materials
|
||||||
startMats = recipeResolver.RecipeToMatIdTable(currentCraftQuestGuildleve.getRecipe());
|
startMats = recipeResolver.RecipeToMatIdTable(currentCraftQuestGuildleve.getRecipe());
|
||||||
end
|
end
|
||||||
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequestedItemsMode, unpack(startMats));
|
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequestedItemsMode, unpack(startMats))};
|
||||||
craftStartWidgetOpen = true;
|
craftStartWidgetOpen = true;
|
||||||
elseif ((chosenOperation == MENU_RECENT or chosenOperation == MENU_AWARDED) and recipeMode != 0) then
|
elseif ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and chosenOperation[2] != 0) then
|
||||||
local prepedMaterials;
|
local prepedMaterials;
|
||||||
-- Recent Recipes/Awarded Recipes
|
-- Recent Recipes/Awarded Recipes
|
||||||
if (chosenOperation == MENU_RECENT) then
|
if (operationMode == MENU_RECENT) then
|
||||||
prepedMaterials = recipeResolver.RecipeToMatIdTable(recentRecipes[recipeMode]);
|
prepedMaterials = recipeResolver.RecipeToMatIdTable(recentRecipes[chosenOperation[2]]);
|
||||||
else
|
else
|
||||||
prepedMaterials = recipeResolver.RecipeToMatIdTable(awardedRecipes[recipeMode]);
|
prepedMaterials = recipeResolver.RecipeToMatIdTable(awardedRecipes[chosenOperation[2]]);
|
||||||
end
|
end
|
||||||
-- Causes the item info window to appear for recent/awarded recipes. Only happens if a recipe was chosen.
|
-- Causes the item info window to appear for recent/awarded recipes. Only happens if a recipe was chosen.
|
||||||
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequestedItemsMode, unpack(prepedMaterials));
|
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequestedItemsMode, unpack(prepedMaterials))};
|
||||||
else
|
else
|
||||||
-- Keep window going if the user "returned" to the starting point
|
-- Keep window going if the user "returned" to the starting point
|
||||||
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequestedItemsMode);
|
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequestedItemsMode)};
|
||||||
end
|
end
|
||||||
|
|
||||||
|
operationMode = operationResult[1];
|
||||||
|
recipeMode = operationResult[2];
|
||||||
|
|
||||||
-- Operation
|
-- Operation
|
||||||
if chosenOperation == MENU_CANCEL then
|
if operationMode == MENU_CANCEL then
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
|
closeCraftStartWidget(player, craftJudge, commandactor);
|
||||||
elseif (chosenOperation == MENU_MAINHAND or chosenOperation == MENU_OFFHAND) then
|
elseif (operationMode == MENU_MAINHAND or operationMode == MENU_OFFHAND) then
|
||||||
-- Recipe choosing loop
|
-- Recipe choosing loop
|
||||||
while (true) do
|
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
|
-- Choosing a recipe from the given materials
|
||||||
local recipes = recipeResolver.GetRecipeFromMats();
|
local recipes = recipeResolver.GetRecipeFromMats(unpack(materials));
|
||||||
local itemIds = recipeResolver.RecipesToItemIdTable(recipes);
|
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));
|
local chosenRecipeIndex = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds));
|
||||||
|
|
||||||
-- Hit back on recipe list
|
-- Hit back on recipe list
|
||||||
@ -240,18 +273,23 @@ function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg
|
|||||||
0);
|
0);
|
||||||
|
|
||||||
if recipeConfirmed then
|
if recipeConfirmed then
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
|
closeCraftStartWidget(player, craftJudge, commandactor);
|
||||||
isRecipeRecentSent = false;
|
isRecipeRecentSent = false;
|
||||||
isRecipeAwardSent = false;
|
isRecipeAwardSent = false;
|
||||||
currentlyCrafting = startCrafting(player, chosenOperation, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
|
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, currentCraftQuestGuildleve, 80, 100, 50);
|
||||||
|
|
||||||
|
--Once crafting is over, return to the original non-quest state.
|
||||||
|
isRequestedItemsMode = false;
|
||||||
|
currentCraftQuestGuildleve = nil;
|
||||||
|
currentCraftQuest = nil;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- End of Recipe choosing loops
|
-- End of Recipe choosing loops
|
||||||
elseif chosenOperation == MENU_REQUEST then -- Conditional button label based on isRequestedItemsMode
|
elseif operationMode == MENU_REQUEST then -- Conditional button label based on isRequestedItemsMode
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
|
closeCraftStartWidget(player, craftJudge, commandactor);
|
||||||
craftStartWidgetOpen = false;
|
|
||||||
|
|
||||||
if isRequestedItemsMode == false then -- "Request Items" hit, close Start and open up the Quest select
|
if isRequestedItemsMode == false then -- "Request Items" hit, close Start and open up the Quest select
|
||||||
isRecipeRecentSent = false;
|
isRecipeRecentSent = false;
|
||||||
@ -271,22 +309,22 @@ function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg
|
|||||||
currentCraftQuestGuildleve = nil;
|
currentCraftQuestGuildleve = nil;
|
||||||
currentCraftQuest = nil;
|
currentCraftQuest = nil;
|
||||||
end
|
end
|
||||||
elseif chosenOperation == MENU_RECENT then -- "Recipes" button hit
|
elseif operationMode == MENU_RECENT then -- "Recipes" button hit
|
||||||
if isRecipeRecentSent == false then
|
if isRecipeRecentSent == false then
|
||||||
recentRecipes = player.GetRecentRecipes();
|
recentRecipes = player.GetRecentRecipes();
|
||||||
local itemIds = recipeResolver.RecipesToItemIdTable(recentRecipes);
|
local itemIds = recipeResolver.RecipesToItemIdTable(recentRecipes);
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up recipe list
|
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up recipe list
|
||||||
isRecipeRecentSent = true;
|
isRecipeRecentSent = true;
|
||||||
end
|
end
|
||||||
elseif chosenOperation == MENU_AWARDED then -- "Awarded Recipes" tab hit
|
elseif operationMode == MENU_AWARDED then -- "Awarded Recipes" tab hit
|
||||||
if isRecipeAwardSent == false then
|
if isRecipeAwardSent == false then
|
||||||
awardedRecipes = player.GetAwardedRecipes();
|
awardedRecipes = player.GetAwardedRecipes();
|
||||||
local itemIds = recipeResolver.RecipesToItemIdTable(awardedRecipes);
|
local itemIds = recipeResolver.RecipesToItemIdTable(awardedRecipes);
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up Award list
|
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up Award list
|
||||||
isRecipeAwardSent = true;
|
isRecipeAwardSent = true;
|
||||||
end
|
end
|
||||||
elseif ((chosenOperation == MENU_RECENT_DETAILED or chosenOperation == MENU_AWARDED_DETAILED) and recipeMode > 0) then -- Pop-up for an item's stats/craft mats on a recent recipe
|
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
|
||||||
local chosenRecipe = chosenOperation == MENU_RECENT_DETAILED and recentRecipes[recipeMode-1] or recentRecipes[awardedMode-1];
|
local chosenRecipe = operationMode == MENU_RECENT_DETAILED and recentRecipes[recipeMode-1] or recentRecipes[awardedMode-1];
|
||||||
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
|
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
|
||||||
chosenRecipe.resultItemID,
|
chosenRecipe.resultItemID,
|
||||||
chosenRecipe.resultQuantity,
|
chosenRecipe.resultQuantity,
|
||||||
@ -297,10 +335,10 @@ function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg
|
|||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
if (recipeConfirmed) then
|
if (recipeConfirmed) then
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
|
closeCraftStartWidget(player, craftJudge, commandactor);
|
||||||
isRecipeRecentSent = false;
|
isRecipeRecentSent = false;
|
||||||
isRecipeAwardSent = false;
|
isRecipeAwardSent = false;
|
||||||
currentlyCrafting = startCrafting(player, chosenOperation, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
|
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -323,6 +361,7 @@ function getCraftQuest(player, craftJudge, commandactor);
|
|||||||
if questCommandId then
|
if questCommandId then
|
||||||
questId = questCommandId - 0xA0F00000;
|
questId = questCommandId - 0xA0F00000;
|
||||||
|
|
||||||
|
-- Craft Quest Chosen
|
||||||
if isCraftQuest(questId) then
|
if isCraftQuest(questId) then
|
||||||
local quest = player.GetQuest(questId);
|
local quest = player.GetQuest(questId);
|
||||||
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, quest.getQuestId(), 20, 1, 1, 1, 0, 0, "<Path Companion>");
|
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, quest.getQuestId(), 20, 1, 1, 1, 0, 0, "<Path Companion>");
|
||||||
@ -330,32 +369,44 @@ function getCraftQuest(player, craftJudge, commandactor);
|
|||||||
player:SendGameMessage(craftJudge, 21, 0x20);
|
player:SendGameMessage(craftJudge, 21, 0x20);
|
||||||
return quest;
|
return quest;
|
||||||
end
|
end
|
||||||
|
-- PassiveGL Quest Chosen
|
||||||
elseif isLocalLeve(questId) then
|
elseif isLocalLeve(questId) then
|
||||||
local difficulty = 0;
|
local difficulty = 0;
|
||||||
local hasMaterials = 1;
|
local hasMaterials = 1;
|
||||||
|
|
||||||
local quest = player.getQuestGuildleve(questId);
|
local quest = player:getQuestGuildleve(questId);
|
||||||
|
|
||||||
if (quest ~= nil) then
|
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,
|
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor,
|
||||||
quest.getQuestId(),
|
quest:getQuestId(),
|
||||||
quest.getCurrentDifficulty(),
|
quest:getCurrentDifficulty() + 1, -- Lua, 1-indexed
|
||||||
0,
|
0,
|
||||||
quest.getNumberOfSuccesses(),
|
quest:getCurrentCrafted(),
|
||||||
quest.getRemainingMaterials(),
|
quest:getRemainingMaterials(),
|
||||||
quest.hasMaterials() and 1 or 0, -- Fucked up way of doing terneries on Lua
|
quest:hasMaterials() and 1 or 0, -- Fucked up way of doing terneries on Lua
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Quest confirmed
|
||||||
if (confirm == true) then
|
if (confirm == true) then
|
||||||
return quest;
|
return quest;
|
||||||
end
|
end
|
||||||
else
|
|
||||||
return nil; -- Shouldn't happen unless db corrupted
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
return nil; -- Shouldn't happen unless db fucked with
|
||||||
|
end
|
||||||
|
-- Scenario Quest Chosen
|
||||||
else
|
else
|
||||||
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
|
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
|
||||||
player:SendGameMessage(GetWorldMaster(), 40209, 0x20);
|
player:SendGameMessage(GetWorldMaster(), 40209, 0x20); -- You cannot undertake that endeavor.
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return nil;
|
return nil;
|
||||||
@ -364,7 +415,6 @@ function getCraftQuest(player, craftJudge, commandactor);
|
|||||||
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
|
||||||
@ -383,7 +433,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
|
||||||
@ -391,12 +440,15 @@ 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, recipe, quest, startDur, startQly, startHQ)
|
function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, startDur, startQly, startHQ)
|
||||||
|
|
||||||
local worldMaster = GetWorldMaster();
|
local worldMaster = GetWorldMaster();
|
||||||
local itemId = recipe.resultItemID;
|
|
||||||
local progress = 0;
|
local progress = 0;
|
||||||
local attempts = 5;
|
local attempts = 5;
|
||||||
local craftedCount = 0;
|
local craftedCount = 0;
|
||||||
@ -406,20 +458,35 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ)
|
|||||||
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(30,50);
|
||||||
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 progress >= 100 then
|
if (progress >= 100) then
|
||||||
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8); -- "You create <#3 quantity> <#1 item> <#2 quality>."
|
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor);
|
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor);
|
||||||
|
|
||||||
|
-- Handle local levequest craft success
|
||||||
if quest then
|
if quest then
|
||||||
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalLeve", 120001, itemId, craftedCount, craftTotal, attempts);
|
quest:craftSuccess();
|
||||||
|
|
||||||
if continueLeve == true then
|
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 == 1) then
|
||||||
progress = 0;
|
progress = 0;
|
||||||
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
|
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
|
||||||
else
|
else
|
||||||
@ -428,14 +495,18 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
end
|
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
|
||||||
|
|
||||||
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]);
|
||||||
@ -445,10 +516,10 @@ function startCrafting(player, hand, recipe, 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
|
||||||
progress = progress + progDiff;
|
progress = progress + progDiff;
|
||||||
|
|
||||||
if progress >= 100 then
|
if (progress >= 100) then
|
||||||
progress = 100;
|
progress = 100;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -465,6 +536,4 @@ function startCrafting(player, hand, recipe, quest, startDur, startQly, startHQ)
|
|||||||
--testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 29501, 24233, 29501,29501, 24223, 29501,12008,12004);
|
--testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 29501, 24233, 29501,29501, 24223, 29501,12008,12004);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return -1;
|
|
||||||
end
|
end
|
@ -47,8 +47,3 @@ function main(thisDirector)
|
|||||||
thisDirector:UpdateAimNumNow(0, 3);
|
thisDirector:UpdateAimNumNow(0, 3);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function attentionMessage(player, textId, ...)
|
|
||||||
player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...);
|
|
||||||
player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...);
|
|
||||||
end
|
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -1265,6 +1265,12 @@ namespace Meteor.Map.Actors
|
|||||||
charaWork.command[16] = 0xA0F00000 | 22005; //Herd
|
charaWork.command[16] = 0xA0F00000 | 22005; //Herd
|
||||||
charaWork.command[17] = 0xA0F00000 | 22009; //Herd 2
|
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)
|
||||||
|
@ -74,6 +74,7 @@ namespace Meteor.Map.Actors
|
|||||||
{
|
{
|
||||||
currentCrafted += (short) targetRecipe.resultQuantity;
|
currentCrafted += (short) targetRecipe.resultQuantity;
|
||||||
currentAttempt++;
|
currentAttempt++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CraftFail()
|
public void CraftFail()
|
||||||
|
Loading…
Reference in New Issue
Block a user