Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.25 KB | None | 0 0
  1. --------------------------------------------------------------
  2. -- func: @heroshop
  3. -- auth: TeoTwawki
  4. -- desc: like @shop, but for accomplished adventurers only
  5. --------------------------------------------------------------
  6.  
  7. cmdprops =
  8. {
  9.     permission = 4,
  10.     parameters = "i"
  11. }; -- unfinished, will remove this comment and change permission when done
  12.  
  13.  
  14. -- Notes:
  15. --
  16. -- ALWAYS comment your additions!
  17.  
  18.  
  19. function onTrigger(player,page)
  20.  
  21.     if (page == 0 or page == nil) then
  22.         player:PrintToPlayer( "Conquer content to unlock new @heroshop pages!");
  23.         player:PrintToPlayer( "1: Nations, 2: Zilart, 3: CoP, 4: ToAU");
  24.         player:PrintToPlayer( "5: WotG, 6: Abyssea, 7: Dynamis, 8: Legion");
  25.         -- player:PrintToPlayer( "9: VoidWatch, 10: Walk of Echoes");
  26.         return
  27.     end
  28.  
  29.     require("scripts/globals/missions");
  30.     local Sandy_clear = player:hasCompletedMission(SANDORIA,THE_HEIR_TO_THE_LIGHT);
  31.     local Basty_clear = player:hasCompletedMission(BASTOK,WHERE_TWO_PATHS_CONVERGE);
  32.     local Windy_clear = player:hasCompletedMission(WINDURST,MOON_READING);
  33.     local Zilart_clear = player:hasCompletedMission(ZILART,AWAKENING);
  34.     local Chains_clear = player:hasCompletedMission(COP,DAWN);
  35.     local AhtUrgan_clear = player:hasCompletedMission(TOAU,THE_EMPRESS_CROWNED);
  36.     local Goddess_clear = player:hasCompletedMission(WOTG,A_TOKEN_OF_TROTH);
  37.     local Abyssea_clear = player:hasCompletedQuest(ABYSSEA,THE_WYRM_GOD);
  38.     local Dyna_clearA = player:hasKeyItem(HYDRA_CORPS_BATTLE_STANDARD);
  39.     local Dyna_clearB = player:hasKeyItem(DYNAMIS_TAVNAZIA_SLIVER);
  40.     local Legion_clear = player:hasTitle(LEGENDARY_LEGIONNAIRE);
  41.  
  42.     if ((Sandy_clear == false or Basty_clear == true or Windy_clear == true) and Zilart_clear == true
  43.     and Chains_clear == true and AhtUrgan_clear == true and Goddess_clear == true and Abyssea_clear == true
  44.     and (Dyna_clearA == true or Dyna_clearB == true) and Legion_clear == true)
  45.         player:PrintToPlayer( "Not so fast, Hercules, you have to complete some legendary labors before you can shop here!" );
  46.         return
  47.     end
  48.  
  49.     if (page == 1) then -- Unlocked by attaining rank 10 in all 3 nations.
  50.         if (Sandy_clear == true and Basty_clear == true and Windy_clear == true) then
  51.             local stock_1 =
  52.             {
  53.                 -- ItemID,    Price,    -- Item Name
  54.                 -- ItemID,    Price,    -- Item Name
  55.                 -- ItemID,    Price,    -- Item Name
  56.             };
  57.             showShop(player, STATIC, stock_1);
  58.         end
  59.  
  60.     elseif (page == 2) then -- Unlocked by completing Rise of the Zilart.
  61.         if (Zilart_clear == true) then
  62.             local stock_2 =
  63.             {
  64.                 -- ItemID,    Price,    -- Item Name
  65.                 -- ItemID,    Price,    -- Item Name
  66.                 -- ItemID,    Price,    -- Item Name
  67.                 -- ItemID,    Price,    -- Item Name
  68.                 -- ItemID,    Price,    -- Item Name
  69.             };
  70.             showShop(player, STATIC, stock_2);
  71.         end
  72.  
  73.     elseif (page == 3) then -- Unlocked by completing Chains of Promathia.
  74.         if (Chains_clear == true) then
  75.             local stock_3 =
  76.             {
  77.                 -- ItemID,    Price,    -- Item Name
  78.                 -- ItemID,    Price,    -- Item Name
  79.                 -- ItemID,    Price,    -- Item Name
  80.                 -- ItemID,    Price,    -- Item Name
  81.                 -- ItemID,    Price,    -- Item Name
  82.             };
  83.             showShop(player, STATIC, stock_3);
  84.         end
  85.  
  86.     elseif (page == 4) then -- Unlocked by completing Treasures of Aht Urgan.
  87.         if (AhtUrgan_clear == true) then
  88.             local stock_4 =
  89.             {
  90.                 -- ItemID,    Price,    -- Item Name
  91.                 -- ItemID,    Price,    -- Item Name
  92.                 -- ItemID,    Price,    -- Item Name
  93.                 -- ItemID,    Price,    -- Item Name
  94.                 -- ItemID,    Price,    -- Item Name
  95.             };
  96.             showShop(player, STATIC, stock_4);
  97.         end
  98.  
  99.     elseif (page == 5) then -- Unlocked by completing Wings of the Goddess.
  100.         if (Goddess_clear == true) then
  101.             local stock_5 =
  102.             {
  103.                 -- ItemID,    Price,    -- Item Name
  104.                 -- ItemID,    Price,    -- Item Name
  105.                 -- ItemID,    Price,    -- Item Name
  106.                 -- ItemID,    Price,    -- Item Name
  107.                 -- ItemID,    Price,    -- Item Name
  108.             };
  109.             showShop(player, STATIC, stock_5);
  110.         end
  111.  
  112.     elseif (page == 6) then -- Unlocked by completing all of Abyssea.
  113.         -- if (player:getVar(MyVariableName) == 1) then
  114.             local stock_6 =
  115.             {
  116.                 -- ItemID,    Price,    -- Item Name
  117.                 -- ItemID,    Price,    -- Item Name
  118.                 -- ItemID,    Price,    -- Item Name
  119.                 -- ItemID,    Price,    -- Item Name
  120.                 -- ItemID,    Price,    -- Item Name
  121.                 -- ItemID,    Price,    -- Item Name
  122.             };
  123.             showShop(player, STATIC, stock_6);
  124.         -- end
  125.  
  126.     elseif (page == 7) then -- Unlocked by clearing every Dynamis zone.
  127.         -- if (player:getVar(MyVariableName) == 1) then
  128.             local stock_7 =
  129.             {
  130.                 -- ItemID,    Price,    -- Item Name
  131.                 -- ItemID,    Price,    -- Item Name
  132.                 -- ItemID,    Price,    -- Item Name
  133.                 -- ItemID,    Price,    -- Item Name
  134.                 -- ItemID,    Price,    -- Item Name
  135.             };
  136.             showShop(player, STATIC, stock_7);
  137.         -- end
  138.  
  139.     elseif (page == 8) then -- Unlocked by clearing every Legion battle.
  140.         -- if (player:getVar(MyVariableName) == 1) then
  141.             local stock_8 =
  142.             {
  143.                 -- ItemID,    Price,    -- Item Name
  144.                 -- ItemID,    Price,    -- Item Name
  145.                 -- ItemID,    Price,    -- Item Name
  146.                 -- ItemID,    Price,    -- Item Name
  147.                 -- ItemID,    Price,    -- Item Name
  148.             };
  149.             showShop(player, STATIC, stock_8);
  150.         -- end
  151.  
  152.     else
  153.         player:PrintToPlayer( string.format( "Page %i not found.", page ) );
  154.     end
  155.  
  156. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement