TrinityCore
Loading...
Searching...
No Matches
MapScripts.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "Map.h"
19#include "CellImpl.h"
20#include "GameTime.h"
21#include "GossipDef.h"
22#include "GridNotifiers.h"
23#include "Item.h"
24#include "Log.h"
25#include "MapManager.h"
26#include "MotionMaster.h"
27#include "ObjectMgr.h"
28#include "Pet.h"
29#include "ScriptMgr.h"
30#include "Transport.h"
31#include "WaypointManager.h"
32#include "World.h"
33
35void Map::ScriptsStart(std::map<uint32, std::multimap<uint32, ScriptInfo>> const& scripts, uint32 id, Object* source, Object* target)
36{
38 ScriptMapMap::const_iterator s = scripts.find(id);
39 if (s == scripts.end())
40 return;
41
42 // prepare static data
43 ObjectGuid sourceGUID = source ? source->GetGUID() : ObjectGuid::Empty; //some script commands doesn't have source
44 ObjectGuid targetGUID = target ? target->GetGUID() : ObjectGuid::Empty;
45 ObjectGuid ownerGUID = [&] { if (Item* item = Object::ToItem(source)) return item->GetOwnerGUID(); return ObjectGuid::Empty; }();
46
48 ScriptMap const* s2 = &(s->second);
49 bool immedScript = false;
50 for (ScriptMap::const_iterator iter = s2->begin(); iter != s2->end(); ++iter)
51 {
52 ScriptAction sa;
53 sa.sourceGUID = sourceGUID;
54 sa.targetGUID = targetGUID;
55 sa.ownerGUID = ownerGUID;
56
57 sa.script = &iter->second;
58 m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(GameTime::GetGameTime() + iter->first), sa));
59 if (iter->first == 0)
60 immedScript = true;
61
62 sMapMgr->IncreaseScheduledScriptsCount();
63 }
65 if (/*start &&*/ immedScript && !i_scriptLock)
66 {
67 i_scriptLock = true;
69 i_scriptLock = false;
70 }
71}
72
73void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target)
74{
75 // NOTE: script record _must_ exist until command executed
76
77 // prepare static data
78 ObjectGuid sourceGUID = source ? source->GetGUID() : ObjectGuid::Empty;
79 ObjectGuid targetGUID = target ? target->GetGUID() : ObjectGuid::Empty;
80 ObjectGuid ownerGUID = [&] { if (Item* item = Object::ToItem(source)) return item->GetOwnerGUID(); return ObjectGuid::Empty; }();
81
82 ScriptAction sa;
83 sa.sourceGUID = sourceGUID;
84 sa.targetGUID = targetGUID;
85 sa.ownerGUID = ownerGUID;
86
87 sa.script = &script;
88 m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(GameTime::GetGameTime() + delay), sa));
89
90 sMapMgr->IncreaseScheduledScriptsCount();
91
93 if (delay == 0 && !i_scriptLock)
94 {
95 i_scriptLock = true;
97 i_scriptLock = false;
98 }
99}
100
101// Helpers for ScriptProcess method.
102inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo) const
103{
104 Player* player = nullptr;
105 if (!source && !target)
106 TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo());
107 else
108 {
109 // Check target first, then source.
110 if (target)
111 player = target->ToPlayer();
112 if (!player && source)
113 player = source->ToPlayer();
114
115 if (!player)
116 TC_LOG_ERROR("scripts", "{} neither source nor target object is player (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.",
117 scriptInfo->GetDebugInfo().c_str(),
118 source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(),
119 target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str());
120 }
121 return player;
122}
123
124inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo, bool bReverse) const
125{
126 Creature* creature = nullptr;
127 if (!source && !target)
128 TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo());
129 else
130 {
131 if (bReverse)
132 {
133 // Check target first, then source.
134 if (target)
135 creature = target->ToCreature();
136 if (!creature && source)
137 creature = source->ToCreature();
138 }
139 else
140 {
141 // Check source first, then target.
142 if (source)
143 creature = source->ToCreature();
144 if (!creature && target)
145 creature = target->ToCreature();
146 }
147
148 if (!creature)
149 TC_LOG_ERROR("scripts", "{} neither source nor target are creatures (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.",
150 scriptInfo->GetDebugInfo().c_str(),
151 source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(),
152 target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str());
153 }
154 return creature;
155}
156
157inline GameObject* Map::_GetScriptGameObjectSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo, bool bReverse) const
158{
159 GameObject* gameobject = nullptr;
160 if (!source && !target)
161 TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo());
162 else
163 {
164 if (bReverse)
165 {
166 // Check target first, then source.
167 if (target)
168 gameobject = target->ToGameObject();
169 if (!gameobject && source)
170 gameobject = source->ToGameObject();
171 }
172 else
173 {
174 // Check source first, then target.
175 if (source)
176 gameobject = source->ToGameObject();
177 if (!gameobject && target)
178 gameobject = target->ToGameObject();
179 }
180
181 if (!gameobject)
182 TC_LOG_ERROR("scripts", "{} neither source nor target are gameobjects (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.",
183 scriptInfo->GetDebugInfo().c_str(),
184 source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(),
185 target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str());
186 }
187 return gameobject;
188}
189
190inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
191{
192 Unit* unit = nullptr;
193 if (!obj)
194 TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
195 else if (!obj->IsUnit())
196 TC_LOG_ERROR("scripts", "{} {} object is not unit {}, skipping.",
197 scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString());
198 else
199 {
200 unit = obj->ToUnit();
201 if (!unit)
202 TC_LOG_ERROR("scripts", "{} {} object could not be cast to unit.",
203 scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
204 }
205 return unit;
206}
207
208inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
209{
210 Player* player = nullptr;
211 if (!obj)
212 TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
213 else
214 {
215 player = obj->ToPlayer();
216 if (!player)
217 TC_LOG_ERROR("scripts", "{} {} object is not a player {}.",
218 scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString());
219 }
220 return player;
221}
222
223inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
224{
225 Creature* creature = nullptr;
226 if (!obj)
227 TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
228 else
229 {
230 creature = obj->ToCreature();
231 if (!creature)
232 TC_LOG_ERROR("scripts", "{} {} object is not a creature {}.", scriptInfo->GetDebugInfo(),
233 isSource ? "source" : "target", obj->GetGUID().ToString());
234 }
235 return creature;
236}
237
238inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
239{
240 WorldObject* pWorldObject = nullptr;
241 if (!obj)
242 TC_LOG_ERROR("scripts", "{} {} object is NULL.",
243 scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
244 else
245 {
246 pWorldObject = dynamic_cast<WorldObject*>(obj);
247 if (!pWorldObject)
248 TC_LOG_ERROR("scripts", "{} {} object is not a world object {}.",
249 scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString());
250 }
251 return pWorldObject;
252}
253
254inline void Map::_ScriptProcessDoor(Object* source, Object* target, ScriptInfo const* scriptInfo) const
255{
256 bool bOpen = false;
257 ObjectGuid::LowType guid = scriptInfo->ToggleDoor.GOGuid;
258 int32 nTimeToToggle = std::max(15, int32(scriptInfo->ToggleDoor.ResetDelay));
259 switch (scriptInfo->command)
260 {
261 case SCRIPT_COMMAND_OPEN_DOOR: bOpen = true; break;
262 case SCRIPT_COMMAND_CLOSE_DOOR: break;
263 default:
264 TC_LOG_ERROR("scripts", "{} unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo());
265 return;
266 }
267 if (!guid)
268 TC_LOG_ERROR("scripts", "{} door guid is not specified.", scriptInfo->GetDebugInfo());
269 else if (!source)
270 TC_LOG_ERROR("scripts", "{} source object is NULL.", scriptInfo->GetDebugInfo());
271 else if (!source->IsUnit())
272 TC_LOG_ERROR("scripts", "{} source object is not unit {}, skipping.", scriptInfo->GetDebugInfo(),
273 source->GetGUID().ToString());
274 else
275 {
276 WorldObject* wSource = dynamic_cast <WorldObject*> (source);
277 if (!wSource)
278 TC_LOG_ERROR("scripts", "{} source object could not be cast to world object {}, skipping.",
279 scriptInfo->GetDebugInfo(), source->GetGUID().ToString());
280 else
281 {
282 GameObject* pDoor = _FindGameObject(wSource, guid);
283 if (!pDoor)
284 TC_LOG_ERROR("scripts", "{} gameobject was not found (guid: {}).", scriptInfo->GetDebugInfo(), guid);
285 else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR)
286 TC_LOG_ERROR("scripts", "{} gameobject is not a door (GoType: {}, {}).",
287 scriptInfo->GetDebugInfo(), pDoor->GetGoType(), pDoor->GetGUID().ToString());
288 else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY))
289 {
290 pDoor->UseDoorOrButton(nTimeToToggle);
291
292 if (GameObject* goTarget = Object::ToGameObject(target))
293 {
294 if (goTarget && goTarget->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
295 goTarget->UseDoorOrButton(nTimeToToggle);
296 }
297 }
298 }
299 }
300}
301
303{
304 auto bounds = searchObject->GetMap()->GetGameObjectBySpawnIdStore().equal_range(guid);
305 if (bounds.first == bounds.second)
306 return nullptr;
307
308 return bounds.first->second;
309}
310
313{
314 if (m_scriptSchedule.empty())
315 return;
316
318 ScriptScheduleMap::iterator iter = m_scriptSchedule.begin();
319 // ok as multimap is a *sorted* associative container
320 while (!m_scriptSchedule.empty() && (iter->first <= GameTime::GetGameTime()))
321 {
322 ScriptAction const& step = iter->second;
323
324 Object* source = nullptr;
325 if (!step.sourceGUID.IsEmpty())
326 {
327 switch (step.sourceGUID.GetHigh())
328 {
329 case HighGuid::Item: // as well as HighGuid::Container
330 if (Player* player = GetPlayer(step.ownerGUID))
331 source = player->GetItemByGuid(step.sourceGUID);
332 break;
333 case HighGuid::Unit:
335 source = GetCreature(step.sourceGUID);
336 break;
337 case HighGuid::Pet:
338 source = GetPet(step.sourceGUID);
339 break;
340 case HighGuid::Player:
341 source = GetPlayer(step.sourceGUID);
342 break;
345 source = GetGameObject(step.sourceGUID);
346 break;
347 case HighGuid::Corpse:
348 source = GetCorpse(step.sourceGUID);
349 break;
351 source = GetTransport(step.sourceGUID);
352 break;
353 default:
354 TC_LOG_ERROR("scripts", "{} source with unsupported high guid {}.",
355 step.script->GetDebugInfo(), step.sourceGUID.ToString());
356 break;
357 }
358 }
359
360 WorldObject* target = nullptr;
361 if (!step.targetGUID.IsEmpty())
362 {
363 switch (step.targetGUID.GetHigh())
364 {
365 case HighGuid::Unit:
367 target = GetCreature(step.targetGUID);
368 break;
369 case HighGuid::Pet:
370 target = GetPet(step.targetGUID);
371 break;
372 case HighGuid::Player:
373 target = GetPlayer(step.targetGUID);
374 break;
377 target = GetGameObject(step.targetGUID);
378 break;
379 case HighGuid::Corpse:
380 target = GetCorpse(step.targetGUID);
381 break;
383 target = GetTransport(step.targetGUID);
384 break;
385 default:
386 TC_LOG_ERROR("scripts", "{} target with unsupported high guid {}.",
387 step.script->GetDebugInfo(), step.targetGUID.ToString());
388 break;
389 }
390 }
391
392 switch (step.script->command)
393 {
395 {
397 {
398 TC_LOG_ERROR("scripts", "{} invalid chat type ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->Talk.ChatType);
399 break;
400 }
401
403 source = _GetScriptPlayerSourceOrTarget(source, target, step.script);
404 else
405 source = _GetScriptCreatureSourceOrTarget(source, target, step.script);
406
407 if (source)
408 {
409 Unit* sourceUnit = source->ToUnit();
410 if (!sourceUnit)
411 {
412 TC_LOG_ERROR("scripts", "{} source object ({}) is not an unit, skipping.", step.script->GetDebugInfo(), source->GetGUID().ToString());
413 break;
414 }
415
416 switch (step.script->Talk.ChatType)
417 {
418 case CHAT_TYPE_SAY:
419 sourceUnit->Say(step.script->Talk.TextID, target);
420 break;
421 case CHAT_TYPE_YELL:
422 sourceUnit->Yell(step.script->Talk.TextID, target);
423 break;
426 sourceUnit->TextEmote(step.script->Talk.TextID, target, step.script->Talk.ChatType == CHAT_TYPE_BOSS_EMOTE);
427 break;
430 {
431 Player* receiver = target ? target->ToPlayer() : nullptr;
432 if (!receiver)
433 TC_LOG_ERROR("scripts", "{} attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo());
434 else
435 sourceUnit->Whisper(step.script->Talk.TextID, receiver, step.script->Talk.ChatType == CHAT_TYPE_BOSS_WHISPER);
436 break;
437 }
438 default:
439 break; // must be already checked at load
440 }
441 }
442 break;
443 }
444
446 // Source or target must be Creature.
447 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
448 {
450 cSource->SetEmoteState(Emote(step.script->Emote.EmoteID));
451 else
452 cSource->HandleEmoteCommand(static_cast<Emote>(step.script->Emote.EmoteID));
453 }
454 break;
455
457 // Source or target must be Creature.
458 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
459 {
460 // Validate field number.
461 if (step.script->FieldSet.FieldID <= OBJECT_FIELD_ENTRY || step.script->FieldSet.FieldID >= cSource->GetValuesCount())
462 TC_LOG_ERROR("scripts", "{} wrong field {} (max count: {}) in object (TypeId: {}, {}) specified, skipping.",
464 cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetGUID().ToString());
465 else
466 cSource->SetUInt32Value(step.script->FieldSet.FieldID, step.script->FieldSet.FieldValue);
467 }
468 break;
469
471 // Source or target must be Creature.
472 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
473 {
474 Unit* unit = (Unit*)cSource;
475 if (step.script->MoveTo.TravelTime != 0)
476 {
477 float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f);
478 unit->MonsterMoveWithSpeed(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, speed);
479 }
480 else
482 }
483 break;
484
486 // Source or target must be Creature.
487 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
488 {
489 // Validate field number.
490 if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
491 TC_LOG_ERROR("scripts", "{} wrong field {} (max count: {}) in object {} specified, skipping.",
493 cSource->GetValuesCount(), cSource->GetGUID().ToString());
494 else
495 cSource->SetFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
496 }
497 break;
498
500 // Source or target must be Creature.
501 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
502 {
503 // Validate field number.
504 if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
505 TC_LOG_ERROR("scripts", "{} wrong field {} (max count: {}) in object {} specified, skipping.",
507 cSource->GetValuesCount(), cSource->GetGUID().ToString());
508 else
509 cSource->RemoveFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
510 }
511 break;
512
515 {
516 // Source or target must be Creature.
517 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true))
518 cSource->NearTeleportTo(step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation);
519 }
520 else
521 {
522 // Source or target must be Player.
523 if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
524 player->TeleportTo(step.script->TeleportTo.MapID, step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation);
525 }
526 break;
527
529 {
530 if (!source)
531 {
532 TC_LOG_ERROR("scripts", "{} source object is NULL.", step.script->GetDebugInfo());
533 break;
534 }
535 if (!target)
536 {
537 TC_LOG_ERROR("scripts", "{} target object is NULL.", step.script->GetDebugInfo());
538 break;
539 }
540
541 // when script called for item spell casting then target == (unit or GO) and source is player
542 WorldObject* worldObject;
543 Player* player = target->ToPlayer();
544 if (player)
545 {
546 if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
547 {
548 TC_LOG_ERROR("scripts", "{} source is not unit, gameobject or player {}, skipping.",
549 step.script->GetDebugInfo(), source->GetGUID().ToString());
550 break;
551 }
552 worldObject = dynamic_cast<WorldObject*>(source);
553 }
554 else
555 {
556 player = source->ToPlayer();
557 if (player)
558 {
559 if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
560 {
561 TC_LOG_ERROR("scripts", "{} target is not unit, gameobject or player {}, skipping.",
562 step.script->GetDebugInfo(), target->GetGUID().ToString());
563 break;
564 }
565 worldObject = dynamic_cast<WorldObject*>(target);
566 }
567 else
568 {
569 TC_LOG_ERROR("scripts", "{} neither source nor target is player (source: {}; target: {}), skipping.",
570 step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str(),
571 target->GetGUID().ToString().c_str());
572 break;
573 }
574 }
575
576 ASSERT(worldObject);
577
578 // quest id and flags checked at script loading
579 if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->IsAlive()) &&
580 (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(player, float(step.script->QuestExplored.Distance))))
582 else
583 player->FailQuest(step.script->QuestExplored.QuestID);
584
585 break;
586 }
587
589 // Source or target must be Player.
590 if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
591 {
593 player->RewardPlayerAndGroupAtEvent(step.script->KillCredit.CreatureEntry, player);
594 else
595 player->KilledMonsterCredit(step.script->KillCredit.CreatureEntry);
596 }
597 break;
598
601 {
602 TC_LOG_ERROR("scripts", "{} gameobject guid (datalong) is not specified.", step.script->GetDebugInfo());
603 break;
604 }
605
606 // Source or target must be WorldObject.
607 if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
608 {
610 if (!pGO)
611 {
612 TC_LOG_ERROR("scripts", "{} gameobject was not found (guid: {}).", step.script->GetDebugInfo(), step.script->RespawnGameobject.GOGuid);
613 break;
614 }
615
620 {
621 TC_LOG_ERROR("scripts", "{} can not be used with gameobject of type {} (guid: {}).",
623 break;
624 }
625
626 // Check that GO is not spawned
627 if (!pGO->isSpawned())
628 {
629 int32 nTimeToDespawn = std::max(5, int32(step.script->RespawnGameobject.DespawnDelay));
631 pGO->SetRespawnTime(nTimeToDespawn);
632
633 pGO->GetMap()->AddToMap(pGO);
634 }
635 }
636 break;
637
639 {
640 // Source must be WorldObject.
641 if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
642 {
644 TC_LOG_ERROR("scripts", "{} creature entry (datalong) is not specified.", step.script->GetDebugInfo());
645 else
646 {
647 float x = step.script->TempSummonCreature.PosX;
648 float y = step.script->TempSummonCreature.PosY;
649 float z = step.script->TempSummonCreature.PosZ;
650 float o = step.script->TempSummonCreature.Orientation;
651
653 TC_LOG_ERROR("scripts", "{} creature was not spawned (entry: {}).", step.script->GetDebugInfo(), step.script->TempSummonCreature.CreatureEntry);
654 }
655 }
656 break;
657 }
658
661 _ScriptProcessDoor(source, target, step.script);
662 break;
663
665 // Source must be Unit.
666 if (Unit* unit = _GetScriptUnit(source, true, step.script))
667 {
668 // Target must be GameObject.
669 if (!target)
670 {
671 TC_LOG_ERROR("scripts", "{} target object is NULL.", step.script->GetDebugInfo());
672 break;
673 }
674
675 if (target->GetTypeId() != TYPEID_GAMEOBJECT)
676 {
677 TC_LOG_ERROR("scripts", "{} target object is not gameobject {}, skipping.",
678 step.script->GetDebugInfo(), target->GetGUID().ToString());
679 break;
680 }
681
682 if (GameObject* pGO = target->ToGameObject())
683 pGO->Use(unit);
684 }
685 break;
686
688 {
689 // Source (datalong2 != 0) or target (datalong2 == 0) must be Unit.
690 bool bReverse = step.script->RemoveAura.Flags & SF_REMOVEAURA_REVERSE;
691 if (Unit* unit = _GetScriptUnit(bReverse ? source : target, bReverse, step.script))
692 unit->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID);
693 break;
694 }
695
697 {
698 if (!source && !target)
699 {
700 TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", step.script->GetDebugInfo());
701 break;
702 }
703
704 WorldObject* uSource = nullptr;
705 WorldObject* uTarget = nullptr;
706 // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s)
707 switch (step.script->CastSpell.Flags)
708 {
709 case SF_CASTSPELL_SOURCE_TO_TARGET: // source -> target
710 uSource = dynamic_cast<WorldObject*>(source);
711 uTarget = target;
712 break;
713 case SF_CASTSPELL_SOURCE_TO_SOURCE: // source -> source
714 uSource = dynamic_cast<WorldObject*>(source);
715 uTarget = uSource;
716 break;
717 case SF_CASTSPELL_TARGET_TO_TARGET: // target -> target
718 uSource = target;
719 uTarget = uSource;
720 break;
721 case SF_CASTSPELL_TARGET_TO_SOURCE: // target -> source
722 uSource = target;
723 uTarget = dynamic_cast<WorldObject*>(source);
724 break;
725 case SF_CASTSPELL_SEARCH_CREATURE: // source -> creature with entry
726 uSource = dynamic_cast<WorldObject*>(source);
727 uTarget = uSource ? uSource->FindNearestCreature(abs(step.script->CastSpell.CreatureEntry), step.script->CastSpell.SearchRadius) : nullptr;
728 break;
729 }
730
731 if (!uSource)
732 {
733 TC_LOG_ERROR("scripts", "{} no source worldobject found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID);
734 break;
735 }
736
737 if (!uTarget)
738 {
739 TC_LOG_ERROR("scripts", "{} no target worldobject found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID);
740 break;
741 }
742
743 bool triggered = (step.script->CastSpell.Flags != 4) ?
746 uSource->CastSpell(uTarget, step.script->CastSpell.SpellID, triggered);
747 break;
748 }
749
751 // Source must be WorldObject.
752 if (WorldObject* object = _GetScriptWorldObject(source, true, step.script))
753 {
754 // PlaySound.Flags bitmask: 0/1=anyone/target
755 Player* player = nullptr;
757 {
758 // Target must be Player.
759 player = _GetScriptPlayer(target, false, step.script);
760 if (!target)
761 break;
762 }
763
764 // PlaySound.Flags bitmask: 0/2=without/with distance dependent
766 object->PlayDistanceSound(step.script->PlaySound.SoundID, player);
767 else
768 object->PlayDirectSound(step.script->PlaySound.SoundID, player);
769 }
770 break;
771
773 // Target or source must be Player.
774 if (Player* pReceiver = _GetScriptPlayerSourceOrTarget(source, target, step.script))
775 {
776 ItemPosCountVec dest;
777 InventoryResult msg = pReceiver->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, step.script->CreateItem.ItemEntry, step.script->CreateItem.Amount);
778 if (msg == EQUIP_ERR_OK)
779 {
780 if (Item* item = pReceiver->StoreNewItem(dest, step.script->CreateItem.ItemEntry, true))
781 pReceiver->SendNewItem(item, step.script->CreateItem.Amount, false, true);
782 }
783 else
784 pReceiver->SendEquipError(msg, nullptr, nullptr, step.script->CreateItem.ItemEntry);
785 }
786 break;
787
789 // First try with target or source creature, then with target or source gameobject
790 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true))
791 cSource->DespawnOrUnsummon(Milliseconds(step.script->DespawnSelf.DespawnDelay));
792 else if (GameObject* goSource = _GetScriptGameObjectSourceOrTarget(source, target, step.script, true))
793 goSource->DespawnOrUnsummon(Milliseconds(step.script->DespawnSelf.DespawnDelay));
794 break;
795
797 // Source must be Unit.
798 if (Unit* unit = _GetScriptUnit(source, true, step.script))
799 {
800 if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID))
801 TC_LOG_ERROR("scripts", "{} source object has an invalid path ({}), skipping.", step.script->GetDebugInfo(), step.script->LoadPath.PathID);
802 else
803 unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable != 0);
804 }
805 break;
806
808 {
810 {
811 TC_LOG_ERROR("scripts", "{} creature entry is not specified, skipping.", step.script->GetDebugInfo());
812 break;
813 }
814 if (!step.script->CallScript.ScriptID)
815 {
816 TC_LOG_ERROR("scripts", "{} script id is not specified, skipping.", step.script->GetDebugInfo());
817 break;
818 }
819
820 Creature* cTarget = nullptr;
821 auto creatureBounds = _creatureBySpawnIdStore.equal_range(step.script->CallScript.CreatureEntry);
822 if (creatureBounds.first != creatureBounds.second)
823 {
824 // Prefer alive (last respawned) creature
825 auto creatureItr = std::find_if(creatureBounds.first, creatureBounds.second, [](Map::CreatureBySpawnIdContainer::value_type const& pair)
826 {
827 return pair.second->IsAlive();
828 });
829
830 cTarget = creatureItr != creatureBounds.second ? creatureItr->second : creatureBounds.first->second;
831 }
832
833 if (!cTarget)
834 {
835 TC_LOG_ERROR("scripts", "{} target was not found (entry: {})", step.script->GetDebugInfo(), step.script->CallScript.CreatureEntry);
836 break;
837 }
838
839 //Lets choose our ScriptMap map
841 //if no scriptmap present...
842 if (!datamap)
843 {
844 TC_LOG_ERROR("scripts", "{} unknown scriptmap ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->CallScript.ScriptType);
845 break;
846 }
847
848 // Insert script into schedule but do not start it
849 ScriptsStart(*datamap, step.script->CallScript.ScriptID, cTarget, nullptr);
850 break;
851 }
852
854 // Source or target must be Creature.
855 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
856 {
857 if (cSource->isDead())
858 TC_LOG_ERROR("scripts", "{} creature is already dead {}",
859 step.script->GetDebugInfo(), cSource->GetGUID().ToString());
860 else
861 {
862 cSource->setDeathState(JUST_DIED);
863 if (step.script->Kill.RemoveCorpse == 1)
864 cSource->RemoveCorpse();
865 }
866 }
867 break;
868
870 // Source must be Unit.
871 if (Unit* sourceUnit = _GetScriptUnit(source, true, step.script))
872 {
874 {
875 // Target must be Unit.
876 Unit* targetUnit = _GetScriptUnit(target, false, step.script);
877 if (!targetUnit)
878 break;
879
880 sourceUnit->SetFacingToObject(targetUnit);
881 }
882 else
883 sourceUnit->SetFacingTo(step.script->Orientation.Orientation);
884 }
885 break;
886
888 // Source must be Creature.
889 if (Creature* cSource = _GetScriptCreature(source, true, step.script))
890 cSource->LoadEquipment(step.script->Equip.EquipmentID);
891 break;
892
894 // Source must be Creature.
895 if (Creature* cSource = _GetScriptCreature(source, true, step.script))
896 cSource->SetDisplayId(step.script->Model.ModelID);
897 break;
898
900 // Source must be Player.
901 if (Player* player = _GetScriptPlayer(source, true, step.script))
902 player->PlayerTalkClass->SendCloseGossip();
903 break;
904
906 // Source must be Player.
907 if (Player* player = _GetScriptPlayer(source, true, step.script))
908 player->SendMovieStart(step.script->PlayMovie.MovieID);
909 break;
910
912 // Source must be Creature.
913 if (Creature* cSource = _GetScriptCreature(source, true, step.script))
914 {
915 if (!cSource->IsAlive())
916 return;
917
918 cSource->GetMotionMaster()->MoveIdle();
919
920 switch (step.script->Movement.MovementType)
921 {
923 cSource->GetMotionMaster()->MoveRandom((float)step.script->Movement.MovementDistance);
924 break;
926 cSource->GetMotionMaster()->MovePath(step.script->Movement.Path, false);
927 break;
928 }
929 }
930 break;
931
932 default:
933 TC_LOG_ERROR("scripts", "Unknown script command {}.", step.script->GetDebugInfo());
934 break;
935 }
936
937 m_scriptSchedule.erase(iter);
938 iter = m_scriptSchedule.begin();
939 sMapMgr->DecreaseScheduledScriptCount();
940 }
941}
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
#define ASSERT
Definition Errors.h:68
@ GO_READY
Definition GameObject.h:77
InventoryResult
Definition ItemDefines.h:25
@ EQUIP_ERR_OK
Definition ItemDefines.h:26
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
#define sMapMgr
Definition MapManager.h:211
@ WAYPOINT_MOTION_TYPE
@ RANDOM_MOTION_TYPE
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
@ TYPEID_GAMEOBJECT
Definition ObjectGuid.h:40
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
Definition ObjectMgr.cpp:75
@ SF_CASTSPELL_SOURCE_TO_SOURCE
Definition ObjectMgr.h:201
@ SF_CASTSPELL_SOURCE_TO_TARGET
Definition ObjectMgr.h:200
@ SF_CASTSPELL_TRIGGERED
Definition ObjectMgr.h:205
@ SF_CASTSPELL_TARGET_TO_SOURCE
Definition ObjectMgr.h:203
@ SF_REMOVEAURA_REVERSE
Definition ObjectMgr.h:197
@ SF_PLAYSOUND_DISTANCE_SOUND
Definition ObjectMgr.h:209
@ SF_TALK_USE_PLAYER
Definition ObjectMgr.h:185
@ SF_TELEPORT_USE_CREATURE
Definition ObjectMgr.h:191
@ SF_KILLCREDIT_REWARD_GROUP
Definition ObjectMgr.h:194
@ SF_PLAYSOUND_TARGET_PLAYER
Definition ObjectMgr.h:208
@ SF_CASTSPELL_TARGET_TO_TARGET
Definition ObjectMgr.h:202
@ SF_EMOTE_USE_STATE
Definition ObjectMgr.h:188
@ SF_CASTSPELL_SEARCH_CREATURE
Definition ObjectMgr.h:204
@ SF_ORIENTATION_FACE_TARGET
Definition ObjectMgr.h:212
std::multimap< uint32, ScriptInfo > ScriptMap
Definition ObjectMgr.h:410
@ SCRIPT_COMMAND_EMOTE
Definition ObjectMgr.h:103
@ SCRIPT_COMMAND_CREATE_ITEM
Definition ObjectMgr.h:119
@ SCRIPT_COMMAND_DESPAWN_SELF
Definition ObjectMgr.h:120
@ SCRIPT_COMMAND_CLOSE_DOOR
Definition ObjectMgr.h:114
@ SCRIPT_COMMAND_CAST_SPELL
Definition ObjectMgr.h:117
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
Definition ObjectMgr.h:111
@ SCRIPT_COMMAND_QUEST_EXPLORED
Definition ObjectMgr.h:109
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
Definition ObjectMgr.h:115
@ SCRIPT_COMMAND_TALK
Definition ObjectMgr.h:102
@ SCRIPT_COMMAND_OPEN_DOOR
Definition ObjectMgr.h:113
@ SCRIPT_COMMAND_EQUIP
Definition ObjectMgr.h:128
@ SCRIPT_COMMAND_FIELD_SET
Definition ObjectMgr.h:104
@ SCRIPT_COMMAND_PLAYMOVIE
Definition ObjectMgr.h:131
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
Definition ObjectMgr.h:123
@ SCRIPT_COMMAND_TELEPORT_TO
Definition ObjectMgr.h:108
@ SCRIPT_COMMAND_MOVE_TO
Definition ObjectMgr.h:105
@ SCRIPT_COMMAND_FLAG_SET
Definition ObjectMgr.h:106
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
Definition ObjectMgr.h:112
@ SCRIPT_COMMAND_MOVEMENT
Definition ObjectMgr.h:132
@ SCRIPT_COMMAND_KILL_CREDIT
Definition ObjectMgr.h:110
@ SCRIPT_COMMAND_KILL
Definition ObjectMgr.h:124
@ SCRIPT_COMMAND_LOAD_PATH
Definition ObjectMgr.h:122
@ SCRIPT_COMMAND_ORIENTATION
Definition ObjectMgr.h:127
@ SCRIPT_COMMAND_PLAY_SOUND
Definition ObjectMgr.h:118
@ SCRIPT_COMMAND_MODEL
Definition ObjectMgr.h:129
@ SCRIPT_COMMAND_CLOSE_GOSSIP
Definition ObjectMgr.h:130
@ SCRIPT_COMMAND_REMOVE_AURA
Definition ObjectMgr.h:116
@ SCRIPT_COMMAND_FLAG_REMOVE
Definition ObjectMgr.h:107
@ CHAT_TYPE_SAY
Definition ObjectMgr.h:138
@ CHAT_TYPE_BOSS_WHISPER
Definition ObjectMgr.h:143
@ CHAT_TYPE_TEXT_EMOTE
Definition ObjectMgr.h:140
@ CHAT_TYPE_BOSS_EMOTE
Definition ObjectMgr.h:141
@ CHAT_TYPE_WHISPER
Definition ObjectMgr.h:142
@ CHAT_TYPE_YELL
Definition ObjectMgr.h:139
std::map< uint32, ScriptMap > ScriptMapMap
Definition ObjectMgr.h:411
ScriptsType
Definition ObjectMgr.h:173
std::vector< ItemPosCount > ItemPosCountVec
Definition Player.h:624
@ GAMEOBJECT_TYPE_BUTTON
@ GAMEOBJECT_TYPE_TRAP
@ GAMEOBJECT_TYPE_FISHINGNODE
@ GAMEOBJECT_TYPE_DOOR
@ GO_STATE_READY
@ JUST_DIED
Definition Unit.h:212
@ NULL_BAG
Definition Unit.h:61
@ NULL_SLOT
Definition Unit.h:62
@ OBJECT_FIELD_ENTRY
#define sWaypointMgr
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
GOState GetGoState() const
Definition GameObject.h:178
bool isSpawned() const
Definition GameObject.h:155
void SetLootState(LootState s, Unit *unit=nullptr)
void SetRespawnTime(int32 respawn)
GameobjectTypes GetGoType() const
Definition GameObject.h:176
Definition Item.h:62
Player * _GetScriptPlayer(Object *obj, bool isSource, ScriptInfo const *scriptInfo) const
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Put scripts in the execution queue.
Pet * GetPet(ObjectGuid const &guid)
Definition Map.cpp:4435
bool AddToMap(T *)
Definition Map.cpp:630
GameObject * _FindGameObject(WorldObject *pWorldObject, ObjectGuid::LowType guid) const
Player * GetPlayer(ObjectGuid const &guid)
Definition Map.cpp:4387
Creature * _GetScriptCreature(Object *obj, bool isSource, ScriptInfo const *scriptInfo) const
GameObject * _GetScriptGameObjectSourceOrTarget(Object *source, Object *target, ScriptInfo const *scriptInfo, bool bReverse=false) const
void ScriptsProcess()
Process queued scripts.
ScriptScheduleMap m_scriptSchedule
Definition Map.h:727
void ScriptCommandStart(ScriptInfo const &script, uint32 delay, Object *source, Object *target)
void _ScriptProcessDoor(Object *source, Object *target, ScriptInfo const *scriptInfo) const
bool i_scriptLock
Definition Map.h:721
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:4430
WorldObject * _GetScriptWorldObject(Object *obj, bool isSource, ScriptInfo const *scriptInfo) const
Corpse * GetCorpse(ObjectGuid const &guid)
Definition Map.cpp:4392
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
Definition Map.h:496
Player * _GetScriptPlayerSourceOrTarget(Object *source, Object *target, ScriptInfo const *scriptInfo) const
Unit * _GetScriptUnit(Object *obj, bool isSource, ScriptInfo const *scriptInfo) const
CreatureBySpawnIdContainer _creatureBySpawnIdStore
Definition Map.h:854
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:4397
Transport * GetTransport(ObjectGuid const &guid)
Definition Map.cpp:4440
Creature * _GetScriptCreatureSourceOrTarget(Object *source, Object *target, ScriptInfo const *scriptInfo, bool bReverse=false) const
static ObjectGuid const Empty
Definition ObjectGuid.h:140
bool IsEmpty() const
Definition ObjectGuid.h:172
std::string ToString() const
uint32 LowType
Definition ObjectGuid.h:142
HighGuid GetHigh() const
Definition ObjectGuid.h:154
static Creature * ToCreature(Object *o)
Definition Object.h:186
static Unit * ToUnit(Object *o)
Definition Object.h:192
static GameObject * ToGameObject(Object *o)
Definition Object.h:198
bool IsUnit() const
Definition Object.h:191
TypeID GetTypeId() const
Definition Object.h:93
GameObject * ToGameObject()
Definition Object.h:200
uint32 GetEntry() const
Definition Object.h:81
Item * ToItem()
Definition Object.h:176
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
static Player * ToPlayer(Object *o)
Definition Object.h:180
void AreaExploredOrEventHappens(uint32 questId)
Definition Player.cpp:16008
void FailQuest(uint32 quest_id)
Definition Player.cpp:15040
Definition Unit.h:769
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition Unit.cpp:13834
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition Unit.cpp:13839
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition Unit.cpp:13844
void NearTeleportTo(Position const &pos, bool casting=false)
Definition Unit.cpp:12832
virtual void Whisper(std::string_view text, Language language, Player *target, bool isBossWhisper=false)
Definition Unit.cpp:13849
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
Definition Unit.cpp:518
Map * GetMap() const
Definition Object.h:449
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2099
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1192
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1123
time_t GetGameTime()
Definition GameTime.cpp:42
float GetOrientation() const
Definition Position.h:82
ObjectGuid targetGUID
Definition Map.h:76
ObjectGuid ownerGUID
Definition Map.h:77
ObjectGuid sourceGUID
Definition Map.h:75
ScriptInfo const * script
‍owner of source if source is item
Definition Map.h:78
float Orientation
Definition ObjectMgr.h:276
uint32 Flags
Definition ObjectMgr.h:233
struct ScriptInfo::@228::@234 MoveTo
uint32 FieldID
Definition ObjectMgr.h:245
uint32 QuestID
Definition ObjectMgr.h:281
float SearchRadius
Definition ObjectMgr.h:330
int32 TextID
Definition ObjectMgr.h:234
struct ScriptInfo::@228::@242 RemoveAura
struct ScriptInfo::@228::@241 ToggleDoor
struct ScriptInfo::@228::@252 Model
struct ScriptInfo::@228::@231 Talk
uint32 MovementType
Definition ObjectMgr.h:401
uint32 MovementDistance
Definition ObjectMgr.h:402
struct ScriptInfo::@228::@235 FlagToggle
float DestX
Definition ObjectMgr.h:255
uint32 ItemEntry
Definition ObjectMgr.h:341
uint32 ChatType
Definition ObjectMgr.h:232
uint32 SoundID
Definition ObjectMgr.h:335
struct ScriptInfo::@228::@244 PlaySound
uint32 ScriptID
Definition ObjectMgr.h:359
struct ScriptInfo::@228::@247 LoadPath
struct ScriptInfo::@228::@237 QuestExplored
uint32 ModelID
Definition ObjectMgr.h:389
struct ScriptInfo::@228::@253 PlayMovie
uint32 FieldValue
Definition ObjectMgr.h:246
struct ScriptInfo::@228::@232 Emote
float PosY
Definition ObjectMgr.h:304
ScriptCommands command
Definition ObjectMgr.h:220
float DestY
Definition ObjectMgr.h:256
uint32 PathID
Definition ObjectMgr.h:352
uint32 MapID
Definition ObjectMgr.h:269
uint32 IsRepeatable
Definition ObjectMgr.h:353
int32 Path
Definition ObjectMgr.h:403
struct ScriptInfo::@228::@233 FieldSet
int32 RemoveCorpse
Definition ObjectMgr.h:367
float PosZ
Definition ObjectMgr.h:305
struct ScriptInfo::@228::@236 TeleportTo
uint32 ScriptType
Definition ObjectMgr.h:360
uint32 ResetDelay
Definition ObjectMgr.h:313
ObjectGuid::LowType GOGuid
Definition ObjectMgr.h:293
uint32 DespawnDelay
Definition ObjectMgr.h:294
struct ScriptInfo::@228::@239 RespawnGameobject
float PosX
Definition ObjectMgr.h:303
struct ScriptInfo::@228::@243 CastSpell
struct ScriptInfo::@228::@254 Movement
struct ScriptInfo::@228::@248 CallScript
uint32 TravelTime
Definition ObjectMgr.h:252
uint32 Distance
Definition ObjectMgr.h:282
struct ScriptInfo::@228::@246 DespawnSelf
uint32 SpellID
Definition ObjectMgr.h:320
std::string GetDebugInfo() const
struct ScriptInfo::@228::@238 KillCredit
float DestZ
Definition ObjectMgr.h:257
uint32 MovieID
Definition ObjectMgr.h:396
struct ScriptInfo::@228::@249 Kill
uint32 EquipmentID
Definition ObjectMgr.h:384
struct ScriptInfo::@228::@251 Equip
struct ScriptInfo::@228::@245 CreateItem
struct ScriptInfo::@228::@240 TempSummonCreature
uint32 CreatureEntry
Definition ObjectMgr.h:287
uint32 Amount
Definition ObjectMgr.h:342
uint32 EmoteID
Definition ObjectMgr.h:239