diff --git a/.github/actions/docker-tag-and-build/action.yml b/.github/actions/docker-tag-and-build/action.yml index af988bed6..436bf8fd4 100644 --- a/.github/actions/docker-tag-and-build/action.yml +++ b/.github/actions/docker-tag-and-build/action.yml @@ -13,6 +13,10 @@ inputs: description: version tag to use for docker image required: true type: string + dockerfile: + description: dockerfile to use + required: false + default: apps/docker/Dockerfile runs: using: composite steps: @@ -29,7 +33,7 @@ runs: uses: docker/build-push-action@v5 with: context: ${{ github.workspace }} - file: apps/docker/Dockerfile + file: ${{ inputs.dockerfile }} push: ${{ inputs.push }} tags: ${{ steps.meta.outputs.tags }} target: ${{ inputs.component-name }} diff --git a/.github/workflows/core-build-nopch.yml b/.github/workflows/core-build-nopch.yml index 2c29bd391..1e31fabdf 100644 --- a/.github/workflows/core-build-nopch.yml +++ b/.github/workflows/core-build-nopch.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'opened', 'synchronize', 'reopened'] + types: ['opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) @@ -25,7 +25,7 @@ jobs: name: ${{ matrix.os }}-${{ matrix.compiler }}-nopch env: COMPILER: ${{ matrix.compiler }} - if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft + if: github.repository == 'azerothcore/azerothcore-wotlk' steps: - uses: actions/checkout@v4 - name: Cache diff --git a/.github/workflows/core-build-pch.yml b/.github/workflows/core-build-pch.yml index 7420d2b17..7535ab5d5 100644 --- a/.github/workflows/core-build-pch.yml +++ b/.github/workflows/core-build-pch.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'opened', 'synchronize', 'reopened'] + types: ['opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index ffc3104a7..141d34036 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -14,76 +14,19 @@ concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) cancel-in-progress: true +env: + COMPOSE_DOCKER_CLI_BUILD: 1 + DOCKER_BUILDKIT: 1 + RUNNING_ON_PRIMARY_BRANCH: | + ${{ (github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master') && 'true' || 'false' }} + jobs: - docker-build-n-deploy-dev: + build-containers: runs-on: "ubuntu-latest" if: | github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft && (github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build') - env: - COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_BUILDKIT: 1 - - steps: - - name: Free up disk space - run: | - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - uses: actions/checkout@v4 - - - name: Login to Docker Hub - if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Get version - id: version - run: | - output=$(./acore.sh version | grep "AzerothCore Rev. ") - version=${output#"AzerothCore Rev. "} - echo "version=$version" >> $GITHUB_OUTPUT - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: acore/ac-wotlk-dev-server - tags: | - type=raw,value=${{ steps.version.outputs.version }} - type=ref,event=branch - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: ${{ github.workspace }} - file: apps/docker/Dockerfile.dev-server - push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }} - tags: ${{ steps.meta.outputs.tags }} - build-args: | - USER_ID=1000 - GROUP_ID=1000 - DOCKER_USER=acore - - # TODO: rename this job - docker-build-n-deploy-prod: - runs-on: "ubuntu-latest" - if: | - github.repository == 'azerothcore/azerothcore-wotlk' - && !github.event.pull_request.draft - && (github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build') - env: - COMPOSE_DOCKER_CLI_BUILD: 1 - DOCKER_BUILDKIT: 1 - steps: - name: Free up disk space run: | @@ -116,8 +59,7 @@ jobs: - name: Get version id: version run: | - output=$(./acore.sh version | grep "AzerothCore Rev. ") - version=${output#"AzerothCore Rev. "} + version="$(jq -r '.version' acore.json)" echo "version=$version" >> $GITHUB_OUTPUT - name: Set up Docker Buildx @@ -128,45 +70,53 @@ jobs: with: component-name: worldserver version: ${{ steps.version.outputs.version }} - push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }} + push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }} - name: build authserver uses: ./.github/actions/docker-tag-and-build with: component-name: authserver version: ${{ steps.version.outputs.version }} - push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }} + push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }} - name: build db-import uses: ./.github/actions/docker-tag-and-build with: component-name: db-import version: ${{ steps.version.outputs.version }} - push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }} + push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }} - name: build client-data uses: ./.github/actions/docker-tag-and-build with: component-name: client-data version: ${{ steps.version.outputs.version }} - push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }} + push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }} - name: build tools uses: ./.github/actions/docker-tag-and-build with: component-name: tools version: ${{ steps.version.outputs.version }} - push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }} + push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }} - dispatch-acore-docker: - needs: [ docker-build-n-deploy-prod , docker-build-n-deploy-dev] - runs-on: ubuntu-latest - steps: - - name: Repository Dispatch + - name: build dev-server + uses: ./.github/actions/docker-tag-and-build + with: + component-name: dev + version: ${{ steps.version.outputs.version }} + push: ${{ env.RUNNING_ON_PRIMARY_BRANCH }} + dockerfile: apps/docker/Dockerfile.dev-server + + - name: Trigger acore-docker CI if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.ACORE_DOCKER_REPO_ACCESS_TOKEN }} repository: azerothcore/acore-docker event-type: azerothcore-new-images - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' + client-payload: > + { + "ref": "${{ github.ref }}", + "sha": "${{ github.sha }}" + } diff --git a/data/sql/updates/db_world/2024_01_08_02.sql b/data/sql/updates/db_world/2024_01_08_02.sql new file mode 100644 index 000000000..308ed2131 --- /dev/null +++ b/data/sql/updates/db_world/2024_01_08_02.sql @@ -0,0 +1,10 @@ +-- DB update 2024_01_08_01 -> 2024_01_08_02 +-- +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 18544); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18544, 0, 0, 0, 1, 0, 100, 257, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 3832.74, 1448.12, -138.4, 0, 'Veraku - Out of Combat - Move To Position'), +(18544, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 0, 'Veraku - On Just Summoned - Start Attacking'); + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_challenge_veraku'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(34895, 'spell_challenge_veraku'); diff --git a/data/sql/updates/db_world/2024_01_08_03.sql b/data/sql/updates/db_world/2024_01_08_03.sql new file mode 100644 index 000000000..d45244b9a --- /dev/null +++ b/data/sql/updates/db_world/2024_01_08_03.sql @@ -0,0 +1,3 @@ +-- DB update 2024_01_08_02 -> 2024_01_08_03 +-- Fix Orgrimmar Grunt directions for barber shop +UPDATE `npc_text` SET `BroadcastTextID0` = 0 WHERE `ID` = 13889; diff --git a/data/sql/updates/db_world/2024_01_11_00.sql b/data/sql/updates/db_world/2024_01_11_00.sql new file mode 100644 index 000000000..75864296b --- /dev/null +++ b/data/sql/updates/db_world/2024_01_11_00.sql @@ -0,0 +1,6 @@ +-- DB update 2024_01_08_03 -> 2024_01_11_00 +-- Update creature 28344 'Blazzle' with sniffed values +-- new spawns +DELETE FROM `creature` WHERE (`id1` = 28344) AND (`guid` IN (116)); +INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES +(116, 28344, 530, 1, 1, 0, 3063.40625, 3677.5703125, 142.7606658935546875, 4.276056766510009765, 120, 0, 0, 0, 0, 0, "", 50063, 1, NULL); diff --git a/src/server/game/Combat/ThreatMgr.cpp b/src/server/game/Combat/ThreatMgr.cpp index c1041da49..21b3741d8 100644 --- a/src/server/game/Combat/ThreatMgr.cpp +++ b/src/server/game/Combat/ThreatMgr.cpp @@ -654,8 +654,12 @@ void ThreatMgr::ResetAllThreat() if (threatList.empty()) return; - for (ThreatContainer::StorageType::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) - (*itr)->SetThreat(0); + for (HostileReference* ref : threatList) + { + // Reset temp threat before setting threat back to 0. + ref->resetTempThreat(); + ref->SetThreat(0.f); + } setDirty(true); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1ce918161..84bf0a5cd 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1670,8 +1670,8 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad // xinef: fix from db if ((addToMap || gridLoad) && !data->overwrittenZ) { - float tz = map->GetHeight(data->posX, data->posY, data->posZ + 1.0f, true); - if (tz >= data->posZ && tz - data->posZ <= 1.0f) + float tz = map->GetHeight(data->posX, data->posY, data->posZ + 0.42f, true); + if (tz >= data->posZ && tz - data->posZ <= 0.42f) const_cast(data)->posZ = tz + 0.1f; const_cast(data)->overwrittenZ = true; diff --git a/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp b/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp index b33923bb8..31954970d 100644 --- a/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp +++ b/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp @@ -369,6 +369,14 @@ void ScriptMgr::OnPlayerLoadFromDB(Player* player) }); } +void ScriptMgr::OnBeforePlayerLogout(Player* player) +{ + ExecuteScript([&](PlayerScript* script) + { + script->OnBeforeLogout(player); + }); +} + void ScriptMgr::OnPlayerLogout(Player* player) { ExecuteScript([&](PlayerScript* script) diff --git a/src/server/game/Scripting/ScriptDefines/PlayerScript.h b/src/server/game/Scripting/ScriptDefines/PlayerScript.h index 76ddeebbc..301de1ac3 100644 --- a/src/server/game/Scripting/ScriptDefines/PlayerScript.h +++ b/src/server/game/Scripting/ScriptDefines/PlayerScript.h @@ -133,6 +133,9 @@ public: // Called when a player logs in. virtual void OnLogin(Player* /*player*/) { } + // Called before the player is logged out + virtual void OnBeforeLogout(Player* /*player*/) { } + // Called when a player logs out. virtual void OnLogout(Player* /*player*/) { } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 6d7b2f231..2b3e0b99d 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -362,6 +362,7 @@ public: /* PlayerScript */ void OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck); void OnPlayerLogin(Player* player); void OnPlayerLoadFromDB(Player* player); + void OnBeforePlayerLogout(Player* player); void OnPlayerLogout(Player* player); void OnPlayerCreate(Player* player); void OnPlayerSave(Player* player); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 2b92c2b11..033cc6b85 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -601,6 +601,9 @@ void WorldSession::LogoutPlayer(bool save) if (_player) { + //! Call script hook before other logout events + sScriptMgr->OnBeforePlayerLogout(_player); + if (ObjectGuid lguid = _player->GetLootGUID()) DoLootRelease(lguid); diff --git a/src/server/scripts/Events/pilgrims_bounty.cpp b/src/server/scripts/Events/pilgrims_bounty.cpp index 0327a3d40..e3386ca53 100644 --- a/src/server/scripts/Events/pilgrims_bounty.cpp +++ b/src/server/scripts/Events/pilgrims_bounty.cpp @@ -515,7 +515,15 @@ class spell_pilgrims_bounty_feast_on_generic : public SpellScript enum tTracker { SPELL_TURKEY_TRACKER = 62014, - SPELL_ACHI_TURKINATOR_CREDIT = 62021, + SPELL_ACHI_TURKINATOR_CREDIT = 62021 +}; + +enum Say +{ + SAY_TURKEY_HUNTER = 33163, + SAY_TURKEY_DOMINATION = 33164, + SAY_TURKEY_SLAUGHTER = 33165, + SAY_TURKEY_TRIUMPH = 33167 }; class spell_pilgrims_bounty_turkey_tracker : public SpellScript @@ -532,16 +540,16 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScript switch (stackAmount) { case 10: - target->TextEmote("Turkey Hunter!", target, true); + target->Whisper(SAY_TURKEY_HUNTER, target, true); break; case 20: - target->TextEmote("Turkey Domination!", target, true); + target->Whisper(SAY_TURKEY_DOMINATION, target, true); break; case 30: - target->TextEmote("Turkey Slaughter!", target, true); + target->Whisper(SAY_TURKEY_SLAUGHTER, target, true); break; case 40: - target->TextEmote("TURKEY TRIUMPH!", target, true); + target->Whisper(SAY_TURKEY_TRIUMPH, target, true); target->CastSpell(target, SPELL_ACHI_TURKINATOR_CREDIT, true); aurEff->GetBase()->Remove(); break; diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index bdaa848d8..e61baf0ff 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -950,6 +950,37 @@ class spell_q10190_battery_recharging_blaster_aura : public AuraScript } }; +enum Veraku +{ + NPC_VERAKU = 18544, + SPELL_CHALLENGE_VERAKU = 34895 +}; + +class spell_challenge_veraku : public SpellScript +{ +public: + PrepareSpellScript(spell_challenge_veraku); + + bool Validate(SpellInfo const* /*SpellInfo*/) override + { + return ValidateSpellInfo({ SPELL_CHALLENGE_VERAKU }); + } + + SpellCastResult CheckRequirement() + { + if (Unit* caster = GetCaster()) + if (Creature* veraku = caster->FindNearestCreature(NPC_VERAKU, 100.0f)) + if (!veraku->HasAura(SPELL_CHALLENGE_VERAKU)) + return SPELL_FAILED_CASTER_AURASTATE; + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_challenge_veraku::CheckRequirement); + } +}; + void AddSC_netherstorm() { // Ours @@ -962,5 +993,6 @@ void AddSC_netherstorm() new npc_bessy(); new npc_maxx_a_million_escort(); RegisterSpellAndAuraScriptPair(spell_q10190_battery_recharging_blaster, spell_q10190_battery_recharging_blaster_aura); + RegisterSpellScript(spell_challenge_veraku); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index f9a469025..5fb73879d 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -695,7 +695,8 @@ class spell_rog_pickpocket : public SpellScript enum vanish { - SPELL_PARALYZE = 38132, + SPELL_STEALTH = 1784, + SPELL_PARALYZE = 38132, SPELL_CLEAN_ESCAPE_AURA = 23582, SPELL_CLEAN_ESCAPE_HEAL = 23583 }; @@ -742,8 +743,22 @@ class spell_rog_vanish : public SpellScript void HandleEffect(SpellEffIndex /*effIndex*/) { - if (GetCaster() && GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA)) - GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true); + if (GetCaster()) + { + GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_STALKED); + + if (!GetCaster()->HasAura(SPELL_STEALTH)) + { + // Remove stealth cooldown if needed. + if (GetCaster()->IsPlayer() && GetCaster()->HasSpellCooldown(SPELL_STEALTH)) + GetCaster()->ToPlayer()->RemoveSpellCooldown(SPELL_STEALTH); + + GetCaster()->CastSpell(GetCaster(), SPELL_STEALTH, true); + } + + if (GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA)) + GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true); + } } void Register() override