- ServUO Version
- Publish Unknown
- Ultima Expansion
- High Seas
Hi, first of all, I'm not an English speaker, so please excuse my poor English.
I'm using a shard with some edits to the script, and since it's not a shard I built myself, I need help with a malfunction in the code.
In this shard, new code added for exp and levels in \Scripts\Customs\BaseCreature.cs.
Below code is normally works fine, but only when playing in a party does it not give me any exp points and does not display any messages.
I'm not very good at coding, but I don't think party play would prevent the if statement from being satisfied.
What am I overlooking? I desperately need some help.
I also have another class that stores, fetches, and prints exp and levels, but that part always works fine.
Thank you in advance.
ServUO Version : 0.5 build 7344.36207
I'm using a shard with some edits to the script, and since it's not a shard I built myself, I need help with a malfunction in the code.
In this shard, new code added for exp and levels in \Scripts\Customs\BaseCreature.cs.
Below code is normally works fine, but only when playing in a party does it not give me any exp points and does not display any messages.
Code:
if ( !Controlled && !Summoned && Alive && ds.m_Mobile is PlayerMobile )
{
PlayerMobile pm = ((PlayerMobile)ds.m_Mobile);
pm.StackI = 0;
int multipler = 750-(pm.PoELevel*5); SoulPower *= multipler;
int getexp = SoulPower/(pm.PoELevel*pm.PoELevel);
int needexp = (pm.PoELevel*pm.PoELevel)+(30*pm.PoELevel);
if ( getexp > (needexp/3) ) { getexp = (needexp/3); }
if ( getexp > 0 && pm.PoEEXP < 2100000000)
{
pm.PoEEXP += getexp;
int percent = 0;
if ( (needexp-pm.PoEEXP) > 0 ){
percent = getexp * 100 / needexp;
}
ds.m_Mobile.SendMessage("You have gained {0} exp. [{1}%]", getexp, percent );
if ( pm.PoEEXP >= needexp && pm.PoELevel < 99 )
{
pm.PoEEXP -= needexp;
pm.PoELevel += 1;
}
}
}
What am I overlooking? I desperately need some help.
I also have another class that stores, fetches, and prints exp and levels, but that part always works fine.
Thank you in advance.
ServUO Version : 0.5 build 7344.36207