Scripts

totemScript

Bloodmoon.esm
Variables 4
Local Variables
bearchance
beardist
placebear
temp
Source
1Begin totemScript 2 3;THIS SCRIPT CREATES A 10% CHANCE OF BEARS ATTACKING THE PLAYER IN HIS SLEEP WHILE IN THE PC'S POSSESSION 4 5short bearchance 6short beardist 7short placebear 8short temp 9 10if ( GetJournalIndex BM_Ceremony1 == 20 ) 11 if ( player->GetItemCount misc_BM_ClawFang_UNIQUE > 0 ) 12 Journal BM_Ceremony1 30 13 endif 14endif 15 16if ( player->GetItemCount misc_BM_ClawFang_UNIQUE == 0 ) ;DOES PC HAVE TOTEM 17 return 18endif 19 20if ( GetPCSleep != 1 ) ;IS PC ASLEEP, ALSO RESET VARIABLE 21 return 22 set beardist to 0 23 set placebear to 0 24endif 25 26set bearchance to Random100 ;MAKE VARIABLE A RANDOM NUMBER 0-100 27 28if ( bearchance > 10 ) ;ONLY 10% CHANCE OF ATTACK 29 return 30endif 31 32;CHECK PLAYER LEVEL, PLACE BEARS, MAKE BEARS ATTACK 33 34if ( player->GetLevel >= 30 ) 35 set placebear to 3 36elseif ( player->GetLevel >= 20 ) 37 set placebear to 2 38elseif ( player->GetLevel < 20 ) 39 set placebear to 1 40endif 41 42set temp to placebear 43set beardist to ( beardist + 128 ) 44 45while ( temp != 0 ) 46 PlaceAtPC BM_bear_black_Claw_UNIQ 1 beardist 1 47 set temp to ( temp - 1 ) 48endwhile 49 50WakeUpPC 51MessageBox "You are awakened by the sounds of bears around you." 52 53 54End totemScript