public override void OnEndSpellCast(SpellPacketBody spell)
    {
        Logger.Info("Tensers Transformation OnEndSpellCast");
        Co8.destroy_spell_obj_with_flag(spell.caster, 6400, Co8SpellFlag.TensersTransformation);
        var item_wielded = spell.caster.ItemWornAt(EquipSlot.WeaponPrimary);

        if ((item_wielded != null))
        {
            if ((item_wielded.GetNameId() == spell.dc) && (Co8.is_spell_flag_set(item_wielded, Co8SpellFlag.TensersTransformation)))
            {
                var new_weapon = GameSystems.MapObject.CreateObject(spell.dc, spell.caster.GetLocation());
                item_wielded.SetInt(obj_f.weapon_type, new_weapon.GetInt(obj_f.weapon_type));
                Co8.unset_spell_flag(item_wielded, Co8SpellFlag.TensersTransformation);
                item_wielded.ClearItemFlag(ItemFlag.NO_DROP);
                new_weapon.Destroy();
            }
        }
        else
        {
            if (spell.dc != 0)
            {
                var weapon = Co8.find_spell_obj_with_flag(spell.caster, spell.dc, Co8SpellFlag.TensersTransformation);
                if (weapon != null) // this shouldn't ever happen but better check
                {
                    var new_weapon = GameSystems.MapObject.CreateObject(spell.dc, spell.caster.GetLocation());
                    weapon.SetInt(obj_f.weapon_type, new_weapon.GetInt(obj_f.weapon_type));
                    Co8.unset_spell_flag(weapon, Co8SpellFlag.TensersTransformation);
                    weapon.ClearItemFlag(ItemFlag.NO_DROP);
                    new_weapon.Destroy();
                }
            }
        }
    }
Example #2
0
 public static bool check_for_tensers(GameObject target)
 {
     if (Co8.find_spell_obj_with_flag(target, 6400, Co8SpellFlag.TensersTransformation) != null)
     {
         Co8.destroy_spell_obj_with_flag(target, 6400, Co8SpellFlag.TensersTransformation);
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public override void OnEndSpellCast(SpellPacketBody spell)
 {
     Logger.Info("Death Ward OnEndSpellCast");
     Co8.destroy_spell_obj_with_flag(spell.caster, SPELL_OBJ, Co8SpellFlag.DeathWard);
 }
Example #4
0
 public override void OnEndSpellCast(SpellPacketBody spell)
 {
     Logger.Info("Analyze Dweomer OnEndSpellCast");
     Co8.destroy_spell_obj_with_flag(spell.caster, 6400, Co8SpellFlag.AnalyzeDweomer);
 }