[XP] Attack without Weapon and personal ATK/PDEF/MDEF/EVA st

Attack without Weapon and personal ATK/PDEF/MDEF/EVA statistics
Authors: PrinceEndymion88
Version: 0.2
Type: More Actor Base Stats
Key Term: Actor Add-on


Introduction

This script was created for those who want to add in their project the possibility to have a base attack, physical defense, magical defense, and evasion. So your hero, for example, can attack without a weapon and can defend himself without armor.

Features


You can customize your hero base attack power
You can customize your hero base phisical defence
You can customize your hero base magical defence
You can customize your hero base evasion
You can select a personal animation for the attack without weapon or you can choose a default one.



Updates
v0.2

Now you could define a default base attack value, a default phisical defence value, a default magical defence value and a default evasion value for those heroes which haven’t a personalized value for the calculation of statistics.



Screenshots

None.

Demo

http://sailormoonanotherstory2.altervis ... tatistics/

Script

v0.2
Content Hidden Show
  1.  
  2. ##Attack without Weapon and personal ATK/PDEF/MDEF/EVA statistics
  3. ##Created by PrinceEndymion88
  4. ##http://sailormoonanotherstory2.altervista.org
  5. ##version 0.2
  6. ##Thanks to ValentinoAvon for his base script
  7.  
  8. #{ID_HERO => ID ANIMATION}
  9. #Instruction:
  10. #First of all copy the script above Main
  11. #This define the animation displayed when an hero have no weapon assigned.
  12. #For example, if you want to assign the animation 386 at hero 1 you have to insert 1=>386
  13. #You have to use comma to separe every personal animation.
  14. #For example ANIMATION_NO_WEAPON = {1=>386, 2=>300, 3=>150}
  15. #Istruzioni:
  16. #Prima di tutto copiare lo script sopra Main
  17. #Questa parte definisce l'animazione visualizzata quando un eroe attacca e non ha un'arma assegnata.
  18. #Per esempio, se vuoi assegnare l'animazione 386 all'eroe 1 dovrai inserire 1=>386
  19. #Devi usare la virgola per separare ogni animazione personalizzata
  20. #Per esempio ANIMATION_NO_WEAPON = {1=>386, 2=>300, 3=>150}
  21. ANIMATION_NO_WEAPON = {1=>10, 5=>11}
  22.  
  23. #Here you can define the default animation for the heroes which have no animation assigned.
  24. #Qui potrai definire l'animazione personalizzata per gli eroi che non ne hanno una assegnata
  25. ANIMATION_NO_WEAPON_DEFAULT = 12
  26.  
  27. #Here you have to insert the multiplier for your personal statistics.
  28. #ATK, PDEF, MDEF and EVA will be calculated with the following formula:
  29. #ATK= HERO_LEVEL * MULTIPLIER_ATK (for example if your hero level is 25 and your MULTIPLIER_ATK is 2, at level 25 your hero will have a base attack = 50)
  30. #PDEF = HERO_LEVEL * MULTIPLIER_PDEF (for example if your hero level is 25 and your MULTIPLIER_PDEF is 3, at level 25 your hero will have a base phisical defence = 75)
  31. #MDEF = HERO_LEVEL * MULTIPLIER_MDEF (for example if your hero level is 25 and your MULTIPLIER_MDEF is 2, at level 25 your hero will have a base magical defence = 50)
  32. #EVA = HERO_LEVEL * MULTIPLIER_EVA (for example if your hero level is 25 and your MULTIPLIER_EVA is 4, at level 25 your hero will have a base evasion = 100)
  33. #Naturally if you equip your hero with weapons or armor, statistics will be summet to base statistics (base statistics + additional statistics)
  34. #Qui dovrai inserire i moltiplicatori per le tue statistiche personali
  35. #Attacco (ATK), Difesa fisica (PDEF), Difesa magica (MDEF) ed evasione (EVA) verranno calcolate con la formula seguente:
  36. #ATK= HERO_LEVEL * MULTIPLIER_ATK (per esempio se il tuo eroe è al livello 25 e il valore MULTIPLIER_ATK è 2, al livello 25 avrà un attacco base pari a = 50)
  37. #PDEF = HERO_LEVEL * MULTIPLIER_PDEF (per esempio se il tuo eroe è al livello 25 e il valore MULTIPLIER_PDEF è 3, al livello 25 avrà una difesa fisica pari a = 75)
  38. #MDEF = HERO_LEVEL * MULTIPLIER_MDEF (per esempio se il tuo eroe è al livello 25 e il valore MULTIPLIER_MDEF è 2, al livello 25 avrà una difesa magica pari a = 50)
  39. #EVA = HERO_LEVEL * MULTIPLIER_EVA (per esempio se il tuo eroe è al livello 25 e il valore MULTIPLIER_EVA è 4, al livello 25 avrà un valore di evasione pari a = 100)
  40. #Naturalmente se equipaggerai il tuo eroe con armi o armature le statistiche verranno sommate a quelle base
  41. MULTIPLIER_ATK =  {1=>2, 5=>3}
  42. MULTIPLIER_PDEF =  {1=>3, 5=>2}
  43. MULTIPLIER_MDEF = {1=>2, 5=>3}
  44. MULTIPLIER_EVA =  {1=>4, 5=>5}
  45. #In base puoi definire un valore di attacco di base, un valore di difesa fisica di base, un valore di difesa magica di base e un valore di evasione di base per quegli
  46. #eroi che non hanno alcun valore personalizzato per il calcolo delle statistiche
  47. #Below you could define a default base attack value, a default phisical defence value, a default magical defence value and a default evasion value for those heroes
  48. #which haven't a personalized value for the calculation of statistics.
  49. MULTIPLIER_ATK_DEF = 5
  50. MULTIPLIER_PDEF_DEF = 5
  51. MULTIPLIER_MDEF_DEF = 5
  52. MULTIPLIER_EVA_DEF = 5
  53.  
  54. class Game_Actor < Game_Battler
  55. #--------------------------------------------------------------------------
  56. # * Define Attack Power with and without weapon
  57. #--------------------------------------------------------------------------
  58.  
  59.   def base_atk
  60.     n = 0
  61.     weapon = $data_weapons[@weapon_id]
  62.     n += weapon.atk if weapon != nil
  63.     if MULTIPLIER_ATK[@actor_id] != nil
  64.     n += (@level *MULTIPLIER_ATK[@actor_id])
  65.     else
  66.     n += (@level * MULTIPLIER_ATK_DEF)
  67.     end
  68.     return n
  69.   end
  70.   alias personal_animation2_id animation2_id
  71.    def animation2_id
  72.     weapon = $data_weapons[@weapon_id]
  73.   if ANIMATION_NO_WEAPON[@actor_id] != nil
  74.     return ANIMATION_NO_WEAPON[@actor_id] if weapon == nil
  75.   else
  76.     return ANIMATION_NO_WEAPON_DEFAULT if weapon == nil
  77.   end
  78.     personal_animation2_id
  79.   end
  80.  
  81. #--------------------------------------------------------------------------
  82. # * Define Physical Defense with and without weapon/armor
  83. #--------------------------------------------------------------------------
  84.   def base_pdef
  85.     n = 0
  86.     weapon = $data_weapons[@weapon_id]
  87.     armor1 = $data_armors[@armor1_id]
  88.     armor2 = $data_armors[@armor2_id]
  89.     armor3 = $data_armors[@armor3_id]
  90.     armor4 = $data_armors[@armor4_id]
  91.     pdef1 = weapon
  92.     pdef2 = armor1 != nil ? armor1.pdef : 0
  93.     pdef3 = armor2 != nil ? armor2.pdef : 0
  94.     pdef4 = armor3 != nil ? armor3.pdef : 0
  95.     pdef5 = armor4 != nil ? armor4.pdef : 0
  96.     n += weapon.pdef if weapon != nil
  97.     if MULTIPLIER_PDEF[@actor_id] != nil
  98.     n += (@level *MULTIPLIER_PDEF[@actor_id])
  99.     else
  100.     n += MULTIPLIER_PDEF_DEF
  101.     end
  102.     return n + pdef2 + pdef3 + pdef4 + pdef5
  103.   end
  104.  
  105. #--------------------------------------------------------------------------
  106. # * Define Magic Defense with and without weapon/armor
  107. #--------------------------------------------------------------------------
  108.   def base_mdef
  109.     n = 0
  110.     weapon = $data_weapons[@weapon_id]
  111.     armor1 = $data_armors[@armor1_id]
  112.     armor2 = $data_armors[@armor2_id]
  113.     armor3 = $data_armors[@armor3_id]
  114.     armor4 = $data_armors[@armor4_id]
  115.     mdef1 = weapon
  116.     mdef2 = armor1 != nil ? armor1.mdef : 0
  117.     mdef3 = armor2 != nil ? armor2.mdef : 0
  118.     mdef4 = armor3 != nil ? armor3.mdef : 0
  119.     mdef5 = armor4 != nil ? armor4.mdef : 0
  120.     n += weapon.mdef if weapon != nil
  121.     if MULTIPLIER_MDEF[@actor_id] != nil
  122.     n += (@level *MULTIPLIER_MDEF[@actor_id])
  123.     else
  124.     n += MULTIPLIER_MDEF_DEF
  125.     end
  126.     return n + mdef2 + mdef3 + mdef4 + mdef5
  127.   end
  128.  
  129. #--------------------------------------------------------------------------
  130. # * Define Evasion Correction with and without armor
  131. #--------------------------------------------------------------------------
  132.   def base_eva
  133.     n = 0
  134.     armor1 = $data_armors[@armor1_id]
  135.     armor2 = $data_armors[@armor2_id]
  136.     armor3 = $data_armors[@armor3_id]
  137.     armor4 = $data_armors[@armor4_id]
  138.     eva1 = armor1 != nil ? armor1.eva : 0
  139.     eva2 = armor2 != nil ? armor2.eva : 0
  140.     eva3 = armor3 != nil ? armor3.eva : 0
  141.     eva4 = armor4 != nil ? armor4.eva : 0
  142.     if MULTIPLIER_EVA[@actor_id] != nil
  143.     n += (@level *MULTIPLIER_EVA[@actor_id])
  144.     else
  145.     n += MULTIPLIER_EVA_DEF
  146.     end
  147.     return n + eva1 + eva2 + eva3 + eva4
  148.   end
  149. end
  150.  
Expand to see the code.

v0.1
Content Hidden Show
  1.  
  2. ##Attack without Weapon and personal ATK/PDEF/MDEF/EVA statistics
  3. ##Created by PrinceEndymion88
  4. ##http://sailormoonanotherstory2.altervista.org
  5. ##version 0.1
  6. ##Thanks to ValentinoAvon for his base script
  7.  
  8. #{ID_HERO => ID ANIMATION}
  9. #Instruction:
  10. #First of all copy the script above Main
  11. #This define the animation displayed when an hero have no weapon assigned.
  12. #For example, if you want to assign the animation 386 at hero 1 you have to insert 1=>386
  13. #You have to use comma to separe every personal animation.
  14. #For example ANIMATION_NO_WEAPON = {1=>386, 2=>300, 3=>150}
  15. ANIMATION_NO_WEAPON = {1=>10}
  16.  
  17. #Here you can define the default animation for the heroes which have no animation assigned.
  18. ANIMATION_NO_WEAPON_DEFAULT = 11
  19.  
  20. #Here you have to insert the multiplier for your personal. Statistics.
  21. #ATK, PDEF, MDEF and EVA will be calculated with the following formula:
  22. #ATK= HERO_LEVEL * MULTIPLIER_ATK (for example if your hero level is 25 and your MULTIPLIER_ATK is 2, at level 25 your hero will have a base attack = 50)
  23. #PDEF = HERO_LEVEL * MULTIPLIER_PDEF (for example if your hero level is 25 and your MULTIPLIER_PDEF is 3, at level 25 your hero will have a base phisical defence = 75)
  24. #MDEF = HERO_LEVEL * MULTIPLIER_MDEF (for example if your hero level is 25 and your MULTIPLIER_MDEF is 2, at level 25 your hero will have a base magical defence = 50)
  25. #EVA = HERO_LEVEL * MULTIPLIER_EVA (for example if your hero level is 25 and your MULTIPLIER_EVA is 4, at level 25 your hero will have a base evasion = 100)
  26. #Naturally if you equip your hero with weapons or armor you have to sum base statistics + additional statistics
  27. MULTIPLIER_ATK =  {1=>2}
  28. MULTIPLIER_PDEF =  {1=>3}
  29. MULTIPLIER_MDEF = {1=>2}
  30. MULTIPLIER_EVA =  {1=>4}
  31.  
  32. class Game_Actor < Game_Battler
  33. #--------------------------------------------------------------------------
  34. # * Define Attack Power with and without weapon
  35. #--------------------------------------------------------------------------
  36.  
  37.   def base_atk
  38.     n = 0
  39.     weapon = $data_weapons[@weapon_id]
  40.     n += weapon.atk if weapon != nil
  41.     n += (@level *MULTIPLIER_ATK[@actor_id])
  42.     return n
  43.   end
  44.   alias personal_animation2_id animation2_id
  45.    def animation2_id
  46.     weapon = $data_weapons[@weapon_id]
  47.   if ANIMATION_NO_WEAPON[@actor_id] != nil
  48.     return ANIMATION_NO_WEAPON[@actor_id] if weapon == nil
  49.   else
  50.     return ANIMATION_NO_WEAPON_DEFAULT if weapon == nil
  51.   end
  52.     personal_animation2_id
  53.   end
  54.  
  55. #--------------------------------------------------------------------------
  56. # * Define Physical Defense with and without weapon/armor
  57. #--------------------------------------------------------------------------
  58.   def base_pdef
  59.     n = 0
  60.     weapon = $data_weapons[@weapon_id]
  61.     armor1 = $data_armors[@armor1_id]
  62.     armor2 = $data_armors[@armor2_id]
  63.     armor3 = $data_armors[@armor3_id]
  64.     armor4 = $data_armors[@armor4_id]
  65.     pdef1 = weapon
  66.     pdef2 = armor1 != nil ? armor1.pdef : 0
  67.     pdef3 = armor2 != nil ? armor2.pdef : 0
  68.     pdef4 = armor3 != nil ? armor3.pdef : 0
  69.     pdef5 = armor4 != nil ? armor4.pdef : 0
  70.     n += weapon.pdef if weapon != nil
  71.     n += (@level *MULTIPLIER_PDEF[@actor_id])
  72.     return n + pdef2 + pdef3 + pdef4 + pdef5
  73.   end
  74.  
  75. #--------------------------------------------------------------------------
  76. # * Define Magic Defense with and without weapon/armor
  77. #--------------------------------------------------------------------------
  78.   def base_mdef
  79.     n = 0
  80.     weapon = $data_weapons[@weapon_id]
  81.     armor1 = $data_armors[@armor1_id]
  82.     armor2 = $data_armors[@armor2_id]
  83.     armor3 = $data_armors[@armor3_id]
  84.     armor4 = $data_armors[@armor4_id]
  85.     mdef1 = weapon
  86.     mdef2 = armor1 != nil ? armor1.mdef : 0
  87.     mdef3 = armor2 != nil ? armor2.mdef : 0
  88.     mdef4 = armor3 != nil ? armor3.mdef : 0
  89.     mdef5 = armor4 != nil ? armor4.mdef : 0
  90.     n += weapon.mdef if weapon != nil
  91.     n += (@level *MULTIPLIER_MDEF[@actor_id])
  92.     return n + mdef2 + mdef3 + mdef4 + mdef5
  93.   end
  94.  
  95. #--------------------------------------------------------------------------
  96. # * Define Evasion Correction with and without armor
  97. #--------------------------------------------------------------------------
  98.   def base_eva
  99.     n = 0
  100.     armor1 = $data_armors[@armor1_id]
  101.     armor2 = $data_armors[@armor2_id]
  102.     armor3 = $data_armors[@armor3_id]
  103.     armor4 = $data_armors[@armor4_id]
  104.     eva1 = armor1 != nil ? armor1.eva : 0
  105.     eva2 = armor2 != nil ? armor2.eva : 0
  106.     eva3 = armor3 != nil ? armor3.eva : 0
  107.     eva4 = armor4 != nil ? armor4.eva : 0
  108.     n += (@level *MULTIPLIER_EVA[@actor_id])
  109.     return n + eva1 + eva2 + eva3 + eva4
  110.   end
  111. end
  112.  
Expand to see the code.


Instructions

Instructions are in the script.

Compatibility

No issue found.

Credits and Thanks


ValentinoAvon


Author's Notes
-None-

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=79322