Advertisement
Brownies

qm1

Dec 11th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.77 KB | None | 0 0
  1. -----------------------------------
  2. -- Area: The_Garden_of_RuHmet
  3. -- NPC:  ??? (Jailer of Fortitude Spawn)
  4. -- Allows players to spawn the Jailer of Fortitude by trading 12 Ghrah M Chips to a ???.
  5. -- @pos ,-420 0 755
  6. -----------------------------------
  7. package.loaded["scripts/zones/The_Garden_of_RuHmet/TextIDs"] = nil;
  8. -----------------------------------
  9.  
  10. require("scripts/zones/The_Garden_of_RuHmet/TextIDs");
  11. require("scripts/zones/The_Garden_of_RuHmet/MobIDs");
  12.  
  13.  
  14. -----------------------------------
  15. -- onTrade Action
  16. -----------------------------------
  17.  
  18. function onTrade(player,npc,trade)
  19.     npc = GetNPCbyID(16921028);
  20.     -- Trade 12 Ghrah M Chips
  21.     if(GetMobAction(16921015) == 0 and trade:hasItemQty(1872,12) and trade:getItemCount() == 12) then
  22.         player:tradeComplete();
  23.         mobspawn:setSpawn(npc:getXPos(),npc:getYPos(),npc:getZPos());
  24.         GetNPCByID(16921028):hideNPC(900);
  25.         --SpawnMob(16921015,180):updateEnmity(player); -- Spawn Jailer of Fortitude
  26.         --local mobpop = GetNPCByID(17535224); -- Spawn ???
  27.        
  28.         --npc:setStatus(0);
  29.     end
  30.    
  31. end;
  32.  
  33. -----------------------------------
  34. -- OnGameHourAutomatisation
  35. -----------------------------------
  36.  
  37. function OnGameHourAutomatisation(npc,player)
  38.     local Spawn = getServerVar("[SPN]Fortitude"); -- start in spawn pos 1.
  39.     local qm1p = getServerVar ("[POSI]Fortitude");
  40.     local SpawnTimer = tonumber(os.time(t));
  41.     local s = 900 -- wait time till change to next spawn pos, set to 15 mins.
  42.    
  43.     if(Spawn = (SpawnTimer - os.time(t) >= s)) then -- change spawn pos every 15 mins.
  44.         setServerVar("[POSI]Fortitude", Spawn + 1);
  45.     elseif (Spawn == 6) then -- set spawn pos to 1 after counter reach 6.
  46.         setServerVar("[POSI]Fortitude",1);
  47.         if (Spawn = 1) then
  48.             GetNPCbyID(16921028):setPos(-420,0.00,755); -- spawn point 1 "Hume"
  49.         elseif (Spawn = 2) then
  50.             GetNPCbyID(16921028):setPos(-43,0.00,460); -- spawn point 2 "Elvaan"
  51.         elseif (Spawn = 3) then
  52.             GetNPCbyID(16921028):setPos(-260,0.00,44.821); -- spawn point 3 "Galka"
  53.         elseif (Spawn = 4) then
  54.             GetNPCbyID(16921028):setPos(-580,0.00,43); -- spawn point 4 "Taru"
  55.         elseif (Spawn = 5) then
  56.             GetNPCbyID(16921028):setPos(-796,0.00,460); -- spawn point 5 "Mithra"
  57.         end
  58.     end
  59. end;   
  60.        
  61. -----------------------------------
  62. -- onTrigger Action
  63. -----------------------------------
  64.  
  65. function onTrigger(player,npc)
  66.  
  67. end;
  68.  
  69. -----------------------------------
  70. -- onEventUpdate
  71. -----------------------------------
  72.  
  73. function onEventUpdate(player,csid,option)
  74. --printf("onUpdate CSID: %u",csid);
  75. --printf("onUpdate RESULT: %u",option);
  76.     end;
  77.  
  78. -----------------------------------
  79. -- onEventFinish Action
  80. -----------------------------------
  81.  
  82. function onEventFinish(player,csid,option)
  83. --printf("onFinish CSID: %u",csid);
  84. --printf("onFinish RESULT: %u",option);
  85.     end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement