How to auto-cast under certain circunstances (scripting)

Post » Tue Jan 28, 2014 10:41 am

Hi,

I had an idea but I'm not sure how feasible it is. I was wondering if some members who are familiar with scripting could offer some guidance.

The idea is the following: if a spell is 'on-self' and the player is sufficiently skilled in the spell's school of magic, then the spell becomes auto-castable.

By 'auto-castable' I mean that pressing the cast button casts the spell instantly, that is, without having to wait for the casting animation. The purpose if obviously to be able to cast certain spells faster.

By 'sufficiently skilled' I mean a difference of at least 1 mastery level between player skill and spell level. For example: to auto-cast an on-self apprentice spell, the player must be at least journeyman on the spell's school.

I thought of 2 approaches to implement the idea:

1) Add a passive ability to the player that contains a script. The script runs everytime the player changes his equipped spell (is there any event handler for that?). When the script runs it retrieves information regarding the equipped spell's level, school and casting type, as well as information regarding how skilled the player is in the equipped spell's school. If the spell is on-self and the player is 'sufficiently skilled' then the spell becomes auto-castable. I'm not sure how to prevent the on-self casting animation from triggering. Any information on that?

2) Use the existing 'perk system'. When a skill in a school of magic reaches the 50, 75 and 100 milestones, then all the apprentice, journeyman and expert on-self spells of that school become auto-castable. So turning lower-level spells auto-castable would be a perk in the same sense that the the ability to disarm opponents at blade level 50 is. Right now I have no idea whether the perk system can be used like that tough, and what would it involve.

Any guidance will be much appreciated.

User avatar
Assumptah George
 
Posts: 3373
Joined: Wed Sep 13, 2006 9:43 am

Return to IV - Oblivion