Advertisement
Brownies

onGameHour timer for npc pos chnage

Dec 12th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. -----------------------------------    
  2. -- onGameHour      
  3. -----------------------------------    
  4.  
  5. function onGameHour(npc, mob, player)
  6.      
  7.     local VanadielHour = VanadielHour();
  8.     local npc = GetNPCByID(16921027);
  9.     local qm1p = GetServerVariable("[POSI]Fortitude"); -- start in spawn pos 1.
  10.     local s = 1 -- wait time till change to next spawn pos, set to 15 mins.
  11.     if(VanadielHour % s == 0) then -- Change ??? position every 6 hours Vana'diel time (~15 mins)
  12.        SetServerVariable("[POSI]Fortitude", qm1p + 1);
  13.         printf("Qm1 will now change to spawn point.");
  14.                 if (qm1p == 1) then
  15.                         npc:setPos(-420,0.00,755); -- spawn point 1 "Hume"
  16.                         printf("Qm1 is at pos 1");
  17.                 elseif (qm1p == 2) then
  18.                         npc:setPos(-43,0.00,460); -- spawn point 2 "Elvaan"
  19.                         printf("Qm1 is at pos 2");
  20.                 elseif (qm1p == 3) then
  21.                         npc:setPos(-260,0.00,44.821); -- spawn point 3 "Galka"
  22.                         printf("Qm1 is at pos 2");
  23.                 elseif (qm1p == 4) then
  24.                         npc:setPos(-580,0.00,43); -- spawn point 4 "Taru"
  25.                         printf("Qm1 is at pos 4");
  26.                 elseif (qm1p == 5) then
  27.                         npc:setPos(-796,0.00,460); -- spawn point 5 "Mithra"
  28.                         printf("Qm1 is at pos 1");
  29.                 elseif (qm1p == 6) then -- set spawn pos to 1 after counter reach 6.
  30.                         SetServerVariable("[POSI]Fortitude",1);
  31.                         printf("Qm1 has reset to 1");
  32.                 end
  33.         end
  34. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement