/// <summary> /// Allow a NPC to manipulate the door /// </summary> /// <param name="npc"></param> /// <param name="open"></param> public virtual void NPCManipulateDoorRequest(GameNPC npc, bool open) { npc.TurnTo(this.X, this.Y); if (open && m_state != eDoorState.Open) this.Open(); else if (!open && m_state != eDoorState.Closed) this.Close(); }
/// <summary> /// Method to launch a spell /// </summary> /// <param name="spellLevel">The spell level</param> /// <param name="spellLineName">The spell line</param> /// <param name="guard">The guard caster</param> public static void LaunchSpell(int spellLevel, string spellLineName, GameNPC caster) { if (caster.TargetObject == null) return; Spell castSpell = null; SpellLine castLine = null; castLine = SkillBase.GetSpellLine(spellLineName); List<Spell> spells = SkillBase.GetSpellList(castLine.KeyName); foreach (Spell spell in spells) { if (spell.Level == spellLevel) { castSpell = spell; break; } } if (caster.AttackState) caster.StopAttack(); if (caster.IsMoving) caster.StopFollowing(); caster.TurnTo(caster.TargetObject); caster.CastSpell(castSpell, castLine); }