Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-24 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 09:15:22 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Loosing exp  (Read 189 times)
Zydu
Jr. Member
**
Posts: 51


View Profile
« on: July 31, 2011, 01:44:13 PM »

So as far as I managed to test newest version of war3source this bug appears randomly on kills. Custom races have nothing to do with it since it also happens on standard races.

When player kills someone he gets message "You received 2 gold." and exp is not mentioned. After this when checking xp status you can see it has been lowered by the amount of exp you were supposed to gain.

I have also tested it with clan sql base but the bug still appears.
 
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #1 on: July 31, 2011, 01:46:04 PM »

do you have extra xp by level cvar enabled?

I can confirm that you LOSE xp for making kills and I can see where this is coming from, I just got to find the actual line in the code...

If YOU as level 2 kill a player at lets say level 30 you get lets say 150xp

If they kill you they lose around 150xp

Basically the function is written as (30-2)x=xp so when it goes (2-30)x=xp you go negative...

To fix the problem open Engine_XPGold and change the contents of GiveKillXPCreds to:

Code:
GiveKillXPCreds(client,playerkilled,bool:headshot,bool:melee)
{
//PrintToChatAll("1");
new race=War3_GetRace(client);
if(race>0){
new killerlevel=War3_GetLevel(client,War3_GetRace(client));
new victimlevel=War3_GetLevel(playerkilled,War3_GetRace(playerkilled));
new leveldiff;

leveldiff=victimlevel-killerlevel;

//check for negitive and assign to 0 so no bonus is awarded
if(leveldiff<0)
{
leveldiff=0;
}

new killxp=W3GetKillXP(client,leveldiff);

new addxp=killxp;
if(headshot) addxp+=((killxp*GetConVarInt(HeadshotXPCvar))/100);
if(melee) addxp+=((killxp*GetConVarInt(MeleeXPCvar))/100);



new String:killaward[64];
Format(killaward,sizeof(killaward),"%T","a kill",client);
W3GiveXPGold(client,XPAwardByKill,addxp,W3GetKillGold(),killaward);
}
}

The above will ensure that no xp is ever removed and that if you kill a player lower level than yourself you get no bonus. In theory you could make your own function here to reward some functional less xp without going negative if you wanted some addational customization.
Logged

DarkEnergy
Zydu
Jr. Member
**
Posts: 51


View Profile
« Reply #2 on: July 31, 2011, 01:48:54 PM »

Yes I do and that must be the issue I guess.

Is it fixed in final 1.2.2.9 or must I edit Engine_XPGold myself?
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #3 on: July 31, 2011, 01:49:27 PM »

its fixed on the SVN only. and the fix is different from above.
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!