I think by you knocking out distance checks would probably increase performance quite a bit...
A Loop is a loop, so you really aren't going to increase performance substantially there, no matter which loop you decide on using...
The CR Check Thing would probably be the most important thing to pull off, so, in case you need it, here is a function you may want to use....
//////////////////////////////////////////////////////////////////////////
// GetLevelByXP(object oTarget)
// This Function will return the PC's Level based upon the XP
// I Made this incase someone wanted to find out how many levels
// the PC was based upon the XP..
//Added Functions for Higher Grounds Legendary Leveler..
int GetLevelByXP(object oTarget)
{
int i = 1; //No matter what return level 1!
int nXP = GetXP(oTarget);
int nCurrentXP = nXP;
if(nXP<=999) //They are IN FACT Level 1 (There is no Level 0!)
{ i = 1; }
else if(nXP >= 1000 && nXP <=2999) // level 2
{ i = 2; }
else if(nXP >= 3000 && nXP <=5999) // level 3
{ i = 3; }
else if(nXP >= 6000 && nXP <=9999) // level 4
{ i = 4; }
else if(nXP >= 10000 && nXP <=14999) // level 5
{ i = 5; }
else if(nXP >= 15000 && nXP <=20999) // level 6
{ i = 6; }
else if(nXP >= 21000 && nXP <=27999) // level 7
{ i = 7; }
else if(nXP >= 28000 && nXP <=35999) // level 8
{ i = 8; }
else if(nXP >= 36000 && nXP <=44999) // level 9
{ i = 9; }
else if(nXP >= 45000 && nXP <=54999) // level 10
{ i = 10; }
else if(nXP >= 55000 && nXP <=65999) // level 11
{ i = 11; }
else if(nXP >= 66000 && nXP <=77999) // level 12
{ i = 12; }
else if(nXP >= 78000 && nXP <=90999) // level 13
{ i = 13; }
else if(nXP >= 91000 && nXP <=104999) // level 14
{ i = 14; }
else if(nXP >= 105000 && nXP <=119999) // level 15
{ i = 15; }
else if(nXP >= 120000 && nXP <=135999) // level 16
{ i = 16; }
else if(nXP >= 136000 && nXP <=152999) // level 17
{ i = 17; }
else if(nXP >= 153000 && nXP <=170999) // level 18
{ i = 18; }
else if(nXP >= 171000 && nXP <=189999) // level 19
{ i = 19; }
else if(nXP >= 190000 && nXP <=209999) // level 20
{ i = 20; }
else if(nXP >= 210000 && nXP <=230999) // level 21
{ i = 21; }
else if(nXP >= 231000 && nXP <=262999) // level 22
{ i = 22; }
else if(nXP >= 263000 && nXP <=275999) // level 23
{ i = 23; }
else if(nXP >= 276000 && nXP <=299999) // level 24
{ i = 24; }
else if(nXP >= 300000 && nXP <=324999) // level 25
{ i = 25; }
else if(nXP >= 325000 && nXP <=350999) // level 26
{ i = 26; }
else if(nXP >= 351000 && nXP <=377999) // level 27
{ i = 27; }
else if(nXP >= 378000 && nXP <=405999) // level 28
{ i = 28; }
else if(nXP >= 406000 && nXP <=434999) // level 29
{ i = 29; }
else if(nXP >= 435000 && nXP <=464999) // level 30
{ i = 30; }
else if(nXP >= 465000 && nXP <=495999) // level 31
{ i = 31; }
else if(nXP >= 496000 && nXP <=527999) // level 32
{ i = 32; }
else if(nXP >= 528000 && nXP <=560999) // level 33
{ i = 33; }
else if(nXP >= 561000 && nXP <=594999) // level 34
{ i = 34; }
else if(nXP >= 595000 && nXP <=629999) // level 35
{ i = 35; }
else if(nXP >= 630000 && nXP <=665999) // level 36
{ i = 36; }
else if(nXP >= 666000 && nXP <=702999) // level 37
{ i = 37; }
else if(nXP >= 703000 && nXP <=740999) // level 38
{ i = 38; }
else if(nXP >= 741000 && nXP <780000) // level 39
{ i = 39; }
else if(nXP >= 780000 && nXP <XP_REQ_LVL41) //Handle level 40
{ i = 40; }
//Handle Legendary Levels (High Ground's System)
else if(nCurrentXP>=XP_REQ_LVL41 && nCurrentXP<XP_REQ_LVL42)
{ i = 41; }
else if(nCurrentXP>=XP_REQ_LVL42 && nCurrentXP<XP_REQ_LVL43)
{ i = 42; }
else if(nCurrentXP>=XP_REQ_LVL43 && nCurrentXP<XP_REQ_LVL44)
{ i = 43; }
else if(nCurrentXP>=XP_REQ_LVL44 && nCurrentXP<XP_REQ_LVL45)
{ i = 44; }
else if(nCurrentXP>=XP_REQ_LVL45 && nCurrentXP<XP_REQ_LVL46)
{ i = 45; }
else if(nCurrentXP>=XP_REQ_LVL46 && nCurrentXP<XP_REQ_LVL47)
{ i = 46; }
else if(nCurrentXP>=XP_REQ_LVL47 && nCurrentXP<XP_REQ_LVL48)
{ i = 47; }
else if(nCurrentXP>=XP_REQ_LVL48 && nCurrentXP<XP_REQ_LVL49)
{ i = 48; }
else if(nCurrentXP>=XP_REQ_LVL49 && nCurrentXP<XP_REQ_LVL50)
{ i = 49; }
else if(nCurrentXP>=XP_REQ_LVL50 && nCurrentXP<XP_REQ_LVL51)
{ i = 50; }
else if(nCurrentXP>=XP_REQ_LVL51 && nCurrentXP<XP_REQ_LVL52)
{ i = 51; }
else if(nCurrentXP>=XP_REQ_LVL52 && nCurrentXP<XP_REQ_LVL53)
{ i = 52; }
else if(nCurrentXP>=XP_REQ_LVL53 && nCurrentXP<XP_REQ_LVL54)
{ i = 53; }
else if(nCurrentXP>=XP_REQ_LVL54 && nCurrentXP<XP_REQ_LVL55)
{ i = 54; }
else if(nCurrentXP>=XP_REQ_LVL55 && nCurrentXP<XP_REQ_LVL56)
{ i = 55; }
else if(nCurrentXP>=XP_REQ_LVL56 && nCurrentXP<XP_REQ_LVL57)
{ i = 56; }
else if(nCurrentXP>=XP_REQ_LVL57 && nCurrentXP<XP_REQ_LVL58)
{ i = 57; }
else if(nCurrentXP>=XP_REQ_LVL58 && nCurrentXP<XP_REQ_LVL59)
{ i = 58; }
else if(nCurrentXP>=XP_REQ_LVL59 && nCurrentXP<XP_REQ_LVL60)
{ i = 59; }
else if(nCurrentXP>=XP_REQ_LVL60)
{ i = 60; }
return i;
//End Prototype
}
Modifié par _Guile, 27 septembre 2011 - 09:55 .