Skip to content

Commit

Permalink
Merge 3.3.5 to npcbots_3.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed May 24, 2024
2 parents f5de253 + df688af commit 4a29e67
Show file tree
Hide file tree
Showing 24 changed files with 163 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/actions/linux-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
using: composite
steps:
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
if: inputs.pch != 'true'
with:
path: ${{ github.workspace }}/var/ccache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-tools
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.9
uses: hendrikmuhs/ccache-action@v1.2.13
- name: Configure OS
shell: bash
env:
Expand Down
38 changes: 35 additions & 3 deletions apps/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
#!/usr/bin/env bash
set -euo pipefail

CONF_DIR="${CONF_DIR:-/azerothcore/env/dist/etc}"
LOGS_DIR="${LOGS_DIR:-/azerothcore/env/dist/logs}"

if ! touch "$CONF_DIR/.write-test" || ! touch "$LOGS_DIR/.write-test"; then
cat <<EOF
===== WARNING =====
The current user doesn't have write permissions for
the configuration dir ($CONF_DIR) or logs dir ($LOGS_DIR).
It's likely that services will fail due to this.
This is usually caused by cloning the repository as root,
so the files are owned by root (uid 0).
To resolve this, you can set the ownership of the
configuration directory with the command on the host machine.
Note that if the files are owned as root, the ownership must
be changed as root (hence sudo).
$ sudo chown -R $(id -u):$(id -g) /path/to$CONF_DIR /path/to$LOGS_DIR
Alternatively, you can set the DOCKER_USER environment
variable (on the host machine) to "root", though this
isn't recommended.
$ DOCKER_USER=root docker-compose up -d
====================
EOF
fi

[[ -f "$CONF_DIR/.write-test" ]] && rm -f "$CONF_DIR/.write-test"
[[ -f "$LOGS_DIR/.write-test" ]] && rm -f "$LOGS_DIR/.write-test"

# Copy all default config files to env/dist/etc if they don't already exist
# -r == recursive
# -n == no clobber (don't overwrite)
# -v == be verbose
cp -rnv /azerothcore/env/ref/etc/* /azerothcore/env/dist/etc
cp -rnv /azerothcore/env/ref/etc/* "$CONF_DIR"

CONF="/azerothcore/env/dist/etc/$ACORE_COMPONENT.conf"
CONF_DIST="/azerothcore/env/dist/etc/$ACORE_COMPONENT.conf.dist"
CONF="$CONF_DIR/$ACORE_COMPONENT.conf"
CONF_DIST="$CONF_DIR/$ACORE_COMPONENT.conf.dist"

# Copy the "dist" file to the "conf" if the conf doesn't already exist
if [[ -f "$CONF_DIST" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions data/sql/updates/db_world/2024_05_18_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- DB update 2024_05_15_00 -> 2024_05_18_00
UPDATE `creature_text` SET `BroadcastTextId`='32838' WHERE `CreatureID`='32169' AND `GroupID`='0' AND `ID`='0';
3 changes: 3 additions & 0 deletions data/sql/updates/db_world/2024_05_18_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- DB update 2024_05_18_00 -> 2024_05_18_01
--
UPDATE `acore_string` SET `content_default`='%d - |c%x|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r ', `locale_deDE`='%d - |c%x|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r ', `locale_zhCN`='%d - |c%x|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r' WHERE `entry`=512;
4 changes: 4 additions & 0 deletions data/sql/updates/db_world/2024_05_18_02.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- DB update 2024_05_18_01 -> 2024_05_18_02
-- add missing broadcastID to Elder Clearwater txt lines
UPDATE `creature_text` SET `BroadcastTextId` = '38218' WHERE `CreatureID` = '38294' AND `GroupID` = '1' AND `ID`='0';
UPDATE `creature_text` SET `BroadcastTextId` = '38222' WHERE `CreatureID` = '38294' AND `GroupID` = '3' AND `ID`='0';
19 changes: 19 additions & 0 deletions data/sql/updates/db_world/2024_05_19_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- DB update 2024_05_18_02 -> 2024_05_19_00
-- Update gameobject 'Crossroads' Supply Crates' with sniffed values
-- updated spawns
DELETE FROM `gameobject` WHERE (`id` IN (175708))
AND (`guid` IN (13381, 13382, 13384, 13385));
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES
(13381, 175708, 1, 0, 0, 1, 1, -69.6404571533203125, -3390.967529296875, 92.3358001708984375, 2.617989301681518554, 0, 0, 0.965925216674804687, 0.258821308612823486, 120, 255, 1, "", 45435, NULL),
(13382, 175708, 1, 0, 0, 1, 1, -230.87164306640625, -3307.604248046875, 91.66666412353515625, 1.745326757431030273, 0, 0, 0.766043663024902343, 0.642788589000701904, 120, 255, 1, "", 46902, NULL),
(13384, 175708, 1, 0, 0, 1, 1, -60.1678390502929687, -3398.855712890625, 91.72420501708984375, 5.602506637573242187, 0, 0, -0.33380699157714843, 0.942641437053680419, 120, 255, 1, "", 45435, NULL),
(13385, 175708, 1, 0, 0, 1, 1, -212.19598388671875, -3292.279052734375, 91.66666412353515625, 5.044002056121826171, 0, 0, -0.58070278167724609, 0.814115643501281738, 120, 255, 1, "", 51943, NULL);

-- new spawns
DELETE FROM `gameobject` WHERE (`id` IN (175708))
AND (`guid` IN (443, 444, 445, 446));
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES
(443, 175708, 1, 0, 0, 1, 1, -134.407684326171875, -3309.6806640625, 91.66666412353515625, 5.375615119934082031, 0, 0, -0.4383707046508789, 0.898794233798980712, 120, 255, 1, "", 45435, NULL),
(444, 175708, 1, 0, 0, 1, 1, -238.936386108398437, -3337.522705078125, 91.68515777587890625, 1.064649581909179687, 0, 0, 0.507537841796875, 0.861629426479339599, 120, 255, 1, "", 45435, NULL),
(445, 175708, 1, 0, 0, 1, 1, -38.3517112731933593, -3373.55859375, 91.701904296875, 0.767943859100341796, 0, 0, 0.374606132507324218, 0.927184045314788818, 120, 255, 1, "", 46902, NULL),
(446, 175708, 1, 0, 0, 1, 1, -48.2439079284667968, -3403.219482421875, 91.69777679443359375, 2.478367090225219726, 0, 0, 0.94551849365234375, 0.325568377971649169, 120, 255, 1, "", 46902, NULL);
8 changes: 8 additions & 0 deletions data/sql/updates/db_world/2024_05_19_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- DB update 2024_05_19_00 -> 2024_05_19_01
UPDATE `creature_template` SET `mingold` = 2500000, `maxgold` = 2500000 WHERE `entry` IN (17767, 17808, 17842, 17888, 18805, 18831, 19044, 19514, 19516, 21213, 21214, 21215, 21216, 21217, 22841, 23420, 22871, 22887, 22898, 22947, 22948, 24882, 24892, 25038, 25840);
UPDATE `creature_template` SET `mingold` = 625000, `maxgold` = 625000 WHERE `entry` IN (22949, 22950, 22951, 22952);
UPDATE `creature_template` SET `mingold` = 3000000, `maxgold` = 3000000 WHERE `entry` IN (17968, 19622, 21212, 22917);
UPDATE `creature_template` SET `mingold` = 3500000, `maxgold` = 3500000 WHERE `entry` IN (25165, 25166);
UPDATE `creature_template` SET `mingold` = 5000000, `maxgold` = 5000000 WHERE `entry` = 25315;
-- Values below are entirely guessed, ±25g from Wowhead's ~500g average money drop.
UPDATE `creature_template` SET `mingold` = 4750000, `maxgold` = 5250000 WHERE `entry` IN (17257, 17711, 18728);
5 changes: 5 additions & 0 deletions data/sql/updates/db_world/2024_05_20_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- DB update 2024_05_19_01 -> 2024_05_20_00
--
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_anetheron_sleep';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(31298, 'spell_anetheron_sleep');
9 changes: 9 additions & 0 deletions data/sql/updates/db_world/2024_05_21_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- DB update 2024_05_20_00 -> 2024_05_21_00
--
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 18104;
UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` = 18095;

DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 18104);
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`, `event_param6`, `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
(18104, 0, 0, 0, 60, 0, 100, 512, 1600, 1600, 1600, 1600, 0, 0, 89, 40, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Doomfire Spirit - Update - move to random near position in 40 yards'),
(18104, 0, 1, 0, 60, 0, 100, 512, 1550, 1550, 1600, 1600, 0, 0, 212, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Doomfire Spirit - Update - stop moving');
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Don't make changes this file! make a `docker-compose.override.yml` and make your
# changes there instead.

version: '3'
services:
ac-database:
container_name: ac-database
Expand Down
2 changes: 2 additions & 0 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6731,6 +6731,8 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply

statType = proto->ItemStat[i].ItemStatType;
val = proto->ItemStat[i].ItemStatValue;

sScriptMgr->OnApplyItemModsBefore(this, slot, apply, i, statType, val);
}

if (val == 0)
Expand Down
2 changes: 2 additions & 0 deletions src/server/game/Entities/Player/PlayerStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4455,6 +4455,8 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
}
}

sScriptMgr->OnApplyEnchantmentItemModsBefore(this, item, slot, apply, enchant_spell_id, enchant_amount);

LOG_DEBUG("entities.player.items", "Adding {} to stat nb {}", enchant_amount, enchant_spell_id);
switch (enchant_spell_id)
{
Expand Down
10 changes: 10 additions & 0 deletions src/server/game/Scripting/ScriptDefines/PlayerScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,16 @@ void ScriptMgr::OnCustomScalingStatValue(Player* player, ItemTemplate const* pro
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE, script->OnCustomScalingStatValue(player, proto, statType, val, itemProtoStatNumber, ScalingStatValue, ssv));
}

void ScriptMgr::OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE, script->OnApplyItemModsBefore(player, slot, apply, itemProtoStatNumber, statType, val));
}

void ScriptMgr::OnApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_APPLY_ENCHANTMENT_ITEM_MODS_BEFORE, script->OnApplyEnchantmentItemModsBefore(player, item, slot, apply, enchant_spell_id, enchant_amount));
}

bool ScriptMgr::CanArmorDamageModifier(Player* player)
{
CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_CAN_ARMOR_DAMAGE_MODIFIER, !script->CanArmorDamageModifier(player));
Expand Down
6 changes: 6 additions & 0 deletions src/server/game/Scripting/ScriptDefines/PlayerScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ enum PlayerHook
PLAYERHOOK_ON_VICTIM_REWARD_AFTER,
PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE_BEFORE,
PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE,
PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE,
PLAYERHOOK_ON_APPLY_ENCHANTMENT_ITEM_MODS_BEFORE,
PLAYERHOOK_CAN_ARMOR_DAMAGE_MODIFIER,
PLAYERHOOK_ON_GET_FERAL_AP_BONUS,
PLAYERHOOK_CAN_APPLY_WEAPON_DEPENDENT_AURA_DAMAGE_MOD,
Expand Down Expand Up @@ -542,6 +544,10 @@ class PlayerScript : public ScriptObject

virtual void OnCustomScalingStatValue(Player* /*player*/, ItemTemplate const* /*proto*/, uint32& /*statType*/, int32& /*val*/, uint8 /*itemProtoStatNumber*/, uint32 /*ScalingStatValue*/, ScalingStatValuesEntry const* /*ssv*/) { }

virtual void OnApplyItemModsBefore(Player* /*player*/, uint8 /*slot*/, bool /*apply*/, uint8 /*itemProtoStatNumber*/, uint32 /*statType*/, int32& /*val*/) { }

virtual void OnApplyEnchantmentItemModsBefore(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, uint32 /*enchant_spell_id*/, uint32& /*enchant_amount*/) { }

[[nodiscard]] virtual bool CanArmorDamageModifier(Player* /*player*/) { return true; }

virtual void OnGetFeralApBonus(Player* /*player*/, int32& /*feral_bonus*/, int32 /*dpsMod*/, ItemTemplate const* /*proto*/, ScalingStatValuesEntry const* /*ssv*/) { }
Expand Down
2 changes: 2 additions & 0 deletions src/server/game/Scripting/ScriptMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ class ScriptMgr
void OnVictimRewardAfter(Player* player, Player* victim, uint32& killer_title, uint32& victim_rank, float& honor_f);
void OnCustomScalingStatValueBefore(Player* player, ItemTemplate const* proto, uint8 slot, bool apply, uint32& CustomScalingStatValue);
void OnCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv);
void OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val);
void OnApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount);
bool CanArmorDamageModifier(Player* player);
void OnGetFeralApBonus(Player* player, int32& feral_bonus, int32 dpsMod, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv);
bool CanApplyWeaponDependentAuraDamageMod(Player* player, Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
Expand Down
5 changes: 3 additions & 2 deletions src/server/scripts/Commands/cs_lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ EndScriptData */
#include "ReputationMgr.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "SharedDefines.h"

using namespace Acore::ChatCommands;

Expand Down Expand Up @@ -516,7 +517,7 @@ class lookup_commandscript : public CommandScript

if (handler->GetSession())
{
handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, itemTemplate.ItemId, name.c_str());
handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, ItemQualityColors[itemTemplate.Quality], itemTemplate.ItemId, name.c_str());
}
else
{
Expand Down Expand Up @@ -550,7 +551,7 @@ class lookup_commandscript : public CommandScript

if (handler->GetSession())
{
handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, itemTemplate.ItemId, name.c_str());
handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, ItemQualityColors[itemTemplate.Quality], itemTemplate.ItemId, name.c_str());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "hyjal.h"

enum Spells
Expand Down Expand Up @@ -58,18 +60,18 @@ struct boss_anetheron : public BossAI

scheduler.Schedule(20s, 28s, [this](TaskContext context)
{
if (DoCastRandomTarget(SPELL_CARRION_SWARM, 0, 60.f))
if (DoCastRandomTarget(SPELL_CARRION_SWARM, 0, 60.f) == SPELL_CAST_OK)
Talk(SAY_SWARM);
context.Repeat(10s, 15s);
}).Schedule(25s, 32s, [this](TaskContext context)
{
if (DoCastRandomTarget(SPELL_SLEEP))
if (DoCastRandomTarget(SPELL_SLEEP) == SPELL_CAST_OK)
Talk(SAY_SLEEP);

context.Repeat(35s, 48s);
}).Schedule(30s, 48s, [this](TaskContext context)
{
if (DoCastRandomTarget(SPELL_INFERNO))
if (DoCastRandomTarget(SPELL_INFERNO) == SPELL_CAST_OK)
Talk(SAY_INFERNO);

context.Repeat(50s, 55s);
Expand Down Expand Up @@ -138,7 +140,24 @@ struct boss_anetheron : public BossAI

};

class spell_anetheron_sleep : public SpellScript
{
PrepareSpellScript(spell_anetheron_sleep);

void FilterTargets(std::list<WorldObject*>& targets)
{
if (!targets.empty())
Acore::Containers::RandomResize(targets, 3);
}

void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anetheron_sleep::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};

void AddSC_boss_anetheron()
{
RegisterHyjalAI(boss_anetheron);
RegisterSpellScript(spell_anetheron_sleep);
}
Loading

0 comments on commit 4a29e67

Please sign in to comment.