public override void OnDoubleClick(Mobile from) { PlayerMobile pm = from as PlayerMobile; CombatLevel combat = (CombatLevel)LSGovernor.GetAttached(from.Serial, typeof(CombatLevel)); if (IsChildOf(pm.Backpack)) { if (combat.Cap >= combat.EndingCap) { from.SendMessage("You cannot use this as you have already reached your full potintial."); return; } if (combat.Cap < combat.EndingCap) { combat.Cap += Increase; this.Delete(); if (combat.Cap >= combat.EndingCap) { combat.Cap = combat.EndingCap; from.SendMessage("Using all of its available knowledge you have reached your full potintial"); } } } else { pm.SendMessage("This must be in your pack!"); } }
public static void Initialize() { foreach (Mobile m in World.Mobiles.Values) { if (m is PlayerMobile) { if (((PlayerMobile)m).FollowersMax > 4 && ((PlayerMobile)m).Class != Class.Ranger) { ((PlayerMobile)m).FollowersMax = 4; } CombatLevel combat = (CombatLevel)LSGovernor.GetAttached(m.Serial, typeof(CombatLevel)); int totalexp = 0; for (int i = 0; i < combat.Level; i++) { totalexp += combat.LevelsAt[i]; } if (combat.TotalExp < totalexp) { combat.TotalExp = totalexp; } } } }
public void SetLevel(int level) { if (level <= CombatLevel.Value) { return; } CombatLevel.AddXP(CombatLevel.GetXPToLevelUp(level) - CombatLevel.XP); }
public override void OnDoubleClick(Mobile from) { PlayerMobile pm = from as PlayerMobile; CombatLevel combat = (CombatLevel)LSGovernor.GetAttached(from.Serial, typeof(CombatLevel)); if (IsChildOf(pm.Backpack)) { if (Owner != null && !(Owner == from)) { from.SendMessage("You are not the rightful owner of this certificate!"); return; } int add = 100; int t = 0; while ((t + add) <= m_Increase) { combat.AddExp(add); if (add <= 0) { break; } if ((t + add) > m_Increase) { add = (t + add) - m_Increase; } else { t += add; } } //combat.AddExp(m_Increase); this.Delete(); } else { pm.SendMessage("This must be in your pack!"); } }
public void AttackOther(Humanoid other, int damage) { if (damage < 0) { damage = 0; } damage = other.CompressDamage(damage); var xp = damage * 4; CombatLevel.AddXP(xp); if (this == Program.ActiveWorld.MainCharacter) { WriteLineColor($"You did {damage} damage to {(string.IsNullOrWhiteSpace(other.Name) ? "the enemy" : other.Name)}", ConsoleColor.Red, ConsoleColor.Black); if (xp > 0) { WriteLineColor($"You received {xp} xp", ConsoleColor.DarkCyan, ConsoleColor.Black); } } else if (other == Program.ActiveWorld.MainCharacter) { WriteLineColor($"You received {damage} damage from {(string.IsNullOrWhiteSpace(this.Name) ? "the enemy" : this.Name)}", ConsoleColor.Red, ConsoleColor.Black); } else { WriteLineColor($"{(string.IsNullOrWhiteSpace(this.Name) ? "the enemy 1" : this.Name)} did {damage} damage to {(string.IsNullOrWhiteSpace(other.Name) ? "the enemy 2" : other.Name)}", ConsoleColor.Red, ConsoleColor.Black); } other.AddHealth(-damage); if (other == Program.ActiveWorld.MainCharacter) { WriteLineColor($"{(string.IsNullOrWhiteSpace(this.Name) ? "the enemy" : this.Name)}'s health is now {this.Health}", ConsoleColor.Red, ConsoleColor.Black); } Program.UpdateStats(Program.ActiveWorld.MainCharacter); }
public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer, double scalar, Mobile target) { int damage = Utility.Dice(dice, sides, bonus) * 100; int damageBonus = 0; int inscribeSkill = GetInscribeFixed(m_Caster); int inscribeBonus = (inscribeSkill + (1000 * (inscribeSkill / 1000))) / 200; damageBonus += inscribeBonus; int intBonus = Caster.Int / 10; damageBonus += intBonus; int sdiBonus = AosAttributes.GetValue(m_Caster, AosAttribute.SpellDamage); #region Mondain's Legacy sdiBonus += ArcaneEmpowermentSpell.GetSpellBonus(m_Caster, playerVsPlayer); #endregion if (target != null && RunedSashOfWarding.IsUnderEffects(target, WardingEffect.SpellDamage)) { sdiBonus -= 10; } if (m_Caster is PlayerMobile && m_Caster.Race == Race.Gargoyle) { double perc = ((double)m_Caster.Hits / (double)m_Caster.HitsMax) * 100; perc = 100 - perc; perc /= 20; if (perc > 4) { sdiBonus += 12; } else if (perc >= 3) { sdiBonus += 9; } else if (perc >= 2) { sdiBonus += 6; } else if (perc >= 1) { sdiBonus += 3; } } // PvP spell damage increase cap of 15% from an item’s magic property, 30% if spell school focused. if (playerVsPlayer) { if (SpellHelper.HasSpellMastery(m_Caster) && sdiBonus > 30) { sdiBonus = 30; } if (!SpellHelper.HasSpellMastery(m_Caster) && sdiBonus > 15) { sdiBonus = 15; } } damageBonus += sdiBonus; TransformContext context = TransformationSpellHelper.GetContext(Caster); if (context != null && context.Spell is ReaperFormSpell) { damageBonus += ((ReaperFormSpell)context.Spell).SpellDamageBonus; } damage = AOS.Scale(damage, 100 + damageBonus); int evalSkill = GetDamageFixed(m_Caster); int evalScale = 30 + ((9 * evalSkill) / 100); damage = AOS.Scale(damage, evalScale); damage = AOS.Scale(damage, (int)(scalar * 100)); #region [Shards of Nagash: Level System] damage = (damage / 100); if (m_Caster is PlayerMobile && damage >= 10) { CombatLevel combat = (CombatLevel)LSGovernor.GetAttached(m_Caster.Serial, typeof(CombatLevel)); damage = (int)(damage + ((combat.Level * .125) + (combat.Level * .1))); } else { damage = (int)(damage / 1.75); } return(damage);// / 100; #endregion //return damage / 100; }
public PointDistributionGump(Mobile t, Mobile o, int page) : base(0, 0) { to = t; of = o; CurrentPage = (page < 1) ? 1 : page; /* * if (of is PlayerMobile && to.AccessLevel < AccessLevel.GameMaster && of != to) * { * of = to; * to.SendMessage("You are currently only allowed to look at your own stats!"); * ReloadGump(to); * return; * }*/ #region [Set Player Skills] if (of is PlayerMobile) { Skills s = ((PlayerMobile)of).Skills; switch (((PlayerMobile)of).Class) { case Class.None: break; case Class.Mage: { Skill1 = s[(SkillName.Alchemy)]; Skill2 = s[(SkillName.EvalInt)]; Skill3 = s[(SkillName.Inscribe)]; Skill4 = s[(SkillName.ItemID)]; Skill5 = s[(SkillName.Magery)]; Skill6 = s[(SkillName.Meditation)]; Skill7 = s[(SkillName.MagicResist)]; Skill8 = s[(SkillName.SpiritSpeak)]; break; } case Class.Warrior: { Skill1 = s[(SkillName.Anatomy)]; Skill2 = s[(SkillName.Fencing)]; Skill3 = s[(SkillName.Healing)]; Skill4 = s[(SkillName.Macing)]; Skill5 = s[(SkillName.Parry)]; Skill6 = s[(SkillName.Swords)]; Skill7 = s[(SkillName.Tactics)]; Skill8 = s[(SkillName.Wrestling)]; break; } case Class.Ranger: { Skill1 = s[(SkillName.AnimalLore)]; Skill2 = s[(SkillName.AnimalTaming)]; Skill3 = s[(SkillName.Archery)]; Skill4 = s[(SkillName.Camping)]; Skill5 = s[(SkillName.Cooking)]; Skill6 = s[(SkillName.Fishing)]; Skill7 = s[(SkillName.Tracking)]; Skill8 = s[(SkillName.Veterinary)]; break; } case Class.Thief: { Skill1 = s[(SkillName.DetectHidden)]; Skill2 = s[(SkillName.Fencing)]; Skill3 = s[(SkillName.Hiding)]; Skill4 = s[(SkillName.Lockpicking)]; Skill5 = s[(SkillName.Poisoning)]; Skill6 = s[(SkillName.Snooping)]; Skill7 = s[(SkillName.Stealing)]; Skill8 = s[(SkillName.Stealth)]; break; } case Class.Bard: { Skill1 = s[(SkillName.Herding)]; Skill2 = s[(SkillName.Cartography)]; Skill3 = s[(SkillName.Discordance)]; Skill4 = s[(SkillName.Macing)]; Skill5 = s[(SkillName.Musicianship)]; Skill6 = s[(SkillName.Peacemaking)]; Skill7 = s[(SkillName.Provocation)]; Skill8 = s[(SkillName.TasteID)]; break; } case Class.Crafter: { Skill1 = s[(SkillName.ArmsLore)]; Skill2 = s[(SkillName.Blacksmith)]; Skill3 = s[(SkillName.Fletching)]; Skill4 = s[(SkillName.Carpentry)]; Skill5 = s[(SkillName.Lumberjacking)]; Skill6 = s[(SkillName.Mining)]; Skill7 = s[(SkillName.Tailoring)]; Skill8 = s[(SkillName.Tinkering)]; break; } } } #endregion Closable = true; Disposable = true; Dragable = true; Resizable = false; #region [Background] AddPage(0); AddBackground(109, 61, 569, 434, 83); AddBackground(113, 103, 562, 355, 9260); AddBackground(131, 392, 525, 25, 9200); AddBackground(393, 240, 264, 149, 9500); AddBackground(130, 240, 247, 149, 9500); AddBackground(321, 112, 336, 87, 9500); AddBackground(481, 213, 175, 25, 9500); AddBackground(306, 213, 175, 25, 9500); AddBackground(130, 213, 175, 25, 9500); AddImageTiled(384, 240, 9, 149, 97); AddBackground(130, 112, 173, 87, 9500); AddImageTiled(127, 198, 536, 18, 10301); AddImageTiled(123, 239, 539, 4, 96); AddImageTiled(303, 115, 18, 95, 10150); AddImageTiled(113, 440, 561, 18, 10301); AddImageTiled(167, 97, 457, 18, 10301); AddBackground(306, 415, 175, 25, 9500); AddBackground(130, 415, 175, 25, 9500); AddBackground(481, 415, 175, 25, 9500); AddImageTiled(131, 413, 524, 4, 96); AddImage(79, 104, 10421); AddImage(107, 86, 10420); AddImage(92, 238, 10422); AddImage(654, 104, 10431); AddImage(621, 86, 10430); AddImage(648, 238, 10432); AddImage(63, 397, 10402); AddImage(643, 397, 10412); AddImageTiled(377, 240, 9, 151, 95); AddImageTiled(131, 389, 524, 4, 96); #endregion #region [Mobile Stats] AddLabel(157, 129, 1953, @"Strength:"); AddLabel(252, 129, 1953, @"" + of.Str); AddLabel(157, 149, 1953, @"Dexterity:"); AddLabel(252, 149, 1953, @"" + of.Dex); AddLabel(157, 169, 1953, @"Intelligence:"); AddLabel(252, 169, 1953, @"" + of.Int); #region [Stat Buttons] if (of.StatPoints > 0 && ((of is BaseCreature && ((BaseCreature)of).GetMaster() == to) || (of == to && of.RawStatTotal < of.StatCap))) { if (of is BaseCreature || of is PlayerMobile && of.RawStr < 150) { AddButton(139, 133, 2435, 2436, (int)Buttons.Increase_Str, GumpButtonType.Reply, 0); } if (of is BaseCreature || of is PlayerMobile && of.RawDex < 150) { AddButton(139, 153, 2435, 2436, (int)Buttons.Increase_Dex, GumpButtonType.Reply, 0); } if (of is BaseCreature || of is PlayerMobile && of.RawInt < 150) { AddButton(139, 173, 2435, 2436, (int)Buttons.Increase_Int, GumpButtonType.Reply, 0); } } if (!(of is BaseCreature)) { AddButton(285, 180, 1209, 1210, (int)Buttons.StatGump, GumpButtonType.Reply, 0); } #endregion #endregion #region [Combat Stats] CombatLevel combat = (CombatLevel)LSGovernor.GetAttached(of.Serial, typeof(CombatLevel)); AddLabel(327, 129, 1953, @"Level:"); AddLabel(392, 129, 1953, @"" + combat.Level); AddLabel(327, 149, 1953, @"Exp:"); AddLabel(392, 149, 1953, @"" + combat.Exp.ToString("#,#")); AddLabel(327, 169, 1953, @"Level At:"); AddLabel(392, 169, 1953, @"" + combat.LevelsAt[combat.Level].ToString("#,#")); AddLabel(492, 129, 1953, @"Cap:"); AddLabel(563, 129, 1953, @"" + combat.Cap); AddLabel(492, 149, 1953, @"Total Exp:"); AddLabel(563, 149, 1953, @"" + combat.TotalExp.ToString("#,#")); #endregion AddLabel(157, 218, 1953, @"" + of.Name); AddLabel(330, 218, 1953, @"Class:"); AddLabel(376, 218, 1953, @"" + ((of is BaseCreature) ? "Creature" : @"" + ((PlayerMobile)of).Class)); AddLabel(502, 218, 1953, @"Rank:"); AddLabel(545, 218, 1953, @"" + ((of is BaseCreature) ? "--" : @"" + ((PlayerMobile)of).Rank)); #region [Pet Skills] if (of is BaseCreature) { #region [Page Background] AddPage(1); AddBackground(131, 392, 525, 25, 9200); AddBackground(393, 240, 264, 149, 9500); AddBackground(130, 240, 247, 149, 9500); AddImageTiled(384, 240, 9, 149, 97); AddImageTiled(123, 239, 539, 4, 96); AddImageTiled(131, 413, 524, 4, 96); AddImage(79, 104, 10421); AddImage(107, 86, 10420); AddImage(92, 238, 10422); AddImage(654, 104, 10431); AddImage(621, 86, 10430); AddImage(648, 238, 10432); AddImageTiled(377, 240, 9, 151, 95); AddImageTiled(131, 389, 524, 4, 96); #endregion //int CurrentPage = (page < 1) ? 1 : page; int SkillCount = ((BaseCreature)of).Skills.Length; int TotalPages = 7; // (int)(SkillCount / 8); #region [Skills On Page] if ((SkillID(1) - 1) < SkillCount) { AddLabel(175, 274, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(1) - 1)].Name + ":"); AddLabel(308, 274, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(1) - 1)].Base); } if ((SkillID(2) - 1) < SkillCount) { AddLabel(175, 299, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(2) - 1)].Name + ":"); AddLabel(308, 299, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(2) - 1)].Base); } if ((SkillID(3) - 1) < SkillCount) { AddLabel(175, 324, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(3) - 1)].Name + ":"); AddLabel(308, 324, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(3) - 1)].Base); } if ((SkillID(4) - 1) < SkillCount) { AddLabel(175, 349, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(4) - 1)].Name + ":"); AddLabel(308, 349, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(4) - 1)].Base); } if ((SkillID(5) - 1) < SkillCount) { AddLabel(446, 274, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(5) - 1)].Name + ":"); AddLabel(579, 274, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(5) - 1)].Base); } if ((SkillID(6) - 1) < SkillCount) { AddLabel(446, 299, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(6) - 1)].Name + ":"); AddLabel(579, 299, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(6) - 1)].Base); } if ((SkillID(7) - 1) < SkillCount) { AddLabel(446, 324, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(7) - 1)].Name + ":"); AddLabel(579, 324, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(7) - 1)].Base); } if ((SkillID(8) - 1) < SkillCount) { AddLabel(446, 349, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(8) - 1)].Name + ":"); AddLabel(579, 349, 1953, @"" + ((BaseCreature)of).Skills[(SkillID(8) - 1)].Base); } #region [Skill Increase Buttons] if (of.SkillPoints > 0) { if ((SkillID(1) - 1) <= SkillCount) { AddButton(160, 278, 2435, 2436, ((SkillID(1) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(2) - 1) <= SkillCount) { AddButton(160, 303, 2435, 2436, ((SkillID(2) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(3) - 1) <= SkillCount) { AddButton(160, 328, 2435, 2436, ((SkillID(3) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(4) - 1) <= SkillCount) { AddButton(160, 353, 2435, 2436, ((SkillID(4) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(5) - 1) <= SkillCount) { AddButton(428, 278, 2435, 2436, ((SkillID(5) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(6) - 1) <= SkillCount) { AddButton(428, 303, 2435, 2436, ((SkillID(6) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(7) - 1) <= SkillCount) { AddButton(428, 328, 2435, 2436, ((SkillID(7) - 1) * 100), GumpButtonType.Reply, 0); } if ((SkillID(8) - 1) <= SkillCount) { AddButton(428, 353, 2435, 2436, ((SkillID(8) - 1) * 100), GumpButtonType.Reply, 0); } } #endregion #endregion #region [Page Buttons] if (CurrentPage > 1) { AddButton(134, 395, 57, 58, (int)Buttons.Previous_SkillsPage, GumpButtonType.Reply, 0); } AddLabel(367, 394, 2594, @"Page " + CurrentPage); if (CurrentPage < TotalPages) { AddButton(622, 395, 59, 58, (int)Buttons.Next_SkillsPage, GumpButtonType.Reply, 0); } #endregion } #endregion #region [Player Skills] if (of is PlayerMobile && Skill1 != null) { AddLabel(175, 274, 1953, @"" + Skill1.Name + ":"); AddLabel(308, 274, 1953, @"" + Skill1.Base); AddLabel(175, 299, 1953, @"" + Skill2.Name + ":"); AddLabel(308, 299, 1953, @"" + Skill2.Base); AddLabel(175, 324, 1953, @"" + Skill3.Name + ":"); AddLabel(308, 324, 1953, @"" + Skill3.Base); AddLabel(175, 349, 1953, @"" + Skill4.Name + ":"); AddLabel(308, 349, 1953, @"" + Skill4.Base); AddLabel(446, 274, 1953, @"" + Skill5.Name + ":"); AddLabel(579, 274, 1953, @"" + Skill5.Base); AddLabel(446, 299, 1953, @"" + Skill6.Name + ":"); AddLabel(579, 299, 1953, @"" + Skill6.Base); AddLabel(446, 324, 1953, @"" + Skill7.Name + ":"); AddLabel(579, 324, 1953, @"" + Skill7.Base); AddLabel(446, 349, 1953, @"" + Skill8.Name + ":"); AddLabel(579, 349, 1953, @"" + Skill8.Base); if (of == to && of.SkillPoints > 0) { if (Skill1.Base < 140) { AddButton(160, 278, 2435, 2436, (int)Buttons.Increase_Skill1, GumpButtonType.Reply, 0); } if (Skill2.Base < 140) { AddButton(160, 303, 2435, 2436, (int)Buttons.Increase_Skill2, GumpButtonType.Reply, 0); } if (Skill3.Base < 140) { AddButton(160, 328, 2435, 2436, (int)Buttons.Increase_Skill3, GumpButtonType.Reply, 0); } if (Skill4.Base < 140) { AddButton(160, 353, 2435, 2436, (int)Buttons.Increase_Skill4, GumpButtonType.Reply, 0); } if (Skill5.Base < 140) { AddButton(428, 278, 2435, 2436, (int)Buttons.Increase_Skill5, GumpButtonType.Reply, 0); } if (Skill6.Base < 140) { AddButton(428, 304, 2435, 2436, (int)Buttons.Increase_Skill6, GumpButtonType.Reply, 0); } if (Skill7.Base < 140) { AddButton(428, 328, 2435, 2436, (int)Buttons.Increase_Skill7, GumpButtonType.Reply, 0); } if (Skill8.Base < 140) { AddButton(428, 353, 2435, 2436, (int)Buttons.Increase_Skill8, GumpButtonType.Reply, 0); } } } #endregion AddLabel(157, 420, 1953, @"Stat Points:"); AddLabel(252, 420, 1953, @"" + of.StatPoints); AddLabel(330, 420, 1953, @"Skill Points:"); AddLabel(415, 420, 1953, @"" + of.SkillPoints); AddLabel(501, 420, 1953, @"Skill Total:"); AddLabel(609, 420, 1953, @"" + Convert.ToString(of.Skills.Total / 10)); AddButton(633, 461, 1150, 1151, (int)Buttons.Exit, GumpButtonType.Reply, 0); }