Files
dsrc/sku.0/sys.server/compiled/game/script/working/cmayer/troopertest.script
T

117 lines
3.8 KiB
Plaintext

/* --------------------------------------------------*/
obj_id makeStormtrooper (obj_id player, location here)
{
string gender = "male";
string species = "object/creature/player/human_";
string name = "stormtrooper";
species = species + gender + ".iff";
obj_id npc = createObject (species, here);
obj_id clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_boots.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make boots ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bicep_l.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bicep_l.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 1 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bicep_r.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bicep_r.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 2 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_l.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_l.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 3 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_r.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_r.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 4 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_chest_plate.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_chest_plate.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 5 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_gloves.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_gloves.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 6 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_helmet.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_helmet.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 7 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_leggings.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_leggings.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 8 ");
}
//object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_utility_belt.iff
clothes1 = createObject("object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_utility_belt.iff", npc, "");
if ( clothes1 == null )
{
debugConsoleMsg ( player, "I wasn't able to make 9 ");
}
if ( false )
{
string clothes_table = "datatables/npc_customization/stormtrooper_clothes.iff";
int columns = dataTableGetNumColumns (clothes_table);
int intX = 1;
while ( intX <= columns )
{
debugConsoleMsg (player, "This is some clothes");
int clothesRows = dataTableGetNumRows (clothes_table);
int randrow = rand(1, clothesRows );
string clothes = dataTableGetString (clothes_table, randrow, intX-1);
debugConsoleMsg(player, "Creating " + clothes);
obj_id newClothes = createObject (clothes, npc, "");
if (newClothes == null)
{
debugConsoleMsg ( player, "I wasn't able to make " + clothes);
}
intX = intX + 1;
}
}
return npc;
}
trigger OnSpeaking(string text)
{
if ( text == "test" )
{
location l = getLocation(self);
obj_id test = makeStormtrooper(self, l);
}
return SCRIPT_CONTINUE;
}