public static int TExpPet(BaseCreature bc) { XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); return(petxml.kxp + LevelCore.GetExp(bc)); }
public static int PetLevelXML(Mobile m, Configured c) { BaseCreature bc = m as BaseCreature; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); if (petxml == null) { return(0); } else { int Lvl = petxml.Levell; return(Lvl); } }
public static void PetOnDeath(BaseCreature bc) { XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); Mobile master = bc.ControlMaster; ConfiguredPetXML cp = new ConfiguredPetXML(); if (master != null && bc.Controlled == true && petxml != null) { if (cp.LoseExpLevelOnDeath == true) { if (cp.LoseStatOnDeath == true) { int strloss = bc.Str / cp.PetStatLossAmount; int dexloss = bc.Dex / cp.PetStatLossAmount; int intloss = bc.Int / cp.PetStatLossAmount; if (bc.Str > strloss) { bc.Str -= strloss; } if (bc.Dex > dexloss) { bc.Dex -= dexloss; } if (bc.Int > intloss) { bc.Int -= intloss; } } int ExpLoss = petxml.Expp / cp.PetStatLossAmount; int KXPLoss = petxml.kxp / cp.PetStatLossAmount; petxml.Expp -= ExpLoss; petxml.kxp -= KXPLoss; if (petxml.Expp <= 0) { petxml.Levell -= 1; petxml.Expp = 0; petxml.kxp = 0; } master.SendMessage(38, "Your pet has suffered a 5% stat lose due to its untimely death."); } else { master.SendMessage(64, "Your pet has been killed!"); } } }
public static void AddExp(Mobile m, Mobile k, Party p, Configured c) { BaseCreature bc = (BaseCreature)m; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); ConfiguredPetXML cp = new ConfiguredPetXML(); PlayerMobile pm = null; LevelHandlerPet lh = new LevelHandlerPet(); Mobile cm = bc.ControlMaster; double orig = 0; //Monster Xp double fig = 0; //Party Xp double give = 0; //Xp To Give if (k != null) { orig = LevelCore.Base(k); } fig = orig; if (fig > 0) { give = LevelHandlerPet.ExpFilter(m, fig, p, false); } if (give > 0) { if (cp.NotifyOnPetExpGain == true) { cm.SendMessage("{0} gained " + give + " exp for the kill!", bc.Name); } petxml.kxp += (int)give; if (petxml.Expp >= petxml.ToLevell && petxml.Levell < petxml.MaxLevel) { DoLevel(bc, new Configured()); } } }
public static int ExpFilter(Mobile m, double o, Party p, bool craft) { BaseCreature bc = (BaseCreature)m; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); ConfiguredPetXML cp = new ConfiguredPetXML(); PlayerMobile pm = null; BaseCreature bcc = null; Configured c = new Configured(); double n; double New = 0; if (p != null && c.PartyExpShare) { } else { bcc = m as BaseCreature; XMLPetLevelAtt petxml3 = (XMLPetLevelAtt)XmlAttach.FindAttachment(bcc, typeof(XMLPetLevelAtt)); if (petxml3 == null) { return(0); } if (petxml3.Expp + o > petxml3.ToLevell && petxml3.Levell >= petxml3.MaxLevel) { n = (o + petxml3.Expp) - petxml3.ToLevell; New = (int)(o - n); } else { New = o; } } return((int)New); }
protected override void OnTarget(Mobile from, object target) { BaseCreature pet = target as BaseCreature; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(pet, typeof(XMLPetLevelAtt)); if (petxml == null) { from.SendMessage("You cannot check this!"); } else if (target == from) { from.SendMessage("You cannot check yourself!"); } else if (target is Item) { from.SendMessage("You cannot check that!"); } else if (target is PlayerMobile) { from.SendMessage("That person gives you a dirty look!"); } else if (Server.Spells.SpellHelper.CheckCombat(from)) { from.SendMessage("You cannot check your pet while you are fighting."); } else if (null == pet) { from.SendMessage("That is not a pet!"); } else if ((pet.BodyValue == 400 || pet.BodyValue == 401) && pet.Controlled == false) { from.SendMessage("That person gives you a dirty look!"); } else if (pet.IsDeadPet) { from.SendMessage("You cannot check the dead!"); } else if (pet.Summoned) { from.SendMessage("You cannot check a summoned creature!"); } else if (!m_StaffCommand && pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map) { from.SendMessage("Your pet is fighting; you cannot check it yet."); } else if (pet.BodyMod != 0) { from.SendMessage("You cannot check your pet while it is polymorphed."); } else if (!m_StaffCommand && pet.Controlled == false) { from.SendMessage("You cannot not check wild creatures."); } else if (!m_StaffCommand && pet.ControlMaster != from) { from.SendMessage("That is not your pet."); } else { from.SendGump(new PetLevelGump(from, pet)); } }
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); } } }
public static void DoLevel(Mobile klr, Configured c) { BaseCreature bc = (BaseCreature)klr; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); ConfiguredPetXML cs = new ConfiguredPetXML(); PlayerMobile pm = klr as PlayerMobile; LevelHandlerPet lh = new LevelHandlerPet(); ConfiguredSkills css = new ConfiguredSkills(); Mobile cm = bc.ControlMaster; /* Still adding Skill Points for Future Development */ if (petxml.Expp >= petxml.ToLevell) { petxml.Expp = 0; petxml.kxp = 0; petxml.Levell += 1; int totalStats = bc.RawDex + bc.RawInt + bc.RawStr; if (petxml.Levell <= 20) { petxml.ToLevell = (int)(petxml.Levell * 20); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below20; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below20Stat; } } else if (petxml.Levell <= 40) { petxml.ToLevell = (int)(petxml.Levell * 40); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below40; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below40Stat; } } else if (petxml.Levell <= 60) { petxml.ToLevell = (int)(petxml.Levell * 60); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below60; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below60Stat; } } else if (petxml.Levell <= 70) { petxml.ToLevell = (int)(petxml.Levell * 80); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below70; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below70Stat; } } else if (petxml.Levell <= 80) { petxml.ToLevell = (int)(petxml.Levell * 100); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below80; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below80Stat; } } else if (petxml.Levell <= 90) { petxml.ToLevell = (int)(petxml.Levell * 120); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below90; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below90Stat; } } else if (petxml.Levell <= 100) { petxml.ToLevell = (int)(petxml.Levell * 140); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below100; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below100Stat; } } else if (petxml.Levell <= 110) { petxml.ToLevell = (int)(petxml.Levell * 140); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below110; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below110Stat; } } else if (petxml.Levell <= 120) { petxml.ToLevell = (int)(petxml.Levell * 150); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below120; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below120Stat; } } else if (petxml.Levell <= 130) { petxml.ToLevell = (int)(petxml.Levell * 150); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below130; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below130Stat; } } else if (petxml.Levell <= 140) { petxml.ToLevell = (int)(petxml.Levell * 160); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below140; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below140Stat; } } else if (petxml.Levell <= 150) { petxml.ToLevell = (int)(petxml.Levell * 180); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below150; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below150Stat; } } else if (petxml.Levell <= 160) { petxml.ToLevell = (int)(petxml.Levell * 180); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below160; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below160Stat; } } else if (petxml.Levell <= 170) { petxml.ToLevell = (int)(petxml.Levell * 190); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below170; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below170Stat; } } else if (petxml.Levell <= 180) { petxml.ToLevell = (int)(petxml.Levell * 190); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below180; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below180Stat; } } else if (petxml.Levell <= 190) { petxml.ToLevell = (int)(petxml.Levell * 190); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below190; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below190Stat; } } else if (petxml.Levell <= 200) { petxml.ToLevell = (int)(petxml.Levell * 200); if (bc.SkillsTotal < cs.SkillsTotal) { petxml.SKPoints += cs.Below200; } if (totalStats < cs.MaxStatPoints) { petxml.StatPoints += cs.Below200Stat; } } } if (cs.RefreshOnLevel) { 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; } } bc.PlaySound(0x20F); bc.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist); bc.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist); if (cs.NotifyOnPetlevelUp == true) { cm.SendMessage("Your Pet level has increased"); } petxml.Expp = 0; petxml.kxp = 0; }
public static void Set(Mobile killer, Mobile killed) { if (killer is PlayerMobile || killed is PlayerMobile) { return; } ConfiguredPetXML cp = new ConfiguredPetXML(); BaseCreature bc = (BaseCreature)killer; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); BaseCreature klr = null; BaseCreature klrr = null; Party pty = null; Configured c = new Configured(); LevelHandlerPet lh = new LevelHandlerPet(); klr = killer as BaseCreature; klrr = killed as BaseCreature; if (klr.Summoned == true || klr.Summoned == true) { return; } if (klrr.Summoned == true || klrr.Summoned == true) { return; } /* Suggestion: Have the below , when NULL, set to attach if system enabled * then continue. Pets without the attachment would then not have a level on them yet. * No real reason to really indicate a pet is Level 1... */ if (petxml == null) { if (cp.EnabledLevelPets == true) { XmlAttach.AttachTo(bc, new XMLPetLevelAtt()); } else { return; } } if (lh.MemberCount.Count > 0) { foreach (Mobile il in lh.MemberCount) { lh.MemberCount.Remove(il); } } if (klr != null) { BaseCreature bcr = (BaseCreature)killer; pty = Party.Get(klr); if (bcr is BaseCreature) { } AddExp(klr, killed, pty, new Configured()); } }