public void SummonUndead(Mobile target) { BaseCreature summon = null; switch (Utility.Random(11)) { default: case 0: summon = new Skeleton(); break; case 1: summon = new Zombie(); break; case 2: summon = new Wraith(); break; case 3: summon = new Spectre(); break; case 4: summon = new Ghoul(); break; case 5: summon = new Mummy(); break; case 6: summon = new Bogle(); break; case 7: summon = new BoneKnight(); break; case 8: summon = new SkeletalKnight(); break; case 9: summon = new Lich(); break; case 10: summon = new SkeletalMage(); break; } summon.Team = Team; summon.FightMode = FightMode.Closest; summon.MoveToWorld(target.Location, target.Map); Effects.SendLocationEffect(summon.Location, summon.Map, 0x3728, 10, 10, 0, 0); summon.Combatant = target; summon.PlaySound(summon.GetAttackSound()); }
public void Target(object obj) { if (CheckSequence()) { // Scriptiz : Amélioration en ciblant un Mobile, le mort l'attaque Point3D location; if (obj is LandTarget) location = ((LandTarget)obj).Location; else if(obj is Mobile) location = ((Mobile)obj).Location; else { Caster.SendMessage("Veuillez cibler une zone valide. (" + obj.GetType().ToString() + ")"); return; } SpellHelper.Turn(Caster, location); double getLich = Caster.Skills.Necromancy.Value / 10; double getSkeleton = Caster.Skills.Necromancy.Value / 5; int chance = Utility.Random(100); BaseCreature undead; if (chance <= getLich) undead = new Lich(); else if (chance <= getSkeleton) undead = new Skeleton(); else undead = new Zombie(); undead.ControlSlots = 1; undead.Fame = 0; undead.Karma = -1500; Caster.Karma -= 500; Effects.PlaySound(location, Caster.Map, 0x1FB); Effects.SendLocationParticles(EffectItem.Create(location, Caster.Map, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0); TimeSpan delay = TimeSpan.FromMinutes((Caster.Skills.Necromancy.Base + Caster.Skills.EvalInt.Base) * 3); BaseCreature.Summon(undead, false, Caster, location, 0x28, delay); // Si la cible est une mobile on l'attaque if (obj is Mobile) { undead.Attack((Mobile)obj); } } FinishSequence(); }
public void SpawnLichs(Mobile target) { Map map = this.Map; if (map == null) { return; } this.Say("I Am The Champion!!!"); int newLichs = Utility.RandomMinMax(2, 4); for (int i = 0; i < newLichs; ++i) { Lich lich = new Lich(); lich.Team = this.Team; lich.FightMode = FightMode.Closest; bool validLocation = false; Point3D loc = this.Location; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(3) - 1; int y = Y + Utility.Random(3) - 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, this.Z, 16, false, false)) { loc = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { loc = new Point3D(x, y, z); } } lich.MoveToWorld(loc, map); lich.Combatant = target; } }
protected override void OnTick() { if ( m_Item != null ) m_Item.IsDigging = false; if ( !m_From.Alive ) { m_From.SendMessage( "You cannot continue digging in this state." ); Stop(); } else { if ( Utility.Random( 100 ) < 35 ) { switch ( Utility.Random ( 10 ) ) { case 0: Skeleton skel = new Skeleton(); skel.Location = m_From.Location; skel.Map = m_From.Map; skel.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) skel.IsParagon = true; World.AddMobile( skel ); break; case 1: Ghoul ghoul = new Ghoul(); ghoul.Location = m_From.Location; ghoul.Map = m_From.Map; ghoul.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) ghoul.IsParagon = true; World.AddMobile( ghoul ); break; case 2: Lich lich = new Lich(); lich.Location = m_From.Location; lich.Map = m_From.Map; lich.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) lich.IsParagon = true; World.AddMobile( lich ); break; case 3: LichLord lichl = new LichLord(); lichl.Location = m_From.Location; lichl.Map = m_From.Map; lichl.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) lichl.IsParagon = true; World.AddMobile( lichl ); break; case 4: AncientLich alich = new AncientLich(); alich.Location = m_From.Location; alich.Map = m_From.Map; alich.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) alich.IsParagon = true; World.AddMobile( alich ); break; case 5: Zombie zom = new Zombie(); zom.Location = m_From.Location; zom.Map = m_From.Map; zom.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) zom.IsParagon = true; World.AddMobile( zom ); break; case 6: SkeletalKnight sk = new SkeletalKnight(); sk.Location = m_From.Location; sk.Map = m_From.Map; sk.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) sk.IsParagon = true; World.AddMobile( sk ); break; case 7: SkeletalMage sm = new SkeletalMage(); sm.Location = m_From.Location; sm.Map = m_From.Map; sm.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) sm.IsParagon = true; World.AddMobile( sm ); break; case 8: Spectre spec = new Spectre(); spec.Location = m_From.Location; spec.Map = m_From.Map; spec.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) spec.IsParagon = true; World.AddMobile( spec ); break; case 9: Shade shade = new Shade(); shade.Location = m_From.Location; shade.Map = m_From.Map; shade.Combatant = m_From; if ( Utility.Random( 100 ) < 50 ) shade.IsParagon = true; World.AddMobile( shade ); break; } m_From.SendMessage( "You have angered the spirits." ); } else if ( m_From.Skills[SkillName.Mining].Base > 10 ) { if ( Utility.Random( 120 ) >= (m_From.Skills[SkillName.Mining].Base) ) { m_From.SendMessage( "You fail to dig anything up." ); } else { m_From.SendMessage( "You dig up the hideous remains of the demon. Unfortunately your shovel breaks in the process." ); m_From.AddToBackpack( new PumpkinheadRemains() ); m_Item.Delete(); } } else if ( m_From.Skills[SkillName.Mining].Base <= 10 ) { if ( Utility.Random( 120 ) > 10 ) { m_From.SendMessage( "You fail to dig anything up." ); } else { m_From.SendMessage( "You dig up the hideous remains of the demon. Unfortunately your shovel breaks in the process." ); m_From.AddToBackpack( new PumpkinheadRemains() ); m_Item.Delete(); } } else { m_From.SendMessage( "You fail to dig anything up." ); } Stop(); } }
public void Spawn() { BaseCreature undead = null; switch (Utility.Random(12)) { case 0: case 1: case 2: undead = new SkeletalMage(); break; case 3: case 4: case 5: undead = new BoneKnight(); break; case 6: case 7: undead = new Mummy(); break; case 8: case 9: undead = new Lich(); break; case 10: undead = new RottingCorpse(); break; case 11: undead = new LichLord(); break; } if (undead != null) undead.MoveToWorld(this.Location, this.Map); }
protected override void OnTick() { if ( m_Item.Deleted ) return; Mobile spawn; switch ( Utility.Random( 8 ) ) { default: case 0: spawn = new PatchworkSkeleton(); break; case 1: spawn = new Zombie(); break; case 2: spawn = new Wraith(); break; case 3: spawn = new SkeletalMage(); break; case 4: spawn = new Mummy(); break; case 5: spawn = new BoneKnight(); break; case 6: spawn = new SkeletalKnight(); break; case 7: spawn = new Lich(); break; } spawn.MoveToWorld( m_Item.Location, m_Item.Map ); //Effects.PlaySound( p, map, 0x1FB ); //Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 ); m_Item.Delete(); }
public virtual void SpawnEnemies( RVS Handeling, String RegionName, int amount) { int numberOfEnemies = amount; int kindOfEnemy = 0; int randomEnemy = 0; Mobile Enemy = null; //Mobile Enemy = new Sheep(); int randomValueX = 0; int randomValueY = 0; int negative = 0; Point3D spawn; Map spawnmap; if ( RegionName == "Sheep" ) { spawn = SheepSpawnPoint; spawnmap = SheepSpawnMap; kindOfEnemy = 0; } else if ( RegionName == "Rabbit" ) { spawn = RabbitSpawnPoint; spawnmap = RabbitSpawnMap; kindOfEnemy = 1; } else { spawn = SheepSpawnPoint; spawnmap = SheepSpawnMap; kindOfEnemy = 0; } for ( int i = 0; i < numberOfEnemies; i++ ) { //kindOfEnemy = Utility.Random( 5 ); randomValueX = Utility.Random( 11 ); negative = Utility.Random( 2 ); if ( negative > 0 ) randomValueX *= -1; negative = Utility.Random( 2 ); randomValueY = Utility.Random( 11 ); if ( negative > 0 ) randomValueY *= -1; if ( Handeling.RvS ) { switch ( kindOfEnemy ) { case 0: { Enemy = new Sheep(); break; } case 1: { Enemy = new Rabbit(); break; } } } else if ( Handeling.Orcs ) { kindOfEnemy = 0; randomEnemy = Utility.Random( 100 ); if ( randomEnemy <= 20 ) kindOfEnemy++; if ( randomEnemy <= 10 ) kindOfEnemy++; if ( randomEnemy <= 5 ) kindOfEnemy++; switch ( kindOfEnemy ) { case 0: { Enemy = new Orc(); break; } case 1: { Enemy = new OrcishLord(); break; } case 2: { Enemy = new Ettin(); break; } case 3: { Enemy = new OrcishMage(); break; } } } else if ( Handeling.Lizardmen ) { kindOfEnemy = 0; randomEnemy = Utility.Random( 100 ); if ( randomEnemy <= 20 ) kindOfEnemy++; if ( randomEnemy <= 10 ) kindOfEnemy++; if ( randomEnemy <= 5 ) kindOfEnemy++; switch ( kindOfEnemy ) { case 0: { Enemy = new Snake(); break; } case 1: { Enemy = new GiantSerpent(); break; } case 2: { Enemy = new Lizardman(); break; } case 3: { Enemy = new Drake(); break; } } } else if ( Handeling.Ratmen ) { kindOfEnemy = 0; randomEnemy = Utility.Random( 100 ); if ( randomEnemy <= 20 ) kindOfEnemy++; if ( randomEnemy <= 15 ) kindOfEnemy++; if ( randomEnemy <= 10 ) kindOfEnemy++; if ( randomEnemy <= 5 ) kindOfEnemy++; switch ( kindOfEnemy ) { case 0: { Enemy = new Sewerrat(); break; } case 1: { Enemy = new GiantRat(); break; } case 2: { Enemy = new Ratman(); break; } case 3: { Enemy = new RatmanMage(); break; } case 4: { Enemy = new RatmanArcher(); break; } } } else if ( Handeling.Undead ) { kindOfEnemy = 0; randomEnemy = Utility.Random( 100 ); if ( randomEnemy <= 50 ) kindOfEnemy++; if ( randomEnemy <= 40 ) kindOfEnemy++; if ( randomEnemy <= 30 ) kindOfEnemy++; if ( randomEnemy <= 20 ) kindOfEnemy++; if ( randomEnemy <= 10 ) kindOfEnemy++; if ( randomEnemy <= 5 ) kindOfEnemy++; switch ( kindOfEnemy ) { case 0: { Enemy = new Skeleton(); break; } case 1: { Enemy = new Zombie(); break; } case 2: { Enemy = new RestlessSoul(); break; } case 3: { Enemy = new SkeletalMage(); break; } case 4: { Enemy = new SkeletalKnight(); break; } case 5: { Enemy = new Mummy(); break; } case 6: { Enemy = new Lich(); break; } } } Enemy.Map = spawnmap; Enemy.Location = new Point3D((spawn.X + randomValueX), (spawn.Y + randomValueY), (spawn.Z)); Enemies.Add(Enemy); } }
public void SpawnEvil( Mobile target ) { Map map = this.Map; if ( map == null ) return; int spawned = 0; foreach ( Mobile m in this.GetMobilesInRange( 10 ) ) { if ( m is Skeleton || m is Lich || m is LichLord ) ++spawned; } if ( spawned < 10 ) { int newSpawned = Utility.RandomMinMax( 1, 6 ); for ( int i = 0; i < newSpawned; ++i ) { BaseCreature spawn; switch ( Utility.Random( 5 ) ) { default: case 0: case 1: spawn = new BoneKnight(); break; case 2: case 3: spawn = new Lich(); break; case 4: spawn = new LichLord(); break; } spawn.Team = this.Team; spawn.Map = map; bool validLocation = false; for ( int j = 0; !validLocation && j < 10; ++j ) { int x = X + Utility.Random( 3 ) - 1; int y = Y + Utility.Random( 3 ) - 1; int z = map.GetAverageZ( x, y ); if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) ) spawn.Location = new Point3D( x, y, Z ); else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) ) spawn.Location = new Point3D( x, y, z ); } if ( !validLocation ) spawn.Location = this.Location; spawn.Combatant = target; } } }
protected override void OnTick() { if ( m_Item.Deleted ) return; Mobile spawn; switch ( Utility.Random( 12 ) ) { default: case 0: spawn = new Skeleton(); break; case 1: spawn = new Zombie(); break; case 2: spawn = new Wraith(); break; case 3: spawn = new Spectre(); break; case 4: spawn = new Ghoul(); break; case 5: spawn = new Mummy(); break; case 6: spawn = new Bogle(); break; case 7: spawn = new RottingCorpse(); break; case 8: spawn = new BoneKnight(); break; case 9: spawn = new SkeletalKnight(); break; case 10: spawn = new Lich(); break; case 11: spawn = new LichLord(); break; } spawn.MoveToWorld( m_Item.Location, m_Item.Map ); m_Item.Delete(); }
public void SpawnUndead( Mobile m ) { Map map = this.Map; Effects.SendLocationParticles( EffectItem.Create( this.Location, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 ); Mobile spawn; switch ( Utility.Random( 12 ) ) { default: case 0: spawn = new Skeleton(); break; case 1: spawn = new Zombie(); break; case 2: spawn = new Wraith(); break; case 3: spawn = new Spectre(); break; case 4: spawn = new Ghoul(); break; case 5: spawn = new Mummy(); break; case 6: spawn = new Bogle(); break; case 7: spawn = new RottingCorpse(); break; case 8: spawn = new BoneKnight(); break; case 9: spawn = new SkeletalKnight(); break; case 10: spawn = new Lich(); break; case 11: spawn = new LichLord(); break; } spawn.Hidden = true; spawn.MoveToWorld( m.Location, m.Map ); }
public void SpawnLich( Mobile target ) { Map map = this.Map; if ( map == null ) return; int newLich = 1; for ( int i = 0; i < newLich; ++i ) { Lich Lich = new Lich(); Lich.Team = this.Team; Lich.FightMode = FightMode.Closest; bool validLocation = false; Point3D loc = this.Location; for ( int j = 0; !validLocation && j < 10; ++j ) { int x = X + Utility.Random( 3 ) - 1; int y = Y + Utility.Random( 3 ) - 1; int z = map.GetAverageZ( x, y ); if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) ) loc = new Point3D( x, y, Z ); else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) ) loc = new Point3D( x, y, z ); } Lich.MoveToWorld( loc, map ); Lich.Combatant = target; } }
protected override void OnTick() { Item gem = Loot.RandomGem(); Item reg = Loot.RandomPossibleReagent(); Item equip; equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); if ( m_Item != null ) m_Item.IsDigging = false; if ( equip is BaseWeapon ) { BaseWeapon weapon = (BaseWeapon)equip; int attributeCount; int min, max; GetRandomAOSStats( out attributeCount, out min, out max ); BaseRunicTool.ApplyAttributesTo( weapon, attributeCount, min, max ); } else if ( equip is BaseArmor ) { BaseArmor armor = (BaseArmor)equip; int attributeCount; int min, max; GetRandomAOSStats( out attributeCount, out min, out max ); BaseRunicTool.ApplyAttributesTo( armor, attributeCount, min, max ); } else if ( equip is BaseJewel ) { int attributeCount; int min, max; GetRandomAOSStats( out attributeCount, out min, out max ); BaseRunicTool.ApplyAttributesTo( (BaseJewel)equip, attributeCount, min, max ); } if ( Utility.Random( 100 ) < 85 ) { switch ( Utility.Random ( 15 ) ) { case 0: Skeleton skel = new Skeleton(); skel.Location = m_From.Location; skel.Map = m_From.Map; skel.Combatant = m_From; World.AddMobile( skel ); break; case 1: Ghoul ghoul = new Ghoul(); ghoul.Location = m_From.Location; ghoul.Map = m_From.Map; ghoul.Combatant = m_From; World.AddMobile( ghoul ); break; case 2: Wraith wraith = new Wraith(); wraith.Location = m_From.Location; wraith.Map = m_From.Map; wraith.Combatant = m_From; World.AddMobile( wraith ); break; case 3: Lich lich = new Lich(); lich.Location = m_From.Location; lich.Map = m_From.Map; lich.Combatant = m_From; World.AddMobile( lich ); break; case 4: LichLord lichl = new LichLord(); lichl.Location = m_From.Location; lichl.Map = m_From.Map; lichl.Combatant = m_From; World.AddMobile( lichl ); break; case 5: AncientLich alich = new AncientLich(); alich.Location = m_From.Location; alich.Map = m_From.Map; alich.Combatant = m_From; World.AddMobile( alich ); break; case 6: Mummy mum = new Mummy(); mum.Location = m_From.Location; mum.Map = m_From.Map; mum.Combatant = m_From; World.AddMobile( mum ); break; case 7: Zombie zom = new Zombie(); zom.Location = m_From.Location; zom.Map = m_From.Map; zom.Combatant = m_From; World.AddMobile( zom ); break; case 8: SkeletalKnight sk = new SkeletalKnight(); sk.Location = m_From.Location; sk.Map = m_From.Map; sk.Combatant = m_From; World.AddMobile( sk ); break; case 9: SkeletalMage sm = new SkeletalMage(); sm.Location = m_From.Location; sm.Map = m_From.Map; sm.Combatant = m_From; World.AddMobile( sm ); break; case 10: BoneKnight bk = new BoneKnight(); bk.Location = m_From.Location; bk.Map = m_From.Map; bk.Combatant = m_From; World.AddMobile( bk ); break; case 11: BoneMagi bm = new BoneMagi(); bm.Location = m_From.Location; bm.Map = m_From.Map; bm.Combatant = m_From; World.AddMobile( bm ); break; case 12: Spectre spec = new Spectre(); spec.Location = m_From.Location; spec.Map = m_From.Map; spec.Combatant = m_From; World.AddMobile( spec ); break; case 13: Shade shade = new Shade(); shade.Location = m_From.Location; shade.Map = m_From.Map; shade.Combatant = m_From; World.AddMobile( shade ); break; } m_From.SendMessage( "The spirits have rose from the dead.." ); } else if ( m_From.Skills[SkillName.Mining].Base < 15.0 ) { if ( Utility.Random( 100 ) < 85 ) { m_From.SendMessage( "You fail to dig anything up." ); } else { switch ( Utility.Random ( 3 ) ) { case 0: m_From.AddToBackpack( gem ); m_From.SendMessage( "You dig up a gem." ); break; case 1: m_From.AddToBackpack( reg ); m_From.SendMessage( "You dig up a reagent." ); break; case 2: m_From.AddToBackpack( equip ); m_From.SendMessage( "You dig up some equipment." ); break; } } } else if ( m_From.Skills[SkillName.Mining].Base < 35.0 ) { if ( Utility.Random( 100 ) < 85 ) { m_From.SendMessage( "You fail to dig anything up." ); } else { gem.Amount = Utility.RandomMinMax( 2, 4 ); reg.Amount = Utility.RandomMinMax( 2, 4 ); switch ( Utility.Random ( 5 ) ) { case 0: m_From.AddToBackpack( gem ); m_From.SendMessage( "You dig up some gems." ); break; case 1: m_From.AddToBackpack( reg ); m_From.SendMessage( "You dig up some reagents." ); break; case 2: m_From.AddToBackpack( equip ); m_From.SendMessage( "You dig up some equipment." ); break; case 3: m_From.AddToBackpack( Loot.RandomScroll( 0, 20, SpellbookType.Regular ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 4: m_From.AddToBackpack( Loot.RandomScroll( 0, 5, SpellbookType.Necromancer ) ); m_From.SendMessage( "You dig up a scroll." ); break; } } } else if ( m_From.Skills[SkillName.Mining].Base < 50.0 ) { if ( Utility.Random( 100 ) < 85 ) { m_From.SendMessage( "You fail to dig anything up." ); } else { gem.Amount = Utility.RandomMinMax( 2, 10 ); reg.Amount = Utility.RandomMinMax( 2, 10 ); switch ( Utility.Random ( 6 ) ) { case 0: m_From.AddToBackpack( gem ); m_From.SendMessage( "You dig up some gems." ); break; case 1: m_From.AddToBackpack( reg ); m_From.SendMessage( "You dig up some reagents." ); break; case 2: m_From.AddToBackpack( equip ); m_From.SendMessage( "You dig up some equipment." ); break; case 3: m_From.AddToBackpack( Loot.RandomScroll( 0, 40, SpellbookType.Regular ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 4: m_From.AddToBackpack( Loot.RandomScroll( 0, 10, SpellbookType.Regular ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 5: m_From.AddToBackpack( new Bones() ); m_From.SendMessage( "You dig up a bones." ); break; } } } else if ( m_From.Skills[SkillName.Mining].Base < 75.0 ) { if ( Utility.Random( 100 ) < 85 ) { m_From.SendMessage( "You fail to dig anything up." ); } else { gem.Amount = Utility.RandomMinMax( 2, 20 ); reg.Amount = Utility.RandomMinMax( 2, 20 ); switch ( Utility.Random ( 7 ) ) { case 0: m_From.AddToBackpack( gem ); m_From.SendMessage( "You dig up some gems." ); break; case 1: m_From.AddToBackpack( reg ); m_From.SendMessage( "You dig up some reagents." ); break; case 2: m_From.AddToBackpack( equip ); m_From.SendMessage( "You dig up some equipment." ); break; case 3: m_From.AddToBackpack( Loot.RandomScroll( 0, 50, SpellbookType.Regular ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 4: m_From.AddToBackpack( Loot.RandomScroll( 0, 13, SpellbookType.Necromancer ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 5: m_From.AddToBackpack( new Bones() ); m_From.SendMessage( "You dig up a bones." ); break; } } } else if ( m_From.Skills[SkillName.Mining].Base < 90.0 ) { if ( Utility.Random( 100 ) < 85 ) { m_From.SendMessage( "You fail to dig anything up." ); } else { gem.Amount = Utility.RandomMinMax( 10, 30 ); reg.Amount = Utility.RandomMinMax( 10, 30 ); switch ( Utility.Random ( 8 ) ) { case 0: m_From.AddToBackpack( gem ); m_From.SendMessage( "You dig up some gems." ); break; case 1: m_From.AddToBackpack( reg ); m_From.SendMessage( "You dig up some reagents." ); break; case 2: m_From.AddToBackpack( equip ); m_From.SendMessage( "You dig up some equipment." ); break; case 3: m_From.AddToBackpack( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 4: m_From.AddToBackpack( Loot.RandomScroll( 0, 15, SpellbookType.Necromancer ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 5: m_From.AddToBackpack( new Bones() ); m_From.SendMessage( "You dig up a bones." ); break; } } } else if ( m_From.Skills[SkillName.Mining].Base < 150.0) { if ( Utility.Random( 500 ) < 5 ) { m_From.SendMessage( "You dig up and item of great value." ); switch ( Utility.Random ( 5 ) ) { case 0: m_From.AddToBackpack( new ArmoredRobe() ); break; case 1: m_From.AddToBackpack( new ButchersResolve() ); break; case 2: m_From.AddToBackpack( new FollowerOfTheOldLord() ); break; case 3: m_From.AddToBackpack( new SkirtOfTheAmazon() ); break; case 4: m_From.AddToBackpack( new HolyHammerOfExorcism() ); break; } } else { gem.Amount = Utility.RandomMinMax( 2, 40 ); reg.Amount = Utility.RandomMinMax( 2, 40 ); switch ( Utility.Random ( 8 ) ) { case 0: m_From.AddToBackpack( gem ); m_From.SendMessage( "You dig up some gems." ); break; case 1: m_From.AddToBackpack( reg ); m_From.SendMessage( "You dig up some reagents." ); break; case 2: m_From.AddToBackpack( equip ); m_From.SendMessage( "You dig up some equipment." ); break; case 3: m_From.AddToBackpack( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 4: m_From.AddToBackpack( Loot.RandomScroll( 0, 15, SpellbookType.Necromancer ) ); m_From.SendMessage( "You dig up a scroll." ); break; case 5: m_From.AddToBackpack( new Bones() ); m_From.SendMessage( "You dig up a bones." ); break; } } } else { m_From.SendMessage( "You fail to dig anything up." ); } Stop(); }
public void SummonUndead(Mobile target) { Point3D[] locs = new Point3D[4]; locs[0] = Location; for (int i = 1; i < 4; i++) { bool validLocation = false; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(4) - 1; int y = Y + Utility.Random(4) - 1; int z = this.Map.GetAverageZ(x, y); if (validLocation = this.Map.CanFit(x, y, this.Z, 16, false, false)) locs[i] = new Point3D(x, y, Z); else if (validLocation = this.Map.CanFit(x, y, z, 16, false, false)) locs[i] = new Point3D(x, y, z); } } bool movelich = false; for (int i = 0; i < 4; i++) { BaseCreature summon = null; if (!movelich && (Utility.Random(4) == 0 || i == 3)) { summon = this; BodyMod = Utility.RandomList(50, 56, 57, 3, 26, 148, 147, 153, 154, 24, 35, 36); HueMod = 0; movelich = true; } else { switch (Utility.Random(12)) { default: case 0: summon = new Skeleton(); break; case 1: summon = new Zombie(); break; case 2: summon = new Wraith(); break; case 3: summon = new Spectre(); break; case 4: summon = new Ghoul(); break; case 5: summon = new Mummy(); break; case 6: summon = new Bogle(); break; case 7: summon = new BoneKnight(); break; case 8: summon = new SkeletalKnight(); break; case 9: summon = new Lich(); break; case 10: summon = new Lizardman(); break; case 11: summon = new SkeletalMage(); break; } summon.Team = this.Team; summon.FightMode = FightMode.Closest; } summon.MoveToWorld(locs[i], Map); Effects.SendLocationEffect(summon.Location, summon.Map, 0x3728, 10, 10, 0, 0); summon.PlaySound(0x48F); summon.PlaySound(summon.GetAttackSound()); summon.Combatant = target; } }
protected virtual void FinishEffect( Point3D p, Map map, Mobile from ) { from.RevealingAction(); int spawncount = GetSpawnCount(); int z = p.Z; //Ghost ship Z, should be 10 lower than the spawn Z int gsZ = z - 30; //Set to -30 so it spawns under the sea and then emerges up //Spawn Z, needs to be 10 higher than ghost ship Z so they get on top of the boat int spawnZ = z - 20; //Create the ghost ship here GhostShip gs = new GhostShip(); //Add treasure MetalChest tc = new MetalChest {ItemID = 0xE7C, LiftOverride = true}; TreasureMapChest.Fill(tc, 5); //Now declare an area the same size as the ship, to look for items that might block Point2D start = new Point2D( p.X - 10, p.Y - 7 ); //Starting location of the area Point2D end = new Point2D(p.X + 10, p.Y + 7); //Ending location of the area Rectangle2D rect = new Rectangle2D( start, end ); //Declaring the entire area as a rectangle //Create a new list that will contain all items in the rectangle List<Item> list = new List<Item>(); IPooledEnumerable eable = map.GetItemsInBounds(rect); //Get all items in the rectangle foreach (Item item in eable) //Add all items in the rectangle to the list list.Add(item); eable.Free(); //While an item exists in the rectangle, move the spawnlocation of the boat/monsters while (list.Count > 0 ) { if (Utility.RandomDouble() < 0.5 ) p.X += 1; else p.X -= 1; if (Utility.RandomDouble() < 0.5) p.Y += 1; else p.Y -= 1; start = new Point2D(p.X - 10, p.Y - 7); end = new Point2D(p.X + 10, p.Y + 7); rect = new Rectangle2D(start, end); eable = map.GetItemsInBounds(rect); //Clear the list as we need to create a new one with the new location of the ship list.Clear(); foreach (Item item in eable) list.Add(item); //Add the items (if any) in the new spawnlocation to the list eable.Free(); } //No items blocking, move the ship to the world p.Z = gsZ; gs.MoveToWorld(p, map); //Move the treasure chest to the world p.Z = spawnZ + 2; p.X -= 9; tc.MoveToWorld(p, map); //Add the boat and all items inside the boat here gs.Itemlist.Add(gs); gs.Itemlist.Add(tc); //Add as many spawns as spawncount allows for (int i = 0; i < spawncount; ++i) { BaseCreature spawn; switch (Utility.Random(4)) { default: spawn = new LichLord(); break; case 1: spawn = new AncientLich(); break; case 2: spawn = new Lich(); break; case 3: spawn = new SkeletalCaptain(); break; } p.Z = spawnZ; Spawn(p, map, spawn); spawn.Combatant = from; //Add the spawn to the list "spawns", needed for the boat decay timer and emerge timer gs.Spawnlist.Add(spawn); } //Start the emerge timer, so the boat doesn't just appear instantly on top of the water new EmergeTimer(gs.Itemlist, gs.Spawnlist).Start(); Delete(); }
////25JUL2008 Lord_Greywolf fix for bad X *** END *** protected virtual void SpawnGenerate(Point2D p, Map map) { BaseCreature spawn; switch (Utility.Random(4)) { default: case 0: spawn = new Lich(); break; case 1: spawn = new Skeleton(); break; case 2: spawn = new Mongbat(); break; case 3: spawn = new Troll(); break; } Spawn(p, map, spawn); Delete(); }
public void SpawnEvil(Mobile target) { Map map = this.Map; if (map == null) { return; } int spawned = 0; foreach (Mobile m in this.GetMobilesInRange(10)) { if (m is Skeleton || m is Lich || m is LichLord) { ++spawned; } } if (spawned < 10) { int newSpawned = Utility.RandomMinMax(1, 6); for (int i = 0; i < newSpawned; ++i) { BaseCreature spawn; switch (Utility.Random(5)) { default: case 0: case 1: spawn = new BoneKnight(); break; case 2: case 3: spawn = new Lich(); break; case 4: spawn = new LichLord(); break; } spawn.Team = this.Team; spawn.Map = map; bool validLocation = false; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(3) - 1; int y = Y + Utility.Random(3) - 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, this.Z, 16, false, false)) { spawn.Location = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { spawn.Location = new Point3D(x, y, z); } } if (!validLocation) { spawn.Location = this.Location; } spawn.Combatant = target; } } }
public void SummonUndead(Mobile target) { Point3D[] locs = new Point3D[4]; locs[0] = Location; for (int i = 1; i < 4; i++) { bool validLocation = false; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(4) - 1; int y = Y + Utility.Random(4) - 1; int z = this.Map.GetAverageZ(x, y); if (validLocation = this.Map.CanFit(x, y, this.Z, 16, false, false)) { locs[i] = new Point3D(x, y, Z); } else if (validLocation = this.Map.CanFit(x, y, z, 16, false, false)) { locs[i] = new Point3D(x, y, z); } } } bool movelich = false; for (int i = 0; i < 4; i++) { BaseCreature summon = null; if (!movelich && (Utility.Random(4) == 0 || i == 3)) { summon = this; BodyMod = Utility.RandomList(50, 56, 57, 3, 26, 148, 147, 153, 154, 24, 35, 36); HueMod = 0; movelich = true; } else { switch (Utility.Random(12)) { default: case 0: summon = new Skeleton(); break; case 1: summon = new Zombie(); break; case 2: summon = new Wraith(); break; case 3: summon = new Spectre(); break; case 4: summon = new Ghoul(); break; case 5: summon = new Mummy(); break; case 6: summon = new Bogle(); break; case 7: summon = new BoneKnight(); break; case 8: summon = new SkeletalKnight(); break; case 9: summon = new Lich(); break; case 10: summon = new Lizardman(); break; case 11: summon = new SkeletalMage(); break; } summon.Team = this.Team; summon.FightMode = FightMode.Closest; } summon.MoveToWorld(locs[i], Map); Effects.SendLocationEffect(summon.Location, summon.Map, 0x3728, 10, 10, 0, 0); summon.PlaySound(0x48F); summon.PlaySound(summon.GetAttackSound()); summon.Combatant = target; } }
public void SpawnLichs( Mobile target ) { Map map = this.Map; if ( map == null ) { return; } this.Say( "I Am The Champion!!!" ); int newLichs = Utility.RandomMinMax( 2, 4 ); for ( int i = 0; i < newLichs; ++i ) { Lich lich = new Lich(); lich.Team = this.Team; lich.FightMode = FightMode.Closest; bool validLocation = false; Point3D loc = this.Location; for ( int j = 0; !validLocation && j < 10; ++j ) { int x = X + Utility.Random( 3 ) - 1; int y = Y + Utility.Random( 3 ) - 1; int z = map.GetAverageZ( x, y ); if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) ) { loc = new Point3D( x, y, Z ); } else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) ) { loc = new Point3D( x, y, z ); } } lich.MoveToWorld( loc, map ); lich.Combatant = target; } }