Skip to content
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

[pull] master from azerothcore:master #91

Merged
merged 6 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions apps/DatabaseExporter/DatabaseExporter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ $mysqlCommand = "SET time_zone = '$timezone';"
$mysqlExec = "mysql -h $mysql_host -u $mysql_user -p$mysql_password -e `"$mysqlCommand`""
Invoke-Expression -Command $mysqlExec

# PS script uses non-utf-8 encoding by default
# https://stackoverflow.com/a/58438716
# Save the current encoding and switch to UTF-8.
$prev = [Console]::OutputEncoding
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()

Write-Host ""
Write-Host "#########################################################"
Write-Host "EXPORT AUTH DATABASE START"
Expand All @@ -123,10 +129,12 @@ foreach ($table in $tables_auth) {
# Export the table structure (CREATE TABLE) and table data (INSERT) to the SQL file
$create_table_command = "mysqldump -h $mysql_host -u $mysql_user --skip-tz-utc $mysql_database_auth $table"
$create_table_output = Invoke-Expression -Command $create_table_command
Add-Content -Path $output_file -Value $create_table_output
# write file with utf-8 encoding
# https://stackoverflow.com/a/32951824
[IO.File]::WriteAllLines($output_file, $create_table_output)

# Format the INSERT values to be on seperate lines.
$content = Get-Content $output_file
$content = Get-Content -Raw $output_file
$formattedContent = $content -replace 'VALUES \(', "VALUES`r`n("
$formattedContent = $formattedContent -replace '\),', "),`r`n"
$formattedContent | Set-Content $output_file
Expand Down Expand Up @@ -161,10 +169,12 @@ foreach ($table in $tables_characters) {
# Export the table structure (CREATE TABLE) and table data (INSERT) to the SQL file
$create_table_command = "mysqldump -h $mysql_host -u $mysql_user --skip-tz-utc $mysql_database_characters $table"
$create_table_output = Invoke-Expression -Command $create_table_command
Add-Content -Path $output_file -Value $create_table_output
# write file with utf-8 encoding
# https://stackoverflow.com/a/32951824
[IO.File]::WriteAllLines($output_file, $create_table_output)

# Format the INSERT values to be on seperate lines.
$content = Get-Content $output_file
$content = Get-Content -Raw $output_file
$formattedContent = $content -replace 'VALUES \(', "VALUES`r`n("
$formattedContent = $formattedContent -replace '\),', "),`r`n"
$formattedContent | Set-Content $output_file
Expand Down Expand Up @@ -199,10 +209,12 @@ foreach ($table in $tables_world) {
# Export the table structure (CREATE TABLE) and table data (INSERT) to the SQL file
$create_table_command = "mysqldump -h $mysql_host -u $mysql_user --skip-tz-utc $mysql_database_world $table"
$create_table_output = Invoke-Expression -Command $create_table_command
Add-Content -Path $output_file -Value $create_table_output
# write file with utf-8 encoding
# https://stackoverflow.com/a/32951824
[IO.File]::WriteAllLines($output_file, $create_table_output)

# Format the INSERT values to be on seperate lines.
$content = Get-Content $output_file
$content = Get-Content -Raw $output_file
$formattedContent = $content -replace 'VALUES \(', "VALUES`r`n("
$formattedContent = $formattedContent -replace '\),', "),`r`n"
$formattedContent | Set-Content $output_file
Expand All @@ -217,3 +229,6 @@ Write-Host "#########################################################"
Write-Host ""
Write-Host "Database Exporter completed."
Write-Host "Have a nice day :)"

# Restore the previous encoding.
[Console]::OutputEncoding = $prev
20 changes: 20 additions & 0 deletions data/sql/updates/db_world/2024_12_18_00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- DB update 2024_12_17_18 -> 2024_12_18_00

-- Set Flight to Disable Gravity and Rooted on 1

DELETE FROM `creature_template_movement` WHERE (`CreatureId` = 28850);
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES
(28850, 0, 0, 1, 1, 0, 0, 0);


-- Set SmartAI

UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28850;


-- Add SmartAI

DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28850);
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
(28850, 0, 0, 0, 1, 0, 100, 513, 1000, 1000, 1000, 1000, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Land Cannon - Out of Combat - Disable Combat Movement (No Repeat)'),
(28850, 0, 1, 0, 0, 0, 100, 0, 1000, 1000, 4000, 5000, 0, 0, 11, 52539, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Land Cannon - In Combat - Cast \'Cannonball\'');
2 changes: 1 addition & 1 deletion src/common/GitRevision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ char const* GitRevision::GetMySQLExecutable()

char const* GitRevision::GetFullVersion()
{
return VER_COMPANYNAME_STR " rev. " VER_PRODUCTVERSION_STR " (" AZEROTH_PLATFORM_STR ", " _BUILD_DIRECTIVE ", " ACORE_LINKAGE_TYPE_STR ")";
return VER_COMPANYNAME_STR " rev. " VER_PRODUCTVERSION_STR " (" AZEROTH_PLATFORM_STR ", " _BUILD_DIRECTIVE ", " ACORE_LINKAGE_TYPE_STR ")"; // cppcheck-suppress unknownMacro
}

char const* GitRevision::GetCompanyNameStr()
Expand Down
8 changes: 0 additions & 8 deletions src/server/game/Entities/Object/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,6 @@ class WorldObject : public Object, public WorldLocation
return GetMapId() == 571 && GetPositionX() > 3733.33331f && GetPositionX() < 5866.66663f && GetPositionY() > 1599.99999f && GetPositionY() < 4799.99997f;
}

#ifdef MAP_BASED_RAND_GEN
int32 irand(int32 min, int32 max) const { return int32 (GetMap()->mtRand.randInt(max - min)) + min; }
uint32 urand(uint32 min, uint32 max) const { return GetMap()->mtRand.randInt(max - min) + min;}
int32 rand32() const { return GetMap()->mtRand.randInt();}
double rand_norm() const { return GetMap()->mtRand.randExc();}
double rand_chance() const { return GetMap()->mtRand.randExc(100.0);}
#endif

uint32 LastUsedScriptID;

// Transports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
#include "MoveSplineInit.h"
#include "Player.h"

#ifdef MAP_BASED_RAND_GEN
#define rand_norm() unit.rand_norm()
#define urand(a, b) unit.urand(a, b)
#endif

template<class T>
void ConfusedMovementGenerator<T>::DoInitialize(T* unit)
{
Expand Down
8 changes: 0 additions & 8 deletions src/server/game/Spells/Spell.h
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,6 @@ class Spell
bool _spellTargetsSelected;

ByteBuffer* m_effectExecuteData[MAX_SPELL_EFFECTS];

#ifdef MAP_BASED_RAND_GEN
int32 irand(int32 min, int32 max) { return int32 (m_caster->GetMap()->mtRand.randInt(max - min)) + min; }
uint32 urand(uint32 min, uint32 max) { return m_caster->GetMap()->mtRand.randInt(max - min) + min; }
int32 rand32() { return m_caster->GetMap()->mtRand.randInt(); }
double rand_norm() { return m_caster->GetMap()->mtRand.randExc(); }
double rand_chance() { return m_caster->GetMap()->mtRand.randExc(100.0); }
#endif
};

namespace Acore
Expand Down
20 changes: 10 additions & 10 deletions src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ struct boss_nalorakk : public BossAI
Talk(SAY_SURGE);
DoCastRandomTarget(SPELL_SURGE, 0, 45.0f, false, false, false);
context.Repeat();
}).Schedule(7s, 12s, GROUP_HUMAN, [this](TaskContext context)
}).Schedule(15s, 25s, GROUP_HUMAN, [this](TaskContext context)
{
DoCastVictim(SPELL_BRUTALSWIPE);
context.Repeat();
}).Schedule(10s, 15s, GROUP_HUMAN, [this](TaskContext context)
}).Schedule(6s, 34s, GROUP_HUMAN, [this](TaskContext context)
{
if (me->GetVictim() && !me->GetVictim()->HasAura(SPELL_MANGLE))
{
Expand Down Expand Up @@ -250,11 +250,11 @@ struct boss_nalorakk : public BossAI
Talk(SAY_SURGE);
DoCastRandomTarget(SPELL_SURGE, 0, 45.0f, false, false, false);
context.Repeat();
}).Schedule(7s, 12s, GROUP_HUMAN, [this](TaskContext context)
}).Schedule(15s, 25s, GROUP_HUMAN, [this](TaskContext context)
{
DoCastVictim(SPELL_BRUTALSWIPE);
context.Repeat();
}).Schedule(10s, 15s, GROUP_HUMAN, [this](TaskContext context)
}).Schedule(6s, 34s, GROUP_HUMAN, [this](TaskContext context)
{
DoCastVictim(SPELL_MANGLE);
context.Repeat();
Expand All @@ -277,18 +277,18 @@ struct boss_nalorakk : public BossAI

me->SetCanDualWield(false);

scheduler.Schedule(2s, GROUP_BEAR, [this](TaskContext context)
scheduler.Schedule(4s, 26s, GROUP_BEAR, [this](TaskContext context)
{
DoCastVictim(SPELL_LACERATINGSLASH);
context.Repeat(18s, 23s);
}).Schedule(3s, GROUP_BEAR, [this](TaskContext context)
context.Repeat(4s, 26s);
}).Schedule(6s, 21s, GROUP_BEAR, [this](TaskContext context)
{
DoCastVictim(SPELL_RENDFLESH);
context.Repeat(5s, 10s);
}).Schedule(5s, 10s, GROUP_BEAR, [this](TaskContext context)
context.Repeat(6s, 21s);
}).Schedule(11s, 24s, GROUP_BEAR, [this](TaskContext context)
{
DoCastSelf(SPELL_DEAFENINGROAR);
context.Repeat(15s, 20s);
context.Repeat(11s, 24s);
}).Schedule(30s, GROUP_BEAR, [this](TaskContext)
{
ShapeShift(_bearForm);
Expand Down