The `spell_area` table
This table is used to apply a specific spell aura to the player within an area in the game. When any player enters this area or somehow interacts with a quest, this aura will be handled accordingly.
Some examples:
- An area could pacify all players (spell 39331)
- Another area could full heal every 1 second (spell 48591)
- Teleport player out of an area (spell 53141)
- Factions-specific buffs, e.g. in Icecrown Citadel:
- "Hellscream's Warsong" (spell 73822) for horde
- "Strength of Wrynn" (spell 73828) for alliance
- Even region-based buffs, such as area 440 - Tanaris.
Structure
Field | Type | Attributes | Key | Null | Default | Extra | Comment |
mediumint(8) | unsigned | PRI | NO | 0 |
|
| |
mediumint(8) | unsigned | PRI | NO | 0 |
|
| |
mediumint(8) | unsigned | PRI | NO | 0 |
|
| |
mediumint(8) | unsigned |
| NO | 0 |
|
| |
mediumint(8) | signed | PRI | NO | 0 |
|
| |
mediumint(8) | unsigned | PRI | NO | 0 |
|
| |
tinyint(1) | unsigned | PRI | NO | 2 |
|
| |
tinyint(1) | unsigned |
| NO | 0 |
|
| |
int(11) | unsigned |
| NO | 64 |
|
| |
int(11) | unsigned |
| NO | 11 |
|
|
Description of the fields
spell
The spell ID of the spell to be casted on the player. See Spell.dbc.
area
The area ID. Type ".gps" in-game and find the "Area:" number to use for this cell. Also see AreaTable.dbc.
quest_start
The entry of the quest which the player must have in the state defined by quest_start_status. See quest_template.id.
quest_end
The entry of the quest which the player must not have in the state defined by quest_end_status. See quest_template.id. Setting both quest_start and quest_end to the same value is useless.
aura_spell
If set, this value (plus or minus aura spell ID from Spell.dbc) imposes additional condition.
The value has the following effect:
- < 0 (negative values) If the player has aura -aura_spell then the spell will not be activated.
- 0 this column is ignored.
- > 0 (positive values) If the player has no aura aura_spell then the spell will not be activated.
racemask
This ID is automatically called from ChrRaces.dbc. The bitmask is entered here.
0, 1791 = All Races
690 (2 + 16 + 32 + 128 + 512) = Horde Only
1101 (1 + 4 + 8 + 64 + 1024) = Alliance Only
gender
The gender type this entry applies to. 0 = Male, 1 = Female, 2 = Any.
autocast
If the spell should be automatically applied when the character enters the area. Also prevents the user from removing it. 0 = is not autocasted, 1 = is autocasted
quest_start_status, quest_end_status
Within quest_start_status, you can define the mask of quest status required for quest_start.
Within quest_end_status, you can define the mask of quest status inadmissible for quest_end.
Example:
Quest 29761 applies a buff on accepting a quest and removes it on handing it in. You also want the spell to remain after completing the quest. Thus, you combine the QUEST_STATUS_ flags for *_INCOMPLETE (8), *_REWARDED (64) and *_COMPLETE (2) within quest_start_status mask. Thus, you end up with a `quest_start_status`= (2|8|64). If at the same time you need to remove the buff when an other quest XXXX is accepted (and restore the buff when this quest is handed in), you define `quest_end` = XXXX and `quest_end_status`=(2|8|32).
Guiding principle:
- A mask DEFINED in *_start_status kicks in, a mask NOT DEFINED in *_end_status kicks in.
Quest Status | Flag | Explanation |
---|---|---|
QUEST_STATUS_NONE = 0 | 1 | Player does not have or had quest at all. He could accept it, but he did not (yet). |
QUEST_STATUS_COMPLETE = 1 | 2 | Player fulfilled objectives, but did not hand it in yet. |
QUEST_STATUS_UNAVAILABLE = 2 | 4 (NOT USED) | (Not used) |
QUEST_STATUS_INCOMPLETE = 3 | 8 | Player did not fulfill objectives yet |
QUEST_STATUS_AVAILABLE = 4 | 16 (NOT USED) | (Not used) |
QUEST_STATUS_FAILED = 5 | 32 | Player failed to fulfill objectives for any reason, e.g. time limit |
QUEST_STATUS_REWARDED = 6 | 64 | Player handed quest in and this is sort of a post-quest interaction |
Example for a SQL
For a `quest_end_status` that should contain QUEST_STATUS_NONE (1), QUEST_STATUS_COMPLETE (2) and QUEST_STATUS_INCOMPLETE (8):
UPDATE `spell_area` SET `quest_end_status`= (1|2|8) WHERE `spell`=XXXXX AND `area`=YYYY; -- equivalent to `quest_end_status`= 11