mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
include library.utils;
|
|
include library.skill;
|
|
|
|
const string skill_table = "datatables/npc_customization/skill_table.iff";
|
|
|
|
trigger OnAttach()
|
|
{
|
|
obj_id pants = createObject ("object/tangible/wearables/pants/pants_s01.iff", self, "");
|
|
obj_id boots = createObject ("object/tangible/wearables/boots/boots_s03.iff", self, "");
|
|
obj_id shirt = createObject ("object/tangible/wearables/shirt/shirt_s15.iff", self, "");
|
|
|
|
string tbl_trainer_skills = "datatables/npc_customization/skill_table.iff";
|
|
resizeable string[] allSkills = new string[0];
|
|
|
|
int numCols = dataTableGetNumColumns(tbl_trainer_skills);
|
|
if ( numCols < 1 )
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
for ( int i = 0; i < numCols; i++ )
|
|
{
|
|
string[] colData = dataTableGetStringColumnNoDefaults(tbl_trainer_skills, i);
|
|
if ( colData != null && colData.length > 0 )
|
|
allSkills = utils.concatArrays(allSkills, colData);
|
|
}
|
|
|
|
if ( allSkills != null && allSkills.length > 0 )
|
|
utils.setBatchScriptVar(self, skill.SCRIPTVAR_SKILLS, allSkills);
|
|
|
|
attachScript (self, "npc.skillteacher.skillteacher");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|