I put the "-like" in, because this script will, at the moment, check how many honorable kills you have then set your rank by the pre-set amount.
I will be updating it to exactly how the PreBC system worked eventually, but for now... This is a good start.
Source Code - This is a link to the C++ source code
Toggle shoutbox Lastest Announcements
![]() |
Page 1 of 1
[c++] Prebc-like Honor System KDA
#1
Posted 03 February 2011 - 01:53 PM
«shadow. The power on your side.»
Keeping the Dream Alive ( KDA ) - PreBC Development
Keeping the Dream Alive ( KDA ) - PreBC Development
#2
Posted 03 February 2011 - 04:00 PM
for(currRank = ARRAYSIZE(rank)-1; currRank >= 0; currRank++) // currRank will decrement until the correct boundary has been found.
decrement? I see a ++ there.
if( Plr->GetTeam()==1 ) // Horde
I think there's something like bool Player::IsTeamHorde() if you want.
#3
Posted 03 February 2011 - 04:54 PM
SaintJamesApostle, on 03 February 2011 - 04:00 PM, said:
for(currRank = ARRAYSIZE(rank)-1; currRank >= 0; currRank++) // currRank will decrement until the correct boundary has been found.
decrement? I see a ++ there.
if( Plr->GetTeam()==1 ) // Horde
I think there's something like bool Player::IsTeamHorde() if you want.
I've changed the code multiple times, the newer version has been uploaded to Pastebin. Sorry I forgot to change the link.
«shadow. The power on your side.»
Keeping the Dream Alive ( KDA ) - PreBC Development
Keeping the Dream Alive ( KDA ) - PreBC Development
#4
Posted 03 February 2011 - 05:21 PM
for(currRank = 0; currRank >= ARRAYSIZE(rank); currRank++) // currRank will inc until the correct boundary has been found.
did you mean "currRank <= " ? otherwise that condition looks doomed to be always false.
Take a couple of minutes to debug your script with the Almighty F10/F11 ^^
Also I suggest an "else" in the body of SetRank(), a Player can't be both Alliance and Horde ^^
Also (second and last one) if Hks is < 5, newRank will be left unitialized. That's very very very bad.
#5
Posted 05 February 2011 - 10:26 AM
SaintJamesApostle, on 03 February 2011 - 05:21 PM, said:
for(currRank = 0; currRank >= ARRAYSIZE(rank); currRank++) // currRank will inc until the correct boundary has been found.
did you mean "currRank <= " ? otherwise that condition looks doomed to be always false.
Take a couple of minutes to debug your script with the Almighty F10/F11 ^^
Also I suggest an "else" in the body of SetRank(), a Player can't be both Alliance and Horde ^^
Also (second and last one) if Hks is < 5, newRank will be left unitialized. That's very very very bad.
Thanks for the tips, I've changed the bottom bit to else.
«shadow. The power on your side.»
Keeping the Dream Alive ( KDA ) - PreBC Development
Keeping the Dream Alive ( KDA ) - PreBC Development
#6
Posted 12 February 2011 - 05:25 PM
Plr->SetUInt32Value( PLAYER_CHOSEN_TITLE, newRank ); // Changes the title that's "equipped" to their current rank
this looks exactly like the code for
Player::SetChosenTitle(uint32 id)
Maybe you should use that method ShadowSight

Share this topic:
Page 1 of 1