azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.56k stars 2.63k forks source link

[Ulduar] [Razorscale] Dark Rune Sentinel spawn #3727

Open 55Honey opened 3 years ago

55Honey commented 3 years ago
CURRENT BEHAVIOUR:

During the Razorscale (25) encounter "Dark Rune Sentinels" currently spawn 2-3 each wave. A similar behaviour exists in 10 man mode, but it seems far worse on 25 man, there is no cap at a single Sentinel per wave, too.

EXPECTED BLIZZLIKE BEHAVIOUR:

There should be a "chance" of one spawning, as in not guaranteed. Just not multiple in the same wave of adds.

STEPS TO REPRODUCE THE PROBLEM:

1.) Take a toon in GM mode to Ulduar 2.) Start the Razorscale encounter 3.) Watch the add spawns. There are multiple "Dark Rune Sentinels" spawning at once.

EXTRA NOTES:

Since the Sentinels are meant to be highest priority targets and provide a STACKING buff to other adds, this does severely impact the difficulty and playability of the encounter. There shouldnt be more than one of them at a given time, if the encounter is played right. Footage from live servers: Youtube)

After having looked at multiple hours of Razorscale 25 kills, it seems 50% or under chance of a sentinel spawn per wave.

AC HASH/COMMIT:

c208a1219b54fa52501d86446a4a30edb51d0d2d from June 3rd

OPERATING SYSTEM:

OS: Ubuntu Server 20.04

MODULES:

none

OTHER CUSTOMIZATIONS:

No customizations at all

--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/94495405-ulduar-razorscale-dark-rune-sentinel-spawn?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github).
55Honey commented 3 years ago

I'm a total beginner in anything but lua, trying to understand the C++ code in the Razorscale bossscript. The code below starts in line 381. I dont really understand the cords array. Most comments are my assumptions. Maybe this helps to find the issue. Feel free to correct me if im wrong.

case EVENT_SUMMON_ADDS: --This is line 381
    for( int i = 0; i < 4; ++i )                // For loop running i from 0 to 3
    {
        if( !cords[i][0] )                          // cords seems to be a base for the add spawn location and is randomly set. min=0/max=2-3 for 10man. min=0/max=2-4 for 25man in line 361
            break;                                  // However, if the value is not set for i=3/4, the for loop is stopped. From what i understand, i can never become 4 tho, only 0-3 ?
                                                    // and the break will prevent the whole i loop from running, if i = 0

        uint8 opt;                                  //define a variable
        uint8 r = urand(1, 100);                    // roll r from 1 to 100
        if( r <= 30 ) opt = 1;                      // set opt depending on r. 30% chance for opt to be 1, 35% each for 2 and 3
        else if( r <= 65 ) opt = 2;                 //      - " -
        else opt = 3;                               //      - " -

        for( int j = 0; j < 4; ++j )                // For loop running j from 0 to 3. 0: set npc_entry to zero. 1-3: possibly spawn adds deending on opt
        {
            float x = cords[i][0] + 4.0f * cos(j * M_PI / 2);       // set a X coordinate for the addspawn location
            float y = cords[i][1] + 4.0f * sin(j * M_PI / 2);       // set a Y coordinate for the addspawn location

            uint32 npc_entry = 0;                                   // define a variable and make its value 0
            switch( opt )                                           // execute one of the code blocks below case depending on the value of opt
            {
                case 1:
                    if( j == 1 ) npc_entry = NPC_DARK_RUNE_SENTINEL;    //spawn a Sentinel on j=1 and opt=1
                    break;
                case 2:
                    switch( j )
                    {
                        case 1:
                            npc_entry = NPC_DARK_RUNE_WATCHER;          //spawn a Watcher on j=1 and opt=2
                            break;
                        case 2:
                            npc_entry = NPC_DARK_RUNE_GUARDIAN;         //spawn a Watcher on j=2 and opt=2
                            break;
                    }
                    break;
                default: // case 3:
                    switch( j )
                    {
                        case 1:
                            npc_entry = NPC_DARK_RUNE_WATCHER;          //spawn a Watcher on j=1 and opt=3
                            break;
                        case 2:
                            npc_entry = NPC_DARK_RUNE_GUARDIAN;         //spawn a Watcher on j=2 and opt=3
                            break;
                        case 3:
                            npc_entry = NPC_DARK_RUNE_GUARDIAN;         //spawn a Watcher on j=3 and opt=3
                            break;
                    }
                    break;
            }

            if( npc_entry )
                if (Creature* c = me->SummonCreature(npc_entry, x, y, 391.1f, j * M_PI / 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))     // spawn adds if npc_entry has a value
                    DoZoneInCombat(c);

        }
   }
   break;