Page 5 of 5

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Tue Feb 02, 2016 5:04 pm
by tarashon
Fixed and also the visual effects should now be added using Assasin- and Blackguard weapon powers. Needs testing still though.

Thanks for the help creating the scripts Rose :)

/tara

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Tue Feb 02, 2016 9:48 pm
by Li'l Rose
You are welcome. :D

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Tue Feb 02, 2016 10:31 pm
by Li'l Rose
Well, I have tested both the weapon power visual effects, and dispel on rest. The dispel on rest works fine. The weapon visual effect still does not work at all.

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Tue Feb 02, 2016 11:25 pm
by tarashon
Grr...

I'll look at it ( again ) tomorrow...

/tara

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Wed Feb 03, 2016 11:38 pm
by tarashon
Have posted the script ( blackguard weapon ) on DM scripter channel to see if Seeker can fix it...

/tara

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Thu Feb 04, 2016 7:46 pm
by tarashon
According to Seeker there is actually nothing adding visual to the actual weapons but merely to the owner, which wont show then.

I've tried another approach so lest see if it works now...

/tara

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Sat Feb 06, 2016 9:22 pm
by Li'l Rose
Try this for keen spell. I made it from the weapon damage spells.

Code: Select all

//::///////////////////////////////////////////////
//:: Keen
//:: X2_S0_keenedge
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
 Gives a melee weapon keen property.
*/
//:://////////////////////////////////////////////
//:: Created By: Rose
//:: Created On: Feb 6, 2016
//:://////////////////////////////////////////////


#include "nw_i0_spells"
#include "x2_i0_spells"

#include "x2_inc_spellhook"


void AddFlamingEffectToWeapon( object oTarget, float fDuration, int nCasterLvl)
{
    IPSafeAddItemProperty(oTarget, ItemPropertyKeen(), fDuration, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
}


void main()
{

 /*
 Spellcast Hook Code
 Added 2003-07-07 by Georg Zoeller
 If you want to make changes to all spells,
 check x2_inc_spellhook.nss to find out more

 */
 if (!X2PreSpellCastCode())
 {
     // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
     return;
 }
 // End of Spell Cast Hook


 //Declare major variables
 effect eVis = EffectVisualEffect(VFX_IMP_PULSE_FIRE);
 effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
 int nDuration = 2 * GetCasterLevel(OBJECT_SELF);
 int nMetaMagic = GetMetaMagicFeat();
 int nCasterLvl = GetCasterLevel(OBJECT_SELF);

 //Limit nCasterLvl to 20, so it max out at +10 to the damage.
 if(nCasterLvl > 20)
 {
     nCasterLvl = 20;
 }

 if (nMetaMagic == METAMAGIC_EXTEND)
 {
     nDuration = nDuration * 2; //Duration is +100%
 }

 object oTarget = GetSpellTargetObject();
 if(GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
 {
    // Alter the right hand weapon equipped by the creature.
    object oWeapon1 = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
    if(GetIsObjectValid(oWeapon1))
    {
        // If the PC has a melee weapon equipped.
        if ( IPGetIsMeleeWeapon(oWeapon1))
        {
            SignalEvent(oWeapon1, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));

            if (nDuration>0)
            {
                // haaaack: store caster level on item for the on hit spell to work properly
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon1));
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon1), TurnsToSeconds(nDuration));
                AddFlamingEffectToWeapon(oWeapon1, TurnsToSeconds(nDuration),nCasterLvl);
            }
        }
        else
        {
            FloatingTextStrRefOnCreature(83615, OBJECT_SELF);
        }
    }
    // Alter the left hand weapon equipped by the creature.
    object oWeapon2 = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget);
    if(GetIsObjectValid(oWeapon2))
    {
        // If the PC has a melee weapon equipped.
        if ( IPGetIsMeleeWeapon(oWeapon2))
        {
            SignalEvent(oWeapon2, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));

            if (nDuration>0)
            {
                // haaaack: store caster level on item for the on hit spell to work properly
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon2));
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon2), TurnsToSeconds(nDuration));
                AddFlamingEffectToWeapon(oWeapon2, TurnsToSeconds(nDuration),nCasterLvl);
            }
        }
        else
        {
            FloatingTextStrRefOnCreature(83615, OBJECT_SELF);
        }
    }
    // Alter the right claw equipped by the creature.
    object oWeapon3 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget);
    if(GetIsObjectValid(oWeapon3))
    {
        SignalEvent(oWeapon3, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));

        if (nDuration>0)
        {
            // haaaack: store caster level on item for the on hit spell to work properly
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon3));
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon3), TurnsToSeconds(nDuration));
            AddFlamingEffectToWeapon(oWeapon3, TurnsToSeconds(nDuration),nCasterLvl);
        }
    }
    // Alter the left claw equipped by the creature.
    object oWeapon4 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget);
    if(GetIsObjectValid(oWeapon4))
    {
        SignalEvent(oWeapon4, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));

        if (nDuration>0)
        {
            // haaaack: store caster level on item for the on hit spell to work properly
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon4));
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon4), TurnsToSeconds(nDuration));
            AddFlamingEffectToWeapon(oWeapon4, TurnsToSeconds(nDuration),nCasterLvl);
        }
    }
    // Alter the bite equipped by the creature.
    object oWeapon5 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget);
    if(GetIsObjectValid(oWeapon5))
    {
        SignalEvent(oWeapon5, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));

        if (nDuration>0)
        {
            // haaaack: store caster level on item for the on hit spell to work properly
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon5));
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon5), TurnsToSeconds(nDuration));
            AddFlamingEffectToWeapon(oWeapon5, TurnsToSeconds(nDuration),nCasterLvl);
        }
    }
    }
    else
    {
        SendMessageToPC(OBJECT_SELF, "You must target a creature!");
        return;
    }
}

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Sat Feb 06, 2016 9:24 pm
by tarashon
basically override keen spell script with this ?

/tara

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Mon Feb 15, 2016 7:07 pm
by Li'l Rose
Seems that the weapon damage spell visual effects for assassins does work, so perhaps can do the same for blackguards.

Re: Spells to fix for Rose, so they target both wielded weapons.

Posted: Mon Feb 15, 2016 7:11 pm
by tarashon
Hmm i did the same for both spells so really strange its not working for Blackguard. My best bet is it has to do with the excact visual type being "EVIL", as their is no "NEGATIVE", visual effect.

( if i recall it right )

/tara