public virtual void SimulationStep(ushort instanceID, ref ZombieInstance data, Vector3 physicsLodRefPos) { Logger.LogClassAndMethodName(this.GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); Logger.Log("2"); if ((data.m_flags & ZombieInstance.Flags.Character) != ZombieInstance.Flags.None) { Logger.Log(data.m_flags.ToString()); ZombieInstance.Frame lastFrameData = data.GetLastFrameData(); int num = Mathf.Clamp((int)(lastFrameData.m_position.x / 8f + 1080f), 0, 2159); int num2 = Mathf.Clamp((int)(lastFrameData.m_position.z / 8f + 1080f), 0, 2159); bool lodPhysics = Vector3.SqrMagnitude(physicsLodRefPos - lastFrameData.m_position) >= 62500f; this.SimulationStep(instanceID, ref data, ref lastFrameData, lodPhysics); int num3 = Mathf.Clamp((int)(lastFrameData.m_position.x / 8f + 1080f), 0, 2159); int num4 = Mathf.Clamp((int)(lastFrameData.m_position.z / 8f + 1080f), 0, 2159); if ((num3 != num || num4 != num2) && (data.m_flags & ZombieInstance.Flags.Character) != ZombieInstance.Flags.None) { Singleton<ZombieManager>.instance.RemoveFromGrid(instanceID, ref data, num, num2); Singleton<ZombieManager>.instance.AddToGrid(instanceID, ref data, num3, num4); } if (data.m_flags != ZombieInstance.Flags.None) { data.SetFrameData(Singleton<SimulationManager>.instance.m_currentFrameIndex, lastFrameData); } } }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack)) { if (Filled && from is ZombieAvatar) { var avatar = from as ZombieAvatar; PlayerZombieProfile profile = ZombieEvent.EnsureProfile(avatar.Owner); from.SendMessage(61, "You drink the contents of the crystal flask."); Consume(); if (Bad) { from.SendMessage(54, "Whatever was in the flask wasn't the cure."); from.Poison = Poison.Lethal; from.Hits = 5; } else { from.SendMessage(61, "You are now immune to the Zombie Plague!"); from.Hue = 61; ZombieInstance instance = ZombieEvent.GetInstance(); if (instance != null) { if (instance.CureWinner == null) { NetState.Instances.Where(ns => ns != null && ns.Mobile is PlayerMobile) .ForEach( ns => ns.Mobile.SendNotification <CureWinner>( profile.Owner.RawName + " was the first person to innoculate themselves against the Zombie Plague!", true, 1.0, 30.0, Color.LawnGreen)); instance.CureWinner = avatar.Owner; profile.OverallScore += 1500; profile.SpendablePoints += 1500; } else { instance.CureCompleters.Add(avatar.Owner); profile.OverallScore += 800; profile.SpendablePoints += 800; } } } } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } base.OnDoubleClick(from); }
public override void OnDamage(int amount, Mobile @from, bool willKill) { if (Owner != null) { PlayerZombieProfile profile = ZombieEvent.EnsureProfile(Owner); ZombieInstance zevent = ZombieEvent.GetInstance(); if (zevent != null && profile.LeaveEventTimer != null && profile.LeaveEventTimer.Running) { profile.LeaveEventTimer.Stop(); SendMessage(54, "Your attempt to leave was interrupted. Either initate another leave attempt or close and reopen your client to log instantly."); } } base.OnDamage(amount, @from, willKill); }
public override bool OnBeforeDeath() { if (Owner != null) { PlayerZombieProfile profile = ZombieEvent.EnsureProfile(Owner); ZombieInstance zevent = ZombieEvent.GetInstance(); if (NetState == null) { Blessed = true; Hidden = true; CantWalk = true; IgnoreMobiles = true; profile.ZombieSavePoint = Point3D.Zero; } if (zevent != null) { return(zevent.HandleAvatarDeath(profile, LastKiller)); } } return(OnBeforeDeath()); }
public virtual void SimulationStep(ushort instanceID, ref ZombieInstance citizenData, ref ZombieInstance.Frame frameData, bool lodPhysics) { Logger.LogClassAndMethodName(this.GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); Logger.Log("3"); }
public virtual void SetTarget(ushort instanceID, ref ZombieInstance data, ushort targetBuilding) { }
public virtual void SetSource(ushort instanceID, ref ZombieInstance data, ushort sourceBuilding) { }
public virtual void ReleaseInstance(ushort instanceID, ref ZombieInstance data) { this.SetSource(instanceID, ref data, 0); this.SetTarget(instanceID, ref data, 0); }
public virtual void CreateInstance(ushort instanceID, ref ZombieInstance data) { }