public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; if (IsChildOf(pm.Backpack)) { int CurrentLevel = xmlplayer.Levell; int NeededToLevel = xmlplayer.ToLevell; int CurrentExp = xmlplayer.Expp; int CurrentKXP = xmlplayer.kxp; int DifferenceNeed = NeededToLevel - CurrentExp; if (xmlplayer.Levell >= xmlplayer.MaxLevel) { pm.SendMessage("Target has reached the max level, this doesn't work for them!"); return; } else { xmlplayer.kxp += DifferenceNeed; xmlplayer.Expp += DifferenceNeed; 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 override bool OnMoveOver(Mobile from) { XMLPlayerLevelAtt gate = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); if (gate == null) { return(false); } if (RequiredExactLevel == true) { if (gate.Levell == RequiredExactLevelVar) { return(true); } else { from.SendMessage("You do not meet the level requirement for this gate."); return(false); } } else if (RequiredExactLevel == false && gate.Levell < RequiredLevel) { return(false); } else { return(true); } return(base.OnMoveOver(from)); }
private static void EventSink_Login(LoginEventArgs args) { Mobile m = args.Mobile; if (args.Mobile.NetState == null) { return; } if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; Configured c = new Configured(); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); if (xmlplayer != null) { return; } else { if (m is PlayerMobile && c.AttachonLogon) { XmlAttach.AttachTo(m, new XMLPlayerLevelAtt()); } else { return; } } } }
protected override void OnTarget(Mobile from, object target) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; BaseCreature pet = target as BaseCreature; if (target == pet) { from.SendMessage("This only works on Players!"); } else if (xmlplayer.Levell >= c.EndMaxLvl) /* Max Level per System */ { pm.SendMessage("Target has reached the max level, this doesn't work for them!"); } else { if (target is Mobile) { Mobile mt = (Mobile)target; mt.SendMessage("You have been awarded {0} EXP points", xp.SCV); xmlplayer.kxp += xp.SCV; if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(pm, new Configured()); } } } }
public static string Display(Mobile m, Configured c) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = m as PlayerMobile; if (xmlplayer == null) { return(null); } string dsp; if (pm.AccessLevel > AccessLevel.Player && !(c.StaffHasLevel)) { dsp = ""; } else { if (c.MaxLevel) { dsp = "" + xmlplayer.Levell + "/" + xmlplayer.MaxLevel; } else { dsp = "" + xmlplayer.Levell; } } return(dsp); }
/* #region Level System Taming * XMLPetLevelAtt xmlpet = (XMLPetLevelAtt)XmlAttach.FindAttachment(this, typeof(XMLPetLevelAtt)); * Configured c = new Configured(); * ConfiguredPetXML cp = new ConfiguredPetXML(); * if (c.TamingGivesExp == true) * LevelCore.Taming(tamer); #endregion */ public static void Harvest(Mobile m, Item i, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { Configured c = new Configured(); //LevelCore.Harvest(tool , from, new Configured()); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = m as PlayerMobile; LevelHandler lh = new LevelHandler(); if (xmlplayer == null) { return; } else { if (xmlplayer.Expp < xmlplayer.ToLevell) { int xp = (int)Math.Round(2 + (LevelCore.HarvestExp(m, i, def, map, loc, resource))); int give = LevelHandler.ExpFilter(pm, xp, null, true); if (give > 0) { pm.SendMessage("You gained {0} experience for harvesting some Resources.", give); xmlplayer.kxp += (int)give; if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(pm, new Configured()); } } } } }
private static void EventSink_Login(LoginEventArgs args) { Mobile m = args.Mobile; if (args.Mobile.NetState == null) { return; } if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; Configured c = new Configured(); XMLDeleteLevelAttOnLogin cr = new XMLDeleteLevelAttOnLogin(); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); if (xmlplayer != null && cr.ActivateDeleteOnLogin == true) { xmlplayer.Delete(); } else { return; } } }
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 int Classic(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; int exp = LevelCore.GetExp(pm);//LevelCore.Stats(pm) + LevelCore.Skills(pm); int ToLevell = (int)(xmlplayer.Levell * 100); int highest = 100; if (Cl.Enabled) { if (exp >= ToLevell && xmlplayer.Levell != highest) { xmlplayer.Levell += 1; xmlplayer.ToLevell = (int)(xmlplayer.Levell * 100); if (exp >= ToLevell) { LevelHandler.Classic(pm); } return(exp); } return(exp); } return(0); }
public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; Configured c = new Configured(); if (IsChildOf(pm.Backpack)) { if (!(Off.Enabled || Cl.Enabled)) { if (xmlplayer.MaxLevel >= c.EndMaxLvl) { pm.SendMessage("You cannot raise any farther with this!"); } else { xmlplayer.MaxLevel += m_RML; pm.SendMessage("Your MaxLevel has increased by {0}", m_RML); this.Delete(); } } } else { pm.SendMessage("This must be in your pack!"); } }
public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); ExpPowerHour powerlevel = (ExpPowerHour)XmlAttach.FindAttachment(from, typeof(ExpPowerHour)); PlayerMobile pm = from as PlayerMobile; Configured c = new Configured(); var p = Party.Get(from); int range = c.PartyRange; if (IsChildOf(pm.Backpack)) { if (xmlplayer == null) { pm.SendMessage("This wont work for you!"); return; } else if (powerlevel != null) { pm.SendMessage("You must wait for your current Exp Power Hour to end!"); return; } else { if (p != null) { foreach (PartyMemberInfo mi in p.Members) { pm = mi.Mobile as PlayerMobile; if (pm.Alive && pm.InRange(pm, range)) { XMLPlayerLevelAtt xmlplayer2 = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); ExpPowerHour powerlevel2 = (ExpPowerHour)XmlAttach.FindAttachment(pm, typeof(ExpPowerHour)); if (powerlevel2 != null) { pm.SendMessage("You already have a power hour, your party gains their bonus!"); return; } if (xmlplayer2 == null) { pm.SendMessage("You lack level attachment, talk to your admin!"); return; } else { XmlAttach.AttachTo(pm, new ExpPowerHour()); this.Delete(); } } } } XmlAttach.AttachTo(from, new ExpPowerHour()); this.Delete(); } } else { pm.SendMessage("This must be in your pack!"); } }
// public static bool BodGainEXP(Mobile from, Skill skill, SkillName skillname) public static void BodGainEXP(Mobile from, int points) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); xmlplayer.kxp += points; from.SendMessage("You have been awarded {0} EXP points for turning in the bulk order.", points); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } }
public static int ExpFilter(Mobile m, double o, Party p, bool craft) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = null; Configured c = new Configured(); double n; double New = 0; #region PartyExpShare if (p != null && c.PartyExpShare) { if (craft) { return(0); } foreach (PartyMemberInfo mi in p.Members) { pm = mi.Mobile as PlayerMobile; XMLPlayerLevelAtt xmlplayerparty = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); if (xmlplayerparty != null) { if (xmlplayerparty.Expp + o > xmlplayerparty.ToLevell && xmlplayerparty.Levell >= xmlplayerparty.MaxLevel) { n = (o + xmlplayerparty.Expp) - xmlplayerparty.ToLevell; New = (o - n); } else { New = o; } } } } #endregion else { pm = m as PlayerMobile; if (xmlplayer.Expp + o > xmlplayer.ToLevell && xmlplayer.Levell >= xmlplayer.MaxLevel) { n = (o + xmlplayer.Expp) - xmlplayer.ToLevell; New = (int)(o - n); } else { New = o; } } return((int)New); }
private static void ExpBar_OnCommand(CommandEventArgs e) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(e.Mobile, typeof(XMLPlayerLevelAtt)); if (xmlplayer == null) { e.Mobile.SendMessage("You may not use this!"); return; } else { e.Mobile.CloseGump(typeof(ExpBar)); e.Mobile.SendGump(new ExpBar(e.Mobile)); } }
protected override void OnTarget(Mobile from, object target) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; BaseCreature pet = target as BaseCreature; int totalstatsreturned = (int)(xmlplayer.StrPointsUsed) + (xmlplayer.IntPointsUsed) + (xmlplayer.DexPointsUsed); int str = (int)(xmlplayer.StrPointsUsed); int dex = (int)(xmlplayer.DexPointsUsed); int intt = (int)(xmlplayer.IntPointsUsed); if (target == pet) { from.SendMessage("This only works on Players!"); return; } if (totalstatsreturned == 0) /* Max Level per System */ { pm.SendMessage("Target has no stats to reset!"); return; } else { if (target is Mobile) { if (xmlplayer.StrPointsUsed > 0) { from.Str += -str; xmlplayer.StatPoints += str; xmlplayer.StrPointsUsed = 0; } if (xmlplayer.DexPointsUsed > 0) { from.Dex += -dex; xmlplayer.StatPoints += dex; xmlplayer.DexPointsUsed = 0; } if (xmlplayer.IntPointsUsed > 0) { from.Int += -intt; xmlplayer.StatPoints += intt; xmlplayer.IntPointsUsed = 0; } } } }
public static int TExp(Mobile m) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = m as PlayerMobile; if (Cl.Enabled) { return(LevelHandler.Classic(pm)); } else if (En.Enabled) { return(xmlplayer.kxp + LevelCore.GetExp(pm)); } else { return(xmlplayer.kxp); } }
public override bool OnEquip(Mobile from) { XMLPlayerLevelAtt weap1 = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); if (weap1 != null && weap1.Levell >= RequiredLevel && from is PlayerMobile) { return(true); } else { if (from is PlayerMobile) { from.SendMessage("You do not meet the level requirement for this Armor."); return(false); } } return(true); }
public ExpBar(Mobile m) : base(0, 0) { Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); PlayerMobile pm = m as PlayerMobile; XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); AddBackground(10, 10, 295, 90, 9270); AddLabel(25, 25, 50, "EXP:"); AddLabel(60, 25, 3, "" + xmlplayer.Expp.ToString("#,0")); AddLabel(185, 25, 50, "Max Level:"); AddLabel(248, 25, 3, "" + xmlplayer.MaxLevel.ToString("#,0")); AddLabel(25, 40, 50, "Level At:"); AddLabel(85, 40, 3, "" + xmlplayer.ToLevell.ToString("#,0")); AddLabel(185, 40, 3, "" + GetPercentage((int)xmlplayer.Expp, xmlplayer.ToLevell, 2) + "%"); AddLabel(179, 40, 50, "(" + AddSpaces(GetPercentage((int)xmlplayer.Expp, xmlplayer.ToLevell, 2) + "%") + " Reached)"); AddLabel(31, 55, 1153, "____________________________"); double ShowBarAt = xmlplayer.ToLevell / 100; double NextExtendAt = 0; int LengthOfBar = 0; if (NextExtendAt == 0) { NextExtendAt = ShowBarAt; } for (int i = 0; xmlplayer.Expp >= NextExtendAt; i++) { NextExtendAt += ShowBarAt; LengthOfBar = (int)(2.24 * i); } AddImageTiled(30, 70, LengthOfBar, 15, 58);//x, y, Width, Heigth, ID AddLabel(26, 68, 1153, "(____________________________)"); }
public override bool OnMoveOver(Mobile m) { XMLPlayerLevelAtt gate = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); if (gate != null && gate.Levell >= RequiredLevel && m is PlayerMobile) { if (m.InRange(GetWorldLocation(), 1)) { CheckGate(m, 1); } } else { if (m is PlayerMobile) { m.SendMessage("You do not meet the level requirement for this gate."); return(false); } } return(true); }
public override void OnDoubleClick(Mobile m) { XMLPlayerLevelAtt gate = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); if (gate == null) { m.SendMessage("You do not meet the level requirement for this gate."); } else if (gate.Levell != RequiredLevel) { m.SendMessage("You do not meet the level requirement for this gate."); } else { if (m.InRange(GetWorldLocation(), 1)) { CheckGate(m, 1); } } }
public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); int totalstatsreturned = (int)(xmlplayer.StrPointsUsed) + (xmlplayer.IntPointsUsed) + (xmlplayer.DexPointsUsed); int str = (int)(xmlplayer.StrPointsUsed); int dex = (int)(xmlplayer.DexPointsUsed); int intt = (int)(xmlplayer.IntPointsUsed); if (totalstatsreturned == 0) { from.SendMessage("You need to have points to refund!"); return; } if (str == 0 || dex == 0 || intt == 0) { from.SendMessage("You must have used at least 1 point in each category to use this! (STR, INT and DEX)"); return; } if (xmlplayer.StrPointsUsed != 0) { from.Str += -str; xmlplayer.StatPoints += str; xmlplayer.StrPointsUsed = 0; } if (xmlplayer.DexPointsUsed != 0) { from.Dex += -dex; xmlplayer.StatPoints += dex; xmlplayer.DexPointsUsed = 0; } if (xmlplayer.IntPointsUsed != 0) { from.Int += -intt; xmlplayer.StatPoints += intt; xmlplayer.IntPointsUsed = 0; } this.Delete(); }
protected override void OnTarget(Mobile from, object target) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); ExpPowerHour powerlevel = (ExpPowerHour)XmlAttach.FindAttachment(from, typeof(ExpPowerHour)); PlayerMobile pm = from as PlayerMobile; if (xmlplayer == null) { pm.SendMessage("You cant give them power hour!"); return; } else if (powerlevel != null) { pm.SendMessage("They already have a power hour!"); return; } else { pm.SendMessage("They have been awarded Power Hour!"); XmlAttach.AttachTo(from, new ExpPowerHour()); } }
public override void VendorBuy(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); if (xmlplayer != null) { if (this is LevelVendor90) { if (xmlplayer.Levell < 90) { Say(true, "You must be level 90 or higher to work with me! Back to Training for you!"); return; } } } else { Say(true, "You lack a level, are you normal?"); return; } base.VendorBuy(from); }
protected override void OnTarget(Mobile from, object target) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; BaseCreature pet = target as BaseCreature; if (target == pet) { from.SendMessage("This only works on Players!"); } else { if (target is PlayerMobile) { int CurrentLevel = xmlplayer.Levell; int NeededToLevel = xmlplayer.ToLevell; int CurrentExp = xmlplayer.Expp; int CurrentKXP = xmlplayer.kxp; int DifferenceNeed = NeededToLevel - CurrentExp; if (xmlplayer.Levell >= xmlplayer.MaxLevel) { pm.SendMessage("Target has reached the max level, this doesn't work for them!"); return; } else { xmlplayer.kxp += DifferenceNeed; xmlplayer.Expp += DifferenceNeed; if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(pm, new Configured()); } } } } }
public static void Craft(Item i, int q, double ch, double e, Mobile m, Configured c) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = m as PlayerMobile; LevelHandler lh = new LevelHandler(); if (xmlplayer.Expp < xmlplayer.ToLevell) { int xp = (int)Math.Round(3.6 + (LevelCore.CraftExp(i, q, ch, e, pm))); int give = LevelHandler.ExpFilter(pm, xp, null, true); if (give > 0) { pm.SendMessage("You gained {0} experience for crafting an item.", give); xmlplayer.kxp += (int)give; if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(pm, new Configured()); } } } }
public static void Taming(Mobile m) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = m as PlayerMobile; LevelHandler lh = new LevelHandler(); if (xmlplayer == null) { return; } else { if (xmlplayer.Expp < xmlplayer.ToLevell) { pm.SendMessage("You have gained 5 Experience for taming a wild creature"); xmlplayer.kxp += 8; if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(pm, new Configured()); } } } }
public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; if (IsChildOf(pm.Backpack)) { if (pm.SkillsTotal >= 700) //Edit this value based on your servers skill cap { pm.SendMessage("You have reached the skill cap, what do you need more skill points for"); return; } else { xmlplayer.SKPoints += m_SKV; } pm.SendMessage("You have been awarded {0} skill points", m_SKV); this.Delete(); } else { pm.SendMessage("This must be in your pack!"); } }
public static string ComputeTitle(Mobile beholder, Mobile beheld) { StringBuilder title = new StringBuilder(); bool showSkillTitle = beheld.ShowFameTitle && ((beholder == beheld) || (beheld.Fame >= 5000)); if (Core.UOR && beheld.ShowFameTitle && beheld is PlayerMobile && ((PlayerMobile)beheld).FameKarmaTitle != null) //UOSI- Core.SA { title.AppendFormat(((PlayerMobile)beheld).FameKarmaTitle, beheld.Name, beheld.Female ? "Lady" : "Lord"); } else if (beheld.ShowFameTitle || (beholder == beheld)) { title.Append(ComputeFameTitle(beheld)); } else { title.Append(beheld.Name); } if (beheld is PlayerMobile && ((PlayerMobile)beheld).DisplayChampionTitle) { PlayerMobile.ChampionTitleInfo info = ((PlayerMobile)beheld).ChampionTitles; if (Core.UOR) //UOSI- Core.SA { if (((PlayerMobile)beheld).CurrentChampTitle != null) { title.AppendFormat(((PlayerMobile)beheld).CurrentChampTitle); } } else if (info.Harrower > 0) { title.AppendFormat(": {0} of Evil", HarrowerTitles[Math.Min(HarrowerTitles.Length, info.Harrower) - 1]); } else { int highestValue = 0, highestType = 0; for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v > highestValue) { highestValue = v; highestType = i; } } int offset = 0; if (highestValue > 800) { offset = 3; } else if (highestValue > 300) { offset = (int)(highestValue / 300); } if (offset > 0) { ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)highestType); title.AppendFormat(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } } string customTitle = beheld.Title; if (Core.UOR) //UOSI- Core.SA { #region Level System PlayerMobile pm = beheld as PlayerMobile; XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); Configured c = new Configured(); if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null) { if (c.PaperdollLevel) { string d = LevelCore.Display(pm, new Configured()); title.Append(" - Level " + d + ", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); } else { title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); } } else if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle == null) { string d = LevelCore.Display(pm, new Configured()); if (c.PaperdollLevel) { if (pm.AccessLevel > AccessLevel.Player && c.StaffHasLevel) { title.Append(" - Level " + d); } else { if (pm.AccessLevel < AccessLevel.GameMaster) { title.Append(" - Level " + d); } } } } else if (beheld is BaseVendor) { title.AppendFormat(" {0}", customTitle); } /* * if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null) * title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); * else if (beheld is BaseVendor) * title.AppendFormat(" {0}", customTitle); */ #endregion } else if (customTitle != null && (customTitle = customTitle.Trim()).Length > 0) { title.AppendFormat(" {0}", customTitle); } else if (showSkillTitle && beheld.Player) { string skillTitle = GetSkillTitle(beheld); if (skillTitle != null) { title.Append(", ").Append(skillTitle); } } return(title.ToString()); }
public static bool DoGainSkillExp(Mobile from, Skill skill, SkillName skillname) { ConfiguredSkillsEXP css = new ConfiguredSkillsEXP(); Configured c = new Configured(); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); if (xmlplayer == null) { return(false); } if (css.EnableEXPFromSkills == false) { return(false); } if (skill == from.Skills.Provocation && css.ProvocationGain) { int gain = (int)css.ProvocationGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Peacemaking && css.PeacemakingGain) { int gain = (int)css.PeacemakingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Discordance && css.DiscordanceGain) { int gain = (int)css.DiscordanceGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Stealing && css.StealingGain) { int gain = (int)css.StealingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.RemoveTrap && css.RemoveTrapGain) { int gain = (int)css.RemoveTrapGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Poisoning && css.PoisoningGain) { int gain = (int)css.PoisoningGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.DetectHidden && css.DetectHiddenGain) { int gain = (int)css.DetectHiddenGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Tracking && css.TrackingGain) { int gain = (int)css.TrackingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Herding && css.HerdingGain) { int gain = (int)css.HerdingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.AnimalTaming && css.AnimalTamingGain) { int gain = (int)css.AnimalTamingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.AnimalLore && css.AnimalLoreGain) { int gain = (int)css.AnimalLoreGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.SpiritSpeak && css.SpiritSpeakGain) { int gain = (int)css.SpiritSpeakGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Meditation && css.MeditationGain) { int gain = (int)css.MeditationGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.EvalInt && css.EvalIntGain) { int gain = (int)css.EvalIntGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Imbuing && css.ImbuingGain) { int gain = (int)css.ImbuingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Tinkering && css.TinkeringGain) { int gain = (int)css.TinkeringGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Tailoring && css.TailoringGain) { int gain = (int)css.TailoringGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Inscribe && css.InscribeGain) { int gain = (int)css.InscribeGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Cooking && css.CookingGain) { int gain = (int)css.CookingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Carpentry && css.CarpentryGain) { int gain = (int)css.CarpentryGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Blacksmith && css.BlacksmithGain) { int gain = (int)css.BlacksmithGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Fletching && css.FletchingGain) { int gain = (int)css.FletchingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Alchemy && css.AlchemyGain) { int gain = (int)css.AlchemyGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Anatomy && css.AnatomyGain) { int gain = (int)css.AnatomyGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.TasteID && css.TasteIDGain) { int gain = (int)css.TasteIDGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.ItemID && css.ItemIDGain) { int gain = (int)css.ItemIDGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Forensics && css.ForensicsGain) { int gain = (int)css.ForensicsGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Cartography && css.CartographyGain) { int gain = (int)css.CartographyGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Camping && css.CampingGain) { int gain = (int)css.CampingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Begging && css.BeggingGain) { int gain = (int)css.BeggingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.ArmsLore && css.ArmsLoreGain) { int gain = (int)css.ArmsLoreGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Fishing && css.FishingGain) { int gain = (int)css.FishingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } if (skill == from.Skills.Hiding && css.HidingGain) { int gain = (int)css.HidingGainAmount; xmlplayer.kxp += gain; from.SendMessage("You have gained " + (gain) + " exp from using {0}!", skillname); if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { LevelHandler.DoLevel(from, new Configured()); } } return(true); }
public static void AddExp(Mobile m, Mobile k, Party p, Configured c) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); ExpPowerHour exppower = (ExpPowerHour)XmlAttach.FindAttachment(m, typeof(ExpPowerHour)); PlayerMobile pm = null; LevelHandler lh = new LevelHandler(); int range = c.PartyRange; double orig = 0; //Monster Xp double fig = 0; //Party Xp double give = 0; //Xp To Give if (k != null) { orig = LevelCore.Base(k); } if (p != null && c.PartyExpShare) { if (c.PartySplitExp) { foreach (PartyMemberInfo mi in p.Members) { pm = mi.Mobile as PlayerMobile; if (pm.InRange(k, range) && lh.MemberCount.Count < 6) { lh.MemberCount.Add(pm); } } if (lh.MemberCount.Count > 1) { fig = (orig / lh.MemberCount.Count); } } else { pm = m as PlayerMobile; fig = orig; } } else { pm = m as PlayerMobile; fig = orig; } if (fig > 0) { give = LevelHandler.ExpFilter(pm, fig, p, false); } if (give > 0) { #region PartyExpShare if (p != null && c.PartyExpShare) { foreach (PartyMemberInfo mi in p.Members) { pm = mi.Mobile as PlayerMobile; if (pm.Alive && pm.InRange(k, range)) { XMLPlayerLevelAtt xmlplayerparty = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); ExpPowerHour exppowerparty = (ExpPowerHour)XmlAttach.FindAttachment(pm, typeof(ExpPowerHour)); if (xmlplayerparty == null) { return; } else { if (exppowerparty != null) { pm.SendMessage("You gained " + (give + c.ExpPowerAmount) + " boosted exp for the party kill!"); xmlplayerparty.kxp += (int)give + c.ExpPowerAmount; if (pm.HasGump(typeof(ExpBar))) { pm.CloseGump(typeof(ExpBar)); pm.SendGump(new ExpBar(pm)); } if (xmlplayerparty.Expp >= xmlplayerparty.ToLevell && xmlplayerparty.Levell < xmlplayerparty.MaxLevel) { DoLevel(pm, new Configured()); } } else { pm.SendMessage("You gained " + give + " exp for the party kill!"); xmlplayerparty.kxp += (int)give; if (pm.HasGump(typeof(ExpBar))) { pm.CloseGump(typeof(ExpBar)); pm.SendGump(new ExpBar(pm)); } if (xmlplayerparty.Expp >= xmlplayerparty.ToLevell && xmlplayerparty.Levell < xmlplayerparty.MaxLevel) { DoLevel(pm, new Configured()); } } } } } } #endregion else { if (exppower != null) { pm.SendMessage("You gained " + (give + c.ExpPowerAmount) + " boosted exp for the kill!"); xmlplayer.kxp += (int)give + c.ExpPowerAmount; } else { pm.SendMessage("You gained " + give + " exp for the kill!"); xmlplayer.kxp += (int)give; } if (pm.HasGump(typeof(ExpBar))) { pm.CloseGump(typeof(ExpBar)); pm.SendGump(new ExpBar(pm)); } if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel) { DoLevel(pm, new Configured()); } } } }