You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
1.8 KiB

  1. */
  2. Ways in which stats can be modified:
  3. * EQ or unEQ item
  4. -* Passives
  5. * Spells
  6. * Casting a Spell
  7. * Activating an Aura
  8. -* Gaining a level
  9. * Downscaling
  10. * Backscaling
  11. * Effects like HP Regen Aura being activated and deactivated
  12. -* Titangrip events
  13. */
  14. */
  15. Ok, here goes.
  16. So, the server has to keep track of your stats for multiple reasons. For example, when dealing damage you might want to query the character's strength. Or, when trying to equip an item, we have to check the character's level. The former has to check the downscaled value and the latter, the unscaled. It's important to note that character's aren't always scaled.
  17. There are tons of ways that a character's stats can be modified, for example: EQ an item, applying a passive tree node, casting a spell, activating an aura, gaining a level, etc...
  18. My question is. How do I bet manage this? Do i recalculate scaled stats every time your stats chang
  19. */
  20. */
  21. * On enter zone:
  22. * Hook prophecy events
  23. * Set level based stats
  24. * Apply Passives
  25. * EQ All Gear (Make sure to ignore stat issues until after all EQd then check all)
  26. * Downscale stats and store in scaledStats
  27. * On EQ, unEQ, spellcast, aura activation, aura deactivation, aura effect application, aura effect removal, damage taken, death and respawn
  28. * Modify both stats and scaledStats
  29. */
  30. define([
  31. 'server/mocks/generator'
  32. ], function(
  33. mocks
  34. ) {
  35. return {
  36. //Do we have the item equipped after equipping it
  37. equipItem_Stats: function() {
  38. var player = mocks.player({
  39. inventory: {
  40. items: [{
  41. id: 0,
  42. slot: 'head',
  43. stats: {
  44. int: 10
  45. }
  46. }]
  47. },
  48. equipment: {},
  49. stats: {},
  50. spellbook: {}
  51. });
  52. player.equipment.equip(0);
  53. if (player.stats.values.int != 10)
  54. return true;
  55. }
  56. };
  57. });