Scripts

TR_m2_q_35_Ilmeni

TR_Mainland.esm
Variables 8
Local Variables
TR_Map
control
controlQ
amuletstate
pocketpicked
TR_m2_q_38_obtained
T_Local_NPC
NoLore
Source
1Begin TR_m2_q_35_Ilmeni 2 3; Script on NPC "TR_m2_Ilmeni Benamamat", shared between quests q2-35 and q2-38. 4; Currently all the code in the script is used for the former quest, while the latter quest 5; just uses a few variables. 6 7short TR_Map 8short control 9short controlQ 10short amuletstate ;for dialogue conditions on topic "enchanted amulet" 11short pocketpicked ;2 when the player is currently picking her pockets, 0 else 12short TR_m2_q_38_obtained ;set to 1 when the player gets ingredients in quest q2-35 but is not even told of the possibility of sabotage 13short T_Local_NPC 14short NoLore 15 16 17If ( OnDeath == 1 ) 18 RemoveItem, "TR_m2_q_35_placeholder", 1 ;Remove the placeholder amulet (only there so she doesn't equip those she's supposed to sell) 19Endif 20 21If ( OnActivate == 1 ) 22 If ( GetPCSneaking == 1 ) 23 Activate 24 set pocketpicked to 1 ;PC is pickpocketing her!!1 25 Else 26 Activate 27 Endif 28EndIf 29 30If ( amuletstate < 2 ) 31 If ( GetJournalIndex "TR_m2_MG_Ranosa1" >= 10 ) 32 if ( GetItemCount, "TR_m2_q_35_amulet1" == 0 ) ; She doesn't have the cheap version of the amulet... 33 if ( GetItemCount, "TR_m2_q_35_amulet2" == 0 ) ; ... nor the expensive one. 34 if ( pocketpicked >= 1 ) 35 Journal "TR_m2_MG_Ranosa1" 20 ;Indicates the quest amulet was stolen 36 if ( amuletstate == 1 ) ;if PC asked about it before pickpocketing... 37 set amuletstate to 4 ;... then asks about it again, she'll be suspicious 38 else 39 set amuletstate to 3 ;amulet stolen and she's unaware 40 endif 41 else 42 set amuletstate to 2 ;Indicates the quest amulet was bought 43 endif 44 endif 45 endif 46 Endif 47Endif 48 49If ( pocketpicked == 1 ) 50 if ( MenuMode == 1 ) 51 set pocketpicked to 2 ;delay to make sure her inventory was opened 52 endif 53ElseIf ( pocketpicked == 2 ) 54 if ( MenuMode == 0 ) 55 set pocketpicked to 0 ;reset when PC is done with her pockets 56 endif 57Endif 58 59 60;regional topic filter 61 62if ( TR_Map == 2 ) 63 return 64endif 65 66set TR_Map to 2 67 68End