public override bool OnMoveOver(Mobile m) { if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; pm.CheckKRStartingQuestStep(m_QuestStep); } return(base.OnMoveOver(m)); }
public static void RemoveHighlightKRUIElement(NetState state, PacketReader pvSrc) { Mobile m = World.FindMobile((Serial)pvSrc.ReadInt32()); int elementID = pvSrc.ReadInt16(); PlayerMobile pm = m as PlayerMobile; if (pm != null) { if (elementID == 0x791F) { pm.CheckKRStartingQuestStep(15); } if (elementID == 0x7919) { pm.CheckKRStartingQuestStep(6); } } }
public override void OnDoubleClick(Mobile from) { base.OnDoubleClick(from); PlayerMobile pm = (PlayerMobile)from; if (pm == null) { return; } pm.CheckKRStartingQuestStep(7); }
public override bool OnEquip(Mobile from) { if (base.OnEquip(from)) { if (from is PlayerMobile) { PlayerMobile pm = (PlayerMobile)from; pm.CheckKRStartingQuestStep(13); } return(true); } return(false); }
public static void ReportUseKRHotbarIcon(NetState state, PacketReader pvSrc) { pvSrc.ReadInt32(); // 0x00010006 /* * Types: * 0x1 - Spell * 0x2 - Weapon Ability * 0x3 - Skill * 0x4 - Item * 0x5 - Scroll * * As per RUOSI packet guide: * "Sometimes between 2.48.0.3 and 2.59.0.2 they changed it again: now type is always 0x06." */ int type = pvSrc.ReadByte(); pvSrc.ReadByte(); // 0x00 int objectID = pvSrc.ReadByte(); objectID |= pvSrc.ReadByte() << 8; objectID |= pvSrc.ReadByte() << 16; objectID |= pvSrc.ReadByte() << 24; #region KR Starting Quest Item item = World.FindItem((Serial)objectID); if (type == 6 && item != null && item is MagicArrowScroll) { PlayerMobile pm = state.Mobile as PlayerMobile; if (pm != null) { pm.CheckKRStartingQuestStep(23); } } #endregion }
public virtual void Open(Mobile from, bool checkSelfLoot) { if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2)) { #region Self Looting bool selfLoot = (checkSelfLoot && (from == m_Owner)); if (selfLoot) { if (from is PlayerMobile && from.Client != null && from.Client.Version.IsEnhanced) { PlayerMobile pm = (PlayerMobile)from; pm.Send(new RemoveWaypoint(this.Serial.Value)); pm.CheckKRStartingQuestStep(27); } ArrayList items = new ArrayList(this.Items); bool gathered = false; bool didntFit = false; Container pack = from.Backpack; bool checkRobe = true; for (int i = 0; !didntFit && i < items.Count; ++i) { Item item = (Item)items[i]; Point3D loc = item.Location; if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc)) { continue; } if (checkRobe) { DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe; if (robe != null) { robe.Delete(); } } if (m_EquipItems.Contains(item) && from.EquipItem(item)) { gathered = true; } else if (pack != null && pack.CheckHold(from, item, false, true)) { item.Location = loc; pack.AddItem(item); gathered = true; } else { didntFit = true; } } if (gathered && !didntFit) { SetFlag(CorpseFlag.Carved, true); if (ItemID == 0x2006) { ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random(0xECA, 9); // bone graphic Hue = 0; Direction = Direction.North; ProcessDelta(); } from.PlaySound(0x3E3); from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings. try { if (from is PlayerMobile && m_InsuredItems != null) { ArrayList bagitems = new ArrayList(from.Backpack.Items); List <Item> insureditems = m_InsuredItems; foreach (Item item in bagitems) { if (insureditems.Contains(item)) { Item move = from.FindItemOnLayer(item.Layer); if (move == null) { from.EquipItem(item); } } } m_InsuredItems = null; } } catch { } return; } if (gathered && didntFit) { from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse. } } #endregion if (!CheckLoot(from)) { return; } #region Quests PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is UzeraanTurmoilQuest) { GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective; if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player))) { Item bone = new QuestDaemonBone(); if (player.PlaceInBackpack(bone)) { obj.CorpseWithBone = null; player.SendLocalizedMessage(1049341, "", 0x22); // You rummage through the bones and find a Daemon Bone! You quickly place the item in your pack. if (!obj.Completed) { obj.Complete(); } } else { bone.Delete(); player.SendLocalizedMessage(1049342, "", 0x22); // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full. Come back when you have more room in your pack. } return; } } else if (qs is TheSummoningQuest) { VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective; if (obj != null && obj.Completed && obj.CorpseWithSkull == this) { GoldenSkull sk = new GoldenSkull(); if (player.PlaceInBackpack(sk)) { obj.CorpseWithSkull = null; player.SendLocalizedMessage(1050022); // For your valor in combating the devourer, you have been awarded a golden skull. qs.Complete(); } else { sk.Delete(); player.SendLocalizedMessage(1050023); // You find a golden skull, but your backpack is too full to carry it. } } } } #endregion if (m_Owner is WeakSkeleton && from is PlayerMobile) { ((PlayerMobile)from).CheckKRStartingQuestStep(20); } base.OnDoubleClick(from); if (from != m_Owner) { from.RevealingAction(); } } else { from.SendLocalizedMessage(500446); // That is too far away. return; } }