private void OnErinnDaytimeTick(MabiTime time) { if(!time.IsNight) WarpNPC(48, 11100, 30400, false); else WarpNPC(15, 0, 0, false); }
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); }
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); } }
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); } } }
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); } } }
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); } }
public static void OnRealTimeTick(MabiTime time) { if (RealTimeTick != null) RealTimeTick(time); }
public static void OnErinnTimeTick(MabiTime time) { try { if (ErinnTimeTick != null) ErinnTimeTick(time); } catch (Exception ex) { Logger.Exception(ex, "In OnErinnTimeTick: " + ex.Message, true); } }
public static void OnErinnMidnightTick(MabiTime time) { if (ErinnMidnightTick != null) ErinnMidnightTick(time); }
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); } } }
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!"); }
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); } }
private void OnRealTimeTick(MabiTime time) { if (time.DateTime.Minute % 20 != 0 && _prevWeather.Count > 0) return; this.BroadcastWeather(); }
/// <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); } } } }
protected void OnErinnTimeTick(MabiTime time) { if(time.Hour >= 17 || time.Hour < 6) { if(!_visible) Warp(_visible = true); } else { if(_visible) Warp(_visible = false); } }