1235 Unit* spellCaster = user;
1237 bool triggered =
false;
1241 if (
sScriptMgr->OnGossipHello(playerUser,
this))
1272 player->SendPreparedGossip(
this);
1278 if (goInfo->
trap.spell)
1283 if (goInfo->
trap.charges == 1)
1300 if (info->
chair.chairslots > 0)
1301 for (
uint32 i = 0; i < info->
chair.chairslots; ++i)
1321 bool found_free_slot =
false;
1325 float relativeDistance = (info->
size*itr->first) - (info->
size*(info->
chair.chairslots - 1) / 2.0f);
1327 float x_i =
GetPositionX() + relativeDistance * std::cos(orthogonalOrientation);
1328 float y_i =
GetPositionY() + relativeDistance * std::sin(orthogonalOrientation);
1330 if (!itr->second.IsEmpty())
1334 if (ChairUser->IsSitState() && ChairUser->GetStandState() !=
UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
1337 itr->second.Clear();
1340 itr->second.Clear();
1343 found_free_slot =
true;
1346 float thisDistance = player->GetDistance2d(x_i, y_i);
1348 if (thisDistance <= lowestDist)
1350 nearest_slot = itr->first;
1351 lowestDist = thisDistance;
1357 if (found_free_slot)
1359 ChairSlotAndUser::iterator itr =
ChairListSlots.find(nearest_slot);
1362 itr->second = player->GetGUID();
1363 player->TeleportTo(
GetMapId(), x_lowest, y_lowest,
GetPositionZ(),
GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
1382 player->SendDirectMessage(data.
Write());
1384 else if (info->
goober.gossipID)
1386 player->PrepareGossipMenu(
this, info->
goober.gossipID);
1387 player->SendPreparedGossip(
this);
1390 if (info->
goober.eventID)
1405 if (
Group* group = player->GetGroup())
1407 for (
GroupReference const* itr = group->GetFirstMember(); itr !=
nullptr; itr = itr->
next())
1408 if (
Player* member = itr->GetSource())
1409 if (member->IsAtGroupRewardDistance(
this))
1423 if (info->
goober.customAnim)
1431 spellId = info->
goober.spell;
1448 player->SendCinematicStart(info->
camera.camera);
1450 if (info->
camera.eventID)
1477 zone_skill =
sObjectMgr->GetFishingBaseSkillLevel(zone);
1481 TC_LOG_ERROR(
"sql.sql",
"Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
1486 if (skill < zone_skill)
1488 chance =
int32(
pow((
double)skill/zone_skill, 2) * 100);
1497 TC_LOG_DEBUG(
"misc",
"Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
1502 player->UpdateFishingSkill();
1554 if (!m_ritualOwner && !owner)
1557 m_ritualOwner = player;
1566 if (player == owner->
ToPlayer() || (info->
ritual.castersGrouped && !player->IsInSameRaidWith(owner->
ToPlayer())))
1574 spellCaster = owner;
1578 if (player != m_ritualOwner && (info->
ritual.castersGrouped && !player->IsInSameRaidWith(m_ritualOwner)))
1581 spellCaster = player;
1586 if (info->
ritual.animSpell)
1588 player->CastSpell(player, info->
ritual.animSpell,
true);
1598 spellCaster = m_ritualOwner;
1600 spellId = info->
ritual.spell;
1602 if (spellId == 62330)
1613 if (info->
ritual.casterTargetSpell && info->
ritual.casterTargetSpell != 1)
1614 for (
uint32 i = 0; i < info->
ritual.casterTargetSpellTargets; i++)
1624 if (!info->
ritual.ritualPersistent)
1674 if (!targetPlayer || targetPlayer == player || !targetPlayer->IsInSameRaidWith(player))
1678 uint8 level = player->getLevel();
1679 if (level < info->meetingStone.minLevel)
1681 level = targetPlayer->getLevel();
1682 if (level < info->meetingStone.minLevel)
1685 if (info->
entry == 194097)
1700 if (player->CanUseBattlegroundObject(
this))
1707 if (player->GetVehicle())
1744 if (player->CanUseBattlegroundObject(
this))
1751 if (player->GetVehicle())
1765 switch (info->
entry)
1796 player->SendDirectMessage(packet.
Write());
1806 TC_LOG_ERROR(
"misc",
"GameObject::Use(): unit (type: %u, %s, name: %s) tries to use object (%s, name: %s) of unknown type (%u)",
1820 TC_LOG_DEBUG(
"outdoorpvp",
"WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
1828 spellCaster->
CastSpell(user, spellInfo, triggered);
#define MAX_GAMEOBJECT_TYPE
Definition: SharedDefines.h:2116
struct GameObjectTemplate::@221::@255 barberChair
Definition: GameObjectPackets.h:96
GameObjectAI * AI() const
Definition: GameObject.h:1061
Unit * GetOwner() const
Definition: GameObject.cpp:1009
uint32 camera
Definition: GameObject.h:281
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Put scripts in the execution queue.
Definition: MapScripts.cpp:33
struct GameObjectTemplate::@221::@230 chair
Definition: GameObject.h:871
GuidSet m_unique_users
Definition: GameObject.h:1104
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:105
LootState getLootState() const
Definition: GameObject.h:981
Map * GetMap() const
Definition: Object.h:543
uint32 m_usetimes
Definition: GameObject.h:1105
C::value_type const & SelectRandomContainerElement(C const &container)
Definition: Containers.h:68
#define M_PI
Definition: Common.h:163
Definition: SpellInfo.h:326
uint32 gossipID
Definition: GameObject.h:84
Definition: SharedDefines.h:4562
Definition: GameObject.h:870
Definition: SpellAuraDefines.h:76
WorldPacket const * Write() override
Definition: GameObjectPackets.cpp:36
void TriggeringLinkedGameObject(uint32 trapEntry, Unit *target)
Definition: GameObject.cpp:1126
std::string const & GetName() const
Definition: Object.h:479
uint32 GetCooldown() const
Definition: GameObject.h:757
void EventInform(uint32 eventId, WorldObject *invoker=NULL)
Definition: GameObject.cpp:1913
Definition: LootMgr.h:101
Definition: GameObject.h:34
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SharedDefines.h:4567
Definition: GameObjectPackets.h:60
Definition: SharedDefines.h:2091
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
#define sWorld
Definition: World.h:887
ObjectGuid::LowType GetSpawnId() const
Definition: GameObject.h:902
Definition: SharedDefines.h:2082
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
float size
Definition: GameObject.h:45
void RemoveFromOwner()
Definition: GameObject.cpp:106
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: SharedDefines.h:2121
time_t m_cooldownTime
Definition: GameObject.h:1099
Player * ToPlayer()
Definition: Object.h:191
Definition: MiscPackets.h:538
int32 irand(int32 min, int32 max)
Definition: Random.cpp:39
TypeID GetTypeId() const
Definition: Object.h:113
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:209
void SetLootState(LootState s, Unit *unit=NULL)
Definition: GameObject.cpp:2112
float GetOrientation() const
Definition: Position.h:107
ObjectGuid GameObjectGUID
Definition: GameObjectPackets.h:67
struct GameObjectTemplate::@221::@229 trap
virtual bool GossipHello(Player *)
Definition: GameObjectAI.h:50
Definition: SharedDefines.h:2078
Definition: SharedDefines.h:2066
float GetPositionY() const
Definition: Position.h:105
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
#define UI64FMTD
Definition: Define.h:137
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: SharedDefines.h:3976
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:1920
float GetPositionZ() const
Definition: Position.h:106
UnitStandStateType
Definition: Unit.h:205
int32_t int32
Definition: Define.h:146
Definition: SharedDefines.h:2089
virtual void EventPlayerClickedOnFlag(Player *, GameObject *)
Definition: Battleground.h:428
uint32_t uint32
Definition: Define.h:150
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
struct GameObjectTemplate::@221::@245 spellCaster
Definition: GameObject.h:880
uint32 GetMapId() const
Definition: Position.h:254
uint32 entry
Definition: GameObject.h:36
Definition: DBCEnums.h:261
void CastSpell(Unit *target, uint32 spell, bool triggered=true)
Definition: GameObject.cpp:1833
struct GameObjectTemplate::@221::@233 goober
WorldPacket const * Write() override
Definition: MiscPackets.h:543
GroupReference * next()
Definition: GroupReference.h:37
ObjectGuid GetOwnerGUID() const
Definition: GameObject.h:925
Definition: UpdateFields.h:319
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
Definition: GameObject.cpp:1182
Definition: GameObject.h:822
Definition: SharedDefines.h:2090
void Use(Unit *user)
Definition: GameObject.cpp:1232
void Clear()
Definition: ObjectGuid.h:215
void SetGoState(GOState state)
Definition: GameObject.cpp:2137
G3D::Quat pow(const G3D::Quat &q, double x)
Definition: Quat.h:761
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: SharedDefines.h:2067
Definition: ObjectGuid.h:33
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
Definition: Object.cpp:1535
GameobjectTypes GetGoType() const
Definition: GameObject.h:964
Definition: SharedDefines.h:2072
uint8 GetGoAnimProgress() const
Definition: GameObject.h:972
void AddUniqueUse(Player *player)
Definition: GameObject.cpp:720
ScriptMapMap sEventScripts
Definition: ObjectMgr.cpp:52
Definition: SharedDefines.h:2075
void AddUse()
Definition: GameObject.h:1000
std::string name
Definition: GameObject.h:39
void SendCustomAnim(uint32 anim)
Definition: GameObject.cpp:1879
void SetSpellId(uint32 id)
Definition: GameObject.h:928
Definition: SharedDefines.h:2083
ChairSlotAndUser ChairListSlots
Definition: GameObject.h:1108
int32_t int32
Definition: g3dmath.h:167
Definition: QuestDef.h:113
Definition: SpellAuraDefines.h:78
uint8_t uint8
Definition: Define.h:152
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
Definition: Unit.cpp:2874
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
Definition: Battleground.h:263
Definition: SharedDefines.h:2097
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check)
Definition: Unit.cpp:3567
Definition: SharedDefines.h:2088
ObjectGuid m_ritualOwnerGUID
Definition: GameObject.h:1103
Definition: Battleground.h:235
uint32 GetUniqueUseCount() const
Definition: GameObject.h:1003
uint32 GetAutoCloseTime() const
Definition: GameObject.h:709
#define sScriptMgr
Definition: ScriptMgr.h:837
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
uint32_t uint32
Definition: g3dmath.h:168
Definition: SharedDefines.h:2087
#define CONTACT_DISTANCE
Definition: Object.h:33
float GetPositionX() const
Definition: Position.h:104
struct GameObjectTemplate::@221::@241 ritual
Definition: GameObject.h:869
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: SharedDefines.h:2071
std::string ToString() const
Definition: ObjectGuid.cpp:99
bool IsEmpty() const
Definition: ObjectGuid.h:242
GameObject * LookupFishingHoleAround(float range)
Definition: GameObject.cpp:1157
void SetOwnerGUID(ObjectGuid owner)
Definition: GameObject.h:915
Definition: GroupReference.h:27
Definition: SpellAuraDefines.h:138
Definition: SharedDefines.h:2065
void Delete()
Definition: GameObject.cpp:726
#define DEFAULT_VISIBILITY_DISTANCE
Definition: Object.h:40