Skip to content

Commit db723c2

Browse files
author
Github Actions
committed
Merge 3.3.5 to 3.3.5-solocraft
2 parents 0488e7b + 0d19616 commit db723c2

File tree

16 files changed

+385
-458
lines changed

16 files changed

+385
-458
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--
2+
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27958;
3+
4+
DELETE FROM `smart_scripts` WHERE `entryorguid` = 27958 AND `source_type` = 0;
5+
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
6+
(27958,0,0,0,11,0,100,0,0,0,0,0,0,11,50186,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Parading Pink Elekk - On Spawn - Cast 'Parading Pink Elekk Life Aura'"),
7+
(27958,0,1,0,60,0,100,1,0,5000,0,0,0,11,36440,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Parading Pink Elekk - On Update - Cast 'Drunk Invisibility (Pink)' (No Repeat)"),
8+
(27958,0,2,0,11,0,100,0,0,0,0,0,0,29,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Parading Pink Elekk - On Spawn - Start Follow Owner");
9+
10+
DELETE FROM `spell_script_names` WHERE `spell_id` = 50186 AND `ScriptName` = 'spell_gen_despawn_aura';
11+
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
12+
(50186,'spell_gen_despawn_aura');
13+
14+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_brewfest_botm_pink_elekk';
15+
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
16+
(42264,'spell_brewfest_botm_pink_elekk');
17+
18+
-- This one is based only on comments
19+
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27867;
20+
DELETE FROM `smart_scripts` WHERE `entryorguid` = 27867 AND `source_type` = 0;
21+
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 2786700 AND 2786701 AND `source_type` = 9;
22+
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
23+
(27867,0,0,0,11,0,100,0,0,0,0,0,0,87,2786700,2786701,0,0,0,0,1,0,0,0,0,0,0,0,0,"Woodland Squirrel - On Spawn - Run Random Script"),
24+
25+
(2786700,9,0,0,0,0,100,0,0,0,0,0,0,11,49757,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Woodland Squirrel - On Script - Cast 'BOTM - Woodland Brew - Squirrel Love Aura'"),
26+
(2786700,9,1,0,0,0,100,0,0,0,0,0,0,29,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Woodland Squirrel - On Script - Start Follow Owner"),
27+
(2786700,9,2,0,0,0,100,0,10000,10000,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Woodland Squirrel - On Script - Despawn"),
28+
29+
(2786701,9,0,0,0,0,100,0,2000,2000,0,0,0,11,49764,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Woodland Squirrel - On Script - Cast 'BOTM - Woodland Brew - Squirrel Hate'"),
30+
(2786701,9,1,0,0,0,100,0,0,0,0,0,0,114,0,0,0,0,0,0,1,0,0,0,0,30,30,0,0,"Woodland Squirrel - On Script - Move Offset"),
31+
(2786701,9,2,0,0,0,100,0,5000,5000,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Woodland Squirrel - On Script - Despawn");
32+
33+
--
34+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_brewfest_botm_nauseous';
35+
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
36+
(49869,'spell_brewfest_botm_nauseous');

src/server/authserver/Server/AuthSession.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -517,39 +517,39 @@ bool AuthSession::HandleLogonProof()
517517
stmt->setString(3, _os);
518518
stmt->setInt16(4, _timezoneOffset.count());
519519
stmt->setString(5, _accountInfo.Login);
520-
LoginDatabase.DirectExecute(stmt);
521-
522-
// Finish SRP6 and send the final result to the client
523-
Trinity::Crypto::SHA1::Digest M2 = Trinity::Crypto::SRP6::GetSessionVerifier(logonProof->A, logonProof->clientM, _sessionKey);
524-
525-
ByteBuffer packet;
526-
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
520+
_queryProcessor.AddCallback(LoginDatabase.AsyncQuery(stmt)
521+
.WithPreparedCallback([this, M2 = Trinity::Crypto::SRP6::GetSessionVerifier(logonProof->A, logonProof->clientM, _sessionKey)](PreparedQueryResult const&)
527522
{
528-
sAuthLogonProof_S proof;
529-
proof.M2 = M2;
530-
proof.cmd = AUTH_LOGON_PROOF;
531-
proof.error = 0;
532-
proof.AccountFlags = 0x00800000; // 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament)
533-
proof.SurveyId = 0;
534-
proof.LoginFlags = 0; // 0x1 = has account message
535-
536-
packet.resize(sizeof(proof));
537-
std::memcpy(packet.contents(), &proof, sizeof(proof));
538-
}
539-
else
540-
{
541-
sAuthLogonProof_S_Old proof;
542-
proof.M2 = M2;
543-
proof.cmd = AUTH_LOGON_PROOF;
544-
proof.error = 0;
545-
proof.unk2 = 0x00;
546-
547-
packet.resize(sizeof(proof));
548-
std::memcpy(packet.contents(), &proof, sizeof(proof));
549-
}
523+
// Finish SRP6 and send the final result to the client
524+
ByteBuffer packet;
525+
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
526+
{
527+
sAuthLogonProof_S proof;
528+
proof.M2 = M2;
529+
proof.cmd = AUTH_LOGON_PROOF;
530+
proof.error = 0;
531+
proof.AccountFlags = 0x00800000; // 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament)
532+
proof.SurveyId = 0;
533+
proof.LoginFlags = 0; // 0x1 = has account message
534+
535+
packet.resize(sizeof(proof));
536+
std::memcpy(packet.contents(), &proof, sizeof(proof));
537+
}
538+
else
539+
{
540+
sAuthLogonProof_S_Old proof;
541+
proof.M2 = M2;
542+
proof.cmd = AUTH_LOGON_PROOF;
543+
proof.error = 0;
544+
proof.unk2 = 0x00;
545+
546+
packet.resize(sizeof(proof));
547+
std::memcpy(packet.contents(), &proof, sizeof(proof));
548+
}
550549

551-
SendPacket(packet);
552-
_status = STATUS_AUTHED;
550+
SendPacket(packet);
551+
_status = STATUS_AUTHED;
552+
}));
553553
}
554554
else
555555
{

src/server/database/Database/Implementation/LoginDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
3636
PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned (id, bandate, unbandate, bannedby, banreason, active) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban', 1)", CONNECTION_ASYNC);
3737
PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC);
3838
PrepareStatement(LOGIN_UPD_LOGON, "UPDATE account SET salt = ?, verifier = ? WHERE id = ?", CONNECTION_ASYNC);
39-
PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET session_key_auth = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ?, timezone_offset = ? WHERE username = ?", CONNECTION_SYNCH);
39+
PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET session_key_auth = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ?, timezone_offset = ? WHERE username = ?", CONNECTION_ASYNC);
4040
PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.id, a.username, a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, "
4141
"ab.unbandate = ab.bandate, aa.SecurityLevel, a.totp_secret, a.salt, a.verifier "
4242
"FROM account a LEFT JOIN account_access aa ON a.id = aa.AccountID LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ?", CONNECTION_ASYNC);

src/server/scripts/Events/brewfest.cpp

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,13 +432,14 @@ class spell_brewfest_mount_transformation : public SpellScript
432432
July [Stranglethorn Brew]
433433
spell_brewfest_botm_jungle_madness
434434
August [Draenic Pale Ale]
435-
NYI
435+
spell_brewfest_botm_pink_elekk
436436
September [Binary Brew]
437437
spell_brewfest_botm_teach_language
438438
October [Autumnal Acorn Ale]
439-
NYI
439+
Nothing to script here
440440
November [Bartlett's Bitter Brew]
441-
NYI
441+
spell_brewfest_botm_nauseous
442+
Incomplete
442443
December [Lord of Frost's Private Label]
443444
Nothing to script here
444445
*/
@@ -573,6 +574,34 @@ class spell_brewfest_botm_jungle_madness : public SpellScript
573574
}
574575
};
575576

577+
enum DraenicPaleAle
578+
{
579+
SPELL_BOTM_PINK_ELEKK = 49908
580+
};
581+
582+
// 42264 - Weak Alcohol
583+
class spell_brewfest_botm_pink_elekk : public SpellScript
584+
{
585+
PrepareSpellScript(spell_brewfest_botm_pink_elekk);
586+
587+
bool Validate(SpellInfo const* /*spellInfo*/) override
588+
{
589+
return ValidateSpellInfo({ SPELL_BOTM_PINK_ELEKK });
590+
}
591+
592+
void HandleAfterCast()
593+
{
594+
// TODO: Needs additional research, this spell is most likely used if drunk state is high enough.
595+
if (roll_chance_i(50))
596+
GetCaster()->CastSpell(GetCaster(), SPELL_BOTM_PINK_ELEKK);
597+
}
598+
599+
void Register() override
600+
{
601+
AfterCast += SpellCastFn(spell_brewfest_botm_pink_elekk::HandleAfterCast);
602+
}
603+
};
604+
576605
enum BinaryBrew
577606
{
578607
SPELL_LEARN_GNOMISH_BINARY = 50242,
@@ -601,6 +630,32 @@ class spell_brewfest_botm_teach_language : public SpellScript
601630
}
602631
};
603632

633+
enum BartlettsBitterBrew
634+
{
635+
SPELL_BOTM_VOMIT_BREW_VOMIT_VISUAL = 49867
636+
};
637+
638+
// 49869 - Nauseous
639+
class spell_brewfest_botm_nauseous : public AuraScript
640+
{
641+
PrepareAuraScript(spell_brewfest_botm_nauseous);
642+
643+
bool Validate(SpellInfo const* /*spellInfo*/) override
644+
{
645+
return ValidateSpellInfo({ SPELL_BOTM_VOMIT_BREW_VOMIT_VISUAL });
646+
}
647+
648+
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
649+
{
650+
GetTarget()->CastSpell(GetTarget(), SPELL_BOTM_VOMIT_BREW_VOMIT_VISUAL, true);
651+
}
652+
653+
void Register() override
654+
{
655+
AfterEffectRemove += AuraEffectRemoveFn(spell_brewfest_botm_nauseous::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
656+
}
657+
};
658+
604659
enum CreateEmptyBrewBottle
605660
{
606661
SPELL_BOTM_CREATE_EMPTY_BREW_BOTTLE = 51655
@@ -706,7 +761,9 @@ void AddSC_event_brewfest()
706761
RegisterSpellScript(spell_brewfest_botm_bloated);
707762
RegisterSpellScript(spell_brewfest_botm_internal_combustion);
708763
RegisterSpellScript(spell_brewfest_botm_jungle_madness);
764+
RegisterSpellScript(spell_brewfest_botm_pink_elekk);
709765
RegisterSpellScript(spell_brewfest_botm_teach_language);
766+
RegisterSpellScript(spell_brewfest_botm_nauseous);
710767
RegisterSpellScript(spell_brewfest_botm_weak_alcohol);
711768
RegisterSpellScript(spell_brewfest_botm_empty_bottle_throw_resolve);
712769
RegisterSpellScript(spell_brewfest_mole_machine_portal_schedule);

src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,42 @@
1919
#include "halls_of_stone.h"
2020
#include "ScriptedCreature.h"
2121
#include "SpellInfo.h"
22+
#include "SpellMgr.h"
2223
#include "SpellScript.h"
2324

24-
enum Spells
25+
enum KrystallusTexts
2526
{
26-
SPELL_BOULDER_TOSS = 50843,
27-
SPELL_GROUND_SPIKE = 59750,
28-
SPELL_GROUND_SLAM = 50827,
29-
SPELL_SHATTER = 50810,
30-
SPELL_SHATTER_EFFECT = 50811,
31-
SPELL_STONED = 50812,
32-
SPELL_STOMP = 48131
27+
SAY_AGGRO = 0,
28+
SAY_SLAY = 1,
29+
SAY_DEATH = 2,
30+
SAY_SHATTER = 3
3331
};
3432

35-
enum Yells
33+
enum KrystallusSpells
3634
{
37-
SAY_AGGRO = 0,
38-
SAY_KILL = 1,
39-
SAY_DEATH = 2,
40-
SAY_SHATTER = 3
35+
SPELL_BOULDER_TOSS = 50843,
36+
SPELL_GROUND_SPIKE = 59750,
37+
SPELL_GROUND_SLAM = 50827,
38+
SPELL_SHATTER = 50810,
39+
SPELL_SHATTER_EFFECT = 50811,
40+
SPELL_STONED = 50812,
41+
SPELL_STOMP = 48131
4142
};
4243

43-
enum Events
44+
enum KrystallusEvents
4445
{
45-
EVENT_BOULDER_TOSS = 1,
46+
EVENT_BOULDER_TOSS = 1,
4647
EVENT_GROUND_SPIKE,
4748
EVENT_GROUND_SLAM,
4849
EVENT_STOMP,
4950
EVENT_SHATTER
5051
};
5152

53+
// 27977 - Krystallus
5254
struct boss_krystallus : public BossAI
5355
{
5456
boss_krystallus(Creature* creature) : BossAI(creature, DATA_KRYSTALLUS) { }
5557

56-
void Reset() override
57-
{
58-
_Reset();
59-
}
60-
6158
void JustEngagedWith(Unit* who) override
6259
{
6360
Talk(SAY_AGGRO);
@@ -70,9 +67,26 @@ struct boss_krystallus : public BossAI
7067
events.ScheduleEvent(EVENT_GROUND_SPIKE, 9s, 14s);
7168
}
7269

70+
void OnSpellCast(SpellInfo const* spell) override
71+
{
72+
if (spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_SHATTER, me))
73+
Talk(SAY_SHATTER);
74+
}
75+
76+
void KilledUnit(Unit* victim) override
77+
{
78+
if (victim->GetTypeId() == TYPEID_PLAYER)
79+
Talk(SAY_SLAY);
80+
}
81+
82+
void JustDied(Unit* /*killer*/) override
83+
{
84+
Talk(SAY_DEATH);
85+
_JustDied();
86+
}
87+
7388
void UpdateAI(uint32 diff) override
7489
{
75-
// Return since we have no target
7690
if (!UpdateVictim())
7791
return;
7892

@@ -88,24 +102,24 @@ struct boss_krystallus : public BossAI
88102
case EVENT_BOULDER_TOSS:
89103
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
90104
DoCast(target, SPELL_BOULDER_TOSS);
91-
events.ScheduleEvent(EVENT_BOULDER_TOSS, 9s, 15s);
105+
events.Repeat(9s, 15s);
92106
break;
93107
case EVENT_GROUND_SPIKE:
94108
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
95109
DoCast(target, SPELL_GROUND_SPIKE);
96-
events.ScheduleEvent(EVENT_GROUND_SPIKE, 12s, 17s);
110+
events.Repeat(12s, 17s);
97111
break;
98112
case EVENT_GROUND_SLAM:
99-
DoCast(me, SPELL_GROUND_SLAM);
113+
DoCastSelf(SPELL_GROUND_SLAM);
100114
events.ScheduleEvent(EVENT_SHATTER, 10s);
101-
events.ScheduleEvent(EVENT_GROUND_SLAM, 15s, 18s);
115+
events.Repeat(15s, 18s);
102116
break;
103117
case EVENT_STOMP:
104-
DoCast(me, SPELL_STOMP);
105-
events.ScheduleEvent(EVENT_STOMP, 20s, 29s);
118+
DoCastSelf(SPELL_STOMP);
119+
events.Repeat(20s, 29s);
106120
break;
107121
case EVENT_SHATTER:
108-
DoCast(me, SPELL_SHATTER);
122+
DoCastSelf(SPELL_SHATTER);
109123
break;
110124
default:
111125
break;
@@ -117,18 +131,6 @@ struct boss_krystallus : public BossAI
117131

118132
DoMeleeAttackIfReady();
119133
}
120-
121-
void JustDied(Unit* /*killer*/) override
122-
{
123-
Talk(SAY_DEATH);
124-
_JustDied();
125-
}
126-
127-
void KilledUnit(Unit* victim) override
128-
{
129-
if (victim->GetTypeId() == TYPEID_PLAYER)
130-
Talk(SAY_KILL);
131-
}
132134
};
133135

134136
// 50810, 61546 - Shatter

0 commit comments

Comments
 (0)