Jump to content

How do I increase the damage for each sword that has a certain tag?


Recommended Posts

So I am a trying to make a mod for The Witcher 3 for the first time and basically what I want to do is to increase the base dmg of all swords with the tag "Aerondight" (obviously the mod is for the Aerondight sword but if you play NG+ you can have multiple Aerondights) that are currently in Geralt's inventory. Basically auto leveling the Aerondight so you no longer have to manually level it.

 

How would I go about doing this? Basically, in psuedo code it should be something like this:

 

  1. When Geralt levels up, find all the items with the tag 'Aerondight'
  2. Loop through each item that is found
  3. For each item, increase base dmg by 10

I know how to do it in theory but not in practice since there is no documentation anywhere for The Witcher 3 scripts. I have however found an event called "OnLevelGained" in "playerWitcher.ws" and have also found a function in "levelManager.ws" called "GainLevel" and I intended to add my code to either of these events/functions. Which is better out of these two and if there is an even better way to do it please tell me.

 

The only problem I see, which I have not figured out a fix for yet, is that if a player uses a console command to level up several levels at a time (or somehow manages to level up twice instantly) the Aerondight sword will only add 10 base damage instead of "increasedLevels*10" times... or at least I think it will.

 

Any help is appreciated. Thanks!

Edited by Schytheron
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...