Jump to content

Quick Scripting Question


Kuraybin

Recommended Posts

Does anyone know how to write a script for a weapon that has, say a 15 percent chance to cast Demoralize 150pt for 5 seconds on strike? The script I have is something like this...

 

 

scn eDragonFear

 

short random

short randomAttack

ref Actor

 

begin ScriptEffectStart

 

set random to GetRandomPercent

 

if ( random <= 15 )

set Actor to getSelf

if ( Actor != player )

Cast 00SDragonFear Player

pme DEMO 5

pms effectEnchantIllusion 5

endif

endif

 

end

 

 

where 00SDragonFear is the name of the spell that casts the demoralize effect. However it isnt working how I had hoped. What I'm really looking for is something that doesnt have to use a spell to cast, and instead just modify the actor (i.e. what I'm hitting) to just run away.

 

And please, no posts saying to just enchant something with an effect....im trying to make a weapon with a CHANCE to do it, just to keep things...interesting :D

 

Thanks,

-Kuraybin

Link to comment
Share on other sites

All scripts have to be attached to an object, spell, or quest. So the problem is in how to apply that script without using a spell. While you could make a single npc with a "onhitwith", followed by the random chance, you would need to apply that block to any and all actors you want the script to run on. The problem of course is that would end up creating script problems everywhere and be a hell of alot of work just to get around the magic effect.

 

However, as a scripted magic effect enchanted on an item the effect can be applied to virtually anyone. If you set the enchantment cost to 0, the effect won't drain the charges on the weapon. I don't think there is any other way.

Link to comment
Share on other sites

All scripts have to be attached to an object, spell, or quest. So the problem is in how to apply that script without using a spell. While you could make a single npc with a "onhitwith", followed by the random chance, you would need to apply that block to any and all actors you want the script to run on. The problem of course is that would end up creating script problems everywhere and be a hell of alot of work just to get around the magic effect.

 

However, as a scripted magic effect enchanted on an item the effect can be applied to virtually anyone. If you set the enchantment cost to 0, the effect won't drain the charges on the weapon. I don't think there is any other way.

That was what I meant, but you wrote it much better. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...