mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[0081] Implement server side spells
Add exemplarily support for spells 21387(used with Ragnaros) and 62388(related to Demonic Circle) Further table columns can be added as required. Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
6c5b7b6749
commit
e82f08f6f2
7 changed files with 8823 additions and 4855 deletions
13589
sql/mangos.sql
13589
sql/mangos.sql
File diff suppressed because it is too large
Load diff
22
sql/updates/0081_12000_01_mangos_spell_template.sql
Normal file
22
sql/updates/0081_12000_01_mangos_spell_template.sql
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_0065_12087_02_mangos_command required_0081_12000_01_mangos_spell_template bit;
|
||||
|
||||
DROP TABLE IF EXISTS `spell_template`;
|
||||
CREATE TABLE `spell_template` (
|
||||
`id` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`proc_flags` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`proc_chance` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`duration_index` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`effect0` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`effect0_implicit_target_a` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`effect0_radius_idx` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`effect0_apply_aura_name` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`effect0_misc_value` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`effect0_trigger_spell` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`comments` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='MaNGOS server side spells';
|
||||
|
||||
INSERT INTO spell_template VALUES
|
||||
-- ID proc_flags chnce dur ef0 tarA0 rad aur misc trigger
|
||||
(21387, 0x00000028, 15, 21, 6, 1, 0, 42, 0, 21388, 'Melt-Weapon trigger aura related used by Ragnaros'),
|
||||
(62388, 0x00000000, 101, 21, 6, 1, 0, 4, 0, 0, 'Aura required for Demonic Circle 48020');
|
||||
|
|
@ -6791,6 +6791,59 @@ void ObjectMgr::LoadNPCSpellClickSpells()
|
|||
sLog.outString(">> Loaded %u spellclick definitions", count);
|
||||
}
|
||||
|
||||
static char* SERVER_SIDE_SPELL = "MaNGOS server-side spell";
|
||||
|
||||
struct SQLSpellLoader : public SQLStorageLoaderBase<SQLSpellLoader>
|
||||
{
|
||||
template<class S, class D>
|
||||
void default_fill(uint32 field_pos, S src, D &dst)
|
||||
{
|
||||
if (field_pos == 65) // EquippedItemClass
|
||||
dst = D(-1);
|
||||
else
|
||||
dst = D(src);
|
||||
}
|
||||
|
||||
void default_fill_to_str(uint32 field_pos, char const* /*src*/, char * & dst)
|
||||
{
|
||||
if (field_pos == 132) // SpellName[0]
|
||||
{
|
||||
dst = SERVER_SIDE_SPELL;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst = new char[1];
|
||||
*dst = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void ObjectMgr::LoadSpellTemplate()
|
||||
{
|
||||
SQLSpellLoader loader;
|
||||
loader.Load(sSpellTemplate);
|
||||
|
||||
sLog.outString(">> Loaded %u spell definitions", sSpellTemplate.RecordCount);
|
||||
sLog.outString();
|
||||
|
||||
for (uint32 i = 1; i < sSpellTemplate.MaxEntry; ++i)
|
||||
{
|
||||
// check data correctness
|
||||
SpellEntry const* spellEntry = sSpellTemplate.LookupEntry<SpellEntry>(i);
|
||||
if (!spellEntry)
|
||||
continue;
|
||||
|
||||
// insert serverside spell data
|
||||
if (sSpellStore.GetNumRows() <= i)
|
||||
{
|
||||
sLog.outErrorDb("Loading Spell Template for spell %u, index out of bounds (max = %)", i, sSpellStore.GetNumRows());
|
||||
continue;
|
||||
}
|
||||
else
|
||||
sSpellStore.InsertEntry(const_cast<SpellEntry*>(spellEntry), i);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadWeatherZoneChances()
|
||||
{
|
||||
uint32 count = 0;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ const char WorldTemplatedstfmt[] = "ii";
|
|||
const char ConditionsSrcFmt[] = "iiii";
|
||||
const char ConditionsDstFmt[] = "iiii";
|
||||
const char SpellTemplatesrcfmt[] = "iiiiiiiiiix";
|
||||
|
||||
// 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 185
|
||||
const char SpellTemplatedstfmt[]="ixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiixxxxixxxxxxFxxxxxxxxxxxxxxxxxxxxxxixxxxxFFFxxxxxxixxxxxixxixxxxxFFFxxxxxxixxxxxixxFFFxxxxxxxxxxxxxppppppppppppppppppppppppppppppppxxxxxxxxxxxFFFxxxxxx";
|
||||
// Id proc DurationIndex
|
||||
SQLStorage sCreatureStorage(CreatureInfosrcfmt, CreatureInfodstfmt, "entry", "creature_template");
|
||||
SQLStorage sCreatureDataAddonStorage(CreatureDataAddonInfofmt, "guid", "creature_addon");
|
||||
SQLStorage sCreatureModelStorage(CreatureModelfmt, "modelid", "creature_model_info");
|
||||
|
|
@ -50,3 +52,4 @@ SQLStorage sPageTextStore(PageTextfmt, "entry", "page_text");
|
|||
SQLStorage sInstanceTemplate(InstanceTemplatesrcfmt, InstanceTemplatedstfmt, "map", "instance_template");
|
||||
SQLStorage sWorldTemplate(WorldTemplatesrcfmt, WorldTemplatedstfmt, "map", "world_template");
|
||||
SQLStorage sConditionStorage(ConditionsSrcFmt, ConditionsDstFmt, "condition_entry", "conditions");
|
||||
SQLStorage sSpellTemplate(SpellTemplatesrcfmt, SpellTemplatedstfmt, "id", "spell_template");
|
||||
|
|
|
|||
|
|
@ -34,5 +34,6 @@ extern SQLStorage sItemStorage;
|
|||
extern SQLStorage sInstanceTemplate;
|
||||
extern SQLStorage sWorldTemplate;
|
||||
extern SQLStorage sConditionStorage;
|
||||
extern SQLStorage sSpellTemplate;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "0080"
|
||||
#define REVISION_NR "0081"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_11785_02_characters_instance"
|
||||
#define REVISION_DB_MANGOS "required_12087_02_mangos_command"
|
||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||
#define REVISION_DB_CHARACTERS "required_0028_xxxxx_01_characters_character_phase_data"
|
||||
#define REVISION_DB_MANGOS "required_0081_12000_01_mangos_spell_template"
|
||||
#define REVISION_DB_REALMD "required_0014_xxxxx_01_realmd_account_access"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue