Added possibility to cast spells with triggered flag using SCRIPT_COMMAND_CAST_SPELL, original patch by Az@zel

Fixed SCRIPT_COMMAND_CAST_SPELL for casting on creatures with selected entry

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-27 19:18:44 +02:00
parent 57947ac303
commit de2f63bcfb
3 changed files with 15 additions and 8 deletions

View File

@@ -3583,7 +3583,7 @@ void Map::ScriptsProcess()
uSource = dynamic_cast<Unit*>(target);
uTarget = dynamic_cast<Unit*>(source);
break;
case 4: // creature
case 4: // source -> creature with entry
uSource = dynamic_cast<Unit*>(source);
uTarget = GetClosestCreatureWithEntry(uSource, step.script->dataint, step.script->x);
break;
@@ -3601,7 +3601,8 @@ void Map::ScriptsProcess()
break;
}
uSource->CastSpell(uTarget, step.script->datalong, false);
bool triggered = step.script->dataint & 0x1;
uSource->CastSpell(uTarget, step.script->datalong, triggered);
break;
}