mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[12669] Add GO-Casting to SCRIPT_COMMAND_CAST_SPELL
Close cmangos/issues#203 (based on commit [12467] - c10539a)
This commit is contained in:
parent
7e89da0bbe
commit
5e944a2c12
2 changed files with 10 additions and 4 deletions
|
|
@ -1395,12 +1395,18 @@ bool ScriptAction::HandleScriptStep()
|
||||||
}
|
}
|
||||||
case SCRIPT_COMMAND_CAST_SPELL: // 15
|
case SCRIPT_COMMAND_CAST_SPELL: // 15
|
||||||
{
|
{
|
||||||
if (LogIfNotUnit(pSource))
|
if (LogIfNotUnit(pTarget)) // TODO - Change when support for casting without victim will be supported
|
||||||
break;
|
|
||||||
if (LogIfNotUnit(pTarget))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 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
|
||||||
|
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);
|
((Unit*)pSource)->CastSpell(((Unit*)pTarget), m_script->castSpell.spellId, (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL) != 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12668"
|
#define REVISION_NR "12669"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue