<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://datoolset.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ashmaran</id>
		<title>Dragon Age Toolset Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://datoolset.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ashmaran"/>
		<link rel="alternate" type="text/html" href="https://datoolset.net/wiki/Special:Contributions/Ashmaran"/>
		<updated>2026-06-19T14:02:07Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Tutorials&amp;diff=8753</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Tutorials&amp;diff=8753"/>
				<updated>2009-12-13T08:35:10Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Custom content tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introductory tutorials ==&lt;br /&gt;
&lt;br /&gt;
In the course of these tutorials we'll go through all the steps needed to create a basic adventure.&lt;br /&gt;
&lt;br /&gt;
{{sidebox|&lt;br /&gt;
*Boxes like this contain a checklist of important steps.&lt;br /&gt;
*They're intended as a reminder and as a navigational aid.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
*[[Introductory tutorial]] - An overview of the toolset as a whole&lt;br /&gt;
*[[Module tutorial]] - how to create a module to work in.&lt;br /&gt;
&lt;br /&gt;
This set of tutorials forms a series, each building on or filling in omissions by the last:&lt;br /&gt;
*[[Area tutorial]]&lt;br /&gt;
*[[Placeable tutorial]]&lt;br /&gt;
*[[Item tutorial]]&lt;br /&gt;
*[[Creature tutorial]]&lt;br /&gt;
*[[Conversation tutorial]]&lt;br /&gt;
&lt;br /&gt;
Once you've become familiar with the basics introduced on those tutorials you might have a better grounding for:&lt;br /&gt;
*[[Cutscene tutorial]]&lt;br /&gt;
*[[Map tutorial]] (which also introduces you to [[2DA]] editing)&lt;br /&gt;
*[[Level Editor Tutorial]]&lt;br /&gt;
*[[Scripting tutorial]]&lt;br /&gt;
&lt;br /&gt;
== Demo module ==&lt;br /&gt;
&lt;br /&gt;
The toolset currently ships with a simple demo module pre-loaded into its database.&lt;br /&gt;
&lt;br /&gt;
*[[Demo module]] - how to export and run the demo module.&lt;br /&gt;
&lt;br /&gt;
== Custom content tutorials == &lt;br /&gt;
*[[Tutorial: Adding a Custom Model to Toolset]]&lt;br /&gt;
*[[Tutorial: Creating a custom placeable from a model]]&lt;br /&gt;
*[[Tutorial: Reskinning an Item]]&lt;br /&gt;
*[[Adding a New Spell Tutorial]]&lt;br /&gt;
&lt;br /&gt;
== Character generation tutorials ==&lt;br /&gt;
*[[Backgrounds tutorial]]&lt;br /&gt;
*[[Add A New Class Tutorial]]&lt;br /&gt;
&lt;br /&gt;
== Other Tutorials ==&lt;br /&gt;
*[[Adding a Location to the Single Player Campaign Tutorial]]&lt;br /&gt;
&lt;br /&gt;
== External Tutorials ==&lt;br /&gt;
*[http://dragonagemodding.wordpress.com Beyond Ferelden] has many in-depth tutorials by jwvanderbeck.&lt;br /&gt;
*[http://www.youtube.com/watch?v=TwQNRBFLhrE Playable Area and Conversation] video tutorial by [http://social.bioware.com/64020/ st4rdog].&lt;br /&gt;
*[http://www.youtube.com/watch?v=CaHldJcUTz8 Simple Conversation Cameras] video tutorial by [http://social.bioware.com/64020/ st4rdog].&lt;br /&gt;
*[http://www.youtube.com/watch?v=QOQJ2heQto4 Cutscene and Trigger] video tutorial by [http://social.bioware.com/64020/ st4rdog].&lt;br /&gt;
*[http://www.youtube.com/watch?v=szWKgj2ZuXo Custom Level and Room Building] video tutorial by [http://social.bioware.com/64020/ st4rdog].&lt;br /&gt;
*[http://www.youtube.com/watch?v=DKJ7F14n8o8 Downloading and Installing the Toolset] video tutorial by [http://social.bioware.com/74287/ DragonAge22].&lt;br /&gt;
*[http://www.youtube.com/watch?v=iMPBsulv9xI Creating a Room] video tutorial by [http://social.bioware.com/74287/ DragonAge22].&lt;br /&gt;
*[http://www.youtube.com/watch?v=g3kx2CaarHo How to Make an Interior Level with Lighting] video tutorial by [http://social.bioware.com/group/60/ Darkworld Development Team].&lt;br /&gt;
*[http://www.youtube.com/watch?v=O6TeZeE1Lc8 Making a Room] video tutorial by BigDrip681.&lt;br /&gt;
*[http://social.bioware.com/5339/blog/576/ Custom Player Items In Single Player] by [http://social.bioware.com/5339/ weriK].&lt;br /&gt;
*[http://social.bioware.com/5339/blog/651/ The Secret Behind Item Statistics] by [http://social.bioware.com/5339/ weriK].&lt;br /&gt;
*[http://social.bioware.com/project/923/ Guide for installing/uninstalling/updating Mods] Beginner Guide to get started with using Mods by [http://social.bioware.com/237411/ Alexspeed].&lt;br /&gt;
*[http://www.jezelf.co.uk/tutorials.htm Photoshop Map making tutorials] Credits to Jason Elford, brought to DAT wiki by [http://social.bioware.com/48156/ Arixsus]&lt;br /&gt;
*[http://social.bioware.com/project/527/ Video Tutorials by SilentCid] Multiple in-depth video tutorials of the DA Toolset&lt;br /&gt;
*[http://www.youtube.com/view_play_list?p=EF29DD1AACEBA92A Qkrch's Video Tutorials] Toolset tutorial complete series for the experienced builder (Spanish &amp;amp; English)&lt;br /&gt;
[[Category:Tutorials| ]]&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8752</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8752"/>
				<updated>2009-12-13T08:31:45Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Creating a new Spell Type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying refer to the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it to a few file and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell.&lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8751</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8751"/>
				<updated>2009-12-13T08:30:01Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Creating a custom spell script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying check out the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it to a few file and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell.&lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8750</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8750"/>
				<updated>2009-12-13T08:27:17Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Creating a custom spell script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying check out the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell.&lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8749</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8749"/>
				<updated>2009-12-13T08:26:54Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Creating a custom spell script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying check out the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell.&lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8748</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8748"/>
				<updated>2009-12-13T08:22:31Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Updating your ability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying check out the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell.&lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8747</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8747"/>
				<updated>2009-12-13T08:22:11Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: /* Updating your ability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying check out the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell.&lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8746</id>
		<title>Adding a new spell tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Adding_a_new_spell_tutorial&amp;diff=8746"/>
				<updated>2009-12-13T08:21:22Z</updated>
		
		<summary type="html">&lt;p&gt;Ashmaran: Created page with 'This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on c...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial steps you through making a new spell called Full Heal. This will be a simple copy of the heal spell with a modification to the amount healed. The focus here is on creating a new spell, but the basic steps are the same for talents and other abilities. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The process of adding a spell to the game is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Create a new module that extends the single player game&lt;br /&gt;
*Create a new guitype that your spell exists under&lt;br /&gt;
*Create a new ability entry for your spell&lt;br /&gt;
*Create a custom script to handle your spell&lt;br /&gt;
*Create strings to describe your spell in the talent page and tool tips&lt;br /&gt;
*Testing it in the game&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before beginning ensure you read the article on editing [[2DA]] files and how to convert them to GDA files for use in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating your module ==&lt;br /&gt;
&lt;br /&gt;
These are just some basic settings required so that your module extends the Single Player campaign. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Load the toolset and select '''File''' &amp;gt; '''Manage Modules'''&lt;br /&gt;
# Click on '''New''' and fill in the following fields:&lt;br /&gt;
## '''Name''': Full Heal&lt;br /&gt;
## '''Script''': (none) (Click on the ... button and select (none))&lt;br /&gt;
## '''UID''': full_heal&lt;br /&gt;
## '''Extended Module''': Single Player&lt;br /&gt;
# Click '''Open''' to load your new module (it should be selected by default)&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Generate Module XML'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You now have a new module that will be loaded whenever you play the Single Player campaign.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new Spell Type == &lt;br /&gt;
&lt;br /&gt;
This step is not strictly necessary to get a new spell into the game, but is recommended. By doing this, your new spell will have its own category on the talents page. This is also how you can restrict which classes have access to the spell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more information on the columns we are modifying check out the article on [[Guitypes.xls]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up your 2DA folder, it should be at \Dragon Age\tools\Source\2DA &lt;br /&gt;
# Copy the file '''guitypes.xls''' to a new folder, for example C:\2DA&lt;br /&gt;
# Open the file and delete all the rows except the headings&lt;br /&gt;
# Create a new row with the following details:&lt;br /&gt;
## '''ID''': 777&lt;br /&gt;
## '''Label''': Divine Healer&lt;br /&gt;
## '''StringID''': **** (we will replace this later with the proper string ID)&lt;br /&gt;
## '''TintColor''': 0x888888 (I think this only matters if you are using the progress bar)&lt;br /&gt;
## '''BlendTree''': ****&lt;br /&gt;
## Any remaining columns in between set to 0&lt;br /&gt;
# Save and close the file. &lt;br /&gt;
# Convert it to a '''GDA''' file. &lt;br /&gt;
# Copy the GDA to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''guitypes_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new ability entry == &lt;br /&gt;
&lt;br /&gt;
This is where you can specify the properties of your new spell. However for this example I'm just keeping it simple. I recommend reading this page to see what can be done: [[ABI_base.xls]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open up the rules folder in your 2DA folder, it should be at \Dragon Age\tools\Source\2DA\rules&lt;br /&gt;
# Copy '''ABI_Base.xls''' to your 2DA folder&lt;br /&gt;
# Open the file and find the entry for '''HEAL'''&lt;br /&gt;
# Copy the whole row to the bottom of the file&lt;br /&gt;
# Delete the rest of the rows except for the headings&lt;br /&gt;
# Cut your row and paste it as the first row&lt;br /&gt;
# Make the following changes to your HEAL row&lt;br /&gt;
##''' ID''': 777777&lt;br /&gt;
## '''label''': FULL HEAL&lt;br /&gt;
## '''guitype''': 777&lt;br /&gt;
# Save and close the file&lt;br /&gt;
# Convert it to a '''GDA''' file&lt;br /&gt;
# Copy the '''ABI_Base.GDA''' file to your module override folder (My Documents\Bioware\Dragon Age\AddIns\full_heal\module\override)&lt;br /&gt;
# Rename the file '''ABI_Base_fh.GDA'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Preliminary Testing ==&lt;br /&gt;
&lt;br /&gt;
At this stage we want to ensure that the above steps worked, and that the new spell appears in-game. Simply run the game and check the talents page for a mage character. Your spell should appear in its own category down the bottom. If it doesn't try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Check that the guitype for your ability in the ABI_base 2DA is the same as the id you set for your guitype in the guitypes 2DA&lt;br /&gt;
* Check that your GDA files are copied to the correct override folder&lt;br /&gt;
* Generate your module XML file again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a custom spell script ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is generally open the script that the spell you are copying references, copy it and modify the contents to suit your purposes. Spell scripting is a little beyond the scope of this tutorial so I've prepared a simple script already. What it does is calculate the maximum health of the target of the spell and then heal them for that amount. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Select '''File''' &amp;gt; '''New''' &amp;gt; '''Script'''&lt;br /&gt;
# Set the following properties&lt;br /&gt;
## '''Resource Name''': full_heal&lt;br /&gt;
## '''Folder''': \&lt;br /&gt;
# Click '''OK''' to create the script &lt;br /&gt;
# Copy the contents of the script below into the script and click '''Save'''&lt;br /&gt;
&lt;br /&gt;
The script should compile correctly if you check the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
// full_heal.nss&lt;br /&gt;
// -----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;abi_templates&amp;quot;&lt;br /&gt;
#include &amp;quot;sys_traps_h&amp;quot;&lt;br /&gt;
#include &amp;quot;spell_constants_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
const int FULL_HEAL = 777777;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void _HandleImpact(struct EventSpellScriptImpactStruct stEvent)&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    effect eEffect;&lt;br /&gt;
   &lt;br /&gt;
    //int bHostile = FALSE;&lt;br /&gt;
&lt;br /&gt;
    // make sure there is a location, just in case&lt;br /&gt;
    if (IsObjectValid(stEvent.oTarget) == TRUE)&lt;br /&gt;
    {&lt;br /&gt;
        stEvent.lTarget = GetLocation(stEvent.oTarget);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Handle Spells&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    switch (stEvent.nAbility)&lt;br /&gt;
    {       &lt;br /&gt;
&lt;br /&gt;
        case FULL_HEAL:&lt;br /&gt;
        {&lt;br /&gt;
            float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);&lt;br /&gt;
            eEffect = EffectHeal(fHeal);&lt;br /&gt;
            eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));&lt;br /&gt;
            ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
   // if(bHostile) // sending only for hostile spells&lt;br /&gt;
        //SendEventOnCastAt(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility, bHostile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    event ev = GetCurrentEvent();&lt;br /&gt;
    int nEventType = GetEventType(ev);&lt;br /&gt;
&lt;br /&gt;
    switch(nEventType)&lt;br /&gt;
    {&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_PENDING:&lt;br /&gt;
        {&lt;br /&gt;
            Ability_SetSpellscriptPendingEventResult(COMMAND_RESULT_SUCCESS);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_CAST:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptCastStruct stEvent = Events_GetEventSpellScriptCastParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            // Hand this through to cast_impact&lt;br /&gt;
            SetAbilityResult(stEvent.oCaster, stEvent.nResistanceCheckResult);&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_SPELLSCRIPT_IMPACT:&lt;br /&gt;
        {&lt;br /&gt;
            // Get a structure with the event parameters&lt;br /&gt;
            struct EventSpellScriptImpactStruct stEvent = Events_GetEventSpellScriptImpactParameters(ev);&lt;br /&gt;
&lt;br /&gt;
            Log_Trace(LOG_CHANNEL_COMBAT_ABILITY, GetCurrentScriptName() + &amp;quot;.EVENT_TYPE_SPELLSCRIPT_IMPACT&amp;quot;,Log_GetAbilityNameById(stEvent.nAbility));&lt;br /&gt;
&lt;br /&gt;
            // Handle impact&lt;br /&gt;
            if (CheckSpellResistance(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility) == FALSE)&lt;br /&gt;
            {&lt;br /&gt;
                _HandleImpact(stEvent);&lt;br /&gt;
            } else&lt;br /&gt;
            {&lt;br /&gt;
                UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_RESISTED);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating new Strings ==&lt;br /&gt;
&lt;br /&gt;
This step allows you to set your own description for the spell and have it appear correctly in tool tips. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Ensure your module is loaded in the toolset&lt;br /&gt;
# Select '''Tools''' &amp;gt; '''String Editor'''&lt;br /&gt;
# Right click in the empty space and select '''Insert''' &amp;gt; '''Insert String'''&lt;br /&gt;
# Set the '''Type''' to '''Spells'''&lt;br /&gt;
# Set the text to Divine Healer&lt;br /&gt;
# Click '''OK''' to save the string&lt;br /&gt;
# Make a note of the string ID generated and what it is for (in this case the Spell Type)&lt;br /&gt;
# Repeat the above steps for the following text (without the information in brackets):&lt;br /&gt;
&lt;br /&gt;
:: Full Heal (note it down as the spell name)&lt;br /&gt;
:: The mage channels divine energy to completely heal the target from all battle damage. (note it down as the description)&lt;br /&gt;
&lt;br /&gt;
The last string is for the tool tip, copy and paste the text below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name/&amp;gt; (&amp;lt;guitypename/&amp;gt;)&lt;br /&gt;
&amp;lt;usetype/&amp;gt;&lt;br /&gt;
Range: &amp;lt;range/&amp;gt;&lt;br /&gt;
Activation: &amp;lt;cost/&amp;gt;&lt;br /&gt;
Cooldown: &amp;lt;cooldown/&amp;gt;s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;requirements/&amp;gt;&lt;br /&gt;
&amp;lt;conditions/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;description/&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once these strings are all created select '''Tools''' &amp;gt; '''Export''' &amp;gt; '''Export Talk Table'''. This will compile your strings into a talk table which can be used with the game. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating your ability ==&lt;br /&gt;
&lt;br /&gt;
This step involves tweaking our new spell to use the strings we created as well as the custom script. We will also adjust the cost and cooldown to make it a bit more balanced. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the following steps I recommend using '''GDApp''' to modify your GDA files rather than editing the excel files and recreating them. It can be found on the [[3rd_party_extensions]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open your '''ABI_base_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''namestrref''' field to the string ID for your spell name&lt;br /&gt;
# Set the '''descstrref''' field to the string ID for your spell description&lt;br /&gt;
# Set the '''tooltipstrref''' field to the string ID for your spell tooltip&lt;br /&gt;
# Set the '''cost''' to 50&lt;br /&gt;
# Set the '''spellscript''' to full_heal.ncs&lt;br /&gt;
# Set the '''cooldown''' to 20&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
Next we modify the guitype:&lt;br /&gt;
&lt;br /&gt;
# Open your '''guitypes_fh.GDA''' file with '''GDApp'''&lt;br /&gt;
# Set the '''stringid''' field to the string ID for your Spell Type&lt;br /&gt;
# Save the file&lt;br /&gt;
&lt;br /&gt;
Now we have updated GDA files which reference our spell script and new strings. It should now function correctly in the game and look like any other spell. &lt;br /&gt;
&lt;br /&gt;
== Testing your new spell == &lt;br /&gt;
&lt;br /&gt;
Your new spell should be working and properly labeled in the game. You can select it when leveling up, or you can use a debug script to add your spell manually. &lt;br /&gt;
&lt;br /&gt;
With the developer console enabled, have your mage character selected and type the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;` runscript addtalent 777777&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
I will try and expand this section a bit later, but for now once you are confident with these steps, try the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the icon for the spell to make it stand out more. You can use one from another spell or make your own&lt;br /&gt;
* Change the different values in ABI_base to alter the spell further&lt;br /&gt;
* Create a new talent using the same procedure but copy and modify a talent instead of a spell&lt;br /&gt;
* Set the ability field of the guitypes.xls to ensure your new ability type is only available to certain classes. This is how the specialization classes limit their abilities.&lt;/div&gt;</summary>
		<author><name>Ashmaran</name></author>	</entry>

	</feed>