Skip to content
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
35 changes: 35 additions & 0 deletions sql/migrations/20260102184203_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
DROP PROCEDURE IF EXISTS add_migration;
DELIMITER ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20260102184203');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20260102184203');
-- Add your query below.

UPDATE `spell_template` SET `script_name`='spell_shadowmeld' WHERE `entry` = 20580;
UPDATE `spell_template` SET `script_name`='spell_stoneform' WHERE `entry` = 20594;
UPDATE `spell_template` SET `script_name`='spell_discombobulate' WHERE `entry` = 4060;
UPDATE `spell_template` SET `script_name`='spell_warrior_sweeping_strikes' WHERE `entry` = 12292;
UPDATE `spell_template` SET `script_name`='spell_warrior_blood_fury' WHERE `entry` = 23234;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we assign it just to the patch the script is for

UPDATE `spell_template` SET `script_name`='spell_nefarian_polymorph' WHERE `entry` = 23603;
UPDATE `spell_template` SET `script_name`='spell_ashbringer' WHERE `entry` = 28282;
UPDATE `spell_template` SET `script_name`='spell_silithyst' WHERE `entry` = 29519;
UPDATE `spell_template` SET `script_name`='spell_controlling_steam_tonk' WHERE `entry` = 24937;
UPDATE `spell_template` SET `script_name`='spell_chains_of_kelthuzad' WHERE `entry` = 28410;
UPDATE `spell_template` SET `script_name`='spell_shaman_mana_tide' WHERE `entry` = 16191;
UPDATE `spell_template` SET `script_name`='spell_hunter_frost_trap_aura' WHERE `entry` = 13810;
UPDATE `spell_template` SET `script_name`='spell_warlock_curse_of_idiocy' WHERE `entry` = 1010;
UPDATE `spell_template` SET `script_name`='spell_activate_mg_turret' WHERE `entry` = 25026;
UPDATE `spell_template` SET `script_name`='spell_flamethrower' WHERE `entry` = 25027;
UPDATE `spell_template` SET `script_name`='spell_thaddius_positive_charge_aura' WHERE `entry` = 28059;
UPDATE `spell_template` SET `script_name`='spell_thaddius_negative_charge_aura' WHERE `entry` = 28084;
UPDATE `spell_template` SET `script_name`='spell_cannibalize_aura' WHERE `entry` = 20578;

-- End of migration.
END IF;
END??
DELIMITER ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
6 changes: 1 addition & 5 deletions src/game/Handlers/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
if (pCurrChar->m_deathState != ALIVE)
{
// not blizz like, we must correctly save and load player instead...
if (pCurrChar->GetRace() == RACE_NIGHTELF)
pCurrChar->CastSpell(pCurrChar, 20584, true); // auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
pCurrChar->CastSpell(pCurrChar, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)

pCurrChar->SetWaterWalking(true);
pCurrChar->ApplyGhostForm();
}
}

Expand Down
38 changes: 29 additions & 9 deletions src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4628,6 +4628,33 @@ void Player::SetFly(bool enable)
SendHeartBeat(true);
}

enum GhostForm : uint32
{
SPELL_WISP_SPIRIT = 20585,
SPELL_WISP_SPIRIT_GHOST = 20584,
SPELL_GHOST = 8326,
};

void Player::ApplyGhostForm()
{
if (HasSpell(SPELL_WISP_SPIRIT))
{
CastSpell(this, SPELL_WISP_SPIRIT_GHOST, true);
}
CastSpell(this, SPELL_GHOST, true);
SetWaterWalking(true);
}

void Player::RemoveGhostForm()
{
if (HasSpell(SPELL_WISP_SPIRIT))
{
RemoveAurasDueToSpell(SPELL_WISP_SPIRIT_GHOST);
}
RemoveAurasDueToSpell(SPELL_GHOST);
SetWaterWalking(false);
}

/* Preconditions:
- a resurrectable corpse must not be loaded for the player (only bones)
- the player must be in world
Expand All @@ -4641,9 +4668,7 @@ void Player::BuildPlayerRepop()
//this is spirit release confirm?
RemovePet(PET_SAVE_REAGENTS);

if (GetRace() == RACE_NIGHTELF)
CastSpell(this, 20584, true); // auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
CastSpell(this, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
ApplyGhostForm();

// the player cannot have a corpse already, only bones which are not returned by GetCorpse
Corpse* corpse;
Expand All @@ -4668,7 +4693,6 @@ void Player::BuildPlayerRepop()
// convert player body to ghost
SetHealth(1);

SetWaterWalking(true);
if (!GetSession()->IsLogingOut())
SetRooted(false);

Expand All @@ -4695,11 +4719,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)

SetDeathState(ALIVE);

if (GetRace() == RACE_NIGHTELF)
RemoveAurasDueToSpell(20584); // speed bonuses
RemoveAurasDueToSpell(8326); // SPELL_AURA_GHOST

SetWaterWalking(false);
RemoveGhostForm();
SetRooted(false);

// set health/powers (0- will be set in caller)
Expand Down
2 changes: 2 additions & 0 deletions src/game/Objects/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,8 @@ class Player final: public Unit
void ResurrectPlayer(float restore_percent, bool applySickness = false);
void BuildPlayerRepop();
void RepopAtGraveyard();
void ApplyGhostForm();
void RemoveGhostForm();
void ScheduleRepopAtGraveyard();

// Nostalrius : Phasing
Expand Down
Loading