Advertisement
Chronos_Ouroboros

Untitled

Jan 6th, 2018
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. override void PostBeginPlay () {
  2. SetTag (S7_Utils.GenName_Male_Eng ());
  3. if (!xpSys) {
  4. GiveInventory ("S7_XPSystem", 1);
  5. xpSys = S7_XPSystem (FindInventory ("S7_XPSystem", true));
  6. }
  7.  
  8. let serverData = S7_ServerData.Get ();
  9. xpSys.level = random [monsterStats] (1, 5) * max (1.0, double (serverData.avgLevel) / 20);
  10. int attrPts = xpSys.level * 4;
  11. int attrPts2 = attrPts * .25;
  12. attrPts *= .75;
  13.  
  14. while (attrPts > 0) {
  15. int rnd = random [monsterStats] (0, 3);
  16.  
  17. switch (rnd) {
  18. case 0: xpSys.SetStat (S7Stat_Strength, 1); break;
  19. case 1: xpSys.SetStat (S7Stat_Defense, 1); break;
  20. case 2: xpSys.SetStat (S7Stat_Vitality, 1); break;
  21. case 3:
  22. int rnd2 = random (0, 4);
  23. if (rnd > 1)
  24. xpSys.SetStat (S7Stat_Agility, 1);
  25. else
  26. xpSys.SetStat (S7Stat_Will, 1);
  27. break;
  28. }
  29.  
  30. attrPts--;
  31. }
  32.  
  33. // Vitality
  34. startHealth = health *= 1.0 + (.1 * xpSys.GetStat (S7Stat_Vitality));
  35. }
  36.  
  37. override void Tick () {
  38. Super.Tick ();
  39.  
  40. if (!xpSys) {
  41. xpSys = S7_XPSystem (FindInventory ("S7_XPSystem", true));
  42. if (!xpSys) {
  43. GiveInventory ("S7_XPSystem", 1);
  44. xpSys = S7_XPSystem (FindInventory ("S7_XPSystem", true));
  45. }
  46. }
  47.  
  48. // Strength
  49. damageMultiply = 1.0 + (0.02 * xpSys.GetStat (S7Stat_Strength / 3));
  50. // Defense
  51. damageFactor = clamp (1.0 - (0.01 * xpSys.GetStat (S7Stat_Defense / 3)), 0.1, 1.0);
  52. }
  53.  
  54. override void OnDeath (Actor source, Actor inflictor, int dmgflags) {
  55. if (source) {
  56. let xpSys = GetXPSystem ();
  57. double level = xpSys ? xpSys.level : 1;
  58. GiveXP (source, 50 * max (1, level / 3));
  59. source.GiveInventory ("S7_Cash", 50 * max (1, level / 4));
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement