Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using DOL.Events;
- using System.Timers;
- namespace DOL.GS.GameEvents
- {
- public class ShatteredRotation
- {
- public static List<Location> Locations = new List<Location>();
- private static readonly short m_interval = 65;
- private static Timer m_timer = null;
- private static Timer m_tempTimer = null;
- private static int m_minutes = 0;
- private static bool temp_ticked = false;
- [ScriptLoadedEvent]
- public static void OnScriptCompiled(DOLEvent e, object sender, EventArgs args)
- {
- Init();
- }
- [ScriptUnloadedEvent]
- public static void OnScriptUnloaded(DOLEvent e, object sender, EventArgs args)
- {
- }
- private static void Init()
- {
- PopulateList();
- StartTimer();
- }
- private static void StartTimer()
- {
- int Interval = TimeSpan.FromMinutes(1).Milliseconds;
- m_timer = new Timer(Interval);
- m_timer.Start();
- m_timer.Elapsed += new ElapsedEventHandler(m_timer_Elapsed);
- }
- static void m_timer_Elapsed(object sender, ElapsedEventArgs e)
- {
- if (m_minutes == 60) //5min warning
- {
- }
- else if (m_minutes == 64)
- {
- m_tempTimer = new Timer(TimeSpan.FromSeconds(29).Milliseconds);
- m_tempTimer.Elapsed += new ElapsedEventHandler(m_tempTimer_Elapsed);
- }
- else if (m_minutes == 65)
- {
- //do teleport
- }
- m_minutes = m_minutes + 1 == 66 ? m_minutes = 0 : m_minutes + 1;
- }
- static void m_tempTimer_Elapsed(object sender, ElapsedEventArgs e)
- {
- //Jumping to new zone or skipping
- if (!temp_ticked)
- {
- temp_ticked = true;
- //warn 30 secs left
- }
- else
- {
- m_tempTimer.Stop();
- //alert zone change
- }
- }
- private static void TeleportPlayers()
- {
- }
- private static void PopulateList()
- {
- Location TirNaNog = new Location("Tir Na Nog", 19144, 34186, 6334, 3131, 201);
- Location QueensLab = new Location("Queens Labyrinth", 34755, 22389, 20459, 4034, 94);
- Location HesperosHaven = new Location("",283724, 579165, 8285, 1034, 73);
- Location SummonersHall = new Location("", 25909, 33010, 16064, 3080, 233);
- Location GothwaiteHarbor = new Location("", 515507, 515929, 3424, 3603, 51);
- Location Crater = new Location("", 364801, 324954, 6536, 2261, 151);
- Location MeteorImpact = new Location("", 394252, 208253, 4552, 4095, 181);
- Location Halheim = new Location("", 223348, 251174, 5131, 3077, 27);
- Location Aegir = new Location("", 258222, 359018, 3752, 3054, 151);
- Location Cotswold = new Location("", 583955, 486656, 2184, 6, 1);
- Location MagMell = new Location("", 342187, 592109, 5456, 3396, 200);
- Location Mularn = new Location("", 774606, 54713, 4600, 9, 100);
- Locations.Add(TirNaNog);
- Locations.Add(QueensLab);
- Locations.Add(HesperosHaven);
- Locations.Add(SummonersHall);
- Locations.Add(GothwaiteHarbor);
- Locations.Add(Crater);
- Locations.Add(MeteorImpact);
- Locations.Add(Halheim);
- Locations.Add(Aegir);
- Locations.Add(Cotswold);
- Locations.Add(MagMell);
- Locations.Add(Mularn);
- }
- }
- private class Location
- {
- string m_name;
- int m_x;
- int m_y;
- int m_z;
- ushort m_heading;
- ushort m_region;
- public Location(string zoneName, int x, int y, int z, ushort heading, ushort region)
- {
- m_name = zoneName;
- X = x;
- Y = y;
- Z = z;
- Heading = heading;
- Region = region;
- }
- public string Name
- {
- get { return m_name; }
- set { m_name = value; }
- }
- public int X
- {
- get { return m_x; }
- set { m_x = value; }
- }
- public int Y
- {
- get { return m_y; }
- set { m_y = value; }
- }
- public int Z
- {
- get { return m_z; }
- set { m_z = value; }
- }
- public ushort Heading
- {
- get { return m_heading; }
- set { m_heading = value; }
- }
- public ushort Region
- {
- get { return m_region; }
- set { m_region = value; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement