Aller au contenu

Photo

Warlock


  • Veuillez vous connecter pour répondre
19 réponses à ce sujet

#1
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
Hello! I'm trying to script warlocks for my module. What I wanted to do was just use the bard class, as warlock. Just as the server Arelith does. I am not sure how to script the eldritch abilities though. Heres what I know...

The warlock powers come off a item that the warlock is given when choosing a pact. They are then able to shoot beams out of the staff from casting the spell Ray of Frost from the staff. What I need to know is how I get the Ray of Frost to behave like warlock eldritch rays, doing the 1d6 more damage on odd levels.

Eventually I would like to have it like Arelith has, on a certain level get a chain beam where you can hit multiple enemies with one blast. Thanks!

#2
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
I've figured out some of this. I was able to script for when warlock's level up they get the spells. (discplacement, ray of frost, etc.) But now I just need to have it so when they use the warlock ray of frost from the staff, it will do the damage (1d6/2 levels from level 1) and that only ray of frost from warlock staffs will do it. Along with the nice beam vfx instead of the cold one.

#3
Alex Warren

Alex Warren
  • Members
  • 179 messages
You need to edit nw_s0_rayfrost.nss script. Example here:
http://pastebin.com/QqT3frRw
When you compile the script and cast ray of frost from item with "warlock_staff" tag it will trigger "eldritch blast". It's just a sample - you should tweak it the way you like.

#4
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
Worked fantastic! I tried the same thing with two other scripts and am having some trouble though..


My script for call lightning overriden.. Trying to get it to do d8 damage/2 levels and do fire strike animations on all the enemies, it compiles but just does regular spell.

//::///////////////////////////////////////////////
//:: Call Lightning
//:: NW_S0_CallLghtn.nss
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    This spells smites an area around the caster
    with bolts of lightning which strike all enemies.
    Bolts do 1d10 per level up 10d10
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
  Spellcast Hook Code
  Added 2003-06-20 by Georg
  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
   if(GetTag(GetSpellCastItem()) == "warlock_staff")
    {
      object oCaster = OBJECT_SELF;
    int nCasterLvl = GetCasterLevel(oCaster);
    int nMetaMagic = GetMetaMagicFeat();
    int nDamage = d8(GetLevelByclass(class_TYPE_BARD)/2);
// = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
    float fDelay;
   // effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
    effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
    effect eDam;
    //Get the spell target location as opposed to the spell target.
    location lTarget = GetSpellTargetLocation();
 object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
    //Cycle through the targets within the spell shape until an invalid object is captured.
    while (GetIsObjectValid(oTarget))
    {
        if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
        {
           //Fire cast spell at event for the specified target
            SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CALL_LIGHTNING));
            //Get the distance between the explosion and the target to calculate delay
            fDelay = GetRandomDelay(0.4, 1.75);
            if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
            {
                //Roll damage for each target
                nDamage = d6(nCasterLvl);
                //Resolve metamagic
                if (nMetaMagic == METAMAGIC_MAXIMIZE)
                {

                }
                else if (nMetaMagic == METAMAGIC_EMPOWER)
                {
                   nDamage = nDamage + nDamage / 2;
                }
                //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
                //Set the damage effect
                eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
                if(nDamage > 0)
                {
                    // Apply effects to the currently selected target.
                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
                    //This visual effect is applied to the target object not the location as above.  This visual effect
                    //represents the flame that erupts on the target not on the ground.
                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
                }
             }
        }
       //Select the next target within the spell shape.
       oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
    }
 
 
 
 
 

   }
    //Declare major variables
    object oCaster = OBJECT_SELF;
    int nCasterLvl = GetCasterLevel(oCaster);
    int nMetaMagic = GetMetaMagicFeat();
    int nDamage;
    float fDelay;
    effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
    effect eDam;
    //Get the spell target location as opposed to the spell target.
    location lTarget = GetSpellTargetLocation();
    //Limit Caster level for the purposes of damage
    if (nCasterLvl > 10)
    {
        nCasterLvl = 10;
    }
    //Declare the spell shape, size and the location.  Capture the first target object in the shape.
    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
    //Cycle through the targets within the spell shape until an invalid object is captured.
    while (GetIsObjectValid(oTarget))
    {
        if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
        {
           //Fire cast spell at event for the specified target
            SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CALL_LIGHTNING));
            //Get the distance between the explosion and the target to calculate delay
            fDelay = GetRandomDelay(0.4, 1.75);
            if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
            {
                //Roll damage for each target
                nDamage = d6(nCasterLvl);
                //Resolve metamagic
                if (nMetaMagic == METAMAGIC_MAXIMIZE)
                {
                    nDamage = 6 * nCasterLvl;
                }
                else if (nMetaMagic == METAMAGIC_EMPOWER)
                {
                   nDamage = nDamage + nDamage / 2;
                }
                //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
                nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY);
                //Set the damage effect
                eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
                if(nDamage > 0)
                {
                    // Apply effects to the currently selected target.
                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
                    //This visual effect is applied to the target object not the location as above.  This visual effect
                    //represents the flame that erupts on the target not on the ground.
                    DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
                }
             }
        }
       //Select the next target within the spell shape.
       oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
    }
}





And my summon creature 1 override.. Works as normal spell, but I want it to summon the warlock minion.

//::///////////////////////////////////////////////
//:: Summon Monster I
//:: NW_S0_Summon1
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Summons a dire badger to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12 , 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
    /*
      Spellcast Hook Code
      Added 2003-06-23 by GeorgZ
      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
    int nMetaMagic = GetMetaMagicFeat();
    int nDuration = GetCasterLevel(OBJECT_SELF);
    effect eSummon = EffectSummonCreature("NW_S_badgerdire");
    if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER))
    {
        eSummon = EffectSummonCreature("NW_S_BOARDIRE");
    }
    if(GetTag(GetSpellCastItem()) == "warstaff")
    eSummon = EffectSummonCreature("WARLOCKMIN1");
    {
    effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1);
    //Make metamagic check for extend
    if (nMetaMagic == METAMAGIC_EXTEND)
    {
        nDuration = nDuration *2;   //Duration is +100%
    }
    //Apply the VFX impact and summon effect
    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}
}

#5
Baragg

Baragg
  • Members
  • 271 messages
You said it compiled but still calls the regular spell? Did you compile it under a different name? Did you have the call ingame call the new name?

#6
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
The names are the same.. Though I don't understand your last quesiton. Thanks! :)

#7
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
Still have not been able to get it to work.. Anyone have any thoughts or solutions or whatever?

#8
Alex Warren

Alex Warren
  • Members
  • 179 messages
Could you check if this script works for you?
http://pastebin.com/uZRDtZhr
it's for summon creature I - when cast from item with 'warlock_staff' tag it will summon creature with 'WARLOCKMIN1' resref.

#9
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
Nope, variable defined without type on line 33...

#10
Alex Warren

Alex Warren
  • Members
  • 179 messages
yes, it should be
effect eSummon = EffectSummonCreature("WARLOCKMIN1");
instead of
eSummon = EffectSummonCreature("WARLOCKMIN1");
sorry

#11
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
Thanks! :)

#12
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Kingdom_Of_Hearts wrote...

Nope, variable defined without type on line 33...



Change Line   39 to :

eSummon = EffectSummonCreature("NW_S_badgerdire");


On line 29 add :
effect eSummon;

Modifié par Lightfoot8, 16 juin 2012 - 02:52 .


#13
WhenTheNightComes

WhenTheNightComes
  • Members
  • 27 messages
Not to commit thread necromancy, or anything. But I'm also using this script, and when using it, I have it as..

   #include "NW_I0_SPELLS"
    #include "x2_inc_spellhook"

    void main()
    {

    /*
      Spellcast Hook Code
      Added 2003-06-20 by Georg
      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
        object oTarget = GetSpellTargetObject();
        int nTouch = TouchAttackRanged(oTarget);
        int nAC =GetAC(oTarget);
        if(GetTag(GetSpellCastItem()) == "warlock_staff")
        {

     if (nTouch > nAC )
         {
            int nDam = d8(GetLevelByclass(class_TYPE_SORCERER)/2);
            effect eDam = EffectDamage(nDam, DAMAGE_TYPE_NEGATIVE);
            effect eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGBLUE), oTarget);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
            return;
        }
        }
        //Declare major variables
        int nMetaMagic = GetMetaMagicFeat();
        int nCasterLevel = GetCasterLevel(OBJECT_SELF);
        int nDam = d4(1) + 1;
        effect eDam;
        effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
        effect eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND);

        if(!GetIsReactionTypeFriendly(oTarget))
        {
            //Fire cast spell at event for the specified target
            SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_FROST));
            eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND);
            //Make SR Check
            if(!MyResistSpell(OBJECT_SELF, oTarget))
            {
                //Enter Metamagic conditions
                if (nMetaMagic == METAMAGIC_MAXIMIZE)
                {
                    nDam = 5 ;//Damage is at max
                }
                else if (nMetaMagic == METAMAGIC_EMPOWER)
                {
                    nDam = nDam + nDam/2; //Damage/Healing is +50%
                }
                //Set damage effect
                eDam = EffectDamage(nDam, DAMAGE_TYPE_COLD);
                //Apply the VFX impact and damage effect
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
            }
        }
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
    }


Problem is, it's hitting all the time no matter what. I'm trying to get the beam only hit on ranged touch attacks. Help please?

Modifié par WhenTheNightComes, 14 mars 2013 - 09:12 .


#14
ffbj

ffbj
  • Members
  • 593 messages
What is the ranged touch and ac of the target?
What is the value of: 
int nTouch = TouchAttackRanged(oTarget);
?

you could add the true parameter and see if you get any feedback:
// The caller will perform a Ranged Touch Attack on oTarget
// * Returns 0 on a miss, 1 on a hit and 2 on a critical hit
int TouchAttackRanged(object oTarget, int bDisplayFeedback=TRUE)

Modifié par ffbj, 15 mars 2013 - 04:37 .


#15
WhenTheNightComes

WhenTheNightComes
  • Members
  • 27 messages
Still didn't work, and somehow the beam has switched to the original ray of frost. Help, anyone?

#16
Shadooow

Shadooow
  • Members
  • 4 470 messages

WhenTheNightComes wrote...

Still didn't work, and somehow the beam has switched to the original ray of frost. Help, anyone?

thats not a surprise, the script you posted should always work like that, you made an error somwhere switched the old script for this i guess, but try this:

#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"

void main()
{
    /*
      Spellcast Hook Code
      Added 2003-06-20 by Georg
      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
    object oTarget = GetSpellTargetObject();
    if(GetTag(GetSpellCastItem()) == "warlock_staff")
    {
        int nTouch = TouchAttackRanged(oTarget);
        if (nTouch > 0)
        {
            int nDam = d8(GetLevelByclass(class_TYPE_SORCERER)/2*nTouch);
            effect eDam = EffectDamage(nDam, DAMAGE_TYPE_NEGATIVE);
            effect eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGBLUE), oTarget);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);      
        }
    return;
    }
    //Declare major variables
    int nMetaMagic = GetMetaMagicFeat();
    int nCasterLevel = GetCasterLevel(OBJECT_SELF);
    int nDam = d4(1) + 1;
    effect eDam;
    effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
    effect eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND);
    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //Fire cast spell at event for the specified target
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_FROST));
        eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND);
        //Make SR Check
        if(!MyResistSpell(OBJECT_SELF, oTarget))
        {
            //Enter Metamagic conditions
            if (nMetaMagic == METAMAGIC_MAXIMIZE)
            {
                nDam = 5 ;//Damage is at max
            }
            else if (nMetaMagic == METAMAGIC_EMPOWER)
            {
                nDam = nDam + nDam/2; //Damage/Healing is +50%
            }
            //Set damage effect
            eDam = EffectDamage(nDam, DAMAGE_TYPE_COLD);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
        }
    }
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
}

This should work + I added critical hit damage calculation into beam damage

#17
WhenTheNightComes

WhenTheNightComes
  • Members
  • 27 messages
Seems to be automatically hitting, successfully getting the ranged touch attack every time. Even though, the roll is nowhere near the AC of the creature it's attacking.

#18
Shadooow

Shadooow
  • Members
  • 4 470 messages

WhenTheNightComes wrote...

Seems to be automatically hitting, successfully getting the ranged touch attack every time. Even though, the roll is nowhere near the AC of the creature it's attacking.

the rolls is performed against touch AC which doesnt take into account many sources so its much lower, it is a same roll that you can find in harm spell etc.

#19
WhenTheNightComes

WhenTheNightComes
  • Members
  • 27 messages
I've got the creatures natural AC. How would I increase this then, to test for sure that this works?

#20
Shadooow

Shadooow
  • Members
  • 4 470 messages
For more details see NWNWiki to lear how touch attacks works, I believe that Warlock's Eldritch blast uses ranged touch attack normally in PnP, thats why it is so powerful and popular.

In brief, increase dexterity score, dodge AC (boots, haste) or deflection AC (cloak, ring, etc.)