sorvani

Scribe_Gurru.lua

Mar 4th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.81 KB | None | 0 0
  1. -- Completes the sewer flags for GoD progression. Also will remove players from instance.
  2. -- Scribe_Gurru NPCID:283052
  3. function event_say(e)
  4.     -- load the current qglobals
  5.     local qglobals = eq.get_qglobals(e.other);
  6.     if(e.message:findi("hail")) then
  7.         if (qglobals["temp_sewers"] ~= nil) then
  8.             -- if the player is working on sewer instance, update appropriately.
  9.             if (qglobals["temp_sewers"] == "1") then
  10.                 e.self:Say("Nice work, speak to the High Priest to continue.");
  11.                 eq.set_global("sewers","2",5,"F");
  12.                 e.other:Message(4,"You receive a character flag!");
  13.             elseif (qglobals["temp_sewers"] == "2" and qglobals["sewers"] == "2") then
  14.                 e.self:Say("Nice work, speak to the High Priest to continue.");
  15.                 eq.set_global("sewers","3",5,"F");
  16.                 e.other:Message(4,"You receive a character flag!");
  17.             elseif (qglobals["temp_sewers"] == "3" and qglobals["sewers"] == "3") then
  18.                 e.self:Say("Nice work, speak to the High Priest to continue.");
  19.                 eq.set_global("sewers","4",5,"F");
  20.                 e.other:Message(4,"You receive a character flag!");
  21.             elseif (qglobals["temp_sewers"] == "4" and (qglobals["sewers"] == "4" or qglobals["sewers"] == "5")) then
  22.                 e.self:Say("Nice work, the path to Vxed is open, speak with Apprentice Udranda.");
  23.                 eq.set_global("god_vxed_access","1",5,"F");
  24.                 e.other:Message(4,"You receive a character flag!");
  25.             elseif (qglobals["temp_sewers"] == "3" and qglobals["sewers"] == "2") then
  26.                 e.self:Say("Thank you for assisting in the Lair, please visit the Crematory to advance.");
  27.             elseif (qglobals["temp_sewers"] == "4") then
  28.                 e.self:Say("Thank you for assisting in the Pool, please visit the Plant to advance.");
  29.             elseif (qglobals["temp_sewers"] == "4" and qglobals["sewers"] == "2") then
  30.                 e.self:Say("Thank you for assisting in the Pool, please visit the Crematory to advance.");
  31.             elseif (qglobals["temp_sewers"] == "4" and qglobals["sewers"] == "3") then
  32.                 e.self:Say("Thank you for assisting in the Pool, please visit the Crematory to advance.");
  33.             elseif (qglobals["sewers"] == "2") then
  34.                 e.self:Say("Thank you for assisting in the Crematory, please visit the Plant to advance.");
  35.             elseif (qglobals["sewers"] == "3") then
  36.                 e.self:Say("Thank you for assisting in the Lair, please visit the Plant to advance.");
  37.             end
  38.         else
  39.             e.self:say("Please speak with the High Priest if you desire to assist");
  40.         end
  41.         -- this is a hack/work around until the expedition system is implemented.
  42.         e.self:Say("Do you need to leave an [" .. eq.say_link("expedition",false,"expedition") .. "]?");
  43.     elseif(e.message:findi("expedition")) then
  44.         -- determine whic instances the player is in already
  45.         -- Lua tbale contains zone short name and instance version as the key/pair values initially
  46.         local instance_id_list = {"snpool"=0,"snlair"=0,"snplant"=1,"sncrematory"=0,"vxed"=0,"tipt"=0};
  47.         -- go through the table and update the values to the instance ID returned
  48.         for k,v in pairs(instance_id_list) do
  49.             instance_id_list[k] = eq.get_instance_id(k,v);
  50.         end
  51.         -- go through the table create a message to ask the player which instances to leave
  52.         local in_an_instance = false;
  53.         local
  54.         for k,v in pairs(instance_id_list) do
  55.             if (v > 0) then
  56.                 if (in_an_instance == false) then
  57.                     -- note that we are in at least one instance
  58.                     in_an_instance = true;
  59.                 end
  60.                 e.other:Message(4,"Click the link if you wish to leave: " .. eq.say_link(k,false,"leave " .. v);
  61.             end
  62.         do
  63.         if (in_an_instance == false) then
  64.             e.self:Say("You are not a member of an expedition!");
  65.         end
  66.     elseif(e.message:findi("leave")) then
  67.         local instance_id = 0;
  68.         for i in string.gmatch(e.message, "%S+") do
  69.             if (tonumber(i)) then
  70.                 eq.remove_player_from_instance(tonumber(i));
  71.                 e.other:Message(4,"You have been removed from the expedition.");
  72.                 return;
  73.             end
  74.         end
  75.     end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment