[10146] Implement SCRIPT_COMMAND_PLAY_MOVIE (19)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
crackm 2010-07-03 23:27:58 +04:00 committed by VladimirMangos
parent ebf27938fb
commit 52e4c0ab17
4 changed files with 33 additions and 1 deletions

View file

@ -2951,6 +2951,27 @@ void Map::ScriptsProcess()
break;
}
case SCRIPT_COMMAND_PLAY_MOVIE:
{
if (!target && !source)
{
sLog.outError("SCRIPT_COMMAND_PLAY_MOVIE (script id %u) call for NULL object.", step.script->id);
break;
}
// only Player
if ((!target || target->GetTypeId() != TYPEID_PLAYER) && (!source || source->GetTypeId() != TYPEID_PLAYER))
{
sLog.outError("SCRIPT_COMMAND_PLAY_MOVIE (script id %u) call for non-player (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0);
break;
}
Player* pReceiver = target && target->GetTypeId() == TYPEID_PLAYER ? (Player*)target : (Player*)source;
pReceiver->SendMovieStart(step.script->datalong);
break;
}
default:
sLog.outError("Unknown SCRIPT_COMMAND_ %u called for script id %u.",step.script->command, step.script->id);
break;