Advertisement
Guest User

Untitled

a guest
Oct 27th, 2017
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 325.16 KB | None | 0 0
  1. /***********************************************************************/
  2. /** © 2015 CD PROJEKT S.A. All rights reserved.
  3. /** THE WITCHER® is a trademark of CD PROJEKT S. A.
  4. /** The Witcher game is based on the prose of Andrzej Sapkowski.
  5. /***********************************************************************/
  6.  
  7.  
  8.  
  9.  
  10. statemachine class W3PlayerWitcher extends CR4Player
  11. {
  12. var ftPack : FastTravelPack; // mod Fast Travel Pack
  13. private saved var craftingSchematics : array<name>;
  14. private saved var expandedCraftingCategories : array<name>;
  15. private saved var craftingFilters : SCraftingFilters;
  16.  
  17.  
  18. private saved var alchemyRecipes : array<name>;
  19. private saved var expandedAlchemyCategories : array<name>;
  20. private saved var alchemyFilters : SCraftingFilters;
  21.  
  22.  
  23. private saved var expandedBestiaryCategories : array<name>;
  24.  
  25. // AeroHD -- AutoLootMenu++
  26. private var mAutoLootConfig : CAHDAutoLootConfig;
  27. private var mAutoLootNotificationManager : CAHDAutoLootNotificationManager;
  28. // AeroHD -- AutoLootMenu--
  29.  
  30. private saved var booksRead : array<name>;
  31.  
  32.  
  33. //---=== modFriendlyMeditation ===---
  34. public var fMeditationConfig : CModFMeditationConfig;
  35. var spawnedCampFire : W3Campfire;
  36. //---=== modFriendlyMeditation ===---
  37.  
  38. private var fastAttackCounter, heavyAttackCounter : int;
  39. private var isInFrenzy : bool;
  40. private var hasRecentlyCountered : bool;
  41. private saved var cannotUseUndyingSkill : bool;
  42.  
  43.  
  44. protected saved var amountOfSetPiecesEquipped : array<int>;
  45.  
  46.  
  47. public var canSwitchFocusModeTarget : bool;
  48. protected var switchFocusModeTargetAllowed : bool;
  49. default canSwitchFocusModeTarget = true;
  50. default switchFocusModeTargetAllowed = true;
  51.  
  52.  
  53. private editable var signs : array< SWitcherSign >;
  54. private saved var equippedSign : ESignType;
  55. private var currentlyCastSign : ESignType; default currentlyCastSign = ST_None;
  56. private var signOwner : W3SignOwnerPlayer;
  57. private var usedQuenInCombat : bool;
  58. public var yrdenEntities : array<W3YrdenEntity>;
  59. public saved var m_quenReappliedCount : int;
  60.  
  61. default equippedSign = ST_Aard;
  62. default m_quenReappliedCount = 1;
  63.  
  64.  
  65.  
  66. private var bDispalyHeavyAttackIndicator : bool;
  67. private var bDisplayHeavyAttackFirstLevelTimer : bool;
  68. public var specialAttackHeavyAllowed : bool;
  69.  
  70. default bIsCombatActionAllowed = true;
  71. default bDispalyHeavyAttackIndicator = false;
  72. default bDisplayHeavyAttackFirstLevelTimer = true;
  73.  
  74.  
  75.  
  76. default explorationInputContext = 'Exploration';
  77. default combatInputContext = 'Combat';
  78. default combatFistsInputContext = 'Combat';
  79.  
  80.  
  81. private saved var companionNPCTag : name;
  82. private saved var companionNPCTag2 : name;
  83.  
  84. private saved var companionNPCIconPath : string;
  85. private saved var companionNPCIconPath2 : string;
  86.  
  87.  
  88. private saved var itemSlots : array<SItemUniqueId>;
  89. private var remainingBombThrowDelaySlot1 : float;
  90. private var remainingBombThrowDelaySlot2 : float;
  91. private var previouslyUsedBolt : SItemUniqueId;
  92. private saved var questMarkedSelectedQuickslotItems : array< SSelectedQuickslotItem >;
  93.  
  94. default isThrowingItem = false;
  95. default remainingBombThrowDelaySlot1 = 0.f;
  96. default remainingBombThrowDelaySlot2 = 0.f;
  97.  
  98.  
  99.  
  100.  
  101.  
  102. private saved var tempLearnedSignSkills : array<SSimpleSkill>;
  103. public saved var autoLevel : bool;
  104.  
  105.  
  106.  
  107.  
  108. protected saved var skillBonusPotionEffect : CBaseGameplayEffect;
  109.  
  110.  
  111. public saved var levelManager : W3LevelManager;
  112.  
  113. //---=== modFriendlyHUD ===---
  114. public var prepDisallowOilsInCombat : bool; default prepDisallowOilsInCombat = false;
  115. public var prepOilsHaveAmmo : bool; default prepOilsHaveAmmo = false;
  116. //---=== modFriendlyHUD ===---
  117.  
  118.  
  119. saved var reputationManager : W3Reputation;
  120.  
  121.  
  122. private editable var medallionEntity : CEntityTemplate;
  123. private var medallionController : W3MedallionController;
  124.  
  125.  
  126.  
  127.  
  128. public var bShowRadialMenu : bool;
  129.  
  130. private var _HoldBeforeOpenRadialMenuTime : float;
  131.  
  132. default _HoldBeforeOpenRadialMenuTime = 0.5f;
  133.  
  134. public var MappinToHighlight : array<SHighlightMappin>;
  135.  
  136.  
  137. protected saved var horseManagerHandle : EntityHandle;
  138.  
  139.  
  140. private var isInitialized : bool;
  141. private var timeForPerk21 : float;
  142.  
  143. default isInitialized = false;
  144.  
  145.  
  146. //Ice Breath
  147. var iceBreath : CIceBreath;
  148. var enableIceBreath : bool; default enableIceBreath = false;
  149. //Ice Breath*/
  150.  
  151. private var invUpdateTransaction : bool;
  152. default invUpdateTransaction = false;
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165. event OnSpawned( spawnData : SEntitySpawnData )
  166. {
  167. var i : int;
  168. var items : array<SItemUniqueId>;
  169. var items2 : array<SItemUniqueId>;
  170. var horseTemplate : CEntityTemplate;
  171. var horseManager : W3HorseManager;
  172. var currWorld : CWorld = theGame.GetWorld(); // mod Fast Travel Pack
  173.  
  174. AddAnimEventCallback( 'ActionBlend', 'OnAnimEvent_ActionBlend' );
  175. AddAnimEventCallback('cast_begin', 'OnAnimEvent_Sign');
  176. AddAnimEventCallback('cast_throw', 'OnAnimEvent_Sign');
  177. AddAnimEventCallback('cast_end', 'OnAnimEvent_Sign');
  178. AddAnimEventCallback('cast_friendly_begin', 'OnAnimEvent_Sign');
  179. AddAnimEventCallback('cast_friendly_throw', 'OnAnimEvent_Sign');
  180. AddAnimEventCallback('axii_ready', 'OnAnimEvent_Sign');
  181. AddAnimEventCallback('axii_alternate_ready', 'OnAnimEvent_Sign');
  182. AddAnimEventCallback('yrden_draw_ready', 'OnAnimEvent_Sign');
  183.  
  184. AddAnimEventCallback( 'ProjectileThrow', 'OnAnimEvent_Throwable' );
  185. AddAnimEventCallback( 'OnWeaponReload', 'OnAnimEvent_Throwable' );
  186. AddAnimEventCallback( 'ProjectileAttach', 'OnAnimEvent_Throwable' );
  187. AddAnimEventCallback( 'Mutation11AnimEnd', 'OnAnimEvent_Mutation11AnimEnd' );
  188. AddAnimEventCallback( 'Mutation11ShockWave', 'OnAnimEvent_Mutation11ShockWave' );
  189.  
  190. spawnMyLovelyStashes(); // Additional Stash Locations
  191.  
  192. amountOfSetPiecesEquipped.Resize( EnumGetMax( 'EItemSetType' ) + 1 );
  193.  
  194. runewordInfusionType = ST_None;
  195.  
  196.  
  197. inv = GetInventory();
  198.  
  199.  
  200. signOwner = new W3SignOwnerPlayer in this;
  201. signOwner.Init( this );
  202.  
  203. itemSlots.Resize( EnumGetMax('EEquipmentSlots')+1 );
  204.  
  205. if(!spawnData.restored)
  206. {
  207. levelManager = new W3LevelManager in this;
  208. levelManager.Initialize();
  209.  
  210.  
  211. inv.GetAllItems(items);
  212. for(i=0; i<items.Size(); i+=1)
  213. {
  214. if(inv.IsItemMounted(items[i]) && ( !inv.IsItemBody(items[i]) || inv.GetItemCategory(items[i]) == 'hair' ) )
  215. EquipItem(items[i]);
  216. }
  217.  
  218.  
  219.  
  220.  
  221.  
  222. AddAlchemyRecipe('Recipe for Swallow 1',true,true);
  223. AddAlchemyRecipe('Recipe for Cat 1',true,true);
  224. AddAlchemyRecipe('Recipe for White Honey 1',true,true);
  225.  
  226. AddAlchemyRecipe('Recipe for Samum 1',true,true);
  227. AddAlchemyRecipe('Recipe for Grapeshot 1',true,true);
  228.  
  229. AddAlchemyRecipe('Recipe for Specter Oil 1',true,true);
  230. AddAlchemyRecipe('Recipe for Necrophage Oil 1',true,true);
  231. AddAlchemyRecipe('Recipe for Alcohest 1',true,true);
  232. }
  233. else
  234. {
  235. AddTimer('DelayedOnItemMount', 0.1, true);
  236.  
  237.  
  238. CheckHairItem();
  239. }
  240.  
  241.  
  242. AddStartingSchematics();
  243.  
  244. super.OnSpawned( spawnData );
  245.  
  246.  
  247. AddAlchemyRecipe('Recipe for Mutagen red',true,true);
  248. AddAlchemyRecipe('Recipe for Mutagen green',true,true);
  249. AddAlchemyRecipe('Recipe for Mutagen blue',true,true);
  250. AddAlchemyRecipe('Recipe for Greater mutagen red',true,true);
  251. AddAlchemyRecipe('Recipe for Greater mutagen green',true,true);
  252. AddAlchemyRecipe('Recipe for Greater mutagen blue',true,true);
  253.  
  254. AddCraftingSchematic('Starting Armor Upgrade schematic 1',true,true);
  255.  
  256.  
  257. if( inputHandler )
  258. {
  259. inputHandler.BlockAllActions( 'being_ciri', false );
  260. }
  261. SetBehaviorVariable( 'test_ciri_replacer', 0.0f);
  262.  
  263. if(!spawnData.restored)
  264. {
  265.  
  266. abilityManager.GainStat(BCS_Toxicity, 0);
  267. }
  268.  
  269. levelManager.PostInit(this, spawnData.restored, true);
  270.  
  271. SetBIsCombatActionAllowed( true );
  272. SetBIsInputAllowed( true, 'OnSpawned' );
  273.  
  274.  
  275. if ( !reputationManager )
  276. {
  277. reputationManager = new W3Reputation in this;
  278. reputationManager.Initialize();
  279. }
  280.  
  281. theSound.SoundParameter( "focus_aim", 1.0f, 1.0f );
  282. theSound.SoundParameter( "focus_distance", 0.0f, 1.0f );
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289. currentlyCastSign = ST_None;
  290.  
  291.  
  292. if(!spawnData.restored)
  293. {
  294. horseTemplate = (CEntityTemplate)LoadResource("horse_manager");
  295. horseManager = (W3HorseManager)theGame.CreateEntity(horseTemplate, GetWorldPosition(),,,,,PM_Persist);
  296. horseManager.CreateAttachment(this);
  297. horseManager.OnCreated();
  298. EntityHandleSet( horseManagerHandle, horseManager );
  299. }
  300. else
  301. {
  302. AddTimer('DelayedHorseUpdate', 0.01, true);
  303. }
  304.  
  305. //---=== modFriendlyMeditation ===---
  306. fMeditationConfig = new CModFMeditationConfig in this;
  307. fMeditationConfig.Init();
  308. //---=== modFriendlyMeditation ===---
  309.  
  310.  
  311. RemoveAbility('Ciri_CombatRegen');
  312. RemoveAbility('Ciri_Rage');
  313. RemoveAbility('CiriBlink');
  314. RemoveAbility('CiriCharge');
  315. RemoveAbility('Ciri_Q205');
  316. RemoveAbility('Ciri_Q305');
  317. RemoveAbility('Ciri_Q403');
  318. RemoveAbility('Ciri_Q111');
  319. RemoveAbility('Ciri_Q501');
  320. RemoveAbility('SkillCiri');
  321.  
  322. if(spawnData.restored)
  323. {
  324. RestoreQuen(savedQuenHealth, savedQuenDuration);
  325. }
  326. else
  327. {
  328. savedQuenHealth = 0.f;
  329. savedQuenDuration = 0.f;
  330. }
  331.  
  332. if(spawnData.restored)
  333. {
  334. ApplyPatchFixes();
  335. }
  336. else
  337. {
  338.  
  339. FactsAdd( "new_game_started_in_1_20" );
  340. }
  341.  
  342. if ( spawnData.restored )
  343. {
  344. FixEquippedMutagens();
  345. }
  346.  
  347. if ( FactsQuerySum("NewGamePlus") > 0 )
  348. {
  349. NewGamePlusAdjustDLC1TemerianSet(inv);
  350. NewGamePlusAdjustDLC5NilfgardianSet(inv);
  351. NewGamePlusAdjustDLC10WolfSet(inv);
  352. NewGamePlusAdjustDLC14SkelligeSet(inv);
  353. if(horseManager)
  354. {
  355. NewGamePlusAdjustDLC1TemerianSet(horseManager.GetInventoryComponent());
  356. NewGamePlusAdjustDLC5NilfgardianSet(horseManager.GetInventoryComponent());
  357. NewGamePlusAdjustDLC10WolfSet(horseManager.GetInventoryComponent());
  358. NewGamePlusAdjustDLC14SkelligeSet(horseManager.GetInventoryComponent());
  359. }
  360. }
  361.  
  362.  
  363. ResumeStaminaRegen('WhirlSkill');
  364.  
  365. if(HasAbility('Runeword 4 _Stats', true))
  366. StartVitalityRegen();
  367.  
  368.  
  369. if(HasAbility('sword_s19'))
  370. {
  371. RemoveTemporarySkills();
  372. }
  373.  
  374. HACK_UnequipWolfLiver();
  375.  
  376. // AeroHD -- AutoLootMenu++
  377. mAutoLootConfig = new CAHDAutoLootConfig in this;
  378. mAutoLootNotificationManager = new CAHDAutoLootNotificationManager in this;
  379. AddTimer('InitAHDAutoLoot', 3.0);
  380. // AeroHD -- AutoLootMenu--
  381.  
  382. if( HasBuff( EET_GryphonSetBonusYrden ) )
  383. {
  384. RemoveBuff( EET_GryphonSetBonusYrden, false, "GryphonSetBonusYrden" );
  385. }
  386.  
  387. if( spawnData.restored )
  388. {
  389.  
  390. UpdateEncumbrance();
  391. AddTimer('DelayedLevelUpEquipped', 0.1);
  392.  
  393.  
  394. RemoveBuff( EET_Mutation11Immortal );
  395. RemoveBuff( EET_Mutation11Buff );
  396. }
  397.  
  398.  
  399. theGame.GameplayFactsAdd( "PlayerIsGeralt" );
  400.  
  401. isInitialized = true;
  402.  
  403.  
  404. //Ice Breath
  405. iceBreath = new CIceBreath in this;
  406. AddTimer('IceBreathTimer',5.0,true);
  407. //Ice Breath*/
  408.  
  409. }
  410.  
  411.  
  412. //Ice Breath+
  413. timer function NPCbreathTimer(deltaTime : float , id : int){
  414.  
  415. if(enableIceBreath){
  416. iceBreath.IceBreathEnable();
  417. }
  418. else{
  419. iceBreath.IceBreathDisable();
  420. }
  421. }
  422.  
  423. timer function HorseBreathTimer(deltaTime : float , id : int){
  424.  
  425. iceBreath.HorseBreathEnable();
  426. }
  427.  
  428. timer function IceBreathTimer(deltaTime : float , id : int){
  429.  
  430. if(iceBreath.isCold()){
  431. if(!enableIceBreath){
  432. //theGame.GetGuiManager().ShowNotification("True");
  433. enableIceBreath = true;
  434. thePlayer.PlayEffectSingle('ice_breath_gameplay');
  435. iceBreath.IceBreathEnable();
  436. iceBreath.HorseBreathEnable();
  437. AddTimer('HorseBreathTimer',1.5,true);
  438. AddTimer('NPCbreathTimer',10.0,true);
  439. }
  440. }
  441. else{
  442. if(theGame.GetCommonMapManager().GetCurrentArea() != AN_Spiral){
  443. if(enableIceBreath){
  444. enableIceBreath = false;
  445. //theGame.GetGuiManager().ShowNotification("False");
  446. thePlayer.StopEffect('ice_breath_gameplay');
  447. RemoveTimer( 'HorseBreathTimer' );
  448. }
  449. }
  450. }
  451. //Ice Breath-*/
  452.  
  453. // mod Fast Travel Pack
  454. ftPack = new FastTravelPack in this;
  455. ftPack.Init();
  456. // mod Fast Travel Pack
  457. }
  458. // mod Fast Travel Pack
  459. public function GetFTPack() : FastTravelPack
  460. {
  461. return ftPack;
  462. }
  463. // mod Fast Travel Pack
  464.  
  465. private function HACK_UnequipWolfLiver()
  466. {
  467. var itemName1, itemName2, itemName3, itemName4 : name;
  468. var item1, item2, item3, item4 : SItemUniqueId;
  469.  
  470. GetItemEquippedOnSlot( EES_Potion1, item1 );
  471. GetItemEquippedOnSlot( EES_Potion2, item2 );
  472. GetItemEquippedOnSlot( EES_Potion3, item3 );
  473. GetItemEquippedOnSlot( EES_Potion4, item4 );
  474.  
  475. if ( inv.IsIdValid( item1 ) )
  476. itemName1 = inv.GetItemName( item1 );
  477. if ( inv.IsIdValid( item2 ) )
  478. itemName2 = inv.GetItemName( item2 );
  479. if ( inv.IsIdValid( item3 ) )
  480. itemName3 = inv.GetItemName( item3 );
  481. if ( inv.IsIdValid( item4 ) )
  482. itemName4 = inv.GetItemName( item4 );
  483.  
  484. if ( itemName1 == 'Wolf liver' || itemName3 == 'Wolf liver' )
  485. {
  486. if ( inv.IsIdValid( item1 ) )
  487. UnequipItem( item1 );
  488. if ( inv.IsIdValid( item3 ) )
  489. UnequipItem( item3 );
  490. }
  491. else if ( itemName2 == 'Wolf liver' || itemName4 == 'Wolf liver' )
  492. {
  493. if ( inv.IsIdValid( item2 ) )
  494. UnequipItem( item2 );
  495. if ( inv.IsIdValid( item4 ) )
  496. UnequipItem( item4 );
  497. }
  498. }
  499.  
  500.  
  501.  
  502.  
  503.  
  504. timer function DelayedHorseUpdate( dt : float, id : int )
  505. {
  506. var man : W3HorseManager;
  507.  
  508. man = GetHorseManager();
  509. if(man)
  510. {
  511. if ( man.ApplyHorseUpdateOnSpawn() )
  512. {
  513.  
  514. UpdateEncumbrance();
  515.  
  516. RemoveTimer( 'DelayedHorseUpdate' );
  517. }
  518. }
  519. }
  520.  
  521. timer function DelayedLevelUpEquipped( dt : float, id : int ) //modLevelUpEquipped
  522. {
  523. LevelUpEquipped();
  524. }
  525.  
  526. event OnAbilityAdded( abilityName : name)
  527. {
  528. super.OnAbilityAdded(abilityName);
  529.  
  530. if( HasAbility('Runeword 4 _Stats', true) )
  531. {
  532. StartVitalityRegen();
  533. }
  534.  
  535. if ( abilityName == 'Runeword 8 _Stats' && GetStat(BCS_Focus, true) >= GetStatMax(BCS_Focus) && !HasBuff(EET_Runeword8) )
  536. {
  537. AddEffectDefault(EET_Runeword8, this, "equipped item");
  538. }
  539.  
  540. }
  541.  
  542. private final function AddStartingSchematics()
  543. {
  544. AddCraftingSchematic('Starting Armor Upgrade schematic 1', true,true);
  545. AddCraftingSchematic('Thread schematic', true, true);
  546. AddCraftingSchematic('String schematic', true, true);
  547. AddCraftingSchematic('Linen schematic', true, true);
  548. AddCraftingSchematic('Silk schematic', true, true);
  549. AddCraftingSchematic('Resin schematic', true, true);
  550. AddCraftingSchematic('Blasting powder schematic', true, true);
  551. AddCraftingSchematic('Haft schematic', true, true);
  552. AddCraftingSchematic('Hardened timber schematic', true, true);
  553. AddCraftingSchematic('Leather squares schematic', true, true);
  554. AddCraftingSchematic('Leather schematic', true, true);
  555. AddCraftingSchematic('Hardened leather schematic', true, true);
  556. AddCraftingSchematic('Draconide leather schematic', true, true);
  557. AddCraftingSchematic('Iron ingot schematic', true, true);
  558. AddCraftingSchematic('Steel ingot schematic', true, true);
  559. AddCraftingSchematic('Steel ingot schematic 1', true, true);
  560. AddCraftingSchematic('Steel plate schematic', true, true);
  561. AddCraftingSchematic('Dark iron ingot schematic', true, true);
  562. AddCraftingSchematic('Dark iron plate schematic', true, true);
  563. AddCraftingSchematic('Dark steel ingot schematic', true, true);
  564. AddCraftingSchematic('Dark steel ingot schematic 1', true, true);
  565. AddCraftingSchematic('Dark steel plate schematic', true, true);
  566. AddCraftingSchematic('Silver ore schematic', true, true);
  567. AddCraftingSchematic('Silver ingot schematic', true, true);
  568. AddCraftingSchematic('Silver ingot schematic 1', true, true);
  569. AddCraftingSchematic('Silver plate schematic', true, true);
  570. AddCraftingSchematic('Meteorite ingot schematic', true, true);
  571. AddCraftingSchematic('Meteorite silver ingot schematic', true, true);
  572. AddCraftingSchematic('Meteorite silver plate schematic', true, true);
  573. AddCraftingSchematic('Glowing ingot schematic', true, true);
  574. AddCraftingSchematic('Dwimeryte ore schematic', true, true);
  575. AddCraftingSchematic('Dwimeryte ingot schematic', true, true);
  576. AddCraftingSchematic('Dwimeryte ingot schematic 1', true, true);
  577. AddCraftingSchematic('Dwimeryte plate schematic', true, true);
  578. AddCraftingSchematic('Infused dust schematic', true, true);
  579. AddCraftingSchematic('Infused shard schematic', true, true);
  580. AddCraftingSchematic('Infused crystal schematic', true, true);
  581.  
  582. if ( theGame.GetDLCManager().IsEP2Available() )
  583. {
  584. AddCraftingSchematic('Draconide infused leather schematic', true, true);
  585. AddCraftingSchematic('Nickel ore schematic', true, true);
  586. AddCraftingSchematic('Cupronickel ore schematic', true, true);
  587. AddCraftingSchematic('Copper ore schematic', true, true);
  588. AddCraftingSchematic('Copper ingot schematic', true, true);
  589. AddCraftingSchematic('Copper plate schematic', true, true);
  590. AddCraftingSchematic('Green gold ore schematic', true, true);
  591. AddCraftingSchematic('Green gold ore schematic 1', true, true);
  592. AddCraftingSchematic('Green gold ingot schematic', true, true);
  593. AddCraftingSchematic('Green gold plate schematic', true, true);
  594. AddCraftingSchematic('Orichalcum ore schematic', true, true);
  595. AddCraftingSchematic('Orichalcum ore schematic 1', true, true);
  596. AddCraftingSchematic('Orichalcum ingot schematic', true, true);
  597. AddCraftingSchematic('Orichalcum plate schematic', true, true);
  598. AddCraftingSchematic('Dwimeryte enriched ore schematic', true, true);
  599. AddCraftingSchematic('Dwimeryte enriched ingot schematic', true, true);
  600. AddCraftingSchematic('Dwimeryte enriched plate schematic', true, true);
  601. }
  602. }
  603.  
  604. private final function ApplyPatchFixes()
  605. {
  606. var cnt, transmutationCount, mutagenCount, i, slot : int;
  607. var transmutationAbility, itemName : name;
  608. var pam : W3PlayerAbilityManager;
  609. var slotId : int;
  610. var offset : float;
  611. var buffs : array<CBaseGameplayEffect>;
  612. var mutagen : W3Mutagen_Effect;
  613. var skill : SSimpleSkill;
  614. var spentSkillPoints, swordSkillPointsSpent, alchemySkillPointsSpent, perkSkillPointsSpent, pointsToAdd : int;
  615. var mutagens : array< W3Mutagen_Effect >;
  616.  
  617. if(FactsQuerySum("ClearingPotionPassiveBonusFix") < 1)
  618. {
  619. pam = (W3PlayerAbilityManager)abilityManager;
  620.  
  621. cnt = GetAbilityCount('sword_adrenalinegain') - pam.GetPathPointsSpent(ESP_Sword);
  622. if(cnt > 0)
  623. RemoveAbilityMultiple('sword_adrenalinegain', cnt);
  624.  
  625. cnt = GetAbilityCount('magic_staminaregen') - pam.GetPathPointsSpent(ESP_Signs);
  626. if(cnt > 0)
  627. RemoveAbilityMultiple('magic_staminaregen', cnt);
  628.  
  629. cnt = GetAbilityCount('alchemy_potionduration') - pam.GetPathPointsSpent(ESP_Alchemy);
  630. if(cnt > 0)
  631. RemoveAbilityMultiple('alchemy_potionduration', cnt);
  632.  
  633. FactsAdd("ClearingPotionPassiveBonusFix");
  634. }
  635.  
  636.  
  637. if(FactsQuerySum("DimeritiumSynergyFix") < 1)
  638. {
  639. slotId = GetSkillSlotID(S_Alchemy_s19);
  640. if(slotId != -1)
  641. UnequipSkill(S_Alchemy_s19);
  642.  
  643. RemoveAbilityAll('greater_mutagen_color_green_synergy_bonus');
  644. RemoveAbilityAll('mutagen_color_green_synergy_bonus');
  645. RemoveAbilityAll('mutagen_color_lesser_green_synergy_bonus');
  646.  
  647. RemoveAbilityAll('greater_mutagen_color_blue_synergy_bonus');
  648. RemoveAbilityAll('mutagen_color_blue_synergy_bonus');
  649. RemoveAbilityAll('mutagen_color_lesser_blue_synergy_bonus');
  650.  
  651. RemoveAbilityAll('greater_mutagen_color_red_synergy_bonus');
  652. RemoveAbilityAll('mutagen_color_red_synergy_bonus');
  653. RemoveAbilityAll('mutagen_color_lesser_red_synergy_bonus');
  654.  
  655. if(slotId != -1)
  656. EquipSkill(S_Alchemy_s19, slotId);
  657.  
  658. FactsAdd("DimeritiumSynergyFix");
  659. }
  660.  
  661.  
  662. if(FactsQuerySum("DontShowRecipePinTut") < 1)
  663. {
  664. FactsAdd( "DontShowRecipePinTut" );
  665. TutorialScript('alchemyRecipePin', '');
  666. TutorialScript('craftingRecipePin', '');
  667. }
  668.  
  669.  
  670. if(FactsQuerySum("LevelReqPotGiven") < 1)
  671. {
  672. FactsAdd("LevelReqPotGiven");
  673. inv.AddAnItem('Wolf Hour', 1, false, false, true);
  674. }
  675.  
  676.  
  677. if(!HasBuff(EET_AutoStaminaRegen))
  678. {
  679. AddEffectDefault(EET_AutoStaminaRegen, this, 'autobuff', false);
  680. }
  681.  
  682.  
  683.  
  684. buffs = GetBuffs();
  685. offset = 0;
  686. mutagenCount = 0;
  687. for(i=0; i<buffs.Size(); i+=1)
  688. {
  689. mutagen = (W3Mutagen_Effect)buffs[i];
  690. if(mutagen)
  691. {
  692. offset += mutagen.GetToxicityOffset();
  693. mutagenCount += 1;
  694. }
  695. }
  696.  
  697.  
  698. if(offset != (GetStat(BCS_Toxicity) - GetStat(BCS_Toxicity, true)))
  699. SetToxicityOffset(offset);
  700.  
  701.  
  702. mutagenCount *= GetSkillLevel(S_Alchemy_s13);
  703. transmutationAbility = GetSkillAbilityName(S_Alchemy_s13);
  704. transmutationCount = GetAbilityCount(transmutationAbility);
  705. if(mutagenCount < transmutationCount)
  706. {
  707. RemoveAbilityMultiple(transmutationAbility, transmutationCount - mutagenCount);
  708. }
  709. else if(mutagenCount > transmutationCount)
  710. {
  711. AddAbilityMultiple(transmutationAbility, mutagenCount - transmutationCount);
  712. }
  713.  
  714.  
  715. if(theGame.GetDLCManager().IsEP1Available())
  716. {
  717. theGame.GetJournalManager().ActivateEntryByScriptTag('TutorialJournalEnchanting', JS_Active);
  718. }
  719.  
  720.  
  721. if(HasAbility('sword_s19') && FactsQuerySum("Patch_Sword_s19") < 1)
  722. {
  723. pam = (W3PlayerAbilityManager)abilityManager;
  724.  
  725.  
  726. skill.level = 0;
  727. for(i = S_Magic_s01; i <= S_Magic_s20; i+=1)
  728. {
  729. skill.skillType = i;
  730. pam.RemoveTemporarySkill(skill);
  731. }
  732.  
  733.  
  734. spentSkillPoints = levelManager.GetPointsUsed(ESkillPoint);
  735. swordSkillPointsSpent = pam.GetPathPointsSpent(ESP_Sword);
  736. alchemySkillPointsSpent = pam.GetPathPointsSpent(ESP_Alchemy);
  737. perkSkillPointsSpent = pam.GetPathPointsSpent(ESP_Perks);
  738.  
  739. pointsToAdd = spentSkillPoints - swordSkillPointsSpent - alchemySkillPointsSpent - perkSkillPointsSpent;
  740. if(pointsToAdd > 0)
  741. levelManager.UnspendPoints(ESkillPoint, pointsToAdd);
  742.  
  743.  
  744. RemoveAbilityAll('sword_s19');
  745.  
  746.  
  747. FactsAdd("Patch_Sword_s19");
  748. }
  749.  
  750.  
  751. if( HasAbility( 'sword_s19' ) )
  752. {
  753. RemoveAbilityAll( 'sword_s19' );
  754. }
  755.  
  756.  
  757. if(FactsQuerySum("Patch_Armor_Type_Glyphwords") < 1)
  758. {
  759. pam = (W3PlayerAbilityManager)abilityManager;
  760.  
  761. pam.SetPerkArmorBonus( S_Perk_05, this );
  762. pam.SetPerkArmorBonus( S_Perk_06, this );
  763. pam.SetPerkArmorBonus( S_Perk_07, this );
  764.  
  765. FactsAdd("Patch_Armor_Type_Glyphwords");
  766. }
  767. else if( FactsQuerySum("154999") < 1 )
  768. {
  769.  
  770. pam = (W3PlayerAbilityManager)abilityManager;
  771.  
  772. pam.SetPerkArmorBonus( S_Perk_05, this );
  773. pam.SetPerkArmorBonus( S_Perk_06, this );
  774. pam.SetPerkArmorBonus( S_Perk_07, this );
  775.  
  776. FactsAdd("154999");
  777. }
  778.  
  779. if( FactsQuerySum( "Patch_Decoction_Buff_Icons" ) < 1 )
  780. {
  781. mutagens = GetMutagenBuffs();
  782. for( i=0; i<mutagens.Size(); i+=1 )
  783. {
  784. itemName = DecoctionEffectTypeToItemName( mutagens[i].GetEffectType() );
  785. mutagens[i].OverrideIcon( itemName );
  786. }
  787.  
  788. FactsAdd( "Patch_Decoction_Buff_Icons" );
  789. }
  790.  
  791.  
  792. if( FactsQuerySum( "154997" ) < 1 )
  793. {
  794. if( IsSkillEquipped( S_Alchemy_s18 ) )
  795. {
  796. slot = GetSkillSlotID( S_Alchemy_s18 );
  797. UnequipSkill( slot );
  798. EquipSkill( S_Alchemy_s18, slot );
  799. }
  800. FactsAdd( "154997" );
  801. }
  802. if( FactsQuerySum( "Patch_Mutagen_Ing_Stacking" ) < 1 )
  803. {
  804. Patch_MutagenStacking();
  805. FactsAdd( "Patch_Mutagen_Ing_Stacking" );
  806. }
  807. }
  808.  
  809. private final function Patch_MutagenStacking()
  810. {
  811. var i, j, quantity : int;
  812. var muts : array< SItemUniqueId >;
  813. var item : SItemUniqueId;
  814. var mutName : name;
  815. var wasInArray : bool;
  816. var mutsToAdd : array< SItemParts >;
  817. var mutToAdd : SItemParts;
  818.  
  819. muts = inv.GetItemsByTag( 'MutagenIngredient' );
  820. if( GetItemEquippedOnSlot( EES_SkillMutagen1, item ) )
  821. {
  822. muts.Remove( item );
  823. inv.SetItemStackable( item, false );
  824. }
  825. if( GetItemEquippedOnSlot( EES_SkillMutagen2, item ) )
  826. {
  827. muts.Remove( item );
  828. inv.SetItemStackable( item, false );
  829. }
  830. if( GetItemEquippedOnSlot( EES_SkillMutagen3, item ) )
  831. {
  832. muts.Remove( item );
  833. inv.SetItemStackable( item, false );
  834. }
  835. if( GetItemEquippedOnSlot( EES_SkillMutagen4, item ) )
  836. {
  837. muts.Remove( item );
  838. inv.SetItemStackable( item, false );
  839. }
  840. muts = SSS_Patch_MutagenStacking(muts); //zur13 modSSS mutTabs
  841. for( i=0; i<muts.Size(); i+=1 )
  842. {
  843. mutName = inv.GetItemName( muts[i] );
  844. quantity = inv.GetItemQuantity( muts[i] );
  845.  
  846. wasInArray = false;
  847. for( j=0; j<mutsToAdd.Size(); j+=1 )
  848. {
  849. if( mutsToAdd[j].itemName == mutName )
  850. {
  851. mutsToAdd[j].quantity += quantity;
  852. wasInArray = true;
  853. break;
  854. }
  855. }
  856.  
  857. if( !wasInArray )
  858. {
  859. mutToAdd.itemName = mutName;
  860. mutToAdd.quantity = quantity;
  861. mutsToAdd.PushBack( mutToAdd );
  862. }
  863.  
  864. inv.RemoveItem( muts[i], quantity );
  865. }
  866.  
  867. for( i=0; i<mutsToAdd.Size(); i+=1 )
  868. {
  869. inv.AddAnItem( mutsToAdd[i].itemName, mutsToAdd[i].quantity, true, true );
  870. }
  871. }
  872.  
  873. private function FixEquippedMutagens()
  874. {
  875. var item : SItemUniqueId;
  876. if( GetItemEquippedOnSlot( EES_SkillMutagen1, item ) )
  877. {
  878. inv.SetItemStackable( item, false );
  879. }
  880. if( GetItemEquippedOnSlot( EES_SkillMutagen2, item ) )
  881. {
  882. inv.SetItemStackable( item, false );
  883. }
  884. if( GetItemEquippedOnSlot( EES_SkillMutagen3, item ) )
  885. {
  886. inv.SetItemStackable( item, false );
  887. }
  888. if( GetItemEquippedOnSlot( EES_SkillMutagen4, item ) )
  889. {
  890. inv.SetItemStackable( item, false );
  891. } SSS_FixEquippedMutagens(); //zur13 modSSS mutTabs
  892. }
  893.  
  894. public final function RestoreQuen( quenHealth : float, quenDuration : float, optional alternate : bool ) : bool
  895. {
  896. var restoredQuen : W3QuenEntity;
  897.  
  898. if(quenHealth > 0.f && quenDuration >= 3.f)
  899. {
  900. restoredQuen = (W3QuenEntity)theGame.CreateEntity( signs[ST_Quen].template, GetWorldPosition(), GetWorldRotation() );
  901. restoredQuen.Init( signOwner, signs[ST_Quen].entity, true );
  902.  
  903. if( alternate )
  904. {
  905. restoredQuen.SetAlternateCast( S_Magic_s04 );
  906. }
  907.  
  908. restoredQuen.OnStarted();
  909. restoredQuen.OnThrowing();
  910.  
  911. if( !alternate )
  912. {
  913. restoredQuen.OnEnded();
  914. }
  915.  
  916. restoredQuen.SetDataFromRestore(quenHealth, quenDuration);
  917.  
  918. return true;
  919. }
  920.  
  921. return false;
  922. }
  923.  
  924. public function IsInitialized() : bool
  925. {
  926. return isInitialized;
  927. }
  928.  
  929. private function NewGamePlusInitialize()
  930. {
  931. var questItems : array<name>;
  932. var horseManager : W3HorseManager;
  933. var horseInventory : CInventoryComponent;
  934. var i, missingLevels, expDiff : int;
  935.  
  936. super.NewGamePlusInitialize();
  937.  
  938.  
  939. horseManager = (W3HorseManager)EntityHandleGet(horseManagerHandle);
  940. if(horseManager)
  941. horseInventory = horseManager.GetInventoryComponent();
  942.  
  943.  
  944. theGame.params.SetNewGamePlusLevel(GetLevel());
  945.  
  946.  
  947. if (theGame.GetDLCManager().IsDLCAvailable('ep1'))
  948. missingLevels = theGame.params.NEW_GAME_PLUS_EP1_MIN_LEVEL - GetLevel();
  949. else
  950. missingLevels = theGame.params.NEW_GAME_PLUS_MIN_LEVEL - GetLevel();
  951.  
  952. for(i=0; i<missingLevels; i+=1)
  953. {
  954.  
  955. expDiff = levelManager.GetTotalExpForNextLevel() - levelManager.GetPointsTotal(EExperiencePoint);
  956. expDiff = CeilF( ((float)expDiff) / 2 );
  957. AddPoints(EExperiencePoint, expDiff, false);
  958. }
  959.  
  960.  
  961.  
  962.  
  963.  
  964. inv.RemoveItemByTag('Quest', -1);
  965. horseInventory.RemoveItemByTag('Quest', -1);
  966.  
  967.  
  968.  
  969. questItems = theGame.GetDefinitionsManager().GetItemsWithTag('Quest');
  970. for(i=0; i<questItems.Size(); i+=1)
  971. {
  972. inv.RemoveItemByName(questItems[i], -1);
  973. horseInventory.RemoveItemByName(questItems[i], -1);
  974. }
  975.  
  976.  
  977. inv.RemoveItemByName('mq1002_artifact_3', -1);
  978. horseInventory.RemoveItemByName('mq1002_artifact_3', -1);
  979.  
  980.  
  981. inv.RemoveItemByTag('NotTransferableToNGP', -1);
  982. horseInventory.RemoveItemByTag('NotTransferableToNGP', -1);
  983.  
  984.  
  985. inv.RemoveItemByTag('NoticeBoardNote', -1);
  986. horseInventory.RemoveItemByTag('NoticeBoardNote', -1);
  987.  
  988.  
  989. RemoveAllNonAutoBuffs();
  990.  
  991.  
  992. RemoveAlchemyRecipe('Recipe for Trial Potion Kit');
  993. RemoveAlchemyRecipe('Recipe for Pops Antidote');
  994. RemoveAlchemyRecipe('Recipe for Czart Lure');
  995. RemoveAlchemyRecipe('q603_diarrhea_potion_recipe');
  996.  
  997.  
  998. inv.RemoveItemByTag('Trophy', -1);
  999. horseInventory.RemoveItemByTag('Trophy', -1);
  1000.  
  1001.  
  1002. inv.RemoveItemByCategory('usable', -1);
  1003. horseInventory.RemoveItemByCategory('usable', -1);
  1004.  
  1005.  
  1006. RemoveAbility('StaminaTutorialProlog');
  1007. RemoveAbility('TutorialStaminaRegenHack');
  1008. RemoveAbility('area_novigrad');
  1009. RemoveAbility('NoRegenEffect');
  1010. RemoveAbility('HeavySwimmingStaminaDrain');
  1011. RemoveAbility('AirBoost');
  1012. RemoveAbility('area_nml');
  1013. RemoveAbility('area_skellige');
  1014.  
  1015.  
  1016. inv.RemoveItemByTag('GwintCard', -1);
  1017. horseInventory.RemoveItemByTag('GwintCard', -1);
  1018.  
  1019.  
  1020.  
  1021. inv.RemoveItemByTag('ReadableItem', -1);
  1022. horseInventory.RemoveItemByTag('ReadableItem', -1);
  1023.  
  1024.  
  1025. abilityManager.RestoreStats();
  1026.  
  1027.  
  1028. ((W3PlayerAbilityManager)abilityManager).RemoveToxicityOffset(10000);
  1029.  
  1030.  
  1031. GetInventory().SingletonItemsRefillAmmo();
  1032.  
  1033.  
  1034. craftingSchematics.Clear();
  1035. AddStartingSchematics();
  1036.  
  1037.  
  1038. for( i=0; i<amountOfSetPiecesEquipped.Size(); i+=1 )
  1039. {
  1040. amountOfSetPiecesEquipped[i] = 0;
  1041. }
  1042.  
  1043.  
  1044. inv.AddAnItem('Clearing Potion', 1, true, false, false);
  1045.  
  1046.  
  1047. inv.RemoveItemByName('q203_broken_eyeofloki', -1);
  1048. horseInventory.RemoveItemByName('q203_broken_eyeofloki', -1);
  1049.  
  1050.  
  1051. NewGamePlusReplaceViperSet(inv);
  1052. NewGamePlusReplaceViperSet(horseInventory);
  1053. NewGamePlusReplaceLynxSet(inv);
  1054. NewGamePlusReplaceLynxSet(horseInventory);
  1055. NewGamePlusReplaceGryphonSet(inv);
  1056. NewGamePlusReplaceGryphonSet(horseInventory);
  1057. NewGamePlusReplaceBearSet(inv);
  1058. NewGamePlusReplaceBearSet(horseInventory);
  1059. NewGamePlusReplaceEP1(inv);
  1060. NewGamePlusReplaceEP1(horseInventory);
  1061. NewGamePlusReplaceEP2WitcherSets(inv);
  1062. NewGamePlusReplaceEP2WitcherSets(horseInventory);
  1063. NewGamePlusReplaceEP2Items(inv);
  1064. NewGamePlusReplaceEP2Items(horseInventory);
  1065. NewGamePlusMarkItemsToNotAdjust(inv);
  1066. NewGamePlusMarkItemsToNotAdjust(horseInventory);
  1067.  
  1068.  
  1069. inputHandler.ClearLocksForNGP();
  1070.  
  1071.  
  1072. buffImmunities.Clear();
  1073. buffRemovedImmunities.Clear();
  1074.  
  1075. newGamePlusInitialized = true;
  1076.  
  1077.  
  1078. m_quenReappliedCount = 1;
  1079. }
  1080.  
  1081. private final function NewGamePlusMarkItemsToNotAdjust(out inv : CInventoryComponent)
  1082. {
  1083. var ids : array<SItemUniqueId>;
  1084. var i : int;
  1085. var n : name;
  1086.  
  1087. inv.GetAllItems(ids);
  1088. for( i=0; i<ids.Size(); i+=1 )
  1089. {
  1090. inv.SetItemModifierInt(ids[i], 'NGPItemAdjusted', 1);
  1091. }
  1092. }
  1093.  
  1094. private final function NewGamePlusReplaceItem( item : name, new_item : name, out inv : CInventoryComponent)
  1095. {
  1096. var i, j : int;
  1097. var ids, new_ids, enh_ids : array<SItemUniqueId>;
  1098. var dye_ids : array<SItemUniqueId>;
  1099. var enh : array<name>;
  1100. var wasEquipped : bool;
  1101. var wasEnchanted : bool;
  1102. var wasDyed : bool;
  1103. var enchantName, colorName : name;
  1104.  
  1105. if ( inv.HasItem( item ) )
  1106. {
  1107. ids = inv.GetItemsIds(item);
  1108. for (i = 0; i < ids.Size(); i += 1)
  1109. {
  1110. inv.GetItemEnhancementItems( ids[i], enh );
  1111. wasEnchanted = inv.IsItemEnchanted( ids[i] );
  1112. if ( wasEnchanted )
  1113. enchantName = inv.GetEnchantment( ids[i] );
  1114. wasEquipped = IsItemEquipped( ids[i] );
  1115. wasDyed = inv.IsItemColored( ids[i] );
  1116. if ( wasDyed )
  1117. {
  1118. colorName = inv.GetItemColor( ids[i] );
  1119. }
  1120.  
  1121. inv.RemoveItem( ids[i], 1 );
  1122. new_ids = inv.AddAnItem( new_item, 1, true, true, false );
  1123. if ( wasEquipped )
  1124. {
  1125. EquipItem( new_ids[0] );
  1126. }
  1127. if ( wasEnchanted )
  1128. {
  1129. inv.EnchantItem( new_ids[0], enchantName, getEnchamtmentStatName(enchantName) );
  1130. }
  1131. for (j = 0; j < enh.Size(); j += 1)
  1132. {
  1133. enh_ids = inv.AddAnItem( enh[j], 1, true, true, false );
  1134. inv.EnhanceItemScript( new_ids[0], enh_ids[0] );
  1135. }
  1136. if ( wasDyed )
  1137. {
  1138. dye_ids = inv.AddAnItem( colorName, 1, true, true, false );
  1139. inv.ColorItem( new_ids[0], dye_ids[0] );
  1140. inv.RemoveItem( dye_ids[0], 1 );
  1141. }
  1142.  
  1143. inv.SetItemModifierInt( new_ids[0], 'NGPItemAdjusted', 1 );
  1144. }
  1145. }
  1146. }
  1147.  
  1148. private final function NewGamePlusAdjustDLCItem(item : name, mod : name, inv : CInventoryComponent)
  1149. {
  1150. var ids : array<SItemUniqueId>;
  1151. var i : int;
  1152.  
  1153. if( inv.HasItem(item) )
  1154. {
  1155. ids = inv.GetItemsIds(item);
  1156. for (i = 0; i < ids.Size(); i += 1)
  1157. {
  1158. if ( inv.GetItemModifierInt(ids[i], 'DoNotAdjustNGPDLC') <= 0 )
  1159. {
  1160. inv.AddItemBaseAbility(ids[i], mod);
  1161. inv.SetItemModifierInt(ids[i], 'DoNotAdjustNGPDLC', 1);
  1162. }
  1163. }
  1164. }
  1165.  
  1166. }
  1167.  
  1168. private final function NewGamePlusAdjustDLC1TemerianSet(inv : CInventoryComponent)
  1169. {
  1170. NewGamePlusAdjustDLCItem('NGP DLC1 Temerian Armor', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1171. NewGamePlusAdjustDLCItem('NGP DLC1 Temerian Gloves', 'NGP DLC Compatibility Armor Mod', inv);
  1172. NewGamePlusAdjustDLCItem('NGP DLC1 Temerian Pants', 'NGP DLC Compatibility Armor Mod', inv);
  1173. NewGamePlusAdjustDLCItem('NGP DLC1 Temerian Boots', 'NGP DLC Compatibility Armor Mod', inv);
  1174. }
  1175.  
  1176. private final function NewGamePlusAdjustDLC5NilfgardianSet(inv : CInventoryComponent)
  1177. {
  1178. NewGamePlusAdjustDLCItem('NGP DLC5 Nilfgaardian Armor', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1179. NewGamePlusAdjustDLCItem('NGP DLC5 Nilfgaardian Gloves', 'NGP DLC Compatibility Armor Mod', inv);
  1180. NewGamePlusAdjustDLCItem('NGP DLC5 Nilfgaardian Pants', 'NGP DLC Compatibility Armor Mod', inv);
  1181. NewGamePlusAdjustDLCItem('NGP DLC5 Nilfgaardian Boots', 'NGP DLC Compatibility Armor Mod', inv);
  1182. }
  1183.  
  1184. private final function NewGamePlusAdjustDLC10WolfSet(inv : CInventoryComponent)
  1185. {
  1186. NewGamePlusAdjustDLCItem('NGP Wolf Armor', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1187. NewGamePlusAdjustDLCItem('NGP Wolf Armor 1', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1188. NewGamePlusAdjustDLCItem('NGP Wolf Armor 2', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1189. NewGamePlusAdjustDLCItem('NGP Wolf Armor 3', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1190.  
  1191. NewGamePlusAdjustDLCItem('NGP Wolf Boots 1', 'NGP DLC Compatibility Armor Mod', inv);
  1192. NewGamePlusAdjustDLCItem('NGP Wolf Boots 2', 'NGP DLC Compatibility Armor Mod', inv);
  1193. NewGamePlusAdjustDLCItem('NGP Wolf Boots 3', 'NGP DLC Compatibility Armor Mod', inv);
  1194. NewGamePlusAdjustDLCItem('NGP Wolf Boots 4', 'NGP DLC Compatibility Armor Mod', inv);
  1195.  
  1196. NewGamePlusAdjustDLCItem('NGP Wolf Gloves 1', 'NGP DLC Compatibility Armor Mod', inv);
  1197. NewGamePlusAdjustDLCItem('NGP Wolf Gloves 2', 'NGP DLC Compatibility Armor Mod', inv);
  1198. NewGamePlusAdjustDLCItem('NGP Wolf Gloves 3', 'NGP DLC Compatibility Armor Mod', inv);
  1199. NewGamePlusAdjustDLCItem('NGP Wolf Gloves 4', 'NGP DLC Compatibility Armor Mod', inv);
  1200.  
  1201. NewGamePlusAdjustDLCItem('NGP Wolf Pants 1', 'NGP DLC Compatibility Armor Mod', inv);
  1202. NewGamePlusAdjustDLCItem('NGP Wolf Pants 2', 'NGP DLC Compatibility Armor Mod', inv);
  1203. NewGamePlusAdjustDLCItem('NGP Wolf Pants 3', 'NGP DLC Compatibility Armor Mod', inv);
  1204. NewGamePlusAdjustDLCItem('NGP Wolf Pants 4', 'NGP DLC Compatibility Armor Mod', inv);
  1205.  
  1206. NewGamePlusAdjustDLCItem('NGP Wolf School steel sword', 'NGP Wolf Steel Sword Mod', inv);
  1207. NewGamePlusAdjustDLCItem('NGP Wolf School steel sword 1', 'NGP Wolf Steel Sword Mod', inv);
  1208. NewGamePlusAdjustDLCItem('NGP Wolf School steel sword 2', 'NGP Wolf Steel Sword Mod', inv);
  1209. NewGamePlusAdjustDLCItem('NGP Wolf School steel sword 3', 'NGP Wolf Steel Sword Mod', inv);
  1210.  
  1211. NewGamePlusAdjustDLCItem('NGP Wolf School silver sword', 'NGP Wolf Silver Sword Mod', inv);
  1212. NewGamePlusAdjustDLCItem('NGP Wolf School silver sword 1', 'NGP Wolf Silver Sword Mod', inv);
  1213. NewGamePlusAdjustDLCItem('NGP Wolf School silver sword 2', 'NGP Wolf Silver Sword Mod', inv);
  1214. NewGamePlusAdjustDLCItem('NGP Wolf School silver sword 3', 'NGP Wolf Silver Sword Mod', inv);
  1215. }
  1216.  
  1217. private final function NewGamePlusAdjustDLC14SkelligeSet(inv : CInventoryComponent)
  1218. {
  1219. NewGamePlusAdjustDLCItem('NGP DLC14 Skellige Armor', 'NGP DLC Compatibility Chest Armor Mod', inv);
  1220. NewGamePlusAdjustDLCItem('NGP DLC14 Skellige Gloves', 'NGP DLC Compatibility Armor Mod', inv);
  1221. NewGamePlusAdjustDLCItem('NGP DLC14 Skellige Pants', 'NGP DLC Compatibility Armor Mod', inv);
  1222. NewGamePlusAdjustDLCItem('NGP DLC14 Skellige Boots', 'NGP DLC Compatibility Armor Mod', inv);
  1223. }
  1224.  
  1225. private final function NewGamePlusReplaceViperSet(out inv : CInventoryComponent)
  1226. {
  1227. NewGamePlusReplaceItem('Viper School steel sword', 'NGP Viper School steel sword', inv);
  1228.  
  1229. NewGamePlusReplaceItem('Viper School silver sword', 'NGP Viper School silver sword', inv);
  1230. }
  1231.  
  1232. private final function NewGamePlusReplaceLynxSet(out inv : CInventoryComponent)
  1233. {
  1234. NewGamePlusReplaceItem('Lynx Armor', 'NGP Lynx Armor', inv);
  1235. NewGamePlusReplaceItem('Lynx Armor 1', 'NGP Lynx Armor 1', inv);
  1236. NewGamePlusReplaceItem('Lynx Armor 2', 'NGP Lynx Armor 2', inv);
  1237. NewGamePlusReplaceItem('Lynx Armor 3', 'NGP Lynx Armor 3', inv);
  1238.  
  1239. NewGamePlusReplaceItem('Lynx Gloves 1', 'NGP Lynx Gloves 1', inv);
  1240. NewGamePlusReplaceItem('Lynx Gloves 2', 'NGP Lynx Gloves 2', inv);
  1241. NewGamePlusReplaceItem('Lynx Gloves 3', 'NGP Lynx Gloves 3', inv);
  1242. NewGamePlusReplaceItem('Lynx Gloves 4', 'NGP Lynx Gloves 4', inv);
  1243.  
  1244. NewGamePlusReplaceItem('Lynx Pants 1', 'NGP Lynx Pants 1', inv);
  1245. NewGamePlusReplaceItem('Lynx Pants 2', 'NGP Lynx Pants 2', inv);
  1246. NewGamePlusReplaceItem('Lynx Pants 3', 'NGP Lynx Pants 3', inv);
  1247. NewGamePlusReplaceItem('Lynx Pants 4', 'NGP Lynx Pants 4', inv);
  1248.  
  1249. NewGamePlusReplaceItem('Lynx Boots 1', 'NGP Lynx Boots 1', inv);
  1250. NewGamePlusReplaceItem('Lynx Boots 2', 'NGP Lynx Boots 2', inv);
  1251. NewGamePlusReplaceItem('Lynx Boots 3', 'NGP Lynx Boots 3', inv);
  1252. NewGamePlusReplaceItem('Lynx Boots 4', 'NGP Lynx Boots 4', inv);
  1253.  
  1254. NewGamePlusReplaceItem('Lynx School steel sword', 'NGP Lynx School steel sword', inv);
  1255. NewGamePlusReplaceItem('Lynx School steel sword 1', 'NGP Lynx School steel sword 1', inv);
  1256. NewGamePlusReplaceItem('Lynx School steel sword 2', 'NGP Lynx School steel sword 2', inv);
  1257. NewGamePlusReplaceItem('Lynx School steel sword 3', 'NGP Lynx School steel sword 3', inv);
  1258.  
  1259. NewGamePlusReplaceItem('Lynx School silver sword', 'NGP Lynx School silver sword', inv);
  1260. NewGamePlusReplaceItem('Lynx School silver sword 1', 'NGP Lynx School silver sword 1', inv);
  1261. NewGamePlusReplaceItem('Lynx School silver sword 2', 'NGP Lynx School silver sword 2', inv);
  1262. NewGamePlusReplaceItem('Lynx School silver sword 3', 'NGP Lynx School silver sword 3', inv);
  1263. }
  1264.  
  1265. private final function NewGamePlusReplaceGryphonSet(out inv : CInventoryComponent)
  1266. {
  1267. NewGamePlusReplaceItem('Gryphon Armor', 'NGP Gryphon Armor', inv);
  1268. NewGamePlusReplaceItem('Gryphon Armor 1', 'NGP Gryphon Armor 1', inv);
  1269. NewGamePlusReplaceItem('Gryphon Armor 2', 'NGP Gryphon Armor 2', inv);
  1270. NewGamePlusReplaceItem('Gryphon Armor 3', 'NGP Gryphon Armor 3', inv);
  1271.  
  1272. NewGamePlusReplaceItem('Gryphon Gloves 1', 'NGP Gryphon Gloves 1', inv);
  1273. NewGamePlusReplaceItem('Gryphon Gloves 2', 'NGP Gryphon Gloves 2', inv);
  1274. NewGamePlusReplaceItem('Gryphon Gloves 3', 'NGP Gryphon Gloves 3', inv);
  1275. NewGamePlusReplaceItem('Gryphon Gloves 4', 'NGP Gryphon Gloves 4', inv);
  1276.  
  1277. NewGamePlusReplaceItem('Gryphon Pants 1', 'NGP Gryphon Pants 1', inv);
  1278. NewGamePlusReplaceItem('Gryphon Pants 2', 'NGP Gryphon Pants 2', inv);
  1279. NewGamePlusReplaceItem('Gryphon Pants 3', 'NGP Gryphon Pants 3', inv);
  1280. NewGamePlusReplaceItem('Gryphon Pants 4', 'NGP Gryphon Pants 4', inv);
  1281.  
  1282. NewGamePlusReplaceItem('Gryphon Boots 1', 'NGP Gryphon Boots 1', inv);
  1283. NewGamePlusReplaceItem('Gryphon Boots 2', 'NGP Gryphon Boots 2', inv);
  1284. NewGamePlusReplaceItem('Gryphon Boots 3', 'NGP Gryphon Boots 3', inv);
  1285. NewGamePlusReplaceItem('Gryphon Boots 4', 'NGP Gryphon Boots 4', inv);
  1286.  
  1287. NewGamePlusReplaceItem('Gryphon School steel sword', 'NGP Gryphon School steel sword', inv);
  1288. NewGamePlusReplaceItem('Gryphon School steel sword 1', 'NGP Gryphon School steel sword 1', inv);
  1289. NewGamePlusReplaceItem('Gryphon School steel sword 2', 'NGP Gryphon School steel sword 2', inv);
  1290. NewGamePlusReplaceItem('Gryphon School steel sword 3', 'NGP Gryphon School steel sword 3', inv);
  1291.  
  1292. NewGamePlusReplaceItem('Gryphon School silver sword', 'NGP Gryphon School silver sword', inv);
  1293. NewGamePlusReplaceItem('Gryphon School silver sword 1', 'NGP Gryphon School silver sword 1', inv);
  1294. NewGamePlusReplaceItem('Gryphon School silver sword 2', 'NGP Gryphon School silver sword 2', inv);
  1295. NewGamePlusReplaceItem('Gryphon School silver sword 3', 'NGP Gryphon School silver sword 3', inv);
  1296. }
  1297.  
  1298. private final function NewGamePlusReplaceBearSet(out inv : CInventoryComponent)
  1299. {
  1300. NewGamePlusReplaceItem('Bear Armor', 'NGP Bear Armor', inv);
  1301. NewGamePlusReplaceItem('Bear Armor 1', 'NGP Bear Armor 1', inv);
  1302. NewGamePlusReplaceItem('Bear Armor 2', 'NGP Bear Armor 2', inv);
  1303. NewGamePlusReplaceItem('Bear Armor 3', 'NGP Bear Armor 3', inv);
  1304.  
  1305. NewGamePlusReplaceItem('Bear Gloves 1', 'NGP Bear Gloves 1', inv);
  1306. NewGamePlusReplaceItem('Bear Gloves 2', 'NGP Bear Gloves 2', inv);
  1307. NewGamePlusReplaceItem('Bear Gloves 3', 'NGP Bear Gloves 3', inv);
  1308. NewGamePlusReplaceItem('Bear Gloves 4', 'NGP Bear Gloves 4', inv);
  1309.  
  1310. NewGamePlusReplaceItem('Bear Pants 1', 'NGP Bear Pants 1', inv);
  1311. NewGamePlusReplaceItem('Bear Pants 2', 'NGP Bear Pants 2', inv);
  1312. NewGamePlusReplaceItem('Bear Pants 3', 'NGP Bear Pants 3', inv);
  1313. NewGamePlusReplaceItem('Bear Pants 4', 'NGP Bear Pants 4', inv);
  1314.  
  1315. NewGamePlusReplaceItem('Bear Boots 1', 'NGP Bear Boots 1', inv);
  1316. NewGamePlusReplaceItem('Bear Boots 2', 'NGP Bear Boots 2', inv);
  1317. NewGamePlusReplaceItem('Bear Boots 3', 'NGP Bear Boots 3', inv);
  1318. NewGamePlusReplaceItem('Bear Boots 4', 'NGP Bear Boots 4', inv);
  1319.  
  1320. NewGamePlusReplaceItem('Bear School steel sword', 'NGP Bear School steel sword', inv);
  1321. NewGamePlusReplaceItem('Bear School steel sword 1', 'NGP Bear School steel sword 1', inv);
  1322. NewGamePlusReplaceItem('Bear School steel sword 2', 'NGP Bear School steel sword 2', inv);
  1323. NewGamePlusReplaceItem('Bear School steel sword 3', 'NGP Bear School steel sword 3', inv);
  1324.  
  1325. NewGamePlusReplaceItem('Bear School silver sword', 'NGP Bear School silver sword', inv);
  1326. NewGamePlusReplaceItem('Bear School silver sword 1', 'NGP Bear School silver sword 1', inv);
  1327. NewGamePlusReplaceItem('Bear School silver sword 2', 'NGP Bear School silver sword 2', inv);
  1328. NewGamePlusReplaceItem('Bear School silver sword 3', 'NGP Bear School silver sword 3', inv);
  1329. }
  1330.  
  1331. private final function NewGamePlusReplaceEP1(out inv : CInventoryComponent)
  1332. {
  1333. NewGamePlusReplaceItem('Ofir Armor', 'NGP Ofir Armor', inv);
  1334. NewGamePlusReplaceItem('Ofir Sabre 2', 'NGP Ofir Sabre 2', inv);
  1335.  
  1336. NewGamePlusReplaceItem('Crafted Burning Rose Armor', 'NGP Crafted Burning Rose Armor', inv);
  1337. NewGamePlusReplaceItem('Crafted Burning Rose Gloves', 'NGP Crafted Burning Rose Gloves', inv);
  1338. NewGamePlusReplaceItem('Crafted Burning Rose Sword', 'NGP Crafted Burning Rose Sword', inv);
  1339.  
  1340. NewGamePlusReplaceItem('Crafted Ofir Armor', 'NGP Crafted Ofir Armor', inv);
  1341. NewGamePlusReplaceItem('Crafted Ofir Boots', 'NGP Crafted Ofir Boots', inv);
  1342. NewGamePlusReplaceItem('Crafted Ofir Gloves', 'NGP Crafted Ofir Gloves', inv);
  1343. NewGamePlusReplaceItem('Crafted Ofir Pants', 'NGP Crafted Ofir Pants', inv);
  1344. NewGamePlusReplaceItem('Crafted Ofir Steel Sword', 'NGP Crafted Ofir Steel Sword', inv);
  1345.  
  1346. NewGamePlusReplaceItem('EP1 Crafted Witcher Silver Sword', 'NGP EP1 Crafted Witcher Silver Sword', inv);
  1347. NewGamePlusReplaceItem('Olgierd Sabre', 'NGP Olgierd Sabre', inv);
  1348.  
  1349. NewGamePlusReplaceItem('EP1 Witcher Armor', 'NGP EP1 Witcher Armor', inv);
  1350. NewGamePlusReplaceItem('EP1 Witcher Boots', 'NGP EP1 Witcher Boots', inv);
  1351. NewGamePlusReplaceItem('EP1 Witcher Gloves', 'NGP EP1 Witcher Gloves', inv);
  1352. NewGamePlusReplaceItem('EP1 Witcher Pants', 'NGP EP1 Witcher Pants', inv);
  1353. NewGamePlusReplaceItem('EP1 Viper School steel sword', 'NGP EP1 Viper School steel sword', inv);
  1354. NewGamePlusReplaceItem('EP1 Viper School silver sword', 'NGP EP1 Viper School silver sword', inv);
  1355. }
  1356.  
  1357. private final function NewGamePlusReplaceEP2WitcherSets(out inv : CInventoryComponent)
  1358. {
  1359. NewGamePlusReplaceItem('Lynx Armor 4', 'NGP Lynx Armor 4', inv);
  1360. NewGamePlusReplaceItem('Gryphon Armor 4', 'NGP Gryphon Armor 4', inv);
  1361. NewGamePlusReplaceItem('Bear Armor 4', 'NGP Bear Armor 4', inv);
  1362. NewGamePlusReplaceItem('Wolf Armor 4', 'NGP Wolf Armor 4', inv);
  1363. NewGamePlusReplaceItem('Red Wolf Armor 1', 'NGP Red Wolf Armor 1', inv);
  1364.  
  1365. NewGamePlusReplaceItem('Lynx Gloves 5', 'NGP Lynx Gloves 5', inv);
  1366. NewGamePlusReplaceItem('Gryphon Gloves 5', 'NGP Gryphon Gloves 5', inv);
  1367. NewGamePlusReplaceItem('Bear Gloves 5', 'NGP Bear Gloves 5', inv);
  1368. NewGamePlusReplaceItem('Wolf Gloves 5', 'NGP Wolf Gloves 5', inv);
  1369. NewGamePlusReplaceItem('Red Wolf Gloves 1', 'NGP Red Wolf Gloves 1', inv);
  1370.  
  1371. NewGamePlusReplaceItem('Lynx Pants 5', 'NGP Lynx Pants 5', inv);
  1372. NewGamePlusReplaceItem('Gryphon Pants 5', 'NGP Gryphon Pants 5', inv);
  1373. NewGamePlusReplaceItem('Bear Pants 5', 'NGP Bear Pants 5', inv);
  1374. NewGamePlusReplaceItem('Wolf Pants 5', 'NGP Wolf Pants 5', inv);
  1375. NewGamePlusReplaceItem('Red Wolf Pants 1', 'NGP Red Wolf Pants 1', inv);
  1376.  
  1377. NewGamePlusReplaceItem('Lynx Boots 5', 'NGP Lynx Boots 5', inv);
  1378. NewGamePlusReplaceItem('Gryphon Boots 5', 'NGP Gryphon Boots 5', inv);
  1379. NewGamePlusReplaceItem('Bear Boots 5', 'NGP Bear Boots 5', inv);
  1380. NewGamePlusReplaceItem('Wolf Boots 5', 'NGP Wolf Boots 5', inv);
  1381. NewGamePlusReplaceItem('Red Wolf Boots 1', 'NGP Red Wolf Boots 1', inv);
  1382.  
  1383.  
  1384. NewGamePlusReplaceItem('Lynx School steel sword 4', 'NGP Lynx School steel sword 4', inv);
  1385. NewGamePlusReplaceItem('Gryphon School steel sword 4', 'NGP Gryphon School steel sword 4', inv);
  1386. NewGamePlusReplaceItem('Bear School steel sword 4', 'NGP Bear School steel sword 4', inv);
  1387. NewGamePlusReplaceItem('Wolf School steel sword 4', 'NGP Wolf School steel sword 4', inv);
  1388. NewGamePlusReplaceItem('Red Wolf School steel sword 1', 'NGP Red Wolf School steel sword 1', inv);
  1389.  
  1390. NewGamePlusReplaceItem('Lynx School silver sword 4', 'NGP Lynx School silver sword 4', inv);
  1391. NewGamePlusReplaceItem('Gryphon School silver sword 4', 'NGP Gryphon School silver sword 4', inv);
  1392. NewGamePlusReplaceItem('Bear School silver sword 4', 'NGP Bear School silver sword 4', inv);
  1393. NewGamePlusReplaceItem('Wolf School silver sword 4', 'NGP Wolf School silver sword 4', inv);
  1394. NewGamePlusReplaceItem('Red Wolf School silver sword 1', 'NGP Red Wolf School silver sword 1', inv);
  1395. }
  1396.  
  1397. private final function NewGamePlusReplaceEP2Items(out inv : CInventoryComponent)
  1398. {
  1399. NewGamePlusReplaceItem('Guard Lvl1 Armor 3', 'NGP Guard Lvl1 Armor 3', inv);
  1400. NewGamePlusReplaceItem('Guard Lvl1 A Armor 3', 'NGP Guard Lvl1 A Armor 3', inv);
  1401. NewGamePlusReplaceItem('Guard Lvl2 Armor 3', 'NGP Guard Lvl2 Armor 3', inv);
  1402. NewGamePlusReplaceItem('Guard Lvl2 A Armor 3', 'NGP Guard Lvl2 A Armor 3', inv);
  1403. NewGamePlusReplaceItem('Knight Geralt Armor 3', 'NGP Knight Geralt Armor 3', inv);
  1404. NewGamePlusReplaceItem('Knight Geralt A Armor 3', 'NGP Knight Geralt A Armor 3', inv);
  1405. NewGamePlusReplaceItem('q702_vampire_armor', 'NGP q702_vampire_armor', inv);
  1406.  
  1407. NewGamePlusReplaceItem('Guard Lvl1 Gloves 3', 'NGP Guard Lvl1 Gloves 3', inv);
  1408. NewGamePlusReplaceItem('Guard Lvl1 A Gloves 3', 'NGP Guard Lvl1 A Gloves 3', inv);
  1409. NewGamePlusReplaceItem('Guard Lvl2 Gloves 3', 'NGP Guard Lvl2 Gloves 3', inv);
  1410. NewGamePlusReplaceItem('Guard Lvl2 A Gloves 3', 'NGP Guard Lvl2 A Gloves 3', inv);
  1411. NewGamePlusReplaceItem('Knight Geralt Gloves 3', 'NGP Knight Geralt Gloves 3', inv);
  1412. NewGamePlusReplaceItem('Knight Geralt A Gloves 3', 'NGP Knight Geralt A Gloves 3', inv);
  1413. NewGamePlusReplaceItem('q702_vampire_gloves', 'NGP q702_vampire_gloves', inv);
  1414.  
  1415. NewGamePlusReplaceItem('Guard Lvl1 Pants 3', 'NGP Guard Lvl1 Pants 3', inv);
  1416. NewGamePlusReplaceItem('Guard Lvl1 A Pants 3', 'NGP Guard Lvl1 A Pants 3', inv);
  1417. NewGamePlusReplaceItem('Guard Lvl2 Pants 3', 'NGP Guard Lvl2 Pants 3', inv);
  1418. NewGamePlusReplaceItem('Guard Lvl2 A Pants 3', 'NGP Guard Lvl2 A Pants 3', inv);
  1419. NewGamePlusReplaceItem('Knight Geralt Pants 3', 'NGP Knight Geralt Pants 3', inv);
  1420. NewGamePlusReplaceItem('Knight Geralt A Pants 3', 'NGP Knight Geralt A Pants 3', inv);
  1421. NewGamePlusReplaceItem('q702_vampire_pants', 'NGP q702_vampire_pants', inv);
  1422.  
  1423. NewGamePlusReplaceItem('Guard Lvl1 Boots 3', 'NGP Guard Lvl1 Boots 3', inv);
  1424. NewGamePlusReplaceItem('Guard Lvl1 A Boots 3', 'NGP Guard Lvl1 A Boots 3', inv);
  1425. NewGamePlusReplaceItem('Guard Lvl2 Boots 3', 'NGP Guard Lvl2 Boots 3', inv);
  1426. NewGamePlusReplaceItem('Guard Lvl2 A Boots 3', 'NGP Guard Lvl2 A Boots 3', inv);
  1427. NewGamePlusReplaceItem('Knight Geralt Boots 3', 'NGP Knight Geralt Boots 3', inv);
  1428. NewGamePlusReplaceItem('Knight Geralt A Boots 3', 'NGP Knight Geralt A Boots 3', inv);
  1429. NewGamePlusReplaceItem('q702_vampire_boots', 'NGP q702_vampire_boots', inv);
  1430.  
  1431. NewGamePlusReplaceItem('Serpent Steel Sword 1', 'NGP Serpent Steel Sword 1', inv);
  1432. NewGamePlusReplaceItem('Serpent Steel Sword 2', 'NGP Serpent Steel Sword 2', inv);
  1433. NewGamePlusReplaceItem('Serpent Steel Sword 3', 'NGP Serpent Steel Sword 3', inv);
  1434. NewGamePlusReplaceItem('Guard lvl1 steel sword 3', 'NGP Guard lvl1 steel sword 3', inv);
  1435. NewGamePlusReplaceItem('Guard lvl2 steel sword 3', 'NGP Guard lvl2 steel sword 3', inv);
  1436. NewGamePlusReplaceItem('Knights steel sword 3', 'NGP Knights steel sword 3', inv);
  1437. NewGamePlusReplaceItem('Hanza steel sword 3', 'NGP Hanza steel sword 3', inv);
  1438. NewGamePlusReplaceItem('Toussaint steel sword 3', 'NGP Toussaint steel sword 3', inv);
  1439. NewGamePlusReplaceItem('q702 vampire steel sword', 'NGP q702 vampire steel sword', inv);
  1440.  
  1441. NewGamePlusReplaceItem('Serpent Silver Sword 1', 'NGP Serpent Silver Sword 1', inv);
  1442. NewGamePlusReplaceItem('Serpent Silver Sword 2', 'NGP Serpent Silver Sword 2', inv);
  1443. NewGamePlusReplaceItem('Serpent Silver Sword 3', 'NGP Serpent Silver Sword 3', inv);
  1444. }
  1445.  
  1446. public function GetEquippedSword(steel : bool) : SItemUniqueId
  1447. {
  1448. var item : SItemUniqueId;
  1449.  
  1450. if(steel)
  1451. GetItemEquippedOnSlot(EES_SteelSword, item);
  1452. else
  1453. GetItemEquippedOnSlot(EES_SilverSword, item);
  1454.  
  1455. return item;
  1456. }
  1457.  
  1458. timer function BroadcastRain( deltaTime : float, id : int )
  1459. {
  1460. var rainStrength : float = 0;
  1461. rainStrength = GetRainStrength();
  1462. if( rainStrength > 0.5 )
  1463. {
  1464. theGame.GetBehTreeReactionManager().CreateReactionEventIfPossible( thePlayer, 'RainAction', 2.0f , 50.0f, -1.f, -1, true);
  1465. LogReactionSystem( "'RainAction' was sent by Player - single broadcast - distance: 50.0" );
  1466. }
  1467. }
  1468.  
  1469. function InitializeParryType()
  1470. {
  1471. var i, j : int;
  1472.  
  1473. parryTypeTable.Resize( EnumGetMax('EAttackSwingType')+1 );
  1474. for( i = 0; i < EnumGetMax('EAttackSwingType')+1; i += 1 )
  1475. {
  1476. parryTypeTable[i].Resize( EnumGetMax('EAttackSwingDirection')+1 );
  1477. }
  1478. parryTypeTable[AST_Horizontal][ASD_UpDown] = PT_None;
  1479. parryTypeTable[AST_Horizontal][ASD_DownUp] = PT_None;
  1480. parryTypeTable[AST_Horizontal][ASD_LeftRight] = PT_Left;
  1481. parryTypeTable[AST_Horizontal][ASD_RightLeft] = PT_Right;
  1482. parryTypeTable[AST_Vertical][ASD_UpDown] = PT_Up;
  1483. parryTypeTable[AST_Vertical][ASD_DownUp] = PT_Down;
  1484. parryTypeTable[AST_Vertical][ASD_LeftRight] = PT_None;
  1485. parryTypeTable[AST_Vertical][ASD_RightLeft] = PT_None;
  1486. parryTypeTable[AST_DiagonalUp][ASD_UpDown] = PT_None;
  1487. parryTypeTable[AST_DiagonalUp][ASD_DownUp] = PT_None;
  1488. parryTypeTable[AST_DiagonalUp][ASD_LeftRight] = PT_UpLeft;
  1489. parryTypeTable[AST_DiagonalUp][ASD_RightLeft] = PT_RightUp;
  1490. parryTypeTable[AST_DiagonalDown][ASD_UpDown] = PT_None;
  1491. parryTypeTable[AST_DiagonalDown][ASD_DownUp] = PT_None;
  1492. parryTypeTable[AST_DiagonalDown][ASD_LeftRight] = PT_LeftDown;
  1493. parryTypeTable[AST_DiagonalDown][ASD_RightLeft] = PT_DownRight;
  1494. parryTypeTable[AST_Jab][ASD_UpDown] = PT_Jab;
  1495. parryTypeTable[AST_Jab][ASD_DownUp] = PT_Jab;
  1496. parryTypeTable[AST_Jab][ASD_LeftRight] = PT_Jab;
  1497. parryTypeTable[AST_Jab][ASD_RightLeft] = PT_Jab;
  1498. }
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505. event OnDeath( damageAction : W3DamageAction )
  1506. {
  1507. var items : array< SItemUniqueId >;
  1508. var i, size : int;
  1509. var slot : EEquipmentSlots;
  1510. var holdSlot : name;
  1511.  
  1512. super.OnDeath( damageAction );
  1513.  
  1514. items = GetHeldItems();
  1515.  
  1516. if( rangedWeapon && rangedWeapon.GetCurrentStateName() != 'State_WeaponWait')
  1517. {
  1518. OnRangedForceHolster( true, true, true );
  1519. rangedWeapon.ClearDeployedEntity(true);
  1520. }
  1521.  
  1522. size = items.Size();
  1523.  
  1524. if ( size > 0 )
  1525. {
  1526. for ( i = 0; i < size; i += 1 )
  1527. {
  1528. if ( this.inv.IsIdValid( items[i] ) && !( this.inv.IsItemCrossbow( items[i] ) ) )
  1529. {
  1530. holdSlot = this.inv.GetItemHoldSlot( items[i] );
  1531.  
  1532. if ( holdSlot == 'l_weapon' && this.IsHoldingItemInLHand() )
  1533. {
  1534. this.OnUseSelectedItem( true );
  1535. }
  1536.  
  1537. DropItemFromSlot( holdSlot, false );
  1538.  
  1539. if ( holdSlot == 'r_weapon' )
  1540. {
  1541. slot = this.GetItemSlot( items[i] );
  1542. if ( UnequipItemFromSlot( slot ) )
  1543. Log( "Unequip" );
  1544. }
  1545. }
  1546. }
  1547. }
  1548. }
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556. function HandleMovement( deltaTime : float )
  1557. {
  1558. super.HandleMovement( deltaTime );
  1559.  
  1560. rawCameraHeading = theCamera.GetCameraHeading();
  1561. }
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569. function ToggleSpecialAttackHeavyAllowed( toggle : bool)
  1570. {
  1571. specialAttackHeavyAllowed = toggle;
  1572. }
  1573.  
  1574. function GetReputationManager() : W3Reputation
  1575. {
  1576. return reputationManager;
  1577. }
  1578.  
  1579. function OnRadialMenuItemChoose( selectedItem : string )
  1580. {
  1581. var iSlotId : int;
  1582. var item : SItemUniqueId;
  1583.  
  1584. if ( selectedItem != "Crossbow" )
  1585. {
  1586. if ( rangedWeapon && rangedWeapon.GetCurrentStateName() != 'State_WeaponWait' )
  1587. OnRangedForceHolster( true, false );
  1588. }
  1589.  
  1590.  
  1591. switch(selectedItem)
  1592. {
  1593.  
  1594. case "Meditation":
  1595. theGame.RequestMenuWithBackground( 'MeditationClockMenu', 'CommonMenu' );
  1596. break;
  1597. case "Slot1":
  1598. GetItemEquippedOnSlot( EES_Petard1, item );
  1599. if( thePlayer.inv.IsIdValid( item ) )
  1600. {
  1601. SelectQuickslotItem( EES_Petard1 );
  1602. }
  1603. else
  1604. {
  1605. SelectQuickslotItem( EES_Petard2 );
  1606. }
  1607. break;
  1608.  
  1609. case "Slot2":
  1610. GetItemEquippedOnSlot( EES_Petard2, item );
  1611. if( thePlayer.inv.IsIdValid( item ) )
  1612. {
  1613. SelectQuickslotItem( EES_Petard2 );
  1614. }
  1615. else
  1616. {
  1617. SelectQuickslotItem( EES_Petard1 );
  1618. }
  1619. break;
  1620.  
  1621. case "Crossbow":
  1622. SelectQuickslotItem(EES_RangedWeapon);
  1623. break;
  1624.  
  1625. case "Slot3":
  1626. GetItemEquippedOnSlot( EES_Quickslot1, item );
  1627. if( thePlayer.inv.IsIdValid( item ) )
  1628. {
  1629. SelectQuickslotItem( EES_Quickslot1 );
  1630. }
  1631. else
  1632. {
  1633. SelectQuickslotItem( EES_Quickslot2 );
  1634. }
  1635. break;
  1636.  
  1637. case "Slot4":
  1638. GetItemEquippedOnSlot( EES_Quickslot2, item );
  1639. if( thePlayer.inv.IsIdValid( item ) )
  1640. {
  1641. SelectQuickslotItem( EES_Quickslot2 );
  1642. }
  1643. else
  1644. {
  1645. SelectQuickslotItem( EES_Quickslot1 );
  1646. }
  1647. break;
  1648.  
  1649. default:
  1650. SetEquippedSign(SignStringToEnum( selectedItem ));
  1651. FactsRemove("SignToggled");
  1652. break;
  1653. }
  1654. }
  1655.  
  1656. function ToggleNextItem()
  1657. {
  1658. var quickSlotItems : array< EEquipmentSlots >;
  1659. var currentSelectedItem : SItemUniqueId;
  1660. var item : SItemUniqueId;
  1661. var i : int;
  1662.  
  1663. for( i = EES_Quickslot2; i > EES_Petard1 - 1; i -= 1 )
  1664. {
  1665. GetItemEquippedOnSlot( i, item );
  1666. if( inv.IsIdValid( item ) )
  1667. {
  1668. quickSlotItems.PushBack( i );
  1669. }
  1670. }
  1671. if( !quickSlotItems.Size() )
  1672. {
  1673. return;
  1674. }
  1675.  
  1676. currentSelectedItem = GetSelectedItemId();
  1677.  
  1678. if( inv.IsIdValid( currentSelectedItem ) )
  1679. {
  1680. for( i = 0; i < quickSlotItems.Size(); i += 1 )
  1681. {
  1682. GetItemEquippedOnSlot( quickSlotItems[i], item );
  1683. if( currentSelectedItem == item )
  1684. {
  1685. if( i == quickSlotItems.Size() - 1 )
  1686. {
  1687. SelectQuickslotItem( quickSlotItems[ 0 ] );
  1688. }
  1689. else
  1690. {
  1691. SelectQuickslotItem( quickSlotItems[ i + 1 ] );
  1692. }
  1693. return;
  1694. }
  1695. }
  1696. }
  1697. else
  1698. {
  1699. SelectQuickslotItem( quickSlotItems[ 0 ] );
  1700. }
  1701. }
  1702.  
  1703.  
  1704. function SetEquippedSign( signType : ESignType )
  1705. {
  1706. if(!IsSignBlocked(signType))
  1707. {
  1708. equippedSign = signType;
  1709. FactsSet("CurrentlySelectedSign", equippedSign);
  1710. }
  1711. }
  1712.  
  1713. function GetEquippedSign() : ESignType
  1714. {
  1715. return equippedSign;
  1716. }
  1717.  
  1718. function GetCurrentlyCastSign() : ESignType
  1719. {
  1720. return currentlyCastSign;
  1721. }
  1722.  
  1723. function SetCurrentlyCastSign( type : ESignType, entity : W3SignEntity )
  1724. {
  1725. currentlyCastSign = type;
  1726.  
  1727. if( type != ST_None )
  1728. {
  1729. signs[currentlyCastSign].entity = entity;
  1730. }
  1731. }
  1732.  
  1733. function GetCurrentSignEntity() : W3SignEntity
  1734. {
  1735. if(currentlyCastSign == ST_None)
  1736. return NULL;
  1737.  
  1738. return signs[currentlyCastSign].entity;
  1739. }
  1740.  
  1741. public function GetSignEntity(type : ESignType) : W3SignEntity
  1742. {
  1743. if(type == ST_None)
  1744. return NULL;
  1745.  
  1746. return signs[type].entity;
  1747. }
  1748.  
  1749. public function GetSignTemplate(type : ESignType) : CEntityTemplate
  1750. {
  1751. if(type == ST_None)
  1752. return NULL;
  1753.  
  1754. return signs[type].template;
  1755. }
  1756.  
  1757. public function IsCurrentSignChanneled() : bool
  1758. {
  1759. if( currentlyCastSign != ST_None && signs[currentlyCastSign].entity)
  1760. return signs[currentlyCastSign].entity.OnCheckChanneling();
  1761.  
  1762. return false;
  1763. }
  1764.  
  1765. function IsCastingSign() : bool
  1766. {
  1767. return currentlyCastSign != ST_None;
  1768. }
  1769.  
  1770.  
  1771. protected function IsInCombatActionCameraRotationEnabled() : bool
  1772. {
  1773. if( IsInCombatAction() && ( GetCombatAction() == EBAT_EMPTY || GetCombatAction() == EBAT_Parry ) )
  1774. {
  1775. return true;
  1776. }
  1777.  
  1778. return !bIsInCombatAction;
  1779. }
  1780.  
  1781. function SetHoldBeforeOpenRadialMenuTime ( time : float )
  1782. {
  1783. _HoldBeforeOpenRadialMenuTime = time;
  1784. }
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792. public function RepairItem ( rapairKitId : SItemUniqueId, usedOnItem : SItemUniqueId )
  1793. {
  1794. var itemMaxDurablity : float;
  1795. var itemCurrDurablity : float;
  1796. var baseRepairValue : float;
  1797. var reapirValue : float;
  1798. var itemAttribute : SAbilityAttributeValue;
  1799.  
  1800. itemMaxDurablity = inv.GetItemMaxDurability(usedOnItem);
  1801. itemCurrDurablity = inv.GetItemDurability(usedOnItem);
  1802. itemAttribute = inv.GetItemAttributeValue ( rapairKitId, 'repairValue' );
  1803.  
  1804. if( itemCurrDurablity >= itemMaxDurablity )
  1805. {
  1806. return;
  1807. }
  1808.  
  1809. if ( inv.IsItemAnyArmor ( usedOnItem )|| inv.IsItemWeapon( usedOnItem ) )
  1810. {
  1811.  
  1812. baseRepairValue = itemMaxDurablity * itemAttribute.valueMultiplicative;
  1813. reapirValue = MinF( itemCurrDurablity + baseRepairValue, itemMaxDurablity );
  1814.  
  1815. inv.SetItemDurabilityScript ( usedOnItem, MinF ( reapirValue, itemMaxDurablity ));
  1816. }
  1817.  
  1818. inv.RemoveItem ( rapairKitId, 1 );
  1819.  
  1820. }
  1821. public function HasRepairAbleGearEquiped ( ) : bool
  1822. {
  1823. var curEquipedItem : SItemUniqueId;
  1824.  
  1825. return ( GetItemEquippedOnSlot(EES_Armor, curEquipedItem) || GetItemEquippedOnSlot(EES_Boots, curEquipedItem) || GetItemEquippedOnSlot(EES_Pants, curEquipedItem) || GetItemEquippedOnSlot(EES_Gloves, curEquipedItem)) == true;
  1826. }
  1827. public function HasRepairAbleWaponEquiped () : bool
  1828. {
  1829. var curEquipedItem : SItemUniqueId;
  1830.  
  1831. return ( GetItemEquippedOnSlot(EES_SilverSword, curEquipedItem) || GetItemEquippedOnSlot(EES_SteelSword, curEquipedItem) ) == true;
  1832. }
  1833. public function IsItemRepairAble ( item : SItemUniqueId ) : bool
  1834. {
  1835. return inv.GetItemDurabilityRatio(item) <= 0.99999f;
  1836. }
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845. public function ApplyOil( oilId : SItemUniqueId, usedOnItem : SItemUniqueId ) : bool
  1846. {
  1847. var tutStateOil : W3TutorialManagerUIHandlerStateOils;
  1848.  
  1849. // CA
  1850. if( !super.CanApplyOilOnItem( oilId, usedOnItem ) )
  1851. {
  1852. return false;
  1853. }
  1854.  
  1855. if (CAOilAnimOn() && ((thePlayer.IsInCombat() && CAOilCombat() ) || thePlayer.GetCurrentStateName() == 'Exploration')) {
  1856. completeAnims.SetOil( oilId );
  1857. completeAnims.SetOilOnItem( usedOnItem );
  1858. completeAnims.OilAnim(inv.GetItemCategory(usedOnItem));
  1859. } else {
  1860. super.ApplyOil( oilId, usedOnItem );
  1861. }
  1862. // CA
  1863.  
  1864. if(ShouldProcessTutorial('TutorialOilCanEquip3'))
  1865. {
  1866. tutStateOil = (W3TutorialManagerUIHandlerStateOils)theGame.GetTutorialSystem().uiHandler.GetCurrentState();
  1867. if(tutStateOil)
  1868. {
  1869. tutStateOil.OnOilApplied();
  1870. }
  1871. }
  1872.  
  1873. return true;
  1874. }
  1875.  
  1876. private final function RemoveExtraOilsFromItem( item : SItemUniqueId )
  1877. {
  1878. var oils : array< CBaseGameplayEffect >;
  1879. var i, cnt : int;
  1880. var buff : W3Effect_Oil;
  1881.  
  1882. oils = GetBuffs( EET_Oil );
  1883. for( i=0; i<oils.Size(); i+=1 )
  1884. {
  1885. buff = (W3Effect_Oil) oils[ i ];
  1886. if( buff && buff.GetSwordItemId() == item )
  1887. {
  1888. cnt += 1;
  1889. }
  1890. }
  1891. while( cnt > 1 )
  1892. {
  1893. inv.RemoveOldestOilFromItem( item );
  1894. cnt -= 1;
  1895. }
  1896. }
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905. function ReduceDamage(out damageData : W3DamageAction)
  1906. {
  1907. var actorAttacker : CActor;
  1908. var quen : W3QuenEntity;
  1909. var attackRange : CAIAttackRange;
  1910. var attackerMovementAdjustor : CMovementAdjustor;
  1911. var dist, distToAttacker, actionHeading, attackerHeading, currAdrenaline, adrenReducedDmg, focus : float;
  1912. var attackName : name;
  1913. var useQuenForBleeding : bool;
  1914. var min, max : SAbilityAttributeValue;
  1915. var skillLevel : int;
  1916.  
  1917. super.ReduceDamage(damageData);
  1918.  
  1919.  
  1920.  
  1921. quen = (W3QuenEntity)signs[ST_Quen].entity;
  1922. useQuenForBleeding = false;
  1923. if(quen && !damageData.DealsAnyDamage() && ((W3Effect_Bleeding)damageData.causer) && damageData.GetDamageValue(theGame.params.DAMAGE_NAME_DIRECT) > 0.f)
  1924. useQuenForBleeding = true;
  1925.  
  1926.  
  1927. if(!useQuenForBleeding && !damageData.DealsAnyDamage())
  1928. return;
  1929.  
  1930. actorAttacker = (CActor)damageData.attacker;
  1931.  
  1932.  
  1933. if(actorAttacker && IsCurrentlyDodging() && damageData.CanBeDodged())
  1934. {
  1935.  
  1936.  
  1937. actionHeading = evadeHeading;
  1938. attackerHeading = actorAttacker.GetHeading();
  1939. dist = AngleDistance(actionHeading, attackerHeading);
  1940. distToAttacker = VecDistance(this.GetWorldPosition(),damageData.attacker.GetWorldPosition());
  1941. attackName = actorAttacker.GetLastAttackRangeName();
  1942. attackRange = theGame.GetAttackRangeForEntity( actorAttacker, attackName );
  1943. attackerMovementAdjustor = actorAttacker.GetMovingAgentComponent().GetMovementAdjustor();
  1944. if( ( AbsF(dist) < 150 && attackName != 'stomp' && attackName != 'anchor_special_far' && attackName != 'anchor_far' )
  1945. || ( ( attackName == 'stomp' || attackName == 'anchor_special_far' || attackName == 'anchor_far' ) && distToAttacker > attackRange.rangeMax * 0.75 ) )
  1946. {
  1947. if ( theGame.CanLog() )
  1948. {
  1949. LogDMHits("W3PlayerWitcher.ReduceDamage: Attack dodged by player - no damage done", damageData);
  1950. }
  1951. damageData.SetAllProcessedDamageAs(0);
  1952. damageData.SetWasDodged();
  1953. }
  1954.  
  1955. else if( !damageData.IsActionEnvironment() && !damageData.IsDoTDamage() && CanUseSkill( S_Sword_s09 ) )
  1956. {
  1957. skillLevel = GetSkillLevel( S_Sword_s09 );
  1958. if( skillLevel == GetSkillMaxLevel( S_Sword_s09 ) )
  1959. {
  1960. damageData.SetAllProcessedDamageAs(0);
  1961. damageData.SetWasDodged();
  1962. }
  1963. else
  1964. {
  1965. damageData.processedDmg.vitalityDamage *= 1 - CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s09, 'damage_reduction', false, true)) * skillLevel;
  1966. }
  1967.  
  1968. if ( theGame.CanLog() )
  1969. {
  1970. LogDMHits("W3PlayerWitcher.ReduceDamage: skill S_Sword_s09 reduced damage while dodging", damageData );
  1971. }
  1972. }
  1973. }
  1974.  
  1975.  
  1976. if(quen && damageData.GetBuffSourceName() != "FallingDamage")
  1977. {
  1978. if ( theGame.CanLog() )
  1979. {
  1980. LogDMHits("W3PlayerWitcher.ReduceDamage: Processing Quen sign damage reduction...", damageData);
  1981. }
  1982. quen.OnTargetHit( damageData );
  1983. }
  1984.  
  1985.  
  1986. if( HasBuff( EET_GryphonSetBonusYrden ) )
  1987. {
  1988. min = GetAttributeValue( 'gryphon_set_bns_dmg_reduction' );
  1989. damageData.processedDmg.vitalityDamage *= 1 - min.valueAdditive;
  1990. }
  1991.  
  1992.  
  1993. if( IsMutationActive( EPMT_Mutation5 ) && !IsAnyQuenActive() && !damageData.IsDoTDamage() )
  1994. {
  1995. focus = GetStat( BCS_Focus );
  1996. currAdrenaline = FloorF( focus );
  1997. if( currAdrenaline >= 1 )
  1998. {
  1999. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation5', 'mut5_dmg_red_perc', min, max );
  2000. adrenReducedDmg = ( currAdrenaline * min.valueAdditive );
  2001. damageData.processedDmg.vitalityDamage *= 1 - adrenReducedDmg;
  2002.  
  2003.  
  2004. theGame.MutationHUDFeedback( MFT_PlayOnce );
  2005.  
  2006. if( focus >= 3.f )
  2007. {
  2008. PlayEffect( 'mutation_5_stage_03' );
  2009. }
  2010. else if( focus >= 2.f )
  2011. {
  2012. PlayEffect( 'mutation_5_stage_02' );
  2013. }
  2014. else
  2015. {
  2016. PlayEffect( 'mutation_5_stage_01' );
  2017. }
  2018. }
  2019. }
  2020.  
  2021.  
  2022. if(!damageData.GetIgnoreImmortalityMode())
  2023. {
  2024. if(!((W3PlayerWitcher)this))
  2025. Log("");
  2026.  
  2027.  
  2028. if( IsInvulnerable() )
  2029. {
  2030. if ( theGame.CanLog() )
  2031. {
  2032. LogDMHits("CActor.ReduceDamage: victim Invulnerable - no damage will be dealt", damageData );
  2033. }
  2034. damageData.SetAllProcessedDamageAs(0);
  2035. return;
  2036. }
  2037.  
  2038. if(actorAttacker && damageData.DealsAnyDamage() )
  2039. actorAttacker.SignalGameplayEventParamObject( 'DamageInstigated', damageData );
  2040.  
  2041.  
  2042. if( IsImmortal() )
  2043. {
  2044. if ( theGame.CanLog() )
  2045. {
  2046. LogDMHits("CActor.ReduceDamage: victim is Immortal, clamping damage", damageData );
  2047. }
  2048. damageData.processedDmg.vitalityDamage = ClampF(damageData.processedDmg.vitalityDamage, 0, GetStat(BCS_Vitality)-1 );
  2049. damageData.processedDmg.essenceDamage = ClampF(damageData.processedDmg.essenceDamage, 0, GetStat(BCS_Essence)-1 );
  2050. return;
  2051. }
  2052. }
  2053. else
  2054. {
  2055.  
  2056. if(actorAttacker && damageData.DealsAnyDamage() )
  2057. actorAttacker.SignalGameplayEventParamObject( 'DamageInstigated', damageData );
  2058. }
  2059. }
  2060.  
  2061. timer function UndyingSkillCooldown(dt : float, id : int)
  2062. {
  2063. cannotUseUndyingSkill = false;
  2064. }
  2065.  
  2066. event OnTakeDamage( action : W3DamageAction)
  2067. {
  2068. var currVitality, rgnVitality, hpTriggerTreshold : float;
  2069. var healingFactor : float;
  2070. var abilityName : name;
  2071. var abilityCount, maxStack, itemDurability : float;
  2072. var addAbility : bool;
  2073. var min, max : SAbilityAttributeValue;
  2074. var mutagenQuen : W3SignEntity;
  2075. var equipped : array<SItemUniqueId>;
  2076. var i : int;
  2077. var killSourceName : string;
  2078. var aerondight : W3Effect_Aerondight;
  2079.  
  2080. currVitality = GetStat(BCS_Vitality);
  2081.  
  2082.  
  2083. if(action.processedDmg.vitalityDamage >= currVitality)
  2084. {
  2085. killSourceName = action.GetBuffSourceName();
  2086.  
  2087.  
  2088. if( killSourceName != "Quest" && killSourceName != "Kill Trigger" && killSourceName != "Trap" && killSourceName != "FallingDamage" )
  2089. {
  2090.  
  2091. if(!cannotUseUndyingSkill && FloorF(GetStat(BCS_Focus)) >= 1 && CanUseSkill(S_Sword_s18) && HasBuff(EET_BattleTrance) )
  2092. {
  2093. healingFactor = CalculateAttributeValue( GetSkillAttributeValue(S_Sword_s18, 'healing_factor', false, true) );
  2094. healingFactor *= GetStatMax(BCS_Vitality);
  2095. healingFactor *= GetStat(BCS_Focus);
  2096. healingFactor *= 1 + CalculateAttributeValue( GetSkillAttributeValue(S_Sword_s18, 'healing_bonus', false, true) ) * (GetSkillLevel(S_Sword_s18) - 1);
  2097. ForceSetStat(BCS_Vitality, GetStatMax(BCS_Vitality));
  2098. DrainFocus(GetStat(BCS_Focus));
  2099. RemoveBuff(EET_BattleTrance);
  2100. cannotUseUndyingSkill = true;
  2101. AddTimer('UndyingSkillCooldown', CalculateAttributeValue( GetSkillAttributeValue(S_Sword_s18, 'trigger_delay', false, true) ), false, , , true);
  2102. }
  2103.  
  2104. else if( IsMutationActive( EPMT_Mutation11 ) && !HasBuff( EET_Mutation11Debuff ) && !IsInAir() )
  2105. {
  2106. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation11', 'health_prc', min, max );
  2107.  
  2108. action.SetAllProcessedDamageAs( 0 );
  2109.  
  2110. OnMutation11Triggered();
  2111. }
  2112. else
  2113. {
  2114.  
  2115. equipped = GetEquippedItems();
  2116.  
  2117. for(i=0; i<equipped.Size(); i+=1)
  2118. {
  2119. if ( !inv.IsIdValid( equipped[i] ) )
  2120. {
  2121. continue;
  2122. }
  2123. itemDurability = inv.GetItemDurability(equipped[i]);
  2124. if(inv.ItemHasAbility(equipped[i], 'MA_Reinforced') && itemDurability > 0)
  2125. {
  2126.  
  2127. inv.SetItemDurabilityScript(equipped[i], MaxF(0, itemDurability - action.processedDmg.vitalityDamage) );
  2128.  
  2129.  
  2130. action.processedDmg.vitalityDamage = 0;
  2131. ForceSetStat(BCS_Vitality, 1);
  2132.  
  2133. break;
  2134. }
  2135. }
  2136. }
  2137. }
  2138. }
  2139.  
  2140.  
  2141. if(action.DealsAnyDamage() && !((W3Effect_Toxicity)action.causer) )
  2142. {
  2143. if(HasBuff(EET_Mutagen10))
  2144. RemoveAbilityAll( GetBuff(EET_Mutagen10).GetAbilityName() );
  2145.  
  2146. if(HasBuff(EET_Mutagen15))
  2147. RemoveAbilityAll( GetBuff(EET_Mutagen15).GetAbilityName() );
  2148. }
  2149.  
  2150.  
  2151. if(HasBuff(EET_Mutagen19))
  2152. {
  2153. theGame.GetDefinitionsManager().GetAbilityAttributeValue(GetBuff(EET_Mutagen19).GetAbilityName(), 'max_hp_perc_trigger', min, max);
  2154. hpTriggerTreshold = GetStatMax(BCS_Vitality) * CalculateAttributeValue(GetAttributeRandomizedValue(min, max));
  2155.  
  2156. if(action.GetDamageDealt() >= hpTriggerTreshold)
  2157. {
  2158. mutagenQuen = (W3SignEntity)theGame.CreateEntity( signs[ST_Quen].template, GetWorldPosition(), GetWorldRotation() );
  2159. mutagenQuen.Init( signOwner, signs[ST_Quen].entity, true );
  2160. mutagenQuen.OnStarted();
  2161. mutagenQuen.OnThrowing();
  2162. mutagenQuen.OnEnded();
  2163. }
  2164. }
  2165.  
  2166.  
  2167. if(action.DealsAnyDamage() && !action.IsDoTDamage() && HasBuff(EET_Mutagen27))
  2168. {
  2169. abilityName = GetBuff(EET_Mutagen27).GetAbilityName();
  2170. abilityCount = GetAbilityCount(abilityName);
  2171.  
  2172. if(abilityCount == 0)
  2173. {
  2174. addAbility = true;
  2175. }
  2176. else
  2177. {
  2178. theGame.GetDefinitionsManager().GetAbilityAttributeValue(abilityName, 'mutagen27_max_stack', min, max);
  2179. maxStack = CalculateAttributeValue(GetAttributeRandomizedValue(min, max));
  2180.  
  2181. if(maxStack >= 0)
  2182. {
  2183. addAbility = (abilityCount < maxStack);
  2184. }
  2185. else
  2186. {
  2187. addAbility = true;
  2188. }
  2189. }
  2190.  
  2191. if(addAbility)
  2192. {
  2193. AddAbility(abilityName, true);
  2194. }
  2195. }
  2196.  
  2197. if(HasBuff(EET_Trap) && !action.IsDoTDamage() && action.attacker.HasAbility( 'mon_dettlaff_monster_base' ))
  2198. {
  2199. action.AddEffectInfo(EET_Knockdown);
  2200. RemoveBuff(EET_Trap, true);
  2201. }
  2202.  
  2203. super.OnTakeDamage(action);
  2204.  
  2205.  
  2206. if( !action.WasDodged() && action.DealtDamage() && inv.ItemHasTag( inv.GetCurrentlyHeldSword(), 'Aerondight' ) && !action.IsDoTDamage() && !( (W3Effect_Toxicity) action.causer ) )
  2207. {
  2208. aerondight = (W3Effect_Aerondight)GetBuff( EET_Aerondight );
  2209. if( aerondight && aerondight.GetCurrentCount() != 0 )
  2210. {
  2211. aerondight.ReduceAerondightStacks();
  2212. }
  2213. }
  2214.  
  2215.  
  2216. if( !action.WasDodged() && action.DealtDamage() && !( (W3Effect_Toxicity) action.causer ) )
  2217. {
  2218. RemoveBuff( EET_Mutation3 );
  2219. }
  2220. }
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228. event OnStartFistfightMinigame()
  2229. {
  2230. var i : int;
  2231. var buffs : array< CBaseGameplayEffect >;
  2232.  
  2233.  
  2234. effectManager.RemoveAllPotionEffects();
  2235.  
  2236. abilityManager.DrainToxicity(GetStatMax( BCS_Toxicity ));
  2237.  
  2238. buffs = GetBuffs( EET_WellFed );
  2239. for( i=buffs.Size()-1; i>=0; i-=1 )
  2240. {
  2241. RemoveEffect( buffs[i] );
  2242. }
  2243.  
  2244.  
  2245. buffs.Clear();
  2246. buffs = GetBuffs( EET_WellHydrated );
  2247. for( i=buffs.Size()-1; i>=0; i-=1 )
  2248. {
  2249. RemoveEffect( buffs[i] );
  2250. }
  2251.  
  2252. super.OnStartFistfightMinigame();
  2253. }
  2254.  
  2255. event OnEndFistfightMinigame()
  2256. {
  2257. super.OnEndFistfightMinigame();
  2258. }
  2259.  
  2260.  
  2261. public function GetCriticalHitChance( isLightAttack : bool, isHeavyAttack : bool, target : CActor, victimMonsterCategory : EMonsterCategory, isBolt : bool ) : float
  2262. {
  2263. var ret : float;
  2264. var thunder : W3Potion_Thunderbolt;
  2265. var min, max : SAbilityAttributeValue;
  2266.  
  2267. ret = super.GetCriticalHitChance( isLightAttack, isHeavyAttack, target, victimMonsterCategory, isBolt );
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275. thunder = ( W3Potion_Thunderbolt )GetBuff( EET_Thunderbolt );
  2276. if( thunder && thunder.GetBuffLevel() == 3 && GetCurWeather() == EWE_Storm )
  2277. {
  2278. ret += 1.0f;
  2279. }
  2280.  
  2281.  
  2282. if( isBolt && IsMutationActive( EPMT_Mutation9 ) )
  2283. {
  2284. theGame.GetDefinitionsManager().GetAbilityAttributeValue('Mutation9', 'critical_hit_chance', min, max);
  2285. ret += min.valueMultiplicative;
  2286. }
  2287.  
  2288.  
  2289. if( isBolt && CanUseSkill( S_Sword_s07 ) )
  2290. {
  2291. ret += CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s07, theGame.params.CRITICAL_HIT_CHANCE, false, true)) * GetSkillLevel(S_Sword_s07);
  2292. }
  2293.  
  2294. return ret;
  2295. }
  2296.  
  2297.  
  2298. public function GetCriticalHitDamageBonus(weaponId : SItemUniqueId, victimMonsterCategory : EMonsterCategory, isStrikeAtBack : bool) : SAbilityAttributeValue
  2299. {
  2300. var min, max, bonus, null, oilBonus : SAbilityAttributeValue;
  2301. var mutagen : CBaseGameplayEffect;
  2302. var monsterBonusType : name;
  2303.  
  2304. bonus = super.GetCriticalHitDamageBonus(weaponId, victimMonsterCategory, isStrikeAtBack);
  2305.  
  2306.  
  2307. if( inv.ItemHasActiveOilApplied( weaponId, victimMonsterCategory ) && GetStat( BCS_Focus ) >= 3 && CanUseSkill( S_Alchemy_s07 ) )
  2308. {
  2309. monsterBonusType = MonsterCategoryToAttackPowerBonus( victimMonsterCategory );
  2310. oilBonus = inv.GetItemAttributeValue( weaponId, monsterBonusType );
  2311. if(oilBonus != null)
  2312. {
  2313. bonus += GetSkillAttributeValue(S_Alchemy_s07, theGame.params.CRITICAL_HIT_DAMAGE_BONUS, false, true);
  2314. }
  2315. }
  2316.  
  2317.  
  2318. if (isStrikeAtBack && HasBuff(EET_Mutagen11))
  2319. {
  2320. mutagen = GetBuff(EET_Mutagen11);
  2321. theGame.GetDefinitionsManager().GetAbilityAttributeValue(mutagen.GetAbilityName(), 'damageIncrease', min, max);
  2322. bonus += GetAttributeRandomizedValue(min, max);
  2323. }
  2324.  
  2325. return bonus;
  2326. }
  2327.  
  2328. public function ProcessLockTarget( optional newLockTarget : CActor, optional checkLeftStickHeading : bool ) : bool
  2329. {
  2330. var newLockTargetFound : bool;
  2331.  
  2332. newLockTargetFound = super.ProcessLockTarget(newLockTarget, checkLeftStickHeading);
  2333.  
  2334. if(GetCurrentlyCastSign() == ST_Axii)
  2335. {
  2336. ((W3AxiiEntity)GetCurrentSignEntity()).OnDisplayTargetChange(newLockTarget);
  2337. }
  2338.  
  2339. return newLockTargetFound;
  2340. }
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348. event OnProcessActionPost(action : W3DamageAction)
  2349. {
  2350. var attackAction : W3Action_Attack;
  2351. var rendLoad : float;
  2352. var value : SAbilityAttributeValue;
  2353. var actorVictim : CActor;
  2354. var weaponId : SItemUniqueId;
  2355. var usesSteel, usesSilver, usesVitality, usesEssence : bool;
  2356. var abs : array<name>;
  2357. var i : int;
  2358. var dm : CDefinitionsManagerAccessor;
  2359. var items : array<SItemUniqueId>;
  2360. var weaponEnt : CEntity;
  2361.  
  2362. super.OnProcessActionPost(action);
  2363.  
  2364. attackAction = (W3Action_Attack)action;
  2365. actorVictim = (CActor)action.victim;
  2366.  
  2367. if(attackAction)
  2368. {
  2369. if(attackAction.IsActionMelee())
  2370. {
  2371.  
  2372. if(SkillNameToEnum(attackAction.GetAttackTypeName()) == S_Sword_s02)
  2373. {
  2374. rendLoad = GetSpecialAttackTimeRatio();
  2375.  
  2376.  
  2377. rendLoad = MinF(rendLoad * GetStatMax(BCS_Focus), GetStat(BCS_Focus));
  2378.  
  2379.  
  2380. rendLoad = FloorF(rendLoad);
  2381. DrainFocus(rendLoad);
  2382.  
  2383. OnSpecialAttackHeavyActionProcess();
  2384. }
  2385. else if(actorVictim && IsRequiredAttitudeBetween(this, actorVictim, true))
  2386. {
  2387.  
  2388.  
  2389. value = GetAttributeValue('focus_gain');
  2390.  
  2391. if( FactsQuerySum("debug_fact_focus_boy") > 0 )
  2392. {
  2393. Debug_FocusBoyFocusGain();
  2394. }
  2395.  
  2396.  
  2397. if ( CanUseSkill(S_Sword_s20) )
  2398. {
  2399. value += GetSkillAttributeValue(S_Sword_s20, 'focus_gain', false, true) * GetSkillLevel(S_Sword_s20);
  2400. }
  2401.  
  2402.  
  2403. if( IsMutationActive( EPMT_Mutation3 ) && IsRequiredAttitudeBetween( this, action.victim, true ) && !action.victim.HasTag( 'Mutation3InvalidTarget' ) && !attackAction.IsParried() && !attackAction.WasDodged() && !attackAction.IsCountered() && !inv.IsItemFists( attackAction.GetWeaponId() ) && !attackAction.WasDamageReturnedToAttacker() && attackAction.DealtDamage() )
  2404. {
  2405. AddEffectDefault( EET_Mutation3, this, "", false );
  2406. }
  2407.  
  2408. GainStat(BCS_Focus, 0.1f * (1 + CalculateAttributeValue(value)) );
  2409. }
  2410.  
  2411.  
  2412. weaponId = attackAction.GetWeaponId();
  2413. if(actorVictim && (ShouldProcessTutorial('TutorialWrongSwordSteel') || ShouldProcessTutorial('TutorialWrongSwordSilver')) && GetAttitudeBetween(actorVictim, this) == AIA_Hostile)
  2414. {
  2415. usesSteel = inv.IsItemSteelSwordUsableByPlayer(weaponId);
  2416. usesSilver = inv.IsItemSilverSwordUsableByPlayer(weaponId);
  2417. usesVitality = actorVictim.UsesVitality();
  2418. usesEssence = actorVictim.UsesEssence();
  2419.  
  2420. if(usesSilver && usesVitality)
  2421. {
  2422. FactsAdd('tut_wrong_sword_silver',1);
  2423. }
  2424. else if(usesSteel && usesEssence)
  2425. {
  2426. FactsAdd('tut_wrong_sword_steel',1);
  2427. }
  2428. else if(FactsQuerySum('tut_wrong_sword_steel') && usesSilver && usesEssence)
  2429. {
  2430. FactsAdd('tut_proper_sword_silver',1);
  2431. FactsRemove('tut_wrong_sword_steel');
  2432. }
  2433. else if(FactsQuerySum('tut_wrong_sword_silver') && usesSteel && usesVitality)
  2434. {
  2435. FactsAdd('tut_proper_sword_steel',1);
  2436. FactsRemove('tut_wrong_sword_silver');
  2437. }
  2438. }
  2439.  
  2440.  
  2441. if(!action.WasDodged() && HasAbility('Runeword 1 _Stats', true))
  2442. {
  2443. if(runewordInfusionType == ST_Axii)
  2444. {
  2445. actorVictim.SoundEvent('sign_axii_release');
  2446. }
  2447. else if(runewordInfusionType == ST_Igni)
  2448. {
  2449. actorVictim.SoundEvent('sign_igni_charge_begin');
  2450. }
  2451. else if(runewordInfusionType == ST_Quen)
  2452. {
  2453. value = GetAttributeValue('runeword1_quen_heal');
  2454. Heal( action.GetDamageDealt() * value.valueMultiplicative );
  2455. PlayEffectSingle('drain_energy_caretaker_shovel');
  2456. }
  2457. else if(runewordInfusionType == ST_Yrden)
  2458. {
  2459. actorVictim.SoundEvent('sign_yrden_shock_activate');
  2460. }
  2461. runewordInfusionType = ST_None;
  2462.  
  2463.  
  2464. items = inv.GetHeldWeapons();
  2465. weaponEnt = inv.GetItemEntityUnsafe(items[0]);
  2466. weaponEnt.StopEffect('runeword_aard');
  2467. weaponEnt.StopEffect('runeword_axii');
  2468. weaponEnt.StopEffect('runeword_igni');
  2469. weaponEnt.StopEffect('runeword_quen');
  2470. weaponEnt.StopEffect('runeword_yrden');
  2471. }
  2472.  
  2473.  
  2474. if(ShouldProcessTutorial('TutorialLightAttacks') || ShouldProcessTutorial('TutorialHeavyAttacks'))
  2475. {
  2476. if(IsLightAttack(attackAction.GetAttackName()))
  2477. {
  2478. theGame.GetTutorialSystem().IncreaseGeraltsLightAttacksCount(action.victim.GetTags());
  2479. }
  2480. else if(IsHeavyAttack(attackAction.GetAttackName()))
  2481. {
  2482. theGame.GetTutorialSystem().IncreaseGeraltsHeavyAttacksCount(action.victim.GetTags());
  2483. }
  2484. }
  2485. }
  2486. else if(attackAction.IsActionRanged())
  2487. {
  2488.  
  2489. if(CanUseSkill(S_Sword_s15))
  2490. {
  2491. value = GetSkillAttributeValue(S_Sword_s15, 'focus_gain', false, true) * GetSkillLevel(S_Sword_s15) ;
  2492. GainStat(BCS_Focus, CalculateAttributeValue(value) );
  2493. }
  2494.  
  2495.  
  2496. if(CanUseSkill(S_Sword_s12) && attackAction.IsCriticalHit() && actorVictim)
  2497. {
  2498.  
  2499. actorVictim.GetCharacterStats().GetAbilities(abs, false);
  2500. dm = theGame.GetDefinitionsManager();
  2501. for(i=abs.Size()-1; i>=0; i-=1)
  2502. {
  2503. if(!dm.AbilityHasTag(abs[i], theGame.params.TAG_MONSTER_SKILL) || actorVictim.IsAbilityBlocked(abs[i]))
  2504. {
  2505. abs.EraseFast(i);
  2506. }
  2507. }
  2508.  
  2509.  
  2510. if(abs.Size() > 0)
  2511. {
  2512. value = GetSkillAttributeValue(S_Sword_s12, 'duration', true, true) * GetSkillLevel(S_Sword_s12);
  2513. actorVictim.BlockAbility(abs[ RandRange(abs.Size()) ], true, CalculateAttributeValue(value));
  2514. }
  2515. }
  2516. }
  2517. }
  2518.  
  2519.  
  2520. if( IsMutationActive( EPMT_Mutation10 ) && ( action.IsActionMelee() || action.IsActionWitcherSign() ) )
  2521. {
  2522. PlayEffect( 'mutation_10_energy' );
  2523. }
  2524.  
  2525.  
  2526. if(CanUseSkill(S_Perk_18) && ((W3Petard)action.causer) && action.DealsAnyDamage() && !action.IsDoTDamage())
  2527. {
  2528. value = GetSkillAttributeValue(S_Perk_18, 'focus_gain', false, true);
  2529. GainStat(BCS_Focus, CalculateAttributeValue(value));
  2530. }
  2531.  
  2532.  
  2533. if( attackAction && IsHeavyAttack( attackAction.GetAttackName() ) && !IsUsingHorse() && attackAction.DealtDamage() && IsSetBonusActive( EISB_Lynx_1 ) && !attackAction.WasDodged() && !attackAction.IsParried() && !attackAction.IsCountered() && ( inv.IsItemSteelSwordUsableByPlayer( attackAction.GetWeaponId() ) || inv.IsItemSilverSwordUsableByPlayer( attackAction.GetWeaponId() ) ) )
  2534. {
  2535. AddEffectDefault( EET_LynxSetBonus, NULL, "HeavyAttack" );
  2536. SoundEvent( "ep2_setskill_lynx_activate" );
  2537. }
  2538. }
  2539.  
  2540.  
  2541. timer function Mutagen14Timer(dt : float, id : int)
  2542. {
  2543. var abilityName : name;
  2544. var abilityCount, maxStack : float;
  2545. var min, max : SAbilityAttributeValue;
  2546. var addAbility : bool;
  2547.  
  2548. abilityName = GetBuff(EET_Mutagen14).GetAbilityName();
  2549. abilityCount = GetAbilityCount(abilityName);
  2550.  
  2551. if(abilityCount == 0)
  2552. {
  2553. addAbility = true;
  2554. }
  2555. else
  2556. {
  2557. theGame.GetDefinitionsManager().GetAbilityAttributeValue(abilityName, 'mutagen14_max_stack', min, max);
  2558. maxStack = CalculateAttributeValue(GetAttributeRandomizedValue(min, max));
  2559.  
  2560. if(maxStack >= 0)
  2561. {
  2562. addAbility = (abilityCount < maxStack);
  2563. }
  2564. else
  2565. {
  2566. addAbility = true;
  2567. }
  2568. }
  2569.  
  2570. if(addAbility)
  2571. {
  2572. AddAbility(abilityName, true);
  2573. }
  2574. else
  2575. {
  2576.  
  2577. RemoveTimer('Mutagen14Timer');
  2578. }
  2579. }
  2580.  
  2581. public final function FailFundamentalsFirstAchievementCondition()
  2582. {
  2583. SetFailedFundamentalsFirstAchievementCondition(true);
  2584. }
  2585.  
  2586. public final function SetUsedQuenInCombat()
  2587. {
  2588. usedQuenInCombat = true;
  2589. }
  2590.  
  2591. public final function UsedQuenInCombat() : bool
  2592. {
  2593. return usedQuenInCombat;
  2594. }
  2595.  
  2596. event OnCombatStart()
  2597. {
  2598. var quenEntity, glyphQuen : W3QuenEntity;
  2599. var focus, stamina : float;
  2600. var glowTargets, moTargets, actors : array< CActor >;
  2601. var delays : array< float >;
  2602. var rand, i : int;
  2603. var isHostile, isAlive, isUnconscious : bool;
  2604.  
  2605. super.OnCombatStart();
  2606.  
  2607. if ( IsInCombatActionFriendly() )
  2608. {
  2609. SetBIsCombatActionAllowed(true);
  2610. SetBIsInputAllowed(true, 'OnCombatActionStart' );
  2611. }
  2612.  
  2613.  
  2614. if(HasBuff(EET_Mutagen14))
  2615. {
  2616. AddTimer('Mutagen14Timer', 2, true);
  2617. }
  2618.  
  2619.  
  2620. if(HasBuff(EET_Mutagen15))
  2621. {
  2622. AddAbility(GetBuff(EET_Mutagen15).GetAbilityName(), false);
  2623. }
  2624.  
  2625.  
  2626. mutation12IsOnCooldown = false;
  2627.  
  2628.  
  2629. quenEntity = (W3QuenEntity)signs[ST_Quen].entity;
  2630.  
  2631.  
  2632. if(quenEntity)
  2633. {
  2634. usedQuenInCombat = quenEntity.IsAnyQuenActive();
  2635. }
  2636. else
  2637. {
  2638. usedQuenInCombat = false;
  2639. }
  2640.  
  2641. if(usedQuenInCombat || HasPotionBuff() || IsEquippedSwordUpgradedWithOil(true) || IsEquippedSwordUpgradedWithOil(false))
  2642. {
  2643. SetFailedFundamentalsFirstAchievementCondition(true);
  2644. }
  2645. else
  2646. {
  2647. if(IsAnyItemEquippedOnSlot(EES_PotionMutagen1) || IsAnyItemEquippedOnSlot(EES_PotionMutagen2) || IsAnyItemEquippedOnSlot(EES_PotionMutagen3) || IsAnyItemEquippedOnSlot(EES_PotionMutagen4))
  2648. SetFailedFundamentalsFirstAchievementCondition(true);
  2649. else
  2650. SetFailedFundamentalsFirstAchievementCondition(false);
  2651. }
  2652.  
  2653. if(CanUseSkill(S_Sword_s20) && IsThreatened())
  2654. {
  2655. focus = GetStat(BCS_Focus);
  2656. if(focus < 1)
  2657. {
  2658. GainStat(BCS_Focus, 1 - focus);
  2659. }
  2660. }
  2661.  
  2662. if ( HasAbility('Glyphword 17 _Stats', true) && RandF() < CalculateAttributeValue(GetAttributeValue('quen_apply_chance')) )
  2663. {
  2664. stamina = GetStat(BCS_Stamina);
  2665. glyphQuen = (W3QuenEntity)theGame.CreateEntity( signs[ST_Quen].template, GetWorldPosition(), GetWorldRotation() );
  2666. glyphQuen.Init( signOwner, signs[ST_Quen].entity, true );
  2667. glyphQuen.OnStarted();
  2668. glyphQuen.OnThrowing();
  2669. glyphQuen.OnEnded();
  2670. ForceSetStat(BCS_Stamina, stamina);
  2671. }
  2672.  
  2673.  
  2674. MeditationForceAbort(true);
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680. if( IsMutationActive( EPMT_Mutation4 ) )
  2681. {
  2682. AddEffectDefault( EET_Mutation4, this, "combat start", false );
  2683. }
  2684. if( IsMutationActive( EPMT_Mutation5 ) && GetStat( BCS_Focus ) >= 1.f ) //zur13 modSSS
  2685. {
  2686. AddEffectDefault( EET_Mutation5, this, "", false );
  2687. }
  2688.  
  2689. if( IsMutationActive( EPMT_Mutation7 ) ) //zur13 modSSS
  2690. {
  2691.  
  2692.  
  2693. RemoveTimer( 'Mutation7CombatStartHackFixGo' );
  2694.  
  2695.  
  2696. AddTimer( 'Mutation7CombatStartHackFix', 1.f, true, , , , true );
  2697.  
  2698. }
  2699. if( IsMutationActive( EPMT_Mutation8 ) ) //zur13 modSSS
  2700. {
  2701. theGame.MutationHUDFeedback( MFT_PlayRepeat );
  2702. }
  2703.  
  2704. if( IsMutationActive( EPMT_Mutation10 ) ) //zur13 modSSS
  2705. {
  2706. if( !HasBuff( EET_Mutation10 ) && GetStat( BCS_Toxicity ) > 0.f )
  2707. {
  2708. AddEffectDefault( EET_Mutation10, this, "Mutation 10" );
  2709. }
  2710.  
  2711.  
  2712. PlayEffect( 'mutation_10' );
  2713.  
  2714.  
  2715. PlayEffect( 'critical_toxicity' );
  2716. AddTimer( 'Mutation10StopEffect', 5.f );
  2717. }
  2718. }
  2719.  
  2720. timer function Mutation7CombatStartHackFix( dt : float, id : int )
  2721. {
  2722. var actors : array< CActor >;
  2723.  
  2724. actors = GetEnemies();
  2725.  
  2726. if( actors.Size() > 0 )
  2727. {
  2728.  
  2729. AddTimer( 'Mutation7CombatStartHackFixGo', 0.5f );
  2730. RemoveTimer( 'Mutation7CombatStartHackFix' );
  2731. }
  2732. }
  2733.  
  2734. timer function Mutation7CombatStartHackFixGo( dt : float, id : int )
  2735. {
  2736. var actors : array< CActor >;
  2737.  
  2738. if( IsMutationActive( EPMT_Mutation7 ) )
  2739. {
  2740. actors = GetEnemies();
  2741.  
  2742. if( actors.Size() > 1 )
  2743. {
  2744. AddEffectDefault( EET_Mutation7Buff, this, "Mutation 7, combat start" );
  2745. }
  2746. }
  2747. }
  2748.  
  2749. public final function IsInFistFight() : bool
  2750. {
  2751. var enemies : array< CActor >;
  2752. var i, j : int;
  2753. var invent : CInventoryComponent;
  2754. var weapons : array< SItemUniqueId >;
  2755.  
  2756. if( IsInFistFightMiniGame() )
  2757. {
  2758. return true;
  2759. }
  2760.  
  2761. enemies = GetEnemies();
  2762. for( i=0; i<enemies.Size(); i+=1 )
  2763. {
  2764. weapons.Clear();
  2765. invent = enemies[i].GetInventory();
  2766. weapons = invent.GetHeldWeapons();
  2767.  
  2768. for( j=0; j<weapons.Size(); j+=1 )
  2769. {
  2770. if( invent.IsItemFists( weapons[j] ) )
  2771. {
  2772. return true;
  2773. }
  2774. }
  2775. }
  2776.  
  2777. return false;
  2778. }
  2779.  
  2780. timer function Mutation10StopEffect( dt : float, id : int )
  2781. {
  2782. StopEffect( 'critical_toxicity' );
  2783. }
  2784.  
  2785.  
  2786. event OnCombatFinished()
  2787. {
  2788. var mut17 : W3Mutagen17_Effect;
  2789. var inGameConfigWrapper : CInGameConfigWrapper;
  2790. var disableAutoSheathe : bool;
  2791.  
  2792. super.OnCombatFinished();
  2793.  
  2794.  
  2795. if(HasBuff(EET_Mutagen10))
  2796. {
  2797. RemoveAbilityAll( GetBuff(EET_Mutagen10).GetAbilityName() );
  2798. }
  2799.  
  2800.  
  2801. if(HasBuff(EET_Mutagen14))
  2802. {
  2803. RemoveAbilityAll( GetBuff(EET_Mutagen14).GetAbilityName() );
  2804. }
  2805.  
  2806.  
  2807. if(HasBuff(EET_Mutagen15))
  2808. {
  2809. RemoveAbilityAll( GetBuff(EET_Mutagen15).GetAbilityName() );
  2810. }
  2811.  
  2812.  
  2813. if(HasBuff(EET_Mutagen17))
  2814. {
  2815. mut17 = (W3Mutagen17_Effect)GetBuff(EET_Mutagen17);
  2816. mut17.ClearBoost();
  2817. }
  2818.  
  2819.  
  2820. if(HasBuff(EET_Mutagen18))
  2821. {
  2822. RemoveAbilityAll( GetBuff(EET_Mutagen18).GetAbilityName() );
  2823. }
  2824.  
  2825.  
  2826. if(HasBuff(EET_Mutagen22))
  2827. {
  2828. RemoveAbilityAll( GetBuff(EET_Mutagen22).GetAbilityName() );
  2829. }
  2830.  
  2831.  
  2832. if(HasBuff(EET_Mutagen27))
  2833. {
  2834. RemoveAbilityAll( GetBuff(EET_Mutagen27).GetAbilityName() );
  2835. }
  2836.  
  2837.  
  2838. RemoveBuff( EET_Mutation3 );
  2839.  
  2840.  
  2841. RemoveBuff( EET_Mutation4 );
  2842.  
  2843.  
  2844. RemoveBuff( EET_Mutation5 );
  2845.  
  2846.  
  2847. RemoveBuff( EET_Mutation7Buff );
  2848. RemoveBuff( EET_Mutation7Debuff );
  2849.  
  2850. if( IsMutationActive( EPMT_Mutation7 ) )
  2851. {
  2852. theGame.MutationHUDFeedback( MFT_PlayHide );
  2853. }
  2854. if( IsMutationActive( EPMT_Mutation8 ) ) //zur13 modSSS
  2855. {
  2856. theGame.MutationHUDFeedback( MFT_PlayHide );
  2857. }
  2858.  
  2859.  
  2860. RemoveBuff( EET_Mutation10 );
  2861.  
  2862.  
  2863. RemoveBuff( EET_LynxSetBonus );
  2864.  
  2865.  
  2866. if(GetStat(BCS_Focus) > 0)
  2867. {
  2868. AddTimer('DelayedAdrenalineDrain', theGame.params.ADRENALINE_DRAIN_AFTER_COMBAT_DELAY, , , , true);
  2869. }
  2870.  
  2871.  
  2872. thePlayer.abilityManager.ResetOverhealBonus();
  2873.  
  2874. usedQuenInCombat = false;
  2875.  
  2876. theGame.GetGamerProfile().ResetStat(ES_FinesseKills);
  2877.  
  2878. LogChannel( 'OnCombatFinished', "OnCombatFinished: DelayedSheathSword timer added" );
  2879.  
  2880. //---=== modFriendlyHUD ===---
  2881. if( !GetFHUDConfig().dontTouchMySwords )
  2882. {
  2883. inGameConfigWrapper = (CInGameConfigWrapper)theGame.GetInGameConfigWrapper();
  2884. disableAutoSheathe = inGameConfigWrapper.GetVarValue( 'Gameplay', 'DisableAutomaticSwordSheathe' );
  2885. if( !disableAutoSheathe )
  2886. {
  2887. if ( ShouldAutoSheathSwordInstantly() )
  2888. AddTimer( 'DelayedSheathSword', 0.5f );
  2889. else
  2890. AddTimer( 'DelayedSheathSword', 2.f );
  2891. }
  2892. }
  2893. //---=== modFriendlyHUD ===---
  2894.  
  2895. OnBlockAllCombatTickets( false );
  2896.  
  2897. // AeroHD -- AutoLootMenu++
  2898. mAutoLootNotificationManager.ShowNotification(true);
  2899. // AeroHD -- AutoLootMenu--
  2900.  
  2901. runewordInfusionType = ST_None;
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907. }
  2908.  
  2909. public function PlayHitEffect( damageAction : W3DamageAction )
  2910. {
  2911. var hitReactionType : EHitReactionType;
  2912. var isAtBack : bool;
  2913.  
  2914.  
  2915. if( damageAction.GetMutation4Triggered() )
  2916. {
  2917. hitReactionType = damageAction.GetHitReactionType();
  2918. isAtBack = IsAttackerAtBack( damageAction.attacker );
  2919.  
  2920. if( hitReactionType != EHRT_Heavy )
  2921. {
  2922. if( isAtBack )
  2923. {
  2924. damageAction.SetHitEffect( 'light_hit_back_toxic', true );
  2925. }
  2926. else
  2927. {
  2928. damageAction.SetHitEffect( 'light_hit_toxic' );
  2929. }
  2930. }
  2931. else
  2932. {
  2933. if( isAtBack )
  2934. {
  2935. damageAction.SetHitEffect( 'heavy_hit_back_toxic' ,true );
  2936. }
  2937. else
  2938. {
  2939. damageAction.SetHitEffect( 'heavy_hit_toxic' );
  2940. }
  2941. }
  2942. }
  2943.  
  2944. super.PlayHitEffect( damageAction );
  2945. }
  2946.  
  2947. timer function DelayedAdrenalineDrain(dt : float, id : int)
  2948. {
  2949. if ( !HasBuff(EET_Runeword8) )
  2950. AddEffectDefault(EET_AdrenalineDrain, this, "after_combat_adrenaline_drain");
  2951. }
  2952.  
  2953.  
  2954. protected function Attack( hitTarget : CGameplayEntity, animData : CPreAttackEventData, weaponId : SItemUniqueId, parried : bool, countered : bool, parriedBy : array<CActor>, attackAnimationName : name, hitTime : float, weaponEntity : CItemEntity)
  2955. {
  2956. var mutagen17 : W3Mutagen17_Effect;
  2957.  
  2958. super.Attack(hitTarget, animData, weaponId, parried, countered, parriedBy, attackAnimationName, hitTime, weaponEntity);
  2959.  
  2960. if( (CActor)hitTarget && HasBuff(EET_Mutagen17) )
  2961. {
  2962. mutagen17 = (W3Mutagen17_Effect)GetBuff(EET_Mutagen17);
  2963. if(mutagen17.HasBoost())
  2964. {
  2965. mutagen17.ClearBoost();
  2966. }
  2967. }
  2968. }
  2969.  
  2970. public final timer function SpecialAttackLightSustainCost(dt : float, id : int)
  2971. {
  2972. var focusPerSec, cost, delay : float;
  2973. var reduction : SAbilityAttributeValue;
  2974. var skillLevel : int;
  2975.  
  2976. if(abilityManager && abilityManager.IsInitialized() && IsAlive())
  2977. {
  2978. PauseStaminaRegen('WhirlSkill');
  2979.  
  2980. if(GetStat(BCS_Stamina) > 0)
  2981. {
  2982. cost = GetStaminaActionCost(ESAT_Ability, GetSkillAbilityName(S_Sword_s01), dt);
  2983. delay = GetStaminaActionDelay(ESAT_Ability, GetSkillAbilityName(S_Sword_s01), dt);
  2984. skillLevel = GetSkillLevel(S_Sword_s01);
  2985.  
  2986. if(skillLevel > 1)
  2987. {
  2988. reduction = GetSkillAttributeValue(S_Sword_s01, 'cost_reduction', false, true) * (skillLevel - 1);
  2989. cost = MaxF(0, cost * (1 - reduction.valueMultiplicative) - reduction.valueAdditive);
  2990. }
  2991.  
  2992. DrainStamina(ESAT_FixedValue, cost, delay, GetSkillAbilityName(S_Sword_s01));
  2993. }
  2994. else
  2995. {
  2996. GetSkillAttributeValue(S_Sword_s01, 'focus_cost_per_sec', false, true);
  2997. focusPerSec = GetWhirlFocusCostPerSec();
  2998. DrainFocus(focusPerSec * dt);
  2999. }
  3000. }
  3001.  
  3002. if(GetStat(BCS_Stamina) <= 0 && GetStat(BCS_Focus) <= 0)
  3003. {
  3004. OnPerformSpecialAttack(true, false);
  3005. }
  3006. }
  3007.  
  3008. public final function GetWhirlFocusCostPerSec() : float
  3009. {
  3010. var ability : SAbilityAttributeValue;
  3011. var val : float;
  3012. var skillLevel : int;
  3013.  
  3014. ability = GetSkillAttributeValue(S_Sword_s01, 'focus_cost_per_sec_initial', false, false);
  3015. skillLevel = GetSkillLevel(S_Sword_s01);
  3016.  
  3017. if(skillLevel > 1)
  3018. ability -= GetSkillAttributeValue(S_Sword_s01, 'cost_reduction', false, false) * (skillLevel-1);
  3019.  
  3020. val = CalculateAttributeValue(ability);
  3021.  
  3022. return val;
  3023. }
  3024.  
  3025. public final timer function SpecialAttackHeavySustainCost(dt : float, id : int)
  3026. {
  3027. var focusHighlight, ratio : float;
  3028. var hud : CR4ScriptedHud;
  3029. var hudWolfHeadModule : CR4HudModuleWolfHead;
  3030.  
  3031.  
  3032. DrainStamina(ESAT_Ability, 0, 0, GetSkillAbilityName(S_Sword_s02), dt);
  3033.  
  3034.  
  3035. if(GetStat(BCS_Stamina) <= 0)
  3036. OnPerformSpecialAttack(false, false);
  3037.  
  3038.  
  3039. ratio = EngineTimeToFloat(theGame.GetEngineTime() - specialHeavyStartEngineTime) / specialHeavyChargeDuration;
  3040.  
  3041.  
  3042. if(ratio > 0.95)
  3043. ratio = 1;
  3044.  
  3045. SetSpecialAttackTimeRatio(ratio);
  3046.  
  3047.  
  3048. focusHighlight = ratio * GetStatMax(BCS_Focus);
  3049. focusHighlight = MinF(focusHighlight, GetStat(BCS_Focus));
  3050. focusHighlight = FloorF(focusHighlight);
  3051.  
  3052. hud = (CR4ScriptedHud)theGame.GetHud();
  3053. if ( hud )
  3054. {
  3055. hudWolfHeadModule = (CR4HudModuleWolfHead)hud.GetHudModule( "WolfHeadModule" );
  3056. if ( hudWolfHeadModule )
  3057. {
  3058. hudWolfHeadModule.LockFocusPoints((int)focusHighlight);
  3059. }
  3060. }
  3061. }
  3062.  
  3063. public function OnSpecialAttackHeavyActionProcess()
  3064. {
  3065. var hud : CR4ScriptedHud;
  3066. var hudWolfHeadModule : CR4HudModuleWolfHead;
  3067.  
  3068. super.OnSpecialAttackHeavyActionProcess();
  3069.  
  3070. hud = (CR4ScriptedHud)theGame.GetHud();
  3071. if ( hud )
  3072. {
  3073. hudWolfHeadModule = (CR4HudModuleWolfHead)hud.GetHudModule( "WolfHeadModule" );
  3074. if ( hudWolfHeadModule )
  3075. {
  3076. hudWolfHeadModule.ResetFocusPoints();
  3077. }
  3078. }
  3079. }
  3080.  
  3081. timer function IsSpecialLightAttackInputHeld ( time : float, id : int )
  3082. {
  3083. var hasResource : bool;
  3084.  
  3085. if ( GetCurrentStateName() == 'CombatSteel' || GetCurrentStateName() == 'CombatSilver' )
  3086. {
  3087. if ( GetBIsCombatActionAllowed() && inputHandler.IsActionAllowed(EIAB_SwordAttack))
  3088. {
  3089. if(GetStat(BCS_Stamina) > 0)
  3090. {
  3091. hasResource = true;
  3092. }
  3093. else
  3094. {
  3095. hasResource = (GetStat(BCS_Focus) >= GetWhirlFocusCostPerSec() * time);
  3096. }
  3097.  
  3098. if(hasResource)
  3099. {
  3100. SetupCombatAction( EBAT_SpecialAttack_Light, BS_Pressed );
  3101. RemoveTimer('IsSpecialLightAttackInputHeld');
  3102. }
  3103. else if(!playedSpecialAttackMissingResourceSound)
  3104. {
  3105. IndicateTooLowAdrenaline();
  3106. playedSpecialAttackMissingResourceSound = true;
  3107. }
  3108. }
  3109. }
  3110. else
  3111. {
  3112. RemoveTimer('IsSpecialLightAttackInputHeld');
  3113. }
  3114. }
  3115.  
  3116. timer function IsSpecialHeavyAttackInputHeld ( time : float, id : int )
  3117. {
  3118. var cost : float;
  3119.  
  3120. if ( GetCurrentStateName() == 'CombatSteel' || GetCurrentStateName() == 'CombatSilver' )
  3121. {
  3122. cost = CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s02, 'stamina_cost_per_sec', false, false));
  3123.  
  3124. if( GetBIsCombatActionAllowed() && inputHandler.IsActionAllowed(EIAB_SwordAttack))
  3125. {
  3126. if(GetStat(BCS_Stamina) >= cost)
  3127. {
  3128. SetupCombatAction( EBAT_SpecialAttack_Heavy, BS_Pressed );
  3129. RemoveTimer('IsSpecialHeavyAttackInputHeld');
  3130. }
  3131. else if(!playedSpecialAttackMissingResourceSound)
  3132. {
  3133. IndicateTooLowAdrenaline();
  3134. playedSpecialAttackMissingResourceSound = true;
  3135. }
  3136. }
  3137. }
  3138. else
  3139. {
  3140. RemoveTimer('IsSpecialHeavyAttackInputHeld');
  3141. }
  3142. }
  3143.  
  3144. public function EvadePressed( bufferAction : EBufferActionType )
  3145. {
  3146. var cat : float;
  3147.  
  3148. if( (bufferAction == EBAT_Dodge && IsActionAllowed(EIAB_Dodge)) || (bufferAction == EBAT_Roll && IsActionAllowed(EIAB_Roll)) )
  3149. {
  3150.  
  3151. if(bufferAction != EBAT_Roll && ShouldProcessTutorial('TutorialDodge'))
  3152. {
  3153. FactsAdd("tut_in_dodge", 1, 2);
  3154.  
  3155. if(FactsQuerySum("tut_fight_use_slomo") > 0)
  3156. {
  3157. theGame.RemoveTimeScale( theGame.GetTimescaleSource(ETS_TutorialFight) );
  3158. FactsRemove("tut_fight_slomo_ON");
  3159. }
  3160. }
  3161. else if(bufferAction == EBAT_Roll && ShouldProcessTutorial('TutorialRoll'))
  3162. {
  3163. FactsAdd("tut_in_roll", 1, 2);
  3164.  
  3165. if(FactsQuerySum("tut_fight_use_slomo") > 0)
  3166. {
  3167. theGame.RemoveTimeScale( theGame.GetTimescaleSource(ETS_TutorialFight) );
  3168. FactsRemove("tut_fight_slomo_ON");
  3169. }
  3170. }
  3171.  
  3172. if ( GetBIsInputAllowed() )
  3173. {
  3174. if ( GetBIsCombatActionAllowed() )
  3175. {
  3176. CriticalEffectAnimationInterrupted("Dodge 2");
  3177. PushCombatActionOnBuffer( bufferAction, BS_Released );
  3178. ProcessCombatActionBuffer();
  3179. }
  3180. else if ( IsInCombatAction() && GetBehaviorVariable( 'combatActionType' ) == (int)CAT_Attack )
  3181. {
  3182. if ( CanPlayHitAnim() && IsThreatened() )
  3183. {
  3184. CriticalEffectAnimationInterrupted("Dodge 1");
  3185. PushCombatActionOnBuffer( bufferAction, BS_Released );
  3186. ProcessCombatActionBuffer();
  3187. }
  3188. else
  3189. PushCombatActionOnBuffer( bufferAction, BS_Released );
  3190. }
  3191.  
  3192. else if ( !( IsCurrentSignChanneled() ) )
  3193. {
  3194.  
  3195. PushCombatActionOnBuffer( bufferAction, BS_Released );
  3196. }
  3197. }
  3198. else
  3199. {
  3200. if ( IsInCombatAction() && GetBehaviorVariable( 'combatActionType' ) == (int)CAT_Attack )
  3201. {
  3202. if ( CanPlayHitAnim() && IsThreatened() )
  3203. {
  3204. CriticalEffectAnimationInterrupted("Dodge 3");
  3205. PushCombatActionOnBuffer( bufferAction, BS_Released );
  3206. ProcessCombatActionBuffer();
  3207. }
  3208. else
  3209. PushCombatActionOnBuffer( bufferAction, BS_Released );
  3210. }
  3211. LogChannel( 'InputNotAllowed', "InputNotAllowed" );
  3212. }
  3213. }
  3214. else
  3215. {
  3216. DisplayActionDisallowedHudMessage(EIAB_Dodge);
  3217. }
  3218. }
  3219.  
  3220.  
  3221. public function ProcessCombatActionBuffer() : bool
  3222. {
  3223. var action : EBufferActionType = this.BufferCombatAction;
  3224. var stage : EButtonStage = this.BufferButtonStage;
  3225. var throwStage : EThrowStage;
  3226. var actionResult : bool = true;
  3227.  
  3228.  
  3229. if( isInFinisher )
  3230. {
  3231. return false;
  3232. }
  3233.  
  3234. if ( action != EBAT_SpecialAttack_Heavy )
  3235. specialAttackCamera = false;
  3236.  
  3237.  
  3238. if(super.ProcessCombatActionBuffer())
  3239. return true;
  3240.  
  3241. switch ( action )
  3242. {
  3243. case EBAT_CastSign :
  3244. {
  3245. switch ( stage )
  3246. {
  3247. case BS_Pressed :
  3248. {
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255. actionResult = this.CastSign();
  3256. LogChannel('SignDebug', "CastSign()");
  3257.  
  3258.  
  3259. } break;
  3260.  
  3261. default :
  3262. {
  3263. actionResult = false;
  3264. } break;
  3265. }
  3266. } break;
  3267.  
  3268. case EBAT_SpecialAttack_Light :
  3269. {
  3270. switch ( stage )
  3271. {
  3272. case BS_Pressed :
  3273. {
  3274.  
  3275. actionResult = this.OnPerformSpecialAttack( true, true );
  3276. } break;
  3277.  
  3278. case BS_Released :
  3279. {
  3280. actionResult = this.OnPerformSpecialAttack( true, false );
  3281. } break;
  3282.  
  3283. default :
  3284. {
  3285. actionResult = false;
  3286. } break;
  3287. }
  3288. } break;
  3289.  
  3290. case EBAT_SpecialAttack_Heavy :
  3291. {
  3292. switch ( stage )
  3293. {
  3294. case BS_Pressed :
  3295. {
  3296.  
  3297. actionResult = this.OnPerformSpecialAttack( false, true );
  3298. } break;
  3299.  
  3300. case BS_Released :
  3301. {
  3302. actionResult = this.OnPerformSpecialAttack( false, false );
  3303. } break;
  3304.  
  3305. default :
  3306. {
  3307. actionResult = false;
  3308. } break;
  3309. }
  3310. } break;
  3311.  
  3312. default:
  3313. return false;
  3314. }
  3315.  
  3316.  
  3317. this.CleanCombatActionBuffer();
  3318.  
  3319. if (actionResult)
  3320. {
  3321. SetCombatAction( action ) ;
  3322. }
  3323.  
  3324. return true;
  3325. }
  3326.  
  3327.  
  3328. event OnPerformSpecialAttack( isLightAttack : bool, enableAttack : bool ){}
  3329.  
  3330. public final function GetEnemies() : array< CActor >
  3331. {
  3332. var actors, actors2 : array<CActor>;
  3333. var i : int;
  3334.  
  3335.  
  3336. actors = GetWitcherPlayer().GetHostileEnemies();
  3337. ArrayOfActorsAppendUnique( actors, GetWitcherPlayer().GetMoveTargets() );
  3338.  
  3339.  
  3340. thePlayer.GetVisibleEnemies( actors2 );
  3341. ArrayOfActorsAppendUnique( actors, actors2 );
  3342.  
  3343. for( i=actors.Size()-1; i>=0; i-=1 )
  3344. {
  3345. if( !IsRequiredAttitudeBetween( actors[i], this, true ) )
  3346. {
  3347. actors.EraseFast( i );
  3348. }
  3349. }
  3350.  
  3351. return actors;
  3352. }
  3353.  
  3354. event OnPlayerTickTimer( deltaTime : float )
  3355. {
  3356. super.OnPlayerTickTimer( deltaTime );
  3357.  
  3358. if ( !IsInCombat() )
  3359. {
  3360. fastAttackCounter = 0;
  3361. heavyAttackCounter = 0;
  3362. }
  3363. }
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369. protected function PrepareAttackAction( hitTarget : CGameplayEntity, animData : CPreAttackEventData, weaponId : SItemUniqueId, parried : bool, countered : bool, parriedBy : array<CActor>, attackAnimationName : name, hitTime : float, weaponEntity : CItemEntity, out attackAction : W3Action_Attack) : bool
  3370. {
  3371. var ret : bool;
  3372. var skill : ESkill;
  3373.  
  3374. ret = super.PrepareAttackAction(hitTarget, animData, weaponId, parried, countered, parriedBy, attackAnimationName, hitTime, weaponEntity, attackAction);
  3375.  
  3376. if(!ret)
  3377. return false;
  3378.  
  3379.  
  3380. if(attackAction.IsActionMelee())
  3381. {
  3382. skill = SkillNameToEnum( attackAction.GetAttackTypeName() );
  3383. if( skill != S_SUndefined && CanUseSkill(skill))
  3384. {
  3385. if(IsLightAttack(animData.attackName))
  3386. fastAttackCounter += 1;
  3387. else
  3388. fastAttackCounter = 0;
  3389.  
  3390. if(IsHeavyAttack(animData.attackName))
  3391. heavyAttackCounter += 1;
  3392. else
  3393. heavyAttackCounter = 0;
  3394. }
  3395. }
  3396.  
  3397. AddTimer('FastAttackCounterDecay',5.0);
  3398. AddTimer('HeavyAttackCounterDecay',5.0);
  3399.  
  3400. return true;
  3401. }
  3402.  
  3403. protected function TestParryAndCounter(data : CPreAttackEventData, weaponId : SItemUniqueId, out parried : bool, out countered : bool) : array<CActor>
  3404. {
  3405.  
  3406. if(SkillNameToEnum(attackActionName) == S_Sword_s02)
  3407. data.Can_Parry_Attack = false;
  3408.  
  3409. return super.TestParryAndCounter(data, weaponId, parried, countered);
  3410. }
  3411.  
  3412. private timer function FastAttackCounterDecay(delta : float, id : int)
  3413. {
  3414. fastAttackCounter = 0;
  3415. }
  3416.  
  3417. private timer function HeavyAttackCounterDecay(delta : float, id : int)
  3418. {
  3419. heavyAttackCounter = 0;
  3420. }
  3421.  
  3422.  
  3423. public function GetCraftingSchematicsNames() : array<name> {return craftingSchematics;}
  3424.  
  3425. public function RemoveAllCraftingSchematics()
  3426. {
  3427. craftingSchematics.Clear();
  3428. }
  3429.  
  3430.  
  3431. function AddCraftingSchematic( nam : name, optional isSilent : bool, optional skipTutorialUpdate : bool ) : bool
  3432. {
  3433. var i : int;
  3434.  
  3435. if(!skipTutorialUpdate && ShouldProcessTutorial('TutorialCraftingGotRecipe'))
  3436. {
  3437. FactsAdd("tut_received_schematic");
  3438. }
  3439.  
  3440. for(i=0; i<craftingSchematics.Size(); i+=1)
  3441. {
  3442. if(craftingSchematics[i] == nam)
  3443. return false;
  3444.  
  3445.  
  3446. if(StrCmp(craftingSchematics[i],nam) > 0)
  3447. {
  3448. craftingSchematics.Insert(i,nam);
  3449. AddCraftingHudNotification( nam, isSilent );
  3450. theGame.GetGlobalEventsManager().OnScriptedEvent( SEC_CraftingSchematics );
  3451. return true;
  3452. }
  3453. }
  3454.  
  3455.  
  3456. craftingSchematics.PushBack(nam);
  3457. AddCraftingHudNotification( nam, isSilent );
  3458. theGame.GetGlobalEventsManager().OnScriptedEvent( SEC_CraftingSchematics );
  3459. return true;
  3460. }
  3461.  
  3462. function AddCraftingHudNotification( nam : name, isSilent : bool )
  3463. {
  3464. var hud : CR4ScriptedHud;
  3465. if( !isSilent )
  3466. {
  3467. hud = (CR4ScriptedHud)theGame.GetHud();
  3468. if( hud )
  3469. {
  3470. hud.OnCraftingSchematicUpdate( nam );
  3471. }
  3472. }
  3473. }
  3474.  
  3475. function AddAlchemyHudNotification( nam : name, isSilent : bool )
  3476. {
  3477. var hud : CR4ScriptedHud;
  3478. if( !isSilent )
  3479. {
  3480. hud = (CR4ScriptedHud)theGame.GetHud();
  3481. if( hud )
  3482. {
  3483. hud.OnAlchemySchematicUpdate( nam );
  3484. }
  3485. }
  3486. }
  3487.  
  3488. public function GetExpandedCraftingCategories() : array< name >
  3489. {
  3490. return expandedCraftingCategories;
  3491. }
  3492.  
  3493. public function AddExpandedCraftingCategory( category : name )
  3494. {
  3495. if ( IsNameValid( category ) )
  3496. {
  3497. ArrayOfNamesPushBackUnique( expandedCraftingCategories, category );
  3498. }
  3499. }
  3500.  
  3501. public function RemoveExpandedCraftingCategory( category : name )
  3502. {
  3503. if ( IsNameValid( category ) )
  3504. {
  3505. expandedCraftingCategories.Remove( category );
  3506. }
  3507. }
  3508.  
  3509. public function SetCraftingFilters(showHasIngre : bool, showMissingIngre : bool, showAlreadyCrafted : bool )
  3510. {
  3511. craftingFilters.showCraftable = showHasIngre;
  3512. craftingFilters.showMissingIngre = showMissingIngre;
  3513. craftingFilters.showAlreadyCrafted = showAlreadyCrafted;
  3514. }
  3515.  
  3516. public function GetCraftingFilters() : SCraftingFilters
  3517. {
  3518.  
  3519. if ( craftingFilters.showCraftable == false && craftingFilters.showMissingIngre == false && craftingFilters.showAlreadyCrafted == false )
  3520. {
  3521. craftingFilters.showCraftable = true;
  3522. craftingFilters.showMissingIngre = true;
  3523. craftingFilters.showAlreadyCrafted = false;
  3524. }
  3525.  
  3526. return craftingFilters;
  3527. }
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533. event OnMutation11Triggered()
  3534. {
  3535. var min, max : SAbilityAttributeValue;
  3536. var healValue : float;
  3537. var quenEntity : W3QuenEntity;
  3538.  
  3539.  
  3540. if( IsSwimming() || IsDiving() || IsSailing() || IsUsingHorse() || IsUsingBoat() || IsUsingVehicle() || IsUsingExploration() )
  3541. {
  3542.  
  3543. ForceSetStat( BCS_Vitality, GetStatMax( BCS_Vitality ) );
  3544.  
  3545.  
  3546. theGame.MutationHUDFeedback( MFT_PlayOnce );
  3547.  
  3548.  
  3549. GCameraShake( 1.0f, , , , true, 'camera_shake_loop_lvl1_1' );
  3550. AddTimer( 'StopMutation11CamShake', 2.f );
  3551.  
  3552.  
  3553. theGame.VibrateControllerVeryHard( 2.f );
  3554.  
  3555.  
  3556. Mutation11ShockWave( true );
  3557.  
  3558.  
  3559. AddEffectDefault( EET_Mutation11Debuff, NULL, "Mutation 11 Debuff", false );
  3560. }
  3561. else
  3562. {
  3563. AddEffectDefault( EET_Mutation11Buff, this, "Mutation 11", false );
  3564. }
  3565. }
  3566.  
  3567. timer function StopMutation11CamShake( dt : float, id : int )
  3568. {
  3569. theGame.GetGameCamera().StopAnimation( 'camera_shake_loop_lvl1_1' );
  3570. }
  3571.  
  3572. private var mutation12IsOnCooldown : bool;
  3573.  
  3574. public final function AddMutation12Decoction()
  3575. {
  3576. var params : SCustomEffectParams;
  3577. var buffs : array< EEffectType >;
  3578. var existingDecoctionBuffs : array<CBaseGameplayEffect>;
  3579. var i : int;
  3580. var effectType : EEffectType;
  3581. var decoctions : array< SItemUniqueId >;
  3582. var tmpName : name;
  3583. var min, max : SAbilityAttributeValue;
  3584.  
  3585. if( mutation12IsOnCooldown )
  3586. {
  3587. return;
  3588. }
  3589.  
  3590.  
  3591. existingDecoctionBuffs = GetDrunkMutagens( "Mutation12" );
  3592. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation12', 'maxcap', min, max );
  3593. if( existingDecoctionBuffs.Size() >= min.valueAdditive )
  3594. {
  3595. return;
  3596. }
  3597.  
  3598.  
  3599. mutation12IsOnCooldown = true;
  3600. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation12', 'cooldown', min, max );
  3601. AddTimer( 'Mutation12Cooldown', CalculateAttributeValue( min ) );
  3602.  
  3603.  
  3604. decoctions = inv.GetItemsByTag( 'Mutagen' );
  3605.  
  3606.  
  3607. for( i=decoctions.Size()-1; i>=0; i-=1 )
  3608. {
  3609. inv.GetPotionItemBuffData( decoctions[i], effectType, tmpName );
  3610. if( HasBuff( effectType ) )
  3611. {
  3612. decoctions.EraseFast( i );
  3613. continue;
  3614. }
  3615. buffs.PushBack( effectType );
  3616. }
  3617.  
  3618.  
  3619. if( buffs.Size() == 0 )
  3620. {
  3621. for( i=EET_Mutagen01; i<=EET_Mutagen28; i+=1 )
  3622. {
  3623. if( !HasBuff( i ) )
  3624. {
  3625. buffs.PushBack( i );
  3626. }
  3627. }
  3628. }
  3629.  
  3630.  
  3631. buffs.Remove( EET_Mutagen16 );
  3632. buffs.Remove( EET_Mutagen24 );
  3633.  
  3634.  
  3635. if( buffs.Size() == 0 )
  3636. {
  3637. return;
  3638. }
  3639.  
  3640.  
  3641. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation12', 'duration', min, max );
  3642. params.effectType = buffs[ RandRange( buffs.Size() ) ];
  3643. params.creator = this;
  3644. params.sourceName = "Mutation12";
  3645. params.duration = min.valueAdditive;
  3646. AddEffectCustom( params );
  3647. ( ( W3Mutagen_Effect ) GetBuff( params.effectType, params.sourceName ) ).OverrideIcon( DecoctionEffectTypeToItemName( params.effectType ) );
  3648.  
  3649.  
  3650. if ( !IsEffectActive( 'invisible' ) )
  3651. {
  3652. PlayEffect( 'use_potion' );
  3653. }
  3654.  
  3655. theGame.MutationHUDFeedback( MFT_PlayOnce );
  3656. }
  3657.  
  3658. timer function Mutation12Cooldown( dt : float, id : int )
  3659. {
  3660. mutation12IsOnCooldown = false;
  3661. }
  3662.  
  3663.  
  3664. public final function HasResourcesToStartAnyMutationResearch() : bool
  3665. {
  3666. var greenPoints, redPoints, bluePoints, count : int;
  3667. var itemIDs : array< SItemUniqueId >;
  3668.  
  3669. if( levelManager.GetPointsFree( ESkillPoint ) > 0 )
  3670. {
  3671. return true;
  3672. }
  3673.  
  3674.  
  3675. count = inv.GetItemQuantityByName( 'Greater mutagen green' );
  3676. if( count > 0 )
  3677. {
  3678. itemIDs = inv.GetItemsByName( 'Greater mutagen green' );
  3679. greenPoints = inv.GetMutationResearchPoints( SC_Green, itemIDs[0] );
  3680. if( greenPoints > 0 )
  3681. {
  3682. return true;
  3683. }
  3684. }
  3685. count = inv.GetItemQuantityByName( 'Greater mutagen red' );
  3686. if( count > 0 )
  3687. {
  3688. itemIDs.Clear();
  3689. itemIDs = inv.GetItemsByName( 'Greater mutagen red' );
  3690. redPoints = inv.GetMutationResearchPoints( SC_Red, itemIDs[0] );
  3691. if( redPoints > 0 )
  3692. {
  3693. return true;
  3694. }
  3695. }
  3696. count = inv.GetItemQuantityByName( 'Greater mutagen blue' );
  3697. if( count > 0 )
  3698. {
  3699. itemIDs.Clear();
  3700. itemIDs = inv.GetItemsByName( 'Greater mutagen blue' );
  3701. bluePoints = inv.GetMutationResearchPoints( SC_Blue, itemIDs[0] );
  3702. if( bluePoints > 0 )
  3703. {
  3704. return true;
  3705. }
  3706. }
  3707.  
  3708. return false;
  3709. }
  3710.  
  3711.  
  3712. public final function Mutation11StartAnimation()
  3713. {
  3714.  
  3715. thePlayer.ActionPlaySlotAnimationAsync( 'PLAYER_SLOT', 'geralt_mutation_11', 0.2, 0.2 );
  3716.  
  3717.  
  3718. BlockAllActions( 'Mutation11', true );
  3719.  
  3720.  
  3721. loopingCameraShakeAnimName = 'camera_shake_loop_lvl1_1';
  3722. GCameraShake( 1.0f, , , , true, loopingCameraShakeAnimName );
  3723.  
  3724.  
  3725. theGame.VibrateControllerVeryHard( 15.f );
  3726.  
  3727.  
  3728. storedInteractionPriority = GetInteractionPriority();
  3729. SetInteractionPriority( IP_Max_Unpushable );
  3730. }
  3731.  
  3732. event OnAnimEvent_Mutation11ShockWave( animEventName : name, animEventType : EAnimationEventType, animInfo : SAnimationEventAnimInfo )
  3733. {
  3734. Mutation11ShockWave( false );
  3735. }
  3736.  
  3737. private final function Mutation11ShockWave( skipQuenSign : bool )
  3738. {
  3739. var action : W3DamageAction;
  3740. var ents : array< CGameplayEntity >;
  3741. var i, j : int;
  3742. var damages : array< SRawDamage >;
  3743.  
  3744.  
  3745. FindGameplayEntitiesInSphere(ents, GetWorldPosition(), 5.f, 1000, '', FLAG_OnlyAliveActors + FLAG_ExcludeTarget + FLAG_Attitude_Hostile + FLAG_Attitude_Neutral, this);
  3746.  
  3747. if( ents.Size() > 0 )
  3748. {
  3749. damages = theGame.GetDefinitionsManager().GetDamagesFromAbility( 'Mutation11' );
  3750. }
  3751.  
  3752.  
  3753. for(i=0; i<ents.Size(); i+=1)
  3754. {
  3755. action = new W3DamageAction in theGame;
  3756. action.Initialize( this, ents[i], NULL, "Mutation11", EHRT_Heavy, CPS_SpellPower, false, false, true, false );
  3757.  
  3758. for( j=0; j<damages.Size(); j+=1 )
  3759. {
  3760. action.AddDamage( damages[j].dmgType, damages[j].dmgVal );
  3761. }
  3762.  
  3763. action.SetCannotReturnDamage( true );
  3764. action.SetProcessBuffsIfNoDamage( true );
  3765. action.AddEffectInfo( EET_KnockdownTypeApplicator );
  3766. action.SetHitAnimationPlayType( EAHA_ForceYes );
  3767. action.SetCanPlayHitParticle( false );
  3768.  
  3769. theGame.damageMgr.ProcessAction( action );
  3770. delete action;
  3771. }
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777. mutation11QuenEntity = ( W3QuenEntity )GetSignEntity( ST_Quen );
  3778. if( !mutation11QuenEntity )
  3779. {
  3780. mutation11QuenEntity = (W3QuenEntity)theGame.CreateEntity( GetSignTemplate( ST_Quen ), GetWorldPosition(), GetWorldRotation() );
  3781. mutation11QuenEntity.CreateAttachment( this, 'quen_sphere' );
  3782. AddTimer( 'DestroyMutation11QuenEntity', 2.f );
  3783. }
  3784. mutation11QuenEntity.PlayHitEffect( 'quen_impulse_explode', mutation11QuenEntity.GetWorldRotation() );
  3785.  
  3786. if( !skipQuenSign )
  3787. {
  3788.  
  3789. PlayEffect( 'mutation_11_second_life' );
  3790.  
  3791.  
  3792. RestoreQuen( 1000000.f, 10.f, true );
  3793. }
  3794. }
  3795.  
  3796. private var mutation11QuenEntity : W3QuenEntity;
  3797. private var storedInteractionPriority : EInteractionPriority;
  3798.  
  3799. timer function DestroyMutation11QuenEntity( dt : float, id : int )
  3800. {
  3801. if( mutation11QuenEntity )
  3802. {
  3803. mutation11QuenEntity.Destroy();
  3804. }
  3805. }
  3806.  
  3807. event OnAnimEvent_Mutation11AnimEnd( animEventName : name, animEventType : EAnimationEventType, animInfo : SAnimationEventAnimInfo )
  3808. {
  3809. if( animEventType == AET_DurationEnd )
  3810. {
  3811.  
  3812. BlockAllActions( 'Mutation11', false );
  3813.  
  3814.  
  3815. theGame.GetGameCamera().StopAnimation( 'camera_shake_loop_lvl1_1' );
  3816.  
  3817.  
  3818. theGame.StopVibrateController();
  3819.  
  3820.  
  3821. SetInteractionPriority( storedInteractionPriority );
  3822.  
  3823.  
  3824. RemoveBuff( EET_Mutation11Buff, true );
  3825. }
  3826. else if ( animEventType == AET_DurationStart || animEventType == AET_DurationStartInTheMiddle )
  3827. {
  3828.  
  3829. SetBehaviorVariable( 'AIControlled', 0.f );
  3830. }
  3831. }
  3832.  
  3833. public final function MutationSystemEnable( enable : bool )
  3834. {
  3835. ( ( W3PlayerAbilityManager ) abilityManager ).MutationSystemEnable( enable );
  3836. }
  3837.  
  3838. public final function IsMutationSystemEnabled() : bool
  3839. {
  3840. return ( ( W3PlayerAbilityManager ) abilityManager ).IsMutationSystemEnabled();
  3841. }
  3842.  
  3843. public final function GetMutation( mutationType : EPlayerMutationType ) : SMutation
  3844. {
  3845. return ( ( W3PlayerAbilityManager ) abilityManager ).GetMutation( mutationType );
  3846. }
  3847.  
  3848. public final function IsMutationActive( mutationType : EPlayerMutationType) : bool
  3849. {
  3850. var swordQuality : int;
  3851. var sword : SItemUniqueId;
  3852.  
  3853. if( !SSS_IsMutationEquipped( mutationType, SSS_GetEquippedMutationType() ) ) //zur13 modSSS
  3854. {
  3855. return false;
  3856. }
  3857.  
  3858. switch( mutationType )
  3859. {
  3860. case EPMT_Mutation4 :
  3861. case EPMT_Mutation5 :
  3862. case EPMT_Mutation7 :
  3863. case EPMT_Mutation8 :
  3864. case EPMT_Mutation10 :
  3865. case EPMT_Mutation11 :
  3866. case EPMT_Mutation12 :
  3867. if( IsInFistFight() )
  3868. {
  3869. return false;
  3870. }
  3871. }
  3872.  
  3873. if( mutationType == EPMT_Mutation1 )
  3874. {
  3875. sword = inv.GetCurrentlyHeldSword();
  3876. swordQuality = inv.GetItemQuality( sword );
  3877.  
  3878.  
  3879. if( swordQuality < 3 )
  3880. {
  3881. return false;
  3882. }
  3883. }
  3884.  
  3885. return true;
  3886. }
  3887.  
  3888. public final function SetEquippedMutation( mutationType : EPlayerMutationType ) : bool
  3889. {
  3890. return ( ( W3PlayerAbilityManager ) abilityManager ).SetEquippedMutation( mutationType );
  3891. }
  3892.  
  3893. public final function GetEquippedMutationType() : EPlayerMutationType
  3894. {
  3895. return ( ( W3PlayerAbilityManager ) abilityManager ).GetEquippedMutationType();
  3896. }
  3897.  
  3898. // CA
  3899. timer function CAApplyOil( dt : float, id : int ) { super.ApplyOil( completeAnims.oilId, completeAnims.usedOnItem ); }
  3900. timer function CAContainerProcessLoot( dt : float, id : int ) {
  3901. var lootData : W3LootPopupData;
  3902.  
  3903. if( GetAutoLootConfig().GetActions().ProcessContainer(completeAnims.container) )
  3904. {
  3905. lootData = new W3LootPopupData in completeAnims.container;
  3906. lootData.targetContainer = completeAnims.container;
  3907. theGame.RequestPopup('LootPopup', lootData);
  3908. }
  3909. }
  3910. timer function CAConsume( time : float, id : int ) { ConsumeItem( completeAnims.ItemToConsume ); }
  3911. timer function CADrinkPotion( time : float, id : int ) { DrinkPreparedPotion(completeAnims.SlotToConsume); }
  3912. timer function CADrinkPotionInv( time : float, id : int ) { DrinkPreparedPotion(completeAnims.SlotToConsume, completeAnims.ItemToConsume ); }
  3913. timer function CARepairBuffWeapon( dt : float, id : int ) {
  3914. AddEffectDefault(EET_EnhancedWeapon, this, "repair_object", false);
  3915. DisplayHudMessage(GetLocStringByKeyExt("panel_hud_message_repair_done"));
  3916. SoundEvent("gui_inventory_silversword_attach");
  3917. }
  3918. timer function CARepairBuffArmor( dt : float, id : int ) {
  3919. AddEffectDefault(EET_EnhancedArmor, this, "repair_object", false);
  3920. DisplayHudMessage(GetLocStringByKeyExt("panel_hud_message_repair_done"));
  3921. SoundEvent("gui_inventory_armor_attach");
  3922. }
  3923. // CA
  3924.  
  3925. public final function CanEquipMutation(mutationType : EPlayerMutationType) : bool
  3926. {
  3927. return ( ( W3PlayerAbilityManager ) abilityManager ).CanEquipMutation( mutationType );
  3928. }
  3929.  
  3930. public final function CanResearchMutation( mutationType : EPlayerMutationType ) : bool
  3931. {
  3932. return ( ( W3PlayerAbilityManager ) abilityManager ).CanResearchMutation( mutationType );
  3933. }
  3934.  
  3935. public final function IsMutationResearched(mutationType : EPlayerMutationType) : bool
  3936. {
  3937. return ( ( W3PlayerAbilityManager ) abilityManager ).IsMutationResearched( mutationType );
  3938. }
  3939.  
  3940. public final function GetMutationResearchProgress(mutationType : EPlayerMutationType) : int
  3941. {
  3942. return ( ( W3PlayerAbilityManager ) abilityManager ).GetMutationResearchProgress( mutationType );
  3943. }
  3944.  
  3945. public final function GetMasterMutationStage() : int
  3946. {
  3947. return ( ( W3PlayerAbilityManager ) abilityManager ).GetMasterMutationStage();
  3948. }
  3949.  
  3950. public final function MutationResearchWithSkillPoints(mutation : EPlayerMutationType, skillPoints : int) : bool
  3951. {
  3952. return ( ( W3PlayerAbilityManager ) abilityManager ).MutationResearchWithSkillPoints( mutation, skillPoints );
  3953. }
  3954.  
  3955. public final function MutationResearchWithItem(mutation : EPlayerMutationType, item : SItemUniqueId, optional count: int) : bool
  3956. {
  3957. return ( ( W3PlayerAbilityManager ) abilityManager ).MutationResearchWithItem( mutation, item, count );
  3958. }
  3959.  
  3960. public final function GetMutationLocalizedName( mutationType : EPlayerMutationType ) : string
  3961. {
  3962. var pam : W3PlayerAbilityManager;
  3963. var locKey : name;
  3964.  
  3965. pam = (W3PlayerAbilityManager)GetWitcherPlayer().abilityManager;
  3966. locKey = pam.GetMutationNameLocalizationKey( mutationType );
  3967.  
  3968. return GetLocStringByKeyExt( locKey );
  3969. }
  3970.  
  3971. public final function GetMutationLocalizedDescription( mutationType : EPlayerMutationType ) : string
  3972. {
  3973. var pam : W3PlayerAbilityManager;
  3974. var locKey : name;
  3975. var arrStr : array< string >;
  3976. var dm : CDefinitionsManagerAccessor;
  3977. var min, max, sp : SAbilityAttributeValue;
  3978. var tmp, tmp2, tox, critBonusDamage, val : float;
  3979. var stats, stats2 : SPlayerOffenseStats;
  3980. var buffPerc, exampleEnemyCount, debuffPerc : int;
  3981.  
  3982. pam = (W3PlayerAbilityManager)GetWitcherPlayer().abilityManager;
  3983. locKey = pam.GetMutationDescriptionLocalizationKey( mutationType );
  3984. dm = theGame.GetDefinitionsManager();
  3985.  
  3986. switch( mutationType )
  3987. {
  3988. case EPMT_Mutation1 :
  3989. dm.GetAbilityAttributeValue('Mutation1', 'dmg_bonus_factor', min, max);
  3990. arrStr.PushBack( NoTrailZeros( RoundMath( 100 * min.valueAdditive ) ) );
  3991. break;
  3992.  
  3993. case EPMT_Mutation2 :
  3994. sp = GetPowerStatValue( CPS_SpellPower );
  3995.  
  3996.  
  3997. dm.GetAbilityAttributeValue( 'Mutation2', 'crit_chance_factor', min, max );
  3998. arrStr.PushBack( NoTrailZeros( RoundMath( 100 * ( min.valueAdditive + sp.valueMultiplicative * min.valueMultiplicative ) ) ) );
  3999.  
  4000.  
  4001. dm.GetAbilityAttributeValue( 'Mutation2', 'crit_damage_factor', min, max );
  4002. critBonusDamage = sp.valueMultiplicative * min.valueMultiplicative;
  4003.  
  4004. arrStr.PushBack( NoTrailZeros( RoundMath( 100 * critBonusDamage ) ) );
  4005. break;
  4006.  
  4007. case EPMT_Mutation3 :
  4008.  
  4009. dm.GetAbilityAttributeValue( 'Mutation3', 'attack_power', min, max );
  4010. tmp = min.valueMultiplicative;
  4011. arrStr.PushBack( NoTrailZeros( RoundMath( 100 * tmp ) ) );
  4012.  
  4013.  
  4014. dm.GetAbilityAttributeValue( 'Mutation3', 'maxcap', min, max );
  4015. arrStr.PushBack( NoTrailZeros( RoundMath( 100 * tmp * min.valueAdditive ) ) );
  4016. break;
  4017.  
  4018. case EPMT_Mutation4 :
  4019.  
  4020. dm.GetAbilityAttributeValue( 'AcidEffect', 'DirectDamage', min, max );
  4021. tmp2 = 100 * min.valueAdditive;
  4022. dm.GetAbilityAttributeValue( 'AcidEffect', 'duration', min, max );
  4023. tmp2 *= min.valueAdditive;
  4024. arrStr.PushBack( NoTrailZeros( tmp2 ) );
  4025.  
  4026.  
  4027. tox = GetStat( BCS_Toxicity );
  4028. if( tox > 0 )
  4029. {
  4030. tmp = RoundMath( tmp2 * tox );
  4031. }
  4032. else
  4033. {
  4034. tmp = tmp2;
  4035. }
  4036. arrStr.PushBack( NoTrailZeros( tmp ) );
  4037.  
  4038.  
  4039. tox = GetStatMax( BCS_Toxicity );
  4040. tmp = RoundMath( tmp2 * tox );
  4041. arrStr.PushBack( NoTrailZeros( tmp ) );
  4042. break;
  4043.  
  4044. case EPMT_Mutation5 :
  4045.  
  4046. dm.GetAbilityAttributeValue( 'Mutation5', 'mut5_dmg_red_perc', min, max );
  4047. tmp = min.valueAdditive;
  4048. arrStr.PushBack( NoTrailZeros( 100 * tmp ) );
  4049.  
  4050.  
  4051. arrStr.PushBack( NoTrailZeros( 100 * tmp * 3 ) );
  4052.  
  4053. break;
  4054.  
  4055. case EPMT_Mutation6 :
  4056.  
  4057. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation6', 'full_freeze_chance', min, max );
  4058. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative ) );
  4059.  
  4060.  
  4061. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation6', 'ForceDamage', min, max );
  4062. sp = GetTotalSignSpellPower( S_Magic_1 );
  4063. val = sp.valueAdditive + sp.valueMultiplicative * ( sp.valueBase + min.valueAdditive );
  4064. arrStr.PushBack( NoTrailZeros( RoundMath( val ) ) );
  4065.  
  4066. break;
  4067.  
  4068. case EPMT_Mutation7 :
  4069.  
  4070. dm.GetAbilityAttributeValue( 'Mutation7Buff', 'attack_power', min, max );
  4071. buffPerc = (int) ( 100 * min.valueMultiplicative );
  4072. arrStr.PushBack( NoTrailZeros( buffPerc ) );
  4073.  
  4074.  
  4075. dm.GetAbilityAttributeValue( 'Mutation7BuffEffect', 'duration', min, max );
  4076. arrStr.PushBack( NoTrailZeros( min.valueAdditive ) );
  4077.  
  4078.  
  4079. exampleEnemyCount = 11;
  4080. arrStr.PushBack( exampleEnemyCount );
  4081.  
  4082.  
  4083. arrStr.PushBack( buffPerc * ( exampleEnemyCount -1 ) );
  4084.  
  4085.  
  4086. dm.GetAbilityAttributeValue( 'Mutation7Debuff', 'attack_power', min, max );
  4087. debuffPerc = (int) ( - 100 * min.valueMultiplicative );
  4088. arrStr.PushBack( NoTrailZeros( debuffPerc ) );
  4089.  
  4090.  
  4091. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation7Debuff', 'minCapStacks', min, max );
  4092. arrStr.PushBack( NoTrailZeros( debuffPerc * min.valueAdditive ) );
  4093.  
  4094.  
  4095. dm.GetAbilityAttributeValue( 'Mutation7DebuffEffect', 'duration', min, max );
  4096. arrStr.PushBack( NoTrailZeros( min.valueAdditive ) );
  4097.  
  4098. break;
  4099.  
  4100. case EPMT_Mutation8 :
  4101.  
  4102. dm.GetAbilityAttributeValue( 'Mutation8', 'dmg_bonus', min, max );
  4103. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative ) );
  4104.  
  4105.  
  4106. dm.GetAbilityAttributeValue( 'Mutation8', 'hp_perc_trigger', min, max );
  4107. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative ) );
  4108.  
  4109. break;
  4110.  
  4111. case EPMT_Mutation9 :
  4112.  
  4113.  
  4114.  
  4115.  
  4116. stats = GetOffenseStatsList( 1 );
  4117. arrStr.PushBack( NoTrailZeros( RoundMath( stats.crossbowSteelDmg ) ) );
  4118.  
  4119.  
  4120. stats2 = GetOffenseStatsList( 2 );
  4121. arrStr.PushBack( NoTrailZeros( RoundMath( stats2.crossbowSteelDmg ) ) );
  4122.  
  4123.  
  4124. dm.GetAbilityAttributeValue( 'Mutation9', 'critical_hit_chance', min, max );
  4125. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative ) );
  4126.  
  4127.  
  4128. dm.GetAbilityAttributeValue( 'Mutation9', 'health_reduction', min, max );
  4129. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative ) );
  4130.  
  4131. break;
  4132.  
  4133. case EPMT_Mutation10 :
  4134.  
  4135. dm.GetAbilityAttributeValue( 'Mutation10Effect', 'mutation10_stat_boost', min, max );
  4136. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative ) );
  4137.  
  4138.  
  4139. arrStr.PushBack( NoTrailZeros( 100 * min.valueMultiplicative * GetStatMax( BCS_Toxicity ) ) );
  4140.  
  4141. break;
  4142.  
  4143. case EPMT_Mutation11 :
  4144.  
  4145. arrStr.PushBack( 100 );
  4146.  
  4147.  
  4148. dm.GetAbilityAttributeValue( 'Mutation11DebuffEffect', 'duration', min, max);
  4149. arrStr.PushBack( NoTrailZeros( min.valueAdditive ) );
  4150. break;
  4151.  
  4152. case EPMT_Mutation12 :
  4153.  
  4154. dm.GetAbilityAttributeValue( 'Mutation12', 'duration', min, max );
  4155. arrStr.PushBack( NoTrailZeros( min.valueAdditive ) );
  4156.  
  4157.  
  4158. dm.GetAbilityAttributeValue( 'Mutation12', 'maxcap', min, max );
  4159. arrStr.PushBack( NoTrailZeros( min.valueAdditive ) );
  4160. break;
  4161.  
  4162. case EPMT_MutationMaster :
  4163.  
  4164. arrStr.PushBack( "4" );
  4165.  
  4166. break;
  4167. }
  4168.  
  4169. return GetLocStringByKeyExtWithParams( locKey, , , arrStr );
  4170. }
  4171.  
  4172. public final function ApplyMutation10StatBoost( out statValue : SAbilityAttributeValue )
  4173. {
  4174. var attValue : SAbilityAttributeValue;
  4175. var currToxicity : float;
  4176.  
  4177. if( IsMutationActive( EPMT_Mutation10 ) )
  4178. {
  4179. currToxicity = GetStat( BCS_Toxicity );
  4180. if( currToxicity > 0.f )
  4181. {
  4182. attValue = GetAttributeValue( 'mutation10_stat_boost' );
  4183. currToxicity *= attValue.valueMultiplicative;
  4184. statValue.valueMultiplicative += currToxicity;
  4185. }
  4186. }
  4187. }
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195. public final function IsBookRead( bookName : name ):bool
  4196. {
  4197. return booksRead.Contains( bookName );
  4198. }
  4199.  
  4200. public final function AddReadBook( bookName : name ):void
  4201. {
  4202. if( !booksRead.Contains( bookName ) )
  4203. {
  4204. booksRead.PushBack( bookName );
  4205. }
  4206. }
  4207.  
  4208. public final function RemoveReadBook( bookName : name ):void
  4209. {
  4210. var idx : int = booksRead.FindFirst( bookName );
  4211.  
  4212. if( idx > -1 )
  4213. {
  4214. booksRead.Erase( idx );
  4215. }
  4216. }
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224. public final function GetMutagenBuffs() : array< W3Mutagen_Effect >
  4225. {
  4226. var null : array< W3Mutagen_Effect >;
  4227.  
  4228. if(effectManager)
  4229. {
  4230. return effectManager.GetMutagenBuffs();
  4231. }
  4232.  
  4233. return null;
  4234. }
  4235.  
  4236. public function GetAlchemyRecipes() : array<name>
  4237. {
  4238. return alchemyRecipes;
  4239. }
  4240.  
  4241. public function CanLearnAlchemyRecipe(recipeName : name) : bool
  4242. {
  4243. var dm : CDefinitionsManagerAccessor;
  4244. var recipeNode : SCustomNode;
  4245. var i, tmpInt : int;
  4246. var tmpName : name;
  4247.  
  4248. dm = theGame.GetDefinitionsManager();
  4249. if ( dm.GetSubNodeByAttributeValueAsCName( recipeNode, 'alchemy_recipes', 'name_name', recipeName ) )
  4250. {
  4251. return true;
  4252.  
  4253. }
  4254.  
  4255. return false;
  4256. }
  4257.  
  4258. private final function RemoveAlchemyRecipe(recipeName : name)
  4259. {
  4260. alchemyRecipes.Remove(recipeName);
  4261. }
  4262.  
  4263. private final function RemoveAllAlchemyRecipes()
  4264. {
  4265. alchemyRecipes.Clear();
  4266. }
  4267.  
  4268.  
  4269. function AddAlchemyRecipe(nam : name, optional isSilent : bool, optional skipTutorialUpdate : bool) : bool
  4270. {
  4271. var i, potions, bombs : int;
  4272. var found : bool;
  4273. var m_alchemyManager : W3AlchemyManager;
  4274. var recipe : SAlchemyRecipe;
  4275. var knownBombTypes : array<string>;
  4276. var strRecipeName, recipeNameWithoutLevel : string;
  4277.  
  4278. if(!IsAlchemyRecipe(nam))
  4279. return false;
  4280.  
  4281. found = false;
  4282. for(i=0; i<alchemyRecipes.Size(); i+=1)
  4283. {
  4284. if(alchemyRecipes[i] == nam)
  4285. return false;
  4286.  
  4287.  
  4288. if(StrCmp(alchemyRecipes[i],nam) > 0)
  4289. {
  4290. alchemyRecipes.Insert(i,nam);
  4291. found = true;
  4292. AddAlchemyHudNotification(nam,isSilent);
  4293. break;
  4294. }
  4295. }
  4296.  
  4297. if(!found)
  4298. {
  4299. alchemyRecipes.PushBack(nam);
  4300. AddAlchemyHudNotification(nam,isSilent);
  4301. }
  4302.  
  4303. m_alchemyManager = new W3AlchemyManager in this;
  4304. m_alchemyManager.Init(alchemyRecipes);
  4305. m_alchemyManager.GetRecipe(nam, recipe);
  4306.  
  4307.  
  4308. if(CanUseSkill(S_Alchemy_s18))
  4309. {
  4310. if ((recipe.cookedItemType != EACIT_Bolt) && (recipe.cookedItemType != EACIT_Undefined) && (recipe.cookedItemType != EACIT_Dye) && (recipe.level <= GetSkillLevel(S_Alchemy_s18)))
  4311. AddAbility(SkillEnumToName(S_Alchemy_s18), true);
  4312.  
  4313. }
  4314.  
  4315.  
  4316. if(recipe.cookedItemType == EACIT_Bomb)
  4317. {
  4318. bombs = 0;
  4319. for(i=0; i<alchemyRecipes.Size(); i+=1)
  4320. {
  4321. m_alchemyManager.GetRecipe(alchemyRecipes[i], recipe);
  4322.  
  4323.  
  4324. if(recipe.cookedItemType == EACIT_Bomb)
  4325. {
  4326. strRecipeName = NameToString(alchemyRecipes[i]);
  4327. recipeNameWithoutLevel = StrLeft(strRecipeName, StrLen(strRecipeName)-2);
  4328. if(!knownBombTypes.Contains(recipeNameWithoutLevel))
  4329. {
  4330. bombs += 1;
  4331. knownBombTypes.PushBack(recipeNameWithoutLevel);
  4332. }
  4333. }
  4334. }
  4335.  
  4336. theGame.GetGamerProfile().SetStat(ES_KnownBombRecipes, bombs);
  4337. }
  4338.  
  4339. else if(recipe.cookedItemType == EACIT_Potion || recipe.cookedItemType == EACIT_MutagenPotion || recipe.cookedItemType == EACIT_Alcohol || recipe.cookedItemType == EACIT_Quest)
  4340. {
  4341. potions = 0;
  4342. for(i=0; i<alchemyRecipes.Size(); i+=1)
  4343. {
  4344. m_alchemyManager.GetRecipe(alchemyRecipes[i], recipe);
  4345.  
  4346.  
  4347. if(recipe.cookedItemType == EACIT_Potion || recipe.cookedItemType == EACIT_MutagenPotion || recipe.cookedItemType == EACIT_Alcohol || recipe.cookedItemType == EACIT_Quest)
  4348. {
  4349. potions += 1;
  4350. }
  4351. }
  4352. theGame.GetGamerProfile().SetStat(ES_KnownPotionRecipes, potions);
  4353. }
  4354.  
  4355. theGame.GetGlobalEventsManager().OnScriptedEvent( SEC_AlchemyRecipe );
  4356.  
  4357. return true;
  4358. }
  4359.  
  4360. public function GetExpandedAlchemyCategories() : array< name >
  4361. {
  4362. return expandedAlchemyCategories;
  4363. }
  4364.  
  4365. public function AddExpandedAlchemyCategory( category : name )
  4366. {
  4367. if ( IsNameValid( category ) )
  4368. {
  4369. ArrayOfNamesPushBackUnique( expandedAlchemyCategories, category );
  4370. }
  4371. }
  4372.  
  4373. public function RemoveExpandedAlchemyCategory( category : name )
  4374. {
  4375. if ( IsNameValid( category ) )
  4376. {
  4377. expandedAlchemyCategories.Remove( category );
  4378. }
  4379. }
  4380.  
  4381. public function SetAlchemyFilters(showHasIngre : bool, showMissingIngre : bool, showAlreadyCrafted : bool )
  4382. {
  4383. alchemyFilters.showCraftable = showHasIngre;
  4384. alchemyFilters.showMissingIngre = showMissingIngre;
  4385. alchemyFilters.showAlreadyCrafted = showAlreadyCrafted;
  4386. }
  4387.  
  4388. public function GetAlchemyFilters() : SCraftingFilters
  4389. {
  4390.  
  4391. if ( alchemyFilters.showCraftable == false && alchemyFilters.showMissingIngre == false && alchemyFilters.showAlreadyCrafted == false )
  4392. {
  4393. alchemyFilters.showCraftable = true;
  4394. alchemyFilters.showMissingIngre = true;
  4395. alchemyFilters.showAlreadyCrafted = false;
  4396. }
  4397.  
  4398. return alchemyFilters;
  4399. }
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407. public function GetExpandedBestiaryCategories() : array< name >
  4408. {
  4409. return expandedBestiaryCategories;
  4410. }
  4411.  
  4412. public function AddExpandedBestiaryCategory( category : name )
  4413. {
  4414. if ( IsNameValid( category ) )
  4415. {
  4416. ArrayOfNamesPushBackUnique( expandedBestiaryCategories, category );
  4417. }
  4418. }
  4419.  
  4420. public function RemoveExpandedBestiaryCategory( category : name )
  4421. {
  4422. if ( IsNameValid( category ) )
  4423. {
  4424. expandedBestiaryCategories.Remove( category );
  4425. }
  4426. }
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434. public function GetDisplayHeavyAttackIndicator() : bool
  4435. {
  4436. return bDispalyHeavyAttackIndicator;
  4437. }
  4438.  
  4439. public function SetDisplayHeavyAttackIndicator( val : bool )
  4440. {
  4441. bDispalyHeavyAttackIndicator = val;
  4442. }
  4443.  
  4444. public function GetDisplayHeavyAttackFirstLevelTimer() : bool
  4445. {
  4446. return bDisplayHeavyAttackFirstLevelTimer;
  4447. }
  4448.  
  4449. public function SetDisplayHeavyAttackFirstLevelTimer( val : bool )
  4450. {
  4451. bDisplayHeavyAttackFirstLevelTimer = val;
  4452. }
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460. public function SelectQuickslotItem( slot : EEquipmentSlots )
  4461. {
  4462. var item : SItemUniqueId;
  4463.  
  4464. GetItemEquippedOnSlot(slot, item);
  4465. selectedItemId = item;
  4466. }
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474. public function GetMedallion() : W3MedallionController
  4475. {
  4476. if ( !medallionController )
  4477. {
  4478. medallionController = new W3MedallionController in this;
  4479. }
  4480. return medallionController;
  4481. }
  4482.  
  4483.  
  4484. public final function HighlightObjects(range : float, optional highlightTime : float )
  4485. {
  4486. var ents : array<CGameplayEntity>;
  4487. var i : int;
  4488.  
  4489. FindGameplayEntitiesInSphere(ents, GetWorldPosition(), range, 100, 'HighlightedByMedalionFX', FLAG_ExcludePlayer);
  4490.  
  4491. if(highlightTime == 0)
  4492. highlightTime = 30;
  4493.  
  4494. for(i=0; i<ents.Size(); i+=1)
  4495. {
  4496. if(!ents[i].IsHighlighted())
  4497. {
  4498. ents[i].SetHighlighted( true );
  4499. ents[i].PlayEffectSingle( 'medalion_detection_fx' );
  4500. ents[i].AddTimer( 'MedallionEffectOff', highlightTime );
  4501. }
  4502. }
  4503. }
  4504.  
  4505.  
  4506. public final function HighlightEnemies(range : float, optional highlightTime : float )
  4507. {
  4508. var ents : array<CGameplayEntity>;
  4509. var i : int;
  4510. var catComponent : CGameplayEffectsComponent;
  4511.  
  4512. FindGameplayEntitiesInSphere(ents, GetWorldPosition(), range, 100, , FLAG_ExcludePlayer + FLAG_OnlyAliveActors);
  4513.  
  4514. if(highlightTime == 0)
  4515. highlightTime = 5;
  4516.  
  4517. for(i=0; i<ents.Size(); i+=1)
  4518. {
  4519. if(IsRequiredAttitudeBetween(this, ents[i], true))
  4520. {
  4521. catComponent = GetGameplayEffectsComponent(ents[i]);
  4522. if(catComponent)
  4523. {
  4524. catComponent.SetGameplayEffectFlag(EGEF_CatViewHiglight, true);
  4525. ents[i].AddTimer( 'EnemyHighlightOff', highlightTime, , , , , true );
  4526. }
  4527. }
  4528. }
  4529. }
  4530.  
  4531. function SpawnMedallionEntity()
  4532. {
  4533. var rot : EulerAngles;
  4534. var spawnedMedallion : CEntity;
  4535.  
  4536. spawnedMedallion = theGame.GetEntityByTag( 'new_Witcher_medallion_FX' );
  4537.  
  4538. if ( !spawnedMedallion )
  4539. theGame.CreateEntity( medallionEntity, GetWorldPosition(), rot, true, false );
  4540. }
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550. public final function InterruptCombatFocusMode()
  4551. {
  4552. if( this.GetCurrentStateName() == 'CombatFocusMode_SelectSpot' )
  4553. {
  4554. SetCanPlayHitAnim( true );
  4555. PopState();
  4556. }
  4557. }
  4558.  
  4559. public final function IsInDarkPlace() : bool
  4560. {
  4561. var envs : array< string >;
  4562.  
  4563. if( FactsQuerySum( "tut_in_dark_place" ) )
  4564. {
  4565. return true;
  4566. }
  4567.  
  4568. GetActiveAreaEnvironmentDefinitions( envs );
  4569.  
  4570. if( envs.Contains( 'env_novigrad_cave' ) || envs.Contains( 'cave_catacombs' ) )
  4571. {
  4572. return true;
  4573. }
  4574.  
  4575. return false;
  4576. }
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582. private saved var selectedPotionSlotUpper, selectedPotionSlotLower : EEquipmentSlots;
  4583. private var potionDoubleTapTimerRunning, potionDoubleTapSlotIsUpper : bool;
  4584. default selectedPotionSlotUpper = EES_Potion1;
  4585. default selectedPotionSlotLower = EES_Potion2;
  4586. default potionDoubleTapTimerRunning = false;
  4587.  
  4588. public final function SetPotionDoubleTapRunning(b : bool, optional isUpperSlot : bool)
  4589. {
  4590. if(b)
  4591. {
  4592. AddTimer('PotionDoubleTap', 0.3);
  4593. }
  4594. else
  4595. {
  4596. RemoveTimer('PotionDoubleTap');
  4597. }
  4598.  
  4599. potionDoubleTapTimerRunning = b;
  4600. potionDoubleTapSlotIsUpper = isUpperSlot;
  4601. }
  4602.  
  4603. public final function IsPotionDoubleTapRunning() : bool
  4604. {
  4605. return potionDoubleTapTimerRunning;
  4606. }
  4607.  
  4608. timer function PotionDoubleTap(dt : float, id : int)
  4609. {
  4610. potionDoubleTapTimerRunning = false;
  4611. OnPotionDrinkInput(potionDoubleTapSlotIsUpper);
  4612. }
  4613.  
  4614. public final function OnPotionDrinkInput(fromUpperSlot : bool)
  4615. {
  4616. var slot : EEquipmentSlots;
  4617.  
  4618. if(fromUpperSlot)
  4619. slot = GetSelectedPotionSlotUpper();
  4620. else
  4621. slot = GetSelectedPotionSlotLower();
  4622.  
  4623. DrinkPotionFromSlot(slot);
  4624. }
  4625.  
  4626. public final function OnPotionDrinkKeyboardsInput(slot : EEquipmentSlots)
  4627. {
  4628. DrinkPotionFromSlot(slot);
  4629. }
  4630.  
  4631. private function DrinkPotionFromSlot(slot : EEquipmentSlots):void
  4632. {
  4633. var item : SItemUniqueId;
  4634. var hud : CR4ScriptedHud;
  4635. var module : CR4HudModuleItemInfo;
  4636.  
  4637. // CA
  4638. if (GetCurrentStateName() == 'Swimming') {
  4639. CAHudNotify(GetLocStringByKeyExt( "menu_cannot_perform_action_here" ));
  4640. return;
  4641. }
  4642. // CA
  4643.  
  4644. GetItemEquippedOnSlot(slot, item);
  4645. if(inv.ItemHasTag(item, 'Edibles'))
  4646. {
  4647. // CA
  4648. if (!CAAllowAnimsInCombat() && thePlayer.IsInCombat()) {
  4649. ConsumeItem(item);
  4650. return;
  4651. }
  4652. completeAnims.SetItemToConsume( item );
  4653. if ( inv.ItemHasTag(item, 'Drinks')) {
  4654. if (CADrinkAnimOn()) {
  4655. completeAnims.DrinkAnim('CAConsume');
  4656. } else {
  4657. ConsumeItem(item);
  4658. }
  4659. } else {
  4660. if (CAEatAnimOn()) {
  4661. completeAnims.EatAnim();
  4662. } else {
  4663. ConsumeItem(item);
  4664. }
  4665. }
  4666. // CA
  4667. }
  4668. } else {
  4669. ConsumeItem(item);
  4670. }
  4671. }
  4672. // CA
  4673. else
  4674. {
  4675. if (ToxicityLowEnoughToDrinkPotion(slot))
  4676. {
  4677. // CA
  4678. if (!CAAllowAnimsInCombat() && thePlayer.IsInCombat()) {
  4679. DrinkPreparedPotion(slot);
  4680. return;
  4681. }
  4682.  
  4683. if (CADrinkAnimOn()) {
  4684. completeAnims.SetSlotToConsumeOne( slot );
  4685. completeAnims.DrinkAnim('CADrinkPotion', slot);
  4686. } else {
  4687. DrinkPreparedPotion(slot);
  4688. return;
  4689. }
  4690.  
  4691. if (CADrinkAnimOn()) {
  4692. completeAnims.SetSlotToConsumeOne( slot );
  4693. completeAnims.DrinkAnim('CADrinkPotion', slot);
  4694. } else {
  4695. DrinkPreparedPotion(slot);
  4696. }
  4697. // CA
  4698. }
  4699. // CA
  4700. }
  4701. else
  4702. {
  4703. SendToxicityTooHighMessage();
  4704. }
  4705.  
  4706. hud = (CR4ScriptedHud)theGame.GetHud();
  4707. if ( hud )
  4708. {
  4709. module = (CR4HudModuleItemInfo)hud.GetHudModule("ItemInfoModule");
  4710. if( module )
  4711. {
  4712. module.ForceShowElement();
  4713. }
  4714. }
  4715. // CA
  4716. public function SendToxicityTooHighMessage()
  4717. {
  4718. var messageText : string;
  4719. var language : string;
  4720. var audioLanguage : string;
  4721.  
  4722. if (GetHudMessagesSize() < 2)
  4723. {
  4724. messageText = GetLocStringByKeyExt("menu_cannot_perform_action_now") + " " + GetLocStringByKeyExt("panel_common_statistics_tooltip_current_toxicity");
  4725.  
  4726. theGame.GetGameLanguageName(audioLanguage,language);
  4727. if (language == "AR")
  4728. {
  4729. messageText += (int)(abilityManager.GetStat(BCS_Toxicity, false)) + " / " + (int)(abilityManager.GetStatMax(BCS_Toxicity)) + " :";
  4730. }
  4731. else
  4732. {
  4733. messageText += ": " + (int)(abilityManager.GetStat(BCS_Toxicity, false)) + " / " + (int)(abilityManager.GetStatMax(BCS_Toxicity));
  4734. }
  4735.  
  4736. DisplayHudMessage(messageText);
  4737. }
  4738. theSound.SoundEvent("gui_global_denied");
  4739. }
  4740.  
  4741. public final function GetSelectedPotionSlotUpper() : EEquipmentSlots
  4742. {
  4743. return selectedPotionSlotUpper;
  4744. }
  4745.  
  4746. public final function GetSelectedPotionSlotLower() : EEquipmentSlots
  4747. {
  4748. return selectedPotionSlotLower;
  4749. }
  4750.  
  4751.  
  4752. public final function FlipSelectedPotion(isUpperSlot : bool) : bool
  4753. {
  4754. if(isUpperSlot)
  4755. {
  4756. if(selectedPotionSlotUpper == EES_Potion1 && IsAnyItemEquippedOnSlot(EES_Potion3))
  4757. {
  4758. selectedPotionSlotUpper = EES_Potion3;
  4759. return true;
  4760. }
  4761. else if(selectedPotionSlotUpper == EES_Potion3 && IsAnyItemEquippedOnSlot(EES_Potion1))
  4762. {
  4763. selectedPotionSlotUpper = EES_Potion1;
  4764. return true;
  4765. }
  4766. }
  4767. else
  4768. {
  4769. if(selectedPotionSlotLower == EES_Potion2 && IsAnyItemEquippedOnSlot(EES_Potion4))
  4770. {
  4771. selectedPotionSlotLower = EES_Potion4;
  4772. return true;
  4773. }
  4774. else if(selectedPotionSlotLower == EES_Potion4 && IsAnyItemEquippedOnSlot(EES_Potion2))
  4775. {
  4776. selectedPotionSlotLower = EES_Potion2;
  4777. return true;
  4778. }
  4779. }
  4780.  
  4781. return false;
  4782. }
  4783.  
  4784. public final function AddBombThrowDelay( bombId : SItemUniqueId )
  4785. {
  4786. var slot : EEquipmentSlots;
  4787.  
  4788. slot = GetItemSlot( bombId );
  4789.  
  4790. if( slot == EES_Unused )
  4791. {
  4792. return;
  4793. }
  4794.  
  4795. if( slot == EES_Petard1 || slot == EES_Quickslot1 )
  4796. {
  4797. remainingBombThrowDelaySlot1 = theGame.params.BOMB_THROW_DELAY;
  4798. AddTimer( 'BombDelay', 0.0f, true );
  4799. }
  4800. else if( slot == EES_Petard2 || slot == EES_Quickslot2 )
  4801. {
  4802. remainingBombThrowDelaySlot2 = theGame.params.BOMB_THROW_DELAY;
  4803. AddTimer( 'BombDelay', 0.0f, true );
  4804. }
  4805. else
  4806. {
  4807. return;
  4808. }
  4809. }
  4810.  
  4811. public final function GetBombDelay( slot : EEquipmentSlots ) : float
  4812. {
  4813. if( slot == EES_Petard1 || slot == EES_Quickslot1 )
  4814. {
  4815. return remainingBombThrowDelaySlot1;
  4816. }
  4817. else if( slot == EES_Petard2 || slot == EES_Quickslot2 )
  4818. {
  4819. return remainingBombThrowDelaySlot2;
  4820. }
  4821.  
  4822. return 0;
  4823. }
  4824.  
  4825. timer function BombDelay( dt : float, id : int )
  4826. {
  4827. remainingBombThrowDelaySlot1 = MaxF( 0.f , remainingBombThrowDelaySlot1 - dt );
  4828. remainingBombThrowDelaySlot2 = MaxF( 0.f , remainingBombThrowDelaySlot2 - dt );
  4829.  
  4830. if( remainingBombThrowDelaySlot1 <= 0.0f && remainingBombThrowDelaySlot2 <= 0.0f )
  4831. {
  4832. RemoveTimer('BombDelay');
  4833. }
  4834. }
  4835.  
  4836. public function ResetCharacterDev()
  4837. {
  4838.  
  4839. UnequipItemFromSlot(EES_SkillMutagen1);
  4840. UnequipItemFromSlot(EES_SkillMutagen2);
  4841. UnequipItemFromSlot(EES_SkillMutagen3);
  4842. UnequipItemFromSlot(EES_SkillMutagen4);
  4843. SSS_UnequipAllMutagens(); //zur13 modSSS mutTabs
  4844. levelManager.ResetCharacterDev();
  4845. ((W3PlayerAbilityManager)abilityManager).ResetCharacterDev();
  4846. }
  4847.  
  4848. public final function ResetMutationsDev()
  4849. {
  4850. levelManager.ResetMutationsDev();
  4851. ((W3PlayerAbilityManager)abilityManager).ResetMutationsDev();
  4852. }
  4853.  
  4854. public final function GetHeldSword() : SItemUniqueId
  4855. {
  4856. var i : int;
  4857. var weapons : array< SItemUniqueId >;
  4858.  
  4859. weapons = inv.GetHeldWeapons();
  4860. for( i=0; i<weapons.Size(); i+=1 )
  4861. {
  4862. if( inv.IsItemSilverSwordUsableByPlayer( weapons[i] ) || inv.IsItemSteelSwordUsableByPlayer( weapons[i] ) )
  4863. {
  4864. return weapons[i];
  4865. }
  4866. }
  4867.  
  4868. return GetInvalidUniqueId();
  4869. }
  4870.  
  4871. public function ConsumeItem( itemId : SItemUniqueId ) : bool
  4872. {
  4873. var itemName : name;
  4874. var removedItem, willRemoveItem : bool;
  4875. var edibles : array<SItemUniqueId>;
  4876. var toSlot : EEquipmentSlots;
  4877. var i : int;
  4878. var equippedNewEdible : bool;
  4879.  
  4880. itemName = inv.GetItemName( itemId );
  4881.  
  4882. if (itemName == 'q111_imlerith_acorn' )
  4883. {
  4884. AddPoints(ESkillPoint, 2, true);
  4885. removedItem = inv.RemoveItem( itemId, 1 );
  4886. theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt("panel_character_popup_title_buy_skill") + "<br>" + GetLocStringByKeyExt("panel_character_availablepoints") + " +2");
  4887. theSound.SoundEvent("gui_character_buy_skill");
  4888. }
  4889. else if ( itemName == 'Clearing Potion' )
  4890. {
  4891. ResetCharacterDev();
  4892. removedItem = inv.RemoveItem( itemId, 1 );
  4893. theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt("panel_character_popup_character_cleared") );
  4894. theSound.SoundEvent("gui_character_synergy_effect");
  4895. }
  4896. else if ( itemName == 'Restoring Potion' )
  4897. {
  4898. ResetMutationsDev();
  4899. removedItem = inv.RemoveItem( itemId, 1 );
  4900. theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt("panel_character_popup_character_cleared") );
  4901. theSound.SoundEvent("gui_character_synergy_effect");
  4902. }
  4903. else if(itemName == 'Wolf Hour')
  4904. {
  4905. removedItem = inv.RemoveItem( itemId, 1 );
  4906. theSound.SoundEvent("gui_character_synergy_effect");
  4907. AddEffectDefault(EET_WolfHour, thePlayer, 'wolf hour');
  4908. }
  4909. else if ( itemName == 'q704_ft_golden_egg' )
  4910. {
  4911. AddPoints(ESkillPoint, 1, true);
  4912. removedItem = inv.RemoveItem( itemId, 1 );
  4913. theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt("panel_character_popup_title_buy_skill") + "<br>" + GetLocStringByKeyExt("panel_character_availablepoints") + " +1");
  4914. theSound.SoundEvent("gui_character_buy_skill");
  4915. }
  4916. else if ( itemName == 'mq7023_cake' )
  4917. {
  4918. this.AddAbility('mq7023_cake_vitality_bonus');
  4919. removedItem = inv.RemoveItem( itemId, 1 );
  4920. theSound.SoundEvent("gui_character_synergy_effect");
  4921. }
  4922. else
  4923. {
  4924. willRemoveItem = inv.GetItemQuantity(itemId) == 1 && !inv.ItemHasTag(itemId, 'InfiniteUse');
  4925.  
  4926. if(willRemoveItem)
  4927. toSlot = GetItemSlot(itemId);
  4928.  
  4929. removedItem = super.ConsumeItem(itemId);
  4930.  
  4931. if(willRemoveItem && removedItem)
  4932. {
  4933. edibles = inv.GetItemsByTag('Edibles');
  4934. equippedNewEdible = false;
  4935.  
  4936.  
  4937. for(i=0; i<edibles.Size(); i+=1)
  4938. {
  4939. if(!IsItemEquipped(edibles[i]) && !inv.ItemHasTag(edibles[i], 'Alcohol') && inv.GetItemName(edibles[i]) != 'Clearing Potion' && inv.GetItemName(edibles[i]) != 'Wolf Hour')
  4940. {
  4941. EquipItemInGivenSlot(edibles[i], toSlot, true, false);
  4942. equippedNewEdible = true;
  4943. break;
  4944. }
  4945. }
  4946.  
  4947.  
  4948. if(!equippedNewEdible)
  4949. {
  4950. for(i=0; i<edibles.Size(); i+=1)
  4951. {
  4952. if(!IsItemEquipped(edibles[i]) && inv.GetItemName(edibles[i]) != 'Clearing Potion' && inv.GetItemName(edibles[i]) != 'Wolf Hour')
  4953. {
  4954. EquipItemInGivenSlot(edibles[i], toSlot, true, false);
  4955. break;
  4956. }
  4957. }
  4958. }
  4959. }
  4960. }
  4961.  
  4962. return removedItem;
  4963. }
  4964.  
  4965.  
  4966. public final function GetAlcoholForAlchemicalItemsRefill() : SItemUniqueId
  4967. {
  4968. var alcos : array<SItemUniqueId>;
  4969. var id : SItemUniqueId;
  4970. var i, price, minPrice : int;
  4971.  
  4972. alcos = inv.GetItemsByTag(theGame.params.TAG_ALCHEMY_REFILL_ALCO);
  4973.  
  4974. if(alcos.Size() > 0)
  4975. {
  4976. if(inv.ItemHasTag(alcos[0], theGame.params.TAG_INFINITE_USE))
  4977. return alcos[0];
  4978.  
  4979. minPrice = inv.GetItemPrice(alcos[0]);
  4980. price = minPrice;
  4981. id = alcos[0];
  4982.  
  4983. for(i=1; i<alcos.Size(); i+=1)
  4984. {
  4985. if(inv.ItemHasTag(alcos[i], theGame.params.TAG_INFINITE_USE))
  4986. return alcos[i];
  4987.  
  4988. price = inv.GetItemPrice(alcos[i]);
  4989.  
  4990. if(price < minPrice)
  4991. {
  4992. minPrice = price;
  4993. id = alcos[i];
  4994. }
  4995. }
  4996.  
  4997. return id;
  4998. }
  4999.  
  5000. return GetInvalidUniqueId();
  5001. }
  5002.  
  5003. public final function ClearPreviouslyUsedBolt()
  5004. {
  5005. previouslyUsedBolt = GetInvalidUniqueId();
  5006. }
  5007.  
  5008. public function ShouldUseInfiniteWaterBolts() : bool
  5009. {
  5010. return GetCurrentStateName() == 'Swimming' || IsSwimming() || IsDiving();
  5011. }
  5012.  
  5013. public function GetCurrentInfiniteBoltName( optional forceBodkin : bool, optional forceHarpoon : bool ) : name
  5014. {
  5015. if(!forceBodkin && (forceHarpoon || ShouldUseInfiniteWaterBolts()) )
  5016. {
  5017. return 'Harpoon Bolt';
  5018. }
  5019. return 'Bodkin Bolt';
  5020. }
  5021.  
  5022.  
  5023. public final function AddAndEquipInfiniteBolt(optional forceBodkin : bool, optional forceHarpoon : bool)
  5024. {
  5025. var bolt, bodkins, harpoons : array<SItemUniqueId>;
  5026. var boltItemName : name;
  5027. var i : int;
  5028.  
  5029.  
  5030. bodkins = inv.GetItemsByName('Bodkin Bolt');
  5031. harpoons = inv.GetItemsByName('Harpoon Bolt');
  5032.  
  5033. for(i=bodkins.Size()-1; i>=0; i-=1)
  5034. inv.RemoveItem(bodkins[i], inv.GetItemQuantity(bodkins[i]) );
  5035.  
  5036. for(i=harpoons.Size()-1; i>=0; i-=1)
  5037. inv.RemoveItem(harpoons[i], inv.GetItemQuantity(harpoons[i]) );
  5038.  
  5039.  
  5040.  
  5041. boltItemName = GetCurrentInfiniteBoltName( forceBodkin, forceHarpoon );
  5042.  
  5043.  
  5044. if(boltItemName == 'Bodkin Bolt' && inv.IsIdValid(previouslyUsedBolt))
  5045. {
  5046. bolt.PushBack(previouslyUsedBolt);
  5047. }
  5048. else
  5049. {
  5050.  
  5051. bolt = inv.AddAnItem(boltItemName, 1, true, true);
  5052.  
  5053.  
  5054. if(boltItemName == 'Harpoon Bolt')
  5055. {
  5056. GetItemEquippedOnSlot(EES_Bolt, previouslyUsedBolt);
  5057. }
  5058. }
  5059.  
  5060. EquipItem(bolt[0], EES_Bolt);
  5061.  
  5062. }
  5063.  
  5064.  
  5065. event OnItemGiven(data : SItemChangedData)
  5066. {
  5067. var m_guiManager : CR4GuiManager;
  5068.  
  5069. super.OnItemGiven(data);
  5070.  
  5071.  
  5072. if(!inv)
  5073. inv = GetInventory();
  5074.  
  5075.  
  5076. if(inv.IsItemEncumbranceItem(data.ids[0]))
  5077. UpdateEncumbrance();
  5078.  
  5079. m_guiManager = theGame.GetGuiManager();
  5080. if(m_guiManager)
  5081. m_guiManager.RegisterNewItem(data.ids[0]);
  5082. }
  5083.  
  5084.  
  5085. public final function CheckForFullyArmedAchievement()
  5086. {
  5087. if( HasAllItemsFromSet(theGame.params.ITEM_SET_TAG_BEAR) || HasAllItemsFromSet(theGame.params.ITEM_SET_TAG_GRYPHON) ||
  5088. HasAllItemsFromSet(theGame.params.ITEM_SET_TAG_LYNX) || HasAllItemsFromSet(theGame.params.ITEM_SET_TAG_WOLF) ||
  5089. HasAllItemsFromSet(theGame.params.ITEM_SET_TAG_VIPER)
  5090. )
  5091. {
  5092. theGame.GetGamerProfile().AddAchievement(EA_FullyArmed);
  5093. }
  5094. }
  5095.  
  5096.  
  5097. public final function HasAllItemsFromSet(setItemTag : name) : bool
  5098. {
  5099. var item : SItemUniqueId;
  5100.  
  5101. if(!GetItemEquippedOnSlot(EES_SteelSword, item) || !inv.ItemHasTag(item, setItemTag))
  5102. return false;
  5103.  
  5104. if(!GetItemEquippedOnSlot(EES_SilverSword, item) || !inv.ItemHasTag(item, setItemTag))
  5105. return false;
  5106.  
  5107. if(!GetItemEquippedOnSlot(EES_Boots, item) || !inv.ItemHasTag(item, setItemTag))
  5108. return false;
  5109.  
  5110. if(!GetItemEquippedOnSlot(EES_Pants, item) || !inv.ItemHasTag(item, setItemTag))
  5111. return false;
  5112.  
  5113. if(!GetItemEquippedOnSlot(EES_Gloves, item) || !inv.ItemHasTag(item, setItemTag))
  5114. return false;
  5115.  
  5116. if(!GetItemEquippedOnSlot(EES_Armor, item) || !inv.ItemHasTag(item, setItemTag))
  5117. return false;
  5118.  
  5119.  
  5120. if(setItemTag == theGame.params.ITEM_SET_TAG_BEAR || setItemTag == theGame.params.ITEM_SET_TAG_LYNX)
  5121. {
  5122. if(!GetItemEquippedOnSlot(EES_RangedWeapon, item) || !inv.ItemHasTag(item, setItemTag))
  5123. return false;
  5124. }
  5125.  
  5126. return true;
  5127. }
  5128.  
  5129.  
  5130.  
  5131.  
  5132. public function GetTotalArmor() : SAbilityAttributeValue
  5133. {
  5134. var armor : SAbilityAttributeValue;
  5135. var armorItem : SItemUniqueId;
  5136.  
  5137. armor = super.GetTotalArmor();
  5138.  
  5139. if(GetItemEquippedOnSlot(EES_Armor, armorItem))
  5140. {
  5141.  
  5142. armor -= inv.GetItemAttributeValue(armorItem, theGame.params.ARMOR_VALUE_NAME);
  5143.  
  5144.  
  5145. armor += inv.GetItemArmorTotal(armorItem);
  5146. }
  5147.  
  5148. if(GetItemEquippedOnSlot(EES_Pants, armorItem))
  5149. {
  5150.  
  5151. armor -= inv.GetItemAttributeValue(armorItem, theGame.params.ARMOR_VALUE_NAME);
  5152.  
  5153.  
  5154. armor += inv.GetItemArmorTotal(armorItem);
  5155. }
  5156.  
  5157. if(GetItemEquippedOnSlot(EES_Boots, armorItem))
  5158. {
  5159.  
  5160. armor -= inv.GetItemAttributeValue(armorItem, theGame.params.ARMOR_VALUE_NAME);
  5161.  
  5162.  
  5163. armor += inv.GetItemArmorTotal(armorItem);
  5164. }
  5165.  
  5166. if(GetItemEquippedOnSlot(EES_Gloves, armorItem))
  5167. {
  5168.  
  5169. armor -= inv.GetItemAttributeValue(armorItem, theGame.params.ARMOR_VALUE_NAME);
  5170.  
  5171.  
  5172. armor += inv.GetItemArmorTotal(armorItem);
  5173. }
  5174.  
  5175. return armor;
  5176. }
  5177.  
  5178.  
  5179.  
  5180. public function ReduceArmorDurability() : EEquipmentSlots
  5181. {
  5182. var r, sum : int;
  5183. var slot : EEquipmentSlots;
  5184. var id : SItemUniqueId;
  5185. var prevDurMult, currDurMult, ratio : float;
  5186.  
  5187.  
  5188. sum = theGame.params.DURABILITY_ARMOR_CHEST_WEIGHT;
  5189. sum += theGame.params.DURABILITY_ARMOR_PANTS_WEIGHT;
  5190. sum += theGame.params.DURABILITY_ARMOR_GLOVES_WEIGHT;
  5191. sum += theGame.params.DURABILITY_ARMOR_BOOTS_WEIGHT;
  5192. sum += theGame.params.DURABILITY_ARMOR_MISS_WEIGHT;
  5193.  
  5194. r = RandRange(sum);
  5195.  
  5196. if(r < theGame.params.DURABILITY_ARMOR_CHEST_WEIGHT)
  5197. slot = EES_Armor;
  5198. else if (r < theGame.params.DURABILITY_ARMOR_CHEST_WEIGHT + theGame.params.DURABILITY_ARMOR_PANTS_WEIGHT)
  5199. slot = EES_Pants;
  5200. else if (r < theGame.params.DURABILITY_ARMOR_CHEST_WEIGHT + theGame.params.DURABILITY_ARMOR_PANTS_WEIGHT + theGame.params.DURABILITY_ARMOR_GLOVES_WEIGHT)
  5201. slot = EES_Gloves;
  5202. else if (r < theGame.params.DURABILITY_ARMOR_CHEST_WEIGHT + theGame.params.DURABILITY_ARMOR_PANTS_WEIGHT + theGame.params.DURABILITY_ARMOR_GLOVES_WEIGHT + theGame.params.DURABILITY_ARMOR_BOOTS_WEIGHT)
  5203. slot = EES_Boots;
  5204. else
  5205. return EES_InvalidSlot;
  5206.  
  5207. GetItemEquippedOnSlot(slot, id);
  5208. ratio = inv.GetItemDurabilityRatio(id);
  5209. if(inv.ReduceItemDurability(id))
  5210. {
  5211. prevDurMult = theGame.params.GetDurabilityMultiplier(ratio, false);
  5212.  
  5213. ratio = inv.GetItemDurabilityRatio(id);
  5214. currDurMult = theGame.params.GetDurabilityMultiplier(ratio, false);
  5215.  
  5216. if(currDurMult != prevDurMult)
  5217. {
  5218.  
  5219.  
  5220.  
  5221.  
  5222. }
  5223.  
  5224. return slot;
  5225. }
  5226.  
  5227. return EES_InvalidSlot;
  5228. }
  5229.  
  5230.  
  5231. public function DismantleItem(dismantledItem : SItemUniqueId, toolItem : SItemUniqueId) : bool
  5232. {
  5233. var parts : array<SItemParts>;
  5234. var i : int;
  5235.  
  5236. if(!inv.IsItemDismantleKit(toolItem))
  5237. return false;
  5238.  
  5239. parts = inv.GetItemRecyclingParts(dismantledItem);
  5240.  
  5241. if(parts.Size() <= 0)
  5242. return false;
  5243.  
  5244. for(i=0; i<parts.Size(); i+=1)
  5245. inv.AddAnItem(parts[i].itemName, parts[i].quantity, true, false);
  5246.  
  5247. inv.RemoveItem(toolItem);
  5248. inv.RemoveItem(dismantledItem);
  5249. return true;
  5250. }
  5251.  
  5252.  
  5253. public function GetItemEquippedOnSlot(slot : EEquipmentSlots, out item : SItemUniqueId) : bool
  5254. {
  5255. if(slot == EES_InvalidSlot || slot < 0 || slot > EnumGetMax('EEquipmentSlots'))
  5256. return false;
  5257.  
  5258. item = itemSlots[slot];
  5259.  
  5260. return inv.IsIdValid(item);
  5261. }
  5262.  
  5263.  
  5264. public function GetItemSlotByItemName(itemName : name) : EEquipmentSlots
  5265. {
  5266. var ids : array<SItemUniqueId>;
  5267. var i : int;
  5268. var slot : EEquipmentSlots;
  5269.  
  5270. ids = inv.GetItemsByName(itemName);
  5271. for(i=0; i<ids.Size(); i+=1)
  5272. {
  5273. slot = GetItemSlot(ids[i]);
  5274. if(slot != EES_InvalidSlot)
  5275. return slot;
  5276. }
  5277.  
  5278. return EES_InvalidSlot;
  5279. }
  5280.  
  5281.  
  5282. public function GetItemSlot(item : SItemUniqueId) : EEquipmentSlots
  5283. {
  5284. var i : int;
  5285.  
  5286. if(!inv.IsIdValid(item))
  5287. return EES_InvalidSlot;
  5288.  
  5289. for(i=0; i<itemSlots.Size(); i+=1)
  5290. if(itemSlots[i] == item)
  5291. return i;
  5292.  
  5293. return EES_InvalidSlot;
  5294. }
  5295.  
  5296. public function GetEquippedItems() : array<SItemUniqueId>
  5297. {
  5298. return itemSlots;
  5299. }
  5300.  
  5301. public function IsItemEquipped(item : SItemUniqueId) : bool
  5302. {
  5303. if(!inv.IsIdValid(item))
  5304. return false;
  5305.  
  5306. return itemSlots.Contains(item);
  5307. }
  5308.  
  5309. public function IsItemHeld(item : SItemUniqueId) : bool
  5310. {
  5311. if(!inv.IsIdValid(item))
  5312. return false;
  5313.  
  5314. return inv.IsItemHeld(item);
  5315. }
  5316.  
  5317.  
  5318. public function IsAnyItemEquippedOnSlot(slot : EEquipmentSlots) : bool
  5319. {
  5320. if(slot == EES_InvalidSlot || slot < 0 || slot > EnumGetMax('EEquipmentSlots'))
  5321. return false;
  5322.  
  5323. return inv.IsIdValid(itemSlots[slot]);
  5324. }
  5325.  
  5326.  
  5327. public function GetFreeQuickslot() : EEquipmentSlots
  5328. {
  5329. if(!inv.IsIdValid(itemSlots[EES_Quickslot1])) return EES_Quickslot1;
  5330. if(!inv.IsIdValid(itemSlots[EES_Quickslot2])) return EES_Quickslot2;
  5331.  
  5332.  
  5333. return EES_InvalidSlot;
  5334. }
  5335.  
  5336.  
  5337. event OnEquipItemRequested(item : SItemUniqueId, ignoreMount : bool)
  5338. {
  5339. var slot : EEquipmentSlots;
  5340.  
  5341. if(inv.IsIdValid(item))
  5342. {
  5343. slot = inv.GetSlotForItemId(item);
  5344.  
  5345. if (slot != EES_InvalidSlot)
  5346. {
  5347.  
  5348.  
  5349. EquipItemInGivenSlot(item, slot, ignoreMount);
  5350. }
  5351. }
  5352. }
  5353.  
  5354. event OnUnequipItemRequested(item : SItemUniqueId)
  5355. {
  5356. UnequipItem(item);
  5357. }
  5358.  
  5359.  
  5360. public function EquipItem(item : SItemUniqueId, optional slot : EEquipmentSlots, optional toHand : bool) : bool
  5361. {
  5362. if(!inv.IsIdValid(item))
  5363. return false;
  5364.  
  5365. if(slot == EES_InvalidSlot)
  5366. {
  5367. slot = inv.GetSlotForItemId(item);
  5368.  
  5369. if(slot == EES_InvalidSlot)
  5370. return false;
  5371. }
  5372.  
  5373. ForceSoundAppearanceUpdate();
  5374.  
  5375. return EquipItemInGivenSlot(item, slot, false, toHand);
  5376. }
  5377.  
  5378. protected function ShouldMount(slot : EEquipmentSlots, item : SItemUniqueId, category : name):bool
  5379. {
  5380.  
  5381.  
  5382. return !IsSlotPotionMutagen(slot) && category != 'usable' && category != 'potion' && category != 'petard' && !inv.ItemHasTag(item, 'PlayerUnwearable');
  5383. }
  5384.  
  5385. protected function ShouldMountItemWithName( itemName: name ): bool
  5386. {
  5387. var slot : EEquipmentSlots;
  5388. var items : array<SItemUniqueId>;
  5389. var category : name;
  5390. var i : int;
  5391.  
  5392. items = inv.GetItemsByName( itemName );
  5393.  
  5394. category = inv.GetItemCategory( items[0] );
  5395.  
  5396. slot = GetItemSlot( items[0] );
  5397.  
  5398. return ShouldMount( slot, items[0], category );
  5399. }
  5400.  
  5401. public function GetMountableItems( out items : array< SItemUniqueId > )
  5402. {
  5403. var i : int;
  5404. var mountable : bool;
  5405. var mountableItems : array< SItemUniqueId >;
  5406. var slot : EEquipmentSlots;
  5407. var category : name;
  5408. var item: SItemUniqueId;
  5409.  
  5410. for ( i = 0; i < items.Size(); i += 1 )
  5411. {
  5412. item = items[i];
  5413.  
  5414. category = inv.GetItemCategory( item );
  5415.  
  5416. slot = GetItemSlot( item );
  5417.  
  5418. mountable = ShouldMount( slot, item, category );
  5419.  
  5420. if ( mountable )
  5421. {
  5422. mountableItems.PushBack( items[ i ] );
  5423. }
  5424. }
  5425. items = mountableItems;
  5426. }
  5427.  
  5428. public final function AddAndEquipItem( item : name ) : bool
  5429. {
  5430. var ids : array< SItemUniqueId >;
  5431.  
  5432. ids = inv.AddAnItem( item );
  5433. if( inv.IsIdValid( ids[ 0 ] ) )
  5434. {
  5435. return EquipItem( ids[ 0 ] );
  5436. }
  5437.  
  5438. return false;
  5439. }
  5440.  
  5441. public final function AddQuestMarkedSelectedQuickslotItem( sel : SSelectedQuickslotItem )
  5442. {
  5443. questMarkedSelectedQuickslotItems.PushBack( sel );
  5444. }
  5445.  
  5446. public final function GetQuestMarkedSelectedQuickslotItem( sourceName : name ) : SItemUniqueId
  5447. {
  5448. var i : int;
  5449.  
  5450. for( i=0; i<questMarkedSelectedQuickslotItems.Size(); i+=1 )
  5451. {
  5452. if( questMarkedSelectedQuickslotItems[i].sourceName == sourceName )
  5453. {
  5454. return questMarkedSelectedQuickslotItems[i].itemID;
  5455. }
  5456. }
  5457.  
  5458. return GetInvalidUniqueId();
  5459. }
  5460.  
  5461. public final function SwapEquippedItems(slot1 : EEquipmentSlots, slot2 : EEquipmentSlots)
  5462. {
  5463. var temp : SItemUniqueId;
  5464. var pam : W3PlayerAbilityManager;
  5465.  
  5466. temp = itemSlots[slot1];
  5467. itemSlots[slot1] = itemSlots[slot2];
  5468. itemSlots[slot2] = temp;
  5469.  
  5470. if(IsSlotSkillMutagen(slot1))
  5471. {
  5472. pam = (W3PlayerAbilityManager)abilityManager;
  5473. if(pam)
  5474. pam.OnSwappedMutagensPost(itemSlots[slot1], itemSlots[slot2]);
  5475. }
  5476. }
  5477.  
  5478. public final function GetSlotForEquippedItem( itemID : SItemUniqueId ) : EEquipmentSlots
  5479. {
  5480. var i : int;
  5481.  
  5482. for( i=0; i<itemSlots.Size(); i+=1 )
  5483. {
  5484. if( itemSlots[i] == itemID )
  5485. {
  5486. return i;
  5487. }
  5488. }
  5489.  
  5490. return EES_InvalidSlot;
  5491. }
  5492.  
  5493. public function EquipItemInGivenSlot(item : SItemUniqueId, slot : EEquipmentSlots, ignoreMounting : bool, optional toHand : bool) : bool
  5494. {
  5495. var i, groupID, quantity : int;
  5496. var fistsID : array<SItemUniqueId>;
  5497. var pam : W3PlayerAbilityManager;
  5498. var isSkillMutagen : bool;
  5499. var armorEntity : CItemEntity;
  5500. var armorMeshComponent : CComponent;
  5501. var armorSoundIdentification : name;
  5502. var category : name;
  5503. var prevSkillColor : ESkillColor;
  5504. var containedAbilities : array<name>;
  5505. var dm : CDefinitionsManagerAccessor;
  5506. var armorType : EArmorType;
  5507. var otherMask, previousItemInSlot : SItemUniqueId;
  5508. var tutStatePot : W3TutorialManagerUIHandlerStatePotions;
  5509. var tutStateFood : W3TutorialManagerUIHandlerStateFood;
  5510. var tutStateSecondPotionEquip : W3TutorialManagerUIHandlerStateSecondPotionEquip;
  5511. var boltItem : SItemUniqueId;
  5512. var aerondight : W3Effect_Aerondight;
  5513.  
  5514. if(!inv.IsIdValid(item))
  5515. {
  5516. LogAssert(false, "W3PlayerWitcher.EquipItemInGivenSlot: invalid item");
  5517. return false;
  5518. }
  5519. if(slot == EES_InvalidSlot || slot == EES_HorseBlinders || slot == EES_HorseSaddle || slot == EES_HorseBag || slot == EES_HorseTrophy)
  5520. {
  5521. LogAssert(false, "W3PlayerWitcher.EquipItem: Cannot equip item <<" + inv.GetItemName(item) + ">> - provided slot <<" + slot + ">> is invalid");
  5522. return false;
  5523. }
  5524. if(itemSlots[slot] == item)
  5525. {
  5526. return true;
  5527. }
  5528.  
  5529. if(!HasRequiredLevelToEquipItem(item))
  5530. {
  5531.  
  5532. return false;
  5533. }
  5534.  
  5535. if(inv.ItemHasTag(item, 'PhantomWeapon') && !GetPhantomWeaponMgr())
  5536. {
  5537. InitPhantomWeaponMgr();
  5538. }
  5539.  
  5540.  
  5541. if( slot == EES_SilverSword && inv.ItemHasTag( item, 'Aerondight' ) )
  5542. {
  5543. AddEffectDefault( EET_Aerondight, this, "Aerondight" );
  5544.  
  5545.  
  5546. aerondight = (W3Effect_Aerondight)GetBuff( EET_Aerondight );
  5547. aerondight.Pause( 'ManageAerondightBuff' );
  5548. }
  5549.  
  5550.  
  5551. previousItemInSlot = itemSlots[slot];
  5552. if( IsItemEquipped(item))
  5553. {
  5554. SwapEquippedItems(slot, GetItemSlot(item));
  5555. return true;
  5556. }
  5557.  
  5558.  
  5559. isSkillMutagen = IsSlotSkillMutagen(slot);
  5560. if(isSkillMutagen)
  5561. {
  5562. pam = (W3PlayerAbilityManager)abilityManager;
  5563. if(!pam.IsSkillMutagenSlotUnlocked(slot))
  5564. {
  5565. return false;
  5566. }
  5567. }
  5568.  
  5569.  
  5570. if(inv.IsIdValid(previousItemInSlot))
  5571. {
  5572. if(!UnequipItemFromSlot(slot, true))
  5573. {
  5574. LogAssert(false, "W3PlayerWitcher.EquipItem: Cannot equip item <<" + inv.GetItemName(item) + ">> !!");
  5575. return false;
  5576. }
  5577. }
  5578.  
  5579.  
  5580. if(inv.IsItemMask(item))
  5581. {
  5582. if(slot == EES_Quickslot1)
  5583. GetItemEquippedOnSlot(EES_Quickslot2, otherMask);
  5584. else
  5585. GetItemEquippedOnSlot(EES_Quickslot1, otherMask);
  5586.  
  5587. if(inv.IsItemMask(otherMask))
  5588. UnequipItem(otherMask);
  5589. }
  5590.  
  5591. if(isSkillMutagen)
  5592. {
  5593. groupID = pam.GetSkillGroupIdOfMutagenSlot(slot);
  5594. prevSkillColor = pam.GetSkillGroupColor(groupID);
  5595. }
  5596.  
  5597. itemSlots[slot] = item;
  5598.  
  5599. category = inv.GetItemCategory( item );
  5600.  
  5601.  
  5602. if( !ignoreMounting && ShouldMount(slot, item, category) )
  5603. {
  5604.  
  5605. inv.MountItem( item, toHand, IsSlotSkillMutagen( slot ) );
  5606. }
  5607.  
  5608. theTelemetry.LogWithLabelAndValue( TE_INV_ITEM_EQUIPPED, inv.GetItemName(item), slot );
  5609.  
  5610. if(slot == EES_RangedWeapon)
  5611. {
  5612. rangedWeapon = ( Crossbow )( inv.GetItemEntityUnsafe(item) );
  5613. if(!rangedWeapon)
  5614. AddTimer('DelayedOnItemMount', 0.1, true);
  5615.  
  5616. if ( IsSwimming() || IsDiving() )
  5617. {
  5618. GetItemEquippedOnSlot(EES_Bolt, boltItem);
  5619.  
  5620. if(inv.IsIdValid(boltItem))
  5621. {
  5622. if ( !inv.ItemHasTag(boltItem, 'UnderwaterAmmo' ))
  5623. {
  5624. AddAndEquipInfiniteBolt(false, true);
  5625. }
  5626. }
  5627. else if(!IsAnyItemEquippedOnSlot(EES_Bolt))
  5628. {
  5629. AddAndEquipInfiniteBolt(false, true);
  5630. }
  5631. }
  5632.  
  5633. else if(!IsAnyItemEquippedOnSlot(EES_Bolt))
  5634. AddAndEquipInfiniteBolt();
  5635. }
  5636. else if(slot == EES_Bolt)
  5637. {
  5638. if(rangedWeapon)
  5639. { if ( !IsSwimming() || !IsDiving() )
  5640. {
  5641. rangedWeapon.OnReplaceAmmo();
  5642. rangedWeapon.OnWeaponReload();
  5643. }
  5644. else
  5645. {
  5646. DisplayHudMessage(GetLocStringByKeyExt( "menu_cannot_perform_action_now" ));
  5647. }
  5648. }
  5649. }
  5650.  
  5651. else if(isSkillMutagen)
  5652. {
  5653. theGame.GetGuiManager().IgnoreNewItemNotifications( true );
  5654.  
  5655.  
  5656. quantity = inv.GetItemQuantity( item );
  5657. if( quantity > 1 )
  5658. {
  5659. inv.SplitItem( item, quantity - 1 );
  5660. }
  5661.  
  5662. pam.OnSkillMutagenEquipped(item, slot, prevSkillColor);
  5663. LogSkillColors("Mutagen <<" + inv.GetItemName(item) + ">> equipped to slot <<" + slot + ">>");
  5664. LogSkillColors("Group bonus color is now <<" + pam.GetSkillGroupColor(groupID) + ">>");
  5665. LogSkillColors("");
  5666.  
  5667. theGame.GetGuiManager().IgnoreNewItemNotifications( false );
  5668. }
  5669. else if(slot == EES_Gloves && HasWeaponDrawn(false))
  5670. {
  5671. PlayRuneword4FX(PW_Steel);
  5672. PlayRuneword4FX(PW_Silver);
  5673. }
  5674.  
  5675. else if( ( slot == EES_Petard1 || slot == EES_Petard2 ) && inv.IsItemBomb( GetSelectedItemId() ) )
  5676. {
  5677. SelectQuickslotItem( slot );
  5678. }
  5679.  
  5680.  
  5681. if(inv.ItemHasAbility(item, 'MA_HtH'))
  5682. {
  5683. inv.GetItemContainedAbilities(item, containedAbilities);
  5684. fistsID = inv.GetItemsByName('fists');
  5685. dm = theGame.GetDefinitionsManager();
  5686. for(i=0; i<containedAbilities.Size(); i+=1)
  5687. {
  5688. if(dm.AbilityHasTag(containedAbilities[i], 'MA_HtH'))
  5689. {
  5690. inv.AddItemCraftedAbility(fistsID[0], containedAbilities[i], true);
  5691. }
  5692. }
  5693. }
  5694.  
  5695.  
  5696. if(inv.IsItemAnyArmor(item))
  5697. {
  5698. armorType = inv.GetArmorType(item);
  5699. pam = (W3PlayerAbilityManager)abilityManager;
  5700.  
  5701. if(armorType == EAT_Light)
  5702. {
  5703. if(CanUseSkill(S_Perk_05))
  5704. pam.SetPerkArmorBonus(S_Perk_05);
  5705. }
  5706. else if(armorType == EAT_Medium)
  5707. {
  5708. if(CanUseSkill(S_Perk_06))
  5709. pam.SetPerkArmorBonus(S_Perk_06);
  5710. }
  5711. else if(armorType == EAT_Heavy)
  5712. {
  5713. if(CanUseSkill(S_Perk_07))
  5714. pam.SetPerkArmorBonus(S_Perk_07);
  5715. }
  5716. }
  5717.  
  5718.  
  5719. UpdateItemSetBonuses( item, true );
  5720.  
  5721.  
  5722. theGame.GetGlobalEventsManager().OnScriptedEvent( SEC_OnItemEquipped );
  5723.  
  5724.  
  5725. if(ShouldProcessTutorial('TutorialPotionCanEquip3'))
  5726. {
  5727. if(IsSlotPotionSlot(slot))
  5728. {
  5729. tutStatePot = (W3TutorialManagerUIHandlerStatePotions)theGame.GetTutorialSystem().uiHandler.GetCurrentState();
  5730. if(tutStatePot)
  5731. {
  5732. tutStatePot.OnPotionEquipped(inv.GetItemName(item));
  5733. }
  5734.  
  5735. tutStateSecondPotionEquip = (W3TutorialManagerUIHandlerStateSecondPotionEquip)theGame.GetTutorialSystem().uiHandler.GetCurrentState();
  5736. if(tutStateSecondPotionEquip)
  5737. {
  5738. tutStateSecondPotionEquip.OnPotionEquipped(inv.GetItemName(item));
  5739. }
  5740.  
  5741. }
  5742. }
  5743.  
  5744. if(ShouldProcessTutorial('TutorialFoodSelectTab'))
  5745. {
  5746. if( IsSlotPotionSlot(slot) && inv.IsItemFood(item))
  5747. {
  5748. tutStateFood = (W3TutorialManagerUIHandlerStateFood)theGame.GetTutorialSystem().uiHandler.GetCurrentState();
  5749. if(tutStateFood)
  5750. {
  5751. tutStateFood.OnFoodEquipped();
  5752. }
  5753. }
  5754. }
  5755.  
  5756.  
  5757. if(inv.IsItemSetItem(item))
  5758. {
  5759. CheckForFullyArmedAchievement();
  5760. }
  5761.  
  5762. LevelUpEquipped(); //modLevelUpEquipped
  5763.  
  5764. return true;
  5765. }
  5766.  
  5767. private function CheckHairItem()
  5768. {
  5769. var ids : array<SItemUniqueId>;
  5770. var i : int;
  5771. var itemName : name;
  5772. var hairApplied : bool;
  5773.  
  5774. ids = inv.GetItemsByCategory('hair');
  5775.  
  5776. for(i=0; i<ids.Size(); i+= 1)
  5777. {
  5778. itemName = inv.GetItemName( ids[i] );
  5779.  
  5780. if( itemName != 'Preview Hair' )
  5781. {
  5782. if( hairApplied == false )
  5783. {
  5784. inv.MountItem( ids[i], false );
  5785. hairApplied = true;
  5786. }
  5787. else
  5788. {
  5789. inv.RemoveItem( ids[i], 1 );
  5790. }
  5791.  
  5792. }
  5793. }
  5794.  
  5795. if( hairApplied == false )
  5796. {
  5797. ids = inv.AddAnItem('Half With Tail Hairstyle', 1, true, false);
  5798. inv.MountItem( ids[0], false );
  5799. }
  5800.  
  5801. }
  5802.  
  5803.  
  5804. timer function DelayedOnItemMount( dt : float, id : int )
  5805. {
  5806. var crossbowID : SItemUniqueId;
  5807. var invent : CInventoryComponent;
  5808.  
  5809. invent = GetInventory();
  5810. if(!invent)
  5811. return;
  5812.  
  5813.  
  5814. GetItemEquippedOnSlot(EES_RangedWeapon, crossbowID);
  5815.  
  5816. if(invent.IsIdValid(crossbowID))
  5817. {
  5818.  
  5819. rangedWeapon = ( Crossbow )(invent.GetItemEntityUnsafe(crossbowID) );
  5820.  
  5821. if(rangedWeapon)
  5822. {
  5823.  
  5824. RemoveTimer('DelayedOnItemMount');
  5825. }
  5826. }
  5827. else
  5828. {
  5829.  
  5830. RemoveTimer('DelayedOnItemMount');
  5831. }
  5832. }
  5833.  
  5834. public function GetHeldItems() : array<SItemUniqueId>
  5835. {
  5836. var items : array<SItemUniqueId>;
  5837. var item : SItemUniqueId;
  5838.  
  5839. if( inv.GetItemEquippedOnSlot(EES_SilverSword, item) && inv.IsItemHeld(item))
  5840. items.PushBack(item);
  5841.  
  5842. if( inv.GetItemEquippedOnSlot(EES_SteelSword, item) && inv.IsItemHeld(item))
  5843. items.PushBack(item);
  5844.  
  5845. if( inv.GetItemEquippedOnSlot(EES_RangedWeapon, item) && inv.IsItemHeld(item))
  5846. items.PushBack(item);
  5847.  
  5848. if( inv.GetItemEquippedOnSlot(EES_Quickslot1, item) && inv.IsItemHeld(item))
  5849. items.PushBack(item);
  5850.  
  5851. if( inv.GetItemEquippedOnSlot(EES_Quickslot2, item) && inv.IsItemHeld(item))
  5852. items.PushBack(item);
  5853.  
  5854. if( inv.GetItemEquippedOnSlot(EES_Petard1, item) && inv.IsItemHeld(item))
  5855. items.PushBack(item);
  5856.  
  5857. if( inv.GetItemEquippedOnSlot(EES_Petard2, item) && inv.IsItemHeld(item))
  5858. items.PushBack(item);
  5859.  
  5860. return items;
  5861. }
  5862.  
  5863. public function MoveMutagenToSlot( item : SItemUniqueId, slotFrom : EEquipmentSlots, slotTo : EEquipmentSlots )
  5864. {
  5865. var pam : W3PlayerAbilityManager;
  5866. var prevSkillColor : ESkillColor;
  5867. var groupID : int;
  5868.  
  5869. if( IsSlotSkillMutagen( slotTo ) )
  5870. {
  5871. itemSlots[slotFrom] = GetInvalidUniqueId();
  5872.  
  5873. pam = (W3PlayerAbilityManager)abilityManager; //zur13 modSSS fixed orig script error
  5874. groupID = pam.GetSkillGroupIdOfMutagenSlot(slotFrom);
  5875. prevSkillColor = pam.GetSkillGroupColor(groupID);
  5876. pam = (W3PlayerAbilityManager)abilityManager;
  5877. pam.OnSkillMutagenUnequipped(item, slotFrom, prevSkillColor, true);
  5878.  
  5879.  
  5880.  
  5881. EquipItemInGivenSlot( item, slotTo, false );
  5882. }
  5883. }
  5884.  
  5885.  
  5886. public function UnequipItemFromSlot(slot : EEquipmentSlots, optional reequipped : bool) : bool
  5887. {
  5888. var item, bolts, id : SItemUniqueId;
  5889. var items : array<SItemUniqueId>;
  5890. var retBool : bool;
  5891. var fistsID, bolt : array<SItemUniqueId>;
  5892. var i, groupID : int;
  5893. var pam : W3PlayerAbilityManager;
  5894. var prevSkillColor : ESkillColor;
  5895. var containedAbilities : array<name>;
  5896. var dm : CDefinitionsManagerAccessor;
  5897. var armorType : EArmorType;
  5898. var isSwimming : bool;
  5899. var hud : CR4ScriptedHud;
  5900. var damagedItemModule : CR4HudModuleDamagedItems;
  5901.  
  5902. if(slot == EES_InvalidSlot || slot < 0 || slot > EnumGetMax('EEquipmentSlots') || !inv.IsIdValid(itemSlots[slot]))
  5903. return false;
  5904.  
  5905.  
  5906. if(IsSlotSkillMutagen(slot))
  5907. {
  5908.  
  5909. pam = (W3PlayerAbilityManager)abilityManager;
  5910. groupID = pam.GetSkillGroupIdOfMutagenSlot(slot);
  5911. prevSkillColor = pam.GetSkillGroupColor(groupID);
  5912. }
  5913.  
  5914.  
  5915. if(slot == EES_SilverSword || slot == EES_SteelSword)
  5916. {
  5917. PauseOilBuffs( slot == EES_SteelSword );
  5918. }
  5919.  
  5920. item = itemSlots[slot];
  5921. itemSlots[slot] = GetInvalidUniqueId();
  5922.  
  5923.  
  5924. if(inv.ItemHasTag( item, 'PhantomWeapon' ) && GetPhantomWeaponMgr())
  5925. {
  5926. DestroyPhantomWeaponMgr();
  5927. }
  5928.  
  5929.  
  5930.  
  5931.  
  5932. if( slot == EES_SilverSword && inv.ItemHasTag( item, 'Aerondight' ) )
  5933. {
  5934. RemoveBuff( EET_Aerondight );
  5935. }
  5936.  
  5937.  
  5938. if(slot == EES_RangedWeapon)
  5939. {
  5940.  
  5941. this.OnRangedForceHolster( true, true );
  5942. rangedWeapon.ClearDeployedEntity(true);
  5943. rangedWeapon = NULL;
  5944.  
  5945.  
  5946. if(GetItemEquippedOnSlot(EES_Bolt, bolts))
  5947. {
  5948. if(inv.ItemHasTag(bolts, theGame.params.TAG_INFINITE_AMMO))
  5949. {
  5950. inv.RemoveItem(bolts, inv.GetItemQuantity(bolts) );
  5951. }
  5952. }
  5953. }
  5954. else if(IsSlotSkillMutagen(slot))
  5955. {
  5956. pam.OnSkillMutagenUnequipped(item, slot, prevSkillColor);
  5957. LogSkillColors("Mutagen <<" + inv.GetItemName(item) + ">> unequipped from slot <<" + slot + ">>");
  5958. LogSkillColors("Group bonus color is now <<" + pam.GetSkillGroupColor(groupID) + ">>");
  5959. LogSkillColors("");
  5960. }
  5961.  
  5962.  
  5963. if(currentlyEquipedItem == item)
  5964. {
  5965. currentlyEquipedItem = GetInvalidUniqueId();
  5966. RaiseEvent('ForcedUsableItemUnequip');
  5967. }
  5968. if(currentlyEquipedItemL == item)
  5969. {
  5970. if ( currentlyUsedItemL )
  5971. {
  5972. currentlyUsedItemL.OnHidden( this );
  5973. }
  5974. HideUsableItem ( true );
  5975. }
  5976.  
  5977.  
  5978. if( !IsSlotPotionMutagen(slot) )
  5979. {
  5980. GetInventory().UnmountItem(item, true);
  5981. }
  5982.  
  5983. retBool = true;
  5984.  
  5985.  
  5986. if(IsAnyItemEquippedOnSlot(EES_RangedWeapon) && slot == EES_Bolt)
  5987. {
  5988. if(inv.ItemHasTag(item, theGame.params.TAG_INFINITE_AMMO))
  5989. {
  5990.  
  5991. inv.RemoveItem(item, inv.GetItemQuantityByName( inv.GetItemName(item) ) );
  5992. }
  5993. else if (!reequipped)
  5994. {
  5995.  
  5996. AddAndEquipInfiniteBolt();
  5997. }
  5998. }
  5999.  
  6000.  
  6001. if(slot == EES_SilverSword || slot == EES_SteelSword)
  6002. {
  6003. OnEquipMeleeWeapon(PW_None, true);
  6004. }
  6005.  
  6006. if( GetSelectedItemId() == item )
  6007. {
  6008. ClearSelectedItemId();
  6009. }
  6010.  
  6011. if(inv.IsItemBody(item))
  6012. {
  6013. retBool = true;
  6014. }
  6015.  
  6016. if(retBool && !reequipped)
  6017. {
  6018. theTelemetry.LogWithLabelAndValue( TE_INV_ITEM_UNEQUIPPED, inv.GetItemName(item), slot );
  6019.  
  6020.  
  6021. if(slot == EES_SteelSword && !IsAnyItemEquippedOnSlot(EES_SilverSword))
  6022. {
  6023. RemoveBuff(EET_EnhancedWeapon);
  6024. }
  6025. else if(slot == EES_SilverSword && !IsAnyItemEquippedOnSlot(EES_SteelSword))
  6026. {
  6027. RemoveBuff(EET_EnhancedWeapon);
  6028. }
  6029. else if(inv.IsItemAnyArmor(item))
  6030. {
  6031. if( !IsAnyItemEquippedOnSlot(EES_Armor) && !IsAnyItemEquippedOnSlot(EES_Gloves) && !IsAnyItemEquippedOnSlot(EES_Boots) && !IsAnyItemEquippedOnSlot(EES_Pants))
  6032. RemoveBuff(EET_EnhancedArmor);
  6033. }
  6034. }
  6035.  
  6036.  
  6037. if(inv.ItemHasAbility(item, 'MA_HtH'))
  6038. {
  6039. inv.GetItemContainedAbilities(item, containedAbilities);
  6040. fistsID = inv.GetItemsByName('fists');
  6041. dm = theGame.GetDefinitionsManager();
  6042. for(i=0; i<containedAbilities.Size(); i+=1)
  6043. {
  6044. if(dm.AbilityHasTag(containedAbilities[i], 'MA_HtH'))
  6045. {
  6046. inv.RemoveItemCraftedAbility(fistsID[0], containedAbilities[i]);
  6047. }
  6048. }
  6049. }
  6050.  
  6051.  
  6052. if(inv.IsItemAnyArmor(item))
  6053. {
  6054. armorType = inv.GetArmorType(item);
  6055. pam = (W3PlayerAbilityManager)abilityManager;
  6056.  
  6057. if(CanUseSkill(S_Perk_05) && (armorType == EAT_Light || GetCharacterStats().HasAbility('Glyphword 2 _Stats', true) || inv.ItemHasAbility(item, 'Glyphword 2 _Stats')))
  6058. {
  6059. pam.SetPerkArmorBonus(S_Perk_05);
  6060. }
  6061. if(CanUseSkill(S_Perk_06) && (armorType == EAT_Medium || GetCharacterStats().HasAbility('Glyphword 3 _Stats', true) || inv.ItemHasAbility(item, 'Glyphword 3 _Stats')) )
  6062. {
  6063. pam.SetPerkArmorBonus(S_Perk_06);
  6064. }
  6065. if(CanUseSkill(S_Perk_07) && (armorType == EAT_Heavy || GetCharacterStats().HasAbility('Glyphword 4 _Stats', true) || inv.ItemHasAbility(item, 'Glyphword 4 _Stats')) )
  6066. {
  6067. pam.SetPerkArmorBonus(S_Perk_07);
  6068. }
  6069. }
  6070.  
  6071.  
  6072. UpdateItemSetBonuses( item, false );
  6073.  
  6074.  
  6075. if( inv.ItemHasTag( item, theGame.params.ITEM_SET_TAG_BONUS ) && !IsSetBonusActive( EISB_RedWolf_2 ) )
  6076. {
  6077. SkillReduceBombAmmoBonus();
  6078. }
  6079.  
  6080. if( slot == EES_Gloves )
  6081. {
  6082. thePlayer.DestroyEffect('runeword_4');
  6083. }
  6084.  
  6085.  
  6086. hud = (CR4ScriptedHud)theGame.GetHud();
  6087. if ( hud )
  6088. {
  6089. damagedItemModule = hud.GetDamagedItemModule();
  6090. if ( damagedItemModule )
  6091. {
  6092. damagedItemModule.OnItemUnequippedFromSlot( slot );
  6093. }
  6094. }
  6095.  
  6096.  
  6097. theGame.GetGlobalEventsManager().OnScriptedEvent( SEC_OnItemEquipped );
  6098.  
  6099. return retBool;
  6100. }
  6101.  
  6102. public function UnequipItem(item : SItemUniqueId) : bool
  6103. {
  6104. if(!inv.IsIdValid(item))
  6105. return false;
  6106.  
  6107. return UnequipItemFromSlot( itemSlots.FindFirst(item) );
  6108. }
  6109.  
  6110. public function DropItem( item : SItemUniqueId, quantity : int ) : bool
  6111. {
  6112. if(!inv.IsIdValid(item))
  6113. return false;
  6114. if(IsItemEquipped(item))
  6115. return UnequipItem(item);
  6116.  
  6117. return true;
  6118. }
  6119.  
  6120.  
  6121. public function IsItemEquippedByName(itemName : name) : bool
  6122. {
  6123. var i : int;
  6124.  
  6125. for(i=0; i<itemSlots.Size(); i+=1)
  6126. if(inv.GetItemName(itemSlots[i]) == itemName)
  6127. return true;
  6128.  
  6129. return false;
  6130. }
  6131.  
  6132.  
  6133. public function IsItemEquippedByCategoryName(categoryName : name) : bool
  6134. {
  6135. var i : int;
  6136.  
  6137. for(i=0; i<itemSlots.Size(); i+=1)
  6138. if(inv.GetItemCategory(itemSlots[i]) == categoryName)
  6139. return true;
  6140.  
  6141. return false;
  6142. }
  6143.  
  6144. public function GetMaxRunEncumbrance(out usesHorseBonus : bool) : float
  6145. {
  6146. var value : float;
  6147.  
  6148. value = CalculateAttributeValue(GetHorseManager().GetHorseAttributeValue('encumbrance', false));
  6149. usesHorseBonus = (value > 0);
  6150. value += CalculateAttributeValue( GetAttributeValue('encumbrance') );
  6151.  
  6152. return value;
  6153. }
  6154.  
  6155. public function GetEncumbrance() : float
  6156. {
  6157. var i: int;
  6158. var encumbrance : float;
  6159. var items : array<SItemUniqueId>;
  6160. var inve : CInventoryComponent;
  6161.  
  6162. inve = GetInventory();
  6163. inve.GetAllItems(items);
  6164.  
  6165. for(i=0; i<items.Size(); i+=1)
  6166. {
  6167. encumbrance += inve.GetItemEncumbrance( items[i] );
  6168.  
  6169.  
  6170.  
  6171. }
  6172. return encumbrance;
  6173. }
  6174.  
  6175.  
  6176.  
  6177. public function StartInvUpdateTransaction():void
  6178. {
  6179. invUpdateTransaction = true;
  6180. }
  6181.  
  6182. public function FinishInvUpdateTransaction():void
  6183. {
  6184. invUpdateTransaction = false;
  6185.  
  6186.  
  6187.  
  6188. UpdateEncumbrance();
  6189. }
  6190.  
  6191.  
  6192. public function UpdateEncumbrance()
  6193. {
  6194. var temp : bool;
  6195.  
  6196. if (invUpdateTransaction)
  6197. {
  6198.  
  6199. return;
  6200. }
  6201.  
  6202.  
  6203.  
  6204. if ( GetEncumbrance() >= (GetMaxRunEncumbrance(temp) + 1) )
  6205. {
  6206. if( !HasBuff(EET_OverEncumbered) && FactsQuerySum( "DEBUG_EncumbranceBoy" ) == 0 )
  6207. {
  6208. AddEffectDefault(EET_OverEncumbered, NULL, "OverEncumbered");
  6209. }
  6210. }
  6211. else if(HasBuff(EET_OverEncumbered))
  6212. {
  6213. RemoveAllBuffsOfType(EET_OverEncumbered);
  6214. }
  6215. }
  6216.  
  6217. public final function GetSkillGroupIDFromIndex(idx : int) : int
  6218. {
  6219. var pam : W3PlayerAbilityManager;
  6220.  
  6221. pam = (W3PlayerAbilityManager)abilityManager;
  6222. if(pam && pam.IsInitialized())
  6223. return pam.GetSkillGroupIDFromIndex(idx);
  6224.  
  6225. return -1;
  6226. }
  6227.  
  6228. public final function GetSkillGroupColor(groupID : int) : ESkillColor
  6229. {
  6230. var pam : W3PlayerAbilityManager;
  6231.  
  6232. pam = (W3PlayerAbilityManager)abilityManager;
  6233. if(pam && pam.IsInitialized())
  6234. return pam.GetSkillGroupColor(groupID);
  6235.  
  6236. return SC_None;
  6237. }
  6238.  
  6239. public final function GetSkillGroupsCount() : int
  6240. {
  6241. var pam : W3PlayerAbilityManager;
  6242.  
  6243. pam = (W3PlayerAbilityManager)abilityManager;
  6244. if(pam && pam.IsInitialized())
  6245. return pam.GetSkillGroupsCount();
  6246.  
  6247. return 0;
  6248. }
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257. function CycleSelectSign( bIsCyclingLeft : bool ) : ESignType
  6258. {
  6259. var signOrder : array<ESignType>;
  6260. var i : int;
  6261.  
  6262. signOrder.PushBack( ST_Yrden );
  6263. signOrder.PushBack( ST_Quen );
  6264. signOrder.PushBack( ST_Igni );
  6265. signOrder.PushBack( ST_Axii );
  6266. signOrder.PushBack( ST_Aard );
  6267.  
  6268. for( i = 0; i < signOrder.Size(); i += 1 )
  6269. if( signOrder[i] == equippedSign )
  6270. break;
  6271.  
  6272. if(bIsCyclingLeft)
  6273. return signOrder[ (4 + i) % 5 ];
  6274. else
  6275. return signOrder[ (6 + i) % 5 ];
  6276. }
  6277.  
  6278. function ToggleNextSign()
  6279. {
  6280. SetEquippedSign(CycleSelectSign( false ));
  6281. FactsAdd("SignToggled", 1, 1);
  6282. }
  6283.  
  6284. function TogglePreviousSign()
  6285. {
  6286. SetEquippedSign(CycleSelectSign( true ));
  6287. FactsAdd("SignToggled", 1, 1);
  6288. }
  6289.  
  6290. function ProcessSignEvent( eventName : name ) : bool
  6291. {
  6292. if( currentlyCastSign != ST_None && signs[currentlyCastSign].entity)
  6293. {
  6294. return signs[currentlyCastSign].entity.OnProcessSignEvent( eventName );
  6295. }
  6296.  
  6297. return false;
  6298. }
  6299.  
  6300. var findActorTargetTimeStamp : float;
  6301. var pcModeChanneledSignTimeStamp : float;
  6302. event OnProcessCastingOrientation( isContinueCasting : bool )
  6303. {
  6304. var customOrientationTarget : EOrientationTarget;
  6305. var checkHeading : float;
  6306. var rotHeading : float;
  6307. var playerToHeadingDist : float;
  6308. var slideTargetActor : CActor;
  6309. var newLockTarget : CActor;
  6310.  
  6311. var enableNoTargetOrientation : bool;
  6312.  
  6313. var currTime : float;
  6314.  
  6315. enableNoTargetOrientation = true;
  6316. if ( GetDisplayTarget() && this.IsDisplayTargetTargetable() )
  6317. {
  6318. enableNoTargetOrientation = false;
  6319. if ( theInput.GetActionValue( 'CastSignHold' ) > 0 || this.IsCurrentSignChanneled() )
  6320. {
  6321. if ( IsPCModeEnabled() )
  6322. {
  6323. if ( EngineTimeToFloat( theGame.GetEngineTime() ) > pcModeChanneledSignTimeStamp + 1.f )
  6324. enableNoTargetOrientation = true;
  6325. }
  6326. else
  6327. {
  6328. if ( GetCurrentlyCastSign() == ST_Igni || GetCurrentlyCastSign() == ST_Axii )
  6329. {
  6330. slideTargetActor = (CActor)GetDisplayTarget();
  6331. if ( slideTargetActor
  6332. && ( !slideTargetActor.GetGameplayVisibility() || !CanBeTargetedIfSwimming( slideTargetActor ) || !slideTargetActor.IsAlive() ) )
  6333. {
  6334. SetSlideTarget( NULL );
  6335. if ( ProcessLockTarget() )
  6336. slideTargetActor = (CActor)slideTarget;
  6337. }
  6338.  
  6339. if ( !slideTargetActor )
  6340. {
  6341. LockToTarget( false );
  6342. enableNoTargetOrientation = true;
  6343. }
  6344. else if ( IsThreat( slideTargetActor ) || GetCurrentlyCastSign() == ST_Axii )
  6345. LockToTarget( true );
  6346. else
  6347. {
  6348. LockToTarget( false );
  6349. enableNoTargetOrientation = true;
  6350. }
  6351. }
  6352. }
  6353. }
  6354.  
  6355. if ( !enableNoTargetOrientation )
  6356. {
  6357. customOrientationTarget = OT_Actor;
  6358. }
  6359. }
  6360.  
  6361. if ( enableNoTargetOrientation )
  6362. {
  6363. if ( GetPlayerCombatStance() == PCS_AlertNear && theInput.GetActionValue( 'CastSignHold' ) > 0 )
  6364. {
  6365. if ( GetDisplayTarget() && !slideTargetActor )
  6366. {
  6367. currTime = EngineTimeToFloat( theGame.GetEngineTime() );
  6368. if ( currTime > findActorTargetTimeStamp + 1.5f )
  6369. {
  6370. findActorTargetTimeStamp = currTime;
  6371.  
  6372. newLockTarget = GetScreenSpaceLockTarget( GetDisplayTarget(), 180.f, 1.f, 0.f, true );
  6373.  
  6374. if ( newLockTarget && IsThreat( newLockTarget ) && IsCombatMusicEnabled() )
  6375. {
  6376. SetTarget( newLockTarget, true );
  6377. SetMoveTargetChangeAllowed( true );
  6378. SetMoveTarget( newLockTarget );
  6379. SetMoveTargetChangeAllowed( false );
  6380. SetSlideTarget( newLockTarget );
  6381. }
  6382. }
  6383. }
  6384. else
  6385. ProcessLockTarget();
  6386. }
  6387.  
  6388. if ( wasBRAxisPushed )
  6389. customOrientationTarget = OT_CameraOffset;
  6390. else
  6391. {
  6392. if ( !lastAxisInputIsMovement || theInput.LastUsedPCInput() )
  6393. customOrientationTarget = OT_CameraOffset;
  6394. else if ( theInput.GetActionValue( 'CastSignHold' ) > 0 )
  6395. {
  6396. if ( GetOrientationTarget() == OT_CameraOffset )
  6397. customOrientationTarget = OT_CameraOffset;
  6398. else if ( GetPlayerCombatStance() == PCS_AlertNear || GetPlayerCombatStance() == PCS_Guarded )
  6399. customOrientationTarget = OT_CameraOffset;
  6400. else
  6401. customOrientationTarget = OT_Player;
  6402. }
  6403. else
  6404. customOrientationTarget = OT_CustomHeading;
  6405. }
  6406. }
  6407.  
  6408. if ( GetCurrentlyCastSign() == ST_Quen )
  6409. {
  6410. if ( theInput.LastUsedPCInput() )
  6411. {
  6412. customOrientationTarget = OT_Camera;
  6413. }
  6414. else if ( IsCurrentSignChanneled() )
  6415. {
  6416. if ( bLAxisReleased )
  6417. customOrientationTarget = OT_Player;
  6418. else
  6419. customOrientationTarget = OT_Camera;
  6420. }
  6421. else
  6422. customOrientationTarget = OT_Player;
  6423. }
  6424.  
  6425. if ( GetCurrentlyCastSign() == ST_Axii && IsCurrentSignChanneled() )
  6426. {
  6427. if ( slideTarget && (CActor)slideTarget )
  6428. {
  6429. checkHeading = VecHeading( slideTarget.GetWorldPosition() - this.GetWorldPosition() );
  6430. rotHeading = checkHeading;
  6431. playerToHeadingDist = AngleDistance( GetHeading(), checkHeading );
  6432.  
  6433. if ( playerToHeadingDist > 45 )
  6434. SetCustomRotation( 'ChanneledSignAxii', rotHeading, 0.0, 0.5, false );
  6435. else if ( playerToHeadingDist < -45 )
  6436. SetCustomRotation( 'ChanneledSignAxii', rotHeading, 0.0, 0.5, false );
  6437. }
  6438. else
  6439. {
  6440. checkHeading = VecHeading( theCamera.GetCameraDirection() );
  6441. rotHeading = GetHeading();
  6442. playerToHeadingDist = AngleDistance( GetHeading(), checkHeading );
  6443.  
  6444. if ( playerToHeadingDist > 45 )
  6445. SetCustomRotation( 'ChanneledSignAxii', rotHeading - 22.5, 0.0, 0.5, false );
  6446. else if ( playerToHeadingDist < -45 )
  6447. SetCustomRotation( 'ChanneledSignAxii', rotHeading + 22.5, 0.0, 0.5, false );
  6448. }
  6449. }
  6450.  
  6451. if ( IsActorLockedToTarget() )
  6452. customOrientationTarget = OT_Actor;
  6453.  
  6454. //modEnhancedTargeting BEGIN
  6455. if ( theGame.GetInGameConfigWrapper().GetVarValue('EnhancedTargeting', 'ETSignsTowardsCamera') )
  6456. customOrientationTarget = OT_CameraOffset; // shitty tweak, oh well
  6457. //modEnhancedTargeting END
  6458.  
  6459. AddCustomOrientationTarget( customOrientationTarget, 'Signs' );
  6460.  
  6461. if ( customOrientationTarget == OT_CustomHeading )
  6462. SetOrientationTargetCustomHeading( GetCombatActionHeading(), 'Signs' );
  6463. }
  6464.  
  6465. event OnRaiseSignEvent()
  6466. {
  6467. var newTarget : CActor;
  6468.  
  6469. if ( ( !IsCombatMusicEnabled() && !CanAttackWhenNotInCombat( EBAT_CastSign, false, newTarget ) ) || ( IsOnBoat() && !IsCombatMusicEnabled() ) )
  6470. {
  6471. if ( CastSignFriendly() )
  6472. return true;
  6473. }
  6474. else
  6475. {
  6476. RaiseEvent('CombatActionFriendlyEnd');
  6477. SetBehaviorVariable( 'SignNum', (int)equippedSign );
  6478. SetBehaviorVariable( 'combatActionType', (int)CAT_CastSign );
  6479.  
  6480. if ( IsPCModeEnabled() )
  6481. pcModeChanneledSignTimeStamp = EngineTimeToFloat( theGame.GetEngineTime() );
  6482.  
  6483. if( RaiseForceEvent('CombatAction') )
  6484. {
  6485. OnCombatActionStart();
  6486. findActorTargetTimeStamp = EngineTimeToFloat( theGame.GetEngineTime() );
  6487. theTelemetry.LogWithValueStr(TE_FIGHT_PLAYER_USE_SIGN, SignEnumToString( equippedSign ));
  6488. return true;
  6489. }
  6490. }
  6491.  
  6492. return false;
  6493. }
  6494.  
  6495. function CastSignFriendly() : bool
  6496. {
  6497. var actor : CActor;
  6498.  
  6499. SetBehaviorVariable( 'combatActionTypeForOverlay', (int)CAT_CastSign );
  6500. if ( RaiseCombatActionFriendlyEvent() )
  6501. {
  6502.  
  6503. return true;
  6504. }
  6505.  
  6506. return false;
  6507. }
  6508.  
  6509. function CastSign() : bool
  6510. {
  6511. var equippedSignStr : string;
  6512. var newSignEnt : W3SignEntity;
  6513. var spawnPos : Vector;
  6514. var slotMatrix : Matrix;
  6515. var target : CActor;
  6516.  
  6517. if ( IsInAir() )
  6518. {
  6519. return false;
  6520. }
  6521.  
  6522. AddTemporarySkills();
  6523.  
  6524.  
  6525.  
  6526. if(equippedSign == ST_Aard)
  6527. {
  6528. CalcEntitySlotMatrix('l_weapon', slotMatrix);
  6529. spawnPos = MatrixGetTranslation(slotMatrix);
  6530. }
  6531. else
  6532. {
  6533. spawnPos = GetWorldPosition();
  6534. }
  6535.  
  6536. if( equippedSign == ST_Aard || equippedSign == ST_Igni )
  6537. {
  6538. target = GetTarget();
  6539. if(target)
  6540. target.SignalGameplayEvent( 'DodgeSign' );
  6541. }
  6542.  
  6543. newSignEnt = (W3SignEntity)theGame.CreateEntity( signs[equippedSign].template, spawnPos, GetWorldRotation() );
  6544. return newSignEnt.Init( signOwner, signs[equippedSign].entity );
  6545. }
  6546.  
  6547.  
  6548. private function HAX_SignToThrowItemRestore()
  6549. {
  6550. var action : SInputAction;
  6551.  
  6552. action.value = theInput.GetActionValue('ThrowItemHold');
  6553. action.lastFrameValue = 0;
  6554.  
  6555. if(IsPressed(action) && CanSetupCombatAction_Throw())
  6556. {
  6557. if(inv.IsItemBomb(selectedItemId))
  6558. {
  6559. BombThrowStart();
  6560. }
  6561. else
  6562. {
  6563. UsableItemStart();
  6564. }
  6565.  
  6566. SetThrowHold( true );
  6567. }
  6568. }
  6569.  
  6570. event OnCFMCameraZoomFail(){}
  6571.  
  6572.  
  6573.  
  6574. public final function GetDrunkMutagens( optional sourceName : string ) : array<CBaseGameplayEffect>
  6575. {
  6576. return effectManager.GetDrunkMutagens( sourceName );
  6577. }
  6578.  
  6579. public final function GetPotionBuffs() : array<CBaseGameplayEffect>
  6580. {
  6581. return effectManager.GetPotionBuffs();
  6582. }
  6583.  
  6584. public final function RecalcPotionsDurations()
  6585. {
  6586. var i : int;
  6587. var buffs : array<CBaseGameplayEffect>;
  6588.  
  6589. buffs = GetPotionBuffs();
  6590. for(i=0; i<buffs.Size(); i+=1)
  6591. {
  6592. buffs[i].RecalcPotionDuration();
  6593. }
  6594. }
  6595.  
  6596. public function StartFrenzy()
  6597. {
  6598. var ratio, duration : float;
  6599. var skillLevel : int;
  6600.  
  6601. isInFrenzy = true;
  6602. skillLevel = GetSkillLevel(S_Alchemy_s16);
  6603. ratio = 0.48f - skillLevel * CalculateAttributeValue(GetSkillAttributeValue(S_Alchemy_s16, 'slowdown_ratio', false, true));
  6604. duration = skillLevel * CalculateAttributeValue(GetSkillAttributeValue(S_Alchemy_s16, 'slowdown_duration', false, true));
  6605.  
  6606. theGame.SetTimeScale(ratio, theGame.GetTimescaleSource(ETS_SkillFrenzy), theGame.GetTimescalePriority(ETS_SkillFrenzy) );
  6607. AddTimer('SkillFrenzyFinish', duration * ratio, , , , true);
  6608. }
  6609.  
  6610. timer function SkillFrenzyFinish(dt : float, optional id : int)
  6611. {
  6612. theGame.RemoveTimeScale( theGame.GetTimescaleSource(ETS_SkillFrenzy) );
  6613. isInFrenzy = false;
  6614. }
  6615.  
  6616. public function GetToxicityDamageThreshold() : float
  6617. {
  6618. var ret : float;
  6619.  
  6620. ret = theGame.params.TOXICITY_DAMAGE_THRESHOLD;
  6621.  
  6622. if(CanUseSkill(S_Alchemy_s01))
  6623. ret += CalculateAttributeValue(GetSkillAttributeValue(S_Alchemy_s01, 'threshold', false, true)) * GetSkillLevel(S_Alchemy_s01);
  6624.  
  6625. return ret;
  6626. }
  6627.  
  6628.  
  6629.  
  6630. public final function AddToxicityOffset( val : float)
  6631. {
  6632. ((W3PlayerAbilityManager)abilityManager).AddToxicityOffset(val);
  6633. }
  6634.  
  6635. public final function SetToxicityOffset( val : float)
  6636. {
  6637. ((W3PlayerAbilityManager)abilityManager).SetToxicityOffset(val);
  6638. }
  6639.  
  6640. public final function RemoveToxicityOffset( val : float)
  6641. {
  6642. ((W3PlayerAbilityManager)abilityManager).RemoveToxicityOffset(val);
  6643. }
  6644.  
  6645.  
  6646. public final function CalculatePotionDuration(item : SItemUniqueId, isMutagenPotion : bool, optional itemName : name) : float
  6647. {
  6648. var duration, skillPassiveMod, mutagenSkillMod : float;
  6649. var val, min, max : SAbilityAttributeValue;
  6650.  
  6651.  
  6652. if(inv.IsIdValid(item))
  6653. {
  6654. duration = CalculateAttributeValue(inv.GetItemAttributeValue(item, 'duration'));
  6655. }
  6656. else
  6657. {
  6658. theGame.GetDefinitionsManager().GetItemAttributeValueNoRandom(itemName, true, 'duration', min, max);
  6659. duration = CalculateAttributeValue(GetAttributeRandomizedValue(min, max));
  6660. }
  6661.  
  6662. skillPassiveMod = CalculateAttributeValue(GetAttributeValue('potion_duration'));
  6663.  
  6664. if(isMutagenPotion && CanUseSkill(S_Alchemy_s14))
  6665. {
  6666. val = GetSkillAttributeValue(S_Alchemy_s14, 'duration', false, true);
  6667. mutagenSkillMod = val.valueMultiplicative * GetSkillLevel(S_Alchemy_s14);
  6668. }
  6669.  
  6670. duration = duration * (1 + skillPassiveMod + mutagenSkillMod);
  6671.  
  6672. return duration;
  6673. }
  6674.  
  6675. public function ToxicityLowEnoughToDrinkPotion( slotid : EEquipmentSlots, optional itemId : SItemUniqueId ) : bool
  6676. {
  6677. var item : SItemUniqueId;
  6678. var maxTox : float;
  6679. var potionToxicity : float;
  6680. var toxicityOffset : float;
  6681. var effectType : EEffectType;
  6682. var customAbilityName : name;
  6683.  
  6684. if(itemId != GetInvalidUniqueId())
  6685. item = itemId;
  6686. else
  6687. item = itemSlots[slotid];
  6688.  
  6689. inv.GetPotionItemBuffData(item, effectType, customAbilityName);
  6690. maxTox = abilityManager.GetStatMax(BCS_Toxicity);
  6691. potionToxicity = CalculateAttributeValue(inv.GetItemAttributeValue(item, 'toxicity'));
  6692. toxicityOffset = CalculateAttributeValue(inv.GetItemAttributeValue(item, 'toxicity_offset'));
  6693.  
  6694. if(effectType != EET_WhiteHoney)
  6695. {
  6696. if(abilityManager.GetStat(BCS_Toxicity, false) + potionToxicity + toxicityOffset > maxTox )
  6697. {
  6698. return false;
  6699. }
  6700. }
  6701.  
  6702. return true;
  6703. }
  6704.  
  6705. public final function HasFreeToxicityToDrinkPotion( item : SItemUniqueId, effectType : EEffectType, out finalPotionToxicity : float ) : bool
  6706. {
  6707. var i : int;
  6708. var maxTox, toxicityOffset, adrenaline : float;
  6709. var costReduction : SAbilityAttributeValue;
  6710.  
  6711.  
  6712. if( effectType == EET_WhiteHoney )
  6713. {
  6714. return true;
  6715. }
  6716.  
  6717.  
  6718. maxTox = abilityManager.GetStatMax(BCS_Toxicity);
  6719. finalPotionToxicity = CalculateAttributeValue(inv.GetItemAttributeValue(item, 'toxicity'));
  6720. toxicityOffset = CalculateAttributeValue(inv.GetItemAttributeValue(item, 'toxicity_offset'));
  6721.  
  6722.  
  6723. if(CanUseSkill(S_Perk_13))
  6724. {
  6725. costReduction = GetSkillAttributeValue(S_Perk_13, 'cost_reduction', false, true);
  6726. adrenaline = FloorF(GetStat(BCS_Focus));
  6727. costReduction = costReduction * adrenaline;
  6728. finalPotionToxicity = (finalPotionToxicity - costReduction.valueBase) * (1 - costReduction.valueMultiplicative) - costReduction.valueAdditive;
  6729. finalPotionToxicity = MaxF(0.f, finalPotionToxicity);
  6730. }
  6731.  
  6732.  
  6733. if(abilityManager.GetStat(BCS_Toxicity, false) + finalPotionToxicity + toxicityOffset > maxTox )
  6734. {
  6735. return false;
  6736. }
  6737.  
  6738. return true;
  6739. }
  6740.  
  6741. public function DrinkPreparedPotion( slotid : EEquipmentSlots, optional itemId : SItemUniqueId )
  6742. {
  6743. var potParams : W3PotionParams;
  6744. var potionParams : SCustomEffectParams;
  6745. var factPotionParams : W3Potion_Fact_Params;
  6746. var adrenaline, hpGainValue, duration, finalPotionToxicity : float;
  6747. var ret : EEffectInteract;
  6748. var effectType : EEffectType;
  6749. var item : SItemUniqueId;
  6750. var customAbilityName, factId : name;
  6751. var atts : array<name>;
  6752. var i : int;
  6753. var mutagenParams : W3MutagenBuffCustomParams;
  6754.  
  6755.  
  6756. if(itemId != GetInvalidUniqueId())
  6757. item = itemId;
  6758. else
  6759. item = itemSlots[slotid];
  6760.  
  6761.  
  6762. if(!inv.IsIdValid(item))
  6763. return;
  6764.  
  6765.  
  6766. if( inv.SingletonItemGetAmmo(item) == 0 )
  6767. return;
  6768.  
  6769.  
  6770. inv.GetPotionItemBuffData(item, effectType, customAbilityName);
  6771.  
  6772.  
  6773. if( !HasFreeToxicityToDrinkPotion( item, effectType, finalPotionToxicity ) )
  6774. {
  6775. return;
  6776. }
  6777.  
  6778. if(effectType == EET_Fact)
  6779. {
  6780. inv.GetItemAttributes(item, atts);
  6781.  
  6782. for(i=0; i<atts.Size(); i+=1)
  6783. {
  6784. if(StrBeginsWith(NameToString(atts[i]), "fact_"))
  6785. {
  6786. factId = atts[i];
  6787. break;
  6788. }
  6789. }
  6790.  
  6791. factPotionParams = new W3Potion_Fact_Params in theGame;
  6792. factPotionParams.factName = factId;
  6793. factPotionParams.potionItemName = inv.GetItemName(item);
  6794.  
  6795. potionParams.buffSpecificParams = factPotionParams;
  6796. }
  6797.  
  6798. else if(inv.ItemHasTag( item, 'Mutagen' ))
  6799. {
  6800. mutagenParams = new W3MutagenBuffCustomParams in theGame;
  6801. mutagenParams.toxicityOffset = CalculateAttributeValue(inv.GetItemAttributeValue(item, 'toxicity_offset'));
  6802. mutagenParams.potionItemName = inv.GetItemName(item);
  6803.  
  6804. potionParams.buffSpecificParams = mutagenParams;
  6805.  
  6806. if( IsMutationActive( EPMT_Mutation10 ) && !HasBuff( EET_Mutation10 ) )
  6807. {
  6808. AddEffectDefault( EET_Mutation10, this, "Mutation 10" );
  6809. }
  6810. }
  6811.  
  6812. else
  6813. {
  6814. potParams = new W3PotionParams in theGame;
  6815. potParams.potionItemName = inv.GetItemName(item);
  6816.  
  6817. potionParams.buffSpecificParams = potParams;
  6818. }
  6819.  
  6820.  
  6821. duration = CalculatePotionDuration(item, inv.ItemHasTag( item, 'Mutagen' ));
  6822.  
  6823.  
  6824. potionParams.effectType = effectType;
  6825. potionParams.creator = this;
  6826. potionParams.sourceName = "drank_potion";
  6827. potionParams.duration = duration;
  6828. potionParams.customAbilityName = customAbilityName;
  6829. ret = AddEffectCustom(potionParams);
  6830.  
  6831.  
  6832. if(factPotionParams)
  6833. delete factPotionParams;
  6834.  
  6835. if(mutagenParams)
  6836. delete mutagenParams;
  6837.  
  6838.  
  6839. inv.SingletonItemRemoveAmmo(item);
  6840.  
  6841.  
  6842. if(ret == EI_Pass || ret == EI_Override || ret == EI_Cumulate)
  6843. {
  6844. if( finalPotionToxicity > 0.f )
  6845. {
  6846. abilityManager.GainStat(BCS_Toxicity, finalPotionToxicity );
  6847. }
  6848.  
  6849.  
  6850. if(CanUseSkill(S_Perk_13))
  6851. {
  6852. abilityManager.DrainFocus(adrenaline);
  6853. }
  6854.  
  6855. if (!IsEffectActive('invisible'))
  6856. {
  6857. PlayEffect('use_potion');
  6858. }
  6859.  
  6860. if ( inv.ItemHasTag( item, 'Mutagen' ) )
  6861. {
  6862.  
  6863. theGame.GetGamerProfile().CheckTrialOfGrasses();
  6864.  
  6865.  
  6866. SetFailedFundamentalsFirstAchievementCondition(true);
  6867. }
  6868.  
  6869.  
  6870. if(CanUseSkill(S_Alchemy_s02))
  6871. {
  6872. hpGainValue = ClampF(GetStatMax(BCS_Vitality) * CalculateAttributeValue(GetSkillAttributeValue(S_Alchemy_s02, 'vitality_gain_perc', false, true)) * GetSkillLevel(S_Alchemy_s02), 0, GetStatMax(BCS_Vitality));
  6873. GainStat(BCS_Vitality, hpGainValue);
  6874. }
  6875.  
  6876.  
  6877. if(CanUseSkill(S_Alchemy_s04) && !skillBonusPotionEffect && (RandF() < CalculateAttributeValue(GetSkillAttributeValue(S_Alchemy_s04, 'apply_chance', false, true)) * GetSkillLevel(S_Alchemy_s04)))
  6878. {
  6879. AddRandomPotionEffectFromAlch4Skill( effectType );
  6880. }
  6881.  
  6882. theGame.GetGamerProfile().SetStat(ES_ActivePotions, effectManager.GetPotionBuffsCount());
  6883. }
  6884.  
  6885. theTelemetry.LogWithLabel(TE_ELIXIR_USED, inv.GetItemName(item));
  6886.  
  6887. if(ShouldProcessTutorial('TutorialPotionAmmo'))
  6888. {
  6889. FactsAdd("tut_used_potion");
  6890. }
  6891.  
  6892. SetFailedFundamentalsFirstAchievementCondition(true);
  6893. }
  6894.  
  6895.  
  6896. private final function AddRandomPotionEffectFromAlch4Skill( currentlyDrankPotion : EEffectType )
  6897. {
  6898. var randomPotions : array<EEffectType>;
  6899. var currentPotion : CBaseGameplayEffect;
  6900. var effectsOld, effectsNew : array<CBaseGameplayEffect>;
  6901. var i, ind : int;
  6902. var duration : float;
  6903. var params : SCustomEffectParams;
  6904. var ret : EEffectInteract;
  6905.  
  6906.  
  6907. randomPotions.PushBack( EET_BlackBlood );
  6908. randomPotions.PushBack( EET_Blizzard );
  6909. randomPotions.PushBack( EET_FullMoon );
  6910. randomPotions.PushBack( EET_GoldenOriole );
  6911. randomPotions.PushBack( EET_KillerWhale );
  6912. randomPotions.PushBack( EET_MariborForest );
  6913. randomPotions.PushBack( EET_PetriPhiltre );
  6914. randomPotions.PushBack( EET_Swallow );
  6915. randomPotions.PushBack( EET_TawnyOwl );
  6916. randomPotions.PushBack( EET_Thunderbolt );
  6917.  
  6918.  
  6919. randomPotions.Remove( currentlyDrankPotion );
  6920.  
  6921.  
  6922. ind = RandRange( randomPotions.Size() );
  6923.  
  6924.  
  6925. if( HasBuff( randomPotions[ ind ] ) )
  6926. {
  6927. currentPotion = GetBuff( randomPotions[ ind ] );
  6928. currentPotion.SetTimeLeft( currentPotion.GetInitialDurationAfterResists() );
  6929. }
  6930.  
  6931. else
  6932. {
  6933. duration = BonusPotionGetDurationFromXML( randomPotions[ ind ] );
  6934.  
  6935. if(duration > 0)
  6936. {
  6937. effectsOld = GetCurrentEffects();
  6938.  
  6939. params.effectType = randomPotions[ ind ];
  6940. params.creator = this;
  6941. params.sourceName = SkillEnumToName( S_Alchemy_s04 );
  6942. params.duration = duration;
  6943. ret = AddEffectCustom( params );
  6944.  
  6945.  
  6946. if( ret != EI_Undefined && ret != EI_Deny )
  6947. {
  6948. effectsNew = GetCurrentEffects();
  6949.  
  6950. ind = -1;
  6951. for( i=effectsNew.Size()-1; i>=0; i-=1)
  6952. {
  6953. if( !effectsOld.Contains( effectsNew[i] ) )
  6954. {
  6955. ind = i;
  6956. break;
  6957. }
  6958. }
  6959.  
  6960. if(ind > -1)
  6961. {
  6962. skillBonusPotionEffect = effectsNew[ind];
  6963. }
  6964. }
  6965. }
  6966. }
  6967. }
  6968.  
  6969.  
  6970. private function BonusPotionGetDurationFromXML(type : EEffectType) : float
  6971. {
  6972. var dm : CDefinitionsManagerAccessor;
  6973. var main, ingredients : SCustomNode;
  6974. var tmpName, typeName, itemName : name;
  6975. var abs : array<name>;
  6976. var min, max : SAbilityAttributeValue;
  6977. var tmpInt : int;
  6978. var temp : array<float>;
  6979. var i, temp2, temp3 : int;
  6980.  
  6981. dm = theGame.GetDefinitionsManager();
  6982. main = dm.GetCustomDefinition('alchemy_recipes');
  6983. typeName = EffectTypeToName(type);
  6984.  
  6985.  
  6986. for(i=0; i<main.subNodes.Size(); i+=1)
  6987. {
  6988. if(dm.GetCustomNodeAttributeValueName(main.subNodes[i], 'type_name', tmpName))
  6989. {
  6990.  
  6991. if(tmpName == typeName)
  6992. {
  6993. if(dm.GetCustomNodeAttributeValueInt(main.subNodes[i], 'level', tmpInt))
  6994. {
  6995.  
  6996. if(tmpInt == 1)
  6997. {
  6998. if(dm.GetCustomNodeAttributeValueName(main.subNodes[i], 'cookedItem_name', itemName))
  6999. {
  7000.  
  7001. if(IsNameValid(itemName))
  7002. {
  7003. break;
  7004. }
  7005. }
  7006. }
  7007. }
  7008. }
  7009. }
  7010. }
  7011.  
  7012. if(!IsNameValid(itemName))
  7013. return 0;
  7014.  
  7015.  
  7016. dm.GetItemAbilitiesWithWeights(itemName, true, abs, temp, temp2, temp3);
  7017. dm.GetAbilitiesAttributeValue(abs, 'duration', min, max);
  7018. return CalculateAttributeValue(GetAttributeRandomizedValue(min, max));
  7019. }
  7020.  
  7021. public function ClearSkillBonusPotionEffect()
  7022. {
  7023. skillBonusPotionEffect = NULL;
  7024. }
  7025.  
  7026. public function GetSkillBonusPotionEffect() : CBaseGameplayEffect
  7027. {
  7028. return skillBonusPotionEffect;
  7029. }
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037. public final function HasRunewordActive(abilityName : name) : bool
  7038. {
  7039. var item : SItemUniqueId;
  7040. var hasRuneword : bool;
  7041.  
  7042. if(GetItemEquippedOnSlot(EES_SteelSword, item))
  7043. {
  7044. hasRuneword = inv.ItemHasAbility(item, abilityName);
  7045. }
  7046.  
  7047. if(!hasRuneword)
  7048. {
  7049. if(GetItemEquippedOnSlot(EES_SilverSword, item))
  7050. {
  7051. hasRuneword = inv.ItemHasAbility(item, abilityName);
  7052. }
  7053. }
  7054.  
  7055. return hasRuneword;
  7056. }
  7057.  
  7058. public final function GetShrineBuffs() : array<CBaseGameplayEffect>
  7059. {
  7060. var null : array<CBaseGameplayEffect>;
  7061.  
  7062. if(effectManager && effectManager.IsReady())
  7063. return effectManager.GetShrineBuffs();
  7064.  
  7065. return null;
  7066. }
  7067.  
  7068. public final function AddRepairObjectBuff(armor : bool, weapon : bool) : bool
  7069. {
  7070. var added : bool;
  7071. // CA
  7072. var wpn : EPlayerWeapon;
  7073. // CA
  7074.  
  7075. added = false;
  7076.  
  7077. if(weapon && (IsAnyItemEquippedOnSlot(EES_SilverSword) || IsAnyItemEquippedOnSlot(EES_SteelSword)) )
  7078. {
  7079. // CA
  7080. if (CAGrindstoneAnimOn()) {
  7081. completeAnims.GrindstoneAnim();
  7082. } else {
  7083. AddEffectDefault(EET_EnhancedWeapon, this, "repair_object", false);
  7084. DisplayHudMessage(GetLocStringByKeyExt("panel_hud_message_repair_done"));
  7085. SoundEvent("gui_inventory_silversword_attach");
  7086. }
  7087. // CA
  7088. added = true;
  7089. }
  7090.  
  7091. if(armor && (IsAnyItemEquippedOnSlot(EES_Armor) || IsAnyItemEquippedOnSlot(EES_Gloves) || IsAnyItemEquippedOnSlot(EES_Boots) || IsAnyItemEquippedOnSlot(EES_Pants)) )
  7092. {
  7093. // CA
  7094. if (CAWorkbenchAnimOn()) {
  7095. completeAnims.WorkbenchAnim();
  7096. } else {
  7097. AddEffectDefault(EET_EnhancedArmor, this, "repair_object", false);
  7098. DisplayHudMessage(GetLocStringByKeyExt("panel_hud_message_repair_done"));
  7099. SoundEvent("gui_inventory_armor_attach");
  7100. }
  7101. // CA
  7102. added = true;
  7103. }
  7104.  
  7105. return added;
  7106. }
  7107.  
  7108. public function StartCSAnim(buff : CBaseGameplayEffect) : bool
  7109. {
  7110.  
  7111. if(IsAnyQuenActive() && (W3CriticalDOTEffect)buff)
  7112. return false;
  7113.  
  7114. return super.StartCSAnim(buff);
  7115. }
  7116.  
  7117. public function GetPotionBuffLevel(effectType : EEffectType) : int
  7118. {
  7119. if(effectManager && effectManager.IsReady())
  7120. return effectManager.GetPotionBuffLevel(effectType);
  7121.  
  7122. return 0;
  7123. }
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131. event OnLevelGained(currentLevel : int, show : bool)
  7132. {
  7133. var hud : CR4ScriptedHud;
  7134. hud = (CR4ScriptedHud)theGame.GetHud();
  7135.  
  7136. if(abilityManager && abilityManager.IsInitialized())
  7137. {
  7138. ((W3PlayerAbilityManager)abilityManager).OnLevelGained(currentLevel);
  7139. }
  7140.  
  7141. if ( theGame.GetDifficultyMode() != EDM_Hardcore )
  7142. {
  7143. Heal(GetStatMax(BCS_Vitality));
  7144. }
  7145.  
  7146.  
  7147. if(currentLevel >= 35)
  7148. {
  7149. theGame.GetGamerProfile().AddAchievement(EA_Immortal);
  7150. }
  7151.  
  7152. if ( hud && currentLevel < levelManager.GetMaxLevel() && FactsQuerySum( "DebugNoLevelUpUpdates" ) == 0 )
  7153. {
  7154. hud.OnLevelUpUpdate(currentLevel, show);
  7155. }
  7156.  
  7157. LevelUpEquipped(); //modLevelUpEquipped
  7158.  
  7159. theGame.RequestAutoSave( "level gained", false );
  7160. }
  7161.  
  7162. public function GetSignStats(skill : ESkill, out damageType : name, out damageVal : float, out spellPower : SAbilityAttributeValue)
  7163. {
  7164. var i, size : int;
  7165. var dm : CDefinitionsManagerAccessor;
  7166. var attrs : array<name>;
  7167.  
  7168. spellPower = GetPowerStatValue(CPS_SpellPower);
  7169.  
  7170. dm = theGame.GetDefinitionsManager();
  7171. dm.GetAbilityAttributes(GetSkillAbilityName(skill), attrs);
  7172. size = attrs.Size();
  7173.  
  7174. for( i = 0; i < size; i += 1 )
  7175. {
  7176. if( IsDamageTypeNameValid(attrs[i]) )
  7177. {
  7178. damageVal = CalculateAttributeValue(GetSkillAttributeValue(skill, attrs[i], false, true));
  7179. damageType = attrs[i];
  7180. break;
  7181. }
  7182. }
  7183. }
  7184.  
  7185.  
  7186. public function SetIgnorePainMaxVitality(val : float)
  7187. {
  7188. if(abilityManager && abilityManager.IsInitialized())
  7189. abilityManager.SetStatPointMax(BCS_Vitality, val);
  7190. }
  7191.  
  7192. event OnAnimEvent_ActionBlend( animEventName : name, animEventType : EAnimationEventType, animInfo : SAnimationEventAnimInfo )
  7193. {
  7194. if ( animEventType == AET_DurationStart && !disableActionBlend )
  7195. {
  7196. if ( this.IsCastingSign() )
  7197. ProcessSignEvent( 'cast_end' );
  7198.  
  7199.  
  7200. FindMoveTarget();
  7201. SetCanPlayHitAnim( true );
  7202. this.SetBIsCombatActionAllowed( true );
  7203.  
  7204. if ( this.GetFinisherVictim() && this.GetFinisherVictim().HasAbility( 'ForceFinisher' ) && !isInFinisher )
  7205. {
  7206. this.GetFinisherVictim().SignalGameplayEvent( 'Finisher' );
  7207. }
  7208. else if (this.BufferCombatAction != EBAT_EMPTY )
  7209. {
  7210.  
  7211.  
  7212.  
  7213. if ( !IsCombatMusicEnabled() )
  7214. {
  7215. SetCombatActionHeading( ProcessCombatActionHeading( this.BufferCombatAction ) );
  7216. FindTarget();
  7217. UpdateDisplayTarget( true );
  7218. }
  7219.  
  7220. if ( AllowAttack( GetTarget(), this.BufferCombatAction ) )
  7221. this.ProcessCombatActionBuffer();
  7222. }
  7223. else
  7224. {
  7225.  
  7226. ResumeStaminaRegen( 'InsideCombatAction' );
  7227.  
  7228.  
  7229.  
  7230. }
  7231. }
  7232. else if ( disableActionBlend )
  7233. {
  7234. disableActionBlend = false;
  7235. }
  7236. }
  7237.  
  7238.  
  7239. event OnAnimEvent_Sign( animEventName : name, animEventType : EAnimationEventType, animInfo : SAnimationEventAnimInfo )
  7240. {
  7241. if( animEventType == AET_Tick )
  7242. {
  7243. ProcessSignEvent( animEventName );
  7244. }
  7245. }
  7246.  
  7247. event OnAnimEvent_Throwable( animEventName : name, animEventType : EAnimationEventType, animInfo : SAnimationEventAnimInfo )
  7248. {
  7249. var thrownEntity : CThrowable;
  7250.  
  7251. thrownEntity = (CThrowable)EntityHandleGet( thrownEntityHandle );
  7252.  
  7253. if ( inv.IsItemCrossbow( inv.GetItemFromSlot('l_weapon') ) && rangedWeapon.OnProcessThrowEvent( animEventName ) )
  7254. {
  7255. return true;
  7256. }
  7257. else if( thrownEntity && IsThrowingItem() && thrownEntity.OnProcessThrowEvent( animEventName ) )
  7258. {
  7259. return true;
  7260. }
  7261. }
  7262.  
  7263. event OnTaskSyncAnim( npc : CNewNPC, animNameLeft : name )
  7264. {
  7265. var tmpBool : bool;
  7266. var tmpName : name;
  7267. var damage, points, resistance : float;
  7268. var min, max : SAbilityAttributeValue;
  7269. var mc : EMonsterCategory;
  7270.  
  7271. super.OnTaskSyncAnim( npc, animNameLeft );
  7272.  
  7273. if( animNameLeft == 'BruxaBite' && IsMutationActive( EPMT_Mutation4 ) )
  7274. {
  7275. theGame.GetMonsterParamsForActor( npc, mc, tmpName, tmpBool, tmpBool, tmpBool );
  7276.  
  7277. if( mc == MC_Vampire )
  7278. {
  7279. GetResistValue( CDS_BleedingRes, points, resistance );
  7280.  
  7281. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'BleedingEffect', 'DirectDamage', min, max );
  7282. damage = MaxF( 0.f, max.valueMultiplicative * GetMaxHealth() - points );
  7283.  
  7284. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'BleedingEffect', 'duration', min, max );
  7285. damage *= min.valueAdditive * ( 1 - MinF( 1.f, resistance ) );
  7286.  
  7287. if( damage > 0.f )
  7288. {
  7289. npc.AddAbility( 'Mutation4BloodDebuff' );
  7290. ProcessActionMutation4ReturnedDamage( damage, npc, EAHA_ForceNo );
  7291. npc.AddTimer( 'RemoveMutation4BloodDebuff', 15.f, , , , , true );
  7292. }
  7293. }
  7294. }
  7295. }
  7296.  
  7297.  
  7298. public function ProcessActionMutation4ReturnedDamage( damageDealt : float, attacker : CActor, hitAnimationType : EActionHitAnim, optional action : W3DamageAction ) : bool
  7299. {
  7300. var customParams : SCustomEffectParams;
  7301. var currToxicity : float;
  7302. var min, max, customDamageValue : SAbilityAttributeValue;
  7303. var dm : CDefinitionsManagerAccessor;
  7304. var animAction : W3DamageAction;
  7305.  
  7306. if( damageDealt <= 0 )
  7307. {
  7308. return false;
  7309. }
  7310.  
  7311. if( action )
  7312. {
  7313. action.SetMutation4Triggered();
  7314. }
  7315.  
  7316. dm = theGame.GetDefinitionsManager();
  7317. currToxicity = GetStat( BCS_Toxicity );
  7318.  
  7319. dm.GetAbilityAttributeValue( 'AcidEffect', 'DirectDamage', min, max );
  7320. customDamageValue.valueAdditive = damageDealt * min.valueAdditive;
  7321.  
  7322. if( currToxicity > 0 )
  7323. {
  7324. customDamageValue.valueAdditive *= currToxicity;
  7325. }
  7326.  
  7327. dm.GetAbilityAttributeValue( 'AcidEffect', 'duration', min, max );
  7328. customDamageValue.valueAdditive /= min.valueAdditive;
  7329.  
  7330. customParams.effectType = EET_Acid;
  7331. customParams.effectValue = customDamageValue;
  7332. customParams.duration = min.valueAdditive;
  7333. customParams.creator = this;
  7334. customParams.sourceName = 'Mutation4';
  7335.  
  7336. attacker.AddEffectCustom( customParams );
  7337.  
  7338.  
  7339. animAction = new W3DamageAction in theGame;
  7340. animAction.Initialize( this, attacker, NULL, 'Mutation4', EHRT_Reflect, CPS_Undefined, true, false, false, false );
  7341. animAction.SetCannotReturnDamage( true );
  7342. animAction.SetCanPlayHitParticle( false );
  7343. animAction.SetHitAnimationPlayType( hitAnimationType );
  7344. theGame.damageMgr.ProcessAction( animAction );
  7345. delete animAction;
  7346.  
  7347. theGame.MutationHUDFeedback( MFT_PlayOnce );
  7348.  
  7349. return true;
  7350. }
  7351.  
  7352. event OnPlayerActionEnd()
  7353. {
  7354. var l_i : int;
  7355. var l_bed : W3WitcherBed;
  7356.  
  7357. l_i = (int)GetBehaviorVariable( 'playerExplorationAction' );
  7358.  
  7359. if( l_i == PEA_GoToSleep )
  7360. {
  7361. l_bed = (W3WitcherBed)theGame.GetEntityByTag( 'witcherBed' );
  7362. BlockAllActions( 'WitcherBed', false );
  7363. l_bed.ApplyAppearance( "collision" );
  7364. l_bed.GotoState( 'WakeUp' );
  7365. theGame.ReleaseNoSaveLock( l_bed.m_bedSaveLock );
  7366.  
  7367.  
  7368. substateManager.m_MovementCorrectorO.disallowRotWhenGoingToSleep = false;
  7369. }
  7370.  
  7371. super.OnPlayerActionEnd();
  7372. }
  7373.  
  7374. event OnPlayerActionStartFinished()
  7375. {
  7376. var l_initData : W3SingleMenuInitData;
  7377. var l_i : int;
  7378.  
  7379. l_i = (int)GetBehaviorVariable( 'playerExplorationAction' );
  7380.  
  7381. if( l_i == PEA_GoToSleep )
  7382. {
  7383. l_initData = new W3SingleMenuInitData in this;
  7384. l_initData.SetBlockOtherPanels( true );
  7385. l_initData.ignoreSaveSystem = true;
  7386. l_initData.ignoreMeditationCheck = true;
  7387. l_initData.setDefaultState( '' );
  7388. l_initData.isBonusMeditationAvailable = true;
  7389. l_initData.fixedMenuName = 'MeditationClockMenu';
  7390.  
  7391. theGame.RequestMenuWithBackground( 'MeditationClockMenu', 'CommonMenu', l_initData );
  7392. }
  7393.  
  7394. super.OnPlayerActionStartFinished();
  7395. }
  7396.  
  7397. public function IsInCombatAction_SpecialAttack() : bool
  7398. {
  7399. if ( IsInCombatAction() && ( GetCombatAction() == EBAT_SpecialAttack_Light || GetCombatAction() == EBAT_SpecialAttack_Heavy ) )
  7400. return true;
  7401. else
  7402. return false;
  7403. }
  7404.  
  7405. public function IsInCombatAction_SpecialAttackHeavy() : bool
  7406. {
  7407. if ( IsInCombatAction() && GetCombatAction() == EBAT_SpecialAttack_Heavy )
  7408. return true;
  7409. else
  7410. return false;
  7411. }
  7412.  
  7413. protected function WhenCombatActionIsFinished()
  7414. {
  7415. super.WhenCombatActionIsFinished();
  7416. RemoveTimer( 'ProcessAttackTimer' );
  7417. RemoveTimer( 'AttackTimerEnd' );
  7418. CastSignAbort();
  7419. specialAttackCamera = false;
  7420. this.OnPerformSpecialAttack( true, false );
  7421. }
  7422.  
  7423. event OnCombatActionEnd()
  7424. {
  7425. this.CleanCombatActionBuffer();
  7426. super.OnCombatActionEnd();
  7427.  
  7428. RemoveTemporarySkills();
  7429. }
  7430.  
  7431. event OnCombatActionFriendlyEnd()
  7432. {
  7433. if ( IsCastingSign() )
  7434. {
  7435. SetBehaviorVariable( 'IsCastingSign', 0 );
  7436. SetCurrentlyCastSign( ST_None, NULL );
  7437. LogChannel( 'ST_None', "ST_None" );
  7438. }
  7439.  
  7440. super.OnCombatActionFriendlyEnd();
  7441. }
  7442.  
  7443. public function GetPowerStatValue( stat : ECharacterPowerStats, optional ablName : name, optional ignoreDeath : bool ) : SAbilityAttributeValue
  7444. {
  7445. var result : SAbilityAttributeValue;
  7446.  
  7447.  
  7448. result = super.GetPowerStatValue( stat, ablName, ignoreDeath );
  7449. ApplyMutation10StatBoost( result );
  7450.  
  7451. return result;
  7452. }
  7453.  
  7454.  
  7455.  
  7456. timer function OpenRadialMenu( time: float, id : int )
  7457. {
  7458.  
  7459. if( GetBIsCombatActionAllowed() && !IsUITakeInput() )
  7460. {
  7461. bShowRadialMenu = true;
  7462. }
  7463.  
  7464. this.RemoveTimer('OpenRadialMenu');
  7465. }
  7466.  
  7467. public function OnAddRadialMenuOpenTimer( )
  7468. {
  7469.  
  7470.  
  7471.  
  7472.  
  7473.  
  7474. this.AddTimer('OpenRadialMenu', _HoldBeforeOpenRadialMenuTime * theGame.GetTimeScale() );
  7475.  
  7476. }
  7477.  
  7478. public function SetShowRadialMenuOpenFlag( bSet : bool )
  7479. {
  7480.  
  7481. bShowRadialMenu = bSet;
  7482. }
  7483.  
  7484. public function OnRemoveRadialMenuOpenTimer()
  7485. {
  7486.  
  7487. this.RemoveTimer('OpenRadialMenu');
  7488. }
  7489.  
  7490. public function ResetRadialMenuOpenTimer()
  7491. {
  7492.  
  7493. this.RemoveTimer('OpenRadialMenu');
  7494. if( GetBIsCombatActionAllowed() )
  7495. {
  7496.  
  7497.  
  7498. AddTimer('OpenRadialMenu', _HoldBeforeOpenRadialMenuTime * theGame.GetTimeScale() );
  7499. }
  7500. }
  7501.  
  7502.  
  7503.  
  7504. timer function ResendCompanionDisplayName(dt : float, id : int)
  7505. {
  7506. var hud : CR4ScriptedHud;
  7507. var companionModule : CR4HudModuleCompanion;
  7508.  
  7509. hud = (CR4ScriptedHud)theGame.GetHud();
  7510. if( hud )
  7511. {
  7512. companionModule = (CR4HudModuleCompanion)hud.GetHudModule("CompanionModule");
  7513. if( companionModule )
  7514. {
  7515. companionModule.ResendDisplayName();
  7516. }
  7517. }
  7518. }
  7519.  
  7520. timer function ResendCompanionDisplayNameSecond(dt : float, id : int)
  7521. {
  7522. var hud : CR4ScriptedHud;
  7523. var companionModule : CR4HudModuleCompanion;
  7524.  
  7525. hud = (CR4ScriptedHud)theGame.GetHud();
  7526. if( hud )
  7527. {
  7528. companionModule = (CR4HudModuleCompanion)hud.GetHudModule("CompanionModule");
  7529. if( companionModule )
  7530. {
  7531. companionModule.ResendDisplayNameSecond();
  7532. }
  7533. }
  7534. }
  7535.  
  7536. public function RemoveCompanionDisplayNameTimer()
  7537. {
  7538. this.RemoveTimer('ResendCompanionDisplayName');
  7539. }
  7540.  
  7541. public function RemoveCompanionDisplayNameTimerSecond()
  7542. {
  7543. this.RemoveTimer('ResendCompanionDisplayNameSecond');
  7544. }
  7545.  
  7546.  
  7547. public function GetCompanionNPCTag() : name
  7548. {
  7549. return companionNPCTag;
  7550. }
  7551.  
  7552. public function SetCompanionNPCTag( value : name )
  7553. {
  7554. companionNPCTag = value;
  7555. }
  7556.  
  7557. public function GetCompanionNPCTag2() : name
  7558. {
  7559. return companionNPCTag2;
  7560. }
  7561.  
  7562. public function SetCompanionNPCTag2( value : name )
  7563. {
  7564. companionNPCTag2 = value;
  7565. }
  7566.  
  7567. public function GetCompanionNPCIconPath() : string
  7568. {
  7569. return companionNPCIconPath;
  7570. }
  7571.  
  7572. public function SetCompanionNPCIconPath( value : string )
  7573. {
  7574. companionNPCIconPath = value;
  7575. }
  7576.  
  7577. public function GetCompanionNPCIconPath2() : string
  7578. {
  7579. return companionNPCIconPath2;
  7580. }
  7581.  
  7582. public function SetCompanionNPCIconPath2( value : string )
  7583. {
  7584. companionNPCIconPath2 = value;
  7585. }
  7586.  
  7587.  
  7588.  
  7589. public function ReactToBeingHit(damageAction : W3DamageAction, optional buffNotApplied : bool) : bool
  7590. {
  7591. var chance : float;
  7592. var procQuen : W3SignEntity;
  7593.  
  7594. if(!damageAction.IsDoTDamage() && damageAction.DealsAnyDamage())
  7595. {
  7596. if(inv.IsItemBomb(selectedItemId))
  7597. {
  7598. BombThrowAbort();
  7599. }
  7600. else
  7601. {
  7602.  
  7603. ThrowingAbort();
  7604. }
  7605. }
  7606.  
  7607.  
  7608. if(damageAction.IsActionRanged())
  7609. {
  7610. chance = CalculateAttributeValue(GetAttributeValue('quen_chance_on_projectile'));
  7611. if(chance > 0)
  7612. {
  7613. chance = ClampF(chance, 0, 1);
  7614.  
  7615. if(RandF() < chance)
  7616. {
  7617. procQuen = (W3SignEntity)theGame.CreateEntity(signs[ST_Quen].template, GetWorldPosition(), GetWorldRotation() );
  7618. procQuen.Init(signOwner, signs[ST_Quen].entity, true );
  7619. procQuen.OnStarted();
  7620. procQuen.OnThrowing();
  7621. procQuen.OnEnded();
  7622. }
  7623. }
  7624. }
  7625.  
  7626.  
  7627. if( !((W3Effect_Toxicity)damageAction.causer) )
  7628. MeditationForceAbort(true);
  7629.  
  7630.  
  7631. if(IsDoingSpecialAttack(false))
  7632. damageAction.SetHitAnimationPlayType(EAHA_ForceNo);
  7633.  
  7634. return super.ReactToBeingHit(damageAction, buffNotApplied);
  7635. }
  7636.  
  7637. protected function ShouldPauseHealthRegenOnHit() : bool
  7638. {
  7639.  
  7640. if( ( HasBuff( EET_Swallow ) && GetPotionBuffLevel( EET_Swallow ) >= 3 ) || HasBuff( EET_Runeword8 ) || HasBuff( EET_Mutation11Buff ) )
  7641. {
  7642. return false;
  7643. }
  7644.  
  7645. return true;
  7646. }
  7647.  
  7648. public function SetMappinToHighlight( mappinName : name, mappinState : bool )
  7649. {
  7650. var mappinDef : SHighlightMappin;
  7651. mappinDef.MappinName = mappinName;
  7652. mappinDef.MappinState = mappinState;
  7653. MappinToHighlight.PushBack(mappinDef);
  7654. }
  7655.  
  7656. public function ClearMappinToHighlight()
  7657. {
  7658. MappinToHighlight.Clear();
  7659. }
  7660.  
  7661. public function CastSignAbort()
  7662. {
  7663. if( currentlyCastSign != ST_None && signs[currentlyCastSign].entity)
  7664. {
  7665. signs[currentlyCastSign].entity.OnSignAborted();
  7666. }
  7667.  
  7668.  
  7669. }
  7670.  
  7671. event OnBlockingSceneStarted( scene: CStoryScene )
  7672. {
  7673. var med : W3PlayerWitcherStateMeditationWaiting;
  7674.  
  7675.  
  7676. med = (W3PlayerWitcherStateMeditationWaiting)GetCurrentState();
  7677. if(med)
  7678. {
  7679. med.StopRequested(true);
  7680. }
  7681.  
  7682. //---=== modFriendlyMeditation ===---
  7683. EndExplorationMeditation();
  7684. //---=== modFriendlyMeditation ===---
  7685.  
  7686.  
  7687. super.OnBlockingSceneStarted( scene );
  7688. }
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694. public function GetHorseManager() : W3HorseManager
  7695. {
  7696. return (W3HorseManager)EntityHandleGet( horseManagerHandle );
  7697. }
  7698.  
  7699.  
  7700. public function HorseEquipItem(horsesItemId : SItemUniqueId) : bool
  7701. {
  7702. var man : W3HorseManager;
  7703.  
  7704. man = GetHorseManager();
  7705. if(man)
  7706. return man.EquipItem(horsesItemId) != GetInvalidUniqueId();
  7707.  
  7708. return false;
  7709. }
  7710.  
  7711.  
  7712. public function HorseUnequipItem(slot : EEquipmentSlots) : bool
  7713. {
  7714. var man : W3HorseManager;
  7715.  
  7716. man = GetHorseManager();
  7717. if(man)
  7718. return man.UnequipItem(slot) != GetInvalidUniqueId();
  7719.  
  7720. return false;
  7721. }
  7722.  
  7723.  
  7724. public final function HorseRemoveItemByName(itemName : name, quantity : int)
  7725. {
  7726. var man : W3HorseManager;
  7727.  
  7728. man = GetHorseManager();
  7729. if(man)
  7730. man.HorseRemoveItemByName(itemName, quantity);
  7731. }
  7732.  
  7733.  
  7734. public final function HorseRemoveItemByCategory(itemCategory : name, quantity : int)
  7735. {
  7736. var man : W3HorseManager;
  7737.  
  7738. man = GetHorseManager();
  7739. if(man)
  7740. man.HorseRemoveItemByCategory(itemCategory, quantity);
  7741. }
  7742.  
  7743.  
  7744. public final function HorseRemoveItemByTag(itemTag : name, quantity : int)
  7745. {
  7746. var man : W3HorseManager;
  7747.  
  7748. man = GetHorseManager();
  7749. if(man)
  7750. man.HorseRemoveItemByTag(itemTag, quantity);
  7751. }
  7752.  
  7753. public function GetAssociatedInventory() : CInventoryComponent
  7754. {
  7755. var man : W3HorseManager;
  7756.  
  7757. man = GetHorseManager();
  7758. if(man)
  7759. return man.GetInventoryComponent();
  7760.  
  7761. return NULL;
  7762. }
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768. public final function TutorialMutagensUnequipPlayerSkills() : array<STutorialSavedSkill>
  7769. {
  7770. var pam : W3PlayerAbilityManager;
  7771.  
  7772. pam = (W3PlayerAbilityManager)abilityManager;
  7773. return pam.TutorialMutagensUnequipPlayerSkills();
  7774. }
  7775.  
  7776. public final function TutorialMutagensEquipOneGoodSkill()
  7777. {
  7778. var pam : W3PlayerAbilityManager;
  7779.  
  7780. pam = (W3PlayerAbilityManager)abilityManager;
  7781. pam.TutorialMutagensEquipOneGoodSkill();
  7782. }
  7783.  
  7784. public final function TutorialMutagensEquipOneGoodOneBadSkill()
  7785. {
  7786. var pam : W3PlayerAbilityManager;
  7787.  
  7788. pam = (W3PlayerAbilityManager)abilityManager;
  7789. if(pam)
  7790. pam.TutorialMutagensEquipOneGoodOneBadSkill();
  7791. }
  7792.  
  7793. public final function TutorialMutagensEquipThreeGoodSkills()
  7794. {
  7795. var pam : W3PlayerAbilityManager;
  7796.  
  7797. pam = (W3PlayerAbilityManager)abilityManager;
  7798. if(pam)
  7799. pam.TutorialMutagensEquipThreeGoodSkills();
  7800. }
  7801.  
  7802. public final function TutorialMutagensCleanupTempSkills(savedEquippedSkills : array<STutorialSavedSkill>)
  7803. {
  7804. var pam : W3PlayerAbilityManager;
  7805.  
  7806. pam = (W3PlayerAbilityManager)abilityManager;
  7807. return pam.TutorialMutagensCleanupTempSkills(savedEquippedSkills);
  7808. }
  7809.  
  7810.  
  7811.  
  7812.  
  7813.  
  7814. public final function CalculatedArmorStaminaRegenBonus() : float
  7815. {
  7816. var armorEq, glovesEq, pantsEq, bootsEq : bool;
  7817. var tempItem : SItemUniqueId;
  7818. var staminaRegenVal : float;
  7819. var armorRegenVal : SAbilityAttributeValue;
  7820.  
  7821. if( HasAbility( 'Glyphword 2 _Stats', true ) )
  7822. {
  7823. armorEq = inv.GetItemEquippedOnSlot( EES_Armor, tempItem );
  7824. glovesEq = inv.GetItemEquippedOnSlot( EES_Gloves, tempItem );
  7825. pantsEq = inv.GetItemEquippedOnSlot( EES_Pants, tempItem );
  7826. bootsEq = inv.GetItemEquippedOnSlot( EES_Boots, tempItem );
  7827.  
  7828. if ( armorEq )
  7829. staminaRegenVal += 0.1;
  7830. if ( glovesEq )
  7831. staminaRegenVal += 0.02;
  7832. if ( pantsEq )
  7833. staminaRegenVal += 0.1;
  7834. if ( bootsEq )
  7835. staminaRegenVal += 0.03;
  7836.  
  7837. }
  7838. else if( HasAbility( 'Glyphword 3 _Stats', true ) )
  7839. {
  7840. staminaRegenVal = 0;
  7841. }
  7842. else if( HasAbility( 'Glyphword 4 _Stats', true ) )
  7843. {
  7844. armorEq = inv.GetItemEquippedOnSlot( EES_Armor, tempItem );
  7845. glovesEq = inv.GetItemEquippedOnSlot( EES_Gloves, tempItem );
  7846. pantsEq = inv.GetItemEquippedOnSlot( EES_Pants, tempItem );
  7847. bootsEq = inv.GetItemEquippedOnSlot( EES_Boots, tempItem );
  7848.  
  7849. if ( armorEq )
  7850. staminaRegenVal -= 0.1;
  7851. if ( glovesEq )
  7852. staminaRegenVal -= 0.02;
  7853. if ( pantsEq )
  7854. staminaRegenVal -= 0.1;
  7855. if ( bootsEq )
  7856. staminaRegenVal -= 0.03;
  7857. }
  7858. else
  7859. {
  7860. armorRegenVal = GetAttributeValue('staminaRegen_armor_mod');
  7861. staminaRegenVal = armorRegenVal.valueMultiplicative;
  7862. }
  7863.  
  7864. return staminaRegenVal;
  7865. }
  7866.  
  7867. public function GetOffenseStatsList( optional hackMode : int ) : SPlayerOffenseStats
  7868. {
  7869. var playerOffenseStats:SPlayerOffenseStats;
  7870. var steelDmg, silverDmg, elementalSteel, elementalSilver : float;
  7871. var steelCritChance, steelCritDmg : float;
  7872. var silverCritChance, silverCritDmg : float;
  7873. var attackPower : SAbilityAttributeValue;
  7874. var fastCritChance, fastCritDmg : float;
  7875. var strongCritChance, strongCritDmg : float;
  7876. var fastAP, strongAP, min, max : SAbilityAttributeValue;
  7877. var item, crossbow : SItemUniqueId;
  7878. var value : SAbilityAttributeValue;
  7879. var mutagen : CBaseGameplayEffect;
  7880. var thunder : W3Potion_Thunderbolt;
  7881.  
  7882. if(!abilityManager || !abilityManager.IsInitialized())
  7883. return playerOffenseStats;
  7884.  
  7885. if (CanUseSkill(S_Sword_s21))
  7886. fastAP += GetSkillAttributeValue(S_Sword_s21, PowerStatEnumToName(CPS_AttackPower), false, true) * GetSkillLevel(S_Sword_s21);
  7887. if (CanUseSkill(S_Perk_05))
  7888. {
  7889. fastAP += GetAttributeValue('attack_power_fast_style');
  7890. fastCritDmg += CalculateAttributeValue(GetAttributeValue('critical_hit_chance_fast_style'));
  7891. strongCritDmg += CalculateAttributeValue(GetAttributeValue('critical_hit_chance_fast_style'));
  7892. }
  7893. if (CanUseSkill(S_Sword_s04))
  7894. strongAP += GetSkillAttributeValue(S_Sword_s04, PowerStatEnumToName(CPS_AttackPower), false, true) * GetSkillLevel(S_Sword_s04);
  7895. if (CanUseSkill(S_Perk_07))
  7896. strongAP += GetAttributeValue('attack_power_heavy_style');
  7897.  
  7898. if (CanUseSkill(S_Sword_s17))
  7899. {
  7900. fastCritChance += CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s17, theGame.params.CRITICAL_HIT_CHANCE, false, true)) * GetSkillLevel(S_Sword_s17);
  7901. fastCritDmg += CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s17, theGame.params.CRITICAL_HIT_DAMAGE_BONUS, false, true)) * GetSkillLevel(S_Sword_s17);
  7902. }
  7903.  
  7904. if (CanUseSkill(S_Sword_s08))
  7905. {
  7906. strongCritChance += CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s08, theGame.params.CRITICAL_HIT_CHANCE, false, true)) * GetSkillLevel(S_Sword_s08);
  7907. strongCritDmg += CalculateAttributeValue(GetSkillAttributeValue(S_Sword_s08, theGame.params.CRITICAL_HIT_DAMAGE_BONUS, false, true)) * GetSkillLevel(S_Sword_s08);
  7908. }
  7909.  
  7910. if ( HasBuff(EET_Mutagen05) && (GetStat(BCS_Vitality) == GetStatMax(BCS_Vitality)) )
  7911. {
  7912. attackPower += GetAttributeValue('damageIncrease');
  7913. }
  7914.  
  7915. steelCritChance += CalculateAttributeValue(GetAttributeValue(theGame.params.CRITICAL_HIT_CHANCE));
  7916. silverCritChance += CalculateAttributeValue(GetAttributeValue(theGame.params.CRITICAL_HIT_CHANCE));
  7917. steelCritDmg += CalculateAttributeValue(GetAttributeValue(theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7918. silverCritDmg += CalculateAttributeValue(GetAttributeValue(theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7919. attackPower += GetPowerStatValue(CPS_AttackPower);
  7920.  
  7921. if (GetItemEquippedOnSlot(EES_SteelSword, item))
  7922. {
  7923. steelDmg = GetTotalWeaponDamage(item, theGame.params.DAMAGE_NAME_SLASHING, GetInvalidUniqueId());
  7924. steelDmg += GetTotalWeaponDamage(item, theGame.params.DAMAGE_NAME_PIERCING, GetInvalidUniqueId());
  7925. steelDmg += GetTotalWeaponDamage(item, theGame.params.DAMAGE_NAME_BLUDGEONING, GetInvalidUniqueId());
  7926. elementalSteel = CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_FIRE));
  7927. elementalSteel += CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_FROST));
  7928. if ( GetInventory().IsItemHeld(item) )
  7929. {
  7930. steelCritChance -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_CHANCE));
  7931. silverCritChance -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_CHANCE));
  7932. steelCritDmg -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7933. silverCritDmg -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7934. }
  7935. steelCritChance += CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_CHANCE));
  7936. steelCritDmg += CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7937.  
  7938. thunder = (W3Potion_Thunderbolt)GetBuff(EET_Thunderbolt);
  7939. if(thunder && thunder.GetBuffLevel() == 3 && GetCurWeather() == EWE_Storm)
  7940. {
  7941. steelCritChance += 1.0f;
  7942. }
  7943. }
  7944. else
  7945. {
  7946. steelDmg += 0;
  7947. steelCritChance += 0;
  7948. steelCritDmg +=0;
  7949. }
  7950.  
  7951. if (GetItemEquippedOnSlot(EES_SilverSword, item))
  7952. {
  7953. silverDmg = GetTotalWeaponDamage(item, theGame.params.DAMAGE_NAME_SILVER, GetInvalidUniqueId());
  7954. elementalSilver = CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_FIRE));
  7955. elementalSilver += CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_FROST));
  7956. if ( GetInventory().IsItemHeld(item) )
  7957. {
  7958. steelCritChance -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_CHANCE));
  7959. silverCritChance -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_CHANCE));
  7960. steelCritDmg -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7961. silverCritDmg -= CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7962. }
  7963. silverCritChance += CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_CHANCE));
  7964. silverCritDmg += CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.CRITICAL_HIT_DAMAGE_BONUS));
  7965.  
  7966. thunder = (W3Potion_Thunderbolt)GetBuff(EET_Thunderbolt);
  7967. if(thunder && thunder.GetBuffLevel() == 3 && GetCurWeather() == EWE_Storm)
  7968. {
  7969. silverCritChance += 1.0f;
  7970. }
  7971. }
  7972. else
  7973. {
  7974. silverDmg += 0;
  7975. silverCritChance += 0;
  7976. silverCritDmg +=0;
  7977. }
  7978.  
  7979. if ( HasAbility('Runeword 4 _Stats', true) )
  7980. {
  7981. steelDmg += steelDmg * (abilityManager.GetOverhealBonus() / GetStatMax(BCS_Vitality));
  7982. silverDmg += silverDmg * (abilityManager.GetOverhealBonus() / GetStatMax(BCS_Vitality));
  7983. }
  7984.  
  7985. fastAP += attackPower;
  7986. strongAP += attackPower;
  7987.  
  7988. playerOffenseStats.steelFastCritChance = (steelCritChance + fastCritChance) * 100;
  7989. playerOffenseStats.steelFastCritDmg = steelCritDmg + fastCritDmg;
  7990. if ( steelDmg != 0 )
  7991. {
  7992. playerOffenseStats.steelFastDmg = (steelDmg + fastAP.valueBase) * fastAP.valueMultiplicative + fastAP.valueAdditive + elementalSteel;
  7993. playerOffenseStats.steelFastCritDmg = (steelDmg + fastAP.valueBase) * (fastAP.valueMultiplicative + playerOffenseStats.steelFastCritDmg) + fastAP.valueAdditive + elementalSteel;
  7994. }
  7995. else
  7996. {
  7997. playerOffenseStats.steelFastDmg = 0;
  7998. playerOffenseStats.steelFastCritDmg = 0;
  7999. }
  8000. playerOffenseStats.steelFastDPS = (playerOffenseStats.steelFastDmg * (100 - playerOffenseStats.steelFastCritChance) + playerOffenseStats.steelFastCritDmg * playerOffenseStats.steelFastCritChance) / 100;
  8001. playerOffenseStats.steelFastDPS = playerOffenseStats.steelFastDPS / 0.6;
  8002.  
  8003.  
  8004. playerOffenseStats.steelStrongCritChance = (steelCritChance + strongCritChance) * 100;
  8005. playerOffenseStats.steelStrongCritDmg = steelCritDmg + strongCritDmg;
  8006. if ( steelDmg != 0 )
  8007. {
  8008. playerOffenseStats.steelStrongDmg = (steelDmg + strongAP.valueBase) * strongAP.valueMultiplicative + strongAP.valueAdditive + elementalSteel;
  8009. playerOffenseStats.steelStrongDmg *= 1.833f;
  8010. playerOffenseStats.steelStrongCritDmg = (steelDmg + strongAP.valueBase) * (strongAP.valueMultiplicative + playerOffenseStats.steelStrongCritDmg) + strongAP.valueAdditive + elementalSteel;
  8011. playerOffenseStats.steelStrongCritDmg *= 1.833f; }
  8012. else
  8013. {
  8014. playerOffenseStats.steelStrongDmg = 0;
  8015. playerOffenseStats.steelStrongCritDmg = 0;
  8016. }
  8017. playerOffenseStats.steelStrongDPS = (playerOffenseStats.steelStrongDmg * (100 - playerOffenseStats.steelStrongCritChance) + playerOffenseStats.steelStrongCritDmg * playerOffenseStats.steelStrongCritChance) / 100;
  8018. playerOffenseStats.steelStrongDPS = playerOffenseStats.steelStrongDPS / 1.1;
  8019.  
  8020.  
  8021.  
  8022. playerOffenseStats.silverFastCritChance = (silverCritChance + fastCritChance) * 100;
  8023. playerOffenseStats.silverFastCritDmg = silverCritDmg + fastCritDmg;
  8024. if ( silverDmg != 0 )
  8025. {
  8026. playerOffenseStats.silverFastDmg = (silverDmg + fastAP.valueBase) * fastAP.valueMultiplicative + fastAP.valueAdditive + elementalSilver;
  8027. playerOffenseStats.silverFastCritDmg = (silverDmg + fastAP.valueBase) * (fastAP.valueMultiplicative + playerOffenseStats.silverFastCritDmg) + fastAP.valueAdditive + elementalSilver;
  8028. }
  8029. else
  8030. {
  8031. playerOffenseStats.silverFastDmg = 0;
  8032. playerOffenseStats.silverFastCritDmg = 0;
  8033. }
  8034. playerOffenseStats.silverFastDPS = (playerOffenseStats.silverFastDmg * (100 - playerOffenseStats.silverFastCritChance) + playerOffenseStats.silverFastCritDmg * playerOffenseStats.silverFastCritChance) / 100;
  8035. playerOffenseStats.silverFastDPS = playerOffenseStats.silverFastDPS / 0.6;
  8036.  
  8037.  
  8038. playerOffenseStats.silverStrongCritChance = (silverCritChance + strongCritChance) * 100;
  8039. playerOffenseStats.silverStrongCritDmg = silverCritDmg + strongCritDmg;
  8040. if ( silverDmg != 0 )
  8041. {
  8042. playerOffenseStats.silverStrongDmg = (silverDmg + strongAP.valueBase) * strongAP.valueMultiplicative + strongAP.valueAdditive + elementalSilver;
  8043. playerOffenseStats.silverStrongDmg *= 1.833f;
  8044. playerOffenseStats.silverStrongCritDmg = (silverDmg + strongAP.valueBase) * (strongAP.valueMultiplicative + playerOffenseStats.silverStrongCritDmg) + strongAP.valueAdditive + elementalSilver;
  8045. playerOffenseStats.silverStrongCritDmg *= 1.833f;
  8046. }
  8047. else
  8048. {
  8049. playerOffenseStats.silverStrongDmg = 0;
  8050. playerOffenseStats.silverStrongCritDmg = 0;
  8051. }
  8052. playerOffenseStats.silverStrongDPS = (playerOffenseStats.silverStrongDmg * (100 - playerOffenseStats.silverStrongCritChance) + playerOffenseStats.silverStrongCritDmg * playerOffenseStats.silverStrongCritChance) / 100;
  8053. playerOffenseStats.silverStrongDPS = playerOffenseStats.silverStrongDPS / 1.1;
  8054.  
  8055.  
  8056. playerOffenseStats.crossbowCritChance = GetCriticalHitChance( false, false, NULL, MC_NotSet, true );
  8057.  
  8058.  
  8059. playerOffenseStats.crossbowSteelDmgType = theGame.params.DAMAGE_NAME_PIERCING;
  8060. if (GetItemEquippedOnSlot(EES_Bolt, item))
  8061. {
  8062.  
  8063.  
  8064. steelDmg = CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_FIRE));
  8065. if(steelDmg > 0)
  8066. {
  8067. playerOffenseStats.crossbowSteelDmg = steelDmg;
  8068.  
  8069. playerOffenseStats.crossbowSteelDmgType = theGame.params.DAMAGE_NAME_FIRE;
  8070. playerOffenseStats.crossbowSilverDmg = steelDmg;
  8071. }
  8072. else
  8073. {
  8074. playerOffenseStats.crossbowSilverDmg = CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_SILVER));
  8075.  
  8076. steelDmg = CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_PIERCING));
  8077. if(steelDmg > 0)
  8078. {
  8079. playerOffenseStats.crossbowSteelDmg = steelDmg;
  8080. playerOffenseStats.crossbowSteelDmgType = theGame.params.DAMAGE_NAME_PIERCING;
  8081. }
  8082. else
  8083. {
  8084. playerOffenseStats.crossbowSteelDmg = CalculateAttributeValue(GetInventory().GetItemAttributeValue(item, theGame.params.DAMAGE_NAME_BLUDGEONING));
  8085. playerOffenseStats.crossbowSteelDmgType = theGame.params.DAMAGE_NAME_BLUDGEONING;
  8086. }
  8087. }
  8088. }
  8089.  
  8090. if (GetItemEquippedOnSlot(EES_RangedWeapon, item))
  8091. {
  8092. attackPower += GetInventory().GetItemAttributeValue(item, PowerStatEnumToName(CPS_AttackPower));
  8093. if(CanUseSkill(S_Perk_02))
  8094. {
  8095. attackPower += GetSkillAttributeValue(S_Perk_02, PowerStatEnumToName(CPS_AttackPower), false, true);
  8096. }
  8097.  
  8098.  
  8099. if( hackMode != 1 && ( IsMutationActive( EPMT_Mutation9 ) || hackMode == 2 ) )
  8100. {
  8101. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Mutation9', 'damage', min, max );
  8102. playerOffenseStats.crossbowSteelDmg += min.valueAdditive;
  8103. playerOffenseStats.crossbowSilverDmg += min.valueAdditive;
  8104. }
  8105.  
  8106. playerOffenseStats.crossbowSteelDmg = (playerOffenseStats.crossbowSteelDmg + attackPower.valueBase) * attackPower.valueMultiplicative + attackPower.valueAdditive;
  8107. playerOffenseStats.crossbowSilverDmg = (playerOffenseStats.crossbowSilverDmg + attackPower.valueBase) * attackPower.valueMultiplicative + attackPower.valueAdditive;
  8108. }
  8109. else
  8110. {
  8111. playerOffenseStats.crossbowSteelDmg = 0;
  8112. playerOffenseStats.crossbowSilverDmg = 0;
  8113. playerOffenseStats.crossbowSteelDmgType = theGame.params.DAMAGE_NAME_PIERCING;
  8114. }
  8115.  
  8116. return playerOffenseStats;
  8117. }
  8118.  
  8119. public function GetTotalWeaponDamage(weaponId : SItemUniqueId, damageTypeName : name, crossbowId : SItemUniqueId) : float
  8120. {
  8121. var damage, durRatio, durMod, itemMod : float;
  8122. var repairObjectBonus, min, max : SAbilityAttributeValue;
  8123.  
  8124. durMod = 0;
  8125. damage = super.GetTotalWeaponDamage(weaponId, damageTypeName, crossbowId);
  8126.  
  8127.  
  8128. if( IsMutationActive( EPMT_Mutation9 ) && inv.IsItemBolt( weaponId ) && IsDamageTypeAnyPhysicalType( damageTypeName ) )
  8129. {
  8130. theGame.GetDefinitionsManager().GetAbilityAttributeValue('Mutation9', 'damage', min, max);
  8131. damage += min.valueAdditive;
  8132. }
  8133.  
  8134.  
  8135. if(IsPhysicalResistStat(GetResistForDamage(damageTypeName, false)))
  8136. {
  8137. repairObjectBonus = inv.GetItemAttributeValue(weaponId, theGame.params.REPAIR_OBJECT_BONUS);
  8138. durRatio = -1;
  8139.  
  8140. if(inv.IsIdValid(crossbowId) && inv.HasItemDurability(crossbowId))
  8141. {
  8142. durRatio = inv.GetItemDurabilityRatio(crossbowId);
  8143. }
  8144. else if(inv.IsIdValid(weaponId) && inv.HasItemDurability(weaponId))
  8145. {
  8146. durRatio = inv.GetItemDurabilityRatio(weaponId);
  8147. }
  8148.  
  8149.  
  8150. if(durRatio >= 0)
  8151. durMod = theGame.params.GetDurabilityMultiplier(durRatio, true);
  8152. else
  8153. durMod = 1;
  8154. }
  8155.  
  8156.  
  8157. if( damageTypeName == 'SilverDamage' && inv.ItemHasTag( weaponId, 'Aerondight' ) )
  8158. {
  8159. itemMod = inv.GetItemModifierFloat( weaponId, 'PermDamageBoost' );
  8160. if( itemMod > 0.f )
  8161. {
  8162. damage += itemMod;
  8163. }
  8164. }
  8165.  
  8166. return damage * (durMod + repairObjectBonus.valueMultiplicative);
  8167. }
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173. public final function GetSkillPathType(skill : ESkill) : ESkillPath
  8174. {
  8175. if(abilityManager && abilityManager.IsInitialized())
  8176. return ((W3PlayerAbilityManager)abilityManager).GetSkillPathType(skill);
  8177.  
  8178. return ESP_NotSet;
  8179. }
  8180.  
  8181. public function GetSkillLevel(s : ESkill) : int
  8182. {
  8183. if(abilityManager && abilityManager.IsInitialized())
  8184. return ((W3PlayerAbilityManager)abilityManager).GetSkillLevel(s);
  8185.  
  8186. return -1;
  8187. }
  8188.  
  8189. public function GetSkillMaxLevel(s : ESkill) : int
  8190. {
  8191. if(abilityManager && abilityManager.IsInitialized())
  8192. return ((W3PlayerAbilityManager)abilityManager).GetSkillMaxLevel(s);
  8193.  
  8194. return -1;
  8195. }
  8196.  
  8197. public function GetBoughtSkillLevel(s : ESkill) : int
  8198. {
  8199. if(abilityManager && abilityManager.IsInitialized())
  8200. return ((W3PlayerAbilityManager)abilityManager).GetBoughtSkillLevel(s);
  8201.  
  8202. return -1;
  8203. }
  8204.  
  8205.  
  8206. public function GetAxiiLevel() : int
  8207. {
  8208. var level : int;
  8209.  
  8210. level = 1;
  8211.  
  8212. if(CanUseSkill(S_Magic_s17)) level += GetSkillLevel(S_Magic_s17);
  8213.  
  8214. return Clamp(level, 1, 4);
  8215. }
  8216.  
  8217. public function IsInFrenzy() : bool
  8218. {
  8219. return isInFrenzy;
  8220. }
  8221.  
  8222. public function HasRecentlyCountered() : bool
  8223. {
  8224. return hasRecentlyCountered;
  8225. }
  8226.  
  8227. public function SetRecentlyCountered(counter : bool)
  8228. {
  8229. hasRecentlyCountered = counter;
  8230. }
  8231.  
  8232. timer function CheckBlockedSkills(dt : float, id : int)
  8233. {
  8234. var nextCallTime : float;
  8235.  
  8236. nextCallTime = ((W3PlayerAbilityManager)abilityManager).CheckBlockedSkills(dt);
  8237. if(nextCallTime != -1)
  8238. AddTimer('CheckBlockedSkills', nextCallTime, , , , true);
  8239. }
  8240.  
  8241.  
  8242. public function RemoveTemporarySkills()
  8243. {
  8244. var i : int;
  8245. var pam : W3PlayerAbilityManager;
  8246.  
  8247. if(tempLearnedSignSkills.Size() > 0)
  8248. {
  8249. pam = (W3PlayerAbilityManager)abilityManager;
  8250. for(i=0; i<tempLearnedSignSkills.Size(); i+=1)
  8251. {
  8252. pam.RemoveTemporarySkill(tempLearnedSignSkills[i]);
  8253. }
  8254.  
  8255. tempLearnedSignSkills.Clear();
  8256. }
  8257. RemoveAbilityAll(SkillEnumToName(S_Sword_s19));
  8258. }
  8259.  
  8260. public function RemoveTemporarySkill(skill : SSimpleSkill) : bool
  8261. {
  8262. var pam : W3PlayerAbilityManager;
  8263.  
  8264. pam = (W3PlayerAbilityManager)abilityManager;
  8265. if(pam && pam.IsInitialized())
  8266. return pam.RemoveTemporarySkill(skill);
  8267.  
  8268. return false;
  8269. }
  8270.  
  8271.  
  8272. private function AddTemporarySkills()
  8273. {
  8274. if(CanUseSkill(S_Sword_s19) && GetStat(BCS_Focus) >= 3)
  8275. {
  8276. tempLearnedSignSkills = ((W3PlayerAbilityManager)abilityManager).AddTempNonAlchemySkills();
  8277. DrainFocus(GetStat(BCS_Focus));
  8278. AddAbilityMultiple(SkillEnumToName(S_Sword_s19), GetSkillLevel(S_Sword_s19));
  8279. }
  8280. }
  8281.  
  8282.  
  8283.  
  8284. public function HasAlternateQuen() : bool
  8285. {
  8286. var quenEntity : W3QuenEntity;
  8287.  
  8288. quenEntity = (W3QuenEntity)GetCurrentSignEntity();
  8289. if(quenEntity)
  8290. {
  8291. return quenEntity.IsAlternateCast();
  8292. }
  8293.  
  8294. return false;
  8295. }
  8296.  
  8297.  
  8298.  
  8299.  
  8300.  
  8301. public function AddPoints(type : ESpendablePointType, amount : int, show : bool)
  8302. {
  8303. levelManager.AddPoints(type, amount, show);
  8304. }
  8305.  
  8306. public function GetLevel() : int {return levelManager.GetLevel();}
  8307. public function GetMaxLevel() : int {return levelManager.GetMaxLevel();}
  8308. public function GetTotalExpForNextLevel() : int {return levelManager.GetTotalExpForNextLevel();}
  8309. public function GetPointsTotal(type : ESpendablePointType) : int {return levelManager.GetPointsTotal(type);}
  8310. public function IsAutoLeveling() : bool {return autoLevel;}
  8311. public function SetAutoLeveling( b : bool ) {autoLevel = b;}
  8312.  
  8313. public function GetMissingExpForNextLevel() : int
  8314. {
  8315. return Max(0, GetTotalExpForNextLevel() - GetPointsTotal(EExperiencePoint));
  8316. }
  8317.  
  8318.  
  8319.  
  8320.  
  8321. private saved var runewordInfusionType : ESignType;
  8322. default runewordInfusionType = ST_None;
  8323.  
  8324. public final function GetRunewordInfusionType() : ESignType
  8325. {
  8326. return runewordInfusionType;
  8327. }
  8328.  
  8329.  
  8330. public function QuenImpulse( isAlternate : bool, signEntity : W3QuenEntity, source : string, optional forceSkillLevel : int )
  8331. {
  8332. var level, i, j : int;
  8333. var atts, damages : array<name>;
  8334. var ents : array<CGameplayEntity>;
  8335. var action : W3DamageAction;
  8336. var dm : CDefinitionsManagerAccessor;
  8337. var skillAbilityName : name;
  8338. var dmg : float;
  8339. var min, max : SAbilityAttributeValue;
  8340. var pos : Vector;
  8341.  
  8342. if( forceSkillLevel > 0 )
  8343. {
  8344. level = forceSkillLevel;
  8345. }
  8346. else
  8347. {
  8348. level = GetSkillLevel(S_Magic_s13);
  8349. }
  8350.  
  8351. dm = theGame.GetDefinitionsManager();
  8352. skillAbilityName = GetSkillAbilityName(S_Magic_s13);
  8353.  
  8354. if(level >= 2)
  8355. {
  8356.  
  8357. dm.GetAbilityAttributes(skillAbilityName, atts);
  8358. for(i=0; i<atts.Size(); i+=1)
  8359. {
  8360. if(IsDamageTypeNameValid(atts[i]))
  8361. {
  8362. damages.PushBack(atts[i]);
  8363. }
  8364. }
  8365. }
  8366.  
  8367.  
  8368. pos = signEntity.GetWorldPosition();
  8369. FindGameplayEntitiesInSphere(ents, pos, 3, 1000, '', FLAG_OnlyAliveActors + FLAG_ExcludeTarget + FLAG_Attitude_Hostile + FLAG_Attitude_Neutral + FLAG_TestLineOfSight, this);
  8370.  
  8371.  
  8372. for(i=0; i<ents.Size(); i+=1)
  8373. {
  8374. action = new W3DamageAction in theGame;
  8375. action.Initialize(this, ents[i], signEntity, source, EHRT_Heavy, CPS_SpellPower, false, false, true, false);
  8376. action.SetSignSkill(S_Magic_s13);
  8377. action.SetCannotReturnDamage(true);
  8378. action.SetProcessBuffsIfNoDamage(true);
  8379.  
  8380.  
  8381. if(!isAlternate && level >= 2)
  8382. {
  8383. action.SetHitEffect('hit_electric_quen');
  8384. action.SetHitEffect('hit_electric_quen', true);
  8385. action.SetHitEffect('hit_electric_quen', false, true);
  8386. action.SetHitEffect('hit_electric_quen', true, true);
  8387. }
  8388.  
  8389. if(level >= 1)
  8390. {
  8391. action.AddEffectInfo(EET_Stagger);
  8392. }
  8393. if(level >= 2)
  8394. {
  8395. for(j=0; j<damages.Size(); j+=1)
  8396. {
  8397. dm.GetAbilityAttributeValue(skillAbilityName, damages[j], min, max);
  8398. dmg = CalculateAttributeValue(GetAttributeRandomizedValue(min, max));
  8399. if( IsSetBonusActive( EISB_Bear_2 ) )
  8400. {
  8401. dm.GetAbilityAttributeValue( GetSetBonusAbility( EISB_Bear_2 ), 'quen_dmg_boost', min, max );
  8402. dmg *= 1 + min.valueMultiplicative;
  8403. }
  8404. action.AddDamage(damages[j], dmg);
  8405. }
  8406. }
  8407. if(level == 3)
  8408. {
  8409. action.AddEffectInfo(EET_KnockdownTypeApplicator);
  8410. }
  8411.  
  8412. theGame.damageMgr.ProcessAction( action );
  8413. delete action;
  8414. }
  8415.  
  8416.  
  8417. if(isAlternate)
  8418. {
  8419. signEntity.PlayHitEffect('quen_impulse_explode', signEntity.GetWorldRotation());
  8420. signEntity.EraseFirstTimeStamp();
  8421.  
  8422.  
  8423. if(level >= 2)
  8424. {
  8425. if( !IsSetBonusActive( EISB_Bear_2 ) )
  8426. {
  8427. signEntity.PlayHitEffect('quen_electric_explode', signEntity.GetWorldRotation());
  8428. }
  8429. else
  8430. {
  8431. signEntity.PlayHitEffect('quen_electric_explode_bear_abl2', signEntity.GetWorldRotation());
  8432. }
  8433. }
  8434. }
  8435. else
  8436. {
  8437. signEntity.PlayEffect('lasting_shield_impulse');
  8438. }
  8439. }
  8440.  
  8441. public function OnSignCastPerformed(signType : ESignType, isAlternate : bool)
  8442. {
  8443. var items : array<SItemUniqueId>;
  8444. var weaponEnt : CEntity;
  8445. var fxName : name;
  8446. var pos : Vector;
  8447.  
  8448. super.OnSignCastPerformed(signType, isAlternate);
  8449.  
  8450. if(HasAbility('Runeword 1 _Stats', true) && GetStat(BCS_Focus) >= 1.0f)
  8451. {
  8452. DrainFocus(1.0f);
  8453. runewordInfusionType = signType;
  8454. items = inv.GetHeldWeapons();
  8455. weaponEnt = inv.GetItemEntityUnsafe(items[0]);
  8456.  
  8457.  
  8458. weaponEnt.StopEffect('runeword_aard');
  8459. weaponEnt.StopEffect('runeword_axii');
  8460. weaponEnt.StopEffect('runeword_igni');
  8461. weaponEnt.StopEffect('runeword_quen');
  8462. weaponEnt.StopEffect('runeword_yrden');
  8463.  
  8464.  
  8465. if(signType == ST_Aard)
  8466. fxName = 'runeword_aard';
  8467. else if(signType == ST_Axii)
  8468. fxName = 'runeword_axii';
  8469. else if(signType == ST_Igni)
  8470. fxName = 'runeword_igni';
  8471. else if(signType == ST_Quen)
  8472. fxName = 'runeword_quen';
  8473. else if(signType == ST_Yrden)
  8474. fxName = 'runeword_yrden';
  8475.  
  8476. weaponEnt.PlayEffect(fxName);
  8477. }
  8478.  
  8479.  
  8480. if( IsMutationActive( EPMT_Mutation6 ) && signType == ST_Aard && !isAlternate )
  8481. {
  8482. pos = GetWorldPosition() + GetWorldForward() * 2;
  8483.  
  8484. theGame.GetSurfacePostFX().AddSurfacePostFXGroup( pos, 0.f, 3.f, 2.f, 5.f, 0 );
  8485. }
  8486. }
  8487.  
  8488. public saved var savedQuenHealth, savedQuenDuration : float;
  8489.  
  8490. timer function HACK_QuenSaveStatus(dt : float, id : int)
  8491. {
  8492. var quenEntity : W3QuenEntity;
  8493.  
  8494. quenEntity = (W3QuenEntity)signs[ST_Quen].entity;
  8495. savedQuenHealth = quenEntity.GetShieldHealth();
  8496. savedQuenDuration = quenEntity.GetShieldRemainingDuration();
  8497. }
  8498.  
  8499. timer function DelayedRestoreQuen(dt : float, id : int)
  8500. {
  8501. RestoreQuen(savedQuenHealth, savedQuenDuration);
  8502. }
  8503.  
  8504. public final function OnBasicQuenFinishing()
  8505. {
  8506. RemoveTimer('HACK_QuenSaveStatus');
  8507. savedQuenHealth = 0.f;
  8508. savedQuenDuration = 0.f;
  8509. }
  8510.  
  8511. public final function IsAnyQuenActive() : bool
  8512. {
  8513. var quen : W3QuenEntity;
  8514.  
  8515. quen = (W3QuenEntity)GetSignEntity(ST_Quen);
  8516. if(quen)
  8517. return quen.IsAnyQuenActive();
  8518.  
  8519. return false;
  8520. }
  8521.  
  8522. public final function IsQuenActive(alternateMode : bool) : bool
  8523. {
  8524. if(IsAnyQuenActive() && GetSignEntity(ST_Quen).IsAlternateCast() == alternateMode)
  8525. return true;
  8526.  
  8527. return false;
  8528. }
  8529.  
  8530. public function FinishQuen( skipVisuals : bool, optional forceNoBearSetBonus : bool )
  8531. {
  8532. var quen : W3QuenEntity;
  8533.  
  8534. quen = (W3QuenEntity)GetSignEntity(ST_Quen);
  8535. if(quen)
  8536. quen.ForceFinishQuen( skipVisuals, forceNoBearSetBonus );
  8537. }
  8538.  
  8539.  
  8540. public function GetTotalSignSpellPower(signSkill : ESkill) : SAbilityAttributeValue
  8541. {
  8542. var sp : SAbilityAttributeValue;
  8543. var penalty : SAbilityAttributeValue;
  8544. var penaltyReduction : float;
  8545. var penaltyReductionLevel : int;
  8546.  
  8547.  
  8548. sp = GetSkillAttributeValue(signSkill, PowerStatEnumToName(CPS_SpellPower), true, true);
  8549.  
  8550.  
  8551. if ( signSkill == S_Magic_s01 )
  8552. {
  8553.  
  8554. penaltyReductionLevel = GetSkillLevel(S_Magic_s01) + 1;
  8555. if(penaltyReductionLevel > 0)
  8556. {
  8557. penaltyReduction = 1 - penaltyReductionLevel * CalculateAttributeValue(GetSkillAttributeValue(S_Magic_s01, 'spell_power_penalty_reduction', true, true));
  8558. penalty = GetSkillAttributeValue(S_Magic_s01, PowerStatEnumToName(CPS_SpellPower), false, false);
  8559. sp += penalty * penaltyReduction;
  8560. }
  8561. }
  8562.  
  8563.  
  8564. if(signSkill == S_Magic_1 || signSkill == S_Magic_s01)
  8565. {
  8566. sp += GetAttributeValue('spell_power_aard');
  8567. }
  8568. else if(signSkill == S_Magic_2 || signSkill == S_Magic_s02)
  8569. {
  8570. sp += GetAttributeValue('spell_power_igni');
  8571. }
  8572. else if(signSkill == S_Magic_3 || signSkill == S_Magic_s03)
  8573. {
  8574. sp += GetAttributeValue('spell_power_yrden');
  8575. }
  8576. else if(signSkill == S_Magic_4 || signSkill == S_Magic_s04)
  8577. {
  8578. sp += GetAttributeValue('spell_power_quen');
  8579. }
  8580. else if(signSkill == S_Magic_5 || signSkill == S_Magic_s05)
  8581. {
  8582. sp += GetAttributeValue('spell_power_axii');
  8583. }
  8584.  
  8585.  
  8586. ApplyMutation10StatBoost( sp );
  8587.  
  8588. return sp;
  8589. }
  8590.  
  8591.  
  8592.  
  8593.  
  8594.  
  8595. public final function GetGwentCardIndex( cardName : name ) : int
  8596. {
  8597. var dm : CDefinitionsManagerAccessor;
  8598.  
  8599. dm = theGame.GetDefinitionsManager();
  8600.  
  8601. if(dm.ItemHasTag( cardName , 'GwintCardLeader' ))
  8602. {
  8603. return theGame.GetGwintManager().GwentLeadersNametoInt( cardName );
  8604. }
  8605. else if(dm.ItemHasTag( cardName , 'GwintCardNrkd' ))
  8606. {
  8607. return theGame.GetGwintManager().GwentNrkdNameToInt( cardName );
  8608. }
  8609. else if(dm.ItemHasTag( cardName , 'GwintCardNlfg' ))
  8610. {
  8611. return theGame.GetGwintManager().GwentNlfgNameToInt( cardName );
  8612. }
  8613. else if(dm.ItemHasTag( cardName , 'GwintCardSctl' ))
  8614. {
  8615. return theGame.GetGwintManager().GwentSctlNameToInt( cardName );
  8616. }
  8617. else if(dm.ItemHasTag( cardName , 'GwintCardMstr' ))
  8618. {
  8619. return theGame.GetGwintManager().GwentMstrNameToInt( cardName );
  8620. }
  8621. else if(dm.ItemHasTag( cardName , 'GwintCardSke' ))
  8622. {
  8623. return theGame.GetGwintManager().GwentSkeNameToInt( cardName );
  8624. }
  8625. else if(dm.ItemHasTag( cardName , 'GwintCardNeutral' ))
  8626. {
  8627. return theGame.GetGwintManager().GwentNeutralNameToInt( cardName );
  8628. }
  8629. else if(dm.ItemHasTag( cardName , 'GwintCardSpcl' ))
  8630. {
  8631. return theGame.GetGwintManager().GwentSpecialNameToInt( cardName );
  8632. }
  8633.  
  8634. return -1;
  8635. }
  8636.  
  8637. public final function AddGwentCard(cardName : name, amount : int) : bool
  8638. {
  8639. var dm : CDefinitionsManagerAccessor;
  8640. var cardIndex, i : int;
  8641. var tut : STutorialMessage;
  8642. var gwintManager : CR4GwintManager;
  8643.  
  8644.  
  8645.  
  8646. if(FactsQuerySum("q001_nightmare_ended") > 0 && ShouldProcessTutorial('TutorialGwentDeckBuilder2'))
  8647. {
  8648. tut.type = ETMT_Hint;
  8649. tut.tutorialScriptTag = 'TutorialGwentDeckBuilder2';
  8650. tut.journalEntryName = 'TutorialGwentDeckBuilder2';
  8651. tut.hintPositionType = ETHPT_DefaultGlobal;
  8652. tut.markAsSeenOnShow = true;
  8653. tut.hintDurationType = ETHDT_Long;
  8654.  
  8655. theGame.GetTutorialSystem().DisplayTutorial(tut);
  8656. }
  8657.  
  8658. dm = theGame.GetDefinitionsManager();
  8659.  
  8660. cardIndex = GetGwentCardIndex(cardName);
  8661.  
  8662. if (cardIndex != -1)
  8663. {
  8664. FactsAdd("Gwint_Card_Looted");
  8665.  
  8666. for(i = 0; i < amount; i += 1)
  8667. {
  8668. theGame.GetGwintManager().AddCardToCollection( cardIndex );
  8669. }
  8670. }
  8671.  
  8672. if( dm.ItemHasTag( cardName, 'GwentTournament' ) )
  8673. {
  8674. if ( dm.ItemHasTag( cardName, 'GT1' ) )
  8675. {
  8676. FactsAdd( "GwentTournament", 1 );
  8677. }
  8678.  
  8679. else if ( dm.ItemHasTag( cardName, 'GT2' ) )
  8680. {
  8681. FactsAdd( "GwentTournament", 2 );
  8682. }
  8683.  
  8684. else if ( dm.ItemHasTag( cardName, 'GT3' ) )
  8685. {
  8686. FactsAdd( "GwentTournament", 3 );
  8687. }
  8688.  
  8689. else if ( dm.ItemHasTag( cardName, 'GT4' ) )
  8690. {
  8691. FactsAdd( "GwentTournament", 4 );
  8692. }
  8693.  
  8694. else if ( dm.ItemHasTag( cardName, 'GT5' ) )
  8695. {
  8696. FactsAdd( "GwentTournament", 5 );
  8697. }
  8698.  
  8699. else if ( dm.ItemHasTag( cardName, 'GT6' ) )
  8700. {
  8701. FactsAdd( "GwentTournament", 6 );
  8702. }
  8703.  
  8704. else if ( dm.ItemHasTag( cardName, 'GT7' ) )
  8705. {
  8706. FactsAdd( "GwentTournament", 7 );
  8707. }
  8708.  
  8709. CheckGwentTournamentDeck();
  8710. }
  8711.  
  8712. if( dm.ItemHasTag( cardName, 'EP2Tournament' ) )
  8713. {
  8714. if ( dm.ItemHasTag( cardName, 'GT1' ) )
  8715. {
  8716. FactsAdd( "EP2Tournament", 1 );
  8717. }
  8718.  
  8719. else if ( dm.ItemHasTag( cardName, 'GT2' ) )
  8720. {
  8721. FactsAdd( "EP2Tournament", 2 );
  8722. }
  8723.  
  8724. else if ( dm.ItemHasTag( cardName, 'GT3' ) )
  8725. {
  8726. FactsAdd( "EP2Tournament", 3 );
  8727. }
  8728.  
  8729. else if ( dm.ItemHasTag( cardName, 'GT4' ) )
  8730. {
  8731. FactsAdd( "EP2Tournament", 4 );
  8732. }
  8733.  
  8734. else if ( dm.ItemHasTag( cardName, 'GT5' ) )
  8735. {
  8736. FactsAdd( "EP2Tournament", 5 );
  8737. }
  8738.  
  8739. else if ( dm.ItemHasTag( cardName, 'GT6' ) )
  8740. {
  8741. FactsAdd( "EP2Tournament", 6 );
  8742. }
  8743.  
  8744. else if ( dm.ItemHasTag( cardName, 'GT7' ) )
  8745. {
  8746. FactsAdd( "EP2Tournament", 7 );
  8747. }
  8748.  
  8749. CheckEP2TournamentDeck();
  8750. }
  8751.  
  8752. gwintManager = theGame.GetGwintManager();
  8753. if( !gwintManager.IsDeckUnlocked( GwintFaction_Skellige ) &&
  8754. gwintManager.HasCardsOfFactionInCollection( GwintFaction_Skellige, false ) )
  8755. {
  8756. gwintManager.UnlockDeck( GwintFaction_Skellige );
  8757. }
  8758.  
  8759. return true;
  8760. }
  8761.  
  8762.  
  8763. public final function RemoveGwentCard(cardName : name, amount : int) : bool
  8764. {
  8765. var dm : CDefinitionsManagerAccessor;
  8766. var cardIndex, i : int;
  8767.  
  8768. dm = theGame.GetDefinitionsManager();
  8769.  
  8770. if(dm.ItemHasTag( cardName , 'GwintCardLeader' ))
  8771. {
  8772. cardIndex = theGame.GetGwintManager().GwentLeadersNametoInt( cardName );
  8773. for(i=0; i<amount; i+=1)
  8774. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8775. }
  8776. else if(dm.ItemHasTag( cardName , 'GwintCardNrkd' ))
  8777. {
  8778. cardIndex = theGame.GetGwintManager().GwentNrkdNameToInt( cardName );
  8779. for(i=0; i<amount; i+=1)
  8780. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8781. }
  8782. else if(dm.ItemHasTag( cardName , 'GwintCardNlfg' ))
  8783. {
  8784. cardIndex = theGame.GetGwintManager().GwentNlfgNameToInt( cardName );
  8785. for(i=0; i<amount; i+=1)
  8786. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8787. }
  8788. else if(dm.ItemHasTag( cardName , 'GwintCardSctl' ))
  8789. {
  8790. cardIndex = theGame.GetGwintManager().GwentSctlNameToInt( cardName );
  8791. for(i=0; i<amount; i+=1)
  8792. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8793. }
  8794. else if(dm.ItemHasTag( cardName , 'GwintCardMstr' ))
  8795. {
  8796. cardIndex = theGame.GetGwintManager().GwentMstrNameToInt( cardName );
  8797. for(i=0; i<amount; i+=1)
  8798. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8799. }
  8800. else if(dm.ItemHasTag( cardName , 'GwintCardNeutral' ))
  8801. {
  8802. cardIndex = theGame.GetGwintManager().GwentNeutralNameToInt( cardName );
  8803. for(i=0; i<amount; i+=1)
  8804. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8805. }
  8806. else if(dm.ItemHasTag( cardName , 'GwintCardSpcl' ))
  8807. {
  8808. cardIndex = theGame.GetGwintManager().GwentSpecialNameToInt( cardName );
  8809. for(i=0; i<amount; i+=1)
  8810. theGame.GetGwintManager().RemoveCardFromCollection( cardIndex );
  8811. }
  8812.  
  8813. if( dm.ItemHasTag( cardName, 'GwentTournament' ) )
  8814. {
  8815. if ( dm.ItemHasTag( cardName, 'GT1' ) )
  8816. {
  8817. FactsSubstract( "GwentTournament", 1 );
  8818. }
  8819.  
  8820. else if ( dm.ItemHasTag( cardName, 'GT2' ) )
  8821. {
  8822. FactsSubstract( "GwentTournament", 2 );
  8823. }
  8824.  
  8825. else if ( dm.ItemHasTag( cardName, 'GT3' ) )
  8826. {
  8827. FactsSubstract( "GwentTournament", 3 );
  8828. }
  8829.  
  8830. else if ( dm.ItemHasTag( cardName, 'GT4' ) )
  8831. {
  8832. FactsSubstract( "GwentTournament", 4 );
  8833. }
  8834.  
  8835. else if ( dm.ItemHasTag( cardName, 'GT5' ) )
  8836. {
  8837. FactsSubstract( "GwentTournament", 5 );
  8838. }
  8839.  
  8840. else if ( dm.ItemHasTag( cardName, 'GT6' ) )
  8841. {
  8842. FactsSubstract( "GwentTournament", 6 );
  8843. }
  8844.  
  8845. else if ( dm.ItemHasTag( cardName, 'GT7' ) )
  8846. {
  8847. FactsSubstract( "GwentTournament", 7 );
  8848. }
  8849.  
  8850. CheckGwentTournamentDeck();
  8851. }
  8852.  
  8853.  
  8854. if( dm.ItemHasTag( cardName, 'EP2Tournament' ) )
  8855. {
  8856. if ( dm.ItemHasTag( cardName, 'GT1' ) )
  8857. {
  8858. FactsSubstract( "EP2Tournament", 1 );
  8859. }
  8860.  
  8861. else if ( dm.ItemHasTag( cardName, 'GT2' ) )
  8862. {
  8863. FactsSubstract( "EP2Tournament", 2 );
  8864. }
  8865.  
  8866. else if ( dm.ItemHasTag( cardName, 'GT3' ) )
  8867. {
  8868. FactsSubstract( "EP2Tournament", 3 );
  8869. }
  8870.  
  8871. else if ( dm.ItemHasTag( cardName, 'GT4' ) )
  8872. {
  8873. FactsSubstract( "EP2Tournament", 4 );
  8874. }
  8875.  
  8876. else if ( dm.ItemHasTag( cardName, 'GT5' ) )
  8877. {
  8878. FactsSubstract( "EP2Tournament", 5 );
  8879. }
  8880.  
  8881. else if ( dm.ItemHasTag( cardName, 'GT6' ) )
  8882. {
  8883. FactsSubstract( "EP2Tournament", 6 );
  8884. }
  8885.  
  8886. else if ( dm.ItemHasTag( cardName, 'GT7' ) )
  8887. {
  8888. FactsSubstract( "EP2Tournament", 7 );
  8889. }
  8890.  
  8891. CheckEP2TournamentDeck();
  8892. }
  8893.  
  8894. return true;
  8895. }
  8896.  
  8897. function CheckGwentTournamentDeck()
  8898. {
  8899. var gwentPower : int;
  8900. var neededGwentPower : int;
  8901. var checkBreakpoint : int;
  8902.  
  8903. neededGwentPower = 70;
  8904.  
  8905. checkBreakpoint = neededGwentPower/5;
  8906. gwentPower = FactsQuerySum( "GwentTournament" );
  8907.  
  8908. if ( gwentPower >= neededGwentPower )
  8909. {
  8910. FactsAdd( "HasGwentTournamentDeck", 1 );
  8911. }
  8912. else
  8913. {
  8914. if( FactsDoesExist( "HasGwentTournamentDeck" ) )
  8915. {
  8916. FactsRemove( "HasGwentTournamentDeck" );
  8917. }
  8918.  
  8919. if ( gwentPower >= checkBreakpoint )
  8920. {
  8921. FactsAdd( "GwentTournamentObjective1", 1 );
  8922. }
  8923. else if ( FactsDoesExist( "GwentTournamentObjective1" ) )
  8924. {
  8925. FactsRemove( "GwentTournamentObjective1" );
  8926. }
  8927.  
  8928. if ( gwentPower >= checkBreakpoint*2 )
  8929. {
  8930. FactsAdd( "GwentTournamentObjective2", 1 );
  8931. }
  8932. else if ( FactsDoesExist( "GwentTournamentObjective2" ) )
  8933. {
  8934. FactsRemove( "GwentTournamentObjective2" );
  8935. }
  8936.  
  8937. if ( gwentPower >= checkBreakpoint*3 )
  8938. {
  8939. FactsAdd( "GwentTournamentObjective3", 1 );
  8940. }
  8941. else if ( FactsDoesExist( "GwentTournamentObjective3" ) )
  8942. {
  8943. FactsRemove( "GwentTournamentObjective3" );
  8944. }
  8945.  
  8946. if ( gwentPower >= checkBreakpoint*4 )
  8947. {
  8948. FactsAdd( "GwentTournamentObjective4", 1 );
  8949. }
  8950. else if ( FactsDoesExist( "GwentTournamentObjective4" ) )
  8951. {
  8952. FactsRemove( "GwentTournamentObjective4" );
  8953. }
  8954. }
  8955. }
  8956.  
  8957. function CheckEP2TournamentDeck()
  8958. {
  8959. var gwentPower : int;
  8960. var neededGwentPower : int;
  8961. var checkBreakpoint : int;
  8962.  
  8963. neededGwentPower = 24;
  8964.  
  8965. checkBreakpoint = neededGwentPower/5;
  8966. gwentPower = FactsQuerySum( "EP2Tournament" );
  8967.  
  8968. if ( gwentPower >= neededGwentPower )
  8969. {
  8970. if( FactsQuerySum( "HasEP2TournamentDeck") == 0 )
  8971. {
  8972. FactsAdd( "HasEP2TournamentDeck", 1 );
  8973. }
  8974.  
  8975. }
  8976. else
  8977. {
  8978. if( FactsDoesExist( "HasEP2TournamentDeck" ) )
  8979. {
  8980. FactsRemove( "HasEP2TournamentDeck" );
  8981. }
  8982.  
  8983. if ( gwentPower >= checkBreakpoint )
  8984. {
  8985. FactsAdd( "EP2TournamentObjective1", 1 );
  8986. }
  8987. else if ( FactsDoesExist( "EP2TournamentObjective1" ) )
  8988. {
  8989. FactsRemove( "EP2TournamentObjective1" );
  8990. }
  8991.  
  8992. if ( gwentPower >= checkBreakpoint*2 )
  8993. {
  8994. FactsAdd( "EP2TournamentObjective2", 1 );
  8995. }
  8996. else if ( FactsDoesExist( "EP2TournamentObjective2" ) )
  8997. {
  8998. FactsRemove( "EP2TournamentObjective2" );
  8999. }
  9000.  
  9001. if ( gwentPower >= checkBreakpoint*3 )
  9002. {
  9003. FactsAdd( "EP2TournamentObjective3", 1 );
  9004. }
  9005. else if ( FactsDoesExist( "EP2TournamentObjective3" ) )
  9006. {
  9007. FactsRemove( "EP2TournamentObjective3" );
  9008. }
  9009.  
  9010. if ( gwentPower >= checkBreakpoint*4 )
  9011. {
  9012. FactsAdd( "EP2TournamentObjective4", 1 );
  9013. }
  9014. else if ( FactsDoesExist( "EP2TournamentObjective4" ) )
  9015. {
  9016. FactsRemove( "EP2TournamentObjective4" );
  9017. }
  9018. }
  9019. }
  9020.  
  9021.  
  9022.  
  9023.  
  9024.  
  9025.  
  9026. public function SimulateBuffTimePassing(simulatedTime : float)
  9027. {
  9028. super.SimulateBuffTimePassing(simulatedTime);
  9029.  
  9030. FinishQuen(true);
  9031. }
  9032.  
  9033.  
  9034. public function CanMeditate() : bool
  9035. {
  9036. var currentStateName : name;
  9037.  
  9038. currentStateName = GetCurrentStateName();
  9039.  
  9040.  
  9041. if(currentStateName == 'Exploration' && !CanPerformPlayerAction())
  9042. return false;
  9043.  
  9044.  
  9045. if(GetCurrentStateName() != 'Exploration' && GetCurrentStateName() != 'Meditation' && GetCurrentStateName() != 'MeditationWaiting')
  9046. return false;
  9047.  
  9048.  
  9049. if(GetUsedVehicle())
  9050. return false;
  9051.  
  9052.  
  9053. return CanMeditateHere();
  9054. }
  9055.  
  9056.  
  9057. public final function CanMeditateWait(optional skipMeditationStateCheck : bool) : bool
  9058. {
  9059. var currState : name;
  9060.  
  9061. currState = GetCurrentStateName();
  9062.  
  9063.  
  9064.  
  9065. if(!skipMeditationStateCheck && currState != 'Meditation')
  9066. return false;
  9067.  
  9068.  
  9069. if(theGame.IsGameTimePaused())
  9070. return false;
  9071.  
  9072. if(!IsActionAllowed( EIAB_MeditationWaiting ))
  9073. return false;
  9074.  
  9075. //---=== modFriendlyMeditation ===---
  9076. return CanMeditateHere();
  9077. //---=== modFriendlyMeditation ===---
  9078. }
  9079.  
  9080.  
  9081. public final function CanMeditateHere() : bool
  9082. {
  9083. var pos : Vector;
  9084.  
  9085. pos = GetWorldPosition();
  9086. if(pos.Z <= theGame.GetWorld().GetWaterLevel(pos, true) && IsInShallowWater())
  9087. return false;
  9088.  
  9089. if(IsThreatened())
  9090. return false;
  9091.  
  9092. return true;
  9093. }
  9094.  
  9095.  
  9096. public function Meditate() : bool
  9097. {
  9098. var medState : W3PlayerWitcherStateMeditation;
  9099. var stateName : name;
  9100.  
  9101. stateName = GetCurrentStateName();
  9102.  
  9103.  
  9104. if (!CanMeditate() || stateName == 'MeditationWaiting' )
  9105. return false;
  9106.  
  9107. GotoState('Meditation');
  9108. medState = (W3PlayerWitcherStateMeditation)GetState('Meditation');
  9109. medState.SetMeditationPointHeading(GetHeading());
  9110.  
  9111. return true;
  9112. }
  9113.  
  9114. //---=== modFriendlyMeditation ===---
  9115. //heals the player and restores alchemy items, used by regular meditation menu
  9116. public final function MeditationRestoring(simulatedTime : float)
  9117. {
  9118. abilityManager.DrainToxicity( abilityManager.GetStat( BCS_Toxicity ) ); // this sets toxicity to zero
  9119. abilityManager.DrainFocus( abilityManager.GetStat( BCS_Focus ) ); // this sets adrenaline to zero
  9120. SimulateBuffTimePassing( simulatedTime ); // simulatedTime is not actually used, all effects are just nullified
  9121. MeditationRegenFullHealth(); // this restores full health
  9122. MeditationRefill( fMeditationConfig.RefillIntervalSeconds() ); // this refills all potions
  9123. ApplyWitcherHouseBuffs(); // this applies witcher house buffs
  9124. if ( fMeditationConfig.ResetRefillSettingToDefaultAfterMeditation() )
  9125. {
  9126. fMeditationConfig.ResetRefillPotionsWhileMeditating();
  9127. }
  9128. }
  9129.  
  9130. public function MeditationRefill( gameTimeSecs : float ) : bool
  9131. {
  9132. if ( gameTimeSecs >= fMeditationConfig.RefillIntervalSeconds() && fMeditationConfig.RefillPotionsWhileMeditating() )
  9133. {
  9134. inv.SingletonItemsRefillAmmo();
  9135. return true;
  9136. }
  9137. return false;
  9138. }
  9139.  
  9140. public function UpdateEffectsAccelerated( realTimeSecs, acceleration : float )
  9141. {
  9142. effectManager.PerformUpdate( realTimeSecs * acceleration );
  9143. }
  9144.  
  9145. public function MeditationRegenFullHealth()
  9146. {
  9147. if ( theGame.GetDifficultyMode() != EDM_Hard && theGame.GetDifficultyMode() != EDM_Hardcore || fMeditationConfig.FullHealthRegenAnyDifficulty() )
  9148. {
  9149. Heal(GetStatMax(BCS_Vitality));
  9150. }
  9151. }
  9152.  
  9153. public function StartExplorationMeditation()
  9154. {
  9155. if ( GetCurrentStateName() != 'ExplorationMeditation' )
  9156. {
  9157. if ( CanMeditateWait( true ) )
  9158. {
  9159. PushState( 'ExplorationMeditation' );
  9160. }
  9161. else
  9162. {
  9163. DisplayHudMessage( GetLocStringByKeyExt( "menu_cannot_perform_action_here" ) );
  9164. }
  9165. }
  9166.  
  9167. }
  9168.  
  9169. public function EndExplorationMeditation()
  9170. {
  9171. if ( GetCurrentStateName() == 'ExplorationMeditation' )
  9172. {
  9173. PopState();
  9174. }
  9175. }
  9176.  
  9177. timer function DeSpawnCampFireTimer(dt : float, id : int)
  9178. {
  9179. spawnedCampFire.ToggleFire( false );
  9180. spawnedCampFire.Destroy();
  9181. spawnedCampFire = NULL;
  9182. }
  9183.  
  9184. public function IsMeditating() : bool
  9185. {
  9186. return ( GetCurrentStateName() == 'ExplorationMeditation' );
  9187. }
  9188. //---=== modFriendlyMeditation ===---
  9189.  
  9190. var clockMenu : CR4MeditationClockMenu;
  9191.  
  9192. public function MeditationClockStart(m : CR4MeditationClockMenu)
  9193. {
  9194. clockMenu = m;
  9195. AddTimer('UpdateClockTime',0.1,true);
  9196. }
  9197.  
  9198. public function MeditationClockStop()
  9199. {
  9200. clockMenu = NULL;
  9201. RemoveTimer('UpdateClockTime');
  9202. }
  9203.  
  9204. public timer function UpdateClockTime(dt : float, id : int)
  9205. {
  9206. if(clockMenu)
  9207. clockMenu.UpdateCurrentHours();
  9208. else
  9209. RemoveTimer('UpdateClockTime');
  9210. }
  9211.  
  9212. private var waitTimeHour : int;
  9213. public function SetWaitTargetHour(t : int)
  9214. {
  9215. waitTimeHour = t;
  9216. }
  9217. public function GetWaitTargetHour() : int
  9218. {
  9219. return waitTimeHour;
  9220. }
  9221.  
  9222. public function MeditationForceAbort(forceCloseUI : bool)
  9223. {
  9224. var waitt : W3PlayerWitcherStateMeditationWaiting;
  9225. var medd : W3PlayerWitcherStateMeditation;
  9226. var currentStateName : name;
  9227.  
  9228. currentStateName = GetCurrentStateName();
  9229.  
  9230. if(currentStateName == 'MeditationWaiting')
  9231. {
  9232. waitt = (W3PlayerWitcherStateMeditationWaiting)GetCurrentState();
  9233. if(waitt)
  9234. {
  9235. waitt.StopRequested(forceCloseUI);
  9236. }
  9237. }
  9238. else if(currentStateName == 'Meditation')
  9239. {
  9240. medd = (W3PlayerWitcherStateMeditation)GetCurrentState();
  9241. if(medd)
  9242. {
  9243. medd.StopRequested(forceCloseUI);
  9244. }
  9245. }
  9246.  
  9247.  
  9248.  
  9249. if(forceCloseUI && theGame.GetGuiManager().IsAnyMenu())
  9250. {
  9251. theGame.GetGuiManager().GetRootMenu().CloseMenu();
  9252. DisplayActionDisallowedHudMessage(EIAB_MeditationWaiting, false, false, true, false);
  9253. }
  9254.  
  9255. //---=== modFriendlyMeditation ===---
  9256. EndExplorationMeditation();
  9257. //---=== modFriendlyMeditation ===---
  9258. }
  9259.  
  9260. public function Runeword10Triggerred()
  9261. {
  9262. var min, max : SAbilityAttributeValue;
  9263.  
  9264. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Runeword 10 _Stats', 'stamina', min, max );
  9265. GainStat(BCS_Stamina, min.valueMultiplicative * GetStatMax(BCS_Stamina));
  9266. PlayEffect('runeword_10_stamina');
  9267. }
  9268.  
  9269. public function Runeword12Triggerred()
  9270. {
  9271. var min, max : SAbilityAttributeValue;
  9272.  
  9273. theGame.GetDefinitionsManager().GetAbilityAttributeValue( 'Runeword 12 _Stats', 'focus', min, max );
  9274. GainStat(BCS_Focus, RandRangeF(max.valueAdditive, min.valueAdditive));
  9275. PlayEffect('runeword_20_adrenaline');
  9276. }
  9277.  
  9278. var runeword10TriggerredOnFinisher, runeword12TriggerredOnFinisher : bool;
  9279.  
  9280. event OnFinisherStart()
  9281. {
  9282. super.OnFinisherStart();
  9283.  
  9284. runeword10TriggerredOnFinisher = false;
  9285. runeword12TriggerredOnFinisher = false;
  9286. }
  9287.  
  9288. public function ApplyWitcherHouseBuffs()
  9289. {
  9290. var l_bed : W3WitcherBed;
  9291.  
  9292. if( FactsQuerySum( "PlayerInsideInnerWitcherHouse" ) > 0 )
  9293. {
  9294. l_bed = (W3WitcherBed)theGame.GetEntityByTag( 'witcherBed' );
  9295.  
  9296. if( l_bed.GetWasUsed() )
  9297. {
  9298. if( l_bed.GetBedLevel() != 0 )
  9299. {
  9300. AddEffectDefault( EET_WellRested, this, "Bed Buff" );
  9301. }
  9302.  
  9303. if( FactsQuerySum( "StablesExists" ) )
  9304. {
  9305. AddEffectDefault( EET_HorseStableBuff, this, "Stables" );
  9306. }
  9307.  
  9308. if( l_bed.GetWereItemsRefilled() )
  9309. {
  9310. theGame.GetGuiManager().ShowNotification( GetLocStringByKeyExt( "message_common_alchemy_table_buff_applied" ),, true );
  9311. l_bed.SetWereItemsRefilled( false );
  9312. }
  9313.  
  9314. AddEffectDefault( EET_BookshelfBuff, this, "Bookshelf" );
  9315.  
  9316. Heal( GetStatMax( BCS_Vitality ) );
  9317. }
  9318. }
  9319. }
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325. public function CheatResurrect()
  9326. {
  9327. super.CheatResurrect();
  9328. theGame.ReleaseNoSaveLock(theGame.deathSaveLockId);
  9329. theInput.RestoreContext( 'Exploration', true );
  9330. }
  9331.  
  9332.  
  9333. public function Debug_EquipTestingSkills(equip : bool, force : bool)
  9334. {
  9335. var skills : array<ESkill>;
  9336. var i, slot : int;
  9337.  
  9338.  
  9339. ((W3PlayerAbilityManager)abilityManager).OnLevelGained(36);
  9340.  
  9341. skills.PushBack(S_Magic_s01);
  9342. skills.PushBack(S_Magic_s02);
  9343. skills.PushBack(S_Magic_s03);
  9344. skills.PushBack(S_Magic_s04);
  9345. skills.PushBack(S_Magic_s05);
  9346. skills.PushBack(S_Sword_s01);
  9347. skills.PushBack(S_Sword_s02);
  9348.  
  9349.  
  9350. if(equip)
  9351. {
  9352. for(i=0; i<skills.Size(); i+=1)
  9353. {
  9354. if(!force && IsSkillEquipped(skills[i]))
  9355. continue;
  9356.  
  9357.  
  9358. if(GetSkillLevel(skills[i]) == 0)
  9359. AddSkill(skills[i]);
  9360.  
  9361.  
  9362. if(force)
  9363. slot = i+1;
  9364. else
  9365. slot = GetFreeSkillSlot();
  9366.  
  9367.  
  9368. EquipSkill(skills[i], slot);
  9369. }
  9370. }
  9371. else
  9372. {
  9373. for(i=0; i<skills.Size(); i+=1)
  9374. {
  9375. UnequipSkill(GetSkillSlotID(skills[i]));
  9376. }
  9377. }
  9378. }
  9379.  
  9380. public function Debug_ClearCharacterDevelopment(optional keepInv : bool)
  9381. {
  9382. var template : CEntityTemplate;
  9383. var entity : CEntity;
  9384. var invTesting : CInventoryComponent;
  9385. var i : int;
  9386. var items : array<SItemUniqueId>;
  9387. var abs : array<name>;
  9388.  
  9389. delete abilityManager;
  9390. delete levelManager;
  9391. delete effectManager;
  9392.  
  9393.  
  9394. GetCharacterStats().GetAbilities(abs, false);
  9395. for(i=0; i<abs.Size(); i+=1)
  9396. RemoveAbility(abs[i]);
  9397.  
  9398.  
  9399. abs.Clear();
  9400. GetCharacterStatsParam(abs);
  9401. for(i=0; i<abs.Size(); i+=1)
  9402. AddAbility(abs[i]);
  9403.  
  9404.  
  9405. levelManager = new W3LevelManager in this;
  9406. levelManager.Initialize();
  9407. levelManager.PostInit(this, false, true);
  9408.  
  9409.  
  9410. AddAbility('GeraltSkills_Testing');
  9411. SetAbilityManager();
  9412. abilityManager.Init(this, GetCharacterStats(), false, theGame.GetDifficultyMode());
  9413.  
  9414. SetEffectManager();
  9415.  
  9416. abilityManager.PostInit();
  9417.  
  9418.  
  9419.  
  9420.  
  9421.  
  9422. if(!keepInv)
  9423. {
  9424. inv.RemoveAllItems();
  9425. }
  9426.  
  9427.  
  9428. template = (CEntityTemplate)LoadResource("geralt_inventory_release");
  9429. entity = theGame.CreateEntity(template, Vector(0,0,0));
  9430. invTesting = (CInventoryComponent)entity.GetComponentByClassName('CInventoryComponent');
  9431. invTesting.GiveAllItemsTo(inv, true);
  9432. entity.Destroy();
  9433.  
  9434.  
  9435. inv.GetAllItems(items);
  9436. for(i=0; i<items.Size(); i+=1)
  9437. {
  9438. if(!inv.ItemHasTag(items[i], 'NoDrop'))
  9439. EquipItem(items[i]);
  9440. }
  9441.  
  9442.  
  9443. Debug_GiveTestingItems(0);
  9444. }
  9445.  
  9446. function Debug_BearSetBonusQuenSkills()
  9447. {
  9448. var skills : array<ESkill>;
  9449. var i, slot : int;
  9450.  
  9451. skills.PushBack(S_Magic_s04);
  9452. skills.PushBack(S_Magic_s14);
  9453.  
  9454. for(i=0; i<skills.Size(); i+=1)
  9455. {
  9456.  
  9457. if(GetSkillLevel(skills[i]) == 0)
  9458. {
  9459. AddSkill(skills[i]);
  9460. }
  9461.  
  9462. slot = GetFreeSkillSlot();
  9463.  
  9464.  
  9465. EquipSkill(skills[i], slot);
  9466. }
  9467. }
  9468.  
  9469. final function Debug_HAX_UnlockSkillSlot(slotIndex : int) : bool
  9470. {
  9471. if(abilityManager && abilityManager.IsInitialized())
  9472. return ((W3PlayerAbilityManager)abilityManager).Debug_HAX_UnlockSkillSlot(slotIndex);
  9473.  
  9474. return false;
  9475. }
  9476.  
  9477.  
  9478. public function GetLevelupAbility( id : int) : name
  9479. {
  9480. switch(id)
  9481. {
  9482. case 1: return 'Lvl1';
  9483. case 2: return 'Lvl2';
  9484. case 3: return 'Lvl3';
  9485. case 4: return 'Lvl4';
  9486. case 5: return 'Lvl5';
  9487. case 6: return 'Lvl6';
  9488. case 7: return 'Lvl7';
  9489. case 8: return 'Lvl8';
  9490. case 9: return 'Lvl9';
  9491. case 10: return 'Lvl10';
  9492. case 11: return 'Lvl11';
  9493. case 12: return 'Lvl12';
  9494. case 13: return 'Lvl13';
  9495. case 14: return 'Lvl14';
  9496. case 15: return 'Lvl15';
  9497. case 16: return 'Lvl16';
  9498. case 17: return 'Lvl17';
  9499. case 18: return 'Lvl18';
  9500. case 19: return 'Lvl19';
  9501. case 20: return 'Lvl20';
  9502. case 21: return 'Lvl21';
  9503. case 22: return 'Lvl22';
  9504. case 23: return 'Lvl23';
  9505. case 24: return 'Lvl24';
  9506. case 25: return 'Lvl25';
  9507. case 26: return 'Lvl26';
  9508. case 27: return 'Lvl27';
  9509. case 28: return 'Lvl28';
  9510. case 29: return 'Lvl29';
  9511. case 30: return 'Lvl30';
  9512. case 31: return 'Lvl31';
  9513. case 32: return 'Lvl32';
  9514. case 33: return 'Lvl33';
  9515. case 34: return 'Lvl34';
  9516. case 35: return 'Lvl35';
  9517. case 36: return 'Lvl36';
  9518. case 37: return 'Lvl37';
  9519. case 38: return 'Lvl38';
  9520. case 39: return 'Lvl39';
  9521. case 40: return 'Lvl40';
  9522. case 41: return 'Lvl41';
  9523. case 42: return 'Lvl42';
  9524. case 43: return 'Lvl43';
  9525. case 44: return 'Lvl44';
  9526. case 45: return 'Lvl45';
  9527. case 46: return 'Lvl46';
  9528. case 47: return 'Lvl47';
  9529. case 48: return 'Lvl48';
  9530. case 49: return 'Lvl49';
  9531. case 50: return 'Lvl50';
  9532.  
  9533. default: return '';
  9534. }
  9535.  
  9536. return '';
  9537. }
  9538.  
  9539. public function CanSprint( speed : float ) : bool
  9540. {
  9541. if( !super.CanSprint( speed ) )
  9542. {
  9543. return false;
  9544. }
  9545. if( rangedWeapon && rangedWeapon.GetCurrentStateName() != 'State_WeaponWait' )
  9546. {
  9547. if ( this.GetPlayerCombatStance() == PCS_AlertNear )
  9548. {
  9549. if ( IsSprintActionPressed() )
  9550. OnRangedForceHolster( true, false );
  9551. }
  9552. else
  9553. return false;
  9554. }
  9555. if( GetCurrentStateName() != 'Swimming' && GetStat(BCS_Stamina) <= 0 )
  9556. {
  9557. SetSprintActionPressed(false,true);
  9558. return false;
  9559. }
  9560.  
  9561. return true;
  9562. }
  9563.  
  9564. public function ManageSleeping()
  9565. {
  9566. thePlayer.RemoveBuffImmunity_AllCritical( 'Bed' );
  9567. thePlayer.RemoveBuffImmunity_AllNegative( 'Bed' );
  9568.  
  9569. thePlayer.PlayerStopAction( PEA_GoToSleep );
  9570. }
  9571.  
  9572.  
  9573.  
  9574. public function RestoreHorseManager() : bool
  9575. {
  9576. var horseTemplate : CEntityTemplate;
  9577. var horseManager : W3HorseManager;
  9578.  
  9579. if ( GetHorseManager() )
  9580. {
  9581. return false;
  9582. }
  9583.  
  9584. horseTemplate = (CEntityTemplate)LoadResource("horse_manager");
  9585. horseManager = (W3HorseManager)theGame.CreateEntity(horseTemplate, GetWorldPosition(),,,,,PM_Persist);
  9586. horseManager.CreateAttachment(this);
  9587. horseManager.OnCreated();
  9588. EntityHandleSet( horseManagerHandle, horseManager );
  9589.  
  9590. return true;
  9591. }
  9592.  
  9593.  
  9594.  
  9595.  
  9596.  
  9597.  
  9598. final function PerformParryCheck( parryInfo : SParryInfo ) : bool
  9599. {
  9600. if( super.PerformParryCheck( parryInfo ) )
  9601. {
  9602. GainAdrenalineFromPerk21( 'parry' );
  9603. return true;
  9604. }
  9605. return false;
  9606. }
  9607.  
  9608. protected final function PerformCounterCheck( parryInfo: SParryInfo ) : bool
  9609. {
  9610. var fistFightCheck, isInFistFight : bool;
  9611.  
  9612. if( super.PerformCounterCheck( parryInfo ) )
  9613. {
  9614. GainAdrenalineFromPerk21( 'counter' );
  9615.  
  9616. isInFistFight = FistFightCheck( parryInfo.target, parryInfo.attacker, fistFightCheck );
  9617.  
  9618. if( isInFistFight && fistFightCheck )
  9619. {
  9620. FactsAdd( "statistics_fist_fight_counter" );
  9621. AddTimer( 'FistFightCounterTimer', 0.5f, , , , true );
  9622. }
  9623.  
  9624. return true;
  9625. }
  9626. return false;
  9627. }
  9628.  
  9629. public function GainAdrenalineFromPerk21( n : name )
  9630. {
  9631. var perkStats, perkTime : SAbilityAttributeValue;
  9632. var targets : array<CActor>;
  9633.  
  9634. targets = GetHostileEnemies();
  9635.  
  9636. if( !CanUseSkill( S_Perk_21 ) || targets.Size() == 0 )
  9637. {
  9638. return;
  9639. }
  9640.  
  9641. perkTime = GetSkillAttributeValue( S_Perk_21, 'perk21Time', false, false );
  9642.  
  9643. if( theGame.GetEngineTimeAsSeconds() >= timeForPerk21 + perkTime.valueAdditive )
  9644. {
  9645. perkStats = GetSkillAttributeValue( S_Perk_21, n , false, false );
  9646. GainStat( BCS_Focus, perkStats.valueAdditive );
  9647. timeForPerk21 = theGame.GetEngineTimeAsSeconds();
  9648.  
  9649. AddEffectDefault( EET_Perk21InternalCooldown, this, "Perk21", false );
  9650. }
  9651. }
  9652.  
  9653. timer function FistFightCounterTimer( dt : float, id : int )
  9654. {
  9655. FactsRemove( "statistics_fist_fight_counter" );
  9656. }
  9657.  
  9658. public final function IsSignBlocked(signType : ESignType) : bool
  9659. {
  9660. switch( signType )
  9661. {
  9662. case ST_Aard :
  9663. return IsRadialSlotBlocked ( 'Aard');
  9664. break;
  9665. case ST_Axii :
  9666. return IsRadialSlotBlocked ( 'Axii');
  9667. break;
  9668. case ST_Igni :
  9669. return IsRadialSlotBlocked ( 'Igni');
  9670. break;
  9671. case ST_Quen :
  9672. return IsRadialSlotBlocked ( 'Quen');
  9673. break;
  9674. case ST_Yrden :
  9675. return IsRadialSlotBlocked ( 'Yrden');
  9676. break;
  9677. default:
  9678. break;
  9679. }
  9680. return false;
  9681.  
  9682. }
  9683.  
  9684. public final function AddAnItemWithAutogenLevelAndQuality(itemName : name, desiredLevel : int, minQuality : int, optional equipItem : bool)
  9685. {
  9686. var itemLevel, quality : int;
  9687. var ids : array<SItemUniqueId>;
  9688. var attemptCounter : int;
  9689.  
  9690. itemLevel = 0;
  9691. quality = 0;
  9692. attemptCounter = 0;
  9693. while(itemLevel != desiredLevel || quality < minQuality)
  9694. {
  9695. attemptCounter += 1;
  9696. ids.Clear();
  9697. ids = inv.AddAnItem(itemName, 1, true);
  9698. itemLevel = inv.GetItemLevel(ids[0]);
  9699. quality = RoundMath(CalculateAttributeValue(inv.GetItemAttributeValue(ids[0], 'quality')));
  9700.  
  9701.  
  9702. if(attemptCounter >= 1000)
  9703. break;
  9704.  
  9705. if(itemLevel != desiredLevel || quality < minQuality)
  9706. inv.RemoveItem(ids[0]);
  9707. }
  9708.  
  9709. if(equipItem)
  9710. EquipItem(ids[0]);
  9711. }
  9712.  
  9713. public final function AddAnItemWithAutogenLevel(itemName : name, desiredLevel : int)
  9714. {
  9715. var itemLevel : int;
  9716. var ids : array<SItemUniqueId>;
  9717. var attemptCounter : int;
  9718.  
  9719. itemLevel = 0;
  9720. while(itemLevel != desiredLevel)
  9721. {
  9722. attemptCounter += 1;
  9723. ids.Clear();
  9724. ids = inv.AddAnItem(itemName, 1, true);
  9725. itemLevel = inv.GetItemLevel(ids[0]);
  9726.  
  9727.  
  9728. if(attemptCounter >= 1000)
  9729. break;
  9730.  
  9731. if(itemLevel != desiredLevel)
  9732. inv.RemoveItem(ids[0]);
  9733. }
  9734. }
  9735.  
  9736. public final function AddAnItemWithMinQuality(itemName : name, minQuality : int, optional equip : bool)
  9737. {
  9738. var quality : int;
  9739. var ids : array<SItemUniqueId>;
  9740. var attemptCounter : int;
  9741.  
  9742. quality = 0;
  9743. while(quality < minQuality)
  9744. {
  9745. attemptCounter += 1;
  9746. ids.Clear();
  9747. ids = inv.AddAnItem(itemName, 1, true);
  9748. quality = RoundMath(CalculateAttributeValue(inv.GetItemAttributeValue(ids[0], 'quality')));
  9749.  
  9750.  
  9751. if(attemptCounter >= 1000)
  9752. break;
  9753.  
  9754. if(quality < minQuality)
  9755. inv.RemoveItem(ids[0]);
  9756. }
  9757.  
  9758. if(equip)
  9759. EquipItem(ids[0]);
  9760. }
  9761.  
  9762.  
  9763.  
  9764.  
  9765.  
  9766.  
  9767. public function IsSetBonusActive( bonus : EItemSetBonus ) : bool
  9768. {
  9769. switch(bonus)
  9770. {
  9771. case EISB_Lynx_1: return amountOfSetPiecesEquipped[ EIST_Lynx ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS;
  9772. case EISB_Lynx_2: return amountOfSetPiecesEquipped[ EIST_Lynx ] >= theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS;
  9773. case EISB_Gryphon_1: return amountOfSetPiecesEquipped[ EIST_Gryphon ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS;
  9774. case EISB_Gryphon_2: return amountOfSetPiecesEquipped[ EIST_Gryphon ] >= theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS;
  9775. case EISB_Bear_1: return amountOfSetPiecesEquipped[ EIST_Bear ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS;
  9776. case EISB_Bear_2: return amountOfSetPiecesEquipped[ EIST_Bear ] >= theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS;
  9777. case EISB_Wolf_1: return amountOfSetPiecesEquipped[ EIST_Wolf ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS;
  9778. case EISB_Wolf_2: return amountOfSetPiecesEquipped[ EIST_Wolf ] >= theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS;
  9779. case EISB_RedWolf_1: return amountOfSetPiecesEquipped[ EIST_RedWolf ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS;
  9780. case EISB_RedWolf_2: return amountOfSetPiecesEquipped[ EIST_RedWolf ] >= theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS;
  9781. case EISB_Vampire: return amountOfSetPiecesEquipped[ EIST_Vampire ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS;
  9782. default: return false;
  9783. }
  9784. }
  9785.  
  9786. public function GetSetPartsEquipped( setType : EItemSetType ) : int
  9787. {
  9788. return amountOfSetPiecesEquipped[ setType ];
  9789. }
  9790.  
  9791. protected function UpdateItemSetBonuses( item : SItemUniqueId, increment : bool )
  9792. {
  9793. var setType : EItemSetType;
  9794. var tutorialStateSets : W3TutorialManagerUIHandlerStateSetItemsUnlocked;
  9795. var id : SItemUniqueId;
  9796.  
  9797. if( !inv.IsIdValid( item ) || !inv.ItemHasTag(item, theGame.params.ITEM_SET_TAG_BONUS ) )
  9798. {
  9799.  
  9800. if( !IsSetBonusActive( EISB_Wolf_1 ) )
  9801. {
  9802. if( GetItemEquippedOnSlot( EES_SteelSword, id ) )
  9803. {
  9804. RemoveExtraOilsFromItem( id );
  9805. }
  9806. if( GetItemEquippedOnSlot( EES_SilverSword, id ) )
  9807. {
  9808. RemoveExtraOilsFromItem( id );
  9809. }
  9810. }
  9811.  
  9812. return;
  9813. }
  9814.  
  9815. setType = CheckSetType( item );
  9816.  
  9817. if( increment )
  9818. {
  9819. amountOfSetPiecesEquipped[ setType ] += 1;
  9820.  
  9821. if( amountOfSetPiecesEquipped[ setType ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS && ShouldProcessTutorial( 'TutorialSetBonusesUnlocked' ) && theGame.GetTutorialSystem().uiHandler && theGame.GetTutorialSystem().uiHandler.GetCurrentStateName() == 'SetItemsUnlocked' )
  9822. {
  9823. tutorialStateSets = ( W3TutorialManagerUIHandlerStateSetItemsUnlocked )theGame.GetTutorialSystem().uiHandler.GetCurrentState();
  9824. tutorialStateSets.OnSetBonusCompleted();
  9825. }
  9826. }
  9827. else if( amountOfSetPiecesEquipped[ setType ] > 0 )
  9828. {
  9829. amountOfSetPiecesEquipped[ setType ] -= 1;
  9830. }
  9831.  
  9832.  
  9833. if( setType != EIST_Vampire && amountOfSetPiecesEquipped[ setType ] == theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS )
  9834. {
  9835. theGame.GetGamerProfile().AddAchievement( EA_ReadyToRoll );
  9836. }
  9837.  
  9838.  
  9839. if( !IsSetBonusActive( EISB_Wolf_1 ) )
  9840. {
  9841. if( GetItemEquippedOnSlot( EES_SteelSword, id ) )
  9842. {
  9843. RemoveExtraOilsFromItem( id );
  9844. }
  9845. if( GetItemEquippedOnSlot( EES_SilverSword, id ) )
  9846. {
  9847. RemoveExtraOilsFromItem( id );
  9848. }
  9849. }
  9850.  
  9851. ManageActiveSetBonuses( setType );
  9852.  
  9853.  
  9854. ManageSetBonusesSoundbanks( setType );
  9855. }
  9856.  
  9857. public function ManageActiveSetBonuses( setType : EItemSetType )
  9858. {
  9859. var l_i : int;
  9860.  
  9861.  
  9862. if( setType == EIST_Lynx )
  9863. {
  9864.  
  9865. if( HasBuff( EET_LynxSetBonus ) && !IsSetBonusActive( EISB_Lynx_1 ) )
  9866. {
  9867. RemoveBuff( EET_LynxSetBonus );
  9868. }
  9869. }
  9870.  
  9871. else if( setType == EIST_Gryphon )
  9872. {
  9873.  
  9874. if( !IsSetBonusActive( EISB_Gryphon_1 ) )
  9875. {
  9876. RemoveBuff( EET_GryphonSetBonus );
  9877. }
  9878.  
  9879. if( IsSetBonusActive( EISB_Gryphon_2 ) && !HasBuff( EET_GryphonSetBonusYrden ) )
  9880. {
  9881. for( l_i = 0 ; l_i < yrdenEntities.Size() ; l_i += 1 )
  9882. {
  9883. if( yrdenEntities[ l_i ].GetIsPlayerInside() && !yrdenEntities[ l_i ].IsAlternateCast() )
  9884. {
  9885. AddEffectDefault( EET_GryphonSetBonusYrden, this, "GryphonSetBonusYrden" );
  9886. break;
  9887. }
  9888. }
  9889. }
  9890. else
  9891. {
  9892. RemoveBuff( EET_GryphonSetBonusYrden );
  9893. }
  9894. }
  9895. }
  9896.  
  9897. public function CheckSetTypeByName( itemName : name ) : EItemSetType
  9898. {
  9899. var dm : CDefinitionsManagerAccessor;
  9900.  
  9901. dm = theGame.GetDefinitionsManager();
  9902.  
  9903. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_LYNX ) )
  9904. {
  9905. return EIST_Lynx;
  9906. }
  9907. else
  9908. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_GRYPHON ) )
  9909. {
  9910. return EIST_Gryphon;
  9911. }
  9912. else
  9913. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_BEAR ) )
  9914. {
  9915. return EIST_Bear;
  9916. }
  9917. else
  9918. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_WOLF ) )
  9919. {
  9920. return EIST_Wolf;
  9921. }
  9922. else
  9923. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_RED_WOLF ) )
  9924. {
  9925. return EIST_RedWolf;
  9926. }
  9927. else
  9928. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_VAMPIRE ) )
  9929. {
  9930. return EIST_Vampire;
  9931. }
  9932. else
  9933. if( dm.ItemHasTag( itemName, theGame.params.ITEM_SET_TAG_VIPER ) )
  9934. {
  9935. return EIST_Viper;
  9936. }
  9937. else
  9938. {
  9939. return EIST_Undefined;
  9940. }
  9941. }
  9942.  
  9943. public function CheckSetType( item : SItemUniqueId ) : EItemSetType
  9944. {
  9945. var stopLoop : bool;
  9946. var tags : array<name>;
  9947. var i : int;
  9948. var setType : EItemSetType;
  9949.  
  9950. stopLoop = false;
  9951.  
  9952. inv.GetItemTags( item, tags );
  9953.  
  9954.  
  9955. for( i=0; i<tags.Size(); i+=1 )
  9956. {
  9957. switch( tags[i] )
  9958. {
  9959. case theGame.params.ITEM_SET_TAG_LYNX:
  9960. case theGame.params.ITEM_SET_TAG_GRYPHON:
  9961. case theGame.params.ITEM_SET_TAG_BEAR:
  9962. case theGame.params.ITEM_SET_TAG_WOLF:
  9963. case theGame.params.ITEM_SET_TAG_RED_WOLF:
  9964. case theGame.params.ITEM_SET_TAG_VAMPIRE:
  9965. case theGame.params.ITEM_SET_TAG_VIPER:
  9966. setType = SetItemNameToType( tags[i] );
  9967. stopLoop = true;
  9968. break;
  9969. }
  9970. if ( stopLoop )
  9971. {
  9972. break;
  9973. }
  9974. }
  9975.  
  9976. return setType;
  9977. }
  9978.  
  9979. public function GetSetBonusStatusByName( itemName : name, out desc1, desc2 : string, out isActive1, isActive2 : bool ) : EItemSetType
  9980. {
  9981. var setType : EItemSetType;
  9982.  
  9983. if( theGame.GetDLCManager().IsEP2Enabled() )
  9984. {
  9985. setType = CheckSetTypeByName( itemName );
  9986. SetBonusStatusByType( setType, desc1, desc2, isActive1, isActive2 );
  9987.  
  9988. return setType;
  9989. }
  9990. else
  9991. {
  9992. return EIST_Undefined;
  9993. }
  9994. }
  9995.  
  9996. public function GetSetBonusStatus( item : SItemUniqueId, out desc1, desc2 : string, out isActive1, isActive2 : bool ) : EItemSetType
  9997. {
  9998. var setType : EItemSetType;
  9999.  
  10000. if( theGame.GetDLCManager().IsEP2Enabled() )
  10001. {
  10002. setType = CheckSetType( item );
  10003. SetBonusStatusByType( setType, desc1, desc2, isActive1, isActive2 );
  10004.  
  10005. return setType;
  10006. }
  10007. else
  10008. {
  10009. return EIST_Undefined;
  10010. }
  10011. }
  10012.  
  10013. private function SetBonusStatusByType(setType : EItemSetType, out desc1, desc2 : string, out isActive1, isActive2 : bool):void
  10014. {
  10015. var setBonus : EItemSetBonus;
  10016.  
  10017. if( amountOfSetPiecesEquipped[ setType ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS )
  10018. {
  10019. isActive1 = true;
  10020. }
  10021.  
  10022. if( amountOfSetPiecesEquipped[ setType ] >= theGame.params.ITEMS_REQUIRED_FOR_MAJOR_SET_BONUS )
  10023. {
  10024. isActive2 = true;
  10025. }
  10026.  
  10027. setBonus = ItemSetTypeToItemSetBonus( setType, 1 );
  10028. desc1 = GetSetBonusTooltipDescription( setBonus );
  10029.  
  10030. setBonus = ItemSetTypeToItemSetBonus( setType, 2 );
  10031. desc2 = GetSetBonusTooltipDescription( setBonus );
  10032. }
  10033.  
  10034. public function ItemSetTypeToItemSetBonus( setType : EItemSetType, nr : int ) : EItemSetBonus
  10035. {
  10036. var setBonus : EItemSetBonus;
  10037.  
  10038. if( nr == 1 )
  10039. {
  10040. switch( setType )
  10041. {
  10042. case EIST_Lynx: setBonus = EISB_Lynx_1; break;
  10043. case EIST_Gryphon: setBonus = EISB_Gryphon_1; break;
  10044. case EIST_Bear: setBonus = EISB_Bear_1; break;
  10045. case EIST_Wolf: setBonus = EISB_Wolf_1; break;
  10046. case EIST_RedWolf: setBonus = EISB_RedWolf_1; break;
  10047. case EIST_Vampire: setBonus = EISB_Vampire; break;
  10048. }
  10049. }
  10050. else
  10051. {
  10052. switch( setType )
  10053. {
  10054. case EIST_Lynx: setBonus = EISB_Lynx_2; break;
  10055. case EIST_Gryphon: setBonus = EISB_Gryphon_2; break;
  10056. case EIST_Bear: setBonus = EISB_Bear_2; break;
  10057. case EIST_Wolf: setBonus = EISB_Wolf_2; break;
  10058. case EIST_RedWolf: setBonus = EISB_RedWolf_2; break;
  10059. case EIST_Vampire: setBonus = EISB_Undefined; break;
  10060. }
  10061. }
  10062.  
  10063. return setBonus;
  10064. }
  10065.  
  10066. public function GetSetBonusTooltipDescription( bonus : EItemSetBonus ) : string
  10067. {
  10068. var finalString : string;
  10069. var arrString : array<string>;
  10070. var dm : CDefinitionsManagerAccessor;
  10071. var min, max : SAbilityAttributeValue;
  10072. var tempString : string;
  10073.  
  10074. switch( bonus )
  10075. {
  10076. case EISB_Lynx_1: tempString = "skill_desc_lynx_set_ability1"; break;
  10077. case EISB_Lynx_2: tempString = "skill_desc_lynx_set_ability2"; break;
  10078. case EISB_Gryphon_1: tempString = "skill_desc_gryphon_set_ability1"; break;
  10079. case EISB_Gryphon_2: tempString = "skill_desc_gryphon_set_ability2"; break;
  10080. case EISB_Bear_1: tempString = "skill_desc_bear_set_ability1"; break;
  10081. case EISB_Bear_2: tempString = "skill_desc_bear_set_ability2"; break;
  10082. case EISB_Wolf_1: tempString = "skill_desc_wolf_set_ability2"; break;
  10083. case EISB_Wolf_2: tempString = "skill_desc_wolf_set_ability1"; break;
  10084. case EISB_RedWolf_1: tempString = "skill_desc_red_wolf_set_ability1"; break;
  10085. case EISB_RedWolf_2: tempString = "skill_desc_red_wolf_set_ability2"; break;
  10086. case EISB_Vampire: tempString = "skill_desc_vampire_set_ability1"; break;
  10087. default: tempString = ""; break;
  10088. }
  10089.  
  10090. dm = theGame.GetDefinitionsManager();
  10091.  
  10092. switch( bonus )
  10093. {
  10094. case EISB_Lynx_1:
  10095. dm.GetAbilityAttributeValue( 'LynxSetBonusEffect', 'duration', min, max );
  10096. arrString.PushBack( FloatToString( min.valueAdditive ) );
  10097. dm.GetAbilityAttributeValue( 'LynxSetBonusEffect', 'lynx_dmg_boost', min, max );
  10098. arrString.PushBack( FloatToString( min.valueAdditive * 100 ) );
  10099. arrString.PushBack( FloatToString( min.valueAdditive * 100 * amountOfSetPiecesEquipped[ EIST_Lynx ] ) );
  10100. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10101. break;
  10102. case EISB_Lynx_2:
  10103. dm.GetAbilityAttributeValue( GetSetBonusAbility( EISB_Lynx_2 ), 'lynx_2_dmg_boost', min, max );
  10104. arrString.PushBack( FloatToString( min.valueAdditive * 100 ) );
  10105.  
  10106. dm.GetAbilityAttributeValue( GetSetBonusAbility( EISB_Lynx_2 ), 'lynx_2_adrenaline_cost', min, max );
  10107. arrString.PushBack( FloatToString( min.valueAdditive ) );
  10108.  
  10109. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10110. break;
  10111. case EISB_Gryphon_1:
  10112. dm.GetAbilityAttributeValue( 'GryphonSetBonusEffect', 'duration', min, max );
  10113. arrString.PushBack( FloatToString( min.valueAdditive ) );
  10114. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10115. break;
  10116. case EISB_Gryphon_2:
  10117. dm.GetAbilityAttributeValue( 'GryphonSetBonusYrdenEffect', 'trigger_scale', min, max );
  10118. arrString.PushBack( FloatToString( ( min.valueAdditive - 1 )* 100) );
  10119. dm.GetAbilityAttributeValue( 'GryphonSetBonusYrdenEffect', 'staminaRegen', min, max );
  10120. arrString.PushBack( FloatToString( min.valueMultiplicative * 100) );
  10121. dm.GetAbilityAttributeValue( 'GryphonSetBonusYrdenEffect', 'spell_power', min, max );
  10122. arrString.PushBack( FloatToString( min.valueMultiplicative * 100) );
  10123. dm.GetAbilityAttributeValue( 'GryphonSetBonusYrdenEffect', 'gryphon_set_bns_dmg_reduction', min, max );
  10124. arrString.PushBack( FloatToString( min.valueAdditive * 100) );
  10125. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10126. break;
  10127. case EISB_Bear_1:
  10128. dm.GetAbilityAttributeValue( 'setBonusAbilityBear_1', 'quen_reapply_chance', min, max );
  10129. arrString.PushBack( FloatToString( min.valueMultiplicative * 100 ) );
  10130.  
  10131. arrString.PushBack( FloatToString( min.valueMultiplicative * 100 * amountOfSetPiecesEquipped[ EIST_Bear ] ) );
  10132. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10133. break;
  10134. case EISB_Bear_2:
  10135. dm.GetAbilityAttributeValue( 'setBonusAbilityBear_2', 'quen_dmg_boost', min, max );
  10136. arrString.PushBack( FloatToString( min.valueMultiplicative * 100 ) );
  10137. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10138. break;
  10139. case EISB_RedWolf_2:
  10140. dm.GetAbilityAttributeValue( 'setBonusAbilityRedWolf_2', 'amount', min, max );
  10141. arrString.PushBack( FloatToString( min.valueAdditive ) );
  10142. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10143. break;
  10144. case EISB_Vampire:
  10145. dm.GetAbilityAttributeValue( 'setBonusAbilityVampire', 'life_percent', min, max );
  10146. arrString.PushBack( FloatToString( min.valueAdditive ) );
  10147. arrString.PushBack( FloatToString( min.valueAdditive * amountOfSetPiecesEquipped[ EIST_Vampire ] ) );
  10148. finalString = GetLocStringByKeyExtWithParams( tempString,,,arrString );
  10149. break;
  10150. default:
  10151. finalString = GetLocStringByKeyExtWithParams( tempString );
  10152. }
  10153.  
  10154. return finalString;
  10155. }
  10156.  
  10157. public function ManageSetBonusesSoundbanks( setType : EItemSetType )
  10158. {
  10159. if( amountOfSetPiecesEquipped[ setType ] >= theGame.params.ITEMS_REQUIRED_FOR_MINOR_SET_BONUS )
  10160. {
  10161. switch( setType )
  10162. {
  10163. case EIST_Lynx:
  10164. LoadSetBonusSoundBank( "ep2_setbonus_lynx.bnk" );
  10165. break;
  10166. case EIST_Gryphon:
  10167. LoadSetBonusSoundBank( "ep2_setbonus_gryphon.bnk" );
  10168. break;
  10169. case EIST_Bear:
  10170. LoadSetBonusSoundBank( "ep2_setbonus_bear.bnk" );
  10171. break;
  10172. }
  10173. }
  10174. else
  10175. {
  10176. switch( setType )
  10177. {
  10178. case EIST_Lynx:
  10179. UnloadSetBonusSoundBank( "ep2_setbonus_lynx.bnk" );
  10180. break;
  10181. case EIST_Gryphon:
  10182. UnloadSetBonusSoundBank( "ep2_setbonus_gryphon.bnk" );
  10183. break;
  10184. case EIST_Bear:
  10185. UnloadSetBonusSoundBank( "ep2_setbonus_bear.bnk" );
  10186. break;
  10187. }
  10188. }
  10189. }
  10190.  
  10191. public function VampiricSetAbilityRegeneration()
  10192. {
  10193. var healthMax : float;
  10194. var healthToReg : float;
  10195.  
  10196. healthMax = GetStatMax( BCS_Vitality );
  10197.  
  10198. healthToReg = ( amountOfSetPiecesEquipped[ EIST_Vampire ] * healthMax ) / 100;
  10199.  
  10200. PlayEffect('drain_energy_caretaker_shovel');
  10201. GainStat( BCS_Vitality, healthToReg );
  10202. }
  10203.  
  10204. private function LoadSetBonusSoundBank( bankName : string )
  10205. {
  10206. if( !theSound.SoundIsBankLoaded( bankName ) )
  10207. {
  10208. theSound.SoundLoadBank( bankName, true );
  10209. }
  10210. }
  10211.  
  10212. private function UnloadSetBonusSoundBank( bankName : string )
  10213. {
  10214. if( theSound.SoundIsBankLoaded( bankName ) )
  10215. {
  10216. theSound.SoundUnloadBank( bankName );
  10217. }
  10218. }
  10219.  
  10220. timer function BearSetBonusQuenReapply( dt : float, id : int )
  10221. {
  10222. var newQuen : W3QuenEntity;
  10223.  
  10224. newQuen = (W3QuenEntity)theGame.CreateEntity( GetSignTemplate( ST_Quen ), GetWorldPosition(), GetWorldRotation() );
  10225. newQuen.Init( signOwner, GetSignEntity( ST_Quen ), true );
  10226. newQuen.freeFromBearSetBonus = true;
  10227. newQuen.OnStarted();
  10228. newQuen.OnThrowing();
  10229. newQuen.OnEnded();
  10230.  
  10231. m_quenReappliedCount += 1;
  10232.  
  10233. RemoveTimer( 'BearSetBonusQuenReapply');
  10234. }
  10235.  
  10236. // AeroHD -- AutoLootMenu++
  10237. timer function InitAHDAutoLoot(dt : float, id : int)
  10238. {
  10239. mAutoLootConfig.Init();
  10240. mAutoLootNotificationManager.Reset();
  10241. }
  10242.  
  10243. public function GetAutoLootConfig() : CAHDAutoLootConfig { return mAutoLootConfig; }
  10244.  
  10245. public function GetAutoLootNotificationManager() : CAHDAutoLootNotificationManager { return mAutoLootNotificationManager; }
  10246.  
  10247. timer function TrueAutoLootMode( dt : float, id : int )
  10248. {
  10249. if( GetAutoLootConfig().ModEnabled() || GetAutoLootConfig().TrueAutoLootEnabled() )
  10250. {
  10251. mAutoLootConfig.GetFeatureManager().TryAreaLooting("true_autoloot_mode");
  10252. AddTimer('TrueAutoLootMode', mAutoLootConfig.GetTrueAutoLootTime());
  10253. }
  10254. }
  10255. // AeroHD -- AutoLootMenu--
  10256.  
  10257. // AeroHD -- AutoLootMenu++
  10258. timer function InitAHDAutoLoot(dt : float, id : int)
  10259. {
  10260. mAutoLootConfig.Init();
  10261. mAutoLootNotificationManager.Reset();
  10262. }
  10263.  
  10264. public function GetAutoLootConfig() : CAHDAutoLootConfig { return mAutoLootConfig; }
  10265.  
  10266. public function GetAutoLootNotificationManager() : CAHDAutoLootNotificationManager { return mAutoLootNotificationManager; }
  10267.  
  10268. timer function TrueAutoLootMode( dt : float, id : int )
  10269. {
  10270. if( GetAutoLootConfig().ModEnabled() || GetAutoLootConfig().TrueAutoLootEnabled() )
  10271. {
  10272. mAutoLootConfig.GetFeatureManager().TryAreaLooting("true_autoloot_mode");
  10273. AddTimer('TrueAutoLootMode', mAutoLootConfig.GetTrueAutoLootTime());
  10274. }
  10275. }
  10276. // AeroHD -- AutoLootMenu--
  10277.  
  10278. public final function StandaloneEp1_1()
  10279. {
  10280. var i, inc, quantityLow, randLow, quantityMedium, randMedium, quantityHigh, randHigh, startingMoney : int;
  10281. var pam : W3PlayerAbilityManager;
  10282. var ids : array<SItemUniqueId>;
  10283. var STARTING_LEVEL : int;
  10284.  
  10285. FactsAdd("StandAloneEP1", 1);
  10286.  
  10287.  
  10288. inv.RemoveAllItems();
  10289.  
  10290.  
  10291. inv.AddAnItem('Illusion Medallion', 1, true, true, false);
  10292. inv.AddAnItem('q103_safe_conduct', 1, true, true, false);
  10293.  
  10294.  
  10295. theGame.GetGamerProfile().ClearAllAchievementsForEP1();
  10296.  
  10297.  
  10298. STARTING_LEVEL = 32;
  10299. inc = STARTING_LEVEL - GetLevel();
  10300. for(i=0; i<inc; i+=1)
  10301. {
  10302. levelManager.AddPoints(EExperiencePoint, levelManager.GetTotalExpForNextLevel() - levelManager.GetPointsTotal(EExperiencePoint), false);
  10303. }
  10304.  
  10305.  
  10306. levelManager.ResetCharacterDev();
  10307. pam = (W3PlayerAbilityManager)abilityManager;
  10308. if(pam)
  10309. {
  10310. pam.ResetCharacterDev();
  10311. }
  10312. levelManager.SetFreeSkillPoints(levelManager.GetLevel() - 1 + 11);
  10313.  
  10314.  
  10315. inv.AddAnItem('Mutagen red', 4);
  10316. inv.AddAnItem('Mutagen green', 4);
  10317. inv.AddAnItem('Mutagen blue', 4);
  10318. inv.AddAnItem('Lesser mutagen red', 2);
  10319. inv.AddAnItem('Lesser mutagen green', 2);
  10320. inv.AddAnItem('Lesser mutagen blue', 2);
  10321. inv.AddAnItem('Greater mutagen green', 1);
  10322. inv.AddAnItem('Greater mutagen blue', 2);
  10323.  
  10324.  
  10325. startingMoney = 40000;
  10326. if(GetMoney() > startingMoney)
  10327. {
  10328. RemoveMoney(GetMoney() - startingMoney);
  10329. }
  10330. else
  10331. {
  10332. AddMoney( 40000 - GetMoney() );
  10333. }
  10334.  
  10335.  
  10336.  
  10337.  
  10338.  
  10339. ids.Clear();
  10340. ids = inv.AddAnItem('EP1 Standalone Starting Armor');
  10341. EquipItem(ids[0]);
  10342. ids.Clear();
  10343. ids = inv.AddAnItem('EP1 Standalone Starting Boots');
  10344. EquipItem(ids[0]);
  10345. ids.Clear();
  10346. ids = inv.AddAnItem('EP1 Standalone Starting Gloves');
  10347. EquipItem(ids[0]);
  10348. ids.Clear();
  10349. ids = inv.AddAnItem('EP1 Standalone Starting Pants');
  10350. EquipItem(ids[0]);
  10351.  
  10352.  
  10353. ids.Clear();
  10354. ids = inv.AddAnItem('EP1 Standalone Starting Steel Sword');
  10355. EquipItem(ids[0]);
  10356. ids.Clear();
  10357. ids = inv.AddAnItem('EP1 Standalone Starting Silver Sword');
  10358. EquipItem(ids[0]);
  10359.  
  10360.  
  10361. inv.AddAnItem('Torch', 1, true, true, false);
  10362.  
  10363.  
  10364. quantityLow = 1;
  10365. randLow = 3;
  10366. quantityMedium = 4;
  10367. randMedium = 4;
  10368. quantityHigh = 8;
  10369. randHigh = 6;
  10370.  
  10371. inv.AddAnItem('Alghoul bone marrow',quantityMedium+RandRange(randMedium));
  10372. inv.AddAnItem('Amethyst dust',quantityLow+RandRange(randLow));
  10373. inv.AddAnItem('Arachas eyes',quantityLow+RandRange(randLow));
  10374. inv.AddAnItem('Arachas venom',quantityLow+RandRange(randLow));
  10375. inv.AddAnItem('Basilisk hide',quantityLow+RandRange(randLow));
  10376. inv.AddAnItem('Basilisk venom',quantityLow+RandRange(randLow));
  10377. inv.AddAnItem('Bear pelt',quantityHigh+RandRange(randHigh));
  10378. inv.AddAnItem('Berserker pelt',quantityLow+RandRange(randLow));
  10379. inv.AddAnItem('Coal',quantityHigh+RandRange(randHigh));
  10380. inv.AddAnItem('Cotton',quantityHigh+RandRange(randHigh));
  10381. inv.AddAnItem('Dark iron ingot',quantityLow+RandRange(randLow));
  10382. inv.AddAnItem('Dark iron ore',quantityLow+RandRange(randLow));
  10383. inv.AddAnItem('Deer hide',quantityHigh+RandRange(randHigh));
  10384. inv.AddAnItem('Diamond dust',quantityLow+RandRange(randLow));
  10385. inv.AddAnItem('Draconide leather',quantityLow+RandRange(randLow));
  10386. inv.AddAnItem('Drowned dead tongue',quantityLow+RandRange(randLow));
  10387. inv.AddAnItem('Drowner brain',quantityMedium+RandRange(randMedium));
  10388. inv.AddAnItem('Dwimeryte ingot',quantityLow+RandRange(randLow));
  10389. inv.AddAnItem('Dwimeryte ore',quantityLow+RandRange(randLow));
  10390. inv.AddAnItem('Emerald dust',quantityLow+RandRange(randLow));
  10391. inv.AddAnItem('Endriag chitin plates',quantityMedium+RandRange(randMedium));
  10392. inv.AddAnItem('Endriag embryo',quantityLow+RandRange(randLow));
  10393. inv.AddAnItem('Ghoul blood',quantityMedium+RandRange(randMedium));
  10394. inv.AddAnItem('Goat hide',quantityMedium+RandRange(randMedium));
  10395. inv.AddAnItem('Hag teeth',quantityMedium+RandRange(randMedium));
  10396. inv.AddAnItem('Hardened leather',quantityMedium+RandRange(randMedium));
  10397. inv.AddAnItem('Hardened timber',quantityMedium+RandRange(randMedium));
  10398. inv.AddAnItem('Harpy feathers',quantityMedium+RandRange(randMedium));
  10399. inv.AddAnItem('Horse hide',quantityLow+RandRange(randLow));
  10400. inv.AddAnItem('Iron ore',quantityHigh+RandRange(randHigh));
  10401. inv.AddAnItem('Leather straps',quantityHigh+RandRange(randHigh));
  10402. inv.AddAnItem('Leather',quantityHigh+RandRange(randHigh));
  10403. inv.AddAnItem('Linen',quantityMedium+RandRange(randMedium));
  10404. inv.AddAnItem('Meteorite ingot',quantityLow+RandRange(randLow));
  10405. inv.AddAnItem('Meteorite ore',quantityMedium+RandRange(randMedium));
  10406. inv.AddAnItem('Necrophage skin',quantityLow+RandRange(randLow));
  10407. inv.AddAnItem('Nekker blood',quantityHigh+RandRange(randHigh));
  10408. inv.AddAnItem('Nekker heart',quantityMedium+RandRange(randMedium));
  10409. inv.AddAnItem('Oil',quantityHigh+RandRange(randHigh));
  10410. inv.AddAnItem('Phosphorescent crystal',quantityLow+RandRange(randLow));
  10411. inv.AddAnItem('Pig hide',quantityMedium+RandRange(randMedium));
  10412. inv.AddAnItem('Pure silver',quantityMedium+RandRange(randMedium));
  10413. inv.AddAnItem('Rabbit pelt',quantityMedium+RandRange(randMedium));
  10414. inv.AddAnItem('Rotfiend blood',quantityMedium+RandRange(randMedium));
  10415. inv.AddAnItem('Sapphire dust',quantityLow+RandRange(randLow));
  10416. inv.AddAnItem('Silk',quantityHigh+RandRange(randHigh));
  10417. inv.AddAnItem('Silver ingot',quantityMedium+RandRange(randMedium));
  10418. inv.AddAnItem('Silver ore',quantityHigh+RandRange(randHigh));
  10419. inv.AddAnItem('Specter dust',quantityMedium+RandRange(randMedium));
  10420. inv.AddAnItem('Steel ingot',quantityHigh+RandRange(randHigh));
  10421. inv.AddAnItem('Steel plate',quantityHigh+RandRange(randHigh));
  10422. inv.AddAnItem('String',quantityHigh+RandRange(randHigh));
  10423. inv.AddAnItem('Thread',quantityHigh+RandRange(randHigh));
  10424. inv.AddAnItem('Timber',quantityHigh+RandRange(randHigh));
  10425. inv.AddAnItem('Twine',quantityMedium+RandRange(randMedium));
  10426. inv.AddAnItem('Venom extract',quantityMedium+RandRange(randMedium));
  10427. inv.AddAnItem('Water essence',quantityMedium+RandRange(randMedium));
  10428. inv.AddAnItem('Wolf liver',quantityHigh+RandRange(randHigh));
  10429. inv.AddAnItem('Wolf pelt',quantityMedium+RandRange(randMedium));
  10430.  
  10431. inv.AddAnItem('Alcohest', 5);
  10432. inv.AddAnItem('Dwarven spirit', 5);
  10433.  
  10434.  
  10435. ids.Clear();
  10436. ids = inv.AddAnItem('Crossbow 5');
  10437. EquipItem(ids[0]);
  10438. ids.Clear();
  10439. ids = inv.AddAnItem('Blunt Bolt', 100);
  10440. EquipItem(ids[0]);
  10441. inv.AddAnItem('Broadhead Bolt', 100);
  10442. inv.AddAnItem('Split Bolt', 100);
  10443.  
  10444.  
  10445. RemoveAllAlchemyRecipes();
  10446. RemoveAllCraftingSchematics();
  10447.  
  10448.  
  10449.  
  10450.  
  10451. AddAlchemyRecipe('Recipe for Cat 1');
  10452.  
  10453.  
  10454.  
  10455. AddAlchemyRecipe('Recipe for Maribor Forest 1');
  10456. AddAlchemyRecipe('Recipe for Petris Philtre 1');
  10457. AddAlchemyRecipe('Recipe for Swallow 1');
  10458. AddAlchemyRecipe('Recipe for Tawny Owl 1');
  10459.  
  10460. AddAlchemyRecipe('Recipe for White Gull 1');
  10461. AddAlchemyRecipe('Recipe for White Honey 1');
  10462. AddAlchemyRecipe('Recipe for White Raffards Decoction 1');
  10463.  
  10464.  
  10465.  
  10466. AddAlchemyRecipe('Recipe for Beast Oil 1');
  10467. AddAlchemyRecipe('Recipe for Cursed Oil 1');
  10468. AddAlchemyRecipe('Recipe for Hanged Man Venom 1');
  10469. AddAlchemyRecipe('Recipe for Hybrid Oil 1');
  10470. AddAlchemyRecipe('Recipe for Insectoid Oil 1');
  10471. AddAlchemyRecipe('Recipe for Magicals Oil 1');
  10472. AddAlchemyRecipe('Recipe for Necrophage Oil 1');
  10473. AddAlchemyRecipe('Recipe for Specter Oil 1');
  10474. AddAlchemyRecipe('Recipe for Vampire Oil 1');
  10475. AddAlchemyRecipe('Recipe for Draconide Oil 1');
  10476. AddAlchemyRecipe('Recipe for Ogre Oil 1');
  10477. AddAlchemyRecipe('Recipe for Relic Oil 1');
  10478. AddAlchemyRecipe('Recipe for Beast Oil 2');
  10479. AddAlchemyRecipe('Recipe for Cursed Oil 2');
  10480. AddAlchemyRecipe('Recipe for Hanged Man Venom 2');
  10481. AddAlchemyRecipe('Recipe for Hybrid Oil 2');
  10482. AddAlchemyRecipe('Recipe for Insectoid Oil 2');
  10483. AddAlchemyRecipe('Recipe for Magicals Oil 2');
  10484. AddAlchemyRecipe('Recipe for Necrophage Oil 2');
  10485. AddAlchemyRecipe('Recipe for Specter Oil 2');
  10486. AddAlchemyRecipe('Recipe for Vampire Oil 2');
  10487. AddAlchemyRecipe('Recipe for Draconide Oil 2');
  10488. AddAlchemyRecipe('Recipe for Ogre Oil 2');
  10489. AddAlchemyRecipe('Recipe for Relic Oil 2');
  10490.  
  10491.  
  10492. AddAlchemyRecipe('Recipe for Dancing Star 1');
  10493.  
  10494. AddAlchemyRecipe('Recipe for Dwimeritum Bomb 1');
  10495.  
  10496. AddAlchemyRecipe('Recipe for Grapeshot 1');
  10497. AddAlchemyRecipe('Recipe for Samum 1');
  10498.  
  10499. AddAlchemyRecipe('Recipe for White Frost 1');
  10500.  
  10501.  
  10502.  
  10503. AddAlchemyRecipe('Recipe for Dwarven spirit 1');
  10504. AddAlchemyRecipe('Recipe for Alcohest 1');
  10505. AddAlchemyRecipe('Recipe for White Gull 1');
  10506.  
  10507.  
  10508. AddStartingSchematics();
  10509.  
  10510.  
  10511. ids.Clear();
  10512. ids = inv.AddAnItem('Swallow 2');
  10513. EquipItem(ids[0]);
  10514. ids.Clear();
  10515. ids = inv.AddAnItem('Thunderbolt 2');
  10516. EquipItem(ids[0]);
  10517. ids.Clear();
  10518. ids = inv.AddAnItem('Tawny Owl 2');
  10519. EquipItem(ids[0]);
  10520. ids.Clear();
  10521.  
  10522. ids = inv.AddAnItem('Grapeshot 2');
  10523. EquipItem(ids[0]);
  10524. ids.Clear();
  10525. ids = inv.AddAnItem('Samum 2');
  10526. EquipItem(ids[0]);
  10527.  
  10528. inv.AddAnItem('Dwimeritum Bomb 1');
  10529. inv.AddAnItem('Dragons Dream 1');
  10530. inv.AddAnItem('Silver Dust Bomb 1');
  10531. inv.AddAnItem('White Frost 2');
  10532. inv.AddAnItem('Devils Puffball 2');
  10533. inv.AddAnItem('Dancing Star 2');
  10534. inv.AddAnItem('Beast Oil 1');
  10535. inv.AddAnItem('Cursed Oil 1');
  10536. inv.AddAnItem('Hanged Man Venom 2');
  10537. inv.AddAnItem('Hybrid Oil 1');
  10538. inv.AddAnItem('Insectoid Oil 1');
  10539. inv.AddAnItem('Magicals Oil 1');
  10540. inv.AddAnItem('Necrophage Oil 2');
  10541. inv.AddAnItem('Specter Oil 1');
  10542. inv.AddAnItem('Vampire Oil 1');
  10543. inv.AddAnItem('Draconide Oil 1');
  10544. inv.AddAnItem('Relic Oil 1');
  10545. inv.AddAnItem('Black Blood 1');
  10546. inv.AddAnItem('Blizzard 1');
  10547. inv.AddAnItem('Cat 2');
  10548. inv.AddAnItem('Full Moon 1');
  10549. inv.AddAnItem('Maribor Forest 1');
  10550. inv.AddAnItem('Petris Philtre 1');
  10551. inv.AddAnItem('White Gull 1', 3);
  10552. inv.AddAnItem('White Honey 2');
  10553. inv.AddAnItem('White Raffards Decoction 1');
  10554.  
  10555.  
  10556. inv.AddAnItem('Mutagen 17');
  10557. inv.AddAnItem('Mutagen 19');
  10558. inv.AddAnItem('Mutagen 27');
  10559. inv.AddAnItem('Mutagen 26');
  10560.  
  10561.  
  10562. inv.AddAnItem('weapon_repair_kit_1', 5);
  10563. inv.AddAnItem('weapon_repair_kit_2', 3);
  10564. inv.AddAnItem('armor_repair_kit_1', 5);
  10565. inv.AddAnItem('armor_repair_kit_2', 3);
  10566.  
  10567.  
  10568. quantityMedium = 2;
  10569. quantityLow = 1;
  10570. inv.AddAnItem('Rune stribog lesser', quantityMedium);
  10571. inv.AddAnItem('Rune stribog', quantityLow);
  10572. inv.AddAnItem('Rune dazhbog lesser', quantityMedium);
  10573. inv.AddAnItem('Rune dazhbog', quantityLow);
  10574. inv.AddAnItem('Rune devana lesser', quantityMedium);
  10575. inv.AddAnItem('Rune devana', quantityLow);
  10576. inv.AddAnItem('Rune zoria lesser', quantityMedium);
  10577. inv.AddAnItem('Rune zoria', quantityLow);
  10578. inv.AddAnItem('Rune morana lesser', quantityMedium);
  10579. inv.AddAnItem('Rune morana', quantityLow);
  10580. inv.AddAnItem('Rune triglav lesser', quantityMedium);
  10581. inv.AddAnItem('Rune triglav', quantityLow);
  10582. inv.AddAnItem('Rune svarog lesser', quantityMedium);
  10583. inv.AddAnItem('Rune svarog', quantityLow);
  10584. inv.AddAnItem('Rune veles lesser', quantityMedium);
  10585. inv.AddAnItem('Rune veles', quantityLow);
  10586. inv.AddAnItem('Rune perun lesser', quantityMedium);
  10587. inv.AddAnItem('Rune perun', quantityLow);
  10588. inv.AddAnItem('Rune elemental lesser', quantityMedium);
  10589. inv.AddAnItem('Rune elemental', quantityLow);
  10590.  
  10591. inv.AddAnItem('Glyph aard lesser', quantityMedium);
  10592. inv.AddAnItem('Glyph aard', quantityLow);
  10593. inv.AddAnItem('Glyph axii lesser', quantityMedium);
  10594. inv.AddAnItem('Glyph axii', quantityLow);
  10595. inv.AddAnItem('Glyph igni lesser', quantityMedium);
  10596. inv.AddAnItem('Glyph igni', quantityLow);
  10597. inv.AddAnItem('Glyph quen lesser', quantityMedium);
  10598. inv.AddAnItem('Glyph quen', quantityLow);
  10599. inv.AddAnItem('Glyph yrden lesser', quantityMedium);
  10600. inv.AddAnItem('Glyph yrden', quantityLow);
  10601.  
  10602.  
  10603. StandaloneEp1_2();
  10604. }
  10605.  
  10606. public final function StandaloneEp1_2()
  10607. {
  10608. var horseId : SItemUniqueId;
  10609. var ids : array<SItemUniqueId>;
  10610. var ents : array< CJournalBase >;
  10611. var i : int;
  10612. var manager : CWitcherJournalManager;
  10613.  
  10614.  
  10615. inv.AddAnItem( 'Cows milk', 20 );
  10616. ids.Clear();
  10617. ids = inv.AddAnItem( 'Dumpling', 44 );
  10618. EquipItem(ids[0]);
  10619.  
  10620.  
  10621. inv.AddAnItem('Clearing Potion', 2, true, false, false);
  10622.  
  10623.  
  10624. GetHorseManager().RemoveAllItems();
  10625.  
  10626. ids.Clear();
  10627. ids = inv.AddAnItem('Horse Bag 2');
  10628. horseId = GetHorseManager().MoveItemToHorse(ids[0]);
  10629. GetHorseManager().EquipItem(horseId);
  10630.  
  10631. ids.Clear();
  10632. ids = inv.AddAnItem('Horse Blinder 2');
  10633. horseId = GetHorseManager().MoveItemToHorse(ids[0]);
  10634. GetHorseManager().EquipItem(horseId);
  10635.  
  10636. ids.Clear();
  10637. ids = inv.AddAnItem('Horse Saddle 2');
  10638. horseId = GetHorseManager().MoveItemToHorse(ids[0]);
  10639. GetHorseManager().EquipItem(horseId);
  10640.  
  10641. manager = theGame.GetJournalManager();
  10642.  
  10643.  
  10644. manager.GetActivatedOfType( 'CJournalCreature', ents );
  10645. for(i=0; i<ents.Size(); i+=1)
  10646. {
  10647. manager.ActivateEntry(ents[i], JS_Inactive, false, true);
  10648. }
  10649.  
  10650.  
  10651. ents.Clear();
  10652. manager.GetActivatedOfType( 'CJournalCharacter', ents );
  10653. for(i=0; i<ents.Size(); i+=1)
  10654. {
  10655. manager.ActivateEntry(ents[i], JS_Inactive, false, true);
  10656. }
  10657.  
  10658.  
  10659. ents.Clear();
  10660. manager.GetActivatedOfType( 'CJournalQuest', ents );
  10661. for(i=0; i<ents.Size(); i+=1)
  10662. {
  10663.  
  10664. if( StrStartsWith(ents[i].baseName, "q60"))
  10665. continue;
  10666.  
  10667. manager.ActivateEntry(ents[i], JS_Inactive, false, true);
  10668. }
  10669.  
  10670.  
  10671. manager.ActivateEntryByScriptTag('TutorialAard', JS_Active);
  10672. manager.ActivateEntryByScriptTag('TutorialAdrenaline', JS_Active);
  10673. manager.ActivateEntryByScriptTag('TutorialAxii', JS_Active);
  10674. manager.ActivateEntryByScriptTag('TutorialAxiiDialog', JS_Active);
  10675. manager.ActivateEntryByScriptTag('TutorialCamera', JS_Active);
  10676. manager.ActivateEntryByScriptTag('TutorialCamera_pad', JS_Active);
  10677. manager.ActivateEntryByScriptTag('TutorialCiriBlink', JS_Active);
  10678. manager.ActivateEntryByScriptTag('TutorialCiriCharge', JS_Active);
  10679. manager.ActivateEntryByScriptTag('TutorialCiriStamina', JS_Active);
  10680. manager.ActivateEntryByScriptTag('TutorialCounter', JS_Active);
  10681. manager.ActivateEntryByScriptTag('TutorialDialogClose', JS_Active);
  10682. manager.ActivateEntryByScriptTag('TutorialFallingRoll', JS_Active);
  10683. manager.ActivateEntryByScriptTag('TutorialFocus', JS_Active);
  10684. manager.ActivateEntryByScriptTag('TutorialFocusClues', JS_Active);
  10685. manager.ActivateEntryByScriptTag('TutorialFocusClues', JS_Active);
  10686. manager.ActivateEntryByScriptTag('TutorialHorseRoad', JS_Active);
  10687. manager.ActivateEntryByScriptTag('TutorialHorseSpeed0', JS_Active);
  10688. manager.ActivateEntryByScriptTag('TutorialHorseSpeed0_pad', JS_Active);
  10689. manager.ActivateEntryByScriptTag('TutorialHorseSpeed1', JS_Active);
  10690. manager.ActivateEntryByScriptTag('TutorialHorseSpeed2', JS_Active);
  10691. manager.ActivateEntryByScriptTag('TutorialHorseSummon', JS_Active);
  10692. manager.ActivateEntryByScriptTag('TutorialHorseSummon_pad', JS_Active);
  10693. manager.ActivateEntryByScriptTag('TutorialIgni', JS_Active);
  10694. manager.ActivateEntryByScriptTag('TutorialJournalAlternateSings', JS_Active);
  10695. manager.ActivateEntryByScriptTag('TutorialJournalBoatDamage', JS_Active);
  10696. manager.ActivateEntryByScriptTag('TutorialJournalBoatMount', JS_Active);
  10697. manager.ActivateEntryByScriptTag('TutorialJournalBuffs', JS_Active);
  10698. manager.ActivateEntryByScriptTag('TutorialJournalCharDevLeveling', JS_Active);
  10699. manager.ActivateEntryByScriptTag('TutorialJournalCharDevSkills', JS_Active);
  10700. manager.ActivateEntryByScriptTag('TutorialJournalCrafting', JS_Active);
  10701. manager.ActivateEntryByScriptTag('TutorialJournalCrossbow', JS_Active);
  10702. manager.ActivateEntryByScriptTag('TutorialJournalDialogGwint', JS_Active);
  10703. manager.ActivateEntryByScriptTag('TutorialJournalDialogShop', JS_Active);
  10704. manager.ActivateEntryByScriptTag('TutorialJournalDive', JS_Active);
  10705. manager.ActivateEntryByScriptTag('TutorialJournalDodge', JS_Active);
  10706. manager.ActivateEntryByScriptTag('TutorialJournalDodge_pad', JS_Active);
  10707. manager.ActivateEntryByScriptTag('TutorialJournalDrawWeapon', JS_Active);
  10708. manager.ActivateEntryByScriptTag('TutorialJournalDrawWeapon_pad', JS_Active);
  10709. manager.ActivateEntryByScriptTag('TutorialJournalDurability', JS_Active);
  10710. manager.ActivateEntryByScriptTag('TutorialJournalExplorations', JS_Active);
  10711. manager.ActivateEntryByScriptTag('TutorialJournalExplorations_pad', JS_Active);
  10712. manager.ActivateEntryByScriptTag('TutorialJournalFastTravel', JS_Active);
  10713. manager.ActivateEntryByScriptTag('TutorialJournalFocusRedObjects', JS_Active);
  10714. manager.ActivateEntryByScriptTag('TutorialJournalGasClouds', JS_Active);
  10715. manager.ActivateEntryByScriptTag('TutorialJournalHeavyAttacks', JS_Active);
  10716. manager.ActivateEntryByScriptTag('TutorialJournalHorse', JS_Active);
  10717. manager.ActivateEntryByScriptTag('TutorialJournalHorseStamina', JS_Active);
  10718. manager.ActivateEntryByScriptTag('TutorialJournalJump', JS_Active);
  10719. manager.ActivateEntryByScriptTag('TutorialJournalLightAttacks', JS_Active);
  10720. manager.ActivateEntryByScriptTag('TutorialJournalLightAttacks_pad', JS_Active);
  10721. manager.ActivateEntryByScriptTag('TutorialJournalMeditation', JS_Active);
  10722. manager.ActivateEntryByScriptTag('TutorialJournalMeditation_pad', JS_Active);
  10723. manager.ActivateEntryByScriptTag('TutorialJournalMonsterThreatLevels', JS_Active);
  10724. manager.ActivateEntryByScriptTag('TutorialJournalMovement', JS_Active);
  10725. manager.ActivateEntryByScriptTag('TutorialJournalMovement_pad', JS_Active);
  10726. manager.ActivateEntryByScriptTag('TutorialJournalMutagenIngredient', JS_Active);
  10727. manager.ActivateEntryByScriptTag('TutorialJournalMutagenPotion', JS_Active);
  10728. manager.ActivateEntryByScriptTag('TutorialJournalOils', JS_Active);
  10729. manager.ActivateEntryByScriptTag('TutorialJournalPetards', JS_Active);
  10730. manager.ActivateEntryByScriptTag('TutorialJournalPotions', JS_Active);
  10731. manager.ActivateEntryByScriptTag('TutorialJournalPotions_pad', JS_Active);
  10732. manager.ActivateEntryByScriptTag('TutorialJournalQuestArea', JS_Active);
  10733. manager.ActivateEntryByScriptTag('TutorialJournalRadial', JS_Active);
  10734. manager.ActivateEntryByScriptTag('TutorialJournalRifts', JS_Active);
  10735. manager.ActivateEntryByScriptTag('TutorialJournalRun', JS_Active);
  10736. manager.ActivateEntryByScriptTag('TutorialJournalShopDescription', JS_Active);
  10737. manager.ActivateEntryByScriptTag('TutorialJournalSignCast', JS_Active);
  10738. manager.ActivateEntryByScriptTag('TutorialJournalSignCast_pad', JS_Active);
  10739. manager.ActivateEntryByScriptTag('TutorialJournalSpecialAttacks', JS_Active);
  10740. manager.ActivateEntryByScriptTag('TutorialJournalStaminaExploration', JS_Active);
  10741. manager.ActivateEntryByScriptTag('TutorialJumpHang', JS_Active);
  10742. manager.ActivateEntryByScriptTag('TutorialLadder', JS_Active);
  10743. manager.ActivateEntryByScriptTag('TutorialLadderMove', JS_Active);
  10744. manager.ActivateEntryByScriptTag('TutorialLadderMove_pad', JS_Active);
  10745. manager.ActivateEntryByScriptTag('TutorialObjectiveSwitching', JS_Active);
  10746. manager.ActivateEntryByScriptTag('TutorialOxygen', JS_Active);
  10747. manager.ActivateEntryByScriptTag('TutorialParry', JS_Active);
  10748. manager.ActivateEntryByScriptTag('TutorialPOIUncovered', JS_Active);
  10749. manager.ActivateEntryByScriptTag('TutorialQuen', JS_Active);
  10750. manager.ActivateEntryByScriptTag('TutorialRoll', JS_Active);
  10751. manager.ActivateEntryByScriptTag('TutorialRoll_pad', JS_Active);
  10752. manager.ActivateEntryByScriptTag('TutorialSpeedPairing', JS_Active);
  10753. manager.ActivateEntryByScriptTag('TutorialSprint', JS_Active);
  10754. manager.ActivateEntryByScriptTag('TutorialStaminaSigns', JS_Active);
  10755. manager.ActivateEntryByScriptTag('TutorialStealing', JS_Active);
  10756. manager.ActivateEntryByScriptTag('TutorialSwimmingSpeed', JS_Active);
  10757. manager.ActivateEntryByScriptTag('TutorialTimedChoiceDialog', JS_Active);
  10758. manager.ActivateEntryByScriptTag('TutorialYrden', JS_Active);
  10759.  
  10760.  
  10761. FactsAdd('kill_base_tutorials');
  10762.  
  10763.  
  10764. theGame.GetTutorialSystem().RemoveAllQueuedTutorials();
  10765.  
  10766.  
  10767. FactsAdd('standalone_ep1');
  10768. FactsRemove("StandAloneEP1");
  10769.  
  10770. theGame.GetJournalManager().ForceUntrackingQuestForEP1Savegame();
  10771. }
  10772.  
  10773. final function Debug_FocusBoyFocusGain()
  10774. {
  10775. var focusGain : float;
  10776.  
  10777. focusGain = FactsQuerySum( "debug_fact_focus_boy" ) ;
  10778. GainStat( BCS_Focus, focusGain );
  10779. }
  10780.  
  10781. public final function StandaloneEp2_1()
  10782. {
  10783. var i, inc, quantityLow, randLow, quantityMedium, randMedium, quantityHigh, randHigh, startingMoney : int;
  10784. var pam : W3PlayerAbilityManager;
  10785. var ids : array<SItemUniqueId>;
  10786. var STARTING_LEVEL : int;
  10787.  
  10788. FactsAdd( "StandAloneEP2", 1 );
  10789.  
  10790.  
  10791. inv.RemoveAllItems();
  10792.  
  10793.  
  10794. inv.AddAnItem( 'Illusion Medallion', 1, true, true, false );
  10795. inv.AddAnItem( 'q103_safe_conduct', 1, true, true, false );
  10796.  
  10797.  
  10798. theGame.GetGamerProfile().ClearAllAchievementsForEP2();
  10799.  
  10800.  
  10801. levelManager.Hack_EP2StandaloneLevelShrink( 35 );
  10802.  
  10803.  
  10804. levelManager.ResetCharacterDev();
  10805. pam = ( W3PlayerAbilityManager )abilityManager;
  10806. if( pam )
  10807. {
  10808. pam.ResetCharacterDev();
  10809. }
  10810. levelManager.SetFreeSkillPoints( levelManager.GetLevel() - 1 + 11 );
  10811.  
  10812.  
  10813. inv.AddAnItem( 'Mutagen red', 4 );
  10814. inv.AddAnItem( 'Mutagen green', 4 );
  10815. inv.AddAnItem( 'Mutagen blue', 4 );
  10816. inv.AddAnItem( 'Lesser mutagen red', 2 );
  10817. inv.AddAnItem( 'Lesser mutagen green', 2 );
  10818. inv.AddAnItem( 'Lesser mutagen blue', 2 );
  10819. inv.AddAnItem( 'Greater mutagen red', 2 );
  10820. inv.AddAnItem( 'Greater mutagen green', 2 );
  10821. inv.AddAnItem( 'Greater mutagen blue', 2 );
  10822.  
  10823.  
  10824. startingMoney = 20000;
  10825. if( GetMoney() > startingMoney )
  10826. {
  10827. RemoveMoney( GetMoney() - startingMoney );
  10828. }
  10829. else
  10830. {
  10831. AddMoney( 20000 - GetMoney() );
  10832. }
  10833.  
  10834.  
  10835. ids.Clear();
  10836. ids = inv.AddAnItem( 'EP2 Standalone Starting Armor' );
  10837. EquipItem( ids[0] );
  10838. ids.Clear();
  10839. ids = inv.AddAnItem( 'EP2 Standalone Starting Boots' );
  10840. EquipItem( ids[0] );
  10841. ids.Clear();
  10842. ids = inv.AddAnItem( 'EP2 Standalone Starting Gloves' );
  10843. EquipItem( ids[0] );
  10844. ids.Clear();
  10845. ids = inv.AddAnItem( 'EP2 Standalone Starting Pants' );
  10846. EquipItem( ids[0] );
  10847.  
  10848.  
  10849. ids.Clear();
  10850. ids = inv.AddAnItem( 'EP2 Standalone Starting Steel Sword' );
  10851. EquipItem( ids[0] );
  10852. ids.Clear();
  10853. ids = inv.AddAnItem( 'EP2 Standalone Starting Silver Sword' );
  10854. EquipItem( ids[0] );
  10855.  
  10856.  
  10857. inv.AddAnItem( 'Torch', 1, true, true, false );
  10858.  
  10859.  
  10860. quantityLow = 1;
  10861. randLow = 3;
  10862. quantityMedium = 4;
  10863. randMedium = 4;
  10864. quantityHigh = 8;
  10865. randHigh = 6;
  10866.  
  10867. inv.AddAnItem( 'Alghoul bone marrow',quantityMedium+RandRange( randMedium ) );
  10868. inv.AddAnItem( 'Amethyst dust',quantityLow+RandRange( randLow ) );
  10869. inv.AddAnItem( 'Arachas eyes',quantityLow+RandRange( randLow ) );
  10870. inv.AddAnItem( 'Arachas venom',quantityLow+RandRange( randLow ) );
  10871. inv.AddAnItem( 'Basilisk hide',quantityLow+RandRange( randLow ) );
  10872. inv.AddAnItem( 'Basilisk venom',quantityLow+RandRange( randLow ) );
  10873. inv.AddAnItem( 'Bear pelt',quantityHigh+RandRange( randHigh ) );
  10874. inv.AddAnItem( 'Berserker pelt',quantityLow+RandRange( randLow ) );
  10875. inv.AddAnItem( 'Coal',quantityHigh+RandRange( randHigh ) );
  10876. inv.AddAnItem( 'Cotton',quantityHigh+RandRange( randHigh ) );
  10877.  
  10878.  
  10879. inv.AddAnItem( 'Deer hide',quantityHigh+RandRange( randHigh ) );
  10880. inv.AddAnItem( 'Diamond dust',quantityLow+RandRange( randLow ) );
  10881.  
  10882. inv.AddAnItem( 'Drowned dead tongue',quantityLow+RandRange( randLow ) );
  10883. inv.AddAnItem( 'Drowner brain',quantityMedium+RandRange( randMedium ) );
  10884.  
  10885.  
  10886.  
  10887. inv.AddAnItem( 'Endriag chitin plates',quantityMedium+RandRange( randMedium ) );
  10888. inv.AddAnItem( 'Endriag embryo',quantityLow+RandRange( randLow ) );
  10889. inv.AddAnItem( 'Ghoul blood',quantityMedium+RandRange( randMedium ) );
  10890. inv.AddAnItem( 'Goat hide',quantityMedium+RandRange( randMedium ) );
  10891. inv.AddAnItem( 'Hag teeth',quantityMedium+RandRange( randMedium ) );
  10892. inv.AddAnItem( 'Hardened leather',quantityMedium+RandRange( randMedium ) );
  10893. inv.AddAnItem( 'Hardened timber',quantityMedium+RandRange( randMedium ) );
  10894. inv.AddAnItem( 'Harpy feathers',quantityMedium+RandRange( randMedium ) );
  10895. inv.AddAnItem( 'Horse hide',quantityLow+RandRange( randLow ) );
  10896.  
  10897.  
  10898.  
  10899.  
  10900.  
  10901.  
  10902. inv.AddAnItem( 'Necrophage skin',quantityLow+RandRange( randLow ) );
  10903. inv.AddAnItem( 'Nekker blood',quantityHigh+RandRange( randHigh ) );
  10904. inv.AddAnItem( 'Nekker heart',quantityMedium+RandRange( randMedium ) );
  10905.  
  10906. inv.AddAnItem( 'Phosphorescent crystal',quantityLow+RandRange( randLow ) );
  10907. inv.AddAnItem( 'Pig hide',quantityMedium+RandRange( randMedium ) );
  10908.  
  10909. inv.AddAnItem( 'Rabbit pelt',quantityMedium+RandRange( randMedium ) );
  10910. inv.AddAnItem( 'Rotfiend blood',quantityMedium+RandRange( randMedium ) );
  10911. inv.AddAnItem( 'Sapphire dust',quantityLow+RandRange( randLow ) );
  10912.  
  10913.  
  10914.  
  10915. inv.AddAnItem( 'Specter dust',quantityMedium+RandRange( randMedium ) );
  10916.  
  10917.  
  10918.  
  10919.  
  10920.  
  10921.  
  10922.  
  10923. inv.AddAnItem( 'Water essence',quantityMedium+RandRange( randMedium ) );
  10924. inv.AddAnItem( 'Wolf liver',quantityHigh+RandRange( randHigh ) );
  10925. inv.AddAnItem( 'Wolf pelt',quantityMedium+RandRange( randMedium ) );
  10926.  
  10927. inv.AddAnItem( 'Alcohest', 5 );
  10928. inv.AddAnItem( 'Dwarven spirit', 5 );
  10929.  
  10930.  
  10931. ids.Clear();
  10932. ids = inv.AddAnItem( 'Crossbow 5' );
  10933. EquipItem( ids[0] );
  10934. ids.Clear();
  10935. ids = inv.AddAnItem( 'Blunt Bolt', 100 );
  10936. EquipItem( ids[0] );
  10937. inv.AddAnItem( 'Broadhead Bolt', 100 );
  10938. inv.AddAnItem( 'Split Bolt', 100 );
  10939.  
  10940.  
  10941. RemoveAllAlchemyRecipes();
  10942. RemoveAllCraftingSchematics();
  10943.  
  10944.  
  10945.  
  10946.  
  10947.  
  10948.  
  10949.  
  10950.  
  10951.  
  10952. AddAlchemyRecipe( 'Recipe for Petris Philtre 2' );
  10953. AddAlchemyRecipe( 'Recipe for Swallow 1' );
  10954. AddAlchemyRecipe( 'Recipe for Tawny Owl 1' );
  10955.  
  10956. AddAlchemyRecipe( 'Recipe for White Gull 1' );
  10957.  
  10958.  
  10959.  
  10960.  
  10961.  
  10962. AddAlchemyRecipe( 'Recipe for Beast Oil 1' );
  10963. AddAlchemyRecipe( 'Recipe for Cursed Oil 1' );
  10964. AddAlchemyRecipe( 'Recipe for Hanged Man Venom 1' );
  10965. AddAlchemyRecipe( 'Recipe for Hybrid Oil 1' );
  10966. AddAlchemyRecipe( 'Recipe for Insectoid Oil 2' );
  10967. AddAlchemyRecipe( 'Recipe for Magicals Oil 1' );
  10968. AddAlchemyRecipe( 'Recipe for Necrophage Oil 1' );
  10969. AddAlchemyRecipe( 'Recipe for Specter Oil 1' );
  10970. AddAlchemyRecipe( 'Recipe for Vampire Oil 2' );
  10971. AddAlchemyRecipe( 'Recipe for Draconide Oil 2' );
  10972. AddAlchemyRecipe( 'Recipe for Ogre Oil 1' );
  10973. AddAlchemyRecipe( 'Recipe for Relic Oil 1' );
  10974. AddAlchemyRecipe( 'Recipe for Beast Oil 2' );
  10975. AddAlchemyRecipe( 'Recipe for Cursed Oil 2' );
  10976. AddAlchemyRecipe( 'Recipe for Hanged Man Venom 2' );
  10977. AddAlchemyRecipe( 'Recipe for Hybrid Oil 2' );
  10978. AddAlchemyRecipe( 'Recipe for Insectoid Oil 2' );
  10979. AddAlchemyRecipe( 'Recipe for Magicals Oil 2' );
  10980. AddAlchemyRecipe( 'Recipe for Necrophage Oil 2' );
  10981. AddAlchemyRecipe( 'Recipe for Specter Oil 2' );
  10982. AddAlchemyRecipe( 'Recipe for Vampire Oil 2' );
  10983. AddAlchemyRecipe( 'Recipe for Draconide Oil 2' );
  10984. AddAlchemyRecipe( 'Recipe for Ogre Oil 2' );
  10985. AddAlchemyRecipe( 'Recipe for Relic Oil 2' );
  10986.  
  10987.  
  10988. AddAlchemyRecipe( 'Recipe for Dancing Star 1' );
  10989.  
  10990. AddAlchemyRecipe( 'Recipe for Dwimeritum Bomb 1' );
  10991.  
  10992. AddAlchemyRecipe( 'Recipe for Grapeshot 1' );
  10993. AddAlchemyRecipe( 'Recipe for Samum 1' );
  10994.  
  10995. AddAlchemyRecipe( 'Recipe for White Frost 1' );
  10996.  
  10997.  
  10998.  
  10999. AddAlchemyRecipe( 'Recipe for Dwarven spirit 1' );
  11000. AddAlchemyRecipe( 'Recipe for Alcohest 1' );
  11001. AddAlchemyRecipe( 'Recipe for White Gull 1' );
  11002.  
  11003.  
  11004. AddStartingSchematics();
  11005.  
  11006.  
  11007. ids.Clear();
  11008. ids = inv.AddAnItem( 'Swallow 2' );
  11009. EquipItem( ids[0] );
  11010. ids.Clear();
  11011. ids = inv.AddAnItem( 'Thunderbolt 2' );
  11012. EquipItem( ids[0] );
  11013. ids.Clear();
  11014. ids = inv.AddAnItem( 'Tawny Owl 2' );
  11015. EquipItem( ids[0] );
  11016. ids.Clear();
  11017.  
  11018. ids = inv.AddAnItem( 'Grapeshot 2' );
  11019. EquipItem( ids[0] );
  11020. ids.Clear();
  11021. ids = inv.AddAnItem( 'Samum 2' );
  11022. EquipItem( ids[0] );
  11023.  
  11024. inv.AddAnItem( 'Dwimeritum Bomb 1' );
  11025. inv.AddAnItem( 'Dragons Dream 1' );
  11026. inv.AddAnItem( 'Silver Dust Bomb 1' );
  11027. inv.AddAnItem( 'White Frost 2' );
  11028. inv.AddAnItem( 'Devils Puffball 2' );
  11029. inv.AddAnItem( 'Dancing Star 2' );
  11030. inv.AddAnItem( 'Beast Oil 1' );
  11031. inv.AddAnItem( 'Cursed Oil 1' );
  11032. inv.AddAnItem( 'Hanged Man Venom 2' );
  11033. inv.AddAnItem( 'Hybrid Oil 2' );
  11034. inv.AddAnItem( 'Insectoid Oil 2' );
  11035. inv.AddAnItem( 'Magicals Oil 1' );
  11036. inv.AddAnItem( 'Necrophage Oil 2' );
  11037. inv.AddAnItem( 'Ogre Oil 1' );
  11038. inv.AddAnItem( 'Specter Oil 1' );
  11039. inv.AddAnItem( 'Vampire Oil 2' );
  11040. inv.AddAnItem( 'Draconide Oil 2' );
  11041. inv.AddAnItem( 'Relic Oil 1' );
  11042. inv.AddAnItem( 'Black Blood 1' );
  11043. inv.AddAnItem( 'Blizzard 1' );
  11044. inv.AddAnItem( 'Cat 2' );
  11045. inv.AddAnItem( 'Full Moon 1' );
  11046. inv.AddAnItem( 'Golden Oriole 1' );
  11047. inv.AddAnItem( 'Killer Whale 1' );
  11048. inv.AddAnItem( 'Maribor Forest 1' );
  11049. inv.AddAnItem( 'Petris Philtre 2' );
  11050. inv.AddAnItem( 'White Gull 1', 3 );
  11051. inv.AddAnItem( 'White Honey 2' );
  11052. inv.AddAnItem( 'White Raffards Decoction 1' );
  11053.  
  11054.  
  11055. inv.AddAnItem( 'Mutagen 17' );
  11056. inv.AddAnItem( 'Mutagen 19' );
  11057. inv.AddAnItem( 'Mutagen 27' );
  11058. inv.AddAnItem( 'Mutagen 26' );
  11059.  
  11060.  
  11061. inv.AddAnItem( 'weapon_repair_kit_1', 5 );
  11062. inv.AddAnItem( 'weapon_repair_kit_2', 3 );
  11063. inv.AddAnItem( 'armor_repair_kit_1', 5 );
  11064. inv.AddAnItem( 'armor_repair_kit_2', 3 );
  11065.  
  11066.  
  11067. quantityMedium = 2;
  11068. quantityLow = 1;
  11069. inv.AddAnItem( 'Rune stribog lesser', quantityMedium );
  11070. inv.AddAnItem( 'Rune stribog', quantityLow );
  11071. inv.AddAnItem( 'Rune dazhbog lesser', quantityMedium );
  11072. inv.AddAnItem( 'Rune dazhbog', quantityLow );
  11073. inv.AddAnItem( 'Rune devana lesser', quantityMedium );
  11074. inv.AddAnItem( 'Rune devana', quantityLow );
  11075. inv.AddAnItem( 'Rune zoria lesser', quantityMedium );
  11076. inv.AddAnItem( 'Rune zoria', quantityLow );
  11077. inv.AddAnItem( 'Rune morana lesser', quantityMedium );
  11078. inv.AddAnItem( 'Rune morana', quantityLow );
  11079. inv.AddAnItem( 'Rune triglav lesser', quantityMedium );
  11080. inv.AddAnItem( 'Rune triglav', quantityLow );
  11081. inv.AddAnItem( 'Rune svarog lesser', quantityMedium );
  11082. inv.AddAnItem( 'Rune svarog', quantityLow );
  11083. inv.AddAnItem( 'Rune veles lesser', quantityMedium );
  11084. inv.AddAnItem( 'Rune veles', quantityLow );
  11085. inv.AddAnItem( 'Rune perun lesser', quantityMedium );
  11086. inv.AddAnItem( 'Rune perun', quantityLow );
  11087. inv.AddAnItem( 'Rune elemental lesser', quantityMedium );
  11088. inv.AddAnItem( 'Rune elemental', quantityLow );
  11089.  
  11090. inv.AddAnItem( 'Glyph aard lesser', quantityMedium );
  11091. inv.AddAnItem( 'Glyph aard', quantityLow );
  11092. inv.AddAnItem( 'Glyph axii lesser', quantityMedium );
  11093. inv.AddAnItem( 'Glyph axii', quantityLow );
  11094. inv.AddAnItem( 'Glyph igni lesser', quantityMedium );
  11095. inv.AddAnItem( 'Glyph igni', quantityLow );
  11096. inv.AddAnItem( 'Glyph quen lesser', quantityMedium );
  11097. inv.AddAnItem( 'Glyph quen', quantityLow );
  11098. inv.AddAnItem( 'Glyph yrden lesser', quantityMedium );
  11099. inv.AddAnItem( 'Glyph yrden', quantityLow );
  11100.  
  11101.  
  11102. StandaloneEp2_2();
  11103. }
  11104.  
  11105. public final function StandaloneEp2_2()
  11106. {
  11107. var horseId : SItemUniqueId;
  11108. var ids : array<SItemUniqueId>;
  11109. var ents : array< CJournalBase >;
  11110. var i : int;
  11111. var manager : CWitcherJournalManager;
  11112.  
  11113.  
  11114. inv.AddAnItem( 'Cows milk', 20 );
  11115. ids.Clear();
  11116. ids = inv.AddAnItem( 'Dumpling', 44 );
  11117. EquipItem( ids[0] );
  11118.  
  11119.  
  11120. inv.AddAnItem( 'Clearing Potion', 2, true, false, false );
  11121.  
  11122.  
  11123. GetHorseManager().RemoveAllItems();
  11124.  
  11125. ids.Clear();
  11126. ids = inv.AddAnItem( 'Horse Bag 2' );
  11127. horseId = GetHorseManager( ).MoveItemToHorse( ids[0] );
  11128. GetHorseManager().EquipItem( horseId );
  11129.  
  11130. ids.Clear();
  11131. ids = inv.AddAnItem( 'Horse Blinder 2' );
  11132. horseId = GetHorseManager().MoveItemToHorse( ids[0] );
  11133. GetHorseManager().EquipItem( horseId );
  11134.  
  11135. ids.Clear();
  11136. ids = inv.AddAnItem( 'Horse Saddle 2' );
  11137. horseId = GetHorseManager().MoveItemToHorse( ids[0] );
  11138. GetHorseManager().EquipItem( horseId );
  11139.  
  11140. manager = theGame.GetJournalManager();
  11141.  
  11142.  
  11143. manager.GetActivatedOfType( 'CJournalCreature', ents );
  11144. for(i=0; i<ents.Size(); i+=1)
  11145. {
  11146. manager.ActivateEntry( ents[i], JS_Inactive, false, true );
  11147. }
  11148.  
  11149.  
  11150. ents.Clear();
  11151. manager.GetActivatedOfType( 'CJournalCharacter', ents );
  11152. for(i=0; i<ents.Size(); i+=1)
  11153. {
  11154. manager.ActivateEntry( ents[i], JS_Inactive, false, true );
  11155. }
  11156.  
  11157.  
  11158. ents.Clear();
  11159. manager.GetActivatedOfType( 'CJournalQuest', ents );
  11160. for(i=0; i<ents.Size(); i+=1)
  11161. {
  11162.  
  11163. if( StrStartsWith( ents[i].baseName, "q60" ) )
  11164. continue;
  11165.  
  11166. manager.ActivateEntry( ents[i], JS_Inactive, false, true );
  11167. }
  11168.  
  11169.  
  11170. manager.ActivateEntryByScriptTag( 'TutorialAard', JS_Active );
  11171. manager.ActivateEntryByScriptTag( 'TutorialAdrenaline', JS_Active );
  11172. manager.ActivateEntryByScriptTag( 'TutorialAxii', JS_Active );
  11173. manager.ActivateEntryByScriptTag( 'TutorialAxiiDialog', JS_Active );
  11174. manager.ActivateEntryByScriptTag( 'TutorialCamera', JS_Active );
  11175. manager.ActivateEntryByScriptTag( 'TutorialCamera_pad', JS_Active );
  11176. manager.ActivateEntryByScriptTag( 'TutorialCiriBlink', JS_Active );
  11177. manager.ActivateEntryByScriptTag( 'TutorialCiriCharge', JS_Active );
  11178. manager.ActivateEntryByScriptTag( 'TutorialCiriStamina', JS_Active );
  11179. manager.ActivateEntryByScriptTag( 'TutorialCounter', JS_Active );
  11180. manager.ActivateEntryByScriptTag( 'TutorialDialogClose', JS_Active );
  11181. manager.ActivateEntryByScriptTag( 'TutorialFallingRoll', JS_Active );
  11182. manager.ActivateEntryByScriptTag( 'TutorialFocus', JS_Active );
  11183. manager.ActivateEntryByScriptTag( 'TutorialFocusClues', JS_Active );
  11184. manager.ActivateEntryByScriptTag( 'TutorialFocusClues', JS_Active );
  11185. manager.ActivateEntryByScriptTag( 'TutorialHorseRoad', JS_Active );
  11186. manager.ActivateEntryByScriptTag( 'TutorialHorseSpeed0', JS_Active );
  11187. manager.ActivateEntryByScriptTag( 'TutorialHorseSpeed0_pad', JS_Active );
  11188. manager.ActivateEntryByScriptTag( 'TutorialHorseSpeed1', JS_Active );
  11189. manager.ActivateEntryByScriptTag( 'TutorialHorseSpeed2', JS_Active );
  11190. manager.ActivateEntryByScriptTag( 'TutorialHorseSummon', JS_Active );
  11191. manager.ActivateEntryByScriptTag( 'TutorialHorseSummon_pad', JS_Active );
  11192. manager.ActivateEntryByScriptTag( 'TutorialIgni', JS_Active );
  11193. manager.ActivateEntryByScriptTag( 'TutorialJournalAlternateSings', JS_Active );
  11194. manager.ActivateEntryByScriptTag( 'TutorialJournalBoatDamage', JS_Active );
  11195. manager.ActivateEntryByScriptTag( 'TutorialJournalBoatMount', JS_Active );
  11196. manager.ActivateEntryByScriptTag( 'TutorialJournalBuffs', JS_Active );
  11197. manager.ActivateEntryByScriptTag( 'TutorialJournalCharDevLeveling', JS_Active );
  11198. manager.ActivateEntryByScriptTag( 'TutorialJournalCharDevSkills', JS_Active );
  11199. manager.ActivateEntryByScriptTag( 'TutorialJournalCrafting', JS_Active );
  11200. manager.ActivateEntryByScriptTag( 'TutorialJournalCrossbow', JS_Active );
  11201. manager.ActivateEntryByScriptTag( 'TutorialJournalDialogGwint', JS_Active );
  11202. manager.ActivateEntryByScriptTag( 'TutorialJournalDialogShop', JS_Active );
  11203. manager.ActivateEntryByScriptTag( 'TutorialJournalDive', JS_Active );
  11204. manager.ActivateEntryByScriptTag( 'TutorialJournalDodge', JS_Active );
  11205. manager.ActivateEntryByScriptTag( 'TutorialJournalDodge_pad', JS_Active );
  11206. manager.ActivateEntryByScriptTag( 'TutorialJournalDrawWeapon', JS_Active );
  11207. manager.ActivateEntryByScriptTag( 'TutorialJournalDrawWeapon_pad', JS_Active );
  11208. manager.ActivateEntryByScriptTag( 'TutorialJournalDurability', JS_Active );
  11209. manager.ActivateEntryByScriptTag( 'TutorialJournalExplorations', JS_Active );
  11210. manager.ActivateEntryByScriptTag( 'TutorialJournalExplorations_pad', JS_Active );
  11211. manager.ActivateEntryByScriptTag( 'TutorialJournalFastTravel', JS_Active );
  11212. manager.ActivateEntryByScriptTag( 'TutorialJournalFocusRedObjects', JS_Active );
  11213. manager.ActivateEntryByScriptTag( 'TutorialJournalGasClouds', JS_Active );
  11214. manager.ActivateEntryByScriptTag( 'TutorialJournalHeavyAttacks', JS_Active );
  11215. manager.ActivateEntryByScriptTag( 'TutorialJournalHorse', JS_Active );
  11216. manager.ActivateEntryByScriptTag( 'TutorialJournalHorseStamina', JS_Active );
  11217. manager.ActivateEntryByScriptTag( 'TutorialJournalJump', JS_Active );
  11218. manager.ActivateEntryByScriptTag( 'TutorialJournalLightAttacks', JS_Active );
  11219. manager.ActivateEntryByScriptTag( 'TutorialJournalLightAttacks_pad', JS_Active );
  11220. manager.ActivateEntryByScriptTag( 'TutorialJournalMeditation', JS_Active );
  11221. manager.ActivateEntryByScriptTag( 'TutorialJournalMeditation_pad', JS_Active );
  11222. manager.ActivateEntryByScriptTag( 'TutorialJournalMonsterThreatLevels', JS_Active );
  11223. manager.ActivateEntryByScriptTag( 'TutorialJournalMovement', JS_Active );
  11224. manager.ActivateEntryByScriptTag( 'TutorialJournalMovement_pad', JS_Active );
  11225. manager.ActivateEntryByScriptTag( 'TutorialJournalMutagenIngredient', JS_Active );
  11226. manager.ActivateEntryByScriptTag( 'TutorialJournalMutagenPotion', JS_Active );
  11227. manager.ActivateEntryByScriptTag( 'TutorialJournalOils', JS_Active );
  11228. manager.ActivateEntryByScriptTag( 'TutorialJournalPetards', JS_Active );
  11229. manager.ActivateEntryByScriptTag( 'TutorialJournalPotions', JS_Active );
  11230. manager.ActivateEntryByScriptTag( 'TutorialJournalPotions_pad', JS_Active );
  11231. manager.ActivateEntryByScriptTag( 'TutorialJournalQuestArea', JS_Active );
  11232. manager.ActivateEntryByScriptTag( 'TutorialJournalRadial', JS_Active );
  11233. manager.ActivateEntryByScriptTag( 'TutorialJournalRifts', JS_Active );
  11234. manager.ActivateEntryByScriptTag( 'TutorialJournalRun', JS_Active );
  11235. manager.ActivateEntryByScriptTag( 'TutorialJournalShopDescription', JS_Active );
  11236. manager.ActivateEntryByScriptTag( 'TutorialJournalSignCast', JS_Active );
  11237. manager.ActivateEntryByScriptTag( 'TutorialJournalSignCast_pad', JS_Active );
  11238. manager.ActivateEntryByScriptTag( 'TutorialJournalSpecialAttacks', JS_Active );
  11239. manager.ActivateEntryByScriptTag( 'TutorialJournalStaminaExploration', JS_Active );
  11240. manager.ActivateEntryByScriptTag( 'TutorialJumpHang', JS_Active );
  11241. manager.ActivateEntryByScriptTag( 'TutorialLadder', JS_Active );
  11242. manager.ActivateEntryByScriptTag( 'TutorialLadderMove', JS_Active );
  11243. manager.ActivateEntryByScriptTag( 'TutorialLadderMove_pad', JS_Active );
  11244. manager.ActivateEntryByScriptTag( 'TutorialObjectiveSwitching', JS_Active );
  11245. manager.ActivateEntryByScriptTag( 'TutorialOxygen', JS_Active );
  11246. manager.ActivateEntryByScriptTag( 'TutorialParry', JS_Active );
  11247. manager.ActivateEntryByScriptTag( 'TutorialPOIUncovered', JS_Active );
  11248. manager.ActivateEntryByScriptTag( 'TutorialQuen', JS_Active );
  11249. manager.ActivateEntryByScriptTag( 'TutorialRoll', JS_Active );
  11250. manager.ActivateEntryByScriptTag( 'TutorialRoll_pad', JS_Active );
  11251. manager.ActivateEntryByScriptTag( 'TutorialSpeedPairing', JS_Active );
  11252. manager.ActivateEntryByScriptTag( 'TutorialSprint', JS_Active );
  11253. manager.ActivateEntryByScriptTag( 'TutorialStaminaSigns', JS_Active );
  11254. manager.ActivateEntryByScriptTag( 'TutorialStealing', JS_Active );
  11255. manager.ActivateEntryByScriptTag( 'TutorialSwimmingSpeed', JS_Active );
  11256. manager.ActivateEntryByScriptTag( 'TutorialTimedChoiceDialog', JS_Active );
  11257. manager.ActivateEntryByScriptTag( 'TutorialYrden', JS_Active );
  11258.  
  11259. inv.AddAnItem( 'Geralt Shirt', 1 );
  11260. inv.AddAnItem( 'Thread', 13 );
  11261. inv.AddAnItem( 'String', 9 );
  11262. inv.AddAnItem( 'Linen', 4 );
  11263. inv.AddAnItem( 'Silk', 6 );
  11264. inv.AddAnItem( 'Nigredo', 3 );
  11265. inv.AddAnItem( 'Albedo', 1 );
  11266. inv.AddAnItem( 'Rubedo', 1 );
  11267. inv.AddAnItem( 'Rebis', 1 );
  11268. inv.AddAnItem( 'Dog tallow', 4 );
  11269. inv.AddAnItem( 'Lunar shards', 3 );
  11270. inv.AddAnItem( 'Quicksilver solution', 5 );
  11271. inv.AddAnItem( 'Aether', 1 );
  11272. inv.AddAnItem( 'Optima mater', 3 );
  11273. inv.AddAnItem( 'Fifth essence', 2 );
  11274. inv.AddAnItem( 'Hardened timber', 6 );
  11275. inv.AddAnItem( 'Fur square', 1 );
  11276. inv.AddAnItem( 'Leather straps', 11 );
  11277. inv.AddAnItem( 'Leather squares', 6 );
  11278. inv.AddAnItem( 'Leather', 3 );
  11279. inv.AddAnItem( 'Hardened leather', 14 );
  11280. inv.AddAnItem( 'Chitin scale', 8 );
  11281. inv.AddAnItem( 'Draconide leather', 5 );
  11282. inv.AddAnItem( 'Infused draconide leather', 0 );
  11283. inv.AddAnItem( 'Steel ingot', 5 );
  11284. inv.AddAnItem( 'Dark iron ore', 2 );
  11285. inv.AddAnItem( 'Dark iron ingot', 3 );
  11286. inv.AddAnItem( 'Dark iron plate', 1 );
  11287. inv.AddAnItem( 'Dark steel ingot', 10 );
  11288. inv.AddAnItem( 'Dark steel plate', 6 );
  11289. inv.AddAnItem( 'Silver ore', 2 );
  11290. inv.AddAnItem( 'Silver ingot', 6 );
  11291. inv.AddAnItem( 'Meteorite ore', 3 );
  11292. inv.AddAnItem( 'Meteorite ingot', 3 );
  11293. inv.AddAnItem( 'Meteorite plate', 2 );
  11294. inv.AddAnItem( 'Meteorite silver ingot', 6 );
  11295. inv.AddAnItem( 'Meteorite silver plate', 5 );
  11296. inv.AddAnItem( 'Orichalcum ingot', 0 );
  11297. inv.AddAnItem( 'Orichalcum plate', 1 );
  11298. inv.AddAnItem( 'Dwimeryte ingot', 6 );
  11299. inv.AddAnItem( 'Dwimeryte plate', 5 );
  11300. inv.AddAnItem( 'Dwimeryte enriched ingot', 0 );
  11301. inv.AddAnItem( 'Dwimeryte enriched plate', 0 );
  11302. inv.AddAnItem( 'Emerald dust', 0 );
  11303. inv.AddAnItem( 'Ruby dust', 4 );
  11304. inv.AddAnItem( 'Ruby', 2 );
  11305. inv.AddAnItem( 'Ruby flawless', 1 );
  11306. inv.AddAnItem( 'Sapphire dust', 0 );
  11307. inv.AddAnItem( 'Sapphire', 0 );
  11308. inv.AddAnItem( 'Monstrous brain', 8 );
  11309. inv.AddAnItem( 'Monstrous blood', 14 );
  11310. inv.AddAnItem( 'Monstrous bone', 9 );
  11311. inv.AddAnItem( 'Monstrous claw', 14 );
  11312. inv.AddAnItem( 'Monstrous dust', 9 );
  11313. inv.AddAnItem( 'Monstrous ear', 5 );
  11314. inv.AddAnItem( 'Monstrous egg', 1 );
  11315. inv.AddAnItem( 'Monstrous eye', 10 );
  11316. inv.AddAnItem( 'Monstrous essence', 7 );
  11317. inv.AddAnItem( 'Monstrous feather', 8 );
  11318. inv.AddAnItem( 'Monstrous hair', 12 );
  11319. inv.AddAnItem( 'Monstrous heart', 7 );
  11320. inv.AddAnItem( 'Monstrous hide', 4 );
  11321. inv.AddAnItem( 'Monstrous liver', 5 );
  11322. inv.AddAnItem( 'Monstrous plate', 1 );
  11323. inv.AddAnItem( 'Monstrous saliva', 6 );
  11324. inv.AddAnItem( 'Monstrous stomach', 3 );
  11325. inv.AddAnItem( 'Monstrous tongue', 5 );
  11326. inv.AddAnItem( 'Monstrous tooth', 9 );
  11327. inv.AddAnItem( 'Venom extract', 0 );
  11328. inv.AddAnItem( 'Siren vocal cords', 1 );
  11329.  
  11330.  
  11331. SelectQuickslotItem( EES_RangedWeapon );
  11332.  
  11333.  
  11334. FactsAdd( 'kill_base_tutorials' );
  11335.  
  11336.  
  11337. theGame.GetTutorialSystem().RemoveAllQueuedTutorials();
  11338.  
  11339.  
  11340. FactsAdd( 'standalone_ep2' );
  11341. FactsRemove( "StandAloneEP2" );
  11342.  
  11343. theGame.GetJournalManager().ForceUntrackingQuestForEP1Savegame();
  11344. }
  11345.  
  11346. //zur13 modSSS
  11347. public function SSS_GetEquippedMutationType() : array< EPlayerMutationType >
  11348. {
  11349. return ( ( W3PlayerAbilityManager ) abilityManager ).SSS_GetEquippedMutationType();
  11350. }
  11351.  
  11352. //zur13 modSSS mutTabs
  11353. public function SSS_FixEquippedMutagens()
  11354. {
  11355. var item : SItemUniqueId;
  11356. var i : int;
  11357. for( i = EES_SkillMutagen5 ; i < EES_SkillMutagen48; i=i+1 )
  11358. {
  11359. if( GetItemEquippedOnSlot( i, item ) )
  11360. {
  11361. inv.SetItemStackable( item, false );
  11362. }
  11363. }
  11364. }
  11365.  
  11366. //zur13 modSSS mutTabs
  11367. public function SSS_Patch_MutagenStacking(muts : array< SItemUniqueId >) : array< SItemUniqueId >
  11368. {
  11369. var i, j, quantity : int;
  11370. var item : SItemUniqueId;
  11371.  
  11372. for( i = EES_SkillMutagen5 ; i < EES_SkillMutagen48; i=i+1 )
  11373. {
  11374. if( GetItemEquippedOnSlot( i, item ) )
  11375. {
  11376. muts.Remove( item );
  11377. inv.SetItemStackable( item, false );
  11378. }
  11379. }
  11380. return muts;
  11381. }
  11382.  
  11383. exec function fuqfep1()
  11384. {
  11385. theGame.GetJournalManager().ForceUntrackingQuestForEP1Savegame();
  11386. }
  11387.  
  11388.  
  11389.  
  11390.  
  11391.  
  11392. function GetWitcherPlayer() : W3PlayerWitcher
  11393. {
  11394. return (W3PlayerWitcher)thePlayer;
  11395. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement