class Window_Help < Window_Base def set_item(item) damage_type = ["none", "HP damage", "MP damage", "HP recovery", "MP recovery", "HP drain", "MP drain"] damage_color = [ "", "1", #Physical "2", #Absorb "3", #Fire "4", #Ice "5", #Thunder "6", #Water "7", #Earth "8", #Wind "9", #Holy "10", #Dark "11", #Law "12", #Chaos "13", #Good "14", #Evil "15", #Neutral "16"] #Sonic if item then if item.is_a?(RPG::Skill) && item.damage.none? != 0 then result = item.description.to_s.clone result.gsub!(/\$DT/i) { damage_type[item.damage.type] } if item.damage.element_id != 0 then result.gsub!(/\$DC/i) { "\\C["+damage_color[item.damage.element_id]+"]" } result.gsub!(/\$DN/i) { $data_system.elements[item.damage.element_id] } end set_text(result) else set_text(item.description) end else set_text("") end endendclass Window_SkillList < Window_Selectable def update_help if item if item.damage.none? != 0 then $game_variables[120] = (item.damage.eval(@actor, @actor, $game_variables).to_i).abs end end @help_window.set_item(item) endendSnippet update. \o/
Generic Usage in a Description:
$DT returns the damage type of the skill (HP damage, MP drain, etc)
$DN returns the name of the damage element (Physical, Fire, Holy)
$DC applies a pre-defined color to the following text, based on damage type.
Four things to note:
1) $DC adds in the listed color for the damage type. Whatever is colored needs to be followed by \C[0] to return the text to normal color. The script can never do this magically.
2) $DN will apply the name of the damage element. (this entire code block is skipped if "none" is set)
3) The array of colors (damage_colors) isn't properly set (generic 1-16), and is based on the number of elements in Silver Town. (Meaning if someone else wishes to use this snippet, they may need to edit the length of this array, as well as which colors each uses.)
4) If the damage type of the skill is set to "none", none of this will work. :)
(I used $D's in this since \D is a reserved escape character used in regexp. In case anyone was wondering.)
Edit: Oops. Made a boo-boo, need to check if the item is actually a skill before checking damage and such. x.x