[12669] Add GO-Casting to SCRIPT_COMMAND_CAST_SPELL

Close cmangos/issues#203

(based on commit [12467] - c10539a)
This commit is contained in:
Schmoozerd 2013-08-19 16:19:35 +03:00 committed by Antz
parent 7e89da0bbe
commit 5e944a2c12
2 changed files with 10 additions and 4 deletions

View file

@ -1395,12 +1395,18 @@ bool ScriptAction::HandleScriptStep()
}
case SCRIPT_COMMAND_CAST_SPELL: // 15
{
if (LogIfNotUnit(pSource))
break;
if (LogIfNotUnit(pTarget))
if (LogIfNotUnit(pTarget)) // TODO - Change when support for casting without victim will be supported
break;
// TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast
if (pSource && pSource->GetTypeId() == TYPEID_GAMEOBJECT)
{
((Unit*)pTarget)->CastSpell(((Unit*)pTarget), m_script->castSpell.spellId, true, NULL, NULL, pSource->GetObjectGuid());
break;
}
if (LogIfNotUnit(pSource))
break;
((Unit*)pSource)->CastSpell(((Unit*)pTarget), m_script->castSpell.spellId, (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL) != 0);
break;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12668"
#define REVISION_NR "12669"
#endif // __REVISION_NR_H__