/// <summary> /// Song of weakness. /// </summary> /// <param name="ch"></param> /// <param name="spell"></param> /// <param name="level"></param> /// <param name="target"></param> /// <returns></returns> public static bool SongWeakling(CharData ch, Spell spell, int level, Target target) { Affect af = new Affect(); foreach (CharData victim in ch.InRoom.People) { if (victim.IsAffected(Affect.AFFECT_STRENGTH_REDUCED) || Magic.SpellSavingThrow(level, victim, AttackType.DamageType.black_magic)) { continue; } af.Type = Affect.AffectType.song; af.Value = spell.Name; af.Duration = level / 7; af.AddModifier(Affect.Apply.strength, -(level / 2)); af.SetBitvector(Affect.AFFECT_STRENGTH_REDUCED); if (level > 25) { af.AddModifier(Affect.Apply.damroll, 0 - (level / 7)); } victim.AddAffect(af); SocketConnection.Act("$n&n looks weaker.", victim, null, null, SocketConnection.MessageTarget.room); victim.SendText("You feel weaker.\r\n"); } return(true); }
/// <summary> /// Song of nightmares. /// </summary> /// <param name="ch"></param> /// <param name="spell"></param> /// <param name="level"></param> /// <param name="target"></param> /// <returns></returns> public static bool SongNightmares(CharData ch, Spell spell, int level, Target target) { Affect af = new Affect(); foreach (CharData victim in ch.InRoom.People) { if (victim.IsAffected(Affect.AFFECT_FEAR) || Magic.SpellSavingThrow(level, victim, AttackType.DamageType.black_magic)) { ch.SendText("You have failed.\r\n"); ch.SendText("You resist the urge to panic.\r\n"); continue; } af.Type = Affect.AffectType.song; af.Value = spell.Name; af.Duration = 1 + (level / 7); af.SetBitvector(Affect.AFFECT_FEAR); victim.AddAffect(af); SocketConnection.Act("$N&n is scared!", ch, null, victim, SocketConnection.MessageTarget.character); victim.SendText("You are scared!\r\n"); SocketConnection.Act("$N&n is scared!", ch, null, victim, SocketConnection.MessageTarget.everyone_but_victim); CommandType.Interpret(victim, "flee"); if (victim.IsNPC()) { Combat.StartFearing(victim, ch); } } return(true); }
/// <summary> /// Song of idiocy. /// </summary> /// <param name="ch"></param> /// <param name="spell"></param> /// <param name="level"></param> /// <param name="target"></param> /// <returns></returns> public static bool SongIdiocy(CharData ch, Spell spell, int level, Target target) { Affect af = new Affect(); foreach (CharData victim in ch.InRoom.People) { if (victim.IsAffected(Affect.AFFECT_FEEBLEMIND) || Magic.SpellSavingThrow(level, victim, AttackType.DamageType.black_magic)) { ch.SendText("You failed!\r\n"); continue; } af.Type = Affect.AffectType.song; af.Value = spell.Name; af.Duration = level / 9; af.AddModifier(Affect.Apply.intelligence, 0 - (level + 15)); af.SetBitvector(Affect.AFFECT_FEEBLEMIND); victim.AddAffect(af); SocketConnection.Act("A dumb look crosses $n&n's face and $e starts to drool.", victim, null, null, SocketConnection.MessageTarget.room); victim.SendText("You feel _REALLY_ dumb.\r\n"); } return(true); }
/// <summary> /// Song of warding, protective. /// </summary> /// <param name="ch"></param> /// <param name="spell"></param> /// <param name="level"></param> /// <param name="target"></param> /// <returns></returns> public static bool SongWarding(CharData ch, Spell spell, int level, Target target) { Affect af = new Affect(); foreach (CharData victim in ch.InRoom.People) { af.Type = Affect.AffectType.song; af.Value = spell.Name; af.Duration = level / 7; af.AddModifier(Affect.Apply.save_spell, 0 - ((level / 5) + 1)); af.AddModifier(Affect.Apply.save_paralysis, 0 - ((level / 5) + 1)); af.AddModifier(Affect.Apply.save_petrification, 0 - ((level / 5) + 1)); af.AddModifier(Affect.Apply.save_poison, 0 - ((level / 5) + 1)); af.AddModifier(Affect.Apply.save_breath, 0 - ((level / 5) + 1)); af.SetBitvector(Affect.AFFECT_NONE); victim.AddAffect(af); } return(true); }
/// <summary> /// Song of obscrurement. /// </summary> /// <param name="ch"></param> /// <param name="spell"></param> /// <param name="level"></param> /// <param name="target"></param> /// <returns></returns> public static bool SongObscurement(CharData ch, Spell spell, int level, Target target) { Affect af = new Affect(); foreach (CharData victim in ch.InRoom.People) { if (victim.IsAffected(Affect.AFFECT_MINOR_INVIS) || victim.IsAffected(Affect.AFFECT_INVISIBLE)) { return(true); } SocketConnection.Act("$n&n fades out of existence.", ch, null, null, SocketConnection.MessageTarget.room); ch.SendText("You vanish.\r\n"); af.Type = Affect.AffectType.song; af.Value = spell.Name; af.Duration = level / 6; af.SetBitvector(Affect.AFFECT_MINOR_INVIS); victim.AddAffect(af); } return(true); }
/// <summary> /// Song of slowness. /// </summary> /// <param name="ch"></param> /// <param name="spell"></param> /// <param name="level"></param> /// <param name="target"></param> /// <returns></returns> public static bool SongSlowness(CharData ch, Spell spell, int level, Target target) { Affect af = new Affect(); foreach (CharData victim in ch.InRoom.People) { if (Magic.SpellSavingThrow(level, victim, AttackType.DamageType.magic_other)) { ch.SendText("You failed!\r\n"); continue; } // Removes haste, takes two castings to make a hasted person slowed if (victim.IsAffected(Affect.AFFECT_HASTE)) { victim.RemoveAffect(Affect.AFFECT_HASTE); victim.SendText("You slow to your normal speed.\r\n"); continue; } if (victim.IsAffected(Affect.AFFECT_SLOWNESS)) { continue; } af.Type = Affect.AffectType.song; af.Value = spell.Name; af.Duration = 6; af.SetBitvector(Affect.AFFECT_SLOWNESS); victim.AddAffect(af); SocketConnection.Act("&+R$n&+R moves much more slowly.&n", victim, null, null, SocketConnection.MessageTarget.room); victim.SendText("&+RYou feel yourself slowing down.&n\r\n"); } return(true); }