Advertisement
Brownies

test1

Aug 2nd, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.17 KB | None | 0 0
  1. -----------------------------------
  2. -- Area: Giddeus
  3. -- NPC:  Uu Zhoumo
  4. -- Involved in Mission 2-3
  5. -- @pos -179 16 155 145
  6. -----------------------------------
  7. package.loaded["scripts/zones/Giddeus/TextIDs"] = nil;
  8. -----------------------------------
  9.  
  10. require("scripts/globals/keyitems");
  11. require("scripts/globals/missions");
  12. require("scripts/zones/Giddeus/TextIDs");
  13.  
  14. -----------------------------------
  15. -- onTrade Action
  16. -----------------------------------
  17.  
  18. function onTrade(player,npc,trade)
  19.    
  20.     if(player:getCurrentMission(BASTOK) == THE_EMISSARY_WINDURST and trade:hasItemQty(16509,1) and trade:getItemCount() == 1) then -- Trade Aspir Knife
  21.         player:startEvent(0x0029);
  22.     end
  23.  
  24. end;
  25.  
  26. -----------------------------------
  27. -- onTrigger Action
  28. -----------------------------------
  29.  
  30. function onTrigger(player,npc)
  31.     local KI = player:hasKeyItem();
  32.     local pNation = player:getNation();
  33.     local currentMission = player:getCurrentMission(pNation);
  34.     local MissionStatus = player:getVar("MissionStatus");
  35.    
  36.     if(pNation == (SANDORIA))then
  37.         if(currentMission == JOURNEY_TO_WINDURST and KI(SHIELD_OFFERING)) then
  38.             player:startEvent(0x002a);
  39.         end
  40.     elseif(pNation == (BASTOK)) then
  41.         if(currentMission == THE_EMISSARY_WINDURST and MissionStatus == 4 and KI(DULL_SWORD)) then
  42.             player:startEvent(0x0028);
  43.         elseif(currentMission == THE_EMISSARY_WINDURST and MissionStatus == 5) then
  44.             player:startEvent(0x002b);
  45.         end
  46.     else
  47.         player:startEvent(0x002c);
  48.     end
  49. end;
  50.  
  51. -----------------------------------
  52. -- onEventUpdate
  53. -----------------------------------
  54.  
  55. function onEventUpdate(player,csid,option)
  56. --printf("CSID: %u",csid);
  57. --printf("RESULT: %u",option);
  58. end;
  59.  
  60. -----------------------------------
  61. -- onEventFinish
  62. -----------------------------------
  63.  
  64. function onEventFinish(player,csid,option)
  65. --printf("CSID: %u",csid);
  66. --printf("RESULT: %u",option);
  67.  
  68.     if(csid == 0x0028) then
  69.         player:setVar("MissionStatus",5);
  70.         player:delKeyItem(DULL_SWORD);
  71.     elseif(csid == 0x0029) then
  72.         player:tradeComplete();
  73.         player:setVar("MissionStatus",6);
  74.     elseif(csid == 0x002a) then
  75.         player:setVar("MissionStatus",6);
  76.         player:delKeyItem(SHIELD_OFFERING);
  77.     end
  78. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement