soin160594 Posted July 31 Share Posted July 31 Hi everyone, There is 5 spells that i want to edit: Heal, Rejuvenate, Regeneration, Mass Rejuvenation and Spellbloom. I would like to make them stronger, i know how to change their cooldown but i'm trying to change their duration and how strong they are. For example Spellbloom +10 stamina/mana regen 30sec ; Mass Rejuvenation +10 Health regen 20sec ; Rejuvenate +5 stamina/mana regen 20sec ; Regeneration +5 Health regen 20sec ; make Heal much stronger (in the wiki for heal it said "100% healing to the target is achieved when the caster has 150 Spellpower", is it possible to be abe to 100% by having 100 spellpower instead of 150 ?) how could i edit those spell that way ? Link to comment Share on other sites More sharing options...
Pasquale1223 Posted August 3 Share Posted August 3 Hello, and welcome. I have no idea where you're at in familiarizing yourself with the toolset, but I would recommend that you take a look at the toolset wiki, as it has a lot of helpful information. I would strongly suggest that you create a mod within the toolset and make your modifications only within that mod instead of changing vanilla code. Quote (in the wiki for heal it said "100% healing to the target is achieved when the caster has 150 Spellpower", is it possible to be abe to 100% by having 100 spellpower instead of 150 ?) That is in keeping with the formula presented in the wiki: Healing (%): (100 + Spellpower) × 0.4. At a spellpower of 150, you would have: (100 + 150) x 0.4, which is 100. The source code is spell_singletarget.nss, and you'll find it under the appropriately named case. To make the change you desire, you would create a copy of that file within your mod. The source line of interest is this: float fHeal = (100.0f + GetCreatureSpellPower(stEvent.oCaster)) * HEAL_HEALTH_FRACTION; I'm going to point out the constant named HEAL_HEALTH_FRACTION, and you can see where it is defined by selecting it, right clicking, selecting go to definition - and you will see that it is defined to be 0.4 in spell_constants_h, a header file that is included when spell_singletarget.nss is compiled. There's more than one way to change the line that would accomplish your stated objective, like so: float fHeal = (150.0f + GetCreatureSpellPower(stEvent.oCaster)) * HEAL_HEALTH_FRACTION; or float fHeal = (100.0f + GetCreatureSpellPower(stEvent.oCaster)) * 0.5f; Note that in the first line, I changed 100.0f to 150.0f and in the second I replaced the constant HEAL_HEALTH_FRACTION with a hard-coded 0.5f. As a general rule, I don't really recommend changing vanilla header files (even if you would copy it to your mod) because header files are typically included by multiple other source files and any change to a single header file can mean that quite a few other source files need to be recompiled. To demonstrate, open (read only) that header file (spell_constants_h), right-click on its tab, select Properties -> Referenced By, and you'll see a list of all of the source files that use it. Once you've made your code changes, you would need to compile. Hope that helps - have fun. Link to comment Share on other sites More sharing options...
soin160594 Posted August 5 Author Share Posted August 5 So this the way for the spell Heal but what about the other ? And whats the script spell_constants_h is for ? I saw all the heal spell i listed on it, can i make the change there ? Link to comment Share on other sites More sharing options...
Pasquale1223 Posted August 6 Share Posted August 6 5 hours ago, soin160594 said: So this the way for the spell Heal but what about the other ? What about them? I pointed you at spell_singletarget.nss, which includes not only Heal, but also Rejuvenate (ABILITY_SPELL_CURE), Regeneration, and Mass Rejuvenation (ABILITY_SPELL_PURIFY). And if you look in spell_aoe_duration.nss, you might find Spellbloom. It's in the same place as the other spell file. I tracked them down by looking at the ABI_base.xls file and finding the ID for each of the spells (example: MASS_REJUVINATE (sic) is 10207, and then cross-referenced that number in the 2da_constants_h.nss file in the toolset and found the constant with that value is named ABILITY_SPELL_PURIFY, so that's the case to look for in the spell ability files). The *.xls files should be on your game install directory (though it may depend on how you installed the toolset), up a directory level from bin_ship, under tools -> Source -> 2DA. Quote And whats the script spell_constants_h is for ? I saw all the heal spell i listed on it, can i make the change there ? It isn't a script, it's a header file as I mentioned before. Files that end in _h are "header" files, sometimes called "include" files and are not complete scripts on their own. They are intended to be "included" by other files, actual scripts, when they are compiled to become executables. If you looked at the particular file you are asking about, you would see that it is filled with definitions for constants. That's it. That's all it does. It provides values for constants. Some header files provide various utility functions or routines needed by other scripts. If you want to learn more about constants, you might want to go through some basic coding tutorials. As to whether you can make the change there - I already advised you not to, explained the reason, and told you how to see for yourself all the other files that include that header file, and would thus need to be recompiled (exported in toolset terms) if you change it. I also gave you the exact changes you could make to accomplish what you said you wanted to do while limiting the impact to a single file. Link to comment Share on other sites More sharing options...
soin160594 Posted August 6 Author Share Posted August 6 Ok, thank you so much for those information, i will try to do it myself Link to comment Share on other sites More sharing options...
Recommended Posts