Fix Excruciate removign status from enemy rather than caster
This commit is contained in:
Yogurt 2019-06-05 19:28:02 -07:00
commit f2e34174c4
272 changed files with 8223 additions and 2425 deletions

View file

@ -11,6 +11,8 @@ eventPushStepPrvMarket(?, ?, ?) -
require ("global")
local MARKETWARD_ENTRANCE = {-201.0, 0.0, -160.0, 1.5};
function init(npc)
return false, false, 0, 0;
end

View file

@ -31,7 +31,7 @@ function onEventStarted(player, npc, triggerName)
itemId = callClientFunction(player, "selectStoreItem", nil, categoryChoice);
if (itemId ~= nil) then
player:GetInventory(INVENTORY_NORMAL):RemoveItem(itemId, 1);
player:GetItemPackage(INVENTORY_NORMAL):RemoveItem(itemId, 1);
end
elseif (storageChoice == 2) then
@ -44,7 +44,7 @@ function onEventStarted(player, npc, triggerName)
itemId = callClientFunction(player, "selectReceiveItem", nil, categoryChoice);
if (itemId ~= nil) then
player:GetInventory(INVENTORY_NORMAL):AddItem(itemId, 1);
player:GetItemPackage(INVENTORY_NORMAL):AddItem(itemId, 1);
end
end

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

@ -46,7 +46,7 @@ function onEventStarted(player, npc, triggerName)
--callClientFunction(player, "eventAfterChocoboName", player);
local curLevel = 20; -- TODO: pull from character
local hasIssuance = player:GetInventory(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]);
local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]);
local hasChocobo = player.hasChocobo;
if (player.isGM and hasChocobo == false) then -- Let GMs auto have the issuance for debugging
@ -78,11 +78,11 @@ function onEventStarted(player, npc, triggerName)
player:SendGameMessage(player, GetWorldMaster(), 25248, 0x20, 2001007);
player:SendDataPacket("attention", GetWorldMaster(), "", 25248, 2001007);
if (player:GetInventory(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
player:GetInventory(INVENTORY_KEYITEMS):AddItem(2001007);
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007);
end
player:GetInventory(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1);
player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1);
player:EndEvent();
return;

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

@ -370,7 +370,7 @@ function deliveryMenuOpen(player, npc, itemId, price, hqPrice, supplyType)
player:SendMessage(0x20, "", "Type7Param: " .. tostring(Type7Param.slot));
--]]
pickedItem = GetItemGamedata(player:GetInventory(INVENTORY_NORMAL):GetItemAtSlot(Type7Param.slot).itemId).name;
pickedItem = GetItemGamedata(player:GetItemPackage(INVENTORY_NORMAL):GetItemAtSlot(Type7Param.slot).itemId).name;
player:SendMessage(0x20, "", "Player tried to deliver " .. quantity .. " " .. pickedItem);
-- TODO: Add error handling for capped seals, no-long-available-to-deliver, etc

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

@ -10,6 +10,12 @@ eventTalkStepMakeupDone() - Confirm when creating LS
eventTalkStepModifyDone() - Confirm when modding LS
eventTalkStepBreakDone() - Confirm when deleting LS
Text IDs:
25121 - That [@SWITCH($E8(1),linkshell,company)] name is already being used.
25122 - That [@SWITCH($E8(1),linkshell,company)] name cannot be used.
25123 - The [@SWITCH($E8(1),linkshell,company)] [@STRING($EA(2))] has been [@SWITCH($E8(1),created,founded)].
--]]
require ("global")
@ -18,44 +24,49 @@ function init(npc)
return false, false, 0, 0;
end
function createLinkshell(name, crest)
function createLinkshell(player, name, crest)
GetWorldManager():RequestWorldLinkshellCreate(player, name, crest);
return waitForSignal("ls_result");
end
function modifyLinkshell(player, name, crest)
end
function modifyLinkshell(name, crest)
end
function disbandLinkshell(name, crest)
function disbandLinkshell(player, name, crest)
end
function onEventStarted(player, npc, triggerName)
hasNoActiveLS = false;
local hasNoActiveLS = false;
callClientFunction(player, "eventTalkStep1", hasNoActiveLS);
command, lsName, crestId = callClientFunction(player, "eventTalkStep2", hasNoActiveLS);
local command, lsName, crestId = callClientFunction(player, "eventTalkStep2", hasNoActiveLS);
--Create
if (result == 3) then
player:SendMessage(0x20, "", "" .. tostring(lsName));
player:SendMessage(0x20, "", "" .. tostring(crestId));
player:SendMessage(0x20, "", "" .. tostring(command));
createLinkshell(lsName, crestId);
callClientFunction(player, "eventTalkStepMakeupDone");
if (command == 3) then
local result = createLinkshell(player, lsName, crestId);
if (result == 0) then
callClientFunction(player, "eventTalkStepMakeupDone");
elseif (result == 1) then
player:SendGameMessage(player, GetWorldMaster(), 25121, 0x20); --LS already exists
callClientFunction(player, "eventTalkStepBreakDone");
elseif (result == 2) then
player:SendGameMessage(player, GetWorldMaster(), 25122, 0x20); --Cannot use this name (reserved/banned)
callClientFunction(player, "eventTalkStepBreakDone");
elseif (result == 3) then
end
--Modify
elseif (result == 4) then
modifyLinkshell(lsName, crestId);
elseif (command == 4) then
modifyLinkshell(player, lsName, crestId);
callClientFunction(player, "eventTalkStepModifyDone");
--Disband
elseif (result == 5) then
disbandLinkshell(lsName, crestId);
elseif (command == 5) then
disbandLinkshell(player, lsName, crestId);
callClientFunction(player, "eventTalkStepBreakDone");
end
player:endEvent();
end

View file

@ -13,65 +13,133 @@ eventTalkStepFinalAnswer(actorClassId) - Confirm Dialog
eventTalkStepError(errorCode) - Error dialog, 1: No Extra Retainers, 2: Server Busy.
eventTalkStepFinish()
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
introChoice = callClientFunction(player, "newEventTalkStep1", false);
if (introChoice == 1) then
raceChoice = callClientFunction(player, "eventTalkStep2");
while (true) do
if (retainerChoice == 0) then
raceChoice = callClientFunction(player, "eventTalkStep22");
end
if (raceChoice == 0) then
--Choose random actorId
elseif (raceChoice > 0) then
--Choose 5 random but correct actor ids
retainerChoice = callClientFunction(player, "eventTaklSelectCutSeane", "rtn0g010", 0x2DCB1A, 0x2DCB1A, 0x2DCB1A, 0x2DCB1A, 0x2DCB1A);
if (retainerChoice == -1) then
player:EndEvent();
return;
elseif (retainerChoice > 0) then
--Retainer chosen, choose name
retainerName = callClientFunction(player, "eventTalkStep4", 0x2DCB1A);
if (retainerName ~= "") then
confirmChoice = callClientFunction(player, "eventTalkStepFinalAnswer", 0x2DCB1A);
if (confirmChoice == 1) then
callClientFunction(player, "eventTalkStepFinish");
player:EndEvent();
return;
elseif (confirmChoice == 3) then
raceChoice = 0;
else
player:EndEvent();
return;
end
end
end
else
break;
end
end
end
player:EndEvent();
local npcActorClass = npc:GetActorClassId()
local retainerIndex = 3001100;
local cutscene = "rtn0l010" -- Defaulting to Limsa for now for testing
if npcActorClass == 1000166 then
cutscene = "rtn0l010";
retainerIndex = 3001101;
elseif npcActorClass == 1000865 then
cutscene = "rtn0u010";
retainerIndex = 3002101;
elseif npcActorClass == 1001184 then
cutscene = "rtn0g010";
retainerIndex = 3003101;
else
return;
end
introChoice = callClientFunction(player, "newEventTalkStep1", false);
if (introChoice == 1) then
-- Choose Retainer or Random
raceChoice = callClientFunction(player, "eventTalkStep2");
while (true) do
if (retainerChoice == 0) then
raceChoice = callClientFunction(player, "eventTalkStep22");
end
if (raceChoice == 0) then
--Choose random actorId from a valid set for the city
math.randomseed(os.time());
local randomRetainer = math.random(retainerIndex, (retainerIndex+74));
retainerName = callClientFunction(player, "eventTalkStep4", randomRetainer);
if (retainerName ~= "") then
confirmChoice = callClientFunction(player, "eventTalkStepFinalAnswer", randomRetainer);
if (confirmChoice == 1) then
callClientFunction(player, "eventTalkStepFinish");
player:EndEvent();
return;
elseif (confirmChoice == 3) then
raceChoice = 0;
else
player:EndEvent();
return;
end
else
callClientFunction(player, "eventTalkStepBreak");
raceChoice = -1;
end
elseif (raceChoice > 0) and (raceChoice < 16) then
--Choose 5 random but correct actor ids for the city and race/tribe
local retainerRace = ((retainerIndex) + (5*(raceChoice-1)));
local retainerRaceChoices = {retainerRace, retainerRace+1, retainerRace+2, retainerRace+3, retainerRace+4};
-- Randomize the appearance order of the available five
shuffle(retainerRaceChoices);
retainerChoice = callClientFunction(player, "eventTaklSelectCutSeane", cutscene, retainerRaceChoices[1], retainerRaceChoices[2], retainerRaceChoices[3], retainerRaceChoices[4], retainerRaceChoices[5]);
if (retainerChoice == -1) then
player:EndEvent();
return;
elseif (retainerChoice > 0) then
--Retainer chosen, choose name
retainerName = callClientFunction(player, "eventTalkStep4", retainerRaceChoices[retainerChoice]);
if (retainerName ~= "") then
confirmChoice = callClientFunction(player, "eventTalkStepFinalAnswer", retainerRaceChoices[retainerChoice]);
if (confirmChoice == 1) then
callClientFunction(player, "eventTalkStepFinish");
player:EndEvent();
return;
elseif (confirmChoice == 3) then
retainerChoice = 0;
else
player:EndEvent();
return;
end
else
callClientFunction(player, "eventTalkStepBreak");
raceChoice = -1;
end
end
else
break;
end
end
end
player:EndEvent();
end
function shuffle(tbl)
for i = #tbl, 2, -1 do
local j = math.random(i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
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);

View file

@ -24,10 +24,6 @@ function init(npc)
return false, false, 0, 0;
end
function onSpawn(player, npc)
npc:SendFullRetainerInventory(player);
end
function onEventStarted(player, retainer, triggerName)
while (true) do

View file

@ -81,26 +81,26 @@ function initClassItems(player)
--DoW
if (player.charaWork.parameterSave.state_mainSkill[0] == 2) then --PUG
player:GetInventory(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307});
player:GetItemPackage(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 3) then --GLA
player:GetInventory(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307});
player:GetItemPackage(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 4) then --MRD
player:GetInventory(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307});
player:GetItemPackage(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307});
player:GetEquipment():SetEquipment({0, 8, 12, 13, 15},{0, 1, 2, 3, 4});
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 7) then --ARC
player:GetInventory(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307});
player:GetItemPackage(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 8) then --LNC
player:GetInventory(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307});
player:GetItemPackage(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
--DoM
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 22) then --THM
player:GetInventory(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208});
player:GetItemPackage(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 23) then --CNJ
player:GetInventory(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208});
player:GetItemPackage(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
--DoH
@ -124,50 +124,50 @@ end
function initRaceItems(player)
if (player.playerWork.tribe == 1) then --Hyur Midlander Male
player:GetInventory(0):AddItem(8040001);
player:GetInventory(0):AddItem(8060001);
player:GetItemPackage(0):AddItem(8040001);
player:GetItemPackage(0):AddItem(8060001);
elseif (player.playerWork.tribe == 2) then --Hyur Midlander Female
player:GetInventory(0):AddItem(8040002);
player:GetInventory(0):AddItem(8060002);
player:GetItemPackage(0):AddItem(8040002);
player:GetItemPackage(0):AddItem(8060002);
elseif (player.playerWork.tribe == 3) then --Hyur Highlander Male
player:GetInventory(0):AddItem(8040003);
player:GetInventory(0):AddItem(8060003);
player:GetItemPackage(0):AddItem(8040003);
player:GetItemPackage(0):AddItem(8060003);
elseif (player.playerWork.tribe == 4) then --Elezen Wildwood Male
player:GetInventory(0):AddItem(8040004);
player:GetInventory(0):AddItem(8060004);
player:GetItemPackage(0):AddItem(8040004);
player:GetItemPackage(0):AddItem(8060004);
elseif (player.playerWork.tribe == 5) then --Elezen Wildwood Female
player:GetInventory(0):AddItem(8040006);
player:GetInventory(0):AddItem(8060006);
player:GetItemPackage(0):AddItem(8040006);
player:GetItemPackage(0):AddItem(8060006);
elseif (player.playerWork.tribe == 6) then --Elezen Duskwight Male
player:GetInventory(0):AddItem(8040005);
player:GetInventory(0):AddItem(8060005);
player:GetItemPackage(0):AddItem(8040005);
player:GetItemPackage(0):AddItem(8060005);
elseif (player.playerWork.tribe == 7) then --Elezen Duskwight Female
player:GetInventory(0):AddItem(8040007);
player:GetInventory(0):AddItem(8060007);
player:GetItemPackage(0):AddItem(8040007);
player:GetItemPackage(0):AddItem(8060007);
elseif (player.playerWork.tribe == 8) then --Lalafell Plainsfolk Male
player:GetInventory(0):AddItem(8040008);
player:GetInventory(0):AddItem(8060008);
player:GetItemPackage(0):AddItem(8040008);
player:GetItemPackage(0):AddItem(8060008);
elseif (player.playerWork.tribe == 9) then --Lalafell Plainsfolk Female
player:GetInventory(0):AddItem(8040010);
player:GetInventory(0):AddItem(8060010);
player:GetItemPackage(0):AddItem(8040010);
player:GetItemPackage(0):AddItem(8060010);
elseif (player.playerWork.tribe == 10) then --Lalafell Dunesfolk Male
player:GetInventory(0):AddItem(8040009);
player:GetInventory(0):AddItem(8060009);
player:GetItemPackage(0):AddItem(8040009);
player:GetItemPackage(0):AddItem(8060009);
elseif (player.playerWork.tribe == 11) then --Lalafell Dunesfolk Female
player:GetInventory(0):AddItem(8040011);
player:GetInventory(0):AddItem(8060011);
player:GetItemPackage(0):AddItem(8040011);
player:GetItemPackage(0):AddItem(8060011);
elseif (player.playerWork.tribe == 12) then --Miqo'te Seekers of the Sun
player:GetInventory(0):AddItem(8040012);
player:GetInventory(0):AddItem(8060012);
player:GetItemPackage(0):AddItem(8040012);
player:GetItemPackage(0):AddItem(8060012);
elseif (player.playerWork.tribe == 13) then --Miqo'te Seekers of the Moon
player:GetInventory(0):AddItem(8040013);
player:GetInventory(0):AddItem(8060013);
player:GetItemPackage(0):AddItem(8040013);
player:GetItemPackage(0):AddItem(8060013);
elseif (player.playerWork.tribe == 14) then --Roegadyn Sea Wolf
player:GetInventory(0):AddItem(8040014);
player:GetInventory(0):AddItem(8060014);
player:GetItemPackage(0):AddItem(8040014);
player:GetItemPackage(0):AddItem(8060014);
elseif (player.playerWork.tribe == 15) then --Roegadyn Hellsguard
player:GetInventory(0):AddItem(8040015);
player:GetInventory(0):AddItem(8060015);
player:GetItemPackage(0):AddItem(8040015);
player:GetItemPackage(0):AddItem(8060015);
end
player:GetEquipment():SetEquipment({9, 11},{5,6});

View file

@ -0,0 +1,29 @@
--[[
BazaarCheckCommand Script
Handles what happens when you examine a player's bazaar
--]]
require ("global")
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, bazaarActorId)
local bazaarActor = nil;
if (name ~= nil) then
bazaarActor = player:GetZone():FindPCInZone(name);
elseif (bazaarActorId ~= nil) then
bazaarActor = player:GetZone():FindActorInArea(bazaarActorId);
end
if (bazaarActor ~= nil) then
callClientFunction(player, "delegateCommand", GetStaticActor("BazaarCheckCommand"), "processChackBazaar");
else
--Show error
end
player:EndEvent();
end

View file

@ -0,0 +1,71 @@
--[[
BazaarDealCommand Script
Handles various bazaar transfer options
All bazaar args have a Reward (The item the person who fufills the request gets) and a Seek (The item the player wants, either gil or an item).
--]]
function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds)
local originalReward = nil;
local originalSeek = nil;
--Handle special case for offers
if (seekItem == nil) then
originalSeek = player:GetItemPackage(0):GetItemAtSlot(rewardItem.seekSlot);
originalReward = player:GetItemPackage(0):GetItemAtSlot(rewardItem.offerSlot);
end
--Handle Reward
if (type(rewardItem) == "number") then
rewardItem = GetWorldManager():CreateItem(rewardItem, rewardAmount);
player:RemoveItem(1000001, rewardAmount);
elseif (seekItem == nil) then
rewardItem = originalReward;
if (bazaarMode ~= 11) then
rewardItem = GetWorldManager():CreateItem(rewardItem.itemId, rewardAmount, rewardItem.quality, rewardItem.modifiers);
end
else
rewardItem = player:GetItem(rewardItem);
originalReward = rewardItem;
if (bazaarMode ~= 11) then
rewardItem = GetWorldManager():CreateItem(rewardItem.itemId, rewardAmount, rewardItem.quality, rewardItem.modifiers);
end
end
--Handle Seek
if (type(seekItem) == "number") then
seekItem = GetWorldManager():CreateItem(seekItem, seekAmount);
elseif (seekItem == nil) then
seekItem = originalSeek;
if (bazaarMode ~= 11) then
seekItem = GetWorldManager():CreateItem(seekItem.itemId, seekAmount, seekItem.quality, seekItem.modifiers);
end
else
seekItem = player:GetItem(seekItem);
originalSeek = seekItem;
if (bazaarMode ~= 11) then
seekItem = GetWorldManager():CreateItem(seekItem.itemId, seekAmount, seekItem.quality, seekItem.modifiers);
end
end
--If not selling, remove the seek item
if (bazaarMode ~= 11 and bazaarMode ~= 12 and bazaarMode ~= 13) then
if (originalSeek ~= nil) then
player:RemoveItem(originalSeek, seekAmount);
end
end
--Remove the reward item
if (originalReward ~= nil) then
player:RemoveItem(originalReward, rewardAmount);
end
GetWorldManager():AddToBazaar(player, rewardItem, seekItem, rewardAmount, seekAmount, bazaarMode);
player:EndEvent();
end

View file

@ -0,0 +1,53 @@
--[[
BazaarTradeCommand Script
Handles bazaar trade
All bazaar args have a Reward (The item the person who fufills the request gets) and a Seek (The item the player wants, either gil or an item).
--]]
function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds)
local originalReward = nil;
local originalSeek = nil;
local bazaarActor = nil;
--Get the bazaar actor
if (bazaarActorId ~= nil) then
bazaarActor = player:GetZone():FindActorInArea(bazaarActorId);
end
--Abort if no actor
if (bazaarActor == nil) then
player:SendGameMessage(player, worldMaster, 25111, 0x20);
player:EndEvent();
return;
end
--If seekItem is a number, we are buying an item (ExecuteBazaarBuy)
if (type(seekItemOrCost) == "number") then
if (player:GetCurrentGil() >= seekItemOrCost) then
if (GetWorldManager():BazaarBuyOperation(bazaarActor, player, bazaarActor:GetItem(rewardItem), rewardAmount, seekItemOrCost)) then
else
player:SendGameMessage(player, worldMaster, 25111, 0x20);
end
else
player:SendGameMessage(player, worldMaster, 40252, 0x20);
end
else --Else we are fufilling a sought out item (ExecuteBazaarSell)
local rewardItem = bazaarActor:GetItem(rewardItem);
local seekItem = player:GetItem(seekItemOrCost);
if (rewardItem ~= nil and seekItem ~= nil) then
if (GetWorldManager():BazaarSellOperation(bazaarActor, player, rewardItem, rewardAmount, seekItem, seekAmount)) then
else
player:SendGameMessage(player, worldMaster, 25111, 0x20);
end
else
end
end
player:EndEvent();
end

View file

@ -0,0 +1,22 @@
--[[
BazaarUndealCommand Script
Handles canceling bazaar items
25107 - Your bazaar is either full or already contains that unique item.
25111 - Unable to complete transaction.
25112 - You are unable to remove the item from your bazaar. You cannot hold any more items.
25113 - Offered and sought items cannot be identical.
25114 - Items in less than mint condition cannot be offered.
25115 - Items in less than mint condition cannot be placed in your bazaar.
--]]
function onEventStarted(player, actor, triggerName, rewardItem, arg1, bazaarType, arg2, bazaarActor, rewardAmount, seekAmount, arg3, arg4, type9ItemIds)
GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem));
player:EndEvent();
end

View file

@ -0,0 +1,20 @@
--[[
ConfirmTradeCommand Script
Handles what happens when you accept/refuse a trade
--]]
function onEventStarted(player, actor, triggerName, groupType, result)
--Accept
if (result == 1) then
GetWorldManager():AcceptTrade(player);
--Refuse
elseif (result == 2) then
GetWorldManager():RefuseTrade(player);
end
player:EndEvent();
end

View file

@ -6,7 +6,7 @@ Notes:
Gearset activating could be optimized a bit more by doing the item packets in one go.
The param "invActionInfo" has the vars: actorId, unknown, slot, and inventoryType.
The param "equippedItem" has the vars: actorId, unknown, slot, and inventoryType.
The param "itemDBIds" has the vars: item1 and item2.
--]]
@ -53,12 +53,12 @@ GRAPHICSLOT_L_RINGFINGER = 24;
GRAPHICSLOT_R_INDEXFINGER = 25;
GRAPHICSLOT_L_INDEXFINGER = 26;
function onEventStarted(player, actor, triggerName, invActionInfo, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds)
function onEventStarted(player, actor, triggerName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds)
equipSlot = equipSlot-1;
--Equip Item
if (invActionInfo ~= nil) then
item = player:GetInventory(0):GetItemAtSlot(invActionInfo.slot);
if (equippedItem ~= nil) then
item = player:GetItemPackage(equippedItem.itemPackage):GetItemAtSlot(equippedItem.slot);
equipItem(player, equipSlot, item);
player:SendAppearance();
--Unequip Item
@ -69,6 +69,8 @@ function onEventStarted(player, actor, triggerName, invActionInfo, param1, param
end
end
player.CalculateBaseStats(); --player.RecalculateStats();
player:EndEvent();
end
@ -83,7 +85,7 @@ function loadGearset(player, classId)
for slot = 0, 34 do
if (slot ~= EQUIPSLOT_MAINHAND and slot ~= EQUIPSLOT_UNDERSHIRT and slot ~= EQUIPSLOT_UNDERGARMENT) then
itemAtSlot = player:GetEquipment():GetItemAtSlot(slot);
itemAtSlot = slot;
itemAtGearsetSlot = gearset[slot];
if (itemAtSlot ~= nil or itemAtGearsetSlot ~= nil) then
@ -98,10 +100,8 @@ function loadGearset(player, classId)
end
end
end
player:GetEquipment():ToggleDBWrite(true);
end
player:GetEquipment():ToggleDBWrite(true);
end
function equipItem(player, equipSlot, item)
@ -151,7 +151,7 @@ function equipItem(player, equipSlot, item)
player:DoClassChange(classId);
end
player:GetEquipment():Equip(equipSlot, item);
player:GetEquipment():Set(equipSlot, item);
if (equipSlot == EQUIPSLOT_MAINHAND and gItem:IsNailWeapon() == false) then graphicSlot = GRAPHICSLOT_MAINHAND;
elseif (equipSlot == EQUIPSLOT_OFFHAND) then graphicSlot = GRAPHICSLOT_OFFHAND;
@ -163,19 +163,23 @@ function equipItem(player, equipSlot, item)
elseif (equipSlot == EQUIPSLOT_HANDS) then graphicSlot = GRAPHICSLOT_HANDS;
elseif (equipSlot == EQUIPSLOT_FEET) then graphicSlot = GRAPHICSLOT_FEET;
elseif (equipSlot == EQUIPSLOT_WAIST) then graphicSlot = GRAPHICSLOT_WAIST;
elseif (equipSlot == EQUIPSLOT_RFINGER) then graphicSlot = GRAPHICSLOT_RFINGER;
elseif (equipSlot == EQUIPSLOT_LFINGER) then graphicSlot = GRAPHICSLOT_LFINGER;
elseif (equipSlot == EQUIPSLOT_NECK) then graphicSlot = GRAPHICSLOT_NECK;
elseif (equipSlot == EQUIPSLOT_RFINGER) then graphicSlot = GRAPHICSLOT_R_RINGFINGER;
elseif (equipSlot == EQUIPSLOT_LFINGER) then graphicSlot = GRAPHICSLOT_L_RINGFINGER;
end
--Graphic Slot was set, otherwise it's a special case
if (graphicSlot ~= nil) then
player:GraphicChange(graphicSlot, item);
elseif (gItem:IsNailWeapon()) then
player:GraphicChange(GRAPHICSLOT_MAINHAND, item);
player:GraphicChange(GRAPHICSLOT_OFFHAND, item);
player:GraphicChange(GRAPHICSLOT_OFFHAND, item);
elseif (equipSlot == EQUIPSLOT_EARS) then
player:GraphicChange(GRAPHICSLOT_R_EAR, item);
player:GraphicChange(GRAPHICSLOT_L_EAR, item);
elseif (equipSlot == EQUIPSLOT_WRIST) then
player:GraphicChange(GRAPHICSLOT_R_WRIST, item);
player:GraphicChange(GRAPHICSLOT_L_WRIST, item);
end
end
end
@ -187,7 +191,7 @@ function unequipItem(player, equipSlot, item)
player:SendGameMessage(player, worldMaster, 30730, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1); --Unable to unequip
elseif (item ~= nil) then
player:SendGameMessage(player, worldMaster, 30602, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1); --Item Removed
player:GetEquipment():Unequip(equipSlot);
player:GetEquipment():Clear(equipSlot);
if (equipSlot == EQUIPSLOT_BODY) then --Show Undershirt
item = player:GetEquipment():GetItemAtSlot(EQUIPSLOT_UNDERSHIRT);
@ -204,9 +208,11 @@ function unequipItem(player, equipSlot, item)
elseif (equipSlot == EQUIPSLOT_PACK) then player:GraphicChange(GRAPHICSLOT_PACK, nil);
elseif (equipSlot == EQUIPSLOT_HEAD) then player:GraphicChange(GRAPHICSLOT_HEAD, nil);
elseif (equipSlot == EQUIPSLOT_WAIST) then player:GraphicChange(GRAPHICSLOT_WAIST, nil);
elseif (equipSlot == EQUIPSLOT_NECK) then player:GraphicChange(GRAPHICSLOT_NECK, nil);
elseif (equipSlot == EQUIPSLOT_EARS) then player:GraphicChange(GRAPHICSLOT_L_EAR, nil); player:GraphicChange(GRAPHICSLOT_R_EAR, nil);
elseif (equipSlot == EQUIPSLOT_RFINGER) then player:GraphicChange(GRAPHICSLOT_RFINGER, nil);
elseif (equipSlot == EQUIPSLOT_LFINGER) then player:GraphicChange(GRAPHICSLOT_LFINGER, nil);
elseif (equipSlot == EQUIPSLOT_WRIST) then player:GraphicChange(GRAPHICSLOT_L_WRIST, nil); player:GraphicChange(GRAPHICSLOT_R_WRIST, nil);
elseif (equipSlot == EQUIPSLOT_RFINGER) then player:GraphicChange(GRAPHICSLOT_R_RINGFINGER, nil);
elseif (equipSlot == EQUIPSLOT_LFINGER) then player:GraphicChange(GRAPHICSLOT_L_RINGFINGER, nil);
end
end
return true;

View file

@ -0,0 +1,13 @@
--[[
ItemMovePackageCommand Script
Handles moving items across item packages (IE: Taking loot)
--]]
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
player:EndEvent();
end

View file

@ -0,0 +1,13 @@
--[[
ItemTransferCommand Script
Handles giving an item to another party member.
--]]
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds)
player:EndEvent();
end

View file

@ -9,7 +9,7 @@ The param "itemDBIds" has the vars: item1 and item2.
--]]
function onEventStarted(player, actor, triggerName, invActionInfo, param1, param2, param3, param4, param5, param6, param7, param8, itemDBIds)
player:GetInventory(0x00):RemoveItemAtSlot(invActionInfo.slot);
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot);
player:EndEvent();
end

View file

@ -0,0 +1,97 @@
--[[
TradeExecuteCommand Script
Handles all trading between players
Functions:
processTradeCommandOpenTray() - Opens the trade widget.
processTradeCommandCloseTray() - Closes the trade widget.
processTradeCommandReply(command, params) - Operates the trade widget.
processUpdateTradeCommandTrayData() - ?
Commands:
set: TradeWidget resets "Set Mode" (turned on once item selected while waiting for reply).
back: TradeWidget resets "Choose Mode" (turned on when ui operation is done).
fix: You have accepted the deal.
targetfix: Target has accepted the deal.
doedit: You have canceled your accept.
reedit: Target has canceled their accept.
--]]
require ("global")
function onEventStarted(player, actor, triggerName)
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray");
tradeOffering = player:GetTradeOfferings();
while (true) do
widgetOpen, chosenOperation, tradeSlot, itemActor, quantity, itemPackageId, itemSlot = callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processUpdateTradeCommandTrayData");
--Abort script if client script dead
if (widgetOpen == false or widgetOpen == nil) then
player:FinishTradeTransaction();
break;
end
--Handle you/target canceling/finishing the trade
if (not player:IsTrading() or not player:GetOtherTrader():IsTrading()) then
player:FinishTradeTransaction();
break;
end
--Handle target accepting
if (player:GetOtherTrader():IsTradeAccepted() == true) then
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "targetfix");
else
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "reedit");
end
--Check if both accepted the trade
if (player:IsTradeAccepted() and player:GetOtherTrader():IsTradeAccepted()) then
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandCloseTray");
GetWorldManager():CompleteTrade(player, player:GetOtherTrader());
break;
end
--Clear Item
if (chosenOperation == 1) then
player:RemoveTradeItem(tradeSlot - 1);
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set");
--Clear All
elseif (chosenOperation == 2) then
player:ClearTradeItems();
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set");
--Item Chosen
elseif (chosenOperation == 3) then
player:AddTradeItem(tradeSlot - 1, itemActor, quantity);
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set", 2, 2, 2, 2);
--Gil Chosen
elseif (chosenOperation == 4) then
player:AddTradeItem(tradeSlot - 1, itemActor, quantity);
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set");
--Cancel
elseif (chosenOperation == 11) then
player:FinishTradeTransaction();
break;
--OK
elseif (chosenOperation == 12) then
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "fix");
player:AcceptTrade(true);
--Reedit
elseif (chosenOperation == 13) then
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "doedit");
player:AcceptTrade(false);
end
wait(1);
end
player:EndEvent();
end

View file

@ -0,0 +1,14 @@
--[[
TradeOfferCommand Script
Handles what happens a player cancels a trade
--]]
function onEventStarted(player, actor, triggerName, commandId, result)
GetWorldManager():CancelTrade(player);
player:EndEvent();
end

View file

@ -0,0 +1,26 @@
--[[
TradeOfferCommand Script
Handles what happens when you invite to trade
--]]
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId)
local otherActor = nil;
if (name ~= nil) then
otherActor = player:GetZone():FindPCInZone(name);
elseif (actorId ~= nil) then
otherActor = player:GetZone():FindActorInArea(actorId);
end
if (otherActor ~= nil) then
GetWorldManager():CreateTradeGroup(player, otherActor);
else
end
player:EndEvent();
end

View file

@ -26,7 +26,7 @@ function onTrigger(player, argc, currency, qty, name, lastName)
currency = tonumber(currency) or nil;
qty = tonumber(qty) or 1;
local removed = player:GetInventory(INVENTORY_CURRENCY):RemoveItem(currency, qty);
local removed = player:GetItemPackage(INVENTORY_CURRENCY):RemoveItem(currency, qty);
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local message = "Attempting to remove currency" -- "unable to remove currency";

View file

@ -39,7 +39,7 @@ function onTrigger(player, argc, item, qty, location, name, lastName)
location = INVENTORY_NORMAL;
end;
local removed = player:GetInventory(location):RemoveItem(item, qty);
local removed = player:GetItemPackage(location):RemoveItem(item, qty);
if removed then -- RemoveItem() currently returns nothing for verification, this statement can't work
message = string.format("Removed item %u of kind %u to %s", item, location, player:GetName());

View file

@ -27,7 +27,7 @@ function onTrigger(player, argc, keyitem, qty, name, lastName)
qty = tonumber(qty) or 1;
local location = INVENTORY_KEYITEMS;
local removed = player:GetInventory(location):RemoveItem(keyitem, qty);
local removed = player:GetItemPackage(location):RemoveItem(keyitem, qty);
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local message = "Attempting to remove keyitem" -- "unable to remove keyitem";

View file

@ -27,7 +27,7 @@ function onTrigger(player, argc, qty, name, lastName)
qty = tonumber(qty) or 1;
location = INVENTORY_CURRENCY;
local added = player:GetInventory(location):AddItem(currency, qty, 1);
local added = player:GetItemPackage(location):AddItem(currency, qty, 1);
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local message = "unable to add gil";

View file

@ -46,8 +46,7 @@ function onTrigger(player, argc, item, qty, location, name, lastName)
location = INVENTORY_NORMAL;
end;
local invCheck = player:getInventory(location):AddItem(item, qty, 1);
local invCheck = player:getItemPackage(location):addItem(item, qty, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.

View file

@ -27,7 +27,7 @@ function onTrigger(player, argc, keyitem, name, lastName)
qty = 1;
location = INVENTORY_KEYITEMS;
local added = player:GetInventory(location):AddItem(keyitem, qty, 1);
local added = player:GetItemPackage(location):AddItem(keyitem, qty, 1);
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local message = "unable to add keyitem";

View file

@ -25,6 +25,6 @@ end
function onCrit(effect, attacker, defender, skill, action, actionContainer)
if skill.GetCommandType() == CommandType.Spell then
defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
attacker.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
end
end

View file

@ -35,7 +35,7 @@ function GetGCSeals(player, company)
company = tonumber(company);
if company ~= nil and company > 0 and company < 4 then
return player:GetInventory(INVENTORY_CURRENCY):GetItemQuantity(companySeal[tonumber(company)]);
return player:GetItemPackage(INVENTORY_CURRENCY):GetItemQuantity(companySeal[tonumber(company)]);
else
return -1;
end
@ -52,7 +52,7 @@ function AddGCSeals(player, company, amount)
if currentAmount ~= -1 then
if amount then
if currentAmount + amount <= maxAmount then
invCheck = player:GetInventory(INVENTORY_CURRENCY):AddItem(companySeal[company], amount, 1);
invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(companySeal[company], amount, 1);
if invCheck == INV_ERROR_SUCCESS then
return INV_ERROR_SUCCESS;
end

View file

@ -82,27 +82,27 @@ function initClassItems(player)
--DoW
if (player.charaWork.parameterSave.state_mainSkill[0] == 2) then --PUG
player:GetInventory(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({4020001, 8030701, 8050728, 8080601, 8090307});
player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0);
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 3) then --GLA
player:GetInventory(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({4030010, 8031120, 8050245, 8080601, 8090307});
player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0);
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 4) then --MRD
player:GetInventory(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307});
player:GetEquipment():SetEquipment({0, 8, 12, 13, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({4040001, 8011001, 8050621, 8070346, 8090307});
player:GetEquipment():Set({0, 8, 12, 13, 15},{0, 1, 2, 3, 4},0);
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 7) then --ARC
player:GetInventory(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({4070001, 8030601, 8050622, 8080601, 8090307});
player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0);
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 8) then --LNC
player:GetInventory(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({4080201, 8030801, 8051015, 8080501, 8090307});
player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0);
--DoM
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 22) then --THM
player:GetInventory(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({5020001, 8030245, 8050346, 8080346, 8090208});
player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0);
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 23) then --CNJ
player:GetInventory(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208});
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
player:GetItemPackage(0):AddItems({5030101, 8030445, 8050031, 8080246, 8090208});
player:GetEquipment():Set({0, 10, 12, 14, 15},{0, 1, 2, 3, 4},0);
--DoH
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 29) then --
@ -125,52 +125,52 @@ end
function initRaceItems(player)
if (player.playerWork.tribe == 1) then --Hyur Midlander Male
player:GetInventory(0):AddItem(8040001);
player:GetInventory(0):AddItem(8060001);
player:GetItemPackage(0):AddItem(8040001);
player:GetItemPackage(0):AddItem(8060001);
elseif (player.playerWork.tribe == 2) then --Hyur Midlander Female
player:GetInventory(0):AddItem(8040002);
player:GetInventory(0):AddItem(8060002);
player:GetItemPackage(0):AddItem(8040002);
player:GetItemPackage(0):AddItem(8060002);
elseif (player.playerWork.tribe == 3) then --Hyur Highlander Male
player:GetInventory(0):AddItem(8040003);
player:GetInventory(0):AddItem(8060003);
player:GetItemPackage(0):AddItem(8040003);
player:GetItemPackage(0):AddItem(8060003);
elseif (player.playerWork.tribe == 4) then --Elezen Wildwood Male
player:GetInventory(0):AddItem(8040004);
player:GetInventory(0):AddItem(8060004);
player:GetItemPackage(0):AddItem(8040004);
player:GetItemPackage(0):AddItem(8060004);
elseif (player.playerWork.tribe == 5) then --Elezen Wildwood Female
player:GetInventory(0):AddItem(8040006);
player:GetInventory(0):AddItem(8060006);
player:GetItemPackage(0):AddItem(8040006);
player:GetItemPackage(0):AddItem(8060006);
elseif (player.playerWork.tribe == 6) then --Elezen Duskwight Male
player:GetInventory(0):AddItem(8040005);
player:GetInventory(0):AddItem(8060005);
player:GetItemPackage(0):AddItem(8040005);
player:GetItemPackage(0):AddItem(8060005);
elseif (player.playerWork.tribe == 7) then --Elezen Duskwight Female
player:GetInventory(0):AddItem(8040007);
player:GetInventory(0):AddItem(8060007);
player:GetItemPackage(0):AddItem(8040007);
player:GetItemPackage(0):AddItem(8060007);
elseif (player.playerWork.tribe == 8) then --Lalafell Plainsfolk Male
player:GetInventory(0):AddItem(8040008);
player:GetInventory(0):AddItem(8060008);
player:GetItemPackage(0):AddItem(8040008);
player:GetItemPackage(0):AddItem(8060008);
elseif (player.playerWork.tribe == 9) then --Lalafell Plainsfolk Female
player:GetInventory(0):AddItem(8040010);
player:GetInventory(0):AddItem(8060010);
player:GetItemPackage(0):AddItem(8040010);
player:GetItemPackage(0):AddItem(8060010);
elseif (player.playerWork.tribe == 10) then --Lalafell Dunesfolk Male
player:GetInventory(0):AddItem(8040009);
player:GetInventory(0):AddItem(8060009);
player:GetItemPackage(0):AddItem(8040009);
player:GetItemPackage(0):AddItem(8060009);
elseif (player.playerWork.tribe == 11) then --Lalafell Dunesfolk Female
player:GetInventory(0):AddItem(8040011);
player:GetInventory(0):AddItem(8060011);
player:GetItemPackage(0):AddItem(8040011);
player:GetItemPackage(0):AddItem(8060011);
elseif (player.playerWork.tribe == 12) then --Miqo'te Seekers of the Sun
player:GetInventory(0):AddItem(8040012);
player:GetInventory(0):AddItem(8060012);
player:GetItemPackage(0):AddItem(8040012);
player:GetItemPackage(0):AddItem(8060012);
elseif (player.playerWork.tribe == 13) then --Miqo'te Seekers of the Moon
player:GetInventory(0):AddItem(8040013);
player:GetInventory(0):AddItem(8060013);
player:GetItemPackage(0):AddItem(8040013);
player:GetItemPackage(0):AddItem(8060013);
elseif (player.playerWork.tribe == 14) then --Roegadyn Sea Wolf
player:GetInventory(0):AddItem(8040014);
player:GetInventory(0):AddItem(8060014);
player:GetItemPackage(0):AddItem(8040014);
player:GetItemPackage(0):AddItem(8060014);
elseif (player.playerWork.tribe == 15) then --Roegadyn Hellsguard
player:GetInventory(0):AddItem(8040015);
player:GetInventory(0):AddItem(8060015);
player:GetItemPackage(0):AddItem(8040015);
player:GetItemPackage(0):AddItem(8060015);
end
player:GetEquipment():SetEquipment({9, 11},{5,6});
player:GetEquipment():Set({9,11},{5,6}, 0);
end

View file

@ -22,18 +22,24 @@ function doItemTrade(player, retainer)
callClientFunction(player, "eventTalkRetainerItemTrade", 1);
while (true) do
resultCode, type7Param, un1, quantity, itemId, quality = callClientFunction(player, "eventTalkRetainerItemTrade", 2);
resultCode, item, un1, quantity, itemId, quality = callClientFunction(player, "eventTalkRetainerItemTrade", 2);
player:SendMessage(0x20, "", "" .. tostring(resultCode));
player:SendMessage(0x20, "", "" .. tostring(un1));
player:SendMessage(0x20, "", "" .. tostring(quantity));
player:SendMessage(0x20, "", "" .. tostring(itemId));
player:SendMessage(0x20, "", "" .. tostring(quality));
--Retreieve
if (resultCode == 31) then
retainer:GetInventory(type7Param.inventoryType):RemoveItemAtSlot(type7Param.slot, quantity);
retainer:GetInventory(type7Param.inventoryType):SendUpdatePackets(player, true);
player:GetInventory(type7Param.inventoryType):AddItem(itemId, quantity, quality);
retainer:GetItemPackage(item.itemPackage):RemoveItemAtSlot(item.slot, quantity);
retainer:GetItemPackage(item.itemPackage):SendUpdatePackets(player, true);
player:GetItemPackage(item.itemPackage):AddItem(itemId, quantity, quality);
--Entrust
elseif (resultCode == 32) then
player:GetInventory(type7Param.inventoryType):RemoveItemAtSlot(type7Param.slot, quantity);
retainer:GetInventory(type7Param.inventoryType):AddItem(itemId, quantity, quality);
retainer:GetInventory(type7Param.inventoryType):SendUpdatePackets(player, true);
player:GetItemPackage(item.itemPackage):RemoveItemAtSlot(item.slot, quantity);
retainer:GetItemPackage(item.itemPackage):AddItem(itemId, quantity, quality);
retainer:GetItemPackage(item.itemPackage):SendUpdatePackets(player, true);
end
callClientFunction(player, "eventReturnResult", resultCode, false);

View file

@ -9,8 +9,8 @@ function purchaseItem(player, location, itemId, quantity, quality, price, curren
local worldMaster = GetWorldMaster();
local invCheck = -1;
if (player:GetInventory(INVENTORY_CURRENCY):HasItem(currency, price)) then
invCheck = player:GetInventory(location):AddItem(itemId, quantity, quality);
if (player:GetItemPackage(INVENTORY_CURRENCY):HasItem(currency, price)) then
invCheck = player:GetItemPackage(location):AddItem(itemId, quantity, quality);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
@ -21,7 +21,7 @@ function purchaseItem(player, location, itemId, quantity, quality, price, curren
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(0x20, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
player:GetInventory(INVENTORY_CURRENCY):removeItem(currency, price);
player:GetItemPackage(INVENTORY_CURRENCY):removeItem(currency, price);
if (currency == 1000001) then -- If Gil
-- You purchase <quantity> <itemId> <quality> for <price> gil.
@ -48,8 +48,8 @@ function sellItem(player, itemId, quantity, quality, itemPrice, slot, currency)
local worldMaster = GetWorldMaster();
local cost = quantity * itemPrice;
player:GetInventory(INVENTORY_CURRENCY):AddItem(currency, cost);
player:GetInventory(INVENTORY_NORMAL):RemoveItemAtSlot(slot, quantity);
player:GetItemPackage(INVENTORY_CURRENCY):AddItem(currency, cost);
player:GetItemPackage(INVENTORY_NORMAL):RemoveItemAtSlot(slot, quantity);
-- You sell <quantity> <itemId> <quality> for <cost> gil.
player:SendGameMessage(player, worldMaster, 25075, MESSAGE_TYPE_SYSTEM, itemId, quality, quantity, cost);
end

View file

@ -4,9 +4,9 @@ function onEventStarted(player, npc)
Spl = GetStaticActor("Spl000");
magickedPrism = 3020615;
if not player:GetInventory(INVENTORY_NORMAL):HasItem(magickedPrism) then
if not player:GetItemPackage(INVENTORY_NORMAL):HasItem(magickedPrism) then
callClientFunction(player, "delegateEvent", player, Spl, "processEventELNAURE", 2);
local invCheck = player:GetInventory(INVENTORY_NORMAL):AddItem(magickedPrism, 10, 1);
local invCheck = player:GetItemPackage(INVENTORY_NORMAL):AddItem(magickedPrism, 10, 1);
if invCheck == INV_ERROR_SUCCESS then
player:SendGameMessage(player, GetWorldMaster(), 25246, MESSAGE_TYPE_SYSTEM, magickedPrism, 10);
end