public override void OnDoubleClick(Mobile m) { if (m.Y < this.Y && m.InRange(this.GetWorldLocation(), 2)) { DoTeleport(m); } else if (m.Y > this.Y && m.InRange(this.GetWorldLocation(), 2) && m.Backpack.FindItemByType(typeof(VortexCube)) != null) { Item square = m.Backpack.FindItemByType(typeof(VortexCube)); if (square is VortexCube) { VortexCube cube = (VortexCube)square; int quest = cube.HasConvexLense + cube.HasConcaveLense + cube.HasKeyLaw + cube.HasKeyChaos + cube.HasKeyBalance + cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple; if (cube.CubeOwner == m && quest > 10) { DoTeleport(m); } else { m.SendMessage("This door seems to be magically sealed."); } } } else if (m.Y > this.Y && m.InRange(this.GetWorldLocation(), 2) && m.Backpack.FindItemByType(typeof(CodexWisdom)) != null) { Item book = m.Backpack.FindItemByType(typeof(CodexWisdom)); if (book is CodexWisdom) { CodexWisdom codex = (CodexWisdom)book; if (codex.CodexOwner == m) { DoTeleport(m); } else { m.SendMessage("This door seems to be magically sealed."); } } } else if (m.InRange(this.GetWorldLocation(), 2)) { m.SendMessage("This door seems to be magically sealed."); } else { m.SendLocalizedMessage(502138); // That is too far away for you to use } }
public override void OnExit(Mobile m) { base.OnExit(m); if (m is PlayerMobile) { LoggingFunctions.LogRegions(m, this.Name, "exit"); } if (this.Name == "the Lodoria Forest") { CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); CharacterDatabase.SetDiscovered(m, "the Land of Lodoria", true); } else if (this.Name == "the Chamber of the Codex") { ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is CodexWisdom) { if (((CodexWisdom)item).CodexOwner == m) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; if (item is CodexWisdom) { CodexWisdom codex = (CodexWisdom)item; bool DestroyLense = true; if ((codex.SkillFirst == codex.PreviousFirst || codex.SkillFirst == codex.PreviousSecond) && (codex.SkillSecond == codex.PreviousFirst || codex.SkillSecond == codex.PreviousSecond)) { DestroyLense = false; } if (DestroyLense) { codex.PreviousFirst = codex.SkillFirst; codex.PreviousSecond = codex.SkillSecond; codex.HasConvexLense = 0; codex.HasConcaveLense = 0; } } } } }
public override bool OnMoveOver(Mobile m) { if (m is PlayerMobile) { if (m.Backpack.FindItemByType(typeof(VortexCube)) != null) { Item square = m.Backpack.FindItemByType(typeof(VortexCube)); if (square is VortexCube) { VortexCube cube = (VortexCube)square; int quest = cube.HasConvexLense + cube.HasConcaveLense + cube.HasKeyLaw + cube.HasKeyChaos + cube.HasKeyBalance + cube.HasCrystalRed + cube.HasCrystalBlue + cube.HasCrystalGreen + cube.HasCrystalYellow + cube.HasCrystalWhite + cube.HasCrystalPurple; if (cube.CubeOwner == m && quest > 10) { square.Delete(); ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is VortexCube) { if (((VortexCube)item).CubeOwner == m) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; item.Delete(); } CodexWisdom book = new CodexWisdom(); book.CodexOwner = m; book.HasConvexLense = 1; book.HasConcaveLense = 1; m.AddToBackpack(book); m.SendMessage("You draw the Codex out from the Void!"); m.LocalOverheadMessage(MessageType.Emote, 1150, true, "You draw the Codex out from the Void"); m.SendSound(0x203); LoggingFunctions.LogGeneric(m, "has obtained the Codex of Ultimate Wisdom."); } } } } return(true); }
public override void OnDoubleClick(Mobile from) { int remove = 0; if (from.InRange(this.GetWorldLocation(), 5)) { string say = "You find nothing useful on the corpse"; if (from.Backpack.FindItemByType(typeof(VortexCube)) != null) { Item square = from.Backpack.FindItemByType(typeof(VortexCube)); if (square is VortexCube) { VortexCube cube = (VortexCube)square; if (this.Name == "Lor-wis-lem's corpse") { if (cube.HasConvexLense == 0) { cube.HasConvexLense = 1; say = "You take possession of the Convex Lense!"; from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the Convex Lense."); remove = 1; } } else { if (cube.HasConcaveLense == 0) { cube.HasConcaveLense = 1; say = "You take possession of the Concave Lense!"; from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the Concave Lense."); remove = 1; } } } } else if (from.Backpack.FindItemByType(typeof(CodexWisdom)) != null) { Item codex = from.Backpack.FindItemByType(typeof(CodexWisdom)); if (codex is CodexWisdom) { CodexWisdom book = (CodexWisdom)codex; if (this.Name == "Lor-wis-lem's corpse") { if (book.HasConvexLense == 0) { book.HasConvexLense = 1; say = "You take possession of the Convex Lense!"; from.SendSound(0x3D); remove = 1; } } else { if (book.HasConcaveLense == 0) { book.HasConcaveLense = 1; say = "You take possession of the Concave Lense!"; from.SendSound(0x3D); remove = 1; } } } } else if (from.FindItemOnLayer(Layer.Talisman) != null) { Item codex = from.FindItemOnLayer(Layer.Talisman); if (codex is CodexWisdom) { CodexWisdom book = (CodexWisdom)codex; if (this.Name == "Lor-wis-lem's corpse") { if (book.HasConvexLense == 0) { book.HasConvexLense = 1; say = "You take possession of the Convex Lense!"; from.SendSound(0x3D); remove = 1; } } else { if (book.HasConcaveLense == 0) { book.HasConcaveLense = 1; say = "You take possession of the Concave Lense!"; from.SendSound(0x3D); remove = 1; } } } } from.SendMessage(say); } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } if (remove > 0) { this.Delete(); } }