25 ScriptMapMap::const_iterator s = scripts.find(
id);
26 if (s == scripts.end())
36 bool immedScript =
false;
37 for (ScriptMap::const_iterator iter = s2->begin(); iter != s2->end(); ++iter)
92 if (!source && !target)
99 if (!player && source)
103 SF_LOG_ERROR(
"scripts",
"%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
114 if (!source && !target)
123 if (!creature && source)
131 if (!creature && target)
136 SF_LOG_ERROR(
"scripts",
"%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
148 SF_LOG_ERROR(
"scripts",
"%s %s object is NULL.", scriptInfo->
GetDebugInfo().c_str(), isSource ?
"source" :
"target");
150 SF_LOG_ERROR(
"scripts",
"%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.",
156 SF_LOG_ERROR(
"scripts",
"%s %s object could not be casted to unit.",
157 scriptInfo->
GetDebugInfo().c_str(), isSource ?
"source" :
"target");
166 SF_LOG_ERROR(
"scripts",
"%s %s object is NULL.", scriptInfo->
GetDebugInfo().c_str(), isSource ?
"source" :
"target");
171 SF_LOG_ERROR(
"scripts",
"%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
181 SF_LOG_ERROR(
"scripts",
"%s %s object is NULL.", scriptInfo->
GetDebugInfo().c_str(), isSource ?
"source" :
"target");
186 SF_LOG_ERROR(
"scripts",
"%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->
GetDebugInfo().c_str(),
197 scriptInfo->
GetDebugInfo().c_str(), isSource ?
"source" :
"target");
202 SF_LOG_ERROR(
"scripts",
"%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).",
226 SF_LOG_ERROR(
"scripts",
"%s source object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->
GetDebugInfo().c_str(),
232 SF_LOG_ERROR(
"scripts",
"%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
240 SF_LOG_ERROR(
"scripts",
"%s gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
293 source = player->GetItemByGuid(step.
sourceGUID);
319 SF_LOG_ERROR(
"scripts",
"%s source with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
354 SF_LOG_ERROR(
"scripts",
"%s target with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
372 LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
385 player->TextEmote(text);
458 SF_LOG_ERROR(
"scripts",
"%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
460 cSource->GetValuesCount(),
uint8(cSource->GetTypeId()), cSource->GetEntry(), cSource->GetGUIDLow());
487 SF_LOG_ERROR(
"scripts",
"%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
489 cSource->GetValuesCount(),
uint8(cSource->GetTypeId()), cSource->GetEntry(), cSource->GetGUIDLow());
501 SF_LOG_ERROR(
"scripts",
"%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
503 cSource->GetValuesCount(),
uint8(cSource->GetTypeId()), cSource->GetEntry(), cSource->GetGUIDLow());
544 SF_LOG_ERROR(
"scripts",
"%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
557 SF_LOG_ERROR(
"scripts",
"%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
565 SF_LOG_ERROR(
"scripts",
"%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
615 SF_LOG_ERROR(
"scripts",
"%s can not be used with gameobject of type %u (guid: %u).",
671 SF_LOG_ERROR(
"scripts",
"%s target object is not gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",
693 if (!source && !target)
699 Unit* uSource = NULL;
700 Unit* uTarget = NULL;
705 uSource = source ? source->
ToUnit() : NULL;
706 uTarget = target ? target->
ToUnit() : NULL;
709 uSource = source ? source->
ToUnit() : NULL;
713 uSource = target ? target->
ToUnit() : NULL;
717 uSource = target ? target->
ToUnit() : NULL;
718 uTarget = source ? source->
ToUnit() : NULL;
721 uSource = source ? source->
ToUnit() : NULL;
857 if (cSource->isDead())
858 SF_LOG_ERROR(
"scripts",
"%s creature is already dead (Entry: %u, GUID: %u)",
864 cSource->RemoveCorpse();
880 sourceUnit->SetFacingToObject(targetUnit);
902 player->PlayerTalkClass->SendCloseGossip();
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
#define SF_LOG_ERROR(filterType__,...)
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
uint32 GUID_HIPART(uint64 guid)
bool IS_PLAYER_GUID(uint64 guid)
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
@ SF_CASTSPELL_SOURCE_TO_SOURCE
@ SF_CASTSPELL_SOURCE_TO_TARGET
@ SF_CASTSPELL_TARGET_TO_SOURCE
@ SF_PLAYSOUND_DISTANCE_SOUND
@ SF_TELEPORT_USE_CREATURE
@ SF_KILLCREDIT_REWARD_GROUP
@ SF_PLAYSOUND_TARGET_PLAYER
@ SF_CASTSPELL_TARGET_TO_TARGET
@ SF_CASTSPELL_SEARCH_CREATURE
@ SF_ORIENTATION_FACE_TARGET
std::multimap< uint32, ScriptInfo > ScriptMap
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
@ SCRIPT_COMMAND_KILL_CREDIT
@ SCRIPT_COMMAND_QUEST_EXPLORED
@ SCRIPT_COMMAND_TELEPORT_TO
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
@ SCRIPT_COMMAND_FLAG_SET
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
@ SCRIPT_COMMAND_PLAY_SOUND
@ SCRIPT_COMMAND_OPEN_DOOR
@ SCRIPT_COMMAND_FIELD_SET
@ SCRIPT_COMMAND_LOAD_PATH
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
@ SCRIPT_COMMAND_REMOVE_AURA
@ SCRIPT_COMMAND_DESPAWN_SELF
@ SCRIPT_COMMAND_CLOSE_DOOR
@ SCRIPT_COMMAND_CAST_SPELL
@ SCRIPT_COMMAND_PLAYMOVIE
@ SCRIPT_COMMAND_CLOSE_GOSSIP
@ SCRIPT_COMMAND_FLAG_REMOVE
@ SCRIPT_COMMAND_CREATE_ITEM
@ SCRIPT_COMMAND_ORIENTATION
std::map< uint32, ScriptMap > ScriptMapMap
std::vector< ItemPosCount > ItemPosCountVec
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
@ GAMEOBJECT_TYPE_FISHINGNODE
@ UNIT_FIELD_NPC_EMOTESTATE
GOState GetGoState() const
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
void SetRespawnTime(int32 respawn)
GameobjectTypes GetGoType() const
void SetLootState(LootState s, Unit *unit=NULL)
Transport * ToTransport()
static T * Find(uint64 guid)
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Put scripts in the execution queue.
GameObject * _FindGameObject(WorldObject *pWorldObject, uint32 guid) const
Creature * _GetScriptCreature(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
void ScriptsProcess()
Process queued scripts.
ScriptScheduleMap m_scriptSchedule
void ScriptCommandStart(ScriptInfo const &script, uint32 delay, Object *source, Object *target)
Creature * _GetScriptCreatureSourceOrTarget(Object *source, Object *target, const ScriptInfo *scriptInfo, bool bReverse=false) const
WorldObject * _GetScriptWorldObject(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
Player * _GetScriptPlayerSourceOrTarget(Object *source, Object *target, const ScriptInfo *scriptInfo) const
void _ScriptProcessDoor(Object *source, Object *target, const ScriptInfo *scriptInfo) const
Player * _GetScriptPlayer(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
Unit * _GetScriptUnit(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
static T * GetObjectInWorld(uint64 guid, T *)
uint32 GetGUIDLow() const
bool isType(uint16 mask) const
GameObject * ToGameObject()
void AreaExploredOrEventHappens(uint32 questId)
void FailQuest(uint32 quest_id)
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false)
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
float GetGridActivationRange() const
void PlayDistanceSound(uint32 sound_id, Player *target)
float GetDistance(WorldObject const *obj) const
CellCoord ComputeCellCoord(float x, float y)
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
ScriptInfo const * script
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@130361027372270375075175021215151356143001013055 Kill
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@235213206037260262323130355352141154322352336256 KillCredit
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@323144237034231264254170147314213276360375006374 RespawnGameobject
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@366202063362232017203072231044323334343276266221 CreateItem
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@215362176107272335311131263361174353005102016155 QuestExplored
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@060313056375165064134111275066130320355250202151 TempSummonCreature
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@051127012334050237002325262055013174250146206153 ToggleDoor
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@344032077141363017062320302015232153251270314326 MoveTo
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@114161360076040133161002267003164201214357057100 FieldSet
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@337031371172363341310074346110326367135322374244 CallScript
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@046004315213250210214200301212324111357101326175 FlagToggle
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@331116102107327262357341352322171111244332342004 LoadPath
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@310207036336307321205127162152160034150247215165 RemoveAura
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@263054102236002116002177012326305077362241107373 PlayMovie
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@311217305261140163363255355271102376114316044147 PlaySound
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@340160313205203126365171223166355241073242151073 CastSpell
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@044166240220270000271314363001357235305117106163 Emote
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@027276335324105102041055136361016371041043214137 Model
std::string GetDebugInfo() const
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@203261325337225075157146047106312017011372377163 TeleportTo
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@264374040335366155120321054324331165306344366303 Talk
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@162360347056214232002103360322344073177375375370 Equip
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@210061205317137213243122261357357070350257132313 DespawnSelf