I need a little help rewriting this script so that it gives the XP reward to the entire party and not just the player.
Help would be appreciated.
Need help rewriting this script: 10% XP given to party.
Débuté par
MokahTGS
, mars 24 2012 06:05
#1
Posté 24 mars 2012 - 06:05
#2
Posté 24 mars 2012 - 06:20
hey MTGS,
you probly want to use
( otherwise only mainPC's are included )
you probly want to use
GetFirstFactionMember(oPC, FALSE)&
GetNextFactionMember(oPC, FALSE)
( otherwise only mainPC's are included )
#3
Posté 24 mars 2012 - 06:21
//added some debug code, see if you are cycling through things correctly.
void main()
{
object oPC = GetFirstPC(TRUE);
object oMember = GetFirstFactionMember(oPC);
SendMessageToPC(oPC, "Debug: first faction member is " + GetTag(oMember));
while(GetIsObjectValid(oMember))
{
int nLevel = GetTotalLevels(oMember, FALSE);
SendMessageToPC(oPC, "Debug: nLevel =" + IntToString(nLevel ));
int nXP = (nLevel * 1000)/10;
SendMessageToPC(oPC, "Debug: Granting xp: " + IntToString(nXP));
GiveXPToCreature(oMember, nXP);
SendMessageToPC(oPC, "Debug: Grantied xp: " );
oMember = GetNextFactionMember(oPC);
SendMessageToPC(oPC, "Debug: next faction member is " + GetTag(oMember));
}
}
void main()
{
object oPC = GetFirstPC(TRUE);
object oMember = GetFirstFactionMember(oPC);
SendMessageToPC(oPC, "Debug: first faction member is " + GetTag(oMember));
while(GetIsObjectValid(oMember))
{
int nLevel = GetTotalLevels(oMember, FALSE);
SendMessageToPC(oPC, "Debug: nLevel =" + IntToString(nLevel ));
int nXP = (nLevel * 1000)/10;
SendMessageToPC(oPC, "Debug: Granting xp: " + IntToString(nXP));
GiveXPToCreature(oMember, nXP);
SendMessageToPC(oPC, "Debug: Grantied xp: " );
oMember = GetNextFactionMember(oPC);
SendMessageToPC(oPC, "Debug: next faction member is " + GetTag(oMember));
}
}
#4
Posté 24 mars 2012 - 06:33
Thanks guys...will test this in a bit.
The idea here is that as the player progresses, they get 10% of the experience needed toward leveling for each stage of the quest line.
The idea here is that as the player progresses, they get 10% of the experience needed toward leveling for each stage of the quest line.
#5
Posté 24 mars 2012 - 07:49
Hmm, debug code would be a good way to help beginners learn to script beyond the basics. Some common problems, debug code, toy problems, etc.





Retour en haut







