From 5e944a2c1231150f3669d7ce61887644c61bce34 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Mon, 19 Aug 2013 16:19:35 +0300 Subject: [PATCH] [12669] Add GO-Casting to SCRIPT_COMMAND_CAST_SPELL Close cmangos/issues#203 (based on commit [12467] - c10539a) --- src/game/ScriptMgr.cpp | 12 +++++++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index 1d3fb7144..2458b7764 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -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; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 32e8f4789..204ae86a5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12668" + #define REVISION_NR "12669" #endif // __REVISION_NR_H__