function gws_adapt_description(&$desc, &$extra_desc, $name, $attribute, $attr_list, $type, $pve_only) { //Take into account Divine Favor add_divine_favor($desc, $extra_desc, $attr_list, $name); //Take into account Strength if (!empty($attr_list['Strength']) && strpos($type, 'Attack') !== false) { $extra_desc = 'This attack skill has <b>' . $attr_list['Strength'] . '</b>% armor penetration.'; } //Put some green around the fork $desc = preg_replace_callback('|([0-9]+\\.\\.[0-9]+)|', 'fork_replace', $desc); //For PvP skills, if (!$pve_only) { //Adapt the fork to the build's attribute level.. if (isset($attr_list[$attribute])) { $attr_lvl = $attr_list[$attribute]; if (preg_match_all('|([0-9]+)\\.\\.([0-9]+)|', $desc, $regs, PREG_SET_ORDER)) { foreach ($regs as $fork) { list($all, $val_0, $val_15) = $fork; $desc = str_replace($all, fork_val($val_0, $val_15, $attr_lvl), $desc); } } } else { $desc = preg_replace_callback('|([0-9]+)\\.\\.([0-9]+)|', 'desc_replace', $desc); } } //and for PvE skills, leave it //Specify a Spirit health and armor $desc = add_spirit_health($desc, $attr_list); //Specify additional weapon spell duration $desc = calc_weapon_duration($desc, $attr_list, $type); }
function gws_adapt_description($name, $attribute, $att, $description) { //Take into account Divine Favor $description = add_divine_favor($att, $name, $description); //Add {Attrib: attr_name) if ($attribute != 'No Attribute') { $description .= " (Attrib: {$attribute})"; } //Put some green around the fork $description = preg_replace_callback('|([0-9]+\\.\\.[0-9]+)|', 'fork_replace', $description); //Adapt the fork to the build's attribute level.. $attr_list = attribute_list($att); if (isset($attr_list[$attribute])) { $attr_lvl = $attr_list[$attribute]; $description = str_replace("(Attrib: {$attribute})", "(Attrib: <b>{$attr_lvl}</b> {$attribute})", $description); if (preg_match_all('|([0-9]+)\\.\\.([0-9]+)|', $description, $regs, PREG_SET_ORDER)) { foreach ($regs as $fork) { list($all, $val_0, $val_15) = $fork; $description = str_replace($all, fork_val($val_0, $val_15, $attr_lvl), $description); } } } else { $description = preg_replace_callback('|([0-9]+)\\.\\.([0-9]+)|', 'desc_replace', $description); } //Specify a Spirit health and armor $description = add_spirit_health($att, $description); return $description; }