...
Have you ever wondered how a boss like Sindragosa (→ wowhead) is scripted? There is no need to wonder, you can see it for yourself! (→ Sindragosa Script File)
I know, I know - this looks incredibly complex, over 1600 lines of code! However there is no need to understand everything at one time. Let's focus on something simple, but still very important, shall we?
If you look at the beginning of the code you can find enum named Texts which is composed of 12 elements (numbers from 0 to 11), let's look closer at the first element of this enum:
Bloque de código | ||||||
---|---|---|---|---|---|---|
| ||||||
enum Texts { SAY_AGGRO = 0, // You are fools to have come to this place! The icy winds of Northrend will consume your souls! ... }; |
...
You can verify in game for yourself that Sindragosa will yell this when you start a fight versus her.
Did you notice something interesting? Actual text is placed after a // which means that this information is comment
and our compiler will ignore it. On the other hand we clearly see that she is yelling that text, how is it possible?
...
There is nothing? That's a shame, but maybe, maybe you had a chance to discover something?
Bloque de código | ||||||
---|---|---|---|---|---|---|
| ||||||
void EnterCombat(Unit* victim) override { ... Talk(SAY_AGGRO); // interesting! } |
Do you see the last line of this function? They are using something which shouldn't work!
We can conclude that this function will be called when Sindragosa is entering combat (look at function name!), so
now we see why she is yelling at start.
There is still one fundamental question - where is information about this text stored? Answer is
simpler than you might thought. It is stored in CREATURE_TEXT table!
to be continued...
Structure
Field | Type | Attributes | Key | Null | Default | Extra | Comment | |||
mediumint(8) | unsigned | PRI | NO | 0 |
| |||||
tinyint(3) | unsigned | PRI | NO | 0 |
|
| ||||
tinyint(3) | unsigned | PRI | NO | 0 |
| |||||
longtext | utf8_general_ci |
| YES | NULL |
|
| ||||
tinyint(3) | unsigned | NO | 0 |
|
| |||||
tinyint(3) | unsigned |
| NO | 0 |
|
| ||||
float | signed |
| NO | 0 |
|
| ||||
mediumint(8) | unsigned | NO | 0 |
|
| |||||
mediumint(8) | unsigned |
| NO | 0 |
|
| ||||
mediumint(8) | unsigned | NO | 0 |
|
| |||||
BroadcastTextId | mediumint(6) | signed | NO | 0 | ||||||
TextRange | tinyint(3) | unsigned | NO | 0 | ||||||
varchar(255) | utf8_general_ci |
| YES | ' ' |
|
Description of the fields
...
This field allows you to label a text entry.