public override void OnDoubleClick(Mobile from) { ConfiguredPetXML cp = new ConfiguredPetXML(); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; if (IsChildOf(pm.Backpack)) { if (xmlplayer.Levell >= c.EndMaxLvl) /* Max Level per System */ { pm.SendMessage("You have reached the max level, this doesn't work for you!"); return; } else { xmlplayer.kxp += m_SCV; } pm.SendMessage("You have been awarded {0} EXP points", m_SCV); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(pm, new Configured()); } this.Delete(); } else { pm.SendMessage("This must be in your pack!"); } }
public static void PetSoundsTalk(BaseCreature mobile) { ConfiguredPetXML cpp = new ConfiguredPetXML(); double chance = Utility.RandomDouble(); if (chance < cpp.PetSpeakChance) // { PetSpeakRandom(petspeak, mobile); // mobile.PlaySound( 0x420 ); // coughing } }
public override void OnTrigger(object activator, Mobile m) { ConfiguredPetXML cp = new ConfiguredPetXML(); if (AttachedTo is BaseCreature) { Point3D loc = new Point3D(0, 0, 0); Map map; if (PetSpeak) { if (cp.PetSpeak == false) { return; } PetSoundsTalk(((BaseCreature)this.AttachedTo)); } } }
public override void OnMovement(MovementEventArgs e) { base.OnMovement(e); ConfiguredPetXML cpd = new ConfiguredPetXML(); if (cpd.LoseExpLevelOnDeath == true) { if (((BaseCreature)this.AttachedTo).Hits == 0 && PetDeathToggle == false) { LevelHandlerPet.PetOnDeath(((BaseCreature)this.AttachedTo)); this.PetDeathToggle = true; } else { if (((BaseCreature)this.AttachedTo).Hits > 0) { this.PetDeathToggle = false; } } } }
public override void OnAttach() { base.OnAttach(); if (AttachedTo is BaseCreature) { XMLPetAttacksBonus xmlpetbonus = (XMLPetAttacksBonus)XmlAttach.FindAttachment((((BaseCreature)this.AttachedTo)), typeof(XMLPetAttacksBonus)); ConfiguredPetXML cp = new ConfiguredPetXML(); if (this.m_Levell == 0) { m_Levell = 1; m_MaxLevel = cp.StartMaxLvl; m_ToLevell = 100; } if (xmlpetbonus != null) { if (cp.PetAttackBonus == false) { xmlpetbonus.Delete(); } return; } else { if (cp.PetAttackBonus == true) { XmlAttach.AttachTo(((BaseCreature)this.AttachedTo), new XMLPetAttacksBonus()); } else { return; } } } else { Delete(); } }
public override void OnAttach() { base.OnAttach(); ConfiguredPetXML cp = new ConfiguredPetXML(); if(AttachedTo is PlayerMobile) { PlayerMobile master = (PlayerMobile)((PlayerMobile)this.AttachedTo); List<Mobile> pets = master.AllFollowers; if (pets.Count > 0) { for (int i = 0; i < pets.Count; ++i) { Mobile pet = (Mobile)pets[i]; if (cp.EnabledLevelPets == true) GetAttPetSet(pet, ((PlayerMobile)this.AttachedTo)); } } } else Delete(); }
public override void OnKill(Mobile killed, Mobile killer) { ConfiguredPetXML cp = new ConfiguredPetXML(); Configured cc = new Configured(); if (cc.ExpGainFromKill == true) { LevelHandler.Set(killer, killed); } if (killer is PlayerMobile) { PlayerMobile master = (PlayerMobile)killer; List <Mobile> pets = master.AllFollowers; if (pets.Count > 0) { for (int i = 0; i < pets.Count; ++i) { Mobile pet = (Mobile)pets[i]; if (pet is IMount && ((IMount)pet).Rider != null) { if (cp.MountedPetsGainEXP == false) { return; } } if (cp.EnabledLevelPets == true) { LevelHandlerPet.Set(pet, killed); } } } } }
public PetLevelGump(Mobile from, BaseCreature target) : base(40, 40) { m_Pet = target; ConfiguredPetXML cp = new ConfiguredPetXML(); m_Petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(m_Pet, typeof(XMLPetLevelAtt)); m_PetAttack = (XMLPetAttacksBonus)XmlAttach.FindAttachment(m_Pet, typeof(XMLPetAttacksBonus)); int hue = 1149; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddBackground(50, 35, 540, 382, 9270); int totalBaseStats; //custom information AddLabel(100, 69, 1153, "You can go anywhere you want in this world with a single blade."); AddLabel(262, 56, TitleHue, @" Pet Level Window"); AddLabel(112, 93, TitleHue, @"Boosted Skills"); AddLabel(220, 93, TitleHue, @"Required Level"); AddImage(0, 4, 10440); AddImage(554, 4, 10441); totalBaseStats = m_Pet.RawStr + m_Pet.RawInt + m_Pet.RawDex; AddLabel(300, 380, LabelHue2, @"Stat Total: "); AddLabel(370, 380, LabelHue, totalBaseStats.ToString()); //22 int totalSkill = m_Pet.SkillsTotal; totalSkill = totalSkill / 10; AddLabel(75, 336, LabelHue2, @"Current Level:"); AddLabel(164, 336, LabelHue, m_Petxml.Levell.ToString()); AddLabel(75, 358, LabelHue2, @"Experience:"); AddLabel(144, 358, LabelHue, m_Petxml.Expp.ToString()); AddLabel(75, 380, LabelHue2, @"Exp. to next level:"); AddLabel(191, 380, LabelHue, m_Petxml.ToLevell.ToString()); //stats AddLabel(394, 93, TitleHue, @"Stats"); AddButton(300, 116, 4005, 4007, GetButtonID(1, 2), GumpButtonType.Reply, 0); AddLabel(337, 117, LabelHue2, @"Strength:"); AddLabel(407, 117, LabelHue, m_Pet.RawStr.ToString()); AddButton(300, 138, 4005, 4007, GetButtonID(1, 3), GumpButtonType.Reply, 0); AddLabel(337, 139, LabelHue2, @"Intelligence:"); AddLabel(407, 139, LabelHue, m_Pet.RawInt.ToString()); AddButton(300, 160, 4005, 4007, GetButtonID(1, 4), GumpButtonType.Reply, 0); AddLabel(337, 161, LabelHue2, @"Dexterity:"); AddLabel(407, 161, LabelHue, m_Pet.RawDex.ToString()); AddLabel(300, 183, LabelHue2, @"Available stat points: "); AddLabel(435, 183, LabelHue, m_Petxml.StatPoints.ToString()); /// AddLabel(300, 205, 155, @"Hit Points:"); AddLabel(435, 205, hue, @"" + m_Pet.Hits); AddLabel(465, 205, hue, @"/ " + m_Pet.HitsMax); AddLabel(300, 227, 155, @"Mana:"); AddLabel(435, 227, hue, @"" + m_Pet.Mana); AddLabel(465, 227, hue, @"/ " + m_Pet.ManaMax); AddLabel(300, 249, 155, @"Stamina:"); AddLabel(435, 249, hue, @"" + m_Pet.Stam); AddLabel(465, 249, hue, @"/ " + m_Pet.StamMax); if (m_PetAttack != null) { if (cp.TelePortToTarget) { AddLabel(112, 117, LabelHue2, @"Teleport To Target"); AddLabel(230, 117, hue, @": " + cp.TelePortToTargetReq); if (m_Petxml.Levell < cp.TelePortToTargetReq) { this.AddImage(75, 116, 5231); } else { if (m_PetAttack.m_TeleToTargetSwitch == true) { AddButton(75, 116, 4006, 4005, GetButtonID(1, 5), GumpButtonType.Reply, 0); } if (m_PetAttack.m_TeleToTargetSwitch == false) { AddButton(75, 116, 4005, 4006, GetButtonID(1, 5), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 117, LabelHue2, @"Disabled by Admin"); } if (cp.MassProvokeToAtt) { AddLabel(112, 139, LabelHue2, @"Mass Provoke"); AddLabel(230, 139, hue, @": " + cp.MassProvokeToAttReq); if (m_Petxml.Levell < cp.MassProvokeToAttReq) { this.AddImage(75, 138, 5231); m_PetAttack.m_MassProvokeSwitch = false; } else { if (m_PetAttack.m_MassProvokeSwitch == true) { AddButton(75, 138, 4006, 4005, GetButtonID(1, 6), GumpButtonType.Reply, 0); } if (m_PetAttack.m_MassProvokeSwitch == false) { AddButton(75, 138, 4005, 4006, GetButtonID(1, 6), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 139, LabelHue2, @"Disabled by Admin"); } if (cp.MassPeaceArea) { AddLabel(112, 161, LabelHue2, @"Mass Peace Area"); AddLabel(230, 161, hue, @": " + cp.MassPeaceReq); if (m_Petxml.Levell < cp.MassPeaceReq) { this.AddImage(75, 160, 5231); m_PetAttack.m_MassPeace = false; } else { if (m_PetAttack.m_MassPeace == true) { AddButton(75, 160, 4006, 4005, GetButtonID(1, 7), GumpButtonType.Reply, 0); } if (m_PetAttack.m_MassPeace == false) { AddButton(75, 160, 4005, 4006, GetButtonID(1, 7), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 161, LabelHue2, @"Disabled by Admin"); } if (cp.BlessedPower) { AddLabel(112, 183, LabelHue2, @"Blessed Power"); AddLabel(230, 183, hue, @": " + cp.BlessedPowerReq); if (m_Petxml.Levell < cp.BlessedPowerReq) { this.AddImage(75, 182, 5231); m_PetAttack.m_BlessedPower = false; } else { if (m_PetAttack.m_BlessedPower == true) { AddButton(75, 182, 4006, 4005, GetButtonID(1, 8), GumpButtonType.Reply, 0); } if (m_PetAttack.m_BlessedPower == false) { AddButton(75, 182, 4005, 4006, GetButtonID(1, 8), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 183, LabelHue2, @"Disabled by Admin"); } if (cp.AreaFireBlast) { AddLabel(112, 205, LabelHue2, @"Area Fire Blast"); AddLabel(230, 205, hue, @": " + cp.AreaFireBlastReq); if (m_Petxml.Levell < cp.AreaFireBlastReq) { this.AddImage(75, 204, 5231); m_PetAttack.m_AreaFireBlast = false; } else { if (m_PetAttack.m_AreaFireBlast == true) { AddButton(75, 204, 4006, 4005, GetButtonID(1, 9), GumpButtonType.Reply, 0); } if (m_PetAttack.m_AreaFireBlast == false) { AddButton(75, 204, 4005, 4006, GetButtonID(1, 9), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 205, LabelHue2, @"Disabled by Admin"); } if (cp.AreaIceBlast) { AddLabel(112, 227, LabelHue2, @"Area Ice Blast"); AddLabel(230, 227, hue, @": " + cp.AreaIceBlastReq); if (m_Petxml.Levell < cp.AreaIceBlastReq) { this.AddImage(75, 226, 5231); m_PetAttack.m_AreaIceBlast = false; } else { if (m_PetAttack.m_AreaIceBlast == true) { AddButton(75, 226, 4006, 4005, GetButtonID(1, 10), GumpButtonType.Reply, 0); } if (m_PetAttack.m_AreaIceBlast == false) { AddButton(75, 226, 4005, 4006, GetButtonID(1, 10), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 227, LabelHue2, @"Disabled by Admin"); } if (cp.AreaAirBlast) { AddLabel(112, 249, LabelHue2, @"Area Air Blast"); AddLabel(230, 249, hue, @": " + cp.AreaAirBlastReq); if (m_Petxml.Levell < cp.AreaAirBlastReq) { this.AddImage(75, 248, 5231); m_PetAttack.m_AreaAirBlast = false; } else { if (m_PetAttack.m_AreaAirBlast == true) { AddButton(75, 248, 4006, 4005, GetButtonID(1, 11), GumpButtonType.Reply, 0); } if (m_PetAttack.m_AreaAirBlast == false) { AddButton(75, 248, 4005, 4006, GetButtonID(1, 11), GumpButtonType.Reply, 0); } } } else { AddLabel(112, 249, LabelHue2, @"Disabled by Admin"); } if (cp.SuperHeal) { if (m_Petxml.Levell < cp.SuperHealReq) { AddLabel(75, 271, LabelHue2, @"Disabled :Super Healing"); } else { AddLabel(75, 271, LabelHue2, @"Enabled :Super Healing"); } AddLabel(230, 271, hue, @": " + cp.SuperHealReq); } else { AddLabel(112, 271, LabelHue2, @"Disabled by Admin"); } if (cp.AuraStatBoost) { if (m_Petxml.Levell < cp.AuraStatBoostReq) { AddLabel(75, 293, LabelHue2, @"Disabled :Aura Stat Boost"); } else { AddLabel(75, 293, LabelHue2, @"Enabled :Aura Stat Boost"); } AddLabel(230, 293, hue, @": " + cp.AuraStatBoostReq); } else { AddLabel(112, 293, LabelHue2, @"Disabled by Admin"); } } else { AddLabel(112, 117, LabelHue2, @"Pet Bonus System Disabled."); } if (cp.EnableLvLMountChkonPetAtt) { if (m_Pet is Beetle) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Beetle); } if (m_Pet is DesertOstard) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.DesertOstard); } if (m_Pet is FireSteed) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.FireSteed); } if (m_Pet is ForestOstard) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.ForestOstard); } if (m_Pet is FrenziedOstard) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.FrenziedOstard); } if (m_Pet is HellSteed) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.HellSteed); } if (m_Pet is Hiryu) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Hiryu); } if (m_Pet is Horse) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Horse); } if (m_Pet is Kirin) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Kirin); } if (m_Pet is LesserHiryu) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.LesserHiryu); } if (m_Pet is Nightmare) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Nightmare); } if (m_Pet is RidableLlama) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.RidableLlama); } if (m_Pet is Ridgeback) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Ridgeback); } if (m_Pet is SavageRidgeback) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.SavageRidgeback); } if (m_Pet is ScaledSwampDragon) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.ScaledSwampDragon); } if (m_Pet is SeaHorse) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.SeaHorse); } if (m_Pet is SilverSteed) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.SilverSteed); } if (m_Pet is SkeletalMount) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.SkeletalMount); } if (m_Pet is SwampDragon) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.SwampDragon); } if (m_Pet is Unicorn) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Unicorn); } if (m_Pet is Reptalon) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Reptalon); } if (m_Pet is WildTiger) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.WildTiger); } if (m_Pet is Windrunner) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Windrunner); } if (m_Pet is Lasher) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Lasher); } if (m_Pet is Eowmu) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.Eowmu); } if (m_Pet is DreadWarhorse) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.DreadWarhorse); } if (m_Pet is CuSidhe) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.CuSidhe); } if (m_Pet is CuSidhe) { AddLabel(75, 315, LabelHue2, @"Level Req to Mount Pet"); AddLabel(230, 315, hue, @": " + cp.CuSidhe); } } }
// disable the default use of the target public override bool BlockDefaultOnUse(Mobile from, object target) { ConfiguredPetXML c = new ConfiguredPetXML(); if (c.EnableLvLMountChkonPetAtt == false) { return(false); } var mount2 = ((BaseCreature)this.AttachedTo); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); if (xmlplayer == null) { return(false); } if (mount2 is BaseMount) { BaseMount mount = (BaseMount)mount2; if (mount is Beetle) { if (xmlplayer.Levell >= c.Beetle) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Beetle); return(BlockDefaultUse); } } else if (mount is DesertOstard) { if (xmlplayer.Levell >= c.DesertOstard) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.DesertOstard); return(BlockDefaultUse); } } else if (mount is FireSteed) { if (xmlplayer.Levell >= c.FireSteed) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.FireSteed); return(BlockDefaultUse); } } else if (mount is ForestOstard) { if (xmlplayer.Levell >= c.ForestOstard) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.ForestOstard); return(BlockDefaultUse); } } else if (mount is FrenziedOstard) { if (xmlplayer.Levell >= c.FrenziedOstard) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.FrenziedOstard); return(BlockDefaultUse); } } else if (mount is HellSteed) { if (xmlplayer.Levell >= c.HellSteed) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.HellSteed); return(BlockDefaultUse); } } else if (mount is Hiryu) { if (xmlplayer.Levell >= c.Hiryu) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Hiryu); return(BlockDefaultUse); } } else if (mount is Horse) { if (xmlplayer.Levell >= c.Horse) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Horse); return(BlockDefaultUse); } } else if (mount is Kirin) { if (xmlplayer.Levell >= c.Kirin) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Kirin); return(BlockDefaultUse); } } else if (mount is LesserHiryu) { if (xmlplayer.Levell >= c.LesserHiryu) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.LesserHiryu); return(BlockDefaultUse); } } else if (mount is Nightmare) { if (xmlplayer.Levell >= c.Nightmare) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Nightmare); return(BlockDefaultUse); } } else if (mount is RidableLlama) { if (xmlplayer.Levell >= c.RidableLlama) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.RidableLlama); return(BlockDefaultUse); } } else if (mount is Ridgeback) { if (xmlplayer.Levell >= c.Ridgeback) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Ridgeback); return(BlockDefaultUse); } } else if (mount is SavageRidgeback) { if (xmlplayer.Levell >= c.SavageRidgeback) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.SavageRidgeback); return(BlockDefaultUse); } } else if (mount is ScaledSwampDragon) { if (xmlplayer.Levell >= c.ScaledSwampDragon) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.ScaledSwampDragon); return(BlockDefaultUse); } } else if (mount is SeaHorse) { if (xmlplayer.Levell >= c.SeaHorse) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.SeaHorse); return(BlockDefaultUse); } } else if (mount is SilverSteed) { if (xmlplayer.Levell >= c.SilverSteed) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.SilverSteed); return(BlockDefaultUse); } } else if (mount is SkeletalMount) { if (xmlplayer.Levell >= c.SkeletalMount) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.SkeletalMount); return(BlockDefaultUse); } } else if (mount is SwampDragon) { if (xmlplayer.Levell >= c.SwampDragon) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.SwampDragon); return(BlockDefaultUse); } } else if (mount is Unicorn) { if (xmlplayer.Levell >= c.Unicorn) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Unicorn); return(BlockDefaultUse); } } else if (mount is Reptalon) { if (xmlplayer.Levell >= c.Reptalon) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Reptalon); return(BlockDefaultUse); } } else if (mount is WildTiger) { if (xmlplayer.Levell >= c.WildTiger) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.WildTiger); return(BlockDefaultUse); } } else if (mount is Windrunner) { if (xmlplayer.Levell >= c.Windrunner) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Windrunner); return(BlockDefaultUse); } } else if (mount is Lasher) { if (xmlplayer.Levell >= c.Lasher) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Lasher); return(BlockDefaultUse); } } else if (mount is Eowmu) { if (xmlplayer.Levell >= c.Eowmu) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.Eowmu); return(BlockDefaultUse); } } else if (mount is DreadWarhorse) { if (xmlplayer.Levell >= c.DreadWarhorse) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.DreadWarhorse); return(BlockDefaultUse); } } else if (mount is CuSidhe) { if (xmlplayer.Levell >= c.CuSidhe) { from.SendMessage("Your level allows you to ride {0}.", mount.Name); return(false); } else { from.SendMessage("You must be Level {0} to ride me!", c.CuSidhe); return(BlockDefaultUse); } } else { /* If mount isn't on the list and has an attachment it will hit this return * statement. Add it to this list and also add an entry to configuration file. */ return(false); } } if (mount2 is BaseCreature) { return(false); } from.SendMessage("You are not at the right Level to ride me!"); return(BlockDefaultUse); //Fail catch for Creatures on this list but have the attachment }
public override void OnMovement(MovementEventArgs e) { base.OnMovement(e); ConfiguredPetXML cp = new ConfiguredPetXML(); XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(((BaseCreature)this.AttachedTo), typeof(XMLPetLevelAtt)); Mobile master = ((BaseCreature)this.AttachedTo).ControlMaster; XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(master, typeof(XMLPlayerLevelAtt)); if (e.Mobile == null) { return; } if (petxml == null) { return; } if (AuraStatBoost == true) { if (cp.AuraStatBoost == false) { return; } if (petxml.Levell < cp.AuraStatBoostReq) { return; } if (xmlplayer == null) { return; } BonusStatAtt10 aurastatboost10 = (BonusStatAtt10)XmlAttach.FindAttachment(master, typeof(BonusStatAtt10)); BonusStatAtt20 aurastatboost20 = (BonusStatAtt20)XmlAttach.FindAttachment(master, typeof(BonusStatAtt20)); BonusStatAtt30 aurastatboost30 = (BonusStatAtt30)XmlAttach.FindAttachment(master, typeof(BonusStatAtt30)); BonusStatAtt40 aurastatboost40 = (BonusStatAtt40)XmlAttach.FindAttachment(master, typeof(BonusStatAtt40)); BonusStatAtt50 aurastatboost50 = (BonusStatAtt50)XmlAttach.FindAttachment(master, typeof(BonusStatAtt50)); BonusStatAtt60 aurastatboost60 = (BonusStatAtt60)XmlAttach.FindAttachment(master, typeof(BonusStatAtt60)); BonusStatAtt70 aurastatboost70 = (BonusStatAtt70)XmlAttach.FindAttachment(master, typeof(BonusStatAtt70)); BonusStatAtt80 aurastatboost80 = (BonusStatAtt80)XmlAttach.FindAttachment(master, typeof(BonusStatAtt80)); BonusStatAtt90 aurastatboost90 = (BonusStatAtt90)XmlAttach.FindAttachment(master, typeof(BonusStatAtt90)); BonusStatAtt100 aurastatboost100 = (BonusStatAtt100)XmlAttach.FindAttachment(master, typeof(BonusStatAtt100)); BonusStatAtt140 aurastatboost140 = (BonusStatAtt140)XmlAttach.FindAttachment(master, typeof(BonusStatAtt140)); BonusStatAtt160 aurastatboost160 = (BonusStatAtt160)XmlAttach.FindAttachment(master, typeof(BonusStatAtt160)); BonusStatAtt180 aurastatboost180 = (BonusStatAtt180)XmlAttach.FindAttachment(master, typeof(BonusStatAtt180)); BonusStatAtt200 aurastatboost200 = (BonusStatAtt200)XmlAttach.FindAttachment(master, typeof(BonusStatAtt200)); BonusStatAtt201 aurastatboost201 = (BonusStatAtt201)XmlAttach.FindAttachment(master, typeof(BonusStatAtt201)); if (xmlplayer.Levell <= 10 && aurastatboost10 == null) { XmlAttach.AttachTo(master, new BonusStatAtt10()); } else if (xmlplayer.Levell > 10 && xmlplayer.Levell <= 20 && aurastatboost20 == null) { XmlAttach.AttachTo(master, new BonusStatAtt20()); } else if (xmlplayer.Levell > 20 && xmlplayer.Levell <= 30 && aurastatboost30 == null) { XmlAttach.AttachTo(master, new BonusStatAtt30()); } else if (xmlplayer.Levell > 30 && xmlplayer.Levell <= 40 && aurastatboost40 == null) { XmlAttach.AttachTo(master, new BonusStatAtt40()); } else if (xmlplayer.Levell > 40 && xmlplayer.Levell <= 50 && aurastatboost50 == null) { XmlAttach.AttachTo(master, new BonusStatAtt50()); } else if (xmlplayer.Levell > 50 && xmlplayer.Levell <= 60 && aurastatboost60 == null) { XmlAttach.AttachTo(master, new BonusStatAtt60()); } else if (xmlplayer.Levell > 60 && xmlplayer.Levell <= 70 && aurastatboost70 == null) { XmlAttach.AttachTo(master, new BonusStatAtt70()); } else if (xmlplayer.Levell > 70 && xmlplayer.Levell <= 80 && aurastatboost80 == null) { XmlAttach.AttachTo(master, new BonusStatAtt80()); } else if (xmlplayer.Levell > 80 && xmlplayer.Levell <= 90 && aurastatboost90 == null) { XmlAttach.AttachTo(master, new BonusStatAtt90()); } else if (xmlplayer.Levell > 90 && xmlplayer.Levell <= 100 && aurastatboost100 == null) { XmlAttach.AttachTo(master, new BonusStatAtt100()); } else if (xmlplayer.Levell > 100 && xmlplayer.Levell <= 140 && aurastatboost140 == null) { XmlAttach.AttachTo(master, new BonusStatAtt140()); } else if (xmlplayer.Levell > 140 && xmlplayer.Levell <= 160 && aurastatboost160 == null) { XmlAttach.AttachTo(master, new BonusStatAtt160()); } else if (xmlplayer.Levell > 160 && xmlplayer.Levell <= 180 && aurastatboost180 == null) { XmlAttach.AttachTo(master, new BonusStatAtt180()); } else if (xmlplayer.Levell > 180 && xmlplayer.Levell <= 200 && aurastatboost200 == null) { XmlAttach.AttachTo(master, new BonusStatAtt200()); } else if (xmlplayer.Levell > 200 && aurastatboost201 == null) { XmlAttach.AttachTo(master, new BonusStatAtt201()); } } switch (Utility.RandomMinMax(1, 6)) { case 1: if (TeleportToTarget && cp.TelePortToTarChance >= Utility.RandomDouble()) // 0.5 is 50% , 0.05 is 5% { if (cp.TelePortToTarget == false) { return; } if (petxml.Levell < cp.TelePortToTargetReq) { return; } if (((BaseCreature)this.AttachedTo).Combatant == null) { return; } TeleToTarget(((BaseCreature)this.AttachedTo), e.Mobile); } break; case 2: if (MassProvoke && cp.MassProvokeChance >= Utility.RandomDouble()) { if (cp.MassProvokeToAtt == false) { return; } if (petxml.Levell < cp.MassProvokeToAttReq) { return; } if (((BaseCreature)this.AttachedTo).Combatant == null) { return; } MassProvokeXML(((BaseCreature)this.AttachedTo), e.Mobile); } ; break; case 3: if (MassPeace && cp.MassPeaceChance >= Utility.RandomDouble()) { if (cp.MassPeaceArea == false) { return; } if (petxml.Levell < cp.MassPeaceReq) { return; } if (((BaseCreature)this.AttachedTo).Combatant == null) { return; } MassPeaceXML(((BaseCreature)this.AttachedTo), e.Mobile); } ; break; case 4: if (SuperHeal && cp.SuperHealChance >= Utility.RandomDouble()) { if (cp.SuperHeal == false) { return; } if (petxml.Levell < cp.SuperHealReq) { return; } if (cp.PetShouldBeBonded == true) { if (((BaseCreature)this.AttachedTo).IsBonded == false) { return; } else { SuperHealXML(((BaseCreature)this.AttachedTo), e.Mobile); break; } } SuperHealXML(((BaseCreature)this.AttachedTo), e.Mobile); } ; break; case 5: if (BlessedPower && cp.BlessedPowerChance >= Utility.RandomDouble()) { if (cp.BlessedPower == false) { return; } if (petxml.Levell < cp.BlessedPowerReq) { return; } if (((BaseCreature)this.AttachedTo).Combatant == null) { return; } BlessedXML(((BaseCreature)this.AttachedTo), e.Mobile); } ; break; // case 6: // case 7: from.Hue = 0x7F7; break; // case 8: from.Hue = 0x7F8; break; // case 9: from.Hue = 0x7F9; break; } if (AttachedTo is BaseCreature && Utility.InRange(e.Mobile.Location, ((BaseCreature)this.AttachedTo).Location, proximityrange)) { OnTrigger(null, e.Mobile); } else { return; } }
public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven) { ConfiguredPetXML cp = new ConfiguredPetXML(); Mobile master = ((BaseCreature)this.AttachedTo).ControlMaster; XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(master, typeof(XMLPlayerLevelAtt)); XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(((BaseCreature)this.AttachedTo), typeof(XMLPetLevelAtt)); if (attacker == null) { return; } if (petxml == null) { return; } switch (Utility.RandomMinMax(1, 3)) { case 1: if (AreaFireBlast && cp.AreaFireBlastChance >= Utility.RandomDouble()) // 0.5 is 50% , 0.05 is 5% { if (cp.AreaFireBlast == false) { return; } if (petxml.Levell < cp.AreaFireBlastReq) { return; } AreaFireBlastXML(((BaseCreature)this.AttachedTo), defender, master); } break; case 2: if (AreaIceBlast && cp.AreaIceBlastChance >= Utility.RandomDouble()) { if (cp.AreaIceBlast == false) { return; } if (petxml.Levell < cp.AreaIceBlastReq) { return; } AreaIceBlastXML(((BaseCreature)this.AttachedTo), defender, master); } ; break; case 3: if (AreaAirBlast && cp.AreaAirBlastChance >= Utility.RandomDouble()) { if (cp.AreaAirBlast == false) { return; } if (petxml.Levell < cp.AreaAirBlastReq) { return; } AreaAirBlastXML(((BaseCreature)this.AttachedTo), defender, master); } ; break; } }