Example:
cockatrice
1) find the ability - Opening the creature (located in the standard palette under Magical Beasts) with Edit Copy in the toolset, I looked at its Special Abilities Tab to see that it had Touch, Petrification. If I simply wanted to add more abilities, I could easily do it in this tab, or in the Spells tab, if I wanted to make Merlin the Spellcasting cockatrice.
2) find the ability in spells.2da - using NWN Explorer (link:
http://nwvault.ign.c...Detail&id=1369 ), I look in NWN: HotU Main Data, the Game Data folder, for spells.2da. I export it by right clicking on the display section to the right and choosing Export Text. I open the spells.2da.txt file with a standard text editor like Notepad, and search for 'petr'. That search shows me Touch_Petrify on line 496. Should I want further verification, I could pull up the tlk table strref, shown in the next column to the right as 3801, using the TalkTableViewer in my nwn install C:\\\\NeverwinterNights\\\\NWN\\\\utils folder.Entering 3801 in the TalkTableViewer, it shows Touch, Petrification, matching the string displayed in the monsters Special Abilities exactly.
3) find the spell script - still looking in the 2da, I check the ImpactScript column, which is 8 columns to the right of the Label column (the label Touch_Petrify was what my search turned up). It shows the script as x0_s1_petrtouch. I open the toolset's script editor, then click to Open an existing file (folder icon on the top). I paste in the name and select the option to show All Resources on the left side of the Select Resource window that pops up. I see the script, so I open it, revealing the following script:
//::///////////////////////////////////////////////////
//:: X0_S1_PETRGAZE
//:: Petrification touch attack monster ability.
//:: Fortitude save (DC 15) or be turned to stone permanently.
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 11/14/2002
//::///////////////////////////////////////////////////
#include "x0_i0_spells"
void main()
{
object oTarget = GetSpellTargetObject();
int nHitDice = GetHitDice(oTarget);
DoPetrification(nHitDice, OBJECT_SELF, oTarget, GetSpellId(), 15);
}
4) Edit the spell script. We need to modify the script so that it retains its normal behavior except when we want it to do something different. To do this, we'll need to identify the creature we want to change the behavior for in some way. We could set a petrification dc variable on it in the toolset and use the number stored in it, or we can simply set the number in script, checking for some other thing unique to the creature. A simple way to do this is to add a check for its tag. Looking in the toolset, the cockatrice's tag is X0_cockatrice - I'll use that for this example.
//::///////////////////////////////////////////////////
//:: X0_S1_PETRGAZE
//:: Petrification touch attack monster ability.
//:: Fortitude save (DC 15) or be turned to stone permanently.
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 11/14/2002
//::///////////////////////////////////////////////////
#include "x0_i0_spells"
void main()
{
object oTarget = GetSpellTargetObject();
int nHitDice = GetHitDice(oTarget);
int nDC = 15;//We'll store the original DC here, and change the DoPetrification line to use nDC instead of 15
if (GetTag(OBJECT_SELF) == "X0_cockatrice")
nDC = 12;//Now we override it for all creatures with the tag X0_cockatrice
DoPetrification(nHitDice, OBJECT_SELF, oTarget, GetSpellId(), nDC);
}
LMK if you have any questions.
Funky
Modifié par FunkySwerve, 25 octobre 2010 - 07:15 .