Cheers,
aeddan23
vn_crown_of_souls_script:
begin vn_crown_of_souls_script long CoSpower short CoShunger long lasthour long currentHour float timer long soultype long temp short state short OnPCEquip short PCSKipEquip short button float maxtime if ( vn_wearinglich == 0 ) if ( PCSKipEquip == 0 ) set PCSkipEquip to 1 endif else if ( PCSKipEquip == 1 ) set PCSKipEquip to 0 endif endif if ( PCSKipEquip == 1 ) return endif ;Messagebox "Made it this far." if ( OnPCEquip == 0 ) if ( player -> getspell, vn_crown_gift == 1 ) player -> removespell, vn_crown_gift Messagebox "You have received the Gift of the Crown" endif return ;don't process anything elseif ( player -> getspell, vn_crown_gift == 0 ) player -> addspell, vn_crown_gift Messagebox "You have lost the Gift of the Crown" endif set currentHour to gameHour if ( lasthour != currentHour ) ;Messagebox "hour changed to %.2f", currentHour if ( CoShunger >= 0 ) set temp to ( CoShunger - 5 ) if ( temp < 0 ) set CoShunger to 0 else set CoShunger to temp endif endif if ( CoSpower > 0 ) set temp to ( CoSpower - 2 ) if ( temp < 0 ) set CoSpower to 0 else set CoSpower to temp endif endif ;Messagebox "CoShunger now %.2f and CoSpower is %.2f", CoShunger, CoSpower set lasthour to currentHour endif if ( CoSpower >= 350 ) Messagebox "The Crown of Souls rewards you. Your Intelligence, luck, and willpower increase." if ( mlRunOnce != 0 ) Messagebox "Mad leveller detecting: Using alternative stat bonus" Set Adj_Intelligence To 1 Set Adj_Willpower to 1 Set Adj_Luck to 1 StartScript mlAdjust else player -> modintelligence, 1 player -> modwillpower, 1 player -> modluck, 1 endif if ( Gals_Natural_Intelligence > 0 ) set Gals_Natural_Intelligence to ( Gals_Natural_Intelligence + 1 ) set Gals_Natural_Willpower to ( Gals_Natural_Willpower + 1 ) set Gals_Natural_Luck to ( Gals_Natural_Luck + 1 ) endif set temp to ( CoSpower - 500 ) set CoSpower to temp endif if ( state == 0 ) if ( CoShunger == 0 ) set timer to ( timer + getsecondspassed ) if ( timer > maxtime ) set state to 1 set timer to 0 endif endif endif if ( state == 1 ) if ( menumode == 0 ) if ( player -> hassoulgem, "ancestor_ghost" ) Messagebox "Allow the crown to feed on the soul of the Ancestor Ghost?" "Yes" "No" set soultype to 1 set state to 2 elseif ( player -> hassoulgem, "ash_slave" ) Messagebox "Allow the crown to feed on the soul of the Ash Slave?" "Yes" "No" set soultype to 2 set state to 2 elseif ( player -> hassoulgem, "Dwarven Ghost" ) Messagebox "Allow the crown to feed on the soul of the Dwarven Spectre?" "Yes" "No" set soultype to 3 set state to 2 elseif ( player -> hassoulgem, "Atronach_flame" ) Messagebox "Allow the crown to feed on the soul of the Flame Atronach?" "Yes" "No" set soultype to 4 set state to 2 elseif ( player -> hassoulgem, "bonelord" ) Messagebox "Allow the crown to feed on the soul of the Bonelord?" "Yes" "No" set soultype to 5 set state to 2 elseif ( player -> hassoulgem, "atronach_frost" ) Messagebox "Allow the crown to feed on the soul of the Frost Atronach?" "Yes" "No" set soultype to 6 set state to 2 elseif ( player -> hassoulgem, "dremora" ) Messagebox "Allow the crown to feed on the soul of the Dremora?" "Yes" "No" set soultype to 7 set state to 2 elseif ( player -> hassoulgem, "Hunger" ) Messagebox "Allow the crown to feed on the soul of the Hunger?" "Yes" "No" set soultype to 8 set state to 2 elseif ( player -> hassoulgem, "Daedroth" ) Messagebox "Allow the crown to feed on the soul of the Daedroth?" "Yes" "No" set soultype to 9 set state to 2 elseif ( player -> hassoulgem, "dremora_lord" ) Messagebox "Allow the crown to feed on the soul of the Dremora Lord?" "Yes" "No" set soultype to 10 set state to 2 elseif ( player -> hassoulgem, "ash_ghoul" ) Messagebox "Allow the crown to feed on the soul of the Ash Ghoul?" "Yes" "No" set soultype to 11 set state to 2 elseif ( player -> hassoulgem, "atronach_storm" ) Messagebox "Allow the crown to feed on the soul of the Storm Atronach?" "Yes" "No" set soultype to 12 set state to 2 elseif ( player -> hassoulgem, "Winged Twilight" ) Messagebox "Allow the crown to feed on the soul of the Winged Twilight?" "Yes" "No" set soultype to 13 set state to 2 elseif ( player -> hassoulgem, "lich" ) Messagebox "Allow the crown to feed on the soul of the Lich?" "Yes" "No" set soultype to 14 set state to 2 elseif ( player -> hassoulgem, "lich_profane_unique" ) Messagebox "Allow the crown to feed on the soul of the Profane Acolyte?" "Yes" "No" set soultype to 15 set state to 2 else set state to 0 endif endif endif if ( state == 2 ) set button to getButtonpressed if ( button == -1 ) return elseif ( button == 0 ) set maxtime to 10 set state to 3 elseif ( button == 1 ) set maxtime to 300 set state to 0 endif endif if ( state == 3 ) if ( soultype == 1 ) ;CoShunger = soul/2 + 20 --> so faster to feed on bigger souls. Messagebox "The crown consumes the soul of the Ancestor Ghost" player -> removesoulgem, "ancestor_ghost" set CoShunger to ( CoShunger + 70 ) set CoSpower to ( CoSpower + 100 ) elseif ( soultype == 2 ) Messagebox "The crown consumes the soul of the Ash Slave" player -> removesoulgem, "ash_slave" set CoShunger to ( CoShunger + 70 ) set CoSpower to ( CoSpower + 100 ) elseif ( soultype == 3 ) Messagebox "The crown consumes the soul of the Dwarven Spectre" player -> removesoulgem, "Dwarven Ghost" set CoShunger to ( CoShunger + 120 ) set CoSpower to ( CoSpower + 200 ) elseif ( soultype == 4 ) Messagebox "The crown consumes the soul of the Flame Atronach" player -> removesoulgem, "atronach_flame" set CoShunger to ( CoShunger + 72 ) set CoSpower to ( CoSpower + 105 ) elseif ( soultype == 5 ) Messagebox "The crown consumes the soul of the Bonelord" player -> removesoulgem, "bonelord" set CoShunger to ( CoShunger + 70 ) set CoSpower to ( CoSpower + 100 ) elseif ( soultype == 6 ) Messagebox "The crown consumes the soul of the Frost Atronach" player -> removesoulgem, "atronach_frost" set CoShunger to ( CoShunger + 88 ) set CoSpower to ( CoSpower + 138 ) elseif ( soultype == 7 ) Messagebox "The crown consumes the soul of the Dremora" player -> removesoulgem, "dremora" set CoShunger to ( CoShunger + 70 ) set CoSpower to ( CoSpower + 100 ) elseif ( soultype == 8 ) Messagebox "The crown consumes the soul of the Hunger" player -> removesoulgem, "hunger" set CoShunger to ( CoShunger + 145 ) set CoSpower to ( CoSpower + 250 ) elseif ( soultype == 9 ) Messagebox "The crown consumes the soul of the Daedroth" player -> removesoulgem, "daedroth" set CoShunger to ( CoShunger + 117 ) set CoSpower to ( CoSpower + 195 ) elseif ( soultype == 10 ) Messagebox "The crown consumes the soul of the Dremora Lord" player -> removesoulgem, "dremora_lord" set CoShunger to ( CoShunger + 120 ) set CoSpower to ( CoSpower + 200 ) elseif ( soultype == 11 ) Messagebox "The crown consumes the soul of the Ash Ghoul" player -> removesoulgem, "ash_ghoul" set CoShunger to ( CoShunger + 145 ) set CoSpower to ( CoSpower + 250 ) elseif ( soultype == 12 ) Messagebox "The crown consumes the soul of the Storm Atronach" player -> removesoulgem, "atronach_storm" set CoShunger to ( CoShunger + 95 ) set CoSpower to ( CoSpower + 150 ) elseif ( soultype == 13 ) Messagebox "The crown consumes the soul of the Winged Twilight" player -> removesoulgem, "winged twilight" set CoShunger to ( CoShunger + 170 ) set CoSpower to ( CoSpower + 300 ) elseif ( soultype == 14 ) Messagebox "The crown consumes the soul of the Lich" player -> removesoulgem, "lich" set CoShunger to ( CoShunger + 170 ) set CoSpower to ( CoSpower + 300 ) elseif ( soultype == 15 ) Messagebox "The crown consumes the soul of the Profane Acolyte" player -> removesoulgem, "lich_profane_unique" set CoShunger to ( CoShunger + 170 ) set CoSpower to ( CoSpower + 300 ) endif set state to 0 endifend