[Papyrus] Applying a magical effect through scripting on the

Post » Fri Nov 16, 2012 1:01 pm

I know there is a function to check if a magical effect is on the player ( .HasMagicEffect() ), but how can i manually apply an effect to the player? The reason im asking, is because on spells that are created, if you dont select Cast on self type of spell, then i dont know how to allpy a secondary effect on yourself. This secondary effect would be a spell cooldown ;) ...Anyone know how to do this?
User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Sat Nov 17, 2012 2:44 am

Yay! I pioneered spell CDs in the earlier versions of Colette's. This is my specialty, I can help! 8D

All you have to do is create a new spell of type self with the CDEffect passed through. Then attach a script to the base spell that forces the caster to cast the spell on themselves.

Generally what you'll want for an aimed spell is to create three spells:
One is cast on self and has a script that checks for the existence of CooldownEffect. if none, it forces the caster to cast the aimed spell instantly; it also forces the caster to cast the CD spell on themselves. If yes, it returns an error to the player.
User avatar
john page
 
Posts: 3401
Joined: Thu May 31, 2007 10:52 pm

Post » Sat Nov 17, 2012 12:40 am

Yay! I pioneered spell CDs in the earlier versions of Colette's. This is my specialty, I can help! 8D

All you have to do is create a new spell of type self with the CDEffect passed through. Then attach a script to the base spell that forces the caster to cast the spell on themselves.

Generally what you'll want for an aimed spell is to create three spells:
One is cast on self and has a script that checks for the existence of CooldownEffect. if none, it forces the caster to cast the aimed spell instantly; it also forces the caster to cast the CD spell on themselves. If yes, it returns an error to the player.

Thanks a bunch for the reply :biggrin:

How exactly do i have the script cast the other spell on the player exactly? Player.cast('cooldownSpellName') ?
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Fri Nov 16, 2012 6:50 pm

SpellName.cast(Game.GetPlayer())

If you only intend for the player to use this, you can also use cooldowns via global variables for each spell and utility.getcurrentgametime IIRC. It's a utility function that gives the current time, whatever it is.
User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Fri Nov 16, 2012 1:39 pm

SpellName.cast(Game.GetPlayer())

If you only intend for the player to use this, you can also use cooldowns via global variables for each spell and utility.getcurrentgametime IIRC. It's a utility function that gives the current time, whatever it is.

Awesome, thanks again! :biggrin:

EDIT: Yes this is just for spell cooldowns
User avatar
Bereket Fekadu
 
Posts: 3421
Joined: Thu Jul 12, 2007 10:41 pm


Return to V - Skyrim