[10956] Implement support triggered spells in SCRIPT_COMMAND_CAST_SPELL

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Schmoozerd 2011-01-04 04:14:12 +03:00 committed by VladimirMangos
parent 9174e5d085
commit 883e88fad5
5 changed files with 6 additions and 5 deletions

View file

@ -157,7 +157,7 @@ spell_scripts
15 SCRIPT_COMMAND_CAST_SPELL source/target cast spell at target/source 15 SCRIPT_COMMAND_CAST_SPELL source/target cast spell at target/source
* datalong = spell id * datalong = spell id
* datalong2 = 0: s->t 1: s->s 2: t->t 3: t->s * datalong2 = 0: s->t 1: s->s 2: t->t 3: t->s 4: cast triggered
16 SCRIPT_COMMAND_PLAY_SOUND source = any object, target=any/player 16 SCRIPT_COMMAND_PLAY_SOUND source = any object, target=any/player
* datalong = sound_id * datalong = sound_id

View file

@ -2397,7 +2397,7 @@ void Map::ScriptsProcess()
Unit* spellSource = (Unit*)cmdSource; Unit* spellSource = (Unit*)cmdSource;
//TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast //TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast
spellSource->CastSpell(spellTarget, step.script->castSpell.spellId, false); spellSource->CastSpell(spellTarget, step.script->castSpell.spellId, step.script->castSpell.flags & 0x04);
break; break;
} }

View file

@ -332,7 +332,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
tablename, tmp.castSpell.spellId, tmp.id); tablename, tmp.castSpell.spellId, tmp.id);
continue; continue;
} }
if (tmp.castSpell.flags & ~0x3) // 2 bits if (tmp.castSpell.flags & ~0x7) // 3 bits
{ {
sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u", sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u",
tablename, tmp.castSpell.flags, tmp.id); tablename, tmp.castSpell.flags, tmp.id);

View file

@ -61,7 +61,8 @@ enum eScriptCommand
SCRIPT_COMMAND_CLOSE_DOOR = 12, // source = unit, datalong=db_guid, datalong2=reset_delay SCRIPT_COMMAND_CLOSE_DOOR = 12, // source = unit, datalong=db_guid, datalong2=reset_delay
SCRIPT_COMMAND_ACTIVATE_OBJECT = 13, // source = unit, target=GO SCRIPT_COMMAND_ACTIVATE_OBJECT = 13, // source = unit, target=GO
SCRIPT_COMMAND_REMOVE_AURA = 14, // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id SCRIPT_COMMAND_REMOVE_AURA = 14, // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id
SCRIPT_COMMAND_CAST_SPELL = 15, // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s SCRIPT_COMMAND_CAST_SPELL = 15, // source/target cast spell at target/source
// datalong2: 0: s->t 1: s->s 2: t->t 3: t->s (this values in 2 bits), and 0x4 mask for cast triggered can be added to
SCRIPT_COMMAND_PLAY_SOUND = 16, // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent) SCRIPT_COMMAND_PLAY_SOUND = 16, // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent)
SCRIPT_COMMAND_CREATE_ITEM = 17, // source or target must be player, datalong = item entry, datalong2 = amount SCRIPT_COMMAND_CREATE_ITEM = 17, // source or target must be player, datalong = item entry, datalong2 = amount
SCRIPT_COMMAND_DESPAWN_SELF = 18, // source or target must be creature, datalong = despawn delay SCRIPT_COMMAND_DESPAWN_SELF = 18, // source or target must be creature, datalong = despawn delay

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10955" #define REVISION_NR "10956"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__