mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-27 15:07:14 +00:00
fix(scripts): the Spider Queen screams from the mountain when a spiderling dies (issue 307)
The zone script never handed the boss her landing target and scream emitter: ZoneAgProperty::ProcessGroupObjects
was empty and nothing answered the boss client script's "QueryZoneScript" event. As the live scripts: the boss asks
the zone ("RetrieveZoneData"), the zone stores the first object of Land_Target and Spider_Scream on her as
LandingTarget and ScreamEmitter (looking again every 0.3 s until they are spawned), and each spiderling death sends
NotifyClientObject "EmitScream" with the emitter, which the boss's client script plays as the scream. The landing
skill and camera shake now come from the landing target, not the boss.
Check in game: AG Spider Queen (property or instance): kill a spiderling: the scream plays from the mountain; when
she comes back down, the landing blast hits around the landing spot and the camera shakes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,6 +75,21 @@ void BossSpiderQueenEnemyServer::OnProximityUpdate(Entity* self, Entity* enterin
|
||||
self->SetVar<int32_t>(u"player_count", playerCount);
|
||||
}
|
||||
|
||||
void BossSpiderQueenEnemyServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
||||
if (args != "QueryZoneScript") return;
|
||||
|
||||
// The zone script sets SpiderEggNetworkID, LandingTarget and ScreamEmitter on the boss
|
||||
auto* const zoneControl = Game::entityManager->GetZoneControlEntity();
|
||||
if (zoneControl) zoneControl->OnFireEventServerSide(self, "RetrieveZoneData");
|
||||
}
|
||||
|
||||
void BossSpiderQueenEnemyServer::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name != "SpiderlingDied" || !sender || sender->GetLOT() != SpiderlingID) return;
|
||||
|
||||
// The boss's client script plays the mountain scream from the emitter it is given
|
||||
GameMessages::NotifyClientObject(self->GetObjectID(), u"EmitScream", 0, 0, self->GetVar<LWOOBJID>(u"ScreamEmitter"), "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
||||
if (Game::zoneManager->GetZoneID().GetMapID() == instanceZoneID && killer) {
|
||||
for (const auto& player : PlayerManager::GetAllPlayers()) {
|
||||
@@ -512,30 +527,20 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
||||
landingTarget:PlayEmbeddedEffectOnAllClientsNearObject{radius = 100, fromObjectID = landingTarget, effectName = "camshake-bridge"}
|
||||
}*/
|
||||
|
||||
auto landingTarget = self->GetI64(u"LandingTarget");
|
||||
auto landingEntity = Game::entityManager->GetEntity(landingTarget);
|
||||
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent != nullptr) {
|
||||
skillComponent->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY);
|
||||
}
|
||||
|
||||
// The landing target casts the landing skill and shakes the camera, not the boss
|
||||
auto* const landingEntity = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"LandingTarget"));
|
||||
if (landingEntity) {
|
||||
auto* landingSkill = landingEntity->GetComponent<SkillComponent>();
|
||||
auto* const landingSkill = landingEntity->GetComponent<SkillComponent>();
|
||||
if (landingSkill) landingSkill->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY, true);
|
||||
|
||||
if (landingSkill != nullptr) {
|
||||
landingSkill->CalculateBehavior(bossLandingSkill, 37739, LWOOBJID_EMPTY, true);
|
||||
}
|
||||
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
|
||||
embeddedEffect.target = landingEntity->GetObjectID();
|
||||
embeddedEffect.effectName = u"camshake-bridge";
|
||||
embeddedEffect.fromObjectID = landingEntity->GetObjectID();
|
||||
embeddedEffect.radius = 100.0f;
|
||||
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
|
||||
embeddedEffect.target = self->GetObjectID();
|
||||
embeddedEffect.effectName = u"camshake-bridge";
|
||||
embeddedEffect.fromObjectID = self->GetObjectID();
|
||||
embeddedEffect.radius = 100.0f;
|
||||
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
} else if (timerName == "AdvanceComplete") {
|
||||
GameMessages::NotifyClientObject(self->GetObjectID(), u"SetColGroup", 11, 0, 0, "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user