public void CreateBuff(ClientBuff buff) { var buffImage = BuffImage(buff.Type); var buffLibrary = Libraries.BuffIcon; if (buffImage >= 20000) { buffImage -= 20000; buffLibrary = Libraries.MagIcon; } if (buffImage >= 10000) { buffImage -= 10000; buffLibrary = Libraries.Prguse2; } var image = new MirImageControl { Library = buffLibrary, Parent = this, Visible = true, Sort = false, Index = buffImage }; _buffList.Insert(0, image); UpdateWindow(); }
private void RefreshBuffs() { TransformType = -1; for (int i = 0; i < GameScene.Scene.BuffsDialog.Buffs.Count; i++) { ClientBuff buff = GameScene.Scene.BuffsDialog.Buffs[i]; Stats.Add(buff.Stats); switch (buff.Type) { case BuffType.SwiftFeet: Sprint = true; break; case BuffType.Transform: if (buff.Paused) { continue; } TransformType = (short)buff.Values[0]; FastRun = true; break; } } }
public void ClientAddBuff(int buffId) { if (!SkillBuffData.dataMap.ContainsKey(buffId)) { return; } SkillBuffData sbd = SkillBuffData.dataMap[buffId]; if (clientBuffs.ContainsKey(buffId)) {//累加时间 clientBuffs[buffId].totalTime += sbd.totalTime; return; } if (sbd.excludeBuff != null) { for (int i = 0; i < sbd.excludeBuff.Count; i++) { if (clientBuffs.ContainsKey(sbd.excludeBuff[i])) { return; } } } if (sbd.replaceBuff != null) { for (int j = 0; j < sbd.replaceBuff.Count; j++) { ClientDelBuff(sbd.replaceBuff[j]); } } if (sbd.activeSkill != null && sbd.activeSkill.Count > 0) { foreach (var item in sbd.activeSkill) { TimerHeap.AddTimer <int>((uint)item.Key, 0, (id) => { m_theOwner.skillManager.BuffUseSkill(id); }, item.Value); } } ClientBuff b = new ClientBuff(sbd); clientBuffs.Add(buffId, b); UpdateState(); }
public string BuffString(ClientBuff buff) { string text = RegexFunctions.SeperateCamelCase(buff.Type.ToString()) + "\n"; bool overridestats = false; switch (buff.Type) { case BuffType.GameMaster: GMOptions options = (GMOptions)buff.Values[0]; if (options.HasFlag(GMOptions.GameMaster)) { text += "-Invisible\n"; } if (options.HasFlag(GMOptions.Superman)) { text += "-Superman\n"; } if (options.HasFlag(GMOptions.Observer)) { text += "-Observer\n"; } break; case BuffType.MentalState: switch (buff.Values[0]) { case 0: text += "Agressive (Full damage)\nCan't shoot over walls.\n"; break; case 1: text += "Trick shot (Minimal damage)\nCan shoot over walls.\n"; break; case 2: text += "Group Mode (Medium damage)\nDon't steal agro.\n"; break; } break; case BuffType.Hiding: case BuffType.ClearRing: text += "Invisible to many monsters.\n"; break; case BuffType.MoonLight: text += "Invisible to players and many\nmonsters when at a distance.\n"; break; case BuffType.EnergyShield: overridestats = true; text += string.Format("{0}% chance to gain {1} HP when attacked.\n", buff.Stats[Stat.EnergyShieldPercent], buff.Stats[Stat.EnergyShieldHPGain]); break; case BuffType.DarkBody: text += "Invisible to many monsters and able to move.\n"; break; case BuffType.VampireShot: text += "Gives you a vampiric ability\nthat can be released with\ncertain skills.\n"; break; case BuffType.PoisonShot: text += "Gives you a poison ability\nthat can be released with\ncertain skills.\n"; break; case BuffType.Concentration: text += "Increases chance on element extraction.\n"; break; case BuffType.MagicBooster: overridestats = true; text = string.Format("Increases MC by: {0}-{1}.\nIncreases consumption by {2}%.\n", buff.Stats[Stat.MinMC], buff.Stats[Stat.MaxMC], buff.Stats[Stat.ManaPenaltyPercent]); break; case BuffType.Transform: text = "Disguises your appearance.\n"; break; case BuffType.Mentee: text = "Learn skill points twice as quick.\n"; break; case BuffType.Guild: text += GameScene.Scene.GuildDialog.ActiveStats; break; } if (!overridestats) { foreach (var val in buff.Stats.Values) { var c = val.Value < 0 ? "Decreases" : "Increases"; var key = val.Key.ToString(); var strKey = RegexFunctions.SeperateCamelCase(key.Replace("Rate", "").Replace("Multiplier", "").Replace("Percent", "")); var sign = ""; if (key.Contains("Percent")) { sign = "%"; } else if (key.Contains("Multiplier")) { sign = "x"; } var txt = $"{c} {strKey} by: {val.Value}{sign}.\n"; text += txt; } } text += buff.Infinite ? GameLanguage.ExpireNever : string.Format(GameLanguage.Expire, Functions.PrintTimeSpanFromSeconds(Math.Round((buff.ExpireTime - CMain.Time) / 1000D))); if (!string.IsNullOrEmpty(buff.Caster)) { text += string.Format("\nCaster: {0}", buff.Caster); } return(text); }
public void ClientAddBuff(int buffId) { if (!SkillBuffData.dataMap.ContainsKey(buffId)) { return; } SkillBuffData sbd = SkillBuffData.dataMap[buffId]; if (clientBuffs.ContainsKey(buffId)) {//累加时间 clientBuffs[buffId].totalTime += sbd.totalTime; return; } if (sbd.excludeBuff != null) { for (int i = 0; i < sbd.excludeBuff.Count; i++) { if (clientBuffs.ContainsKey(sbd.excludeBuff[i])) { return; } } } if (sbd.replaceBuff != null) { for (int j = 0; j < sbd.replaceBuff.Count; j++) { ClientDelBuff(sbd.replaceBuff[j]); } } if (sbd.activeSkill != null && sbd.activeSkill.Count > 0) { foreach (var item in sbd.activeSkill) { TimerHeap.AddTimer<int>((uint)item.Key, 0, (id) => { m_theOwner.skillManager.BuffUseSkill(id); }, item.Value); } } ClientBuff b = new ClientBuff(sbd); clientBuffs.Add(buffId, b); UpdateState(); }