diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index 9221efed1190c8..00000000000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Auto Assign to Project(s) - -on: - issues: - types: [opened, labeled] - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - name: Assign to One Project - steps: - - - name: Assign issues with `ChromieCraft Generic` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, 'ChromieCraft Generic') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/20' - - - name: Assign issues with `1-19` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '1-19') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/14' - - - name: Assign issues with `20-29` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '20-29') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/17' - - - name: Assign issues with `30-39` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '30-39') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/23' - - - name: Assign issues with `40-49` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '40-49') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/24' - - - name: Assign issues with `50-59` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '50-59') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/25' - - - name: Assign issues with `60` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '60') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/22' - - - name: Assign issues with `61-64` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '61-64') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/32' - - - name: Assign issues with `65-69` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '65-69') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/36' - - - name: Assign issues with `70` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '70') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/26' - - - name: Assign issues with `71-74` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '71-74') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/33' - - - name: Assign issues with `75-79` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '75-79') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/37' - - - name: Assign issues with `80` label to their project - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, '80') - with: - project: 'https://github.com/azerothcore/azerothcore-wotlk/projects/38' - diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml deleted file mode 100644 index ce72ed58f7eb62..00000000000000 --- a/.github/workflows/codestyle.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Codestyle -on: - pull_request: - paths: - - src/** - - "!README.md" - - "!docs/**" - -jobs: - triage: - runs-on: ubuntu-latest - name: C++ - if: github.repository == 'azerothcore/azerothcore-wotlk' - steps: - - uses: actions/checkout@v4 - - name: AzerothCore codestyle - run: source ./apps/ci/ci-codestyle.sh - - name: C++ Advanced - run: | - sudo apt update -y - sudo apt install -y cppcheck - cppcheck --force --inline-suppr --suppressions-list=./.suppress.cppcheck src/ --output-file=report.txt - - if [ -s report.txt ]; then # if file is not empty - cat report.txt - exit 1 # let github action fails - fi diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 61a3862ca937ce..707274324fa4fa 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -2,9 +2,9 @@ name: windows-build on: push: branches: - - 'master' + - "master" pull_request: - types: ['labeled', 'opened', 'synchronize', 'reopened'] + types: ["labeled", "opened", "synchronize", "reopened"] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) @@ -20,10 +20,10 @@ jobs: name: ${{ matrix.os }} env: BOOST_ROOT: C:\local\boost_1_82_0 - if: | - github.repository == 'azerothcore/azerothcore-wotlk' - && !github.event.pull_request.draft - && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build') + # if: | + # github.repository == 'azerothcore/azerothcore-wotlk' + # && !github.event.pull_request.draft + # && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build') steps: - uses: actions/checkout@v4 - name: ccache @@ -39,3 +39,26 @@ jobs: run: | export CTOOLS_BUILD=all ./acore.sh compiler build + + - name: Zip Mod-Forge SQL folder + shell: powershell + run: | + Compress-Archive -Path ./modules/mod-Forge -Destination ./env/dist/mod-forge-sql.zip + + - name: Zip Data SQL folder + shell: powershell + run: | + Compress-Archive -Path ./data/sql/custom -Destination ./env/dist/data-sql.zip + + - uses: "marvinpinto/action-automatic-releases@latest" + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + with: + repo_token: "${{ secrets.GH_TOKEN }}" + automatic_release_tag: "Latest" + prerelease: false + title: "Release" + files: | + ./env/dist/worldserver.exe + ./env/dist/mod-forge-sql.zip + ./env/dist/data-sql.zip diff --git a/modules/mod-Forge/src/ForgePlayerMessageHandler.cpp b/modules/mod-Forge/src/ForgePlayerMessageHandler.cpp index 92f69cce96d9c5..b6f4db28768d3c 100644 --- a/modules/mod-Forge/src/ForgePlayerMessageHandler.cpp +++ b/modules/mod-Forge/src/ForgePlayerMessageHandler.cpp @@ -26,10 +26,10 @@ #include #include #include -#include +/* #include #include #include -#include +#include */ #include #include #include @@ -276,11 +276,11 @@ void AddForgePlayerMessageHandler() sTopicRouter->AddHandler(new UpdateSpecHandler(cache)); sTopicRouter->AddHandler(new PrestigeHandler(cache, cm)); sTopicRouter->AddHandler(new ActivateClassSpecHandler(cache, cm)); - sTopicRouter->AddHandler(new GetCollectionsHandler(cache, cm)); +/* sTopicRouter->AddHandler(new GetCollectionsHandler(cache, cm)); sTopicRouter->AddHandler(new ApplyTransmogHandler(cache, cm)); sTopicRouter->AddHandler(new SaveTransmogSetHandler(cache, cm)); sTopicRouter->AddHandler(new GetTransmogSetsHandler(cache, cm)); - sTopicRouter->AddHandler(new GetTransmogHandler(cache, cm)); + sTopicRouter->AddHandler(new GetTransmogHandler(cache, cm)); */ sTopicRouter->AddHandler(new StartMythicHandler(cache, cm)); sTopicRouter->AddHandler(new GetAffixesHandler(cache, cm)); sTopicRouter->AddHandler(new GetCharacterLoadoutsHandler(cache, cm)); diff --git a/src/server/game/Entities/Item/Transmogrification.cpp b/src/server/game/Entities/Item/Transmogrification.cpp index 024faa6b993496..2a7241129c2f74 100644 --- a/src/server/game/Entities/Item/Transmogrification.cpp +++ b/src/server/game/Entities/Item/Transmogrification.cpp @@ -866,7 +866,7 @@ void Transmogrification::SaveToDB(Player* player, uint32 transmogtype, uint32 vi stmt->SetData(0, player->GetSession()->GetAccountId()); stmt->SetData(1, transmogtype); stmt->SetData(2, visual); - CharacterDatabase.Execute(stmt); + /* CharacterDatabase.Execute(stmt); */ } bool Transmogrification::HasVisual(Player* player, uint32 transmogtype, uint32 visual) @@ -889,7 +889,7 @@ uint32 Transmogrification::Save(Player* player, uint32 transmogtype, ItemTemplat if (player->transmogrification_appearances[transmogtype].insert(visual->ItemId).second) { player->_tmogVisualToItem[transmogtype][visual->DisplayInfoID] = visual->ItemId; - SaveToDB(player, transmogtype, visual->ItemId); + /* SaveToDB(player, transmogtype, visual->ItemId); */ return visual->ItemId; } } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a9379ba1508ddf..53f87f9ca99d55 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15638,114 +15638,115 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const if (GetTypeId() == TYPEID_PLAYER) { - uint32 CatnDisplay = 0; - uint32 CatnSpellID = 0; - uint32 CatnReqSpellID = 0; - - uint32 BearnDisplay = 0; - uint32 BearnSpellID = 0; - uint32 BearnReqSpellID = 0; - - uint32 FlynDisplay = 0; - uint32 FlynSpellID = 0; - uint32 FlynReqSpellID = 0; - - uint32 BuhonDisplay = 0; - uint32 BuhonSpellID = 0; - uint32 BuhonReqSpellID = 0; - - uint32 SeanDisplay = 0; - uint32 SeanSpellID = 0; - uint32 SeanReqSpellID = 0; - - uint32 TreenDisplay = 0; - uint32 TreenSpellID = 0; - uint32 TreenReqSpellID = 0; - - uint32 TravelnDisplay = 0; - uint32 TravelnSpellID = 0; - uint32 TravelnReqSpellID = 0; - - QueryResult resultCat = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'cat'"); - QueryResult resultBear = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'bear'"); - QueryResult resultFly = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'fly'"); - QueryResult resultBuho = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'buho'"); - QueryResult resultSea = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'sea'"); - QueryResult resultTree = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'tree'"); - QueryResult resultTravel = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'travel'"); - switch (form) - { - case FORM_CAT: + uint32 CatnDisplay = 0; + uint32 CatnSpellID = 0; + uint32 CatnReqSpellID = 0; - if (resultCat) - { - do - { - Field* fields = resultCat->Fetch(); - CatnSpellID = fields[5].Get(); - CatnReqSpellID = fields[6].Get(); + uint32 BearnDisplay = 0; + uint32 BearnSpellID = 0; + uint32 BearnReqSpellID = 0; - if (HasSpell(CatnSpellID)) - { + uint32 FlynDisplay = 0; + uint32 FlynSpellID = 0; + uint32 FlynReqSpellID = 0; - if (CatnReqSpellID == 0) - { - CatnDisplay = fields[2].Get(); - } - else - { - if (HasSpell(CatnReqSpellID)) - { - CatnDisplay = fields[2].Get(); - } - else - { - CatnDisplay = 0; - } - } - } + uint32 BuhonDisplay = 0; + uint32 BuhonSpellID = 0; + uint32 BuhonReqSpellID = 0; - } while (resultCat->NextRow()); - } + uint32 SeanDisplay = 0; + uint32 SeanSpellID = 0; + uint32 SeanReqSpellID = 0; - if (CatnDisplay != 0) // Violet - { - return CatnDisplay; - } + uint32 TreenDisplay = 0; + uint32 TreenSpellID = 0; + uint32 TreenReqSpellID = 0; - else + uint32 TravelnDisplay = 0; + uint32 TravelnSpellID = 0; + uint32 TravelnReqSpellID = 0; + + QueryResult resultCat = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'cat'"); + QueryResult resultBear = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'bear'"); + QueryResult resultFly = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'fly'"); + QueryResult resultBuho = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'buho'"); + QueryResult resultSea = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'sea'"); + QueryResult resultTree = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'tree'"); + QueryResult resultTravel = WorldDatabase.Query("SELECT type,name,display,npc,racemask,SpellId,ReqSpellID FROM custom_druid_barbershop WHERE type = 'travel'"); + + + switch (form) + { + case FORM_CAT: + if (resultCat) + { + do + { + Field *fields = resultCat->Fetch(); + CatnSpellID = fields[5].Get(); + CatnReqSpellID = fields[6].Get(); + + if (HasSpell(CatnSpellID)) + { + + if (CatnReqSpellID == 0) + { + CatnDisplay = fields[2].Get(); + } + else + { + if (HasSpell(CatnReqSpellID)) + { + CatnDisplay = fields[2].Get(); + } + else + { + CatnDisplay = 0; + } + } + } + + } while (resultCat->NextRow()); + } + + if (CatnDisplay != 0) // Violet + { + return CatnDisplay; + } + + else + { + // Based on Hair color + if (getRace() == RACE_NIGHTELF) { - // Based on Hair color - if (getRace() == RACE_NIGHTELF) + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) { - uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); - switch (hairColor) - { - case 7: // Violet - case 8: - return 29405; - case 3: // Light Blue - return 29406; - case 0: // Green - case 1: // Light Green - case 2: // Dark Green - return 29407; - case 4: // White - return 29408; - default: // original - Dark Blue - return 892; - } + case 7: // Violet + case 8: + return 29405; + case 3: // Light Blue + return 29406; + case 0: // Green + case 1: // Light Green + case 2: // Dark Green + return 29407; + case 4: // White + return 29408; + default: // original - Dark Blue + return 892; } - // Based on Skin color - else if (getRace() == RACE_TAUREN) + } + // Based on Skin color + else if (getRace() == RACE_TAUREN) + { + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) { - uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); - // Male - if (getGender() == GENDER_MALE) + switch (skinColor) { - switch (skinColor) - { case 12: // White case 13: case 14: @@ -15768,36 +15769,72 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return 29412; default: // original - Grey return 8571; - } } - // Female - else switch (skinColor) + } + // Female + else switch (skinColor) { - case 10: // White - return 29409; - case 6: // Light Brown - case 7: - return 29410; - case 4: // Brown - case 5: - return 29411; - case 0: // Dark - case 1: - case 2: - case 3: - return 29412; - default: // original - Grey - return 8571; + case 10: // White + return 29409; + case 6: // Light Brown + case 7: + return 29410; + case 4: // Brown + case 5: + return 29411; + case 0: // Dark + case 1: + case 2: + case 3: + return 29412; + default: // original - Grey + return 8571; } - } - else if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) - return 892; - else - return 8571; - } + else if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) + return 892; + else + return 8571; + } case FORM_DIREBEAR: case FORM_BEAR: + + if (resultBear) + { + do + { + Field *fields = resultBear->Fetch(); + BearnSpellID = fields[5].Get(); + BearnReqSpellID = fields[6].Get(); + + if (HasSpell(BearnSpellID)) + { + + if (BearnReqSpellID == 0) + { + BearnDisplay = fields[2].Get(); + } + else + { + if (HasSpell(BearnReqSpellID)) + { + BearnDisplay = fields[2].Get(); + } + else + { + BearnDisplay = 0; + } + } + } + + } while (resultBear->NextRow()); + } + if (BearnDisplay != 0) // Violet + { + return BearnDisplay; + } + else + { // Based on Hair color if (getRace() == RACE_NIGHTELF) { @@ -15875,14 +15912,287 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return 2281; else return 2289; + } case FORM_FLIGHT: + + if (resultFly) + { + do + { + Field *fields = resultFly->Fetch(); + FlynSpellID = fields[5].Get(); + FlynReqSpellID = fields[6].Get(); + + if (HasSpell(FlynSpellID)) + { + + if (FlynReqSpellID == 0) + { + FlynDisplay = fields[2].Get(); + } + else + { + if (HasSpell(FlynReqSpellID)) + { + FlynDisplay = fields[2].Get(); + } + else + { + FlynDisplay = 0; + } + } + } + + } while (resultFly->NextRow()); + } + if (FlynDisplay != 0) // Violet + { + return FlynDisplay; + } + else + { if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) + { return 20857; - return 20872; + } + else + { + return 20872; + } + } case FORM_FLIGHT_EPIC: + + if (resultFly) + { + do + { + Field *fields = resultFly->Fetch(); + FlynSpellID = fields[5].Get(); + FlynReqSpellID = fields[6].Get(); + + if (HasSpell(FlynSpellID)) + { + + if (FlynReqSpellID == 0) + { + FlynDisplay = fields[2].Get(); + } + else + { + if (HasSpell(FlynReqSpellID)) + { + FlynDisplay = fields[2].Get(); + } + else + { + FlynDisplay = 0; + } + } + } + + } while (resultFly->NextRow()); + } + + if (FlynDisplay != 0) // Violet + { + return FlynDisplay; + } + else + { if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) + { return 21243; - return 21244; + } + else + { + return 21244; + } + } +case FORM_MOONKIN: + + if (resultBuho) + { + do + { + Field *fields = resultBuho->Fetch(); + BuhonSpellID = fields[5].Get(); + BuhonReqSpellID = fields[6].Get(); + + if (HasSpell(BuhonSpellID)) + { + + if (BuhonReqSpellID == 0) + { + BuhonDisplay = fields[2].Get(); + } + else + { + if (HasSpell(BuhonReqSpellID)) + { + BuhonDisplay = fields[2].Get(); + } + else + { + BuhonDisplay = 0; + } + } + } + + } while (resultBuho->NextRow()); + } + + if (BuhonDisplay != 0) // Violet + { + return BuhonDisplay; + } + else + { + if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) + { + return 15374; + } + else + { + return 15375; + } + } + + case FORM_AQUA: + + if (resultSea) + { + do + { + Field *fields = resultSea->Fetch(); + SeanSpellID = fields[5].Get(); + SeanReqSpellID = fields[6].Get(); + + if (HasSpell(SeanSpellID)) + { + if (SeanReqSpellID == 0) + { + SeanDisplay = fields[2].Get(); + } + else + { + if (HasSpell(SeanReqSpellID)) + { + SeanDisplay = fields[2].Get(); + } + else + { + SeanDisplay = 0; + } + } + } + + } while (resultSea->NextRow()); + } + + if (SeanDisplay != 0) + { + return SeanDisplay; + } + else + { + return 2428; + } + case FORM_TREE: + + if (resultTree) + { + do + { + Field *fields = resultTree->Fetch(); + TreenSpellID = fields[5].Get(); + TreenReqSpellID = fields[6].Get(); + + if (HasSpell(TreenSpellID)) + { + + if (TreenReqSpellID == 0) + { + TreenDisplay = fields[2].Get(); + } + else + { + if (HasSpell(TreenReqSpellID)) + { + TreenDisplay = fields[2].Get(); + } + else + { + TreenDisplay = 0; + } + } + } + + } while (resultTree->NextRow()); + } + + if (TreenDisplay != 0) // Violet + { + return TreenDisplay; + } + else + { + if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) + { + return 2451; + } + else + { + return 864; + } + } + case FORM_TRAVEL: + if (resultTravel) + { + do + { + Field *fields = resultTravel->Fetch(); + TravelnSpellID = fields[5].Get(); + TravelnReqSpellID = fields[6].Get(); + + if (HasSpell(TravelnSpellID)) + { + + if (TravelnReqSpellID == 0) + { + TravelnDisplay = fields[2].Get(); + } + else + { + if (HasSpell(TravelnReqSpellID)) + { + TravelnDisplay = fields[2].Get(); + } + else + { + TravelnDisplay = 0; + } + } + } + + } while (resultTravel->NextRow()); + } + + if (TravelnDisplay != 0) // Violet + { + return TravelnDisplay; + } + else + { + if (Player::TeamIdForRace(getRace()) == TEAM_ALLIANCE) + { + return 918; + } + else + { + return 15593; + } + } + default: break; } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 903701a3a850d1..81beb39a66d24d 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2027,6 +2027,26 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } break; } + + if (apply) + { + /*Unit::AuraEffectList aurEffects = {}; + + if (caster == target) { + aurEffects = caster->GetAuraEffectsByType(SPELL_AURA_MOD_TRIGGER_SPELL_ON_STACKS_ON_SELF); + } + else { + aurEffects = caster->GetAuraEffectsByType(SPELL_AURA_MOD_TRIGGER_SPELL_ON_STACKS_ON_TARGET); + } + if (!aurEffects.empty()) + for (auto aurEff : aurEffects) + { + auto eff = aurEff->GetSpellInfo()->GetEffect(SpellEffIndex(aurEff->GetEffIndex())); + + if (aurApp->GetBase()->GetId() == eff.MiscValue) + ProcessTriggerSpellOnStacks(aurApp->GetBase(), eff.MiscValueB, eff.TriggerSpell, eff.TargetA.GetTarget(), eff.Amplitude, caster, aurEff->GetBase()->GetEffect(aurEff->GetEffIndex())); + }*/ + } } void Aura::ProcessTriggerSpellOnStacks(Aura* aurApp, int32 stackCount, int32 triggerSpell, Targets triggerSpellTarget, uint32 amplitude, Unit* caster, AuraEffect* const triggeringEffect) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a189c13fb3fca9..d8247af2021ff6 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2232,7 +2232,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) { int32 xpLevel = goInfo->chest.xpMinLevel; - Quest const* quest; + Quest const* quest = sObjectMgr->GetQuestTemplate(24746); player->GiveXP(quest->XPValue(player->getLevel(), xpLevel, xpDifficulty), nullptr); } } diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index bc78f9d9794842..efc826c5d11ca0 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -52,7 +52,7 @@ class account_commandscript : public CommandScript { static ChatCommandTable accountSetCommandTable = { - { "addon", SEC_TRIAL_GAMEMASTER, true, &HandleAccountSetAddonCommand, "" }, + { "addon", SEC_GAMEMASTER1, true, &HandleAccountSetAddonCommand, "" }, { "gmlevel", SEC_CONSOLE, true, &HandleAccountSetGmLevelCommand, "" }, { "password", SEC_CONSOLE, true, &HandleAccountSetPasswordCommand, "" }, { "2fa", SEC_PLAYER, true, &HandleAccountSet2FACommand, "" } diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 0998016a6ac79e..3916fa4cc2e23b 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -45,13 +45,13 @@ class gm_commandscript : public CommandScript { static ChatCommandTable gmCommandTable = { - { "chat", HandleGMChatCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "fly", HandleGMFlyCommand, SEC_TRIAL_GAMEMASTER, Console::No }, + { "chat", HandleGMChatCommand, SEC_GAMEMASTER1, Console::No }, + { "fly", HandleGMFlyCommand, SEC_GAMEMASTER1, Console::No }, { "ingame", HandleGMListIngameCommand, SEC_PLAYER, Console::Yes }, { "list", HandleGMListFullCommand, SEC_GAMEMASTER2_F, Console::Yes }, { "visible", HandleGMVisibleCommand, SEC_GAMEMASTER1, Console::No }, - { "on", HandleGMOnCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "off", HandleGMOffCommand, SEC_TRIAL_GAMEMASTER, Console::No } + { "on", HandleGMOnCommand, SEC_GAMEMASTER1, Console::No }, + { "off", HandleGMOffCommand, SEC_GAMEMASTER1, Console::No } }; static ChatCommandTable commandTable = { @@ -156,7 +156,7 @@ class gm_commandscript : public CommandScript { ///- Get the accounts with GM Level >0 LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS); - stmt->SetData(0, uint8(SEC_TRIAL_GAMEMASTER)); + stmt->SetData(0, uint8(SEC_GAMEMASTER1)); stmt->SetData(1, int32(realm.Id.Realm)); PreparedQueryResult result = LoginDatabase.Query(stmt); diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 406218a9d4becb..b4b79a4924a008 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -45,19 +45,19 @@ class go_commandscript : public CommandScript { static ChatCommandTable goCommandTable = { - { "creature", HandleGoCreatureSpawnIdCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "creature id", HandleGoCreatureCIdCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "creature name", HandleGoCreatureNameCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "gameobject", HandleGoGameObjectSpawnIdCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "gameobject id", HandleGoGameObjectGOIdCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "graveyard", HandleGoGraveyardCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "grid", HandleGoGridCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "taxinode", HandleGoTaxinodeCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "trigger", HandleGoTriggerCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "zonexy", HandleGoZoneXYCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "xyz", HandleGoXYZCommand, SEC_TRIAL_GAMEMASTER, Console::No }, + { "creature", HandleGoCreatureSpawnIdCommand, SEC_GAMEMASTER1, Console::No }, + { "creature id", HandleGoCreatureCIdCommand, SEC_GAMEMASTER1, Console::No }, + { "creature name", HandleGoCreatureNameCommand, SEC_GAMEMASTER1, Console::No }, + { "gameobject", HandleGoGameObjectSpawnIdCommand, SEC_GAMEMASTER1, Console::No }, + { "gameobject id", HandleGoGameObjectGOIdCommand, SEC_GAMEMASTER1, Console::No }, + { "graveyard", HandleGoGraveyardCommand, SEC_GAMEMASTER1, Console::No }, + { "grid", HandleGoGridCommand, SEC_GAMEMASTER1, Console::No }, + { "taxinode", HandleGoTaxinodeCommand, SEC_GAMEMASTER1, Console::No }, + { "trigger", HandleGoTriggerCommand, SEC_GAMEMASTER1, Console::No }, + { "zonexy", HandleGoZoneXYCommand, SEC_GAMEMASTER1, Console::No }, + { "xyz", HandleGoXYZCommand, SEC_GAMEMASTER1, Console::No }, { "ticket", HandleGoTicketCommand, SEC_GAMEMASTER1, Console::No }, - { "quest", HandleGoQuestCommand, SEC_TRIAL_GAMEMASTER, Console::No }, + { "quest", HandleGoQuestCommand, SEC_GAMEMASTER1, Console::No }, }; static ChatCommandTable commandTable = diff --git a/src/server/scripts/Commands/cs_inventory.cpp b/src/server/scripts/Commands/cs_inventory.cpp index fb9f2679bb0b01..62a7e11cdafe53 100644 --- a/src/server/scripts/Commands/cs_inventory.cpp +++ b/src/server/scripts/Commands/cs_inventory.cpp @@ -71,7 +71,7 @@ class inventory_commandscript : public CommandScript { static ChatCommandTable inventoryCommandTable = { - { "count", HandleInventoryCountCommand, SEC_TRIAL_GAMEMASTER, Console::No } + { "count", HandleInventoryCountCommand, SEC_GAMEMASTER1, Console::No } }; static ChatCommandTable commandTable = diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 0de37bdb574bc5..cf9c6dc3478260 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -47,16 +47,16 @@ class list_commandscript : public CommandScript { static ChatCommandTable listAurasCommandTable = { - { "", HandleListAllAurasCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "id", HandleListAurasByIdCommand, SEC_TRIAL_GAMEMASTER, Console::No }, - { "name", HandleListAurasByNameCommand, SEC_TRIAL_GAMEMASTER, Console::No }, + { "", HandleListAllAurasCommand, SEC_GAMEMASTER1, Console::No }, + { "id", HandleListAurasByIdCommand, SEC_GAMEMASTER1, Console::No }, + { "name", HandleListAurasByNameCommand, SEC_GAMEMASTER1, Console::No }, }; static ChatCommandTable listCommandTable = { - { "creature", HandleListCreatureCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "item", HandleListItemCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "object", HandleListObjectCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, + { "creature", HandleListCreatureCommand, SEC_GAMEMASTER1, Console::Yes }, + { "item", HandleListItemCommand, SEC_GAMEMASTER1, Console::Yes }, + { "object", HandleListObjectCommand, SEC_GAMEMASTER1, Console::Yes }, { "auras", listAurasCommandTable }, }; static ChatCommandTable commandTable = diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 5927664bccf4f1..b89f5bf71f5ce2 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -52,12 +52,12 @@ class lookup_commandscript : public CommandScript static ChatCommandTable lookupCommandTable = { - { "area", HandleLookupAreaCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "creature", HandleLookupCreatureCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "event", HandleLookupEventCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "faction", HandleLookupFactionCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "item", HandleLookupItemCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, - { "item set", HandleLookupItemSetCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, + { "area", HandleLookupAreaCommand, SEC_GAMEMASTER1, Console::Yes }, + { "creature", HandleLookupCreatureCommand, SEC_GAMEMASTER1, Console::Yes }, + { "event", HandleLookupEventCommand, SEC_GAMEMASTER1, Console::Yes }, + { "faction", HandleLookupFactionCommand, SEC_GAMEMASTER1, Console::Yes }, + { "item", HandleLookupItemCommand, SEC_GAMEMASTER1, Console::Yes }, + { "item set", HandleLookupItemSetCommand, SEC_GAMEMASTER1, Console::Yes }, { "map", HandleLookupMapCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, { "object", HandleLookupObjectCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, { "gobject", HandleLookupObjectCommand, SEC_TRIAL_GAMEMASTER, Console::Yes }, diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 71b210016e327b..14d46b9e7686cf 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2888,7 +2888,7 @@ class misc_commandscript : public CommandScript { Creature* creatureTarget = handler->getSelectedCreature(); - if (!target && !creatureTarget) + if (!target) { target = PlayerIdentifier::FromTargetOrSelf(handler); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 04495ae45bc973..47118aa89025b8 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -31,11 +31,10 @@ enum MageSpells { - SPELL_MAGE_BLAZING_SPEED = 31643, + SPELL_MAGE_BLAZING_SPEED = 31643, SPELL_MAGE_BURNOUT_TRIGGER = 44450, SPELL_MAGE_IMPROVED_BLIZZARD_CHILLED = 12486, SPELL_MAGE_COMBUSTION = 11129, - SPELL_MAGE_COLD_SNAP = 11958, SPELL_MAGE_FOCUS_MAGIC_PROC = 54648, SPELL_MAGE_FROST_WARDING_R1 = 11189, @@ -54,18 +53,18 @@ enum MageSpells SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT = 70908, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907, SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, - SPELL_MAGE_CHILLED = 12484, - SPELL_MAGE_MANA_SURGE = 37445, - SPELL_MAGE_MAGIC_ABSORPTION_MANA = 29442, - SPELL_MAGE_ARCANE_POTENCY_RANK_1 = 57529, - SPELL_MAGE_ARCANE_POTENCY_RANK_2 = 57531, - SPELL_MAGE_COMBUSTION_PROC = 28682, - SPELL_MAGE_EMPOWERED_FIRE_PROC = 67545, - SPELL_MAGE_T10_2P_BONUS = 70752, - SPELL_MAGE_T10_2P_BONUS_EFFECT = 70753, - SPELL_MAGE_T8_4P_BONUS = 64869, - SPELL_MAGE_MISSILE_BARRAGE = 44401, - SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA = 44544, + SPELL_MAGE_CHILLED = 12484, + SPELL_MAGE_MANA_SURGE = 37445, + SPELL_MAGE_MAGIC_ABSORPTION_MANA = 29442, + SPELL_MAGE_ARCANE_POTENCY_RANK_1 = 57529, + SPELL_MAGE_ARCANE_POTENCY_RANK_2 = 57531, + SPELL_MAGE_COMBUSTION_PROC = 28682, + SPELL_MAGE_EMPOWERED_FIRE_PROC = 67545, + SPELL_MAGE_T10_2P_BONUS = 70752, + SPELL_MAGE_T10_2P_BONUS_EFFECT = 70753, + SPELL_MAGE_T8_4P_BONUS = 64869, + SPELL_MAGE_MISSILE_BARRAGE = 44401, + SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA = 44544, SPELL_MAGE_FINGERS_OF_FROST = 44543, // Duskhaven @@ -1751,6 +1750,7 @@ class spell_mage_arcane_barrage : public SpellScript void Register() override { + OnCheckCast += SpellCheckCastFn(spell_mage_arcane_barrage::CheckCast);; OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_arcane_barrage::FilterTargets, EFFECT_0, TARGET_UNIT_TARGET_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_mage_arcane_barrage::HandleOnEffectHitTarget, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } @@ -1919,9 +1919,7 @@ class spell_mage_barriers_onproc_aura : public AuraScript DamageInfo* damageInfo = eventInfo.GetDamageInfo(); if (!damageInfo || !damageInfo->GetDamage()) - { return; - } if (damageInfo->GetDamageType() != DIRECT_DAMAGE || damageInfo->GetAttackType() != BASE_ATTACK || damageInfo->GetAttackType() != OFF_ATTACK) PreventDefaultAction(); @@ -2080,20 +2078,38 @@ class spell_mage_blink : public SpellScript }; // 1310073 - Cascading Power -class spell_mage_cascading_power_aura : public AuraScript +class spell_mage_cascading_power_aura : public SpellScript { - PrepareAuraScript(spell_mage_cascading_power_aura); + PrepareSpellScript(spell_mage_cascading_power_aura); - void HandleOnApply() + void HandleBeforeHit(SpellMissInfo missInfo) { - if (GetTarget()->HasAura(SPELL_MAGE_CASCADING_POWER_BUFF)) - SetMaxDuration(GetDuration()); + caster = GetCaster(); + + if (caster->HasAura(SPELL_MAGE_CASCADING_POWER_BUFF)) + duration = caster->GetAura(SPELL_MAGE_CASCADING_POWER_BUFF)->GetDuration(); + } + + void HandleAfterHit() + { + if (caster && caster->HasAura(SPELL_MAGE_CASCADING_POWER_BUFF)) + { + Aura* aura = caster->GetAura(SPELL_MAGE_CASCADING_POWER_BUFF); + + if (aura->GetStackAmount() > 1) + aura->SetDuration(duration); + } } void Register() override { - OnAuraApply += AuraApplyFn(spell_mage_cascading_power_aura::HandleOnApply); + BeforeHit += BeforeSpellHitFn(spell_mage_cascading_power_aura::HandleBeforeHit); + AfterHit += SpellHitFn(spell_mage_cascading_power_aura::HandleAfterHit); } + +private: + Unit* caster; + float duration = 0; }; // 1290026 - Comet Storm @@ -2146,9 +2162,7 @@ class spell_mage_cone_of_cold : public SpellScript Player* player = caster->ToPlayer(); if (caster->HasAura(SPELL_MAGE_DIAMOND_DUST_AURA)) - { player->RemoveCategoryCooldown(29); // Blizzard - } } void Register() override @@ -2237,6 +2251,7 @@ class spell_mage_displacement_talent_aura : public AuraScript void HandleOnApply() { Player* player = GetCaster()->ToPlayer(); + if (!player->HasActiveSpell(SPELL_MAGE_DISPLACEMENT_TELEPORT)) player->learnSpell(SPELL_MAGE_DISPLACEMENT_TELEPORT); } @@ -2244,6 +2259,7 @@ class spell_mage_displacement_talent_aura : public AuraScript void HandleOnRemove() { Player* player = GetCaster()->ToPlayer(); + if (player->HasActiveSpell(SPELL_MAGE_DISPLACEMENT_TELEPORT)) player->removeSpell(SPELL_MAGE_DISPLACEMENT_TELEPORT, SPEC_MASK_ALL, false); } @@ -2317,10 +2333,8 @@ class spell_mage_displacement_summon : public AuraScript SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_MAGE_DISPLACEMENT_TELEPORT); if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true))) - { if (!GetTarget()->HasAura(SPELL_MAGE_DISPLACEMENT_ALLOW_CAST_AURA)) GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_DISPLACEMENT_ALLOW_CAST_AURA, true); - } else GetTarget()->RemoveAura(SPELL_MAGE_DISPLACEMENT_ALLOW_CAST_AURA); } @@ -3056,9 +3070,7 @@ class spell_mage_icy_veins : public SpellScript Unit* caster = GetCaster(); if (caster->HasAura(SPELL_MAGE_ICE_FORM_AURA)) - { caster->CastSpell(caster, SPELL_MAGE_ICY_VEINS_ICE_FORM, true); - } } void Register() override @@ -3090,9 +3102,7 @@ class spell_mage_master_of_magic_trigger : public SpellScript Unit* caster = GetCaster(); if (!caster->HasAura(SPELL_MAGE_MASTER_OF_MAGIC_ICD_AURA) && caster->HasAura(SPELL_MAGE_MASTER_OF_MAGIC_ARCANE_AURA) && caster->HasAura(SPELL_MAGE_MASTER_OF_MAGIC_FIRE_AURA) && caster->HasAura(SPELL_MAGE_MASTER_OF_MAGIC_FROST_AURA)) - { caster->CastSpell(caster, SPELL_MAGE_MASTER_OF_MAGIC_PROC_AURA, true); - } } void Register() override @@ -3253,9 +3263,7 @@ class spell_mage_missile_barrage_aura : public AuraScript Unit* caster = GetCaster(); if (caster->HasAura(SPELL_MAGE_ARCANIST_MIND_BUFF)) - { caster->RemoveAura(SPELL_MAGE_ARCANIST_MIND_BUFF); - } caster->RemoveAura(SPELL_MAGE_MISSILE_BARRAGE_BUFF); } @@ -3267,9 +3275,9 @@ class spell_mage_missile_barrage_aura : public AuraScript }; // 1310075 - Particle Disintegration -class spell_mage_particle_disintegration_aura : public AuraScript +class spell_mage_particle_disintegration_aura : public SpellScript { - PrepareAuraScript(spell_mage_particle_disintegration_aura); + PrepareSpellScript(spell_mage_particle_disintegration_aura); bool Validate(SpellInfo const* /*spellEntry*/) override { @@ -3279,26 +3287,40 @@ class spell_mage_particle_disintegration_aura : public AuraScript }); } - void HandleOnApply() + void HandleOnHit() { - Unit* target = GetTarget(); + target = GetHitUnit(); if (target->HasAura(SPELL_MAGE_PARTICLE_DISINTEGRATION_DEBUFF)) + duration = target->GetAura(SPELL_MAGE_PARTICLE_DISINTEGRATION_DEBUFF)->GetDuration(); + } + + void HandleAfterHit() + { + if (target && target->HasAura(SPELL_MAGE_PARTICLE_DISINTEGRATION_DEBUFF)) { - SetMaxDuration(GetDuration()); + Aura* aura = target->GetAura(SPELL_MAGE_PARTICLE_DISINTEGRATION_DEBUFF); + + if (aura->GetStackAmount() > 1) + aura->SetDuration(duration); } } void Register() override { - OnAuraApply += AuraApplyFn(spell_mage_particle_disintegration_aura::HandleOnApply); + OnHit += SpellHitFn(spell_mage_particle_disintegration_aura::HandleOnHit); + AfterHit += SpellHitFn(spell_mage_particle_disintegration_aura::HandleAfterHit); } + +private: + Unit* target; + float duration = 0; }; // 1280033 - Permafrost -class spell_mage_permafrost_aura : public AuraScript +class spell_mage_permafrost_aura : public SpellScript { - PrepareAuraScript(spell_mage_permafrost_aura); + PrepareSpellScript(spell_mage_permafrost_aura); bool Validate(SpellInfo const* /*spellEntry*/) override { @@ -3308,20 +3330,34 @@ class spell_mage_permafrost_aura : public AuraScript }); } - void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleBeforeHit(SpellMissInfo missInfo) { - Unit* caster = GetCaster(); + caster = GetCaster(); if (caster->HasAura(SPELL_MAGE_PERMAFROST_PROC)) + duration = caster->GetAura(SPELL_MAGE_PERMAFROST_PROC)->GetDuration(); + } + + void HandleAfterHit() + { + if (caster && caster->HasAura(SPELL_MAGE_PERMAFROST_PROC)) { - SetMaxDuration(GetDuration()); + Aura* aura = caster->GetAura(SPELL_MAGE_PERMAFROST_PROC); + + if (aura->GetStackAmount() > 1) + aura->SetDuration(duration); } } void Register() override { - OnEffectApply += AuraEffectApplyFn(spell_mage_permafrost_aura::HandleApply, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + BeforeHit += BeforeSpellHitFn(spell_mage_permafrost_aura::HandleBeforeHit); + AfterHit += SpellHitFn(spell_mage_permafrost_aura::HandleAfterHit); } + +private: + Unit* caster; + float duration = 0; }; // 1310065 - Power of the Mad Prince @@ -3501,9 +3537,7 @@ class spell_mage_pyroblast : public SpellScript Unit* target = GetHitUnit(); if (target->HasAura(SPELL_MAGE_IMPROVED_SCORCH_DEBUFF) && target->GetAura(SPELL_MAGE_IMPROVED_SCORCH_DEBUFF)->GetCaster()->GetGUID() == GetCaster()->GetGUID()) - { target->GetAura(SPELL_MAGE_IMPROVED_SCORCH_DEBUFF)->RefreshDuration(); - } if (cast) caster->CastSpell(target, SPELL_MAGE_SUNDERING_FLAME_DEBUFF, true); @@ -3525,6 +3559,7 @@ class spell_mage_pyroblast : public SpellScript void Register() override { + OnCast += SpellCastFn(spell_mage_pyroblast::HandleOnCast); OnHit += SpellHitFn(spell_mage_pyroblast::HandleOnHit); } @@ -3533,7 +3568,7 @@ class spell_mage_pyroblast : public SpellScript }; // 1290042 - Ray of Frost -class spell_mage_ray_of_frost_aura : public AuraScript // TODO: hitting enemies in ray path requires area trigger +class spell_mage_ray_of_frost_aura : public AuraScript { PrepareAuraScript(spell_mage_ray_of_frost_aura); @@ -3973,9 +4008,9 @@ class spell_mage_shimmer : public SpellScript }; // 1300031 - Sundering Flame -class spell_mage_sundering_flame_debuff_aura : public AuraScript +class spell_mage_sundering_flame_debuff_aura : public SpellScript { - PrepareAuraScript(spell_mage_sundering_flame_debuff_aura); + PrepareSpellScript(spell_mage_sundering_flame_debuff_aura); bool Validate(SpellInfo const* /*spellEntry*/) override { @@ -3985,20 +4020,34 @@ class spell_mage_sundering_flame_debuff_aura : public AuraScript }); } - void HandleOnApply() + void HandleOnHit() { - Unit* target = GetTarget(); + target = GetHitUnit(); if (target->HasAura(SPELL_MAGE_SUNDERING_FLAME_DEBUFF)) + duration = target->GetAura(SPELL_MAGE_SUNDERING_FLAME_DEBUFF)->GetDuration(); + } + + void HandleAfterHit() + { + if (target && target->HasAura(SPELL_MAGE_SUNDERING_FLAME_DEBUFF)) { - SetMaxDuration(GetDuration()); + Aura* aura = target->GetAura(SPELL_MAGE_SUNDERING_FLAME_DEBUFF); + + if (aura->GetStackAmount() > 1) + aura->SetDuration(duration); } } void Register() override { - OnAuraApply += AuraApplyFn(spell_mage_sundering_flame_debuff_aura::HandleOnApply); + OnHit += SpellHitFn(spell_mage_sundering_flame_debuff_aura::HandleOnHit); + AfterHit += SpellHitFn(spell_mage_sundering_flame_debuff_aura::HandleAfterHit); } + +private: + Unit* target; + float duration = 0; }; // 1310069 - Superconductor @@ -4385,4 +4434,3 @@ void AddSC_mage_spell_scripts() RegisterSpellScript(spell_mage_touch_of_the_magi_aura); RegisterSpellScript(spell_mage_touch_of_the_magi_talent_procs); } -