I have tried prob 30+ different ways to get this npc lua to take a trade and give back an item. I know I have to be close but I am missing something. It does not throw any errors on the game server. Though it also does not do anything either. I have looked at the guide on wiki, maat.lua and the question marks in sky to get ideas. If anyone could help me figure out what I am doing wrong I would greatly appreciate it.
Thanks,
Code: Select all
-----------------------------------
-- Area: Ru'Lud Gardens
-- NPC: Baran
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/RuLude_Gardens/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/RuLude_Gardens/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local tradeCount = trade:getItemCount();
----------------------------------
--Empyrean Weapon Upgrades
----------------------------------
--Redemption 90->95
if (player:getFreeSlotsCount() > 0 and trade:hasItemQty(3509,99) and trade:hasItemQty(19540,1) and tradeCount == 2) then
player:tradeComplete();
player:addItem(19638);
player:messageSpecial(ITEM_OBTAINED,19638);
end
end;
-------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0096);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;