public static void BlessedXML(BaseCreature bc, Mobile player) { bc.Emote("*you see {0} looks ready to fight harder!*", bc.Name); bc.AddStatMod(new StatMod(StatType.Dex, "XmlDex", Utility.RandomMinMax(20, 60), TimeSpan.FromSeconds(25.0))); bc.AddStatMod(new StatMod(StatType.Str, "XmlStr", Utility.RandomMinMax(20, 60), TimeSpan.FromSeconds(25.0))); bc.AddStatMod(new StatMod(StatType.Int, "XmlInt", Utility.RandomMinMax(20, 60), TimeSpan.FromSeconds(25.0))); bc.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist); bc.PlaySound(0x1EA); bc.InvalidateProperties(); }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseCreature) { BaseCreature targ = (BaseCreature)targeted; if (targ.ControlMaster == from) { CommandLogging.WriteLine(from, "{0} {1} forcing speech on {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(targ)); targ.Emote(m_toEmote); } else { from.SendMessage("You do not own this pet."); } } }
public static void SuperHealXML(BaseCreature bc, Mobile player) { if (!bc.Alive) { bc.Resurrect(); } if (bc.Hits < bc.HitsMax) { bc.Hits = bc.HitsMax; } if (bc.Mana < bc.ManaMax) { bc.Mana = bc.ManaMax; } if (bc.Stam < bc.StamMax) { bc.Stam = bc.StamMax; } if (bc.Poison != null) { bc.Poison = null; } if (bc.Paralyzed == true) { bc.Paralyzed = false; } EvilOmenSpell.TryEndEffect(bc); StrangleSpell.RemoveCurse(bc); CorpseSkinSpell.RemoveCurse(bc); CurseSpell.RemoveEffect(bc); MortalStrike.EndWound(bc); BloodOathSpell.RemoveCurse(bc); MindRotSpell.ClearMindRotScalar(bc); bc.Loyalty = BaseCreature.MaxLoyalty; Effects.SendTargetEffect(bc, 0x3709, 32); Effects.SendTargetEffect(bc, 0x376A, 32); bc.PlaySound(0x208); bc.Emote("*you see {0} looks refreshed!*", bc.Name); }
public static void AreaAirBlastXML(BaseCreature mobile, Mobile player, Mobile master) { ArrayList list = new ArrayList(); foreach (Mobile m in mobile.GetMobilesInRange(10)) { if (m == mobile || !m.CanBeHarmful(m)) { continue; } if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team)) { list.Add(m); } else if (m.Player) { list.Add(m); } } mobile.Emote("*you see {0} shoots a distructive air attack!*", mobile.Name); mobile.Mana -= 25; mobile.Stam -= 15; foreach (Mobile m in list) { if (m == master) { return; } m.DoHarmful(m); m.FixedParticles(0x3728, 50, 50, 5052, EffectLayer.Waist); m.PlaySound(655); m.SendMessage("Your lose your breath as the air hits you!"); int toStrike = Utility.RandomMinMax(25, 35); m.Damage(toStrike, mobile); } }
public static void AreaIceBlastXML(BaseCreature mobile, Mobile player, Mobile master) { ArrayList list = new ArrayList(); foreach (Mobile m in mobile.GetMobilesInRange(10)) { if (m == mobile || !m.CanBeHarmful(m)) { continue; } if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team)) { list.Add(m); } else if (m.Player) { list.Add(m); } } mobile.Emote("*you see {0} shoots a distructive ice attack!*", mobile.Name); mobile.Mana -= 25; mobile.Stam -= 15; foreach (Mobile m in list) { if (m == master) { return; } m.DoHarmful(m); m.FixedParticles(0x1fb7, 50, 50, 5052, EffectLayer.Waist); m.PlaySound(279); m.PlaySound(280); m.SendMessage("Your skin numbs as the cold freezes you!"); m.Damage(((Utility.Random(25, 35)) - (m.ColdResistance / 2))); } }
protected override void OnTarget(Mobile from, object target) { if (target is BaseChampion) { from.SendMessage("You cannot extract DNA from a champion."); } else if (target is BaseVendor) { from.SendMessage("You cannot extract DNA from a vendor."); } else if (target is PlayerVendor) { from.SendMessage("You cannot extract DNA from a vendor."); } //else if ( target is DemonKnight || target is AbysmalHorror || target is DarknightCreeper || target is FleshRenderer || target is ShadowKnight || target is Impaler ) //{ // from.SendMessage( "You cannot extract DNA from a doom boss." ); //} else if (target is BaseCreature) { BaseCreature bc = (BaseCreature)target; if (!from.InRange(((Mobile)bc).Location, 1)) { from.SendMessage("You are to far away to do that."); } else if (bc.Blessed != false) { from.SendMessage("They cannot be harmed."); } else if (bc.BodyValue == 400 || bc.BodyValue == 401) { from.SendMessage("You cannot extract DNA from a human. "); } else if (bc.Controlled != true) { int qua = bc.Str + bc.HitsMax + bc.PhysicalResistance + bc.DamageMin + bc.DamageMax + bc.VirtualArmor; int chance = qua; if (chance <= 500) { chance = 499; } if (Utility.Random(chance) < 500) { DNAItem dna = new DNAItem(); dna.DNAName = bc.Name; dna.DNAStr = bc.Str; dna.DNAHits = bc.HitsMax; dna.DNAPhysicalResist = bc.PhysicalResistance; dna.DNADamageMin = bc.DamageMin; dna.DNADamageMax = bc.DamageMax; dna.DNAArmor = bc.VirtualArmor; dna.DNAType = DNAType.Prowess; dna.DNAAnatomy = bc.Skills[SkillName.Anatomy].Base; dna.DNAWrestling = bc.Skills[SkillName.Wrestling].Base; dna.DNATactics = bc.Skills[SkillName.Tactics].Base; if (qua <= 200) { dna.DNAQuality = DNAQuality.VeryLow; } else if (qua <= 350) { dna.DNAQuality = DNAQuality.Low; } else if (qua <= 450) { dna.DNAQuality = DNAQuality.BelowAverage; } else if (qua <= 600) { dna.DNAQuality = DNAQuality.Average; } else if (qua <= 900) { dna.DNAQuality = DNAQuality.AboveAverage; } else if (qua <= 2000) { dna.DNAQuality = DNAQuality.High; } else if (qua <= 4500 || qua >= 4500) { dna.DNAQuality = DNAQuality.VeryHigh; } from.AddToBackpack(dna); from.PlaySound(0x240); switch (Utility.Random(3)) { case 0: bc.Combatant = from; from.Combatant = bc; from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress."); bc.Emote("You have angered the creature"); break; case 1: from.SendMessage("You successfully sample the creatures dna."); break; case 2: from.SendMessage("You successfully sample the creatures dna."); break; } if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } } else { switch (Utility.Random(2)) { case 0: from.SendMessage("You fail to sample this creatures dna."); bc.Combatant = from; from.Combatant = bc; bc.Emote("You have angered the creature"); if (Utility.Random(100) < 35) { if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } from.PlaySound(Utility.RandomList(62, 63)); from.SendMessage("The vial has broken."); } break; case 1: from.SendMessage("You fail to sample this creatures dna."); bc.Combatant = from; from.Combatant = bc; bc.Emote("You have angered the creature"); if (Utility.Random(100) < 35) { if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } from.PlaySound(Utility.RandomList(62, 63)); from.SendMessage("The vial has broken."); } break; } } } else { from.SendMessage("You cannot sample dna from a tamed creature."); } } }
protected override void OnTarget(Mobile from, object target) { if (target is BaseChampion) { from.SendMessage("You cannot extract DNA from a champion."); } else if (target is BaseVendor) { from.SendMessage("You cannot extract DNA from a vendor."); } else if (target is PlayerVendor) { from.SendMessage("You cannot extract DNA from a vendor."); } //else if ( target is DemonKnight || target is AbysmalHorror || target is DarknightCreeper || target is FleshRenderer || target is ShadowKnight || target is Impaler ) //{ //from.SendMessage( "You cannot extract DNA from a doom boss." ); //} else if (target is BaseCreature) { BaseCreature bc = (BaseCreature)target; if (!from.InRange(((Mobile)bc).Location, 1)) { from.SendMessage("You are to far away to do that."); } else if (bc.Blessed != false) { from.SendMessage("They cannot be harmed."); } else if (bc.BodyValue == 400 || bc.BodyValue == 401) { from.SendMessage("You cannot extract DNA from a human. "); } else if (bc.Controlled != true) { DNAItem dna = new DNAItem(); dna.DNAName = bc.Name; dna.DNAType = DNAType.Mimic; dna.DNABodyValue = bc.BodyValue; dna.DNASoundID = bc.BaseSoundID; if (bc is BaseMount) { BaseMount bm = (BaseMount)bc; dna.MountID = bm.ItemID; } if (Utility.Random(100) < 15) { switch (Utility.Random(3)) { case 0: dna.DNABluntAttack = true; break; case 1: dna.DNAHealAttack = true; break; case 2: dna.DNAPoisonAttack = true; break; } } if (Utility.Random(100) < 15) { switch (Utility.Random(5)) { case 0: dna.DNATrialByFire = true; break; case 1: dna.DNAIceBlast = true; break; case 2: dna.DNACometAttack = true; break; case 3: dna.DNACallOfNature = true; break; case 4: dna.DNAAcidRain = true; break; } } from.AddToBackpack(dna); from.PlaySound(0x240); switch (Utility.Random(3)) { case 0: bc.Combatant = from; from.Combatant = bc; from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress."); bc.Emote("You have angered the creature"); break; case 1: bc.Combatant = from; from.Combatant = bc; from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress."); bc.Emote("You have angered the creature"); break; case 2: from.SendMessage("You successfully sample the creatures dna."); break; } if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } } else { switch (Utility.Random(2)) { case 0: from.SendMessage("You fail to sample this creatures dna."); bc.Combatant = from; from.Combatant = bc; bc.Emote("You have angered the creature"); if (Utility.Random(100) < 35) { if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } from.PlaySound(Utility.RandomList(62, 63)); from.SendMessage("The vial has broken."); } break; case 1: from.SendMessage("You fail to sample this creatures dna."); bc.Combatant = from; from.Combatant = bc; bc.Emote("You have angered the creature"); if (Utility.Random(100) < 35) { if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } from.PlaySound(Utility.RandomList(62, 63)); from.SendMessage("The vial has broken."); } break; } } } else { from.SendMessage("You cannot sample dna from a tamed creature."); } }
public static void LevelUp( BaseCreature player ) { player.NextLevel += ( player.Level + 1 ) * (5000 / player.XPScale); player.Level++; if( player.Level % 2 != 0 ) player.DamageMin++; else player.DamageMax++; double i = 0.5 * player.SkillScale; if (player is Serpent) { player.RawStr += player.StatScale; player.RawDex += player.StatScale; player.RawStam += player.StatScale; player.RawMana += player.StatScale; if (player.XPScale == 1) { player.RawInt += 1; player.RawHits += 1; } else { player.RawInt += (player.StatScale / 2); player.RawHits += (player.StatScale / 2); } } else if (player is BirdOfPrey) { if (player.StatScale == 1) { player.RawStr += 1; player.RawHits += 1; } else { player.RawStr += (player.StatScale / 2); player.RawHits += (player.StatScale / 2); } player.RawDex += (int)(player.StatScale * Utility.RandomMinMax(1,2)); player.RawInt += player.StatScale; player.RawStam += player.StatScale; player.RawMana += player.StatScale; } else if (player is Bear) { int statBonus = Utility.Random(player.StatScale); int armorBonus = Utility.Random(5); if (player.XPScale == 1) { player.RawStr += 1; player.RawDex += Utility.Random(2); } else { player.RawStr += (player.StatScale / 2); player.RawDex += ((player.StatScale - (statBonus + 1)) / 2); } player.RawInt += (player.StatScale - statBonus); player.RawHits += (player.StatScale + (statBonus + 1)); player.RawStam += (player.StatScale + statBonus); player.RawMana += (player.StatScale / 2); if (armorBonus == 0) player.BluntResistSeed += (player.StatScale - 1); else if (armorBonus == 1) player.SlashingResistSeed += (player.StatScale - 1); else if (armorBonus == 2) player.PiercingResistSeed += (player.StatScale - 1); else if (armorBonus == 3) { player.PoisonResistSeed += (player.StatScale - 1); player.EnergyResistSeed += (player.StatScale - 1); } else { if (player.Level % 2 != 0) player.DamageMin--; else player.DamageMax--; } } else if (player is Mercenary) { int statUpgrade = Utility.RandomMinMax(1, 4); switch (statUpgrade) { case 1: { player.RawStr += player.StatScale; player.RawDex += Utility.RandomMinMax(1, player.StatScale); player.RawInt += 1; player.RawHits += Utility.RandomMinMax(1, player.StatScale); player.RawStam += Utility.RandomMinMax(1, player.StatScale); break; } case 2: { player.RawStr += Utility.RandomMinMax(1, player.StatScale); player.RawDex += player.StatScale; player.RawInt += 1; player.RawHits += Utility.RandomMinMax(1, player.StatScale); player.RawStam += Utility.RandomMinMax(1, player.StatScale); break; } case 3: { player.RawStr += Utility.RandomMinMax(1, player.StatScale); player.RawDex += Utility.RandomMinMax(1, player.StatScale); player.RawInt += 1; player.RawHits += player.StatScale; player.RawStam += Utility.RandomMinMax(1, player.StatScale); break; } case 4: { player.RawStr += Utility.RandomMinMax(1, player.StatScale); player.RawDex += Utility.RandomMinMax(1, player.StatScale); player.RawInt += 1; player.RawHits += Utility.RandomMinMax(1, player.StatScale); player.RawStam += player.StatScale; break; } } if (player.ControlMaster != null) { switch (((PlayerMobile)player.ControlMaster).Nation) { case Nation.Alyrian: { if (Utility.RandomBool()) player.RawDex += Utility.Random(player.StatScale); else player.RawInt += Utility.Random(player.StatScale); break; } case Nation.Azhuran: { player.RawDex += Utility.Random(player.StatScale); break; } case Nation.Khemetar: { player.RawInt += Utility.Random(player.StatScale); break; } case Nation.Mhordul: { player.RawStr += Utility.Random(player.StatScale); break; } case Nation.Tyrean: { if (Utility.RandomBool()) player.RawStr += Utility.Random(player.StatScale); else player.RawStam += Utility.Random(player.StatScale); break; } case Nation.Vhalurian: { player.RawHits += Utility.Random(player.StatScale); break; } } } } else { player.RawStr += player.StatScale; player.RawDex += player.StatScale; player.RawInt += player.StatScale; player.RawHits += player.StatScale; player.RawStam += player.StatScale; player.RawMana += player.StatScale; } if( player is Dragon ) { if( player.Level > 19 && player.BodyValue == 61 ) { Gold newloot = new Gold( Utility.RandomMinMax( 1, 3 ) ); Container pack = player.Backpack; if( pack != null ) pack.DropItem( newloot ); player.BodyValue = 59; } if( player.Level > 38 && player.BodyValue == 59 ) { Gold newloot = new Gold( Utility.RandomMinMax( 3, 6 ) ); Container pack = player.Backpack; if( pack != null ) pack.DropItem( newloot ); player.BodyValue = 46; } } if( player is Mercenary && ((Mercenary)player).Lives < 8 ) ((Mercenary)player).Lives++; else if( player is BaseBreedableCreature ) { BaseBreedableCreature bbc = player as BaseBreedableCreature; if( player.Level % 5 == 0 && bbc.PetEvolution > 0 ) { bbc.RaiseRandomFeat(); bbc.PetEvolution--; } bbc.UpdateSpeeds(); if( ((BaseBreedableCreature)player).Lives < (8 + ((BaseBreedableCreature)player).ExtraLives) ) ((BaseBreedableCreature)player).Lives++; if (player is Serpent) { if (player.Level == 40) { if (player is GrassSnake) { ((GrassSnake)player).SetConstrict(true); player.SetDex(player.RawDex / 3); player.BodyValue = 89; player.Emote("*" + player.Name + " has grown more langurous but also more powerful!*"); player.PlaySound(0x05E); } else { player.BodyValue = 89; player.Emote("*" + player.Name + " is growing!*"); player.PlaySound(0x05E); } } if(player is Viper) ((Viper)player).incSerpentPoison(); else if(player is Copperhead) ((Copperhead)player).incSerpentPoison(); else if(player is Cobra) ((Cobra)player).incSerpentPoison(); else if(player is BlackMamba) ((BlackMamba)player).incSerpentPoison(); } if (player is WorkHorse) { List<Item> packItems = new List<Item>(); foreach (Item item in (player as WorkHorse).Backpack.Items) packItems.Add(item); StrongBackpack newPack = new StrongBackpack((player as WorkHorse).Backpack.MaxWeight + player.StatScale); newPack.MaxItems += Utility.Random(player.StatScale); foreach (Item item in packItems) newPack.AddItem(item); (player as WorkHorse).Backpack.Delete(); (player as WorkHorse).AddItem(newPack); } } else if( player.Controlled && player.Lives < 8 ) player.Lives++; AwardSkill( player, i ); if( player.Level < 50 ) CheckLevel( player ); }
protected override void OnTarget(Mobile from, object target) { if (target is BaseChampion) { from.SendMessage("You cannot extract DNA from a champion."); } else if (target is BaseVendor) { from.SendMessage("You cannot extract DNA from a vendor."); } else if (target is PlayerVendor) { from.SendMessage("You cannot extract DNA from a vendor."); } else if (target is DemonKnight || target is AbysmalHorror || target is DarknightCreeper || target is FleshRenderer || target is ShadowKnight || target is Impaler) { from.SendMessage("You cannot extract DNA from a doom boss."); } else if (target is BaseCreature) { BaseCreature bc = (BaseCreature)target; if (!from.InRange(((Mobile)bc).Location, 1)) { from.SendMessage("You are to far away to do that."); } else if (bc.Blessed != false) { from.SendMessage("They cannot be harmed."); //} //else if ( bc.BodyValue == 400 || bc.BodyValue == 401 ) //{ //from.SendMessage( "You cannot extract DNA from a human. " ); } else if (bc.Controlled != true) { int qua = bc.Int + bc.ManaMax + bc.EnergyResistance + bc.PoisonResistance; int chance = qua; if (chance <= 200) { chance = 199; } if (Utility.Random(chance) < 200) { DNAItem dna = new DNAItem(); dna.DNAName = bc.Name; dna.DNAInt = bc.Int; dna.DNAMana = bc.ManaMax; dna.DNAEnergyResist = bc.EnergyResistance; dna.DNAPoisonResist = bc.PoisonResistance; dna.DNAType = DNAType.Mental; dna.DNAMagery = bc.Skills[SkillName.Magery].Base; dna.DNAEvalInt = bc.Skills[SkillName.EvalInt].Base; dna.DNAMeditation = bc.Skills[SkillName.Meditation].Base; if (qua <= 100) { dna.DNAQuality = DNAQuality.VeryLow; } else if (qua <= 150) { dna.DNAQuality = DNAQuality.Low; } else if (qua <= 200) { dna.DNAQuality = DNAQuality.BelowAverage; } else if (qua <= 300) { dna.DNAQuality = DNAQuality.Average; } else if (qua <= 600) { dna.DNAQuality = DNAQuality.AboveAverage; } else if (qua <= 1500) { dna.DNAQuality = DNAQuality.High; } else if (qua <= 3500 || qua >= 3500) { dna.DNAQuality = DNAQuality.VeryHigh; } from.AddToBackpack(dna); from.PlaySound(0x240); switch (Utility.Random(3)) { case 0: bc.Combatant = from; from.Combatant = bc; from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress."); bc.Emote("You have angered the creature"); break; case 1: from.SendMessage("You successfully sample the creatures dna, but the tramua of the sample was to great for the creature."); bc.Kill(); if (bc.Corpse != null) { bc.Corpse.Delete(); } break; case 2: from.SendMessage("You successfully sample the creatures dna."); break; } if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } } else { switch (Utility.Random(2)) { case 0: from.SendMessage("You fail to sample this creatures dna."); bc.Combatant = from; from.Combatant = bc; bc.Emote("You have angered the creature"); if (Utility.Random(100) < 35) { if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } from.PlaySound(Utility.RandomList(62, 63)); from.SendMessage("The vial has broken."); } break; case 1: from.SendMessage("You fail to sample this creatures dna."); from.SendMessage("The creature has died due to the tramua from the dna sample."); bc.Kill(); if (bc.Corpse != null) { bc.Corpse.Delete(); } if (Utility.Random(100) < 35) { if (m_Vial.Amount >= 1) { m_Vial.Amount -= 1; if (m_Vial.Amount == 0) { m_Vial.Delete(); } } from.PlaySound(Utility.RandomList(62, 63)); from.SendMessage("The vial has broken."); } break; } } } else { from.SendMessage("You cannot sample dna from a tamed creature."); } } }