Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
MapScripts.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "CellImpl.h"
7#include "GossipDef.h"
8#include "GridNotifiers.h"
9#include "GridNotifiersImpl.h"
10#include "Map.h"
11#include "MapManager.h"
12#include "MapRefManager.h"
13#include "ObjectMgr.h"
14#include "Pet.h"
15#include "ScriptedCreature.h"
16#include "ScriptMgr.h"
17#include "Transport.h"
18#include "WaypointManager.h"
19#include "World.h"
20
22void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target)
23{
25 ScriptMapMap::const_iterator s = scripts.find(id);
26 if (s == scripts.end())
27 return;
28
29 // prepare static data
30 uint64 sourceGUID = source ? source->GetGUID() : uint64(0); //some script commands doesn't have source
31 uint64 targetGUID = target ? target->GetGUID() : uint64(0);
32 uint64 ownerGUID = (source && source->GetTypeId() == TypeID::TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0);
33
35 ScriptMap const* s2 = &(s->second);
36 bool immedScript = false;
37 for (ScriptMap::const_iterator iter = s2->begin(); iter != s2->end(); ++iter)
38 {
39 ScriptAction sa;
40 sa.sourceGUID = sourceGUID;
41 sa.targetGUID = targetGUID;
42 sa.ownerGUID = ownerGUID;
43
44 sa.script = &iter->second;
45 m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld->GetGameTime() + iter->first), sa));
46 if (iter->first == 0)
47 immedScript = true;
48
49 sScriptMgr->IncreaseScheduledScriptsCount();
50 }
52 if (/*start &&*/ immedScript && !i_scriptLock)
53 {
54 i_scriptLock = true;
56 i_scriptLock = false;
57 }
58}
59
60void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target)
61{
62 // NOTE: script record _must_ exist until command executed
63
64 // prepare static data
65 uint64 sourceGUID = source ? source->GetGUID() : uint64(0);
66 uint64 targetGUID = target ? target->GetGUID() : uint64(0);
67 uint64 ownerGUID = (source && source->GetTypeId() == TypeID::TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0);
68
69 ScriptAction sa;
70 sa.sourceGUID = sourceGUID;
71 sa.targetGUID = targetGUID;
72 sa.ownerGUID = ownerGUID;
73
74 sa.script = &script;
75 m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld->GetGameTime() + delay), sa));
76
77 sScriptMgr->IncreaseScheduledScriptsCount();
78
80 if (delay == 0 && !i_scriptLock)
81 {
82 i_scriptLock = true;
84 i_scriptLock = false;
85 }
86}
87
88// Helpers for ScriptProcess method.
89inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo) const
90{
91 Player* player = NULL;
92 if (!source && !target)
93 SF_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
94 else
95 {
96 // Check target first, then source.
97 if (target)
98 player = target->ToPlayer();
99 if (!player && source)
100 player = source->ToPlayer();
101
102 if (!player)
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.",
104 scriptInfo->GetDebugInfo().c_str(),
105 source ? uint8(source->GetTypeId()) : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
106 target ? uint8(target->GetTypeId()) : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
107 }
108 return player;
109}
110
111inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo, bool bReverse) const
112{
113 Creature* creature = NULL;
114 if (!source && !target)
115 SF_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
116 else
117 {
118 if (bReverse)
119 {
120 // Check target first, then source.
121 if (target)
122 creature = target->ToCreature();
123 if (!creature && source)
124 creature = source->ToCreature();
125 }
126 else
127 {
128 // Check source first, then target.
129 if (source)
130 creature = source->ToCreature();
131 if (!creature && target)
132 creature = target->ToCreature();
133 }
134
135 if (!creature)
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.",
137 scriptInfo->GetDebugInfo().c_str(),
138 source ? uint8(source->GetTypeId()) : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
139 target ? uint8(target->GetTypeId()) : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
140 }
141 return creature;
142}
143
144inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
145{
146 Unit* unit = NULL;
147 if (!obj)
148 SF_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
149 else if (!obj->isType(TYPEMASK_UNIT))
150 SF_LOG_ERROR("scripts", "%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.",
151 scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", uint8(obj->GetTypeId()), obj->GetEntry(), obj->GetGUIDLow());
152 else
153 {
154 unit = obj->ToUnit();
155 if (!unit)
156 SF_LOG_ERROR("scripts", "%s %s object could not be casted to unit.",
157 scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
158 }
159 return unit;
160}
161
162inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
163{
164 Player* player = NULL;
165 if (!obj)
166 SF_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
167 else
168 {
169 player = obj->ToPlayer();
170 if (!player)
171 SF_LOG_ERROR("scripts", "%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
172 scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", uint8(obj->GetTypeId()), obj->GetEntry(), obj->GetGUIDLow());
173 }
174 return player;
175}
176
177inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
178{
179 Creature* creature = NULL;
180 if (!obj)
181 SF_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
182 else
183 {
184 creature = obj->ToCreature();
185 if (!creature)
186 SF_LOG_ERROR("scripts", "%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
187 isSource ? "source" : "target", uint8(obj->GetTypeId()), obj->GetEntry(), obj->GetGUIDLow());
188 }
189 return creature;
190}
191
192inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
193{
194 WorldObject* pWorldObject = NULL;
195 if (!obj)
196 SF_LOG_ERROR("scripts", "%s %s object is NULL.",
197 scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
198 else
199 {
200 pWorldObject = dynamic_cast<WorldObject*>(obj);
201 if (!pWorldObject)
202 SF_LOG_ERROR("scripts", "%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).",
203 scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", uint8(obj->GetTypeId()), obj->GetEntry(), obj->GetGUIDLow());
204 }
205 return pWorldObject;
206}
207
208inline void Map::_ScriptProcessDoor(Object* source, Object* target, const ScriptInfo* scriptInfo) const
209{
210 bool bOpen = false;
211 uint32 guid = scriptInfo->ToggleDoor.GOGuid;
212 int32 nTimeToToggle = std::max(15, int32(scriptInfo->ToggleDoor.ResetDelay));
213 switch (scriptInfo->command)
214 {
215 case ScriptCommands::SCRIPT_COMMAND_OPEN_DOOR: bOpen = true; break;
217 default:
218 SF_LOG_ERROR("scripts", "%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str());
219 return;
220 }
221 if (!guid)
222 SF_LOG_ERROR("scripts", "%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str());
223 else if (!source)
224 SF_LOG_ERROR("scripts", "%s source object is NULL.", scriptInfo->GetDebugInfo().c_str());
225 else if (!source->isType(TYPEMASK_UNIT))
226 SF_LOG_ERROR("scripts", "%s source object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->GetDebugInfo().c_str(),
227 uint8(source->GetTypeId()), source->GetEntry(), source->GetGUIDLow());
228 else
229 {
230 WorldObject* wSource = dynamic_cast <WorldObject*> (source);
231 if (!wSource)
232 SF_LOG_ERROR("scripts", "%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
233 scriptInfo->GetDebugInfo().c_str(), uint8(source->GetTypeId()), source->GetEntry(), source->GetGUIDLow());
234 else
235 {
236 GameObject* pDoor = _FindGameObject(wSource, guid);
237 if (!pDoor)
238 SF_LOG_ERROR("scripts", "%s gameobject was not found (guid: %u).", scriptInfo->GetDebugInfo().c_str(), guid);
239 else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR)
240 SF_LOG_ERROR("scripts", "%s gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
241 scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetEntry(), pDoor->GetGUIDLow());
242 else if (bOpen == (pDoor->GetGoState() == GOState::GO_STATE_READY))
243 {
244 pDoor->UseDoorOrButton(nTimeToToggle);
245
246 if (target && target->isType(TYPEMASK_GAMEOBJECT))
247 {
248 GameObject* goTarget = target->ToGameObject();
249 if (goTarget && goTarget->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
250 goTarget->UseDoorOrButton(nTimeToToggle);
251 }
252 }
253 }
254 }
255}
256
257inline GameObject* Map::_FindGameObject(WorldObject* searchObject, uint32 guid) const
258{
259 GameObject* gameobject = NULL;
260
261 CellCoord p(Skyfire::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
262 Cell cell(p);
263
264 Skyfire::GameObjectWithDbGUIDCheck goCheck(*searchObject, guid);
265 Skyfire::GameObjectSearcher<Skyfire::GameObjectWithDbGUIDCheck> checker(searchObject, gameobject, goCheck);
266
268 cell.Visit(p, objectChecker, *searchObject->GetMap(), *searchObject, searchObject->GetGridActivationRange());
269
270 return gameobject;
271}
272
275{
276 if (m_scriptSchedule.empty())
277 return;
278
280 ScriptScheduleMap::iterator iter = m_scriptSchedule.begin();
281 // ok as multimap is a *sorted* associative container
282 while (!m_scriptSchedule.empty() && (iter->first <= sWorld->GetGameTime()))
283 {
284 ScriptAction const& step = iter->second;
285
286 Object* source = NULL;
287 if (step.sourceGUID)
288 {
289 switch (GUID_HIPART(step.sourceGUID))
290 {
291 case HIGHGUID_ITEM: // as well as HIGHGUID_CONTAINER
292 if (Player* player = HashMapHolder<Player>::Find(step.ownerGUID))
293 source = player->GetItemByGuid(step.sourceGUID);
294 break;
295 case HIGHGUID_UNIT:
296 case HIGHGUID_VEHICLE:
298 break;
299 case HIGHGUID_PET:
301 break;
302 case HIGHGUID_PLAYER:
304 break;
308 break;
309 case HIGHGUID_CORPSE:
311 break;
313 {
315 source = go ? go->ToTransport() : NULL;
316 break;
317 }
318 default:
319 SF_LOG_ERROR("scripts", "%s source with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
320 step.script->GetDebugInfo().c_str(), step.sourceGUID, GUID_HIPART(step.sourceGUID));
321 break;
322 }
323 }
324
325 WorldObject* target = NULL;
326 if (step.targetGUID)
327 {
328 switch (GUID_HIPART(step.targetGUID))
329 {
330 case HIGHGUID_UNIT:
331 case HIGHGUID_VEHICLE:
333 break;
334 case HIGHGUID_PET:
336 break;
337 case HIGHGUID_PLAYER: // empty GUID case also
339 break;
343 break;
344 case HIGHGUID_CORPSE:
346 break;
348 {
350 target = go ? go->ToTransport() : NULL;
351 break;
352 }
353 default:
354 SF_LOG_ERROR("scripts", "%s target with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
355 step.script->GetDebugInfo().c_str(), step.targetGUID, GUID_HIPART(step.targetGUID));
356 break;
357 }
358 }
359
360 switch (step.script->command)
361 {
364 {
365 SF_LOG_ERROR("scripts", "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType);
366 break;
367 }
369 {
370 if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
371 {
372 LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
373 std::string text(sObjectMgr->GetSkyFireString(step.script->Talk.TextID, loc_idx));
374
375 switch (step.script->Talk.ChatType)
376 {
377 case CHAT_TYPE_SAY:
378 player->Say(text, Language::LANG_UNIVERSAL);
379 break;
380 case CHAT_TYPE_YELL:
381 player->Yell(text, Language::LANG_UNIVERSAL);
382 break;
385 player->TextEmote(text);
386 break;
389 {
390 uint64 targetGUID = target ? target->GetGUID() : 0;
391 if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
392 SF_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
393 else
394 player->Whisper(text, Language::LANG_UNIVERSAL, targetGUID);
395 break;
396 }
397 default:
398 break; // must be already checked at load
399 }
400 }
401 }
402 else
403 {
404 // Source or target must be Creature.
405 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
406 {
407 uint64 targetGUID = target ? target->GetGUID() : 0;
408 switch (step.script->Talk.ChatType)
409 {
410 case CHAT_TYPE_SAY:
411 cSource->MonsterSay(step.script->Talk.TextID, Language::LANG_UNIVERSAL, target);
412 break;
413 case CHAT_TYPE_YELL:
414 cSource->MonsterYell(step.script->Talk.TextID, Language::LANG_UNIVERSAL, target);
415 break;
417 cSource->MonsterTextEmote(step.script->Talk.TextID, target);
418 break;
420 cSource->MonsterTextEmote(step.script->Talk.TextID, target, true);
421 break;
423 if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
424 SF_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
425 else
426 cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer());
427 break;
429 if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
430 SF_LOG_ERROR("scripts", "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
431 else
432 cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer(), true);
433 break;
434 default:
435 break; // must be already checked at load
436 }
437 }
438 }
439 break;
440
442 // Source or target must be Creature.
443 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
444 {
446 cSource->SetUInt32Value(UNIT_FIELD_NPC_EMOTESTATE, step.script->Emote.EmoteID);
447 else
448 cSource->HandleEmoteCommand(step.script->Emote.EmoteID);
449 }
450 break;
451
453 // Source or target must be Creature.
454 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
455 {
456 // Validate field number.
457 if (step.script->FieldSet.FieldID <= OBJECT_FIELD_ENTRY_ID || step.script->FieldSet.FieldID >= cSource->GetValuesCount())
458 SF_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
459 step.script->GetDebugInfo().c_str(), step.script->FieldSet.FieldID,
460 cSource->GetValuesCount(), uint8(cSource->GetTypeId()), cSource->GetEntry(), cSource->GetGUIDLow());
461 else
462 cSource->SetUInt32Value(step.script->FieldSet.FieldID, step.script->FieldSet.FieldValue);
463 }
464 break;
465
467 // Source or target must be Creature.
468 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
469 {
470 Unit* unit = (Unit*)cSource;
471 if (step.script->MoveTo.TravelTime != 0)
472 {
473 float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f);
474 unit->MonsterMoveWithSpeed(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, speed);
475 }
476 else
478 }
479 break;
480
482 // Source or target must be Creature.
483 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
484 {
485 // Validate field number.
486 if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY_ID || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
487 SF_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
488 step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
489 cSource->GetValuesCount(), uint8(cSource->GetTypeId()), cSource->GetEntry(), cSource->GetGUIDLow());
490 else
491 cSource->SetFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
492 }
493 break;
494
496 // Source or target must be Creature.
497 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
498 {
499 // Validate field number.
500 if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY_ID || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
501 SF_LOG_ERROR("scripts", "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
502 step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
503 cSource->GetValuesCount(), uint8(cSource->GetTypeId()), cSource->GetEntry(), cSource->GetGUIDLow());
504 else
505 cSource->RemoveFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
506 }
507 break;
508
511 {
512 // Source or target must be Creature.
513 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true))
514 cSource->NearTeleportTo(step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation);
515 }
516 else
517 {
518 // Source or target must be Player.
519 if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
520 player->TeleportTo(step.script->TeleportTo.MapID, step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation);
521 }
522 break;
523
525 {
526 if (!source)
527 {
528 SF_LOG_ERROR("scripts", "%s source object is NULL.", step.script->GetDebugInfo().c_str());
529 break;
530 }
531 if (!target)
532 {
533 SF_LOG_ERROR("scripts", "%s target object is NULL.", step.script->GetDebugInfo().c_str());
534 break;
535 }
536
537 // when script called for item spell casting then target == (unit or GO) and source is player
538 WorldObject* worldObject;
539 Player* player = target->ToPlayer();
540 if (player)
541 {
543 {
544 SF_LOG_ERROR("scripts", "%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
545 step.script->GetDebugInfo().c_str(), uint8(source->GetTypeId()), source->GetEntry(), source->GetGUIDLow());
546 break;
547 }
548 worldObject = dynamic_cast<WorldObject*>(source);
549 }
550 else
551 {
552 player = source->ToPlayer();
553 if (player)
554 {
556 {
557 SF_LOG_ERROR("scripts", "%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
558 step.script->GetDebugInfo().c_str(), uint8(target->GetTypeId()), target->GetEntry(), target->GetGUIDLow());
559 break;
560 }
561 worldObject = dynamic_cast<WorldObject*>(target);
562 }
563 else
564 {
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.",
566 step.script->GetDebugInfo().c_str(), uint8(source->GetTypeId()), source->GetEntry(), source->GetGUIDLow(),
567 uint8(target->GetTypeId()), target->GetEntry(), target->GetGUIDLow());
568 break;
569 }
570 }
571
572 // quest id and flags checked at script loading
573 if ((worldObject->GetTypeId() != TypeID::TYPEID_UNIT || ((Unit*)worldObject)->IsAlive()) &&
574 (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(player, float(step.script->QuestExplored.Distance))))
576 else
577 player->FailQuest(step.script->QuestExplored.QuestID);
578
579 break;
580 }
581
583 // Source or target must be Player.
584 if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script))
585 {
587 player->RewardPlayerAndGroupAtEvent(step.script->KillCredit.CreatureEntry, player);
588 else
589 player->KilledMonsterCredit(step.script->KillCredit.CreatureEntry, 0);
590 }
591 break;
592
595 {
596 SF_LOG_ERROR("scripts", "%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str());
597 break;
598 }
599
600 // Source or target must be WorldObject.
601 if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
602 {
604 if (!pGO)
605 {
606 SF_LOG_ERROR("scripts", "%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid);
607 break;
608 }
609
614 {
615 SF_LOG_ERROR("scripts", "%s can not be used with gameobject of type %u (guid: %u).",
616 step.script->GetDebugInfo().c_str(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid);
617 break;
618 }
619
620 // Check that GO is not spawned
621 if (!pGO->isSpawned())
622 {
623 int32 nTimeToDespawn = std::max(5, int32(step.script->RespawnGameobject.DespawnDelay));
625 pGO->SetRespawnTime(nTimeToDespawn);
626
627 pGO->GetMap()->AddToMap(pGO);
628 }
629 }
630 break;
631
633 {
634 // Source must be WorldObject.
635 if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
636 {
638 SF_LOG_ERROR("scripts", "%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str());
639 else
640 {
641 float x = step.script->TempSummonCreature.PosX;
642 float y = step.script->TempSummonCreature.PosY;
643 float z = step.script->TempSummonCreature.PosZ;
644 float o = step.script->TempSummonCreature.Orientation;
645
647 SF_LOG_ERROR("scripts", "%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry);
648 }
649 }
650 break;
651 }
652
655 _ScriptProcessDoor(source, target, step.script);
656 break;
657
659 // Source must be Unit.
660 if (Unit* unit = _GetScriptUnit(source, true, step.script))
661 {
662 // Target must be GameObject.
663 if (!target)
664 {
665 SF_LOG_ERROR("scripts", "%s target object is NULL.", step.script->GetDebugInfo().c_str());
666 break;
667 }
668
669 if (target->GetTypeId() != TypeID::TYPEID_GAMEOBJECT)
670 {
671 SF_LOG_ERROR("scripts", "%s target object is not gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",
672 step.script->GetDebugInfo().c_str(), uint8(target->GetTypeId()), target->GetEntry(), target->GetGUIDLow());
673 break;
674 }
675
676 if (GameObject* pGO = target->ToGameObject())
677 pGO->Use(unit);
678 }
679 break;
680
682 {
683 // Source (datalong2 != 0) or target (datalong2 == 0) must be Unit.
684 bool bReverse = step.script->RemoveAura.Flags & SF_REMOVEAURA_REVERSE;
685 if (Unit* unit = _GetScriptUnit(bReverse ? source : target, bReverse, step.script))
686 unit->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID);
687 break;
688 }
689
691 {
693 if (!source && !target)
694 {
695 SF_LOG_ERROR("scripts", "%s source and target objects are NULL.", step.script->GetDebugInfo().c_str());
696 break;
697 }
698
699 Unit* uSource = NULL;
700 Unit* uTarget = NULL;
701 // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s
702 switch (step.script->CastSpell.Flags)
703 {
704 case SF_CASTSPELL_SOURCE_TO_TARGET: // source -> target
705 uSource = source ? source->ToUnit() : NULL;
706 uTarget = target ? target->ToUnit() : NULL;
707 break;
708 case SF_CASTSPELL_SOURCE_TO_SOURCE: // source -> source
709 uSource = source ? source->ToUnit() : NULL;
710 uTarget = uSource;
711 break;
712 case SF_CASTSPELL_TARGET_TO_TARGET: // target -> target
713 uSource = target ? target->ToUnit() : NULL;
714 uTarget = uSource;
715 break;
716 case SF_CASTSPELL_TARGET_TO_SOURCE: // target -> source
717 uSource = target ? target->ToUnit() : NULL;
718 uTarget = source ? source->ToUnit() : NULL;
719 break;
720 case SF_CASTSPELL_SEARCH_CREATURE: // source -> creature with entry
721 uSource = source ? source->ToUnit() : NULL;
722 uTarget = uSource ? GetClosestCreatureWithEntry(uSource, abs(step.script->CastSpell.CreatureEntry), step.script->CastSpell.SearchRadius) : NULL;
723 break;
724 }
725
726 if (!uSource || !uSource->isType(TYPEMASK_UNIT))
727 {
728 SF_LOG_ERROR("scripts", "%s no source unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
729 break;
730 }
731
732 if (!uTarget || !uTarget->isType(TYPEMASK_UNIT))
733 {
734 SF_LOG_ERROR("scripts", "%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
735 break;
736 }
737
738 bool triggered = (step.script->CastSpell.Flags != 4) ?
741 uSource->CastSpell(uTarget, step.script->CastSpell.SpellID, triggered);
742 break;
743 }
744
746 // Source must be WorldObject.
747 if (WorldObject* object = _GetScriptWorldObject(source, true, step.script))
748 {
749 // PlaySound.Flags bitmask: 0/1=anyone/target
750 Player* player = NULL;
752 {
753 // Target must be Player.
754 player = _GetScriptPlayer(target, false, step.script);
755 if (!target)
756 break;
757 }
758
759 // PlaySound.Flags bitmask: 0/2=without/with distance dependent
761 object->PlayDistanceSound(step.script->PlaySound.SoundID, player);
762 else
763 object->PlayDirectSound(step.script->PlaySound.SoundID, player);
764 }
765 break;
766
768 // Target or source must be Player.
769 if (Player* pReceiver = _GetScriptPlayerSourceOrTarget(source, target, step.script))
770 {
771 ItemPosCountVec dest;
772 InventoryResult msg = pReceiver->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, step.script->CreateItem.ItemEntry, step.script->CreateItem.Amount);
773 if (msg == EQUIP_ERR_OK)
774 {
775 if (Item* item = pReceiver->StoreNewItem(dest, step.script->CreateItem.ItemEntry, true))
776 pReceiver->SendNewItem(item, step.script->CreateItem.Amount, false, true);
777 }
778 else
779 pReceiver->SendEquipError(msg, NULL, NULL, step.script->CreateItem.ItemEntry);
780 }
781 break;
782
784 // Target or source must be Creature.
785 if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true))
786 cSource->DespawnOrUnsummon(step.script->DespawnSelf.DespawnDelay);
787 break;
788
790 // Source must be Unit.
791 if (Unit* unit = _GetScriptUnit(source, true, step.script))
792 {
793 if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID))
794 SF_LOG_ERROR("scripts", "%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID);
795 else
796 unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable);
797 }
798 break;
799
801 {
803 {
804 SF_LOG_ERROR("scripts", "%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str());
805 break;
806 }
807 if (!step.script->CallScript.ScriptID)
808 {
809 SF_LOG_ERROR("scripts", "%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str());
810 break;
811 }
812
813 Creature* cTarget = NULL;
814 if (source) //using grid searcher
815 {
816 WorldObject* wSource = dynamic_cast <WorldObject*> (source);
817
819 Cell cell(p);
820
822 Skyfire::CreatureSearcher<Skyfire::CreatureWithDbGUIDCheck> checker(wSource, cTarget, target_check);
823
825 cell.Visit(p, unit_checker, *wSource->GetMap(), *wSource, wSource->GetGridActivationRange());
826 }
827 else //check hashmap holders
828 {
829 if (CreatureData const* data = sObjectMgr->GetCreatureData(step.script->CallScript.CreatureEntry))
830 cTarget = ObjectAccessor::GetObjectInWorld<Creature>(data->mapid, data->posX, data->posY, MAKE_NEW_GUID(step.script->CallScript.CreatureEntry, data->id, HIGHGUID_UNIT), cTarget);
831 }
832
833 if (!cTarget)
834 {
835 SF_LOG_ERROR("scripts", "%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry);
836 break;
837 }
838
839 //Lets choose our ScriptMap map
841 //if no scriptmap present...
842 if (!datamap)
843 {
844 SF_LOG_ERROR("scripts", "%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), 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, NULL);
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 SF_LOG_ERROR("scripts", "%s creature is already dead (Entry: %u, GUID: %u)",
859 step.script->GetDebugInfo().c_str(), cSource->GetEntry(), cSource->GetGUIDLow());
860 else
861 {
862 cSource->setDeathState(DeathState::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
911 default:
912 SF_LOG_ERROR("scripts", "Unknown script command %s.", step.script->GetDebugInfo().c_str());
913 break;
914 }
915
916 m_scriptSchedule.erase(iter);
917 iter = m_scriptSchedule.begin();
918 sScriptMgr->DecreaseScheduledScriptCount();
919 }
920}
LocaleConstant
Definition Common.h:138
@ CHAT_TYPE_SAY
Definition Creature.h:305
@ CHAT_TYPE_BOSS_WHISPER
Definition Creature.h:310
@ CHAT_TYPE_TEXT_EMOTE
Definition Creature.h:307
@ CHAT_TYPE_BOSS_EMOTE
Definition Creature.h:308
@ CHAT_TYPE_WHISPER
Definition Creature.h:309
@ CHAT_TYPE_YELL
Definition Creature.h:306
std::int32_t int32
Definition Define.h:73
#define UI64FMTD
Definition Define.h:64
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
@ GO_STATE_READY
Definition GameObject.h:577
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
Definition GridDefines.h:71
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
InventoryResult
Definition Item.h:27
@ EQUIP_ERR_OK
Definition Item.h:28
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
@ TYPEID_PLAYER
Definition Object.h:55
@ TYPEID_GAMEOBJECT
Definition Object.h:56
@ TYPEID_UNIT
Definition Object.h:54
@ TYPEID_ITEM
Definition Object.h:52
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition Object.h:68
@ TYPEMASK_UNIT
Definition Object.h:40
@ TYPEMASK_GAMEOBJECT
Definition Object.h:42
@ HIGHGUID_PET
@ HIGHGUID_GAMEOBJECT
@ HIGHGUID_TRANSPORT
@ HIGHGUID_CORPSE
@ HIGHGUID_PLAYER
@ HIGHGUID_MO_TRANSPORT
@ HIGHGUID_UNIT
@ HIGHGUID_ITEM
@ HIGHGUID_VEHICLE
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
Definition ObjectMgr.h:177
@ SF_CASTSPELL_SOURCE_TO_TARGET
Definition ObjectMgr.h:176
@ SF_CASTSPELL_TRIGGERED
Definition ObjectMgr.h:181
@ SF_CASTSPELL_TARGET_TO_SOURCE
Definition ObjectMgr.h:179
@ SF_REMOVEAURA_REVERSE
Definition ObjectMgr.h:173
@ SF_PLAYSOUND_DISTANCE_SOUND
Definition ObjectMgr.h:185
@ SF_TALK_USE_PLAYER
Definition ObjectMgr.h:161
@ SF_TELEPORT_USE_CREATURE
Definition ObjectMgr.h:167
@ SF_KILLCREDIT_REWARD_GROUP
Definition ObjectMgr.h:170
@ SF_PLAYSOUND_TARGET_PLAYER
Definition ObjectMgr.h:184
@ SF_CASTSPELL_TARGET_TO_TARGET
Definition ObjectMgr.h:178
@ SF_EMOTE_USE_STATE
Definition ObjectMgr.h:164
@ SF_CASTSPELL_SEARCH_CREATURE
Definition ObjectMgr.h:180
@ SF_ORIENTATION_FACE_TARGET
Definition ObjectMgr.h:188
std::multimap< uint32, ScriptInfo > ScriptMap
Definition ObjectMgr.h:379
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
Definition ObjectMgr.h:106
@ SCRIPT_COMMAND_KILL_CREDIT
Definition ObjectMgr.h:93
@ SCRIPT_COMMAND_QUEST_EXPLORED
Definition ObjectMgr.h:92
@ SCRIPT_COMMAND_TELEPORT_TO
Definition ObjectMgr.h:91
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
Definition ObjectMgr.h:94
@ SCRIPT_COMMAND_FLAG_SET
Definition ObjectMgr.h:89
@ SCRIPT_COMMAND_MOVE_TO
Definition ObjectMgr.h:88
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
Definition ObjectMgr.h:98
@ SCRIPT_COMMAND_PLAY_SOUND
Definition ObjectMgr.h:101
@ SCRIPT_COMMAND_OPEN_DOOR
Definition ObjectMgr.h:96
@ SCRIPT_COMMAND_FIELD_SET
Definition ObjectMgr.h:87
@ SCRIPT_COMMAND_LOAD_PATH
Definition ObjectMgr.h:105
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
Definition ObjectMgr.h:95
@ SCRIPT_COMMAND_REMOVE_AURA
Definition ObjectMgr.h:99
@ SCRIPT_COMMAND_DESPAWN_SELF
Definition ObjectMgr.h:103
@ SCRIPT_COMMAND_CLOSE_DOOR
Definition ObjectMgr.h:97
@ SCRIPT_COMMAND_CAST_SPELL
Definition ObjectMgr.h:100
@ SCRIPT_COMMAND_PLAYMOVIE
Definition ObjectMgr.h:114
@ SCRIPT_COMMAND_CLOSE_GOSSIP
Definition ObjectMgr.h:113
@ SCRIPT_COMMAND_FLAG_REMOVE
Definition ObjectMgr.h:90
@ SCRIPT_COMMAND_CREATE_ITEM
Definition ObjectMgr.h:102
@ SCRIPT_COMMAND_ORIENTATION
Definition ObjectMgr.h:110
#define sObjectMgr
Definition ObjectMgr.h:1617
std::map< uint32, ScriptMap > ScriptMapMap
Definition ObjectMgr.h:380
ScriptsType
Definition ObjectMgr.h:152
std::vector< ItemPosCount > ItemPosCountVec
Definition Player.h:777
#define sScriptMgr
Definition ScriptMgr.h:764
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
@ GAMEOBJECT_TYPE_BUTTON
@ GAMEOBJECT_TYPE_TRAP
@ GAMEOBJECT_TYPE_FISHINGNODE
@ GAMEOBJECT_TYPE_DOOR
@ JUST_DIED
Definition Unit.h:504
@ NULL_BAG
Definition Unit.h:336
@ NULL_SLOT
Definition Unit.h:337
@ UNIT_FIELD_NPC_EMOTESTATE
@ OBJECT_FIELD_ENTRY_ID
#define sWaypointMgr
GOState GetGoState() const
Definition GameObject.h:717
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
bool isSpawned() const
Definition GameObject.h:705
void SetRespawnTime(int32 respawn)
Definition GameObject.h:699
GameobjectTypes GetGoType() const
Definition GameObject.h:719
void SetLootState(LootState s, Unit *unit=NULL)
Transport * ToTransport()
Definition GameObject.h:833
static T * Find(uint64 guid)
Definition Item.h:202
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
bool AddToMap(T *)
Definition Map.cpp:504
Creature * _GetScriptCreature(Object *obj, bool isSource, const ScriptInfo *scriptInfo) const
void ScriptsProcess()
Process queued scripts.
ScriptScheduleMap m_scriptSchedule
Definition Map.h:592
void ScriptCommandStart(ScriptInfo const &script, uint32 delay, Object *source, Object *target)
bool i_scriptLock
Definition Map.h:586
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 *)
uint64 GetGUID() const
Definition Object.h:119
Player * ToPlayer()
Definition Object.h:204
uint32 GetGUIDLow() const
Definition Object.h:120
TypeID GetTypeId() const
Definition Object.h:131
bool isType(uint16 mask) const
Definition Object.h:132
GameObject * ToGameObject()
Definition Object.h:213
uint32 GetEntry() const
Definition Object.h:125
Creature * ToCreature()
Definition Object.h:207
Unit * ToUnit()
Definition Object.h:210
void AreaExploredOrEventHappens(uint32 questId)
void FailQuest(uint32 quest_id)
Definition Unit.h:1367
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)
Definition Unit.cpp:8393
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
Definition Unit.cpp:358
Map * GetMap() const
Definition Object.h:740
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1735
float GetGridActivationRange() const
Definition Object.cpp:2054
void PlayDistanceSound(uint32 sound_id, Player *target)
Definition Object.cpp:3417
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1666
#define sWorld
Definition World.h:910
CellCoord ComputeCellCoord(float x, float y)
Definition Cell.h:37
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
Definition CellImpl.h:109
float GetOrientation() const
Definition Object.h:331
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
uint64 ownerGUID
Definition Map.h:48
uint64 sourceGUID
Definition Map.h:46
ScriptInfo const * script
Definition Map.h:49
uint64 targetGUID
Definition Map.h:47
float Orientation
Definition ObjectMgr.h:252
uint32 Flags
Definition ObjectMgr.h:209
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@130361027372270375075175021215151356143001013055 Kill
uint32 FieldID
Definition ObjectMgr.h:221
uint32 QuestID
Definition ObjectMgr.h:257
float SearchRadius
Definition ObjectMgr.h:306
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@235213206037260262323130355352141154322352336256 KillCredit
int32 TextID
Definition ObjectMgr.h:210
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
float DestX
Definition ObjectMgr.h:231
uint32 ItemEntry
Definition ObjectMgr.h:317
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@344032077141363017062320302015232153251270314326 MoveTo
uint32 ChatType
Definition ObjectMgr.h:208
uint32 SoundID
Definition ObjectMgr.h:311
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@114161360076040133161002267003164201214357057100 FieldSet
uint32 ScriptID
Definition ObjectMgr.h:335
uint32 ModelID
Definition ObjectMgr.h:365
uint32 FieldValue
Definition ObjectMgr.h:222
float PosY
Definition ObjectMgr.h:280
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@337031371172363341310074346110326367135322374244 CallScript
ScriptCommands command
Definition ObjectMgr.h:196
float DestY
Definition ObjectMgr.h:232
uint32 PathID
Definition ObjectMgr.h:328
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@046004315213250210214200301212324111357101326175 FlagToggle
uint32 MapID
Definition ObjectMgr.h:245
uint32 IsRepeatable
Definition ObjectMgr.h:329
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@331116102107327262357341352322171111244332342004 LoadPath
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@310207036336307321205127162152160034150247215165 RemoveAura
int32 RemoveCorpse
Definition ObjectMgr.h:343
float PosZ
Definition ObjectMgr.h:281
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@263054102236002116002177012326305077362241107373 PlayMovie
uint32 ScriptType
Definition ObjectMgr.h:336
uint32 ResetDelay
Definition ObjectMgr.h:289
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@311217305261140163363255355271102376114316044147 PlaySound
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@340160313205203126365171223166355241073242151073 CastSpell
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@044166240220270000271314363001357235305117106163 Emote
uint32 DespawnDelay
Definition ObjectMgr.h:270
float PosX
Definition ObjectMgr.h:279
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@027276335324105102041055136361016371041043214137 Model
uint32 TravelTime
Definition ObjectMgr.h:228
uint32 Distance
Definition ObjectMgr.h:258
uint32 SpellID
Definition ObjectMgr.h:296
std::string GetDebugInfo() const
float DestZ
Definition ObjectMgr.h:233
uint32 MovieID
Definition ObjectMgr.h:372
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@203261325337225075157146047106312017011372377163 TeleportTo
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@264374040335366155120321054324331165306344366303 Talk
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@162360347056214232002103360322344073177375375370 Equip
uint32 EquipmentID
Definition ObjectMgr.h:360
uint32 GOGuid
Definition ObjectMgr.h:269
uint32 CreatureEntry
Definition ObjectMgr.h:263
uint32 Amount
Definition ObjectMgr.h:318
uint32 EmoteID
Definition ObjectMgr.h:215
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@210061205317137213243122261357357070350257132313 DespawnSelf