Esempio n. 1
0
 private void OnErinnDaytimeTick(MabiTime time)
 {
     if(!time.IsNight)
         WarpNPC(48, 11100, 30400, false);
     else
         WarpNPC(15, 0, 0, false);
 }
Esempio n. 2
0
 private void OnErinnDaytimeTick(MabiTime time)
 {
     if (!time.IsNight)
         WarpNPC(region: 4015, x: 32951, y: 40325, flash: false);
     else
         WarpNPC(region: 15, x: 100, y: 0, flash: false);
 }
Esempio n. 3
0
    public void OnErinnDaytimeTick(MabiTime time)
    {
        var state = "closed";
        if(time.IsNight)
            state = "open";

        foreach (var gate in _gates.Values)
        {
            gate.Prop.State = state;
            Send.PropUpdate(gate.Prop);
        }
    }
Esempio n. 4
0
        private void ChangeItemColors(MabiTime time)
        {
            if (!WorldConf.ColorChange || !this.ColorChangeEnabled)
                return;

            var rand = RandomProvider.Get();

            foreach (var tab in Tabs)
            {
                foreach (var item in tab.Items)
                {
                    item.Info.ColorA = MabiData.ColorMapDb.GetRandom(item.DataInfo.ColorMap1, rand);
                    item.Info.ColorB = MabiData.ColorMapDb.GetRandom(item.DataInfo.ColorMap2, rand);
                    item.Info.ColorC = MabiData.ColorMapDb.GetRandom(item.DataInfo.ColorMap3, rand);
                }
            }
        }
Esempio n. 5
0
 protected void OnPhraseTick(MabiTime time)
 {
     if (this.Phrases.Count > 0)
     {
         if (--_ticksTillNextPhrase <= 0)
         {
             var rand = RandomProvider.Get();
             this.Speak(Phrases[rand.Next(Phrases.Count)]);
             _ticksTillNextPhrase = rand.Next(10, 30);
         }
     }
 }
Esempio n. 6
0
    protected void OnErinnTimeTick(MabiTime time)
    {
        var h = time.Hour;

        // Visible from 9-11, 15-17, and 19-21
        if((h >= 9 && h < 11) || (h >= 15 && h < 17) || (h >= 19 && h < 21))
        {
            if(!_visible)
                Warp(_visible = true);
        }
        else
        {
            if(_visible)
                Warp(_visible = false);
        }
    }
Esempio n. 7
0
 public static void OnRealTimeTick(MabiTime time)
 {
     if (RealTimeTick != null)
         RealTimeTick(time);
 }
Esempio n. 8
0
 public static void OnErinnTimeTick(MabiTime time)
 {
     try
     {
         if (ErinnTimeTick != null)
             ErinnTimeTick(time);
     }
     catch (Exception ex)
     {
         Logger.Exception(ex, "In OnErinnTimeTick: " + ex.Message, true);
     }
 }
Esempio n. 9
0
 public static void OnErinnMidnightTick(MabiTime time)
 {
     if (ErinnMidnightTick != null)
         ErinnMidnightTick(time);
 }
Esempio n. 10
0
            public static void OnErinnDaytimeTick(MabiTime time)
            {
                if (ErinnDaytimeTick == null)
                    return;

                // Iterate through the handlers to be able to tell which one errored,
                // and let the ones after that on be called.
                foreach (var handler in ErinnDaytimeTick.GetInvocationList().Cast<TimeEventHandler>())
                {
                    try { handler(time); }
                    catch (Exception ex) { Logger.Error("Source: {0}.{1}, Error: {2}", handler.Target, handler.Method.Name, ex.Message); }
                }
            }
Esempio n. 11
0
 private void OnMidnightTick(MabiTime time)
 {
     var next = GetLocation(DateTime.Now);
     WarpNPC(next.Item1, next.Item2, next.Item3);
     if(_broadcastLocation)
         Broadcast("[Price] I'm at " + next.Item4 + " now!");
 }
Esempio n. 12
0
        protected virtual void RestoreStats(MabiTime time)
        {
            if (this.IsDead)
                return;

            lock (this.StatRegens)
            {
                var toRemove = new List<MabiStatRegen>();
                foreach (var mod in this.StatRegens)
                {
                    if (mod.TimeLeft < 1)
                    {
                        toRemove.Add(mod);
                    }
                    else
                    {
                        switch (mod.Stat)
                        {
                            case Stat.Life: this.Life += mod.ChangePerSecond; break;
                            case Stat.Mana: this.Mana += mod.ChangePerSecond; break;
                            case Stat.Stamina: this.Stamina += mod.ChangePerSecond; break;
                        }
                    }
                }
                foreach (var mod in toRemove)
                    this.StatRegens.Remove(mod);
            }
        }
Esempio n. 13
0
        private void OnRealTimeTick(MabiTime time)
        {
            if (time.DateTime.Minute % 20 != 0 && _prevWeather.Count > 0)
                return;

            this.BroadcastWeather();
        }
Esempio n. 14
0
        /// <summary>
        /// Broadcasts Eweca notices and updates stat regens.
        /// </summary>
        /// <param name="mt"></param>
        private void DaytimeChange(MabiTime mt)
        {
            var notice = mt.IsNight
                ? Localization.Get("world.eweca_night") // Eweca is rising.\nMana is starting to fill the air all around.
                : Localization.Get("world.eweca_day");  // Eweca has disappeared.\nThe surrounding Mana is starting to fade away.
            Send.ChannelNotice(NoticeType.MiddleTop, notice);

            lock (_creatures)
            {
                foreach (var creature in _creatures.Where(a => a.Client is WorldClient))
                {
                    if (creature.ManaRegen != null)
                    {
                        if (mt.IsNight)
                            creature.ManaRegen.ChangePerSecond *= 3;
                        else
                            creature.ManaRegen.ChangePerSecond /= 3;
                        this.CreatureStatsUpdate(creature);
                    }
                }
            }
        }
Esempio n. 15
0
 protected void OnErinnTimeTick(MabiTime time)
 {
     if(time.Hour >= 17 || time.Hour < 6)
     {
         if(!_visible)
             Warp(_visible = true);
     }
     else
     {
         if(_visible)
             Warp(_visible = false);
     }
 }