public void DoCure( Mobile from ) { bool cure = false; CureLevelInfo[] info = LevelInfo; for ( int i = 0; i < info.Length; ++i ) { CureLevelInfo li = info[i]; if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() ) { cure = true; break; } } if ( cure && from.CurePoison( from ) ) { from.SendAsciiMessage( "You feel cured of poison!" ); // You feel cured of poison! from.FixedEffect( 0x373A, 10, 15 ); from.PlaySound( 0x1E0 ); } else if ( !cure ) { from.SendAsciiMessage( "That potion was not strong enough to cure your ailment!" ); // That potion was not strong enough to cure your ailment! } }
protected override void OnTarget( Mobile from, object o ) { if ( o is Item ) { if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) ) { if ( o is BaseWeapon ) ((BaseWeapon)o).Identified = true; else if ( o is BaseArmor ) ((BaseArmor)o).Identified = true; else if ( o is BaseJewel ) ((BaseJewel)o).Identified = true; if ( !Core.AOS ) ((Item)o).OnSingleClick( from ); } else { from.SendAsciiMessage( "You are not certain..." ); } } else if ( o is Mobile ) { ((Mobile)o).OnSingleClick( from ); } else { from.SendAsciiMessage( "You are not certain..." ); } }
public void BeginSacrifice( Mobile from ) { if ( Deleted ) return; if ( m_Skull != null && m_Skull.Deleted ) Skull = null; if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 3 ) ) { from.SendAsciiMessage( "That is too far away." ); } else if ( !Harrower.CanSpawn ) { from.SendAsciiMessage( "The harrower has already been spawned." ); } else if ( m_Skull == null ) { from.SendAsciiMessage( "What would you like to sacrifice?" ); from.Target = new SacrificeTarget( this ); } else { SendAsciiMessageTo( from, "I already have my champions awakening skull!"); } }
protected override void OnTarget(Mobile from, object target) { if (target is BlankMap) { Item item = (Item)target; BaseTool tool = new MapmakersPen(); if (item.RootParent != from) from.SendAsciiMessage("That must be in your pack for you to use it."); else from.SendMenu(new CartographyMenu(from, CartographyMenu.Main(from), "Main", tool)); if (tool != null) tool.Delete(); } else if (target is WorldMap || target is LocalMap || target is CityMap || target is SeaChart) //from.Send(new AsciiMessage(((Item)target).Serial, ((Item)target).ItemID, MessageType.Regular, 0, 3, "", "You cannot overwrite this carefully hand-drawn map!")); from.SendAsciiMessage("You cannot overwrite this carefully hand-drawn map!"); else { from.SendAsciiMessage("This is not a map."); /*if (target is Item) from.Send(new AsciiMessage(((Item)target).Serial, ((Item)target).ItemID, MessageType.Regular, 0, 3, "", "This is not a map."));*/ } }
public override void OnDoubleClick( Mobile from ) { if ( !this.VerifyMove( from ) ) return; if ( !from.InRange( this.GetWorldLocation(), 2 ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "I can't reach that." ); // I can't reach that. return; } Point3D fireLocation = GetFireLocation( from ); if ( fireLocation == Point3D.Zero ) { from.SendAsciiMessage( "There is not a spot nearby to place your campfire." ); // There is not a spot nearby to place your campfire. } else if ( !from.CheckSkill( SkillName.Camping, 0.0, 100.0 ) ) { from.SendAsciiMessage("You fail to ignite the campfire."); // You fail to ignite the campfire. } else { Consume(); if ( !this.Deleted && this.Parent == null ) from.PlaceInBackpack( this ); new Campfire(from).MoveToWorld( fireLocation, from.Map ); } }
public override void OnDoubleClick(Mobile from) { if (from.AccessLevel > AccessLevel.Player) { from.SendAsciiMessage("Drop items in here for players to receive."); DisplayTo(from); return; } if (!IsChildOf(from.Backpack)) { from.SendAsciiMessage("The scroll must be in your backpack when used."); return; } Internalize(); //So you don't get overweight Item[] items = FindItemsByType(typeof (Item), true); bool inBank = false; foreach (Item item in items) { if (!from.AddToBackpack(item)) { from.BankBox.DropItem(item); inBank = true; } } from.SendAsciiMessage("The scroll summons treasures into your pack as you unravel it!"); if (inBank) from.SendAsciiMessage("You are overweight, the treasures were added to your bank"); Delete(); }
protected override void OnTarget( Mobile from, object targeted ) { from.RevealingAction(); int number = -1; if ( targeted is Mobile ) { Mobile targ = (Mobile)targeted; if ( targ.Player ) // We can't beg from players { from.SendAsciiMessage("Perhaps just asking would work better."); number = 500398; // Perhaps just asking would work better. } else if ( !targ.Body.IsHuman ) // Make sure the NPC is human { from.SendAsciiMessage("There is little chance of getting money from that!"); number = 500399; // There is little chance of getting money from that! } else if ( !from.InRange( targ, 2 ) ) { if (!targ.Female) { from.SendAsciiMessage("You are too far away to beg from him."); number = 500401; // You are too far away to beg from him. } else from.SendAsciiMessage("You are too far away to beg from her."); //number = 500402; // You are too far away to beg from her. } else if ( from.Mounted ) // If we're on a mount, who would give us money? { from.SendAsciiMessage("They seem unwilling to give you any money."); number = 500404; // They seem unwilling to give you any money. } else { // Face eachother from.Direction = from.GetDirectionTo( targ ); targ.Direction = targ.GetDirectionTo( from ); from.Animate( 32, 5, 1, true, false, 0 ); // Bow new InternalTimer( from, targ ).Start(); m_SetSkillTime = false; } } else // Not a Mobile { from.SendAsciiMessage("There is little chance of getting money from that!"); //number = 500399; // There is little chance of getting money from that! } number = -1; if ( number != -1 ) from.SendLocalizedMessage( number ); }
public override bool OnMoveOver( Mobile m ) { if(m_Game != null) m_Game.RemoveItemFromGameArea(this); Container pack = m.Backpack; Item[] placers = pack.FindItemsByType( typeof(BombermanBombPlacer) ); foreach (Item placer in placers) { if(placer is BombermanBombPlacer) { BombermanBombPlacer realPlacer = (BombermanBombPlacer)placer; if (placer != null) { if (Type == BombermanUpgradeType.Strength) { realPlacer.Strength = realPlacer.Strength + 1; m.SendAsciiMessage("Your bombs are now more powerful."); } else if (Type == BombermanUpgradeType.BombAmount) { realPlacer.MaxBombs = realPlacer.MaxBombs + 1; m.SendAsciiMessage("You can now place more bombs at the same time."); } else if (Type == BombermanUpgradeType.SpreadSpeed) { realPlacer.SpreadSpeed -= 0.001f; m.SendAsciiMessage("Your bombs will spread faster."); } else if (Type == BombermanUpgradeType.KickBombPlacer) { BombermanKickBombPlacer kplacer = (BombermanKickBombPlacer)pack.FindItemByType(typeof(BombermanKickBombPlacer)); if (kplacer == null) { BombermanKickBombPlacer kickplacer = new BombermanKickBombPlacer(m, m_Game); kickplacer.EventItem = true; kickplacer.LootType = LootType.Newbied; kickplacer.Strength = realPlacer.Strength; kickplacer.MaxBombs = realPlacer.MaxBombs; kickplacer.SpreadSpeed = realPlacer.SpreadSpeed; m.AddToBackpack(kickplacer); m.SendAsciiMessage("You have received a kickbombplacer. You can now kick bombs over stones."); } else { kplacer.Range += 1; m.SendAsciiMessage("The range of your kickbombplacer has increased."); } } } else m.SendAsciiMessage("You do not have a Bomberman Bomb Placer in your backpack"); } } Delete(); return true; }
protected override void OnTarget( Mobile from, object targeted ) { if ( targeted is Mobile ) { if ( targeted is PlayerMobile ) { if ( targeted == m_Sender ) from.SendAsciiMessage( "You cannot duel yourself." ); else if ( DuelGump.Exists( (Mobile)targeted ) || ((Mobile)targeted).Region is DuelRegion || ((PlayerMobile)targeted).SentRequest || ((PlayerMobile)targeted).RecievedRequest ) { from.SendAsciiMessage( "They look busy, maybe you should try again later." ); ((PlayerMobile)from).SentRequest = false; } else if ( !((Mobile)targeted).Alive ) { from.SendMessage( "A live opponent would be a better choice." ); ((PlayerMobile)from).SentRequest = false; } else if ( !from.Alive ) { from.SendMessage( "You cannot duel while dead." ); ((PlayerMobile)from).SentRequest = false; } else if ( from.Hits != from.HitsMax ) { from.SendMessage( "You need to heal before offering a duel." ); ((PlayerMobile)from).SentRequest = false; } else if ( ((Mobile)targeted).Hits != ((Mobile)targeted).HitsMax ) { from.SendMessage( "They are not at full health." ); ((PlayerMobile)from).SentRequest = false; } else { m_Reciever = (PlayerMobile)targeted; ((PlayerMobile)m_Reciever).RecievedRequest = true; m_Reciever.SendGump( new DuelAcceptGump( m_Sender, m_Reciever ) ); } } else if ( ((Mobile)targeted).Body.IsHuman ) { from.SendAsciiMessage( ((Mobile)targeted).Name + " does not wish to duel you." ); ((PlayerMobile)from).SentRequest = false; } else { from.SendAsciiMessage( "Maybe you should just attack it." ); ((PlayerMobile)from).SentRequest = false; } } else { from.SendAsciiMessage( "You seem to have died since making the offer." ); } }
protected override void OnTarget( Mobile from, object target ) { if ( target is Mobile ) { if ( from.CheckTargetSkill( SkillName.Forensics, target, 40.0, 100.0 ) ) { if ( target is PlayerMobile && ((PlayerMobile)target).NpcGuild == NpcGuild.ThievesGuild ) from.SendAsciiMessage( "That individual is a thief!" ); else from.SendAsciiMessage( "You notice nothing unusual." ); } else { from.SendAsciiMessage( "You cannot determain anything useful." ); } } else if ( target is Corpse ) { if ( from.CheckTargetSkill( SkillName.Forensics, target, 0.0, 100.0 ) ) { Corpse c = (Corpse)target; if ( ((Body)c.Amount).IsHuman ) c.LabelTo( from, 1042751, ( c.Killer == null ? "no one" : c.Killer.Name ) );//This person was killed by ~1_KILLER_NAME~ if ( c.Looters.Count > 0 ) { StringBuilder sb = new StringBuilder(); for (int i=0;i<c.Looters.Count;i++) { if ( i>0 ) sb.Append( ", " ); sb.Append( ((Mobile)c.Looters[i]).Name ); } c.LabelTo( from, 1042752, sb.ToString() );//This body has been distrubed by ~1_PLAYER_NAMES~ } else { c.LabelTo( from, "The corpse has not be desecrated." ); } } else { from.SendAsciiMessage( "You cannot determain anything useful." ); } } else if ( target is ILockpickable ) { ILockpickable p = (ILockpickable)target; if ( p.Picker != null ) from.SendAsciiMessage( "This lock was opened by " + p.Picker.Name ); else from.SendAsciiMessage( "You notice nothing unusual." ); } }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack) || Parent == from) { from.SendAsciiMessage("Please select the cloth you would like to use."); from.Target = new TailoringTarget(this); } else from.SendAsciiMessage("That must be in your pack for you to use it."); }
protected override void OnTarget( Mobile from, object targeted ) { if ( !from.Alive ) { from.SendAsciiMessage("The spirits of the dead are not the province of animal lore."); //from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore. } else if ( targeted is BaseCreature ) { BaseCreature c = (BaseCreature)targeted; if ( !c.IsDeadPet ) { if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea ) { if ( (!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Base < 100.0 ) { from.SendAsciiMessage("At your skill level, you can only lore tamed creatures."); //from.SendLocalizedMessage( 1049674 ); // At your skill level, you can only lore tamed creatures. } else if ( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 110.0 ) { from.SendAsciiMessage("At your skill level, you can only lore tamed or tameable creatures."); //from.SendLocalizedMessage( 1049675 ); // At your skill level, you can only lore tamed or tameable creatures. } else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 100.0 ) ) { from.SendAsciiMessage("You can't think of anything you know offhand."); //from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand. } else { from.CloseGump( typeof( AnimalLoreGump ) ); from.SendGump( new AnimalLoreGump( c ) ); } } else { from.SendAsciiMessage("That's not an animal!"); //from.SendLocalizedMessage( 500329 ); // That's not an animal! } } else { from.SendAsciiMessage("The spirits of the dead are not the province of animal lore."); //from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore. } } else { from.SendAsciiMessage("That's not an animal!"); //from.SendLocalizedMessage( 500329 ); // That's not an animal! } }
private static void OpenBrowser_Callback( Mobile m, bool okay, object unused ) { if ( okay ) { m.SendAsciiMessage( Ad_OkMsg ); m.LaunchBrowser( Ad_Url ); } else { m.SendAsciiMessage( Ad_CancelMsg ); } }
public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( OnTarget ) ); from.SendAsciiMessage( "Select the weapon or armor you wish to use the cloth on." ); } else { from.SendAsciiMessage( "That must be in your pack for you to use it." ); } }
public override void OnDoubleClick( Mobile from ) { if ( from.InRange( GetWorldLocation(), Core.AOS ? 2 : 1 ) ) { from.RevealingAction(); from.SendAsciiMessage( "Who will you use the bandages on?" ); from.Target = new InternalTarget( this ); } else { from.SendAsciiMessage( "You are too far away to do that." ); } }
public override bool Begin( Mobile from, BaseTool tool ) { if ( from.Deleted || !from.Alive || m_Wood == null || m_Wood.Deleted ) return false; if ( !base.Begin( from, tool ) ) return false; if ( m_Wood.IsChildOf( from ) ) { if ( ShowMenu( m_WoodMenu ) ) { return true; } else { End(); return false; } } else { from.SendAsciiMessage( "That wood belongs to someone else." ); End(); return false; } }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) from.SendAsciiMessage("That must be in your pack for you to use it."); else from.Target = new CarpentryTarget(this); }
public override void OnDoubleClick(Mobile from) { if ( !IsChildOf( from.Backpack ) ) { from.SendAsciiMessage( "That must be in your pack for you to use it." ); // } else if ( from.Skills[SkillName.Carpentry].Base < 90.0 ) { from.SendAsciiMessage( "You do not understand how to use this." ); // } else { from.SendAsciiMessage( "Target the corpse to make a trophy out of." ); // from.Target = new CorpseTarget( this ); } }
public override bool OnEquip( Mobile from ) { if ( from.AccessLevel < m_AccessLevel ) from.SendAsciiMessage( "You may not wear this." ); return ( from.AccessLevel >= m_AccessLevel ); }
public void OnSelectBuilding(Mobile from, object target, object state) { BattleBuilding bb = target as BattleBuilding; ArrayList list = state as ArrayList; if (bb == null) { from.SendAsciiMessage(0x25, "Select the building to add the items to!"); from.BeginTarget(18, false, TargetFlags.None, new TargetStateCallback(OnSelectBuilding), state); return; } int count = 0; foreach (Item i in list) { if (i != bb && !bb.Decorations.Contains(i)) { bb.Decorations.Add(i); count++; } } from.SendAsciiMessage(count.ToString() + " items added to building."); }
public override void Drink( Mobile from ) { if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) ) { from.SendAsciiMessage( "You can not use a purple potion while paralyzed." ); // You can not use a purple potion while paralyzed. return; } ThrowTarget targ = from.Target as ThrowTarget; if ( targ != null && targ.Potion == this ) return; from.RevealingAction(); if ( m_Users == null ) m_Users = new ArrayList(); if ( !m_Users.Contains( from ) ) m_Users.Add( from ); from.Target = new ThrowTarget( this ); if ( m_Timer == null ) { from.SendAsciiMessage( "You should throw it now!" ); // You should throw it now! m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 4, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); } }
public static TimeSpan OnUse( Mobile m ) { if ( !IsEmptyHanded( m ) ) { m.SendAsciiMessage( "Both hands must be free to steal." ); } else { m.Target = new Stealing.StealingTarget( m ); m.RevealingAction(); m.SendAsciiMessage( "Which item do you want to steal?" ); } return TimeSpan.FromSeconds( 10.0 ); }
public virtual bool Dye( Mobile from, DyeTub sender ) { if ( Deleted ) return false; BaseHouse house = BaseHouse.FindHouseAt( this ); if ( house != null && house.IsCoOwner( from ) ) { if ( from.InRange( GetWorldLocation(), 1 ) ) { Hue = sender.DyedHue; return true; } else { from.SendAsciiMessage( "You are too far away to do that." ); return false; } } else { return false; } }
protected override void OnTarget( Mobile from, object o ) { if ( o is Item ) { if ( !m_CheckSkill || from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) ) { if ( o is IIdentifiable ) ((IIdentifiable)o).OnIdentify( from ); else if ( o is Spellbook ) from.SendAsciiMessage( "You guess it contains about {0} spells....", Math.Max( 0, ((Spellbook)o).SpellCount + Utility.RandomMinMax( -8, 8 ) ) ); ((Item)o).OnSingleClick( from ); if ( m_OK != null ) m_OK( from, o ); } else { from.SendLocalizedMessage( 500353 ); // You are not certain... } } else if ( o is Mobile ) { ((Mobile)o).OnSingleClick( from ); } else { from.SendLocalizedMessage( 500353 ); // You are not certain... } }
public static TimeSpan OnUse( Mobile from ) { from.SendAsciiMessage( "What do you wish to appraise and identify?" ); from.Target = new InternalTarget(); return TimeSpan.FromSeconds( 1.0 ); }
public static TimeSpan OnUse( Mobile m ) { m.Target = new Anatomy.InternalTarget(); m.SendAsciiMessage( "Whom shall I examine?" ); return TimeSpan.FromSeconds( 1.0 ); }
public override void OnDoubleClick( Mobile from ) { if ( !Movable ) return; from.SendAsciiMessage("Use that on gears to make an axle with gears."); from.Target = new InternalTarget( this ); }
public override void OnDoubleClick(Mobile from) { if (!Movable) return; from.SendAsciiMessage("Use that on a clock frame to make a clock."); from.Target = new InternalTarget(this); }
public override void OnDoubleClick(Mobile from) { if (!Movable) return; from.SendAsciiMessage("Use that on springs to make clock parts, or a hinge to make sextant parts."); from.Target = new InternalTarget(this); }
public override void OnDoubleClick( Mobile from ) { if ( CheckUse( from ) ) { from.SendAsciiMessage( "Select an area to incinerate." ); // from.Target = new InternalTarget( this ); } }