This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TUTORIAL] DBC editing: Spells  (Read 18431 times)

Crumpet

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 46
    • View Profile
[TUTORIAL] DBC editing: Spells
« on: January 02, 2013, 12:47:17 am »
Part 1: The Basics

Get yourself MyDBCEditor (google it...tada)

Open up Spell.dbc (you're doing so well)

Tonight we're going to tackle a basic but surprisingly educating problem to solve:

There are a few things you need to know about spells. More often than you'd think there is more than one spell involved in the casting of a "singular" spell. For instance, Holy Shock, this spell either heals the target if friendly or damages the target if hostile. Now, unfortunately, dbc's don't handle any mechanic this dynamic and therefore it's handled via the core and there are actually two spells (two entries in the dbc) for each rank of holy shock, one that heals and one that deals damage. Right, now say you wanted to edit holy shock for your new fantabulous twink server so you hop along to open-wow and look up Holy Shock (http://wotlk.openwow.com/?spell=20473) and openwow tells you that the id is 20473. Great, now you head on over to column 80 (incidentally I'll teach you what these columns actually mean, just knowing "that's the one that has the same number as the tooltip" is ridiculous, but I digress...) but what's this? it's empty! you check all the other nearby columns in the vague hope that there will be a number that you can change that will do the right thing, but none of them come close to the damage/healing value specified in the tooltip! ah well, I guess your twink realm won't be so fantabulous after all, right? WRONG MOTHERFUCKER! Here's the solution to your problem, but in order to understand it you have to approach it logically. I've already told you, spell such as holy shock have to be handled in the core, but this is the spell you use to cast it, so this spell must tell you something... It does, the tooltip tells you everything, it tells you how much it will heal for on friendly targets and how much it will damage your newly created super custom fun time boss for your amazing twink server. So, now you go in search of the tooltip column in the DBC, which, by the way, is 170 (most of the time) and you see this:

Quote
Blasts the target with Holy energy, causing $25912s1 Holy damage to an enemy, or $25914s1 healing to an ally.

Ooooh numbers, let's break this down:

"$" pretty much means your getting a value from somewhere else in the dbc. What comes after it is what row it's getting that value from, if there is no number after it, that means it's getting the number from it's own row (e.g. $s1)

"s" stands for the effectbasepoint columns a.k.a 80-82

"1" doesn't have to be 1, but it stands for which of the effectbasepoint columns it is getting the number from, in this case it's column 80, if it was 2 then it would be column 81 and if it was 3 then it would be column 82.

With this new found knowledge you can see that the tooltip is pointing to two different rows (two different spells) to return the heal/damage values. For the heal value it's pointing to row 25914, and sure enough, if we go to row 25914 at column 80, there's the value for the minimum heal for holy shock.



Right ok that's it for tonight, do it yourself with a spell like haunt, see if you can successfully modify both values.

Part one continued: Columns explained

I'm going to try and teach columsn with something to relate to. So let us deconstruct a spell.
Lets take rank 3 fireball (http://wotlk.openwow.com/?spell=145) as it's nice and simple. Ok, so let's look at what fireball does: It takes 2.5 seconds to shoot a projectile (fire-ball... durrr) which deals 53-73 fire damage and then 2 damage over 6 seconds after that.


Quote
It takes 2.5 seconds

This is the cast time. Column 28 handles cast time, but it stands for the casting time index, not the time itself. The value here points to a row in another dbc, SpellCastTimes.dbc. With our fireball, the value in column 28 is 19 so we need to go to SpellCastTimes.dbc and look at row 19 to understand further. We're only interested in column one and the row id in spellcasttimes.dbc as it tells us how long the cast time is, at row 19 the value in column 1 is 2500, so this means that it's done in milliseconds (1000 milliseconds in a second). If you wanted to change the cast time of fireball then you would need to change the value in column 28 (spell.dbc) to a different row id from SpellCastTimes.dbc.


Quote
shoot a projectile (fire-ball...dur)

This is the visual of the spell. Spell visuals are exceedingly complex so I won't go into too much detail as it would no longer be defined basic. But, column 131 is the spell visual column, to oversimplify, this is what makes the fireball look like a fireball, what makes the explosions on impact and what controlls the casting visual. The path of the fireball through the air is controlled elsewhere, but this will be discussed at another time, it's much more advanced. I suggest, for now, you don't tamper with this, it's unlikely it will turn out well. I promise I'll get round to a comprehensive tutorial on it.


Quote
deals 53-73 fire damage and then 2 damage over 6 seconds after that.

This is the fun stuff, but also the most complex. We'll start at the beginning, basic attributes of the spell (columns 4-11 define atributes, these are like limiting factors). The only attribute that fireball has is in column four and it's 0x10000 which means that the spell cannot be cast whilst shapeshifted, simple, this is an attribute that almost every spell has (apart from the obvious exceptions) What the attributes mean can be found here: http://www.wowdev.wiki/index.php?title=Spell.dbc/Attributes (mind, this is only for the first attribute column, each one has its own set).

The spell target type also needs to be defined somewhere, this is defined in column 16. For fireball the value here is zero, which means it can have a singular player/creature target, we'll get on to how this is further refined in a bit.
Lets move on to the spell effects. Columns 71-73 define the effects of the spell. Fireball has two effects, some instant damage and a periodic damage tick. Column 71 for fireball has the value 2 which stands for SPELL_EFFECT_SCHOOL_DAMAGE ( list can be found here : http://www.wowdev.wiki/index.php?title=Spell.dbc/Effect), Column 72 for fireball has the value 6 which stands for SPELL_EFFECT_APPLY AURA.

Lets deal with the SPELL_EFFECT_SCHOOL_DAMAGE first, this means that damage of a particular school is done to the target. The school of damage is defined at column 225, where the value for fireball is 4, which is the value for the fire school of damage. We then go to columns 80-82, which are the effectbasepoints columns, and it is (sortof) the amount of the effect that is applied, so for fireball the value in column 80 (the first effect therefore the first effectbasepoint column) is 52, which means that 53 points of fire damage will be dealt to the target (0 is counted as 1 here), sorted.

As for SPELL_EFFECT_APPLY_AURA, well we need to say which aura is applied. So we go to columns 95-97, which are the columns for "effectapplyauraname". We go to column 96, as the effect was defined in the second effect column and therefore the aura defined should be in the second applyaura column. For fireball the value in column 96 is 3, which stands for SPELL_AURA_PERIODIC_DAMAGE (http://www.wowdev.wiki/index.php?title=Spell.dbc/EffectApplyAuraName) so this means periodic damage is done. Columns 98-100 handle the effect amplitude, which in this case handles the amount of time between the damage ticks, so if we look at column 99 (second column, again, same reasons as before) we see the value for fireball which is 2000, which means that periodic damage will be dealt every 2 seconds (measured in milliseconds). Now we go to the second effectbasepoints column (81) and see that the value is 1 which means 2 damage will be done every 2 seconds. But the after effect of fireball only lasts 6 seconds so this needs to defined somewhere and it is, in column 40, the durationindex column. This column points to the spellduration.dbc and for fireball has the value 32, which points to row 32 in spellduration.dbc which is 6000 a.k.a 6 seconds in milliseconds.
Now, to get back to how the target is refined, we already know it has to be a singular player/creature, but columns 86-88 handle what each effect of the spell can, well, affect. With fireball in column 86 and 87 the value is 6, which means that the effects can not be applied to the caster, in other words, the spell cannot be cast on self.


Ok, I think that's it for the basic explanations of the dbc columns, I hope you enjoyed and I hope it's not too much of a wall of text!

If you don't like it, tell me to stop and I'll stop, I don't care as long as you don't run around screaming about how inferior I am compared to your immense power etc.
If you do like it, just say thanks.

Before you think I'm wrong, bear in mind I've simplified the explanations of some things in order for easy reading.

I will update this as time progresses.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

frezer748

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 175
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #1 on: January 02, 2013, 01:37:03 am »
You should use more pictures, and more free strings between the text, so it's easier to read. But the Content is good. In my opinion. :D
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #2 on: January 02, 2013, 02:03:57 am »
Hint: List all the columns in a list.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Crumpet

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 46
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #3 on: January 02, 2013, 02:26:19 am »
Quote from: "Ascathos"
Hint: List all the columns in a list.

I tried to break it down so they could see which column applied to what with a real spell.
But I get the message, :P.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #4 on: January 02, 2013, 03:14:32 am »
Quote from: "Crumpet"
Quote from: "Ascathos"
Hint: List all the columns in a list.

I tried to break it down so they could see which column applied to what with a real spell.
But I get the message, :P.
Correction: All the important columns. Also, link to the wiki (somewhere it is reasonable).
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Jameyboor

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 20
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #5 on: January 05, 2013, 08:55:36 pm »
Like it, Good job, very useful aswell, also, not sure if I am necro'ing or not, can't see the year of release xD
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #6 on: January 06, 2013, 07:36:18 am »
I gotta give you credit, for how short the guide is compared to how large and extensive the spell.dbc is, it's pretty informative. I was working on a guide for this myself breaking down every column and it is taking forever. However this will certainly work for people and after they can do this, most of the rest they can learn themselves. Although I would say you should explain attributes and hexadecimal a bit more.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #7 on: January 07, 2013, 12:25:53 pm »
Thanks for this Guide and for all help you gave in the past. Got blue for this and hope you will also be active here in the future :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

yubiyoy

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #8 on: April 03, 2013, 04:40:53 am »
This is a great tutorial for people new to this, you really know how to compress information :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Experience is simply the name we give our mistakes.

Romzarah

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 62
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #9 on: February 21, 2014, 05:30:56 pm »
Hi.. I am trying to make a higher rank Arcane Shot spell.. I copied the rank 11 spell line and changed column 81 to a higher number was 691, now is 891.. And the spell name column to rank 12. Then I made a patch.

Two things are odd..

1 the spell shows up in the misc tab of the spell book

2 the spell is doing less damage than the rank 11 spell

rank 11 spell crits at 5941 average
rank 12 spell crits at 2777 avarage

Anyone know what I am missing, or know of a better place to find what the columns mean than this site?
http://www.wowdev.wiki/index.php?title=Spell.dbc
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

deep6ixed

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 189
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #10 on: February 21, 2014, 08:43:52 pm »
All spells that don't have a skilllineablility.dbc entry will show up in the misc spell tab.  That's normal.

As for the damage, what does the tool tip for the spell say its supposed to do?  Calculated spell damage can be kinda tricky.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Romzarah

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 62
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #11 on: February 21, 2014, 10:16:41 pm »
Rank 11 spell say it does 1579 arcane damage

Rank 12 the one I made say 2075 arcane damage
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Romzarah

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 62
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #12 on: February 22, 2014, 01:46:28 pm »
Added a line to the skilllineablility.dbc and it fixed where the spell ends up in the spell book.. Thanks for that bit of info.. But have yet to find anything on why it is doing less damage than the rank 11 spell..
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Romzarah

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 62
    • View Profile
Re: [TUTORIAL] DBC editing: Spells
« Reply #13 on: February 23, 2014, 06:20:07 pm »
Adding to the Tutorial for people that want to add new spell ranks of existing spells. Backup all dbs you plan to edit 1st.

Trinitycore 3.3.5

Tools I used.
mydbceditor v 1.00
MySqlYog v7.02
mpqediten32 v 3.5.0.750


For spells like Arcane Shot.

Open the spell.dbc with mydbceditor and search for the highest rank spell you want to edit, in this case its 49045 rank 11
When you have found the spell, go to the edit menu and click the Copy Line To link. "Warning, you will need to be sure you use a ID number that is not in the database!" A popup will come up and you need to put in the filed a unique ID number and click the ok button.
A new line will be added to the bottom of the dbc. In the case of the Arcane Shot you will need to edit column 38,39,40 for spell level info and 81 to set the damage you want it to do. Also need to edit 154 for the spell name and rank.

Next open the SkillLineAbility.dbc and again be sure you use unique ID numbers. Here you need to search for the rank 11 spell ID as you did above and copy the line with your new ID number. In this DBC you only need to edit column 3 by putting in your spell ID you used in the Spell.dbc and save it.

Next copy the finished Spell.dbc and SkillLineAbility.dbc and past them in your sever core dbc folder.

Open MySQLYog and find the spell_ranks dbc. The center column has the spell ids, find your rank 11 spell here and write down the number in the 1st column. Add a new line at the bottom and put the number from the 1st column in, and the new spell ID number you made in the Spell.dbc in the center column. The 3rd column put the new rank number, in this case 12.

Now it is time to make a patch. In your mpqediten32 folder you will need to have a Work folder in it a folder named DBFilesClient, add your 2 dbc files in this folder. Open mpqediten32 and make your patch.

Reboot the server and test your spell.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »