Actually there is no need to use any nwnx plugins. (hmm... Are they called plugins?)
Also int's are rounded down into full numbers so that script might miss the round start by up to 0.999... seconds.
Here is a few scripts straight from my module.
Put this in an include script
Modify iH if you modified the minutes per hour in your module
// Returns current server time in seconds
int Time();
int Time()
{
int iTime;
int iH = 2; // Amount of minutes per hour
iTime += GetTimeSecond();
iTime += GetTimeMinute()*60;
iTime += GetTimeHour()*iH*60;
iTime += GetCalendarDay()*24*iH*60;
iTime += GetCalendarMonth()*28*24*iH*60;
iTime += GetCalendarYear()*12*28*24*iH*60;
iTime -= GetLocalInt(GetModule(), "zero");
return iTime;
}
Put this in your OnModuleLoad script
SetLocalInt(GetModule(), "zero", Time());
And after a while of looking through a ridiculous pile of useless scripts I found something that you can easily modify to do what you want. This DOESN'T do what you want as it is, but I did modify it a little for your convenience.
'>
#include ""
void main()
{
object oUser = OBJECT_SELF; // The one who used the feat.
// Make sure not to cast it twice in one round
effect eEff = GetFirstEffect(oUser);
while (GetIsEffectValid(eEff)) // This doesn't actually work, too tired to fix it
{ //
if (GetEffectType(eEff) == EFFECT_TYPE_TIMESTOP) {return;}
eEff = GetNextEffect(oUser);
}
int iTime = Time();
int iRound = (iTime/6); // Basically equals to the second
iRound = (iTime*6)+6; // next server round begins, since int's
// are always rounded down... It should work!
float fTime = IntToFloat(iTime) + (GetTimeMillisecond()/1000.0); // Must be accurate
float fRound = IntToFloat(iRound);
float fN = fRound - fTime; // Time in seconds until next server round begins
if (fN != 0.000)
{DelayCommand(fN, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTimeStop(), oUser, fN));}
else
{ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTimeStop(), oUser, fN);}
//
//
}
Its ready for use, just add it into one of the DM/Player tool feat scripts and it should work... Its not tested though.
What it does (or should do) is pause the game for one round, starting exactly at the beginning of the next round.
Modifié par Xardex, 31 mai 2011 - 04:58 .