Last active
March 10, 2016 19:04
-
-
Save hastinbe/7a8934162d7b84ceff9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Vocation | |
| { | |
| private long xp; | |
| public readonly string PlayerName; | |
| public int Level; | |
| public long XP | |
| { | |
| get | |
| { | |
| return xp; | |
| } | |
| private set | |
| { | |
| long nextLevelExp = getLevelXp(Level + 1); | |
| if (value >= nextLevelExp) | |
| { | |
| Level++; | |
| XP = 0; | |
| player.SendInfoMessage(cClass.Resources.INFO_LEVELUP, Level); | |
| } | |
| else | |
| { | |
| int change = Main.rand.Next(0, 100); | |
| if (change <= 5) | |
| { | |
| long percent = value * 100 / nextLevelExp; | |
| NetMessage.SendData(Convert.ToInt32(PacketTypes.CreateCombatText), -1, -1, | |
| string.Format(cClass.Resources.INFO_LEVELHINT, 100 - percent), | |
| Convert.ToInt32(Color.Gold.PackedValue), | |
| player.X, player.Y); | |
| } | |
| xp = value; | |
| } | |
| } | |
| } | |
| protected TSPlayer player; | |
| protected virtual float MELEE_VOCATION_CONSTANT { get { return 2f; } } | |
| protected virtual float RANGED_VOCATION_CONSTANT { get { return 2f; } } | |
| protected virtual float MAGIC_VOCATION_CONSTANT { get { return 3f; } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment