Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.64 KB | None | 0 0
  1. // -= WMK:modAQOOM =-
  2. public saved var wmkMapMenuData : WmkMapMenuData;
  3. public var wmkMapMenu : WmkMapMenuEx;
  4. // -= WMK:modAQOOM =-
  5. // AeroHD -- AutoLootMenu++
  6. private var mAutoLootConfig : CAHDAutoLootConfig;
  7. private var mAutoLootNotificationManager : CAHDAutoLootNotificationManager;
  8. // AeroHD -- AutoLootMenu--
  9. // CrossbowDamageBoost
  10. var crossbowDmgProcessor : CrossbowDamageBoostProcessor;
  11. // CrossbowDamageBoost
  12. crossbowDmgProcessor = new CrossbowDamageBoostProcessor in this;
  13. crossbowDmgProcessor.Init();
  14. muts = SSS_Patch_MutagenStacking(muts); //zur13 modSSS mutTabs
  15. SSS_FixEquippedMutagens(); //zur13 modSSS mutTabs
  16.  
  17. // AeroHD -- AutoLootMenu++
  18. mAutoLootConfig = new CAHDAutoLootConfig in this;
  19. mAutoLootNotificationManager = new CAHDAutoLootNotificationManager in this;
  20. AddTimer('InitAHDAutoLoot', 3.0);
  21. // AeroHD -- AutoLootMenu--
  22. //modThrowingDaggers++
  23. timer function ScanForTDAmmo( dt : float, id : int )
  24. {
  25. var tkstacks : array< SItemUniqueId >;
  26. var tkammo : int;
  27. var throwingknives : array< SItemUniqueId >;
  28. var throwingknife : SItemUniqueId;
  29. var i : int;
  30.  
  31. tkstacks = thePlayer.inv.GetItemsByTag('ThrowingKnifeAmmo');
  32. throwingknives = thePlayer.inv.GetItemsByTag('ThrowingKnife');
  33. throwingknife = throwingknives[0];
  34. if( IsMutationActive( EPMT_Mutation5 ) && GetStat( BCS_Focus ) >= 1.f ) //zur13 modSSS
  35. if( IsMutationActive( EPMT_Mutation7 ) ) //zur13 modSSS
  36. if( IsMutationActive( EPMT_Mutation8 ) ) //zur13 modSSS
  37. if( IsMutationActive( EPMT_Mutation10 ) ) //zur13 modSSS
  38.  
  39. if(throwingknives.Size() > 0)
  40. {
  41. for(i = 0; i < tkstacks.Size(); i += 1)
  42. {
  43. tkammo = tkammo + thePlayer.inv.GetNumOfStackedItems(tkstacks[i]);
  44. }
  45. thePlayer.inv.SingletonItemSetAmmo(throwingknife, tkammo);
  46.  
  47. if(tkstacks.Size() > 0)
  48. {
  49. RemoveTimer('ScanForTDAmmo');
  50. }
  51. }
  52. }
  53. //modThrowingDaggers--
  54. var cnt, transmutationCount, mutagenCount, i : int;
  55.  
  56. if( !actorVictim.IsAlive() )
  57. {
  58. return false;
  59. }
  60.  
  61. // AeroHD -- AutoLootMenu++
  62. mAutoLootNotificationManager.ShowNotification(true);
  63. // AeroHD -- AutoLootMenu--
  64. WmkGetMapMenuInstance().OnTick(deltaTime); // -= WMK:modAQOOM =-
  65. public final function MutationResearchWithItem(mutation : EPlayerMutationType, item : SItemUniqueId) : bool
  66. return ( ( W3PlayerAbilityManager ) abilityManager ).MutationResearchWithItem( mutation, item );
  67. // CrossbowDamageBoost
  68. var result : string;
  69. // CrossbowDamageBoost
  70. result = GetLocStringByKeyExtWithParams( locKey, , , arrStr );
  71. if (mutationType == EPMT_Mutation9)
  72. if( IsMutationActive( EPMT_Mutation8 ) ) //zur13 modSSS
  73. {
  74. result += "<br>Increases manually aimed shot critical chance by additional 15%. Increases critical hit damage by 50%.";
  75. }
  76.  
  77. if ((recipe.cookedItemType != EACIT_Bolt) && (recipe.cookedItemType != EACIT_Undefined) && (recipe.level <= GetSkillLevel(S_Alchemy_s18)))
  78. // W3EE - Begin
  79. private var CurrentPotionSlot : EEquipmentSlots;
  80. private var CurrentConsumableSlot : SItemUniqueId;
  81. private var InventoryConsumableSlot : SItemUniqueId;
  82. private var inventoryCall : bool;
  83.  
  84. private function GetPotionSlot() : EEquipmentSlots
  85. {
  86. return CurrentPotionSlot;
  87. }
  88.  
  89. private function SetPotionSlot( slot : EEquipmentSlots )
  90. {
  91. CurrentPotionSlot = slot;
  92. }
  93.  
  94. private function GetConsumableSlot() : SItemUniqueId
  95. {
  96. return CurrentConsumableSlot;
  97. }
  98.  
  99. private function SetConsumableSlot( item : SItemUniqueId )
  100. {
  101. CurrentConsumableSlot = item;
  102. }
  103.  
  104. private function GetInvPotSlot() : SItemUniqueId
  105. {
  106. return InventoryConsumableSlot;
  107. }
  108.  
  109. private function SetInvPotSlot( item : SItemUniqueId )
  110. {
  111. InventoryConsumableSlot = item;
  112. }
  113.  
  114. private function GetWasInvCall() : bool
  115. {
  116. return inventoryCall;
  117. }
  118.  
  119. private function SetWasInvCall( i : bool )
  120. {
  121. inventoryCall = i;
  122. }
  123.  
  124. timer function ConsumePotionTimer( dt : float, id : int )
  125. {
  126. var wep : EPlayerWeapon;
  127.  
  128. wep = thePlayer.GetWep();
  129.  
  130. if ( !thePlayer.GetStaggeredDuringAnim() )
  131. {
  132. if( GetWasInvCall() )
  133. DrinkPreparedPotion( GetPotionSlot(), GetInvPotSlot() );
  134. else
  135. DrinkPreparedPotion( GetPotionSlot() );
  136.  
  137. if( thePlayer.IsInCombat() )
  138. if ( wep == PW_Fists || wep == PW_None )
  139. AddTimer('ResetAnimationSpeed', 1.73f,false);
  140. else AddTimer('ResetAnimationSpeed', 1.64f,false);
  141. else
  142. if ( wep == PW_Fists || wep == PW_None )
  143. AddTimer('ResetAnimationSpeed', 2.60f,false);
  144. else AddTimer('ResetAnimationSpeed', 2.55f,false);
  145. }
  146. else
  147. {
  148. thePlayer.SetAnimatedState(false);
  149. }
  150. }
  151.  
  152. timer function AnimationSpeed( dt : float, id : int )
  153. {
  154. if ( !thePlayer.GetStaggeredDuringAnim() )
  155. {
  156. ((CAnimatedComponent)((CActor)thePlayer).GetComponentByClassName('CAnimatedComponent')).SetAnimationTimeMultiplier(2.0);
  157. }
  158. }
  159.  
  160. timer function AnimationSpeedCombat( dt : float, id : int )
  161. {
  162. if ( !thePlayer.GetStaggeredDuringAnim() )
  163. {
  164. ((CAnimatedComponent)((CActor)thePlayer).GetComponentByClassName('CAnimatedComponent')).SetAnimationTimeMultiplier(3.0);
  165. }
  166. }
  167.  
  168. timer function ResetAnimationSpeed( dt : float, id : int )
  169. {
  170. if ( !thePlayer.GetStaggeredDuringAnim() )
  171. {
  172. ((CAnimatedComponent)((CActor)thePlayer).GetComponentByClassName('CAnimatedComponent')).SetAnimationTimeMultiplier(1.0);
  173.  
  174. if( thePlayer.IsInCombat() )
  175. thePlayer.weaponHolster.OnEquipMeleeWeapon( thePlayer.GetWep(), true, false );
  176.  
  177. thePlayer.SetAnimatedState(false);
  178. }
  179. }
  180.  
  181. timer function Drink( dt : float, id : int )
  182. {
  183. if ( !thePlayer.GetStaggeredDuringAnim() )
  184. {
  185. thePlayer.PlayerStartAction( 1, 'work_stand_drink_02' );
  186. }
  187. }
  188.  
  189. timer function Eat( dt : float, id : int )
  190. {
  191. if ( !thePlayer.GetStaggeredDuringAnim() )
  192. {
  193. thePlayer.PlayerStartAction( 1, 'work_stand_eat_01' );
  194. }
  195. }
  196.  
  197. timer function ConsumeItemTimer( dt : float, id : int )
  198. {
  199. ConsumeItem( GetConsumableSlot() );
  200. thePlayer.SetAnimatedState(false);
  201. }
  202.  
  203. public function DrinkPotionFromSlot(slot : EEquipmentSlots, optional itemId : SItemUniqueId, optional invcall : bool) : void
  204. // W3EE - End
  205. // W3EE - Begin
  206. var anim : CComponent;
  207. var weps : EPlayerWeapon;
  208.  
  209. SetWasInvCall(invcall);
  210.  
  211. if( invcall )
  212. SetInvPotSlot(itemId);
  213. else
  214. GetItemEquippedOnSlot(slot, itemId);
  215.  
  216. if( ( IsInShallowWater() || IsSwimming() || GetOilAnimState() || GetIsInAnimatedState() || IsInAir() || IsCurrentlyDodging() || GetIsStaggered() || ( ( inv.ItemHasTag(itemId, 'Drinks') || inv.ItemHasTag(itemId, 'Edibles') ) && IsInCombat() ) ) && theGame.GetInGameConfigWrapper().GetVarValue('TESAnims', 'PotAnim') )
  217.  
  218. theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt( "menu_cannot_perform_action_now" ) );
  219. theSound.SoundEvent( "gui_global_denied" );
  220. return;
  221. if( !SSS_IsMutationEquipped( mutationType, SSS_GetEquippedMutationType() ) ) //zur13 modSSS
  222.  
  223.  
  224.  
  225.  
  226. weps = thePlayer.weaponHolster.GetCurrentMeleeWeapon();
  227.  
  228. thePlayer.SetWep( weps );
  229. thePlayer.SetStaggeredDuringAnim(false);
  230.  
  231. if( !theGame.GetInGameConfigWrapper().GetVarValue('TESAnims', 'PotAnim') )
  232. {
  233. if( inv.ItemHasTag(itemId, 'Drinks') || inv.ItemHasTag(itemId, 'Edibles') )
  234.  
  235. if( invcall )
  236. ConsumeItem( GetInvPotSlot() );
  237. else
  238. ConsumeItem(itemId);
  239. if ( ToxicityLowEnoughToDrinkPotion(slot) && thePlayer.inv.SingletonItemGetAmmo(itemId) > 0 )
  240. if( invcall )
  241. DrinkPreparedPotion( GetPotionSlot(), GetInvPotSlot() );
  242. else
  243. DrinkPreparedPotion( slot, itemId );
  244. }
  245. else
  246.  
  247. hud = (CR4ScriptedHud)theGame.GetHud();
  248. if ( hud )
  249. {
  250. module = (CR4HudModuleItemInfo)hud.GetHudModule("ItemInfoModule");
  251. if( module )
  252. {
  253. module.ForceShowElement();
  254. }
  255. }
  256. SSS_UnequipAllMutagens(); //zur13 modSSS mutTabs
  257.  
  258. return;
  259.  
  260.  
  261. if ( ToxicityLowEnoughToDrinkPotion(slot) && thePlayer.inv.SingletonItemGetAmmo(itemId) > 0 )
  262. {
  263. thePlayer.SetAnimatedState(true);
  264. pam = (W3PlayerAbilityManager)abilityManager; //zur13 modSSS fixed orig script error
  265.  
  266. theGame.GetGuiManager().GetCommonMenu().CloseMenu();
  267.  
  268. RaiseEvent('ForcedUsableItemUnequip');
  269.  
  270. if ( thePlayer.IsInCombat() )
  271. {
  272. if (weps == PW_Fists || weps == PW_None)
  273. {
  274. SetPotionSlot(slot);
  275. if( theGame.GetInGameConfigWrapper().GetVarValue('TESAnims', 'PotBottle') )
  276. thePlayer.PlayerStartAction( 1, 'geralt_determined_gesture_drink' );
  277. else
  278. thePlayer.PlayerStartAction( 1, 'high_standing_determined_gesture_drink' );
  279. AddTimer('AnimationSpeedCombat', 0.1, false);
  280. AddTimer('ConsumePotionTimer', 1.25f, false);
  281. }
  282. else
  283. {
  284. SetPotionSlot(slot);
  285. AddTimer('AnimationSpeedCombat', 0.1, false);
  286. thePlayer.OnMeleeForceHolster(true);
  287. thePlayer.OnRangedForceHolster(true);
  288. if( theGame.GetInGameConfigWrapper().GetVarValue('TESAnims', 'PotBottle') )
  289. thePlayer.PlayerStartAction( 1, 'geralt_determined_gesture_drink' );
  290. else
  291. thePlayer.PlayerStartAction( 1, 'high_standing_determined_gesture_drink' );
  292. AddTimer('ConsumePotionTimer', 1.35f, false);
  293.  
  294. }
  295. }
  296. else
  297. {
  298. if (weps == PW_Fists || weps == PW_None)
  299. {
  300. SetPotionSlot(slot);
  301. if( theGame.GetInGameConfigWrapper().GetVarValue('TESAnims', 'PotBottle') )
  302. thePlayer.PlayerStartAction( 1, 'geralt_determined_gesture_drink' );
  303. else
  304. thePlayer.PlayerStartAction( 1, 'high_standing_determined_gesture_drink' );
  305. AddTimer('AnimationSpeed', 0.1, false);
  306. AddTimer('ConsumePotionTimer', 1.85f, false);
  307. }
  308. else
  309. {
  310. SetPotionSlot(slot);
  311. AddTimer('AnimationSpeed', 0.1, false);
  312. thePlayer.OnMeleeForceHolster(true);
  313. thePlayer.OnRangedForceHolster(true);
  314. if( theGame.GetInGameConfigWrapper().GetVarValue('TESAnims', 'PotBottle') )
  315. thePlayer.PlayerStartAction( 1, 'geralt_determined_gesture_drink' );
  316. else
  317. thePlayer.PlayerStartAction( 1, 'high_standing_determined_gesture_drink' );
  318. AddTimer('ConsumePotionTimer', 1.95f, false);
  319. }
  320. }
  321. return;
  322. }
  323. else { if( !ToxicityLowEnoughToDrinkPotion(slot) && !inv.ItemHasTag(itemId, 'Drinks') && !inv.ItemHasTag(itemId, 'Edibles') ) { SendToxicityTooHighMessage(); return; } }
  324.  
  325. if( inv.ItemHasTag(itemId, 'Drinks') )
  326. {
  327. thePlayer.SetAnimatedState(true);
  328.  
  329. theGame.GetGuiManager().GetCommonMenu().CloseMenu();
  330.  
  331. RaiseEvent('ForcedUsableItemUnequip');
  332.  
  333. if ( weps == PW_Fists || weps == PW_None )
  334. {
  335. SetConsumableSlot(itemId);
  336. thePlayer.PlayerStartAction( 1, 'work_stand_drink_02' );
  337. AddTimer('ConsumeItemTimer', 1.2f, false);
  338. }
  339. else
  340. {
  341. SetConsumableSlot(itemId);
  342. thePlayer.OnMeleeForceHolster( true );
  343. thePlayer.OnRangedForceHolster( true );
  344. AddTimer('Drink', 2.1, false);
  345. AddTimer('ConsumeItemTimer', 3.2f, false);
  346. else
  347. if( inv.ItemHasTag(itemId, 'Edibles') )
  348. {
  349. thePlayer.SetAnimatedState(true);
  350.  
  351. theGame.GetGuiManager().GetCommonMenu().CloseMenu();
  352.  
  353. RaiseEvent('ForcedUsableItemUnequip');
  354.  
  355. if ( weps == PW_Fists || weps == PW_None )
  356. {
  357. SetConsumableSlot(itemId);
  358. thePlayer.PlayerStartAction( 1, 'work_stand_eat_01' );
  359. AddTimer('ConsumeItemTimer', 1.7f, false);
  360. }
  361. else
  362. {
  363. SetConsumableSlot(itemId);
  364. thePlayer.OnMeleeForceHolster(true);
  365. thePlayer.OnRangedForceHolster(true);
  366. AddTimer('Eat', 1.4, false);
  367. AddTimer('ConsumeItemTimer', 3.3f, false);
  368. }
  369. }
  370. else { theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt( "menu_cannot_perform_action_now" ) ); }
  371. // W3EE - End
  372. if(!forceBodkin && (forceHarpoon || GetCurrentStateName() == 'Swimming' || IsSwimming() || IsDiving()) )
  373. var i, groupID : int;
  374. {
  375. var silverSword, steelSword, armor, boots, gloves, pants : SItemUniqueId; // modScalingArmors
  376.  
  377. // modScalingArmors BEGIN
  378. GetItemEquippedOnSlot(EES_SilverSword, silverSword);
  379. GetItemEquippedOnSlot(EES_SteelSword, steelSword);
  380. GetItemEquippedOnSlot(EES_Armor, armor);
  381. GetItemEquippedOnSlot(EES_Boots, boots);
  382. GetItemEquippedOnSlot(EES_Gloves, gloves);
  383. GetItemEquippedOnSlot(EES_Pants, pants);
  384. inv.GetItemLevel(silverSword);
  385. inv.GetItemLevel(steelSword);
  386. inv.GetItemLevel(armor);
  387. inv.GetItemLevel(boots);
  388. inv.GetItemLevel(gloves);
  389. inv.GetItemLevel(pants);
  390. // modScalingArmors END
  391. //CrossbowDamageBoost
  392. var extraBoltDamage : float;
  393. var boltDamageFactor : float;
  394.  
  395. // CrossbowDamageBoost++
  396. extraBoltDamage = crossbowDmgProcessor.GetExtraBoltDamage(GetLevel());
  397. boltDamageFactor = crossbowDmgProcessor.GetBoltDamageMod(GetInventory().GetItemName(item));
  398. // CrossbowDamageBoost--
  399. playerOffenseStats.crossbowSteelDmg = steelDmg * crossbowDmgProcessor.crossbowDamageBoostData.ExplosiveBoltFactor; // CrossbowDamageBoost
  400. // CrossbowDamageBoost
  401. extraBoltDamage *= crossbowDmgProcessor.crossbowDamageBoostData.ExplosiveWitcherFactor;
  402. // unmodified game bug fix - fire bolts also have silver damage
  403.  
  404. // CrossbowDamageBoost
  405. // - 1.0 crossbow hack - calculate crossbow multiplicative value as it is displayed on crossbow damage
  406. // so 101% means 1.01 of bolt damage, not 2.01
  407. attackPower.valueMultiplicative -= 1.0;
  408.  
  409. // CrossbowDamageBoost
  410. if(CanUseSkill(S_Sword_s15))
  411. {
  412. attackPower.valueMultiplicative += 0.12 * GetSkillLevel(S_Sword_s15);
  413. }
  414. // CrossbowDamageBoost
  415. // Cat eyes mutation simply gives attack power bonus instead of base damage increase
  416. if (hackMode != 1 && ( IsMutationActive( EPMT_Mutation9 ) || hackMode == 2 ) )
  417. attackPower.valueMultiplicative += 0.6;
  418. }
  419.  
  420. //mutation 9 increases base damage
  421. /*if( hackMode != 1 && ( IsMutationActive( EPMT_Mutation9 ) || hackMode == 2 ) )
  422. {
  423. }*/
  424. // CrossbowDamageBoost - include extra bolt base damage
  425. playerOffenseStats.crossbowSteelDmg = (playerOffenseStats.crossbowSteelDmg * crossbowDmgProcessor.crossbowDamageBoostData.SteelBoltFactor + attackPower.valueBase + extraBoltDamage * crossbowDmgProcessor.crossbowDamageBoostData.SteelWitcherFactor * boltDamageFactor)
  426. * attackPower.valueMultiplicative + attackPower.valueAdditive;
  427. playerOffenseStats.crossbowSilverDmg = (playerOffenseStats.crossbowSilverDmg * crossbowDmgProcessor.crossbowDamageBoostData.SilverBoltFactor + attackPower.valueBase + extraBoltDamage * crossbowDmgProcessor.crossbowDamageBoostData.SilverWitcherFactor * boltDamageFactor)
  428. * attackPower.valueMultiplicative + attackPower.valueAdditive;
  429. // CrossbowDamageBoost++
  430. public function GetCrossbowCritChanceReduction() : float
  431. {
  432. if (CanUseSkill(S_Perk_19))
  433. {
  434. return FloorF(GetStat(BCS_Focus)) * 0.02;
  435. }
  436. else
  437. {
  438. return 0.0;
  439. }
  440. }
  441.  
  442. public timer function OnCrossbowDmgProcessorTimer(dt : float, id : int)
  443. {
  444. crossbowDmgProcessor.OnTimer();
  445. }
  446. // CrossbowDamageBoost--
  447.  
  448. // CrossbowDamageBoost code disable. This mutation no longer gives base damage bonus.
  449. /*if( IsMutationActive( EPMT_Mutation9 ) && inv.IsItemBolt( weaponId ) && IsDamageTypeAnyPhysicalType( damageTypeName ) )
  450. }*/
  451. else
  452.  
  453. // AeroHD -- AutoLootMenu++
  454. timer function InitAHDAutoLoot(dt : float, id : int)
  455. {
  456. mAutoLootConfig.Init();
  457. mAutoLootNotificationManager.Reset();
  458. }
  459.  
  460. public function GetAutoLootConfig() : CAHDAutoLootConfig { return mAutoLootConfig; }
  461.  
  462. public function GetAutoLootNotificationManager() : CAHDAutoLootNotificationManager { return mAutoLootNotificationManager; }
  463.  
  464. timer function TrueAutoLootMode( dt : float, id : int )
  465. {
  466. if( GetAutoLootConfig().ModEnabled() || GetAutoLootConfig().TrueAutoLootEnabled() )
  467. }
  468.  
  469. //zur13 modSSS
  470. public function SSS_GetEquippedMutationType() : array< EPlayerMutationType >
  471. {
  472. return ( ( W3PlayerAbilityManager ) abilityManager ).SSS_GetEquippedMutationType();
  473. }
  474.  
  475. //zur13 modSSS mutTabs
  476. public function SSS_FixEquippedMutagens()
  477. {
  478. var item : SItemUniqueId;
  479. var i : int;
  480. for( i = EES_SkillMutagen5 ; i < EES_SkillMutagen48; i=i+1 )
  481. {
  482. if( GetItemEquippedOnSlot( i, item ) )
  483. {
  484. inv.SetItemStackable( item, false );
  485. }
  486. }
  487. }
  488.  
  489. //zur13 modSSS mutTabs
  490. public function SSS_Patch_MutagenStacking(muts : array< SItemUniqueId >) : array< SItemUniqueId >
  491. {
  492. var i, j, quantity : int;
  493. var item : SItemUniqueId;
  494.  
  495. for( i = EES_SkillMutagen5 ; i < EES_SkillMutagen48; i=i+1 )
  496. {
  497. if( GetItemEquippedOnSlot( i, item ) )
  498. {
  499. muts.Remove( item );
  500. inv.SetItemStackable( item, false );
  501. }
  502. }
  503. return muts;
  504. {
  505. mAutoLootConfig.GetFeatureManager().TryAreaLooting("true_autoloot_mode");
  506. AddTimer('TrueAutoLootMode', mAutoLootConfig.GetTrueAutoLootTime());
  507. }
  508. }
  509.  
  510. // AeroHD -- AutoLootMenu--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement