// give the player some equipment
object oItem = UT_AddItemToInventory(R"gen_im_arm_cht_lgt_rlr.uti");
EquipItem(oHero,oItem);
oItem = UT_AddItemToInventory(R"gen_im_arm_bot_lgt_rlr.uti");
EquipItem(oHero,oItem);
oItem = UT_AddItemToInventory(R"gen_im_arm_glv_lgt_rlr.uti");
EquipItem(oHero,oItem);
oItem = UT_AddItemToInventory(R"gen_im_arm_shd_sml_wdn.uti");
EquipItem(oHero,oItem);
oItem = UT_AddItemToInventory(R"gen_im_wep_mel_lsw_lsw.uti");
EquipItem(oHero,oItem);
break;
}
另一种方法是创建一个生物范本([b]Template),然后呼叫(LoadItemsFromTemplate) 函式将它复制到玩者人物. [/b]
编码: :
case EVENT_TYPE_MODULE_START:
{
// skip character generation
object oHero = GetHero();
Chargen_InitializeCharacter(oHero);
Chargen_SelectRace(oHero,RACE_HUMAN);
Chargen_SelectCoreClass(oHero,CLASS_WARRIOR);
Chargen_SelectBackground(oHero,BACKGROUND_NOBLE);
LoadItemsFromTemplate(oHero, "gcd_hero.utc", TRUE);
break;
}
若要快速升级, 你可以加入以下的脚本到上面的任何范例内:
编码: :
...
#include "sys_rewards_h"
const int FORCE_AUTOLEVEL = 2;
...
case EVENT_TYPE_MODULE_START:
{
object oHero = GetHero();
...
// Make character level 10
int nTargetLevel = 10;
RewardXP(oHero, RW_GetXPNeededForLevel(nTargetLevel), FALSE, FALSE);
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);
...
}
一个更复杂的脚本可能包括其他设定程式码,例如触发介绍或是电影通知玩家在游戏的剧情.