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();
                }
            }
        }
    }
예제 #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);
     }
 }
예제 #3
0
    public override void OnSpellEffect(SpellPacketBody spell)
    {
        Logger.Info("Analyze Dweomer OnSpellEffect");
        var remove_list = new List <GameObject>();

        spell.duration = spell.casterLevel * 10;
        if (spell.Targets.Length == 1 && spell.Targets[0].Object == spell.caster)
        {
        }
        else
        {
            if (spell.caster.GetMoney() >= 150000)
            {
                foreach (var t in spell.Targets)
                {
                    AttachParticles("sp-Identify", t.Object);
                    t.Object.IdentifyAll();
                }
            }
            else
            {
                spell.caster.FloatMesFileLine("mes/spell.mes", 16009);
            }
        }

        foreach (var target_item in spell.Targets)
        {
            remove_list.Add(target_item.Object);
        }

        spell.RemoveTargets(remove_list);
        if (Co8.find_spell_obj_with_flag(spell.caster, 6400, Co8SpellFlag.AnalyzeDweomer) == null)
        {
            var spell_obj = GameSystems.MapObject.CreateObject(6400, spell.caster.GetLocation());
            Co8.set_spell_flag(spell_obj, Co8SpellFlag.AnalyzeDweomer);
            spell_obj.AddConditionToItem("Skill Circumstance Bonus", (int)SkillId.spellcraft, 20);
            spell.caster.GetItem(spell_obj);
            spell.ClearTargets();
            spell.AddTarget(spell.caster);
            spell.caster.AddCondition("sp-Endurance", spell.spellId, spell.duration, 0);
        }
        else
        {
            spell.caster.FloatMesFileLine("mes/spell.mes", 16007);
            spell.EndSpell();
        }
    }
예제 #4
0
    public override void OnSpellEffect(SpellPacketBody spell)
    {
        Logger.Info("Antidote OnSpellEffect");
        spell.duration = 600;
        if (Co8.find_spell_obj_with_flag(spell.caster, 12706, Co8SpellFlag.AnalyzeDweomer) == null)
        {
            var spell_obj = GameSystems.MapObject.CreateObject(12706, spell.caster.GetLocation());
            Co8.set_spell_flag(spell_obj, Co8SpellFlag.AnalyzeDweomer);
            spell_obj.AddConditionToItem("Luck Poison Save Bonus", 5, 0);
            spell.caster.GetItem(spell_obj);
            spell.ClearTargets();
            spell.AddTarget(spell.caster);
            spell.caster.AddCondition("sp-Endurance", spell.spellId, spell.duration, 0);
        }
        else
        {
            spell.caster.FloatMesFileLine("mes/spell.mes", 16007);
        }

        spell.EndSpell();
    }
예제 #5
0
    public override void OnSpellEffect(SpellPacketBody spell)
    {
        Logger.Info("Death Ward OnSpellEffect");
        // Dar's level check no longer needed thanks to Spellslinger's dll fix
        // if spell.caster_class == 13: #added to check for proper paladin slot level (darmagon)
        // if spell.spell_level < 4:
        // spell.caster.float_mesfile_line('mes\\spell.mes', 16008)
        // return
        spell.duration = 10 * spell.casterLevel;
        var npc = spell.caster; // added so NPC's can pre-buff

        if (npc.type != ObjectType.pc && npc.GetLeader() == null && !GameSystems.Combat.IsCombatActive())
        {
            spell.duration = 2000 * spell.casterLevel;
        }

        var target = spell.Targets[0];

        if (Co8.find_spell_obj_with_flag(target.Object, SPELL_OBJ, Co8SpellFlag.DeathWard) == null)
        {
            var spell_obj = GameSystems.MapObject.CreateObject(SPELL_OBJ, target.Object.GetLocation());
            spell_obj.SetItemFlag(ItemFlag.NO_DROP);
            spell_obj.SetItemFlag(ItemFlag.NO_LOOT);
            Co8.set_spell_flag(spell_obj, Co8SpellFlag.DeathWard);
            spell_obj.AddConditionToItem("Monster Energy Immunity", (int)DamageType.NegativeEnergy, 0);
            target.Object.GetItem(spell_obj);
            target.Object.AddCondition("sp-Death Ward", spell.spellId, spell.duration, 0);
            do_particles(target);
            // This is evil, but we need to remember who the spell was
            // cast on, and the target_list gets blown away.
            spell.caster = target.Object;
        }
        else
        {
            target.Object.FloatMesFileLine("mes/spell.mes", 16007);
            AttachParticles("Fizzle", target.Object);
            spell.RemoveTarget(target.Object);
            spell.EndSpell();
        }
    }
    public override void OnSpellEffect(SpellPacketBody spell)
    {
        Logger.Info("Tensers Transformation OnSpellEffect");
        spell.duration = 1 * spell.casterLevel;
        var dam = Dice.Parse("1d1");

        dam      = dam.WithCount(spell.casterLevel);
        spell.dc = 0;
        if (Co8.find_spell_obj_with_flag(spell.caster, 6400, Co8SpellFlag.TensersTransformation) == null)
        {
            var weapon = spell.caster.ItemWornAt(EquipSlot.WeaponPrimary);
            if (weapon != null)
            {
                Co8.set_spell_flag(weapon, Co8SpellFlag.TensersTransformation);
                weapon.SetInt(obj_f.weapon_type, 12);
                weapon.SetItemFlag(ItemFlag.NO_DROP);
                spell.dc = weapon.GetNameId(); // OKAY I am trying to avoid stuff like this but I need a variable, not otherwise used,and unique to this spell that I know will still be alive in OnEndSpellcast
            }

            var spell_obj = GameSystems.MapObject.CreateObject(6400, spell.caster.GetLocation());
            Co8.set_spell_flag(spell_obj, Co8SpellFlag.TensersTransformation);
            spell_obj.AddConditionToItem("sp-Feeblemind", 0, 0, 0); // yeah it works, you can put spell effects on items and they will affect the holder
            spell_obj.AddConditionToItem("Saving Throw Resistance Bonus", 0, 9);
            spell_obj.AddConditionToItem("Saving Throw Resistance Bonus", 1, 4);
            spell_obj.AddConditionToItem("Saving Throw Resistance Bonus", 2, 4);
            spell_obj.AddConditionToItem("Attribute Enhancement Bonus", 0, -2); // divine power gives too much strength bonus
            spell_obj.AddConditionToItem("Attribute Enhancement Bonus", 1, 4);
            spell_obj.AddConditionToItem("Attribute Enhancement Bonus", 2, 4);
            spell_obj.AddConditionToItem("Amulet of Natural Armor", 4, 0);
            spell.caster.GetItem(spell_obj);
            spell.caster.AddCondition("sp-Divine Power", spell.spellId, spell.duration, 0); // to make base attack bonus equal caster level did not put on item in order that a spell marker would appear on casters icon
            spell.caster.Damage(null, DamageType.Force, dam, D20AttackPower.NORMAL);
        }
        else
        {
            spell.caster.FloatMesFileLine("mes/spell.mes", 16007);
            spell.EndSpell();
        }
    }