Ability Handler:
- Code: Select all
using System;
using System.Collections.Generic;
using System.Text;
using System;
using System.Collections;
using System.Reflection;
using DOL.GS;
using DOL.GS.PacketHandler;
using DOL.GS.Effects;
using DOL.GS.Scripts;
using DOL.Events;
using DOL.Database;
using DOL.GS.Spells;
using DOL.AI.Brain;
namespace DOL.GS.RealmAbilities
{
public class CalmingNotesAbility : RR5RealmAbility
{
public CalmingNotesAbility(DBAbility dba, int level) : base(dba, level) { }
private GamePlayer player;
public override void Execute(GameLiving living)
{
if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;
GamePlayer player = living as GamePlayer;
if (player == null)
return;
foreach (GameNPC enemy in player.GetNPCsInRadius(700))
{
if (enemy.Realm != player.Realm && enemy.IsAlive && enemy.Brain is IControlledBrain)
{
Spell subspell = SkillBase.GetSpellByID(87303);
ISpellHandler spellhandler = Scripts.ScriptMgr.CreateSpellHandler(player, subspell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells));
spellhandler.StartSpell(enemy);
}
}
DisableSkill(player);
}
public override int GetReUseDelay(int level)
{
return 600;
}
public override void AddEffectsInfo(System.Collections.IList list)
{
list.Add("Insta-cast spell that mesmerizes all enemy pets within 750 radius for 30 seconds.");
list.Add("");
list.Add("Radius: 700");
list.Add("Target: Pet");
list.Add("Duration: 30 sec");
list.Add("Casting time: instant");
}
}
}
- Code: Select all
using System;
using DOL.AI.Brain;
using DOL.GS;
using DOL.GS.PacketHandler;
using DOL.GS.Effects;
using DOL.Events;
namespace DOL.GS.Spells
{
[SpellHandlerAttribute("CalmingNotes")]
public class CalmingNotesSpellHandler : MesmerizeSpellHandler
{
public CalmingNotesSpellHandler(GameLiving caster, Spell spell, SpellLine spellLine) : base(caster, spell, spellLine) { }
public override int CalculateSpellResistChance(GameLiving target)
{
return 0;
}
protected override int CalculateEffectDuration(GameLiving target, double effectiveness)
{
return Spell.Duration;
}
}
}
Bye your Carnifexe