Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Yes...
please answer my question, to help me .
Scriptname shoutSkillIncrease extends ReferenceAlias
{This script adds speechcraft skill experience when you use a shout}
import game
auto State shoutenabled
EVENT OnSpellCast(form akspell)
Spell SpellCast = akspell as Spell
float shouttime = GetPlayer().GetVoiceRecoveryTime() as float
float XPAmount = shouttime * 5
if shouttime > 0
advanceSkill("speechcraft",XPAmount)
gotostate("shoutdisabled")
endif
endEVENT
Endstate
state shoutdisabled
EVENT Onbeginstate()
registerforsingleupdate(1)
endEVENT
EVENT OnUpdate()
float shouttime = GetPlayer().GetVoiceRecoveryTime() as float
if shouttime > 0
registerforsingleupdate(1)
else
gotostate("shoutenabled")
endif
endEVENT
Endstate
I run my game at 1:1. 1 game second = 1 real second.
When you cast a spell,shout, power, etc.. an event OnSpellCast triggers the script.
I get the shoutrecoverytime from the player as shouttime variable, and get the XPamount variable by multiplying the shouttime by 5.
Then it checks if the shouttime is greater than 0, which means a shout was just used. To prevent any other magic spells from earning free XP while the recoverytime is ticking down, I disable the State until the number of game hours has passed so it can't be trigger by anything else. I get the gamehours variable by dividing the number of seconds in the shouttime by 180. 180 is the number of seconds in one game hour. I tested it out and it works flawlessly. This means this will work on any shout, from the main game, from current and future DLC, and mods, without having to update anything.