Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
EricksOliveira committed Dec 21, 2024
2 parents e427539 + 883dea0 commit c346a5c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/server/game/Entities/Creature/TemporarySummon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ void TempSummon::InitSummon()
}
}

void TempSummon::UpdateObjectVisibilityOnCreate()
{
WorldObject::UpdateObjectVisibility(true);
}

void TempSummon::SetTempSummonType(TempSummonType type)
{
m_type = type;
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Entities/Creature/TemporarySummon.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class TempSummon : public Creature
virtual void InitStats(uint32 lifetime);
virtual void InitSummon();
virtual void UnSummon(uint32 msTime = 0);
void UpdateObjectVisibilityOnCreate() override;
void RemoveFromWorld() override;
void SetTempSummonType(TempSummonType type);
void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) override {}
Expand Down
4 changes: 3 additions & 1 deletion src/server/game/Entities/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,9 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert

summon->InitSummon();

//ObjectAccessor::UpdateObjectVisibility(summon);
// call MoveInLineOfSight for nearby creatures
Acore::AIRelocationNotifier notifier(*summon);
Cell::VisitAllObjects(summon, notifier, GetVisibilityRange());

return summon;
}
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Entities/Object/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ class WorldObject : public Object, public WorldLocation

void DestroyForNearbyPlayers();
virtual void UpdateObjectVisibility(bool forced = true, bool fromUpdate = false);
virtual void UpdateObjectVisibilityOnCreate() { UpdateObjectVisibility(true); }
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set) override;
void GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry);

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ bool Map::AddToMap(T* obj, bool checkTransport)

//something, such as vehicle, needs to be update immediately
//also, trigger needs to cast spell, if not update, cannot see visual
obj->UpdateObjectVisibility(true);
obj->UpdateObjectVisibilityOnCreate();

// Xinef: little hack for vehicles, accessories have to be added after visibility update so they wont fall off the vehicle, moved from Creature::AIM_Initialize
// Initialize vehicle, this is done only for summoned npcs, DB creatures are handled by grid loaders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_QUAKE, 62s + 500ms);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 3500ms, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SUMMON_ICE_SPHERE, 8s, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SUMMON_RAGING_SPIRIT, 4s, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SUMMON_RAGING_SPIRIT, 6s, EVENT_GROUP_ABILITIES);
break;
case POINT_CENTER_2:
me->SetFacingTo(0.0f);
Expand All @@ -959,7 +959,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_QUAKE_2, 62s + 500ms);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 3500ms, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SUMMON_ICE_SPHERE, 8s, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SUMMON_RAGING_SPIRIT, 4s, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SUMMON_RAGING_SPIRIT, 5s, EVENT_GROUP_ABILITIES);
break;
default:
break;
Expand Down

0 comments on commit c346a5c

Please sign in to comment.