I have a couple spells using this setup but they don't work. Am I scripting it wrong or do these effect flags affect the PC only?
[dascript]
case ABILITY_SPELL_SILENCE:
{
// remove stacking effects
RemoveStackingEffects(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility);
if (ResistanceCheck(stEvent.oCaster, stEvent.oTarget, PROPERTY_ATTRIBUTE_SPELLPOWER, RESISTANCE_PHYSICAL) == FALSE)
{
//Silence effect
eEffect = SetEffectFlags(eEffect, EFFECT_FLAG_DISABLE_SPELLS);
eEffect = SetEffectFlags(eEffect, EFFECT_FLAG_DISABLE_TALENTS);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eEffect, stEvent.oTarget, 6.0f, stEvent.oCaster, stEvent.nAbility);
}
break;
}
[/dascript]
Locking out spells/talents
Débuté par
jsd313
, avril 02 2010 04:04
#1
Posté 02 avril 2010 - 04:04
#2
Posté 02 avril 2010 - 05:37
I've never used effect flags myself, so I don't really know about their effects, but even if they do work as you expect them to you will need to change your code a bit if you want both spells and talents disabled. Notice the bitwise or (|=) below.
[dascript]
case ABILITY_SPELL_SILENCE:
{
// remove stacking effects
RemoveStackingEffects(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility);
if (ResistanceCheck(stEvent.oCaster, stEvent.oTarget, PROPERTY_ATTRIBUTE_SPELLPOWER, RESISTANCE_PHYSICAL) == FALSE)
{
//Silence effect
eEffect = SetEffectFlags(eEffect, EFFECT_FLAG_DISABLE_SPELLS | EFFECT_FLAG_DISABLE_TALENTS);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eEffect, stEvent.oTarget, 6.0f, stEvent.oCaster, stEvent.nAbility);
}
break;
}
[/dascript]
[dascript]
case ABILITY_SPELL_SILENCE:
{
// remove stacking effects
RemoveStackingEffects(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility);
if (ResistanceCheck(stEvent.oCaster, stEvent.oTarget, PROPERTY_ATTRIBUTE_SPELLPOWER, RESISTANCE_PHYSICAL) == FALSE)
{
//Silence effect
eEffect = SetEffectFlags(eEffect, EFFECT_FLAG_DISABLE_SPELLS | EFFECT_FLAG_DISABLE_TALENTS);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eEffect, stEvent.oTarget, 6.0f, stEvent.oCaster, stEvent.nAbility);
}
break;
}
[/dascript]
Modifié par Craig Graff, 02 avril 2010 - 06:48 .
#3
Posté 02 avril 2010 - 06:22
What do the pipes do? I added them and the script barked at me Logical operation has invalid operands (while compiling var_constants_h.nss)
#4
Posté 02 avril 2010 - 06:48
Sorry, that will teach me not to post after rolling out of bed (well, probably it won't, but it should). I've fixed the above code.
| is a bitwise OR, basically the same as a +, but it obviously needs to be applied to the flags, not effects.
| is a bitwise OR, basically the same as a +, but it obviously needs to be applied to the flags, not effects.
Modifié par Craig Graff, 02 avril 2010 - 06:50 .
#5
Posté 02 avril 2010 - 06:55
I gotcha, I had originally tried something similiar there, used a comma instead but that didn't work ><
Script exports will test and let ya know, thank you Craig.
Script exports will test and let ya know, thank you Craig.
#6
Posté 02 avril 2010 - 07:01
Nah it doesn't work. I'm thinking the effect flags only affect the controlled player.
#7
Posté 02 avril 2010 - 07:38
Do you have eEffect defined elsewhere?
If you look in the core scripts, you will see eEffect either defined as an EFFECT_TYPE_ constant or will be constructed using a EffectModifyProperty constructor. I suppose the FLAG can be assigned only on a defined Effect.
If you look in the core scripts, you will see eEffect either defined as an EFFECT_TYPE_ constant or will be constructed using a EffectModifyProperty constructor. I suppose the FLAG can be assigned only on a defined Effect.
#8
Posté 02 avril 2010 - 08:00
I'm going to mess around with it a bit more but if I can't figure it out I'll just replace the 2 abilities. Thanks
Modifié par jsd313, 02 avril 2010 - 08:06 .
#9
Posté 02 avril 2010 - 08:45
Does it only require one pipe, or two? Usually in coding a logical OR is ||.





Retour en haut






