I've got a uni project where we have to do a mod for this game, due in tomorrow and yeah I absolutely suck with all this scripting business. I wanted to create a custom class but gave up on that, now I've just been struggling to get my main character loaded the way I want.. For the record, tried my hand at making a custom spell too, and that just made me sad.
Basically, I want to be able to pick and choose what spells I give him.. I've made him a blood mage because I want access to those spells, but when I run my script it automatically loads him with every other spell under the sun.. I've tried to make use of the removeability() function, but to no avail.
I'll copy my script here and hey, if anyone can point me in the right direction, it would be greatly appreciated, if not then, hmmm, such is life I suppose.. Anyway, whoever you are that was kind enough to at least read and get to this sentence, thank you for your time, and all the best in life. Peace.
**************************************************
#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_h"
#include "sys_rewards_h"
const int FORCE_AUTOLEVEL = 2;
void main()
{
// keep track of whether the event has been handled
int nEventHandled = FALSE;
event ev = GetCurrentEvent();
switch(GetEventType(ev))
{
case EVENT_TYPE_MODULE_START:
{
object oHero = GetHero();
// skip character generation
Chargen_InitializeCharacter(oHero);
Chargen_SelectGender(oHero, GENDER_MALE);
Chargen_SelectRace(oHero, RACE_HUMAN);
Chargen_SelectCoreclass(oHero, class_BLOOD_MAGE);
Chargen_SelectBackground(oHero, BACKGROUND_NOBLE);
// give the player some equipment
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_cht_lgt_rlr.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_bot_lgt_rlr.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_glv_lgt_rlr.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_shd_sml_wdn.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_wep_mel_lsw_lsw.uti"));
//give him blood magic
//AddAbility(oHero, 10700, FALSE);
// level the bastard up.
RewardXP(oHero, RW_GetXPNeededForLevel(12), FALSE, FALSE);
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);
RemoveAbility(oHero, 13001); // Winter's Grasp
RemoveAbility(oHero, 11001); // Glyph of paralysis
break;
}
}
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
Modifié par norrinorri, 29 mai 2011 - 06:45 .





Retour en haut






