mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7067] Move inactive form/stance passive spells from playercreateinfo_spell to spell_learn_spell with active field.
This let have in `playercreateinfo_spell` only expected at character creating spells for simplify updating.
This commit is contained in:
parent
6165da2b3a
commit
f956a3bf10
12 changed files with 2742 additions and 2724 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `character_db_version`;
|
DROP TABLE IF EXISTS `character_db_version`;
|
||||||
CREATE TABLE `character_db_version` (
|
CREATE TABLE `character_db_version` (
|
||||||
`required_7059_02_characters_pet_spell` bit(1) default NULL
|
`required_7067_03_characters_character_spell` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
|
||||||
5374
sql/mangos.sql
5374
sql/mangos.sql
File diff suppressed because it is too large
Load diff
6
sql/updates/7067_01_mangos_playercreateinfo_spell.sql
Normal file
6
sql/updates/7067_01_mangos_playercreateinfo_spell.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_7063_01_mangos_spell_proc_event required_7067_01_mangos_playercreateinfo_spell bit;
|
||||||
|
|
||||||
|
ALTER TABLE playercreateinfo_spell
|
||||||
|
DROP COLUMN Active;
|
||||||
|
|
||||||
|
DELETE FROM playercreateinfo_spell WHERE Spell IN (1178,3025,5419,5420,5421,7376,7381,9635,21156,21178,24905,33948,34123,40121);
|
||||||
33
sql/updates/7067_02_mangos_spell_learn_spell.sql
Normal file
33
sql/updates/7067_02_mangos_spell_learn_spell.sql
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_7067_01_mangos_playercreateinfo_spell required_7067_02_mangos_spell_learn_spell bit;
|
||||||
|
|
||||||
|
ALTER TABLE spell_learn_spell
|
||||||
|
ADD COLUMN Active tinyint(3) unsigned NOT NULL default '1' AFTER SpellID;
|
||||||
|
|
||||||
|
DELETE FROM spell_learn_spell WHERE Entry IN (
|
||||||
|
71,768,783,1066,2458,2457,5487,5487,9634,9634,17002,24858,24866,
|
||||||
|
33872,33873,33891,33891,33943,33943,33943,40123,40123
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO spell_learn_spell VALUES
|
||||||
|
(71,7376,0),
|
||||||
|
(768,3025,0),
|
||||||
|
(783,5419,0),
|
||||||
|
(1066,5421,0),
|
||||||
|
(2457,21156,0),
|
||||||
|
(2458,7381,0),
|
||||||
|
(5487,1178,0),
|
||||||
|
(5487,21178,0),
|
||||||
|
(9634,9635,0),
|
||||||
|
(9634,21178,0),
|
||||||
|
(17002,24867,0),
|
||||||
|
(24858,24905,0),
|
||||||
|
(24866,24864,0),
|
||||||
|
(33872,47179,0),
|
||||||
|
(33873,47180,0),
|
||||||
|
(33891,5420,0),
|
||||||
|
(33891,34123,0),
|
||||||
|
(33943,33948,0),
|
||||||
|
(33943,34090,1),
|
||||||
|
(33943,34764,0),
|
||||||
|
(40123,40121,0),
|
||||||
|
(40123,40122,0);
|
||||||
3
sql/updates/7067_03_characters_character_spell.sql
Normal file
3
sql/updates/7067_03_characters_character_spell.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE character_db_version CHANGE COLUMN required_7059_02_characters_pet_spell required_7067_03_characters_character_spell bit;
|
||||||
|
|
||||||
|
DELETE FROM `character_spell` WHERE `spell` IN (7376,3025,5419,5421,21156,7381,1178,21178,9635,21178,24905,5420,34123,33948,34090,34764,40121,40122);
|
||||||
|
|
@ -129,6 +129,9 @@ pkgdata_DATA = \
|
||||||
7060_01_mangos_spell_proc_event.sql \
|
7060_01_mangos_spell_proc_event.sql \
|
||||||
7061_01_mangos_spell_proc_event.sql \
|
7061_01_mangos_spell_proc_event.sql \
|
||||||
7063_01_mangos_spell_proc_event.sql \
|
7063_01_mangos_spell_proc_event.sql \
|
||||||
|
7067_01_mangos_playercreateinfo_spell.sql \
|
||||||
|
7067_02_mangos_spell_learn_spell.sql \
|
||||||
|
7067_03_characters_character_spell.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -238,4 +241,7 @@ EXTRA_DIST = \
|
||||||
7060_01_mangos_spell_proc_event.sql \
|
7060_01_mangos_spell_proc_event.sql \
|
||||||
7061_01_mangos_spell_proc_event.sql \
|
7061_01_mangos_spell_proc_event.sql \
|
||||||
7063_01_mangos_spell_proc_event.sql \
|
7063_01_mangos_spell_proc_event.sql \
|
||||||
|
7067_01_mangos_playercreateinfo_spell.sql \
|
||||||
|
7067_02_mangos_spell_learn_spell.sql \
|
||||||
|
7067_03_characters_character_spell.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -2225,8 +2225,8 @@ void ObjectMgr::LoadPlayerInfo()
|
||||||
|
|
||||||
// Load playercreate spells
|
// Load playercreate spells
|
||||||
{
|
{
|
||||||
// 0 1 2 3
|
// 0 1 2
|
||||||
QueryResult *result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell");
|
QueryResult *result = WorldDatabase.Query("SELECT race, class, Spell FROM playercreateinfo_spell");
|
||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
|
|
@ -2261,7 +2261,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerInfo* pInfo = &playerInfo[current_race][current_class];
|
PlayerInfo* pInfo = &playerInfo[current_race][current_class];
|
||||||
pInfo->spell.push_back(CreateSpellPair(fields[2].GetUInt16(), fields[3].GetUInt8()));
|
pInfo->spell.push_back(fields[2].GetUInt32());
|
||||||
|
|
||||||
bar.step();
|
bar.step();
|
||||||
++count;
|
++count;
|
||||||
|
|
|
||||||
|
|
@ -2822,8 +2822,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
|
||||||
{
|
{
|
||||||
if(!itr->second.autoLearned)
|
if(!itr->second.autoLearned)
|
||||||
{
|
{
|
||||||
if(loading) // at spells loading, no output, but allow save
|
if(loading || !itr->second.active) // at spells loading, no output, but allow save
|
||||||
addSpell(itr->second.spell,true,true,loading);
|
addSpell(itr->second.spell,itr->second.active,true,loading);
|
||||||
else // at normal learning
|
else // at normal learning
|
||||||
learnSpell(itr->second.spell);
|
learnSpell(itr->second.spell);
|
||||||
}
|
}
|
||||||
|
|
@ -17908,19 +17908,15 @@ void Player::learnDefaultSpells(bool loading)
|
||||||
{
|
{
|
||||||
// learn default race/class spells
|
// learn default race/class spells
|
||||||
PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(),getClass());
|
PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(),getClass());
|
||||||
std::list<CreateSpellPair>::const_iterator spell_itr;
|
for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr!=info->spell.end(); ++itr)
|
||||||
for (spell_itr = info->spell.begin(); spell_itr!=info->spell.end(); ++spell_itr)
|
|
||||||
{
|
{
|
||||||
uint16 tspell = spell_itr->first;
|
uint32 tspell = *itr;
|
||||||
if (tspell)
|
sLog.outDebug("PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell);
|
||||||
{
|
if(loading) // will send in INITIAL_SPELLS in list anyway
|
||||||
sLog.outDebug("PLAYER: Adding initial spell, id = %u",tspell);
|
addSpell(tspell,true);
|
||||||
if(loading || !spell_itr->second) // not care about passive spells or loading case
|
|
||||||
addSpell(tspell,spell_itr->second);
|
|
||||||
else // but send in normal spell in game learn case
|
else // but send in normal spell in game learn case
|
||||||
learnSpell(tspell);
|
learnSpell(tspell);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::learnQuestRewardedSpells(Quest const* quest)
|
void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,6 @@ enum ActionButtonType
|
||||||
|
|
||||||
typedef std::map<uint8,ActionButton> ActionButtonList;
|
typedef std::map<uint8,ActionButton> ActionButtonList;
|
||||||
|
|
||||||
typedef std::pair<uint16, uint8> CreateSpellPair;
|
|
||||||
|
|
||||||
struct PlayerCreateInfoItem
|
struct PlayerCreateInfoItem
|
||||||
{
|
{
|
||||||
PlayerCreateInfoItem(uint32 id, uint32 amount) : item_id(id), item_amount(amount) {}
|
PlayerCreateInfoItem(uint32 id, uint32 amount) : item_id(id), item_amount(amount) {}
|
||||||
|
|
@ -173,6 +171,8 @@ struct PlayerLevelInfo
|
||||||
uint8 stats[MAX_STATS];
|
uint8 stats[MAX_STATS];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::list<uint32> PlayerCreateInfoSpells;
|
||||||
|
|
||||||
struct PlayerInfo
|
struct PlayerInfo
|
||||||
{
|
{
|
||||||
// existence checked by displayId != 0 // existence checked by displayId != 0
|
// existence checked by displayId != 0 // existence checked by displayId != 0
|
||||||
|
|
@ -188,7 +188,7 @@ struct PlayerInfo
|
||||||
uint16 displayId_m;
|
uint16 displayId_m;
|
||||||
uint16 displayId_f;
|
uint16 displayId_f;
|
||||||
PlayerCreateInfoItems item;
|
PlayerCreateInfoItems item;
|
||||||
std::list<CreateSpellPair> spell;
|
PlayerCreateInfoSpells spell;
|
||||||
std::list<uint16> action[4];
|
std::list<uint16> action[4];
|
||||||
|
|
||||||
PlayerLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
|
PlayerLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
|
||||||
|
|
|
||||||
|
|
@ -1690,7 +1690,8 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||||
{
|
{
|
||||||
mSpellLearnSpells.clear(); // need for reload case
|
mSpellLearnSpells.clear(); // need for reload case
|
||||||
|
|
||||||
QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID FROM spell_learn_spell");
|
// 0 1 2
|
||||||
|
QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
|
||||||
if(!result)
|
if(!result)
|
||||||
{
|
{
|
||||||
barGoLink bar( 1 );
|
barGoLink bar( 1 );
|
||||||
|
|
@ -1714,6 +1715,7 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||||
|
|
||||||
SpellLearnSpellNode node;
|
SpellLearnSpellNode node;
|
||||||
node.spell = fields[1].GetUInt32();
|
node.spell = fields[1].GetUInt32();
|
||||||
|
node.active = fields[2].GetBool();
|
||||||
node.autoLearned= false;
|
node.autoLearned= false;
|
||||||
|
|
||||||
if(!sSpellStore.LookupEntry(spell_id))
|
if(!sSpellStore.LookupEntry(spell_id))
|
||||||
|
|
@ -1750,6 +1752,7 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||||
{
|
{
|
||||||
SpellLearnSpellNode dbc_node;
|
SpellLearnSpellNode dbc_node;
|
||||||
dbc_node.spell = entry->EffectTriggerSpell[i];
|
dbc_node.spell = entry->EffectTriggerSpell[i];
|
||||||
|
dbc_node.active = true; // all dbc based learned spells is active (show in spell book or hide by client itself)
|
||||||
|
|
||||||
// ignore learning not existed spells (broken/outdated/or generic learnig spell 483
|
// ignore learning not existed spells (broken/outdated/or generic learnig spell 483
|
||||||
if(!sSpellStore.LookupEntry(dbc_node.spell))
|
if(!sSpellStore.LookupEntry(dbc_node.spell))
|
||||||
|
|
|
||||||
|
|
@ -693,6 +693,7 @@ typedef std::map<uint32, SpellLearnSkillNode> SpellLearnSkillMap;
|
||||||
struct SpellLearnSpellNode
|
struct SpellLearnSpellNode
|
||||||
{
|
{
|
||||||
uint32 spell;
|
uint32 spell;
|
||||||
|
bool active; // show in spellbook or not
|
||||||
bool autoLearned;
|
bool autoLearned;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7066"
|
#define REVISION_NR "7067"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue