feat(Core\Player): Added createplayerinfo_cast_spell support cast spell for some class spells (#9448)

This commit is contained in:
acidmanifesto
2021-12-03 22:33:21 +01:00
committed by GitHub
parent 2789d5b877
commit 1500453f59
6 changed files with 81 additions and 69 deletions

View File

@@ -1,67 +0,0 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Player.h"
#include "ScriptMgr.h"
enum Creationabilities
{
WARRIOR_CREATION_BATTLE_STANCE = 2457, // Battle Stance
DEATH_KNIGHT_CREATION_BLOOD_PRESENCE = 48266, // Blood Presence
};
// Instead of adding a hacky way into Player::Create, we use existing hooks to cast these spells on first character login
class CharacterCreationProcedures : public PlayerScript
{
public:
CharacterCreationProcedures() : PlayerScript("CharacterCreationProcedures")
{
}
void OnFirstLogin(Player* player) override
{
switch (player->getClass())
{
// Only two classes posses an aura on creation;
case CLASS_WARRIOR:
player->CastSpell(player, WARRIOR_CREATION_BATTLE_STANCE, true);
return;
case CLASS_DEATH_KNIGHT:
player->CastSpell(player, DEATH_KNIGHT_CREATION_BLOOD_PRESENCE, true);
return;
// We include, but do not change the other classes
case CLASS_NONE:
case CLASS_PALADIN:
case CLASS_HUNTER:
case CLASS_ROGUE:
case CLASS_PRIEST:
case CLASS_SHAMAN:
case CLASS_MAGE:
case CLASS_WARLOCK:
// case CLASS_UNK: // Does not exist!
case CLASS_DRUID:
default:
// Can be modified based on personal needs;
return;
}
}
};
void AddSC_character_creation()
{
new CharacterCreationProcedures();
}

View File

@@ -28,7 +28,6 @@ void AddSC_npcs_special();
void AddSC_npc_taxi();
void AddSC_achievement_scripts();
void AddSC_chat_log(); // location: scripts\World\chat_log.cpp
void AddSC_character_creation();
void AddSC_action_ip_logger(); // location: scripts\World\action_ip_logger.cpp
void AddSC_player_scripts();
void AddSC_npc_stave_of_ancients();
@@ -49,7 +48,6 @@ void AddWorldScripts()
AddSC_npc_taxi();
AddSC_achievement_scripts();
AddSC_chat_log(); // location: scripts\World\chat_log.cpp
AddSC_character_creation();
AddSC_action_ip_logger(); // location: scripts\World\action_ip_logger.cpp
AddSC_player_scripts();
AddSC_npc_stave_of_ancients();