I need a line of code that checks any new PCs entering a mod to see if they are high enough level. If they are not then they are given the amount of experience needed to meet the base level. For the sample script lets make it level 3.
If PC Level < 3 then
Award PC XP = 3000-PC's Current XP
Level Check on Load
Débuté par
Dragonfolk2000
, oct. 09 2010 05:23
#1
Posté 09 octobre 2010 - 05:23
#2
Posté 09 octobre 2010 - 05:41
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 );
}
}
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 .
#3
Posté 09 octobre 2010 - 09:27
I think I figure out how to omit the stuff I don't want. Thanks.





Retour en haut






