вот скрипт из мода Vvardenfell Druglord для зависимости от скуумы, тут просто надо выбросить по-мелочи и переписать ид. Неуникальное зелье должно увеличивать к-л характеристику, здесь - силу. поскольку этот спелл 100% наложится, в отличие от безмолвий и прочих, как в НоМе begin dr_first_one_is_free
short dr_sk_cnt
short dr_rsk_cnt
short dr_crnt_strength
;global dr_check
float TimePassed; Timer must be FLOAT!
short state
; Only count inventory in menu. We need to wait for the strength check until menu is closed.
; Player might get away with quaffing skooma environment within menumode, though.
; But alternative is to run GetItemCount every frame even in menumode, and that's something
; at least I do not want in my game. However, feel free to change that. It's your mod, after all.
; What I do with the script in my personal game is my problem.
if ( MenuMode == 1 )
return
endif
; We don't need the GetItemCount each frame. My game is already slow enough. :-)
set TimePassed to ( TimePassed + GetSecondsPassed )
if ( TimePassed < 3 )
return
endif
set TimePassed to 0
; State 0: Count skooma in inventory
if ( state == 0 )
; Set amount to value of last run.
set dr_sk_amt to dr_sk_cnt
set dr_rsk_amt to dr_rsk_cnt
set dr_strength to dr_crnt_strength
set dr_sk_cnt to ( Player->GetItemCount, "potion_skooma_01" )
set dr_rsk_cnt to ( Player->GetItemCount, "dr_refined_skooma_01" )
set dr_crnt_strength to ( Player->GetStrength )
; Initialize things the first time to be safe
if ( dr_check == 0 )
set dr_sk_amt to dr_sk_cnt
set dr_rsk_amt to dr_rsk_cnt
set dr_strength to dr_crnt_strength
set dr_check to 1
return
endif
; Skooma reduced?
; Either consumed or dropped/sold. We will check that in state 1
; I hate this retarded language. Heck, even C64 BASIC knows OR operations
if ( dr_sk_cnt < dr_sk_amt )
set state to 1
set TimePassed to 4
elseif ( dr_rsk_cnt < dr_rsk_amt )
set state to 1
set TimePassed to 2.5; Check strength in 0.5 seconds
endif
return
elseif ( state == 1 )
if ( dr_crnt_strength > dr_strength )
set state to 2 ; Hook me up in state 2
set TimePassed to 2.5; Do this in 0.5 seconds
else
; No strength increase
set state to 0 ; Continue with itemcount after 3 seconds
endif
return
elseif ( state == 2 )
; Only startscript if it's not running yet, else we might get a CTD.
; In the (unlikely) case it's already running, this script will stall here
; at state 2 until dr_get_hooked is stopped.
; However, dr_get_hook must always be stopped, else our logic locks up here.
if ( ScriptRunning dr_get_hooked == 0 )
startscript dr_get_hooked; Hook me up, Scotty
set state to 0 ; Continue with itemcount for next "fix".
else
set TimePassed to 2; Poll script again in 1 second
endif
endif
end