Warlock
#1
Posté 11 juin 2012 - 12:11
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
Posté 12 juin 2012 - 02:29
#3
Posté 12 juin 2012 - 06:34
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
Posté 13 juin 2012 - 03:05
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
Posté 13 juin 2012 - 11:22
#6
Posté 13 juin 2012 - 01:48
#7
Posté 14 juin 2012 - 01:49
#8
Posté 14 juin 2012 - 03:55
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
Posté 14 juin 2012 - 08:55
#10
Posté 15 juin 2012 - 03:47
effect eSummon = EffectSummonCreature("WARLOCKMIN1");
instead of
eSummon = EffectSummonCreature("WARLOCKMIN1");
sorry
#11
Posté 16 juin 2012 - 01:06
#12
Posté 16 juin 2012 - 02:52
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
Posté 14 mars 2013 - 09:02
#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
Posté 15 mars 2013 - 04:03
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
Posté 15 mars 2013 - 02:06
#16
Posté 15 mars 2013 - 02:25
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:WhenTheNightComes wrote...
Still didn't work, and somehow the beam has switched to the original ray of frost. Help, anyone?
This should work + I added critical hit damage calculation into beam damage#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);
}
#17
Posté 15 mars 2013 - 03:35
#18
Posté 15 mars 2013 - 07:44
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.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.
#19
Posté 15 mars 2013 - 08:05
#20
Posté 15 mars 2013 - 08:40
In brief, increase dexterity score, dodge AC (boots, haste) or deflection AC (cloak, ring, etc.)





Retour en haut






