Jump to content
  • 0

Fluxogram of spells


Vian

Question

Hello guys,

Upon playing with the latest build "develop21" and DB update 73,  I noticed I could not complete the quest chain "Taming the beast" as a NE hunter lv 10.

What happened was the follow,

The first quest asks you to use a Taming Rod to tame a spider, that quest worked as intended.

The second quest asks you to use a new Taming Rod to tame a "Nightsaber Stalker", but after finding one I just could not use the item on him, receiving the "Invalid Target" error.

Npc info told me that the npc entry was 2043, and after checking the table "item_required_target" I found the relation (15922 , 1 , 2043) that told me that the nightsaber indeed was the target of our rod(checked the rod entry 15922 in the "item_template" table and everything was ok).

So I decided to check the spell.dbc for the spellid_1 19699 that I found related to that rod, and I found the expected spell "Tame Nightsaber Stalker". Even so I could not tame the npc I mentioned above.

But when I changed the targetEntry value to 2042 (the entry of the lv6 nightsaber close to the npc), I managed to tame them without a problem.

Wrapping up, I believe that's a bug, but can someone clarify the situation for me? We don't mess with the spell.dbc values, we only forced the rod to be usable with that specific nightsaber type, but since it wasn't working with the original value but worked with the one I updated, does that mean the spell has its own target type defined somewhere? I don't think its in the spell.dbc because all the Taming Rods had the same values except for the strings defining the npc being tamed.

Thanks in advance :)

 

btw, the next Taming the beast quest that requires a Owl to be tamed appeared to have the same problem.

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

2 hours ago, madmax said:

Another bug with hunters - 

 

Thanks for the heads up, I was about to fill a new issue in the tracker, I'll take a look into this bug.

I just need some help understanding the spell behavior, not sure where to look after the spell.dbc file, could not find where that information is handled.

Link to comment
Share on other sites

Hey Bdebaere, thanks for checking it.

After seeing your screenshot, I did some extra research on this quest and found some posts outside mangos forums talking about deleting the WDB folder in the client. I'm ashamed to say that it indeed worked, after deleting the folder in my client I managed to log, create a new character and complete the quests. :$

Besides the mangos server I compiled I only logged in on the Elysium stress test servers, must have been that.

 

Edit:

Btw I'm still interested in some insight about the process of the example give (rod usage, spell from dbc, serverhandling). I managed to understand a bit by going through the server files related to handling, spell and auras but since I only found info about some spells and none was the taming ones used by the rod I'm still a bit lost of where that logic is.

Link to comment
Share on other sites

Hello Vian, what do you want to know exactly ?

In WoW almost everything is about spells. You start with opcodes (network messages) to cast a spell, then all the generic checks are made based on spell attributes (target, state, area, ...). If your spell is very generic, you won't see any custom code in the source.

Link to comment
Share on other sites

5 hours ago, Talendrys said:

Hello Vian, what do you want to know exactly ?

In WoW almost everything is about spells. You start with opcodes (network messages) to cast a spell, then all the generic checks are made based on spell attributes (target, state, area, ...). If your spell is very generic, you won't see any custom code in the source.

Hey Talendrys, thanks for the answer.

I have read some posts about the opcodes and checking the server console while playing helped to understand a bit better the client x server relation.

It's just that as a programmer I really like to understand the whole process, were each stage of the process is handled. Like in my example, "player uses rod", "server checks if the target is valid", if it is "cast the spell Taming Nightsaber stalker" etc

Maybe that case is not a good one to analyze and understand the spell process since it seems there isn't any specific  logic for it, I expected to find some logic about it because a bunch of spells are pretty well documented there and you can understand whats going on in the "case SPELL_NAME". 

Link to comment
Share on other sites

1 hour ago, Vian said:

Hey Talendrys, thanks for the answer.

I have read some posts about the opcodes and checking the server console while playing helped to understand a bit better the client x server relation.

It's just that as a programmer I really like to understand the whole process, were each stage of the process is handled. Like in my example, "player uses rod", "server checks if the target is valid", if it is "cast the spell Taming Nightsaber stalker" etc

Maybe that case is not a good one to analyze and understand the spell process since it seems there isn't any specific  logic for it, I expected to find some logic about it because a bunch of spells are pretty well documented there and you can understand whats going on in the "case SPELL_NAME". 

Hello Vian, well a bit like as I said, when you see "case spell_name", it means that some custom codes have been applied.

Basically, I can't explain the whole things because it's very large and I don't think I remember all of them but:

- Spell is the basic spell with its attributes (coming from spell.dbc)

- SpellEffect are the effects that a spell can apply to a target or an area or... You have maximum 3 spell effects and you can find an enum of them in the code

- SpellAura are the Aura that you can apply on a player (e.g. a buff or a debuff), an aura can be positive or negative. You have these values also available in the code

 

I suggest you to find Qt SpellWork which is an excellent tool to help to understand how a spell is working. Then you can start and understand in the code where what sequence is handled.

(https://github.com/sidsukana/QSpellWork)

The generic chain to handle spell is:

- World is looping awaiting for message

- It gets SMS_SPELL_CAST from a client with the spell id

- The spells get queued for execution and the calculation starts: damages, heals, effects, aura, triggering other spells, aggro of the mob, ...

- The spell cast result is sent back to the client with its result (spell cast results are also enum you can find out in the code)

 

 

Link to comment
Share on other sites

Hey Talendrys, thanks for the answer, I'll look into QT SpellWork.

Also I did some testing and the taming rods weren't not a good study case at all, by deleting the rod entries in the item_required_terget I could use them on any beast, the only requirements being level and a beast itself. So I guess the logic being used server side must be one of the charm ones. 

Link to comment
Share on other sites

Well yeah, sometimes spell.dbc is confusing and is missing some features that were added into the database (sometimes really hackfixing it).

If I look to the spell ID 19699, I got that this spell is from the school nature.

From its attributes:

- not usable shapeshifted

- channeled

- flags unk10, unk16 & unk26 are set

 

Advanced info:

- Creature type mask is BEAST

- Spell level is 10

- range is average (30 max)

- No cast time

- Default recovery time

 

As spell effects:

- threat

- apply aura 4 (spell aura dummy), value = 1

- no third effect

 

So indeed, this spell does not contain the restriction to the nightsaber. Database is then handling the missing part. :-)

Link to comment
Share on other sites

Hey Talendrys

Using all the tools pointed here I spent a few hours yesterday debugging the hunter Taming quest chain and it really helped me to better understand how spells are handled. After a bunch of back and forth inside the core code I finally found out  Aura::HandleModCharm inside spell.cpp where I believe the logic of the charmed beast are handled.

Thanks for all the help

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use