Scripts

TR_m7_JNS_TheBossSc

TR_Mainland.esm
Variables 6
Local Variables
control
controlQ
doonce
rank
expelled
OnPCHitMe
Source
1Begin TR_m7_JNS_TheBossSc 2 3short control 4short controlQ 5 6short doonce 7 8short rank 9short expelled 10 11short OnPCHitMe 12 13set rank to ( GetPCRank "T_Mw_JaNattaSyndicate" ) 14set expelled to ( PCExpelled "T_Mw_JaNattaSyndicate" ) 15 16if ( OnPCHitMe ) 17 ; don't punish the Underboss player who attacks the Boss to take over his role 18 if ( GetPCRank "T_Mw_JaNattaSyndicate" < 8 ) 19 set TR_m7_JNS_TheBossAttacked to 1 20 ; expell if you're a member and not currently expelled 21 if ( GetPCRank "T_Mw_JaNattaSyndicate" < 0 ) 22 elseif ( PCExpelled "T_Mw_JaNattaSyndicate" != 1 ) 23 PCExpell "T_Mw_JaNattaSyndicate" 24 endif 25 endif 26 if ( doonce == 0 ) 27 set doonce to 1 28 endif 29 startcombat player 30 set OnPCHitMe to 0 31endif 32 33; scripted fight 34if ( doonce == 1 ) 35 cast "TR_m7_JNS_TheBossBlind" player 36 set doonce to 2 37elseif ( doonce == 2 ) 38 if ( GetHealthGetRatio < 0.75 ) 39 cast "TR_m7_JNS_TheBossScamp" "TR_m7_JNS_TheBoss" 40 set doonce to 3 41 endif 42elseif ( doonce == 3 ) 43 if ( GetHealthGetRatio < 0.50 ) 44 cast "TR_m7_JNS_TheBossFly" player 45 set doonce to 4 46 endif 47elseif ( doonce == 4 ) 48 if ( GetHealthGetRatio < 0.25 ) 49 cast "TR_m7_JNS_TheBossHunger" "TR_m7_JNS_TheBoss" 50 set doonce to 5 51 endif 52endif 53 54if ( OnDeath ) 55 ; end scripted combat 56 set doonce to -1 57 58 if ( GetPCRank "T_Mw_JaNattaSyndicate" >= 8 ) 59 ; congrats, you're the Boss and no longer expelled if you were 60 if ( PCExpelled "T_Mw_JaNattaSyndicate" ) 61 PCClearExpelled "T_Mw_JaNattaSyndicate" 62 endif 63 PCRaiseRank "T_Mw_JaNattaSyndicate" 64 else 65 ; lock the questline and access to Uddanu 66 set TR_m7_JNS_TheBossAttacked to 1 67 endif 68 69 ; fail the active quest 70 if ( GetJournalIndex "TR_m7_JNS_TheBoss_BreathingIn" >= 10 ) 71 if ( GetJournalIndex "TR_m7_JNS_TheBoss_BreathingIn" < 100 ) 72 Journal "TR_m7_JNS_TheBoss_BreathingIn" 300 73 endif 74 endif 75 if ( GetJournalIndex "TR_m7_JNS_TheBoss_SnakeEyes" >= 10 ) 76 if ( GetJournalIndex "TR_m7_JNS_TheBoss_SnakeEyes" < 100 ) 77 Journal "TR_m7_JNS_TheBoss_SnakeEyes" 300 78 if ( GetJournalIndex "TR_m7_Ns_TG_7" < 10 ) 79 set TR_m7_Ns_FortunaQuestActive to 0 80 elseif ( GetJournalIndex "TR_m7_Ns_TG_7" >= 100 ) 81 set TR_m7_Ns_FortunaQuestActive to 0 82 endif 83 endif 84 endif 85 if ( GetJournalIndex "TR_m7_JNS_TheBoss_BreathingOut" >= 10 ) 86 if ( GetJournalIndex "TR_m7_JNS_TheBoss_BreathingOut" < 100 ) 87 Journal "TR_m7_JNS_TheBoss_BreathingOut" 300 88 endif 89 endif 90 if ( GetJournalIndex "TR_m7_JNS_TheBoss_EndOfTheLine" >= 10 ) 91 if ( GetJournalIndex "TR_m7_JNS_TheBoss_EndOfTheLine" < 100 ) 92 Journal "TR_m7_JNS_TheBoss_EndOfTheLine" 300 93 endif 94 endif 95 if ( GetJournalIndex "TR_m7_JNS_TheBoss_Consolidation" >= 10 ) 96 if ( GetJournalIndex "TR_m7_JNS_TheBoss_Consolidation" < 100 ) 97 Journal "TR_m7_JNS_TheBoss_Consolidation" 300 98 endif 99 endif 100endif 101 102End