-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Scripts/Zul'Aman: Rewrite Nalorakk #31490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.3.5
Are you sure you want to change the base?
Conversation
src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
Outdated
Show resolved
Hide resolved
| { | ||
| BossAI::JustEngagedWith(who); | ||
| std::vector<Creature*> waveCreatures; | ||
| GetCreatureListWithOptionsInGrid(waveCreatures, me, 50.0f, { .StringId = NalorakkWave[_currentWaveCount] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use instance as a holder, so you dont have to use grid searchers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aka: oncreaturecreate -> store in appropriate storage -> use it in w/e way u want (make a script in instance to attack a unit, for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creatures aren't spawned all at once, they're summoned in waves and we still will have to use StringIds to store them
| if (!creature) | ||
| return; | ||
|
|
||
| if (creature->HasStringId("NalorakkWave1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stringid is overkill if you ask me, you can "simply" check if the creature is within the related group
if (SpawnMetadata const* data = sObjectMgr->GetSpawnMetadata(SpawnObjectType::SPAWN_TYPE_CREATURE, me->GetSpawnId()))
if (data->spawnGroupData && data->spawnGroupData->groupId == SPAWN_GROUP_MOJO)
maybe there is an easier way to access groupId on this context though (InstanceMapScript)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently scripting similar event and in that event I created no spawn groups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stringid is overkill if you ask me, you can "simply" check if the creature is within the related group
if (SpawnMetadata const* data = sObjectMgr->GetSpawnMetadata(SpawnObjectType::SPAWN_TYPE_CREATURE, me->GetSpawnId())) if (data->spawnGroupData && data->spawnGroupData->groupId == SPAWN_GROUP_MOJO)maybe there is an easier way to access groupId on this context though (InstanceMapScript)
we should not do that. SpawnGroups, as they are currently implemented, should only be used for controlling spawns, not to integrate them into scripts directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the reasons why stringid exists, to target specific spawns (or packs) without hardcoding guids (or spawn group ids)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I really doubt string ids are used on retail this way. I think what they did here is attached GameEvent to Death \ Despawn Event. Once all members in Spawn Group are dead, event is launched, then Nalorakk "catches" that event and executes script linked to that event
| { | ||
| ++killedUnitInWaveCounter[0]; | ||
|
|
||
| if (killedUnitInWaveCounter[0] == 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is respawn/reset/wipe handling necessary? meaning, do you need to reset this counter to 0 somewhere in case of any of these situations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno how this event should be handled in any of these cases
Changes proposed:
Issues addressed:
none
Tests performed:
builds, tested in-game