public override void OnRemoved(object parent) { Mobile mob = parent as Mobile; if (mob != null) { string modName = this.Serial.ToString(); mob.RemoveStatMod(modName + "Str"); mob.RemoveStatMod(modName + "Dex"); mob.RemoveStatMod(modName + "Int"); mob.CheckStatTimers(); if (XmlScript.HasTrigger(this, TriggerName.onUnequip)) { UberScriptTriggers.Trigger(this, (Mobile)parent, TriggerName.onUnequip); } } else if (parent is Item) { Item parentItem = (Item)parent; if (XmlScript.HasTrigger(this, TriggerName.onRemove)) { UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onRemove, parentItem); } } base.OnRemoved(parent); }
public override void OnSpeech(SpeechEventArgs e) { if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech)) { return; } if (!e.Handled && m_NewsTimer == null && e.HasKeyword(0x30) && e.Mobile.Alive && InRange(e.Mobile, 12)) // *news* { Direction = GetDirectionTo(e.Mobile); TownCrierEntry tce = GetRandomEntry(); if (tce == null) { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1005643); // I have no news at this time. } else { m_NewsTimer = Timer.DelayCall( TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(3.0), ShoutNews_Callback, new NewsInfo(tce)); PublicOverheadMessage(MessageType.Regular, 0x3B2, 502978); // Some of the latest news! } } }
public override void OnAdded(object parent) { if (parent is Mobile) { if (XmlScript.HasTrigger(this, TriggerName.onEquip) && UberScriptTriggers.Trigger(this, (Mobile)parent, TriggerName.onEquip)) { ((Mobile)parent).AddToBackpack(this); // override, put it in their pack base.OnAdded(parent); return; } if (Server.Engines.XmlSpawner2.XmlAttach.CheckCanEquip(this, (Mobile)parent)) { Server.Engines.XmlSpawner2.XmlAttach.CheckOnEquip(this, (Mobile)parent); } else { ((Mobile)parent).AddToBackpack(this); } } else if (parent is Item) { Item parentItem = (Item)parent; if (XmlScript.HasTrigger(this, TriggerName.onAdded)) { UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onAdded, parentItem); } } base.OnAdded(parent); }
public override void OnSpeech(SpeechEventArgs e) { if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech)) { return; } Mobile from = e.Mobile; if (!e.Handled && from is PlayerMobile && from.InRange(this.Location, 2) && e.HasKeyword(0x1F)) // *disguise* { PlayerMobile pm = (PlayerMobile)from; if (pm.NpcGuild == NpcGuild.ThievesGuild) { SayTo(from, 501839); // That particular item costs 700 gold pieces. } else { SayTo(from, 501838); // I don't know what you're talking about. } e.Handled = true; } base.OnSpeech(e); }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is EminosUndertakingQuest) { if (dropped is NoteForZoel) { QuestObjective obj = qs.FindObjective(typeof(GiveZoelNoteObjective)); if (obj != null && !obj.Completed) { dropped.Delete(); obj.Complete(); return(true); } } } } return(base.OnDragDrop(from, dropped)); }
public override void OnAdded(object parent) { Mobile mob = parent as Mobile; if (mob != null) { AddStatBonuses(mob); mob.CheckStatTimers(); if (XmlScript.HasTrigger(this, TriggerName.onEquip) && UberScriptTriggers.Trigger(this, (Mobile)parent, TriggerName.onEquip)) { ((Mobile)parent).AddToBackpack(this); // override, put it in their pack base.OnAdded(parent); return; } } else if (parent is Item) { Item parentItem = (Item)parent; if (XmlScript.HasTrigger(this, TriggerName.onAdded)) { UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onAdded, parentItem); } } base.OnAdded(parent); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Horn.Deleted) { return; } var entity = targeted as IEntity; if (UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, m_Horn)) { return; } IPoint3D loc; if (targeted is Item) { loc = ((Item)targeted).GetWorldLocation(); } else { loc = targeted as IPoint3D; } m_Horn.Use(from, loc); }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } PlayerMobile player = from as PlayerMobile; if (player != null) { if (dropped is DaemonDust) { DaemonDust dust = ( DaemonDust )dropped; int amount = (dust.Amount * 5); this.PlaySound(665); this.KP += amount; dust.Delete(); this.Say("*" + this.Name + " absorbs the daemon dust*"); return(false); } else { } } return(base.OnDragDrop(from, dropped)); }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } if (dropped is BlankScroll && UzeraanTurmoilQuest.HasLostScrollOfPower(from)) { FocusTo(from); Item scroll = new SchmendrickScrollOfPower(); if (!from.PlaceInBackpack(scroll)) { scroll.Delete(); from.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory. return(false); } else { dropped.Consume(); from.SendLocalizedMessage(1049346); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product. return(dropped.Deleted); } } return(base.OnDragDrop(from, dropped)); }
public virtual void OnComponentUsed(AddonComponent c, Mobile from) { if (XmlScript.HasTrigger(this, TriggerName.onUse) && UberScriptTriggers.Trigger(this, from, TriggerName.onUse)) { return; } }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } var player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is TheSummoningQuest) { if (dropped is DaemonBone) { var bones = (DaemonBone)dropped; QuestObjective obj = qs.FindObjective(typeof(CollectBonesObjective)); if (obj != null && !obj.Completed) { int need = obj.MaxProgress - obj.CurProgress; if (bones.Amount < need) { obj.CurProgress += bones.Amount; bones.Delete(); qs.ShowQuestLogUpdated(); } else { obj.Complete(); bones.Consume(need); if (!bones.Deleted) { // TODO: Accurate? SayTo(from, 1050038); // You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time. } } } else { // TODO: Accurate? SayTo(from, 1050038); // You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time. } return(false); } } } return(base.OnDragDrop(from, dropped)); }
public override void OnRemoved(object parent) { if (parent is Mobile) { if (XmlScript.HasTrigger(this, TriggerName.onUnequip)) { UberScriptTriggers.Trigger(this, (Mobile)parent, TriggerName.onUnequip); } Mobile from = (Mobile)parent; m_AosSkillBonuses.Remove(); m_AosAttributes.RemoveStatBonuses(from); if (m_Creature != null && !m_Creature.Deleted) { Effects.SendLocationParticles(EffectItem.Create(m_Creature.Location, m_Creature.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042); Effects.PlaySound(m_Creature, m_Creature.Map, 0x201); m_Creature.Delete(); } StopTimer(); } else if (parent is Item) { Item parentItem = (Item)parent; if (XmlScript.HasTrigger(this, TriggerName.onRemove)) { UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onRemove, parentItem); } } InvalidateProperties(); }
public override bool OnDragDrop(Mobile from, Item item) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, item)) { return(true); } if (m_Pay != 0) { // Is the creature already hired if (!Controlled) { // Is the item the payment in gold if (item is Gold) { // Is the payment in gold sufficient if (item.Amount >= m_Pay) { // Check if this mobile already has a hire BaseHire hire; m_HireTable.TryGetValue(from, out hire); if (hire != null && !hire.Deleted && hire.GetOwner() == from) { SayTo(from, 500896); // I see you already have an escort. } // Try to add the hireling as a follower else if (AddHire(from)) { SayTo(from, 1043258, string.Format("{0}", (int)item.Amount / m_Pay)); //"I thank thee for paying me. I will work for thee for ~1_NUMBER~ days.", (int)item.Amount / m_Pay ); m_HireTable[from] = this; m_HoldGold += item.Amount; m_PayTimer = new PayTimer(this); m_PayTimer.Start(); return(true); } return(false); } else { this.SayHireCost(); } } else { SayTo(from, 1043268); // Tis crass of me, but I want gold } } else { Say(1042495); // I have already been hired. } } else { SayTo(from, 500200); // I have no need for that. } return(base.OnDragDrop(from, item)); }
public override void OnSpeech(SpeechEventArgs e) { if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech)) { return; } Mobile m = e.Mobile; Faction fact = Faction.Find(m); if (!e.Handled && m.Alive && e.HasKeyword(0x38)) // *appraise* { if (FactionAllegiance != null && fact != null && FactionAllegiance != fact) { Say("I will not do business with the enemy!"); } else if (!TestCenter.Enabled) { PublicOverheadMessage(MessageType.Regular, 0x3B2, 500608); // Which deed would you like appraised? m.BeginTarget(12, false, TargetFlags.None, Appraise_OnTarget); e.Handled = true; } } base.OnSpeech(e); }
public override void OnDelete() { if (XmlScript.HasTrigger(this, TriggerName.onDelete)) { UberScriptTriggers.Trigger(this, this.RootParentEntity as Mobile, TriggerName.onDelete); } base.OnDelete(); }
public override void OnSpeech(SpeechEventArgs e) { if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech)) { return; } if (!e.Handled && e.HasKeyword(Keyword) && e.Mobile.InRange(Location, 2)) { e.Handled = true; Mobile from = e.Mobile; var g = from.Guild as Guild; var ethic = Ethics.Player.Find(e.Mobile); if (g == null && ethic == null || g != null && g.Type != Type && ethic == null) { Say(SignupNumber); } else if (ethic != null && Shield is OrderShield && ethic.Ethic is EvilEthic || ethic != null && Shield is ChaosShield && ethic.Ethic is HeroEthic) { Say("Begone! You do not follow the proper ethic to wield one of our order's shields."); } else { Container pack = from.Backpack; BaseShield shield = Shield; Item twoHanded = from.FindItemOnLayer(Layer.TwoHanded); if ((pack != null && pack.FindItemByType(shield.GetType()) != null) || (twoHanded != null && shield.GetType().IsInstanceOfType(twoHanded))) { Say(1007110); // Why dost thou ask about virtue guards when thou art one? shield.Delete(); } else if (from.PlaceInBackpack(shield)) { Say(Utility.Random(1007101, 5)); Say(1007139); // I see you are in need of our shield, Here you go. from.AddToBackpack(shield); } else { from.SendLocalizedMessage(502868); // Your backpack is too full. shield.Delete(); } } } base.OnSpeech(e); }
public override bool OnDragDrop(Mobile from, Item item) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, item)) { return(true); } return(XmlQuest.RegisterGive(from, this, item)); //return base.OnDragDrop(from, item); }
// Alan Mod =================================== // this is when THIS container is added or removed from something public override void OnAdded(object parent) { if (parent is Item) { Item parentItem = (Item)parent; if (XmlScript.HasTrigger(this, TriggerName.onAdded)) { UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onAdded, parentItem); } } base.OnAdded(parent); }
protected override void OnTarget(Mobile from, object o) { var entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Owner)) { return; } if (o is RecallRune) { var rune = (RecallRune)o; if (rune.Marked) { m_Owner.Effect(rune.Target, rune.TargetMap, true); } else { from.SendLocalizedMessage(501803); // That rune is not yet marked. } } else if (o is Runebook) { RunebookEntry e = ((Runebook)o).Default; if (e != null) { m_Owner.Effect(e.Location, e.Map, true); } else { from.SendLocalizedMessage(502354); // Target is not marked. } } /*else if ( o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat ) * { * BaseBoat boat = ((Key)o).Link as BaseBoat; * * if ( !boat.Deleted && boat.CheckKey( ((Key)o).KeyValue ) ) * m_Owner.Effect( boat.GetMarkedLocation(), boat.Map, false ); * else * from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object. * }*/ else { from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "")); // I can not gate travel from that object. } }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } if (IsAccessibleTo(from) && (dropped is PlagueBeastInnard || dropped is PlagueBeastGland)) { return(base.OnDragDrop(from, dropped)); } return(false); }
public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) { if (!CheckHold(from, dropped, sendFullMessage, true)) { return(false); } if (XmlScript.HasTrigger(this, TriggerName.onDropIntoContainer) && UberScriptTriggers.Trigger(this, from, TriggerName.onDropIntoContainer, dropped)) // true if return override { return(false); } BaseHouse house = BaseHouse.FindHouseAt(this); if (house != null && house.IsLockedDown(this)) { if (dropped is VendorRentalContract || (dropped is Container && ((Container)dropped).FindItemByType(typeof(VendorRentalContract)) != null)) { from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container. return(false); } if (!house.LockDown(from, dropped, false)) { return(false); } } List <Item> list = this.Items; for (int i = 0; i < list.Count; ++i) { Item item = list[i]; if (!(item is Container) && item.StackWith(from, dropped, false)) { return(true); } } DropItem(dropped); // ARTEGORDONMOD // Begin mod for spawner release of items // set flag to have item taken off spawner list at next defrag ItemFlags.SetTaken(dropped, true); // End mod for spawner release of items return(true); }
public override void OnRemoved(object parent) { if (parent is Item) { Item parentItem = (Item)parent; if (XmlScript.HasTrigger(this, TriggerName.onRemove)) { UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onRemove, parentItem); } } //Server.Engines.XmlSpawner2.XmlAttach.CheckOnRemoved(this, parent); base.OnRemoved(parent); }
protected override void OnTarget(Mobile from, object o) { var entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Owner)) { return; } if (o is IPoint3D) { m_Owner.Target((IPoint3D)o); } }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } if (dropped is GoldenSkull) { dropped.Delete(); PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050046, from.Name); // Very well, ~1_NAME~, I accept your token. You may cross. BeginRemove(TimeSpan.FromSeconds(4.0)); Party p = PartySystem.Party.Get(from); if (p != null) { foreach (var pmi in p.Members) { Mobile member = pmi.Mobile; if (member != @from && member.Map == Map.Malas && member.Region.IsPartOf("Doom")) { if (m_AngryAt == member) { m_AngryAt = null; } member.CloseGump(typeof(ChylothPartyGump)); member.SendGump(new ChylothPartyGump(@from, member)); } } } if (m_AngryAt == from) { m_AngryAt = null; } TeleportToFerry(from); return(false); } return(base.OnDragDrop(from, dropped)); }
public override void OnRemoved(object parent) { if (parent is Mobile) { UberScriptTriggers.Trigger(this, (Mobile)parent, TriggerName.onUnequip); } else if (parent is Item) { Item parentItem = (Item)parent; UberScriptTriggers.Trigger(this, parentItem.RootParentEntity as Mobile, TriggerName.onRemove, parentItem); } Server.Engines.XmlSpawner2.XmlAttach.CheckOnRemoved(this, parent); base.OnRemoved(parent); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Potion != null && !m_Potion.Deleted && m_Potion.Map != Map.Internal) { var mob = targeted as Mobile; var p = targeted as IPoint3D; if (p != null) { Map map = from.Map; if (map != null) { SpellHelper.GetSurfaceTop(ref p); from.RevealingAction(); IEntity to = new Entity(Serial.Zero, new Point3D(p), map); if (RelativeLocation && mob != null) { to = mob; } Effects.SendMovingEffect(from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0); var entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, m_Potion)) { Effects.PlaySound(p, map, 0x307); Effects.SendLocationEffect(p, map, 0x36BD, 9, 10, 0, 0); m_Potion.Consume(); return; } if (m_Potion.Amount > 1) { Mobile.LiftItemDupe(m_Potion, 1); } m_Potion.Internalize(); Timer.DelayCall(TimeSpan.FromSeconds(1.0), m_Potion.Reposition_OnTick, new[] { from, to }); } } } }
protected override void OnTarget(Mobile from, object targeted) { var entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Spell)) { return; } if (targeted is Mobile && m_Spell.CheckBSequence((Mobile)targeted)) { var targ = (Mobile)targeted; SpellHelper.Turn(m_Spell.Caster, targ); if (targ.BeginAction(typeof(LightCycle))) { new LightCycle.NightSightTimer(targ).Start(); var level = (int) (LightCycle.DungeonLevel * ((from.EraAOS ? targ.Skills[SkillName.Magery].Value : from.Skills[SkillName.Magery].Value) / 100)); if (level < 0) { level = 0; } targ.LightLevel = level; targ.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist); targ.PlaySound(0x1E3); BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.NightSight, 1075643)); //Night Sight/You ignore lighting effects } else { from.SendMessage("{0} already have nightsight.", from == targ ? "You" : "They"); } } m_Spell.FinishSequence(); }
protected override void OnTarget(Mobile from, object o) { var entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Owner)) { return; } if (o is TrapableContainer) { m_Owner.Target((TrapableContainer)o); } else { from.SendMessage("You can't trap that"); } }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } PlayerMobile player = from as PlayerMobile; if (player != null) { QuestSystem qs = player.Quest; if (qs is DarkTidesQuest) { if (dropped is DarkTidesHorn) { if (player.Young) { DarkTidesHorn horn = (DarkTidesHorn)dropped; if (horn.Charges < 10) { SayTo(from, 1049384); // I have recharged the item for you. horn.Charges = 10; } else { SayTo(from, 1049385); // That doesn't need recharging yet. } } else { player.SendLocalizedMessage(1114333); //You must be young to have this item recharged. } return(false); } } } return(base.OnDragDrop(from, dropped)); }
public override bool OnDragDrop(Mobile from, Item dropped) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped)) { return(true); } if (!TestCenter.Enabled && dropped is HouseDeed) { Faction fact = Faction.Find(from); if (FactionAllegiance != null && fact != null && FactionAllegiance != fact) { Say("I will not do business with the enemy!"); } else { var deed = (HouseDeed)dropped; int price = ComputePriceFor(deed); if (price > 0) { if (Banker.Deposit(from, TypeOfCurrency, price)) { Say("For the deed I have placed {0} in your bank box : {1:#,0}", TypeOfCurrency.Name, price); deed.Delete(); return(true); } Say(500390); // Your bank box is full. return(false); } Say(500607); // I'm not interested in that. return(false); } } return(base.OnDragDrop(from, dropped)); }