Aller au contenu

Photo

Modifying an Ability's damage


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
FergusM

FergusM
  • Members
  • 460 messages
Oh dear. I was rather hoping I could do this by just editing 2DAs.

I'm trying to edit an ability (specifically, the Ogre's hurl, 90061) to do less damage. So, it turns out that the damage is controlled by a spell script, monster_aoe_instant. A line in there clearly calculates the damage:

float fDamage = (100.0f + GetAttributeModifier(stEvent.oCaster, PROPERTY_ATTRIBUTE_STRENGTH)) * OGRE_HURL_DAMAGE_FACTOR;

Sadly, even modifying the Ogre's strength to 1 is not enough to get  the desired effect. So it seems I need to override this somehow, which leads me into a whole bunch of questions:

1) Just outright modifying monster_aoe_instant is a bad idea, right? I'm actually creating a completely separate module, i.e. not adding to the single player campaign, but it seems like editing core scripts still changes them for other modules, is that right?
(Bonus question 1B, will editing 2DAs and putting them in my module's override directoy affect other modules? I don't want people to play my mod only to find out it tampers with their single player campaign)
2) If I can't just modify the script, how should I go about changing the damage using another script?
3) The Ogre's attacks actually appear in the ability_data worksheet in ABI_Base.xls. What's more, they have values in a column called "dmg_param()". I don't quite understand what is going on here, but could editing that perhaps work? This solution sort of seems like cheating, since only like 40 abilities are in there and it just so happens that they include the one I want to edit, but if it's an easy solution I wouldn't mind.

#2
Toryss

Toryss
  • Members
  • 41 messages
The main thing is OGRE_HURL_DAMAGE_FACTOR which is defined in one of the **_constants_h files (check the top of the script to see which one). You can change OGRE_HURL_DAMAGE_FACTOR in that header file, or just replace OGRE_HURL_DAMAGE_FACTOR in that line above with 0.0f, 0.06f, etc (check the header file to see what it's at right now).

#3
TimelordDC

TimelordDC
  • Members
  • 923 messages
The problem with the above approach would be that you are still overriding a core script. Currently, the OGRE_HURL_DAMAGE_FACTOR is set to 0.5f so the major component of damage is coming from that 100.0f in the equation.

Instead, edit the 2da to point OGRE_HURL ability to a custom script and in that script, do the same thing as monster_aoe_instant but put in your own formula (you only need to copy the portions relevant to Ogre and don't need Golem-related ones)

Edit:
For Bonus question, the answer is no. However, some files in the module's core override will affect the single player game.

Modifié par TimelordDC, 19 février 2010 - 03:22 .


#4
FergusM

FergusM
  • Members
  • 460 messages
Ah, you know somehow my eyes just slid over the spellscript column, I just assumed it was handled in some other core script somewhere. That's easy enough to change. Thanks.