-------
Revised Subraces Script
-------
Ok I revised the subraces script so it does not go away after you rest,
turned the actual editing command into a function so it is easier to handle
in other scripts you may wish to use it in, and provided an example script
on attaching it to conversations, doors, and triggers along with the
possibility of setting it up to automatically teleport the character to
either a general starting point OR a starting point dependent on the subrace
(can be changed to race by changing one little line). Here is what you need
to do.
1. Set up a Start Room and put your start point there. It can be as big or
small as you like as long as it will fit a PC and an NPC, Trigger, or door.
2. Under View, Area Properties make sure it is set to NO REST otherwise it
will cause a problem if the PC's rest before updating themselves.
3. Create the base function script which is included in the other 2 scripts
necessary for this. I suggest you save the script as "gs_subrace" as that is
what I saved mine as and will remove the need to edit the #include
statements. There is a template at the end of the script for you to use in
adding your own races. The base "gs_subrace" script is as follows:
NWScript:
object oTarget;
string sSubrace;
int race;
int str;
int dex;
int con;
int intel;
int wis;
int cha;
int empathy;
int conc;
int dtrap;
int disc;
int heal;
int hide;
int list;
int lore;
int silent;
int open;
int parry;
int perf;
int pers;
int pick;
int search;
int strap;
int spell;
int spot;
int taunt;
int magic;
void raisestr()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityIncrease(ABILITY_STRENGTH,str),oTarget);
}
void raisedex()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityIncrease(ABILITY_DEXTERITY,dex),oTarget);
}
void raisecon()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityIncrease(ABILITY_CONSTITUTION,con),oTarget);
}
void raiseint()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityIncrease(ABILITY_INTELLIGENCE,intel),oTarget);
}
void raisewis()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityIncrease(ABILITY_WISDOM,wis),oTarget);
}
void raisecha()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityIncrease(ABILITY_CHARISMA,cha),oTarget);
}
void lowerstr()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_STRENGTH,str),oTarget);
}
void lowerdex()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_DEXTERITY,dex),oTarget);
}
void lowercon()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_CONSTITUTION,con),oTarget);
}
void lowerint()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_INTELLIGENCE,intel),oTarget);
}
void lowerwis()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_WISDOM,wis),oTarget);
}
void lowercha()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_CHARISMA,cha),oTarget);
}
void raiseempathy()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_ANIMAL_EMPATHY,empathy),oTarget);
}
void raiseconc()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_CONCENTRATION,conc),oTarget);
}
void raisedtrap()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_DISABLE_TRAP,dtrap),oTarget);
}
void raisedisc()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_DISCIPLINE,disc),oTarget);
}
void raiseheal()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_HEAL,heal),oTarget);
}
void raisehide()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_HIDE,hide),oTarget);
}
void raiselist()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_LISTEN,list),oTarget);
}
void raiselore()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_LORE,lore),oTarget);
}
void raisesilent()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_MOVE_SILENTLY,silent),oTarget);
}
void raiseopen()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_OPEN_LOCK,open),oTarget);
}
void raiseparry()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_PARRY,parry),oTarget);
}
void raiseperf()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_PERFORM,perf),oTarget);
}
void raisepers()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_PERSUADE,pers),oTarget);
}
void raisepick()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_PICK_POCKET,pick),oTarget);
}
void raisesearch()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_SEARCH,search),oTarget);
}
void raisestrap()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_SET_TRAP,strap),oTarget);
}
void raisespell()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_SPELLCRAFT,spell),oTarget);
}
void raisespot()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_SPOT,spot),oTarget);
}
void raisetaunt()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_TAUNT,taunt),oTarget);
}
void raisemagic()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillIncrease(SKILL_USE_MAGIC_DEVICE,magic),oTarget);
}
void lowerempathy()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_ANIMAL_EMPATHY,empathy),oTarget);
}
void lowerconc()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_CONCENTRATION,conc),oTarget);
}
void lowertrap()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_DISABLE_TRAP,dtrap),oTarget);
}
void lowerdisc()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_DISCIPLINE,disc),oTarget);
}
void lowerheal()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_HEAL,heal),oTarget);
}
void lowerhide()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_HIDE,hide),oTarget);
}
void lowerlist()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_LISTEN,list),oTarget);
}
void lowerlore()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_LORE,lore),oTarget);
}
void lowersilent()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_MOVE_SILENTLY,silent),oTarget);
}
void loweropen()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_OPEN_LOCK,open),oTarget);
}
void lowerparry()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_PARRY,parry),oTarget);
}
void lowerperf()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_PERFORM,perf),oTarget);
}
void lowerpers()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_PERSUADE,pers),oTarget);
}
void lowerpick()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_PICK_POCKET,pick),oTarget);
}
void lowersearch()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_SEARCH,search),oTarget);
}
void lowerstrap()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_SET_TRAP,strap),oTarget);
}
void lowerspell()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_SPELLCRAFT,spell),oTarget);
}
void lowerspot()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_SPOT,spot),oTarget);
}
void lowertaunt()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_TAUNT,taunt),oTarget);
}
void lowermagic()
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectSkillDecrease(SKILL_USE_MAGIC_DEVICE,magic),oTarget);
}
int subrace()
{
sSubrace = GetSubRace(oTarget);
race = GetRacialType(oTarget);
if (race == RACIAL_TYPE_ELF)
{
if (sSubrace == "Wood Elf")
{
str = 1;
dex = 0;
con = 2;
intel = 1;
wis = 0;
cha = 3;
empathy = 0;
conc = 0;
dtrap = 0;
disc = 0;
heal = 0;
hide = 0;
list = 0;
lore = 0;
silent = 0;
open = 0;
parry = 0;
perf = 0;
pers = 0;
pick = 0;
search = 0;
strap = 0;
spell = 0;
spot = 0;
taunt = 0;
magic = 0;
raisestr();
raisecon();
lowerint();
lowercha();
return 1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
{/nwscript]
4. Add this into your module's OnRest script (accessed via View, Module Properties).
#include "gs_subrace"
void main()
{
oTarget = GetLastPCRested();
subrace();
}
4. In your module's OnRest script (access via View, Module Properties) add
this:
NWScript: #include "gs_subrace"
void main()
{
oTarget = GetLastPCRested();
subrace();
}
5. Finally in your starting area add an NPC, Door, or Trigger. For NPC's
attach this script to their conversation. For doors attach it to their
OnOpen, and for triggers attach it to OnEnter. Make sure to set up your
waypoints for where you want the player to be moved to, and edit the script
to change the waypoint tag in it from mine to yours if different. For
teleporting based on subrace make sure to add enough if-then-else
statements. Also DO NOT set up the door or trigger's area transition, the
script does it for you. Oh yeah and unremark the lines you wish to use.
NWScript: #include "gs_subrace"
void main()
{
}
That should get you going with sub-races. I could go on and add in the WotC
rules for how to balance the sub-races and all that good stuff; however, I
really don't feel like typing it all up and violating copyright. I suggest
you go out and buy the Dungeon Master's Guide, or just playtest alot, your
call.
As always if you have any questions send them my way.
-J
|