using table "SpellXCustomValues" will allow to link multiple spell by creating multiple relations with key "MultipleSubSpellID" and one SpellID by row.
- Code: Select all
ed11b9007af489d860f214833a0552fdbd53e507 DOLSharp/trunk/GameServer/spells/Spell.cs | 10 +++++++++- DOLSharp/trunk/GameServer/spells/SpellHandler.cs | 20 ++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/DOLSharp/trunk/GameServer/spells/Spell.cs b/DOLSharp/trunk/GameServer/spells/Spell.cs index 5d167c2..38e5d5b 100644 --- a/DOLSharp/trunk/GameServer/spells/Spell.cs +++ b/DOLSharp/trunk/GameServer/spells/Spell.cs @@ -548,7 +548,7 @@ namespace DOL.GS { get { - return SubSpellID > 0; + return SubSpellID > 0 || MultipleSubSpells.Count > 0; } } @@ -638,6 +638,14 @@ namespace DOL.GS return this.GetParamValue<ushort>("InternalIconID"); } } + + public IList<int> MultipleSubSpells + { + get + { + return this.GetParamValues<int>("MultipleSubSpellID").Where(id => id > 0).ToList(); + } + } /// <summary> /// Initialize Param Cache from DB Relation Collection. diff --git a/DOLSharp/trunk/GameServer/spells/SpellHandler.cs b/DOLSharp/trunk/GameServer/spells/SpellHandler.cs index 821bb6a..cf8cad7 100644 --- a/DOLSharp/trunk/GameServer/spells/SpellHandler.cs +++ b/DOLSharp/trunk/GameServer/spells/SpellHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Text; using DOL.AI.Brain; @@ -2329,14 +2330,21 @@ namespace DOL.GS.Spells /// <param name="target"></param> public virtual void CastSubSpells(GameLiving target) { - if (m_spell.SubSpellID > 0 && Spell.SpellType != "Archery" && Spell.SpellType != "Bomber" && Spell.SpellType != "SummonAnimistFnF" && Spell.SpellType != "SummonAnimistPet" && Spell.SpellType != "Grapple") + if (Spell.SpellType != "Archery" && Spell.SpellType != "Bomber" && Spell.SpellType != "SummonAnimistFnF" && Spell.SpellType != "SummonAnimistPet" && Spell.SpellType != "Grapple") { - Spell spell = SkillBase.GetSpellByID(m_spell.SubSpellID); - //we need subspell ID to be 0, we don't want spells linking off the subspell - if (target != null && spell != null && spell.SubSpellID == 0) + List<int> subSpellList = new List<int>(); + if (m_spell.SubSpellID > 0) + subSpellList.Add(m_spell.SubSpellID); + + foreach (int spellID in subSpellList.Union(m_spell.MultipleSubSpells)) { - ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_caster, spell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); - spellhandler.StartSpell(target); + Spell spell = SkillBase.GetSpellByID(spellID); + //we need subspell ID to be 0, we don't want spells linking off the subspell + if (target != null && spell != null && spell.SubSpellID == 0) + { + ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_caster, spell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); + spellhandler.StartSpell(target); + } } } }