Skip to content

Commit

Permalink
Spell: Move SpellTargetRestrictions DBC into database
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Dec 8, 2024
1 parent 6b73d09 commit fe2cd88
Show file tree
Hide file tree
Showing 12 changed files with 5,640 additions and 64 deletions.
15 changes: 15 additions & 0 deletions sql/base/dbc/cmangos_fixes/SpellTargetRestrictions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ALTER TABLE spell_template ADD `MaxTargetRadius` FLOAT NOT NULL DEFAULT '0' AFTER SpellTargetRestrictionsId;
ALTER TABLE spell_template ADD `MaxAffectedTargets` INT UNSIGNED NOT NULL DEFAULT '0' AFTER MaxTargetRadius;
ALTER TABLE spell_template ADD `MaxTargetLevel` INT UNSIGNED NOT NULL DEFAULT '0' AFTER MaxAffectedTargets;
ALTER TABLE spell_template ADD `TargetCreatureType` INT UNSIGNED NOT NULL DEFAULT '0' AFTER MaxTargetLevel;
ALTER TABLE spell_template ADD `Targets` INT UNSIGNED NOT NULL DEFAULT '0' AFTER TargetCreatureType;

UPDATE spell_template INNER JOIN spell_target_restrictions ON (spell_template.SpellTargetRestrictionsId = spell_target_restrictions.ID) SET spell_template.MaxTargetRadius = spell_target_restrictions.MaxTargetRadius;
UPDATE spell_template INNER JOIN spell_target_restrictions ON (spell_template.SpellTargetRestrictionsId = spell_target_restrictions.ID) SET spell_template.MaxAffectedTargets = spell_target_restrictions.MaxAffectedTargets;
UPDATE spell_template INNER JOIN spell_target_restrictions ON (spell_template.SpellTargetRestrictionsId = spell_target_restrictions.ID) SET spell_template.MaxTargetLevel = spell_target_restrictions.MaxTargetLevel;
UPDATE spell_template INNER JOIN spell_target_restrictions ON (spell_template.SpellTargetRestrictionsId = spell_target_restrictions.ID) SET spell_template.TargetCreatureType = spell_target_restrictions.TargetCreatureType;
UPDATE spell_template INNER JOIN spell_target_restrictions ON (spell_template.SpellTargetRestrictionsId = spell_target_restrictions.ID) SET spell_template.Targets = spell_target_restrictions.Targets;

ALTER TABLE spell_template DROP COLUMN SpellTargetRestrictionsId;

DROP TABLE spell_target_restrictions;
Loading

0 comments on commit fe2cd88

Please sign in to comment.