[Spell Copier] Simple INSERT SELECT (Copy spell)

3.3.5a [Spell Copier] Simple INSERT SELECT (Copy spell) 2022-12-25

INSERT INTO SELECT to copy a single spell
Very simple: Copies 1 spell
REQUIREMENT: You need Stoneharry's SpellEditor and the corrosponding database tables (for SpellEditor).

REMEBER: to edit dev_dbc_files.spell to your own table and database name.

Also contains two select queries.
The first select query selects everything (*).
The second select query selects: spell ID, spell name, and the three effectTriggerSpell'x'.


This is the same query as the attachment:
SQL:
-- ######################################
-- ######## Spell Copier SELECT #########
-- ######################################
-- ### By Frathir (ac-web; emuheaven) ###
-- ######################################

-- Simple Spell Copy SELECT

/* DESCRIPTION:
    Copies one spell to a new one only by ID
    */

/* Set the old spell ID */
    Set
        @old_Spell_ID = ''    -- Spell To Copy!
      ; -- end
                  --  is "Template Passive Aura"

/* NEW spell from here (NoEdit) */

  /* SET MAX */

    set
          @max_Spell_ID = (select max(spell.id) from dev_dbc_files.spell)
        ; -- end

  /* INSERT INTO SELECT
      Actual Spell creation */

    INSERT INTO
            dev_dbc_files.spell


        SELECT
             @max_Spell_ID + 1,
             spell.Category,
             spell.Dispel,
             spell.Mechanic,
             spell.Attributes,
             spell.AttributesEx,
             spell.AttributesEx2,
             spell.AttributesEx3,
             spell.AttributesEx4,
             spell.AttributesEx5,
             spell.AttributesEx6,
             spell.AttributesEx7,
             spell.Stances,
             spell.Unknown1,
             spell.StancesNot,
             spell.Unknown2,
             spell.Targets,
             spell.TargetCreatureType,
             spell.RequiresSpellFocus,
             spell.FacingCasterFlags,
             spell.CasterAuraState,
             spell.TargetAuraState,
             spell.CasterAuraStateNot,
             spell.TargetAuraStateNot,
             spell.CasterAuraSpell,
             spell.TargetAuraSpell,
             spell.ExcludeCasterAuraSpell,
             spell.ExcludeTargetAuraSpell,
             spell.CastingTimeIndex,
             spell.RecoveryTime,
             spell.CategoryRecoveryTime,
             spell.InterruptFlags,
             spell.AuraInterruptFlags,
             spell.ChannelInterruptFlags,
             spell.ProcFlags,
             spell.ProcChance,
             spell.ProcCharges,
             spell.MaximumLevel,
             spell.BaseLevel,
             spell.SpellLevel,
             spell.DurationIndex,
             spell.PowerType,
             spell.ManaCost,
             spell.ManaCostPerLevel,
             spell.ManaPerSecond,
             spell.ManaPerSecondPerLevel,
             spell.RangeIndex,
             spell.Speed,
             spell.ModalNextSpell,
             spell.StackAmount,
             spell.Totem1,
             spell.Totem2,
             spell.Reagent1,
             spell.Reagent2,
             spell.Reagent3,
             spell.Reagent4,
             spell.Reagent5,
             spell.Reagent6,
             spell.Reagent7,
             spell.Reagent8,
             spell.ReagentCount1,
             spell.ReagentCount2,
             spell.ReagentCount3,
             spell.ReagentCount4,
             spell.ReagentCount5,
             spell.ReagentCount6,
             spell.ReagentCount7,
             spell.ReagentCount8,
             spell.EquippedItemClass,
             spell.EquippedItemSubClassMask,
             spell.EquippedItemInventoryTypeMask,
             spell.Effect1,
             spell.Effect2,
             spell.Effect3,
             spell.EffectDieSides1,
             spell.EffectDieSides2,
             spell.EffectDieSides3,
             spell.EffectRealPointsPerLevel1,
             spell.EffectRealPointsPerLevel2,
             spell.EffectRealPointsPerLevel3,
             spell.EffectBasePoints1,
             spell.EffectBasePoints2,
             spell.EffectBasePoints3,
             spell.EffectMechanic1,
             spell.EffectMechanic2,
             spell.EffectMechanic3,
             spell.EffectImplicitTargetA1,
             spell.EffectImplicitTargetA2,
             spell.EffectImplicitTargetA3,
             spell.EffectImplicitTargetB1,
             spell.EffectImplicitTargetB2,
             spell.EffectImplicitTargetB3,
             spell.EffectRadiusIndex1,
             spell.EffectRadiusIndex2,
             spell.EffectRadiusIndex3,
             spell.EffectApplyAuraName1,
             spell.EffectApplyAuraName2,
             spell.EffectApplyAuraName3,
             spell.EffectAmplitude1,
             spell.EffectAmplitude2,
             spell.EffectAmplitude3,
             spell.EffectMultipleValue1,
             spell.EffectMultipleValue2,
             spell.EffectMultipleValue3,
             spell.EffectChainTarget1,
             spell.EffectChainTarget2,
             spell.EffectChainTarget3,
             spell.EffectItemType1,
             spell.EffectItemType2,
             spell.EffectItemType3,
             spell.EffectMiscValue1,
             spell.EffectMiscValue2,
             spell.EffectMiscValue3,
             spell.EffectMiscValueB1,
             spell.EffectMiscValueB2,
             spell.EffectMiscValueB3,
             spell.EffectTriggerSpell1,
             spell.EffectTriggerSpell2,
             spell.EffectTriggerSpell3,
             spell.EffectPointsPerComboPoint1,
             spell.EffectPointsPerComboPoint2,
             spell.EffectPointsPerComboPoint3,
             spell.EffectSpellClassMaskA1,
             spell.EffectSpellClassMaskA2,
             spell.EffectSpellClassMaskA3,
             spell.EffectSpellClassMaskB1,
             spell.EffectSpellClassMaskB2,
             spell.EffectSpellClassMaskB3,
             spell.EffectSpellClassMaskC1,
             spell.EffectSpellClassMaskC2,
             spell.EffectSpellClassMaskC3,
             spell.SpellVisual1,
             spell.SpellVisual2,
             spell.SpellIconID,
             spell.ActiveIconID,
             spell.SpellPriority,
             spell.SpellName0,
             spell.SpellName1,
             spell.SpellName2,
             spell.SpellName3,
             spell.SpellName4,
             spell.SpellName5,
             spell.SpellName6,
             spell.SpellName7,
             spell.SpellName8,
             spell.SpellNameFlag0,
             spell.SpellNameFlag1,
             spell.SpellNameFlag2,
             spell.SpellNameFlag3,
             spell.SpellNameFlag4,
             spell.SpellNameFlag5,
             spell.SpellNameFlag6,
             spell.SpellNameFlag7,
             spell.SpellRank0,
             spell.SpellRank1,
             spell.SpellRank2,
             spell.SpellRank3,
             spell.SpellRank4,
             spell.SpellRank5,
             spell.SpellRank6,
             spell.SpellRank7,
             spell.SpellRank8,
             spell.SpellRankFlags0,
             spell.SpellRankFlags1,
             spell.SpellRankFlags2,
             spell.SpellRankFlags3,
             spell.SpellRankFlags4,
             spell.SpellRankFlags5,
             spell.SpellRankFlags6,
             spell.SpellRankFlags7,
             spell.SpellDescription0,
             spell.SpellDescription1,
             spell.SpellDescription2,
             spell.SpellDescription3,
             spell.SpellDescription4,
             spell.SpellDescription5,
             spell.SpellDescription6,
             spell.SpellDescription7,
             spell.SpellDescription8,
             spell.SpellDescriptionFlags0,
             spell.SpellDescriptionFlags1,
             spell.SpellDescriptionFlags2,
             spell.SpellDescriptionFlags3,
             spell.SpellDescriptionFlags4,
             spell.SpellDescriptionFlags5,
             spell.SpellDescriptionFlags6,
             spell.SpellDescriptionFlags7,
             spell.SpellToolTip0,
             spell.SpellToolTip1,
             spell.SpellToolTip2,
             spell.SpellToolTip3,
             spell.SpellToolTip4,
             spell.SpellToolTip5,
             spell.SpellToolTip6,
             spell.SpellToolTip7,
             spell.SpellToolTip8,
             spell.SpellToolTipFlags0,
             spell.SpellToolTipFlags1,
             spell.SpellToolTipFlags2,
             spell.SpellToolTipFlags3,
             spell.SpellToolTipFlags4,
             spell.SpellToolTipFlags5,
             spell.SpellToolTipFlags6,
             spell.SpellToolTipFlags7,
             spell.ManaCostPercentage,
             spell.StartRecoveryCategory,
             spell.StartRecoveryTime,
             spell.MaximumTargetLevel,
             spell.SpellFamilyName,
             spell.SpellFamilyFlags,
             spell.SpellFamilyFlags1,
             spell.SpellFamilyFlags2,
             spell.MaximumAffectedTargets,
             spell.DamageClass,
             spell.PreventionType,
             spell.StanceBarOrder,
             spell.EffectDamageMultiplier1,
             spell.EffectDamageMultiplier2,
             spell.EffectDamageMultiplier3,
             spell.MinimumFactionId,
             spell.MinimumReputation,
             spell.RequiredAuraVision,
             spell.TotemCategory1,
             spell.TotemCategory2,
             spell.AreaGroupID,
             spell.SchoolMask,
             spell.RuneCostID,
             spell.SpellMissileID,
             spell.PowerDisplayId,
             spell.EffectBonusMultiplier1,
             spell.EffectBonusMultiplier2,
             spell.EffectBonusMultiplier3,
             spell.SpellDescriptionVariableID,
             spell.SpellDifficultyID


        FROM dev_dbc_files.spell
            WHERE dev_dbc_files.spell.ID = @old_Spell_ID

    ; -- END of INSERT INTO SELECT


    /* New Spell SELECT (max) */

    SELECT
            * -- ALL
        FROM
            dev_dbc_files.spell
        WHERE
            dev_dbc_files.spell.id = @max_Spell_ID + 1
    ; -- END


    /* New Spell Select (max) ONLY TRIGGERS */

    SELECT
            spell.ID,
             spell.SpellName0,
             spell.EffectTriggerSpell1,
             spell.EffectTriggerSpell2,
             spell.EffectTriggerSpell3
        FROM
            dev_dbc_files.spell
        WHERE
            dev_dbc_files.spell.id = @max_Spell_ID + 1
    ; -- END
Liked By 1 member :
Register & Get access to index
Frathir
Author Frathir
Divine

Posts

18

Likes

28

Resources

6

Version 2022-12-25
Downloads 8
Views 726
Last Update
0.00 star(s) 0 ratings
None

3,382

1,252

9,526

410

Top