See also Special Abilities Scripts
There is a list of 'Special Abilities' associated with each:
A special ability is no more than a name and a parameter. Both are arbitrary strings although you will cause yourself less grief if you avoid using special characters such as the equal-sign, comma, period, quotation-marks, and such. A special ability might be "Takes More Damage At Night" with parameter "10pm-4am". Special abilities are cheap in terms of CPU and memory. An item (or spell or whatever) can have as many special abilities as needed but cannot have two with the same name. Different items can have special abilities with the same name and different parameters. For example, an arrow might have the special ability "DULL" with parameter "4" and a dart might have the special ability "DULL" with the parameter "123".
In addition to the special ability names and parameters associated with each item, monster, etc. there is also a database of special abilitites. Each special ability in the database has a name (probably the same name as a special ability given to some object) and an arbitrarily long list of arbitrarily-named arbitrary strings. Each if the strings has a type of SCRIPT, CONSTANT, or INCLUDE. For example, the Special Ability "Dozed" might have a SCRIPT named "IsCombatReady". The script would probably declare the holder of the special ability "Dozed" as ineligible for combat. It might also have a script named "CanCastSpells" which would make the holder unable to cast spells while he is dozing. Use of these SCRIPTs, CONSTANTs, and INCLUDEs will be describe a bit more below.
Here is a real-world example. Let us use Special Abilities scripts to implement the Doze spell. When cast, the Doze spell should put its target to sleep for 3 rounds of combat.
We start by using the spell editor to create a Doze spell. When the spell is invoked, the runtime engine will use the name of each of the spell's Special abilities to examine the Special Abilities database in search of a script named InvokeSpellOnTarget. That script name is wired into the engine and cannot be changed. So we give the spell a special ability. We make up some name that seems to describe the ability. Let us call it "DozeSpell". We give the Special ability a parameter of 3, which we will use later to decide how long our target will sleep. We are done with the spell editor.
Now we use the Special Abilities editor to define what the Special Ability named "DozeSpell" will do. We add a script to "DozeSpell" named InvokeSpellOnTarget. The script will add a special ability to the Target!!!!. Actually it is more like a 'disability' but we call it a special ability. This 'disability' will prevent the target from participating in the combat. Let us think of a name that might make sense. Let us call it "Sleeping". We copy the parameter from ourselves ("DozeSpell") into the Special ability "Sleeping" which we give to the target of the spell. Now the target has the Special ability "Sleeping" with parameter 3. So now we need to define what the special ability "Sleeping" does.
We use the Special Abilities editor to define what the Special Ability "Sleeping" does. We add several scripts:
So here is what happens when we cast Doze on an Orc:
Back to Dungeon Craft Help