Here is a module start script that I use. It does several things.
1) sets the maximum number of henchmen to 4.
2) levels up the pc to level 4 if they aren't that high already.
3) raises their gold level to 5600 gold if they don't have that much gold.
4) Sets a couple of dynamic conversation strings that I use. These can be used in a conversation and changed periodically so that the NPCs say different things when you talk to them multiple times.
5) Sets a resurrect flag to a particular waypoint so the PC respawns there. It can get set somewhere else later if you want to change where the PC will respawn. This requires some additional code in the OnDeath script that isn't shown here.
void main()
{
SetMaxHenchmen(4);
object pc = GetFirstPC();
int xp = GetXP( pc );
int newxp = 0;
if( xp < 6250 )
{
newxp = 6250;
SetXP( pc, newxp );
}
int gold = GetGold( pc );
if( gold < 5600 )
{
int newgold = 5600 - gold;
GiveGoldToCreature( pc, newgold );
}
string s ="Is there anything I can do to help?";
SetCustomToken( 2, s );
s = "I haven't got time for idle conversation?";
SetCustomToken( 3, s );
int resset = GetLocalInt( pc, "resurrect");
if( resset == 0 )
{
SetLocalInt( pc, "resurrect", 1 );
}
}
Modifié par Mudeye, 09 octobre 2010 - 05:42 .