mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[10146] Implement SCRIPT_COMMAND_PLAY_MOVIE (19)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
ebf27938fb
commit
52e4c0ab17
4 changed files with 33 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -4545,6 +4545,16 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
|||
// for later, we might consider despawn by database guid, and define in datalong2 as option to despawn self.
|
||||
break;
|
||||
}
|
||||
case SCRIPT_COMMAND_PLAY_MOVIE:
|
||||
{
|
||||
if (!sMovieStore.LookupEntry(tmp.datalong))
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` use non-existing movie_id (id: %u) in SCRIPT_COMMAND_PLAY_MOVIE for script id %u",
|
||||
tablename, tmp.datalong, tmp.id);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (scripts.find(tmp.id) == scripts.end())
|
||||
|
|
|
|||
|
|
@ -411,6 +411,7 @@ enum RealmZone
|
|||
#define SCRIPT_COMMAND_PLAY_SOUND 16 // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent)
|
||||
#define SCRIPT_COMMAND_CREATE_ITEM 17 // source or target must be player, datalong = item entry, datalong2 = amount
|
||||
#define SCRIPT_COMMAND_DESPAWN_SELF 18 // source or target must be creature, datalong = despawn delay
|
||||
#define SCRIPT_COMMAND_PLAY_MOVIE 19 // target can only be a player, datalog = movie id
|
||||
|
||||
/// Storage class for commands issued for delayed execution
|
||||
struct CliCommandHolder
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10145"
|
||||
#define REVISION_NR "10146"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue