More changes.

This commit is contained in:
Filip Maj 2019-05-06 16:40:11 -04:00
parent c1fdad2156
commit 044d7e5207
8 changed files with 53 additions and 56 deletions

View file

@ -68,7 +68,7 @@ function onEventStarted(player, npc, triggerName)
callClientFunction(player, "eventTalkWelcome", player);
if player:GetInventory(INVENTORY_NORMAL):HasItem(commemorativeCoin) and playerGC > 0 then
if player:GetItemPackage(INVENTORY_NORMAL):HasItem(commemorativeCoin) and playerGC > 0 then
-- Checks for player having a commemorative coin, show window trade option if so.
coinChoice = callClientFunction(player, "eventSellItemAsk", player, commemorativeCoin, commemorativeCoinValue);
if coinChoice == 1 then
@ -76,8 +76,8 @@ function onEventStarted(player, npc, triggerName)
elseif coinChoice == 2 then
-- You trade <itemQuantity1> <itemName1> <itemQuality1> for <itemQuantity2> <itemName2> <itemQuality2>.
player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, commemorativeCoin, 1, playerGCSeal, 1, 1, commemorativeCoinValue);
player:GetInventory(INVENTORY_NORMAL):RemoveItem(commemorativeCoin, 1);
player:getInventory(INVENTORY_CURRENCY):addItem(playerGCSeal, 25000, 1)
player:GetItemPackage(INVENTORY_NORMAL):RemoveItem(commemorativeCoin, 1);
player:GetItemPackage(INVENTORY_CURRENCY):addItem(playerGCSeal, 25000, 1)
-- TODO: Add handling for checking GC seals limit and not going over it
end
else

View file

@ -50,7 +50,7 @@ function onEventStarted(player, npc, triggerName)
if playerGC == gcOfficer[npcId] then
callClientFunction(player, "eventTalkWelcome");
if playerCurrentRank < currentRankCap then
if player:GetInventory(INVENTORY_CURRENCY):HasItem(playerGCSeal, playerRankUpCost) then
if player:GetItemPackage(INVENTORY_CURRENCY):HasItem(playerGCSeal, playerRankUpCost) then
-- Show Promotion window, allow paying
local choice = callClientFunction(player, "eventTalkJoined", playerCurrentRank, playerNextRank, true, true);

View file

@ -69,8 +69,6 @@ aethernet =
}
}
function init(npc)
return false, false, 0, 0;
end
@ -86,19 +84,19 @@ function onEventStarted(player, npc, triggerName)
if city == 1 then
if player:GetInventory(INVENTORY_KEYITEMS):HasItem(passLimsa) then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then
passCheck = 1;
else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
end;
elseif city == 2 then
if player:GetInventory(INVENTORY_KEYITEMS):HasItem(passGrid) then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then
passCheck = 1;
else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
end;
elseif city == 3 then
if player:GetInventory(INVENTORY_KEYITEMS):HasItem(passUldah) then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah) then
passCheck = 1;
else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end

View file

@ -64,7 +64,7 @@ function onEventStarted(player, npc, triggerName)
player:SendMessage(0x20, "", "You pretend to hand over four over-aspected crystals.");
callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC);
local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1);
local invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1);
if invCheck == INV_ERROR_SUCCESS then
player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, crystal, 1, npcGCSeal, 1, 4, 1000);
end
@ -73,7 +73,7 @@ function onEventStarted(player, npc, triggerName)
--callClientFunction(player, "eventTalkCsOverflow", player, npcGC);
callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC);
local invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1);
local invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1);
if invCheck == INV_ERROR_SUCCESS then
player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, cluster, 1, npcGCSeal, 1, 1, 3000);
end

View file

@ -17,7 +17,6 @@ guildExplain(npcId, player) -- Guild Mark tutorial dialo
--]]
require ("global")
require ("shop")
@ -79,7 +78,7 @@ function onEventStarted(player, npc)
end;
processGuildShop(player, shopPack, shopCurrency);
elseif (choice == 121) then -- Exchange marks for Gil. 1 mark = 4 gil
local markAmount = player:GetInventory(INVENTORY_CURRENCY):GetItemQuantity(shopCurrency);
local markAmount = player:GetItemPackage(INVENTORY_CURRENCY):GetItemQuantity(shopCurrency);
purchaseItem(player, INVENTORY_CURRENCY, gilCurrency, markAmount*4, 1, markAmount, shopCurrency);
end

View file

@ -264,7 +264,7 @@ function openSellMenu(player)
break;
else
if sellState == 1 then
itemToSell = player:GetInventory(INVENTORY_NORMAL):GetItemAtSlot(sellItemSlot-1);
itemToSell = player:GetItemPackage(INVENTORY_NORMAL):GetItemAtSlot(sellItemSlot-1);
gItemSellId = itemToSell.itemId;
gItemQuality = itemToSell.quality;
gItemPrice = GetItemGamedata(gItemSellId);