private void GainFromDealtDamage(SuffixStaticData p_suffix) { Int32 suffixLevel = m_equipment.SuffixLevel; Single valueForLevel = p_suffix.GetValueForLevel(suffixLevel, m_equipment.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND); Single num = m_attackResult.DamageDone; EnchantmentEffectEventArgs suffixEffectEntry; if (p_suffix.Effect == ESuffixEffect.GAIN_HP_PERCENTAGE_FROM_DEALT_DAMAGE) { Int32 num2 = Math.Max(1, (Int32)Math.Round(num * valueForLevel, MidpointRounding.AwayFromZero)); m_character.ChangeHP(num2); suffixEffectEntry = new EnchantmentEffectEventArgs(p_suffix, num2); DamageEventArgs p_eventArgs = new DamageEventArgs(new AttackResult { Result = EResultType.HEAL, DamageResults = { new DamageResult(EDamageType.HEAL, num2, 0, 1f) } }); LegacyLogic.Instance.EventManager.InvokeEvent(m_character, EEventType.CHARACTER_HEALS, p_eventArgs); } else { Int32 num3 = Math.Max(1, (Int32)Math.Round(num * valueForLevel, MidpointRounding.AwayFromZero)); m_character.ChangeMP(num3); suffixEffectEntry = new EnchantmentEffectEventArgs(p_suffix, num3); } m_character.FightHandler.FeedActionLog(suffixEffectEntry); }
private void TargetDealMagicDamageOnTile(SuffixStaticData p_suffix) { Int32 suffixLevel = m_equipment.SuffixLevel; Int32 damageValue = (Int32)Math.Round(p_suffix.GetValueForLevel(suffixLevel, m_equipment.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND), MidpointRounding.AwayFromZero); EnchantmentEffectEventArgs suffixEffectEntry = new EnchantmentEffectEventArgs(p_suffix); m_character.FightHandler.FeedActionLog(suffixEffectEntry); m_character.FightHandler.AttackAllMonstersOnTargetsTile(m_target, damageValue, p_suffix.MagicSchool, m_counterAttack); }
private void AfflictDebuff(Monster p_target, EMonsterBuffType p_buff, SuffixStaticData p_suffix, Boolean p_buffEndDelayed) { if (p_suffix.MagicSchool != EDamageType.NONE && p_target.CombatHandler.TestEvadeSpell(p_suffix.MagicSchool, 0)) { return; } MonsterBuff monsterBuff = BuffFactory.CreateMonsterBuff(p_buff, p_suffix.GetValueForLevel(m_equipment.SuffixLevel, m_equipment.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND)); monsterBuff.Causer = m_character; monsterBuff.DontTriggerOnFirstDamage = true; if (p_buffEndDelayed) { monsterBuff.Duration++; } p_target.AddBuff(monsterBuff); LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.ITEM_SUFFIX_APPLY_BUFF, new ItemSuffixApplyBuffEventArgs(p_target, p_suffix.Description, p_buff)); MonsterBuffEntryEventArgs item = new MonsterBuffEntryEventArgs(p_target, monsterBuff, p_target.BuffHandler.HasBuff(monsterBuff)); m_logEntries.Add(item); }