mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 14:04:41 +02:00
Added all the shop keeper scripts in Ul'dah. Fixed some broken populace scripts. Changed .ini files, wrong default. Fixed a syntax error in CommandProcessor.cs.
This commit is contained in:
parent
5b7ad2364b
commit
136ced3aae
32 changed files with 252 additions and 51 deletions
|
@ -5,6 +5,6 @@ function init(npc)
|
|||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
player:callClientFunction(player, "bookTalk");
|
||||
callClientFunction(player, "bookTalk");
|
||||
player:EndEvent();
|
||||
end
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
player:RunEventFunction("materiabookTalk");
|
||||
end
|
||||
|
||||
function onEventUpdate(player, npc, step, menuOptionSelected)
|
||||
player:EndEvent();
|
||||
callClientFunction(player, "materiabookTalk");
|
||||
player:EndEvent();
|
||||
end
|
|
@ -1,10 +1,11 @@
|
|||
require ("global")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
end
|
||||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function onEventUpdate(player, npc)
|
||||
|
||||
end
|
|
@ -37,53 +37,121 @@ end
|
|||
|
||||
function onEventStarted(player, npc, triggerName)
|
||||
|
||||
require("/unique/".. npc.zone.zoneName .."/PopulaceShopSalesman/" .. npc:GetUniqueId())
|
||||
require("/unique/".. npc.zone.zoneName .."/PopulaceShopSalesman/" .. npc:GetUniqueId())
|
||||
|
||||
callClientFunction(player, "welcomeTalk", shopInfo.welcomeText, player);
|
||||
|
||||
while (true) do
|
||||
choice = callClientFunction(player, "selectMode", 1);
|
||||
|
||||
tutorialId = -8;
|
||||
|
||||
if (shopInfo.tutorialId ~= nil) then
|
||||
tutorialAskMode = shopInfo.tutorialId;
|
||||
end
|
||||
|
||||
if (shopInfo.selectMode == nil or shopInfo.selectMode == 0) then
|
||||
choice = callClientFunction(player, "selectMode", tutorialId);
|
||||
elseif (shopInfo.selectMode == 1) then
|
||||
choice = callClientFunction(player, "selectModeOfClassVendor");
|
||||
elseif (shopInfo.selectMode == 2) then
|
||||
choice = callClientFunction(player, "selectModeOfMultiWeaponVendor", tutorialId);
|
||||
elseif (shopInfo.selectMode == 3) then
|
||||
choice = callClientFunction(player, "selectModeOfMultiArmorVendor", tutorialId);
|
||||
end
|
||||
|
||||
if (choice == nil) then
|
||||
break;
|
||||
elseif (choice == 1) then
|
||||
callClientFunction(player, "openShopBuy", player, shopInfo.shopPack, shopInfo.shopCurrancy);
|
||||
|
||||
while (true) do
|
||||
buyResult = callClientFunction(player, "selectShopBuy", player);
|
||||
|
||||
if (buyResult == 0) then
|
||||
callClientFunction(player, "closeShopBuy", player);
|
||||
break;
|
||||
else
|
||||
player:SendMessage(0x20, "", "Player bought a thing at slot " .. tostring(buyResult)..".");
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
elseif (choice == 2) then
|
||||
callClientFunction(player, "openShopSell", player);
|
||||
|
||||
while (true) do
|
||||
sellResult = callClientFunction(player, "selectShopSell", player);
|
||||
|
||||
if (sellResult == nil) then
|
||||
callClientFunction(player, "closeShopSell", player);
|
||||
break;
|
||||
else
|
||||
player:SendMessage(0x20, "", "Player sold a thing at slot " .. tostring(sellResult)..".");
|
||||
end
|
||||
|
||||
end
|
||||
elseif (choice == 3) then
|
||||
callClientFunction(player, "selectFacility", 2, 35, 3);
|
||||
callClientFunction(player, "confirmUseFacility", player, 35);
|
||||
elseif (choice == 4) then
|
||||
callClientFunction(player, "startTutorial", nil, 29);
|
||||
end
|
||||
|
||||
if (shopInfo.selectMode == nil or shopInfo.selectMode == 0) then
|
||||
processNormalShop(player, choice);
|
||||
elseif (shopInfo.selectMode == 1) then
|
||||
processNormalShop(player, choice);
|
||||
elseif (shopInfo.selectMode == 2) then
|
||||
processMultiShop(player, choice);
|
||||
elseif (shopInfo.selectMode == 3) then
|
||||
processMultiShop(player, choice);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
callClientFunction(player, "finishTalkTurn", player);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
||||
|
||||
function processNormalShop(player, choice)
|
||||
if (choice == 1) then
|
||||
callClientFunction(player, "openShopBuy", player, shopInfo.shopPack, shopInfo.shopCurrancy);
|
||||
|
||||
while (true) do
|
||||
buyResult = callClientFunction(player, "selectShopBuy", player);
|
||||
|
||||
if (buyResult == 0) then
|
||||
callClientFunction(player, "closeShopBuy", player);
|
||||
break;
|
||||
else
|
||||
player:SendMessage(0x20, "", "Player bought a thing at slot " .. tostring(buyResult)..".");
|
||||
end
|
||||
|
||||
end
|
||||
elseif (choice == 2) then
|
||||
callClientFunction(player, "openShopSell", player);
|
||||
|
||||
while (true) do
|
||||
sellResult = callClientFunction(player, "selectShopSell", player);
|
||||
|
||||
if (sellResult == nil) then
|
||||
callClientFunction(player, "closeShopSell", player);
|
||||
break;
|
||||
else
|
||||
player:SendMessage(0x20, "", "Player sold a thing at slot " .. tostring(sellResult)..".");
|
||||
end
|
||||
|
||||
end
|
||||
elseif (choice == 3) then
|
||||
callClientFunction(player, "selectFacility", 2, 35, 3);
|
||||
callClientFunction(player, "confirmUseFacility", player, 35);
|
||||
elseif (choice == 4) then
|
||||
callClientFunction(player, "startTutorial", nil, shopInfo.classAskMode);
|
||||
end
|
||||
end
|
||||
|
||||
function processMultiShop(player, choice, sellType)
|
||||
|
||||
if (choice >= 1 and choice <= 4) then
|
||||
callClientFunction(player, "openShopBuy", player, shopInfo.shopPack[choice], shopInfo.shopCurrancy);
|
||||
|
||||
while (true) do
|
||||
buyResult = callClientFunction(player, "selectShopBuy", player);
|
||||
|
||||
if (buyResult == 0) then
|
||||
callClientFunction(player, "closeShopBuy", player);
|
||||
break;
|
||||
else
|
||||
player:SendMessage(0x20, "", "Player bought a thing at slot " .. tostring(buyResult)..".");
|
||||
end
|
||||
|
||||
end
|
||||
elseif (choice == 5) then
|
||||
callClientFunction(player, "openShopSell", player);
|
||||
|
||||
while (true) do
|
||||
sellResult = callClientFunction(player, "selectShopSell", player);
|
||||
|
||||
if (sellResult == nil) then
|
||||
callClientFunction(player, "closeShopSell", player);
|
||||
break;
|
||||
else
|
||||
player:SendMessage(0x20, "", "Player sold a thing at slot " .. tostring(sellResult)..".");
|
||||
end
|
||||
|
||||
end
|
||||
elseif (choice == 6) then
|
||||
callClientFunction(player, "selectFacility", 2, 35, 3);
|
||||
callClientFunction(player, "confirmUseFacility", player, 35);
|
||||
elseif (choice == 7) then
|
||||
callClientFunction(player, "startTutorial", nil, shopInfo.classAskMode);
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue