Guest User

Untitled

a guest
Apr 26th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using DOL.Database;
  5. using DOL.GS.PacketHandler;
  6. using log4net;
  7. using System.Reflection;
  8. using DOL.Language;
  9.  
  10. namespace DOL.GS
  11. {
  12.     public class ZoneBonus
  13.     {
  14.         private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  15.  
  16.         #region eZoneBonusType
  17.         public enum eZoneBonusType
  18.         {
  19.             XP = 0,
  20.             RP = 1,
  21.             BP = 2,
  22.             COIN = 3,
  23.         }
  24.         #endregion
  25.         #region Get Bonuses Methods
  26.         public static int GetXPBonus(GamePlayer player)
  27.         {
  28.             if (player.Level < 45)
  29.                 return player.CurrentZone.BonusExperience;
  30.             else
  31.                 Console.WriteLine(player.Name+" level is > 45 and doesn't benefits of the bonus");
  32.                 return 0;
  33.         }
  34.         public static int GetRPBonus(GamePlayer player)
  35.         {
  36.             if (player.Level < 45)
  37.                 return player.CurrentZone.BonusRealmpoints;
  38.             else
  39.                 Console.WriteLine(player.Name + " level is > 45 and doesn't benefits of the bonus");
  40.                 return 0;
  41.         }
  42.         public static int GetBPBonus(GamePlayer player)
  43.         {
  44.             if (player.Level < 45)
  45.                 return player.CurrentZone.BonusBountypoints;
  46.             else
  47.                 Console.WriteLine(player.Name + " level is > 45 and doesn't benefits of the bonus");
  48.                 return 0;
  49.         }
  50.         public static int GetCoinBonus(GamePlayer player)
  51.         {
  52.             if (player.Level < 45)
  53.                 return player.CurrentZone.BonusCoin;
  54.             else
  55.                 Console.WriteLine(player.Name + " level is > 45 and doesn't benefits of the bonus");
  56.                 return 0;
  57.         }
  58.         #endregion
  59.         #region Get Bonus Message
  60.         public static string GetBonusMessage(GamePlayer player, int bonusAmount, eZoneBonusType type)
  61.         {
  62.             switch (type)
  63.             {
  64.                 case eZoneBonusType.XP:
  65.                     return LanguageMgr.GetTranslation(player.Client.Account.Language, "ZoneBonus.AdditionalXP", bonusAmount);
  66.                 case eZoneBonusType.RP:
  67.                     return LanguageMgr.GetTranslation(player.Client.Account.Language, "ZoneBonus.AdditionalRP", bonusAmount);
  68.                 case eZoneBonusType.BP:
  69.                     return LanguageMgr.GetTranslation(player.Client.Account.Language, "ZoneBonus.AdditionalBP", bonusAmount);
  70.                 case eZoneBonusType.COIN:
  71.                     return LanguageMgr.GetTranslation(player.Client.Account.Language, "ZoneBonus.AdditionalCoin");
  72.                 default: return "No Bonus Type Found";
  73.             }
  74.         }
  75.         #endregion
  76.  
  77.     }
  78. }
Add Comment
Please, Sign In to add comment