;"QuestCore2 Patch 001" ;"5/26/2022" ;"questcore2_patch_001.txt" ;"This patch fixes a bug in the code for the @kgen command which causes the operation to fail" ;"if the target object's 'ammo_type' property is set to #-1." ;"To install this patch, copy and paste this entire file into the MUD client." ;"NOTE: You must be logged in to an account with wizard permissions." @prog #57:@kgen if (!argstr) return player:tell("You must specify an object."); endif if (parent(player) == $rpgamer) return player:tell("You cannot use this function."); endif target = $string_utils:match_object(dobjstr, $nothing); if (target == $failed_match) return player:tell("\"", dobjstr, "\" could not be matched."); endif if (parent(target) == $monster) n = {}; n = setadd(n, $string_utils:uppercase(target.name)); if (target.magic_immunity) n = setadd(n, "[IMMUNE TO MAGIC]"); endif n = setadd(n, target.description); if (target.greedy) n = setadd(n, "(May pick up items.)"); else n = setadd(n, "(Does not pick up items.)"); endif st = "STR: " + floatstr(target.stats[2][1], 1) + " DEX: " + floatstr(target.stats[2][2], 1) + " INT: " + floatstr(target.stats[2][3], 1) + " HEA: " + floatstr(target.stats[2][4], 1) + " COM: " + floatstr(target.skills[2][1], 1); n = setadd(n, st); xph = "XP: " + tostr(target.exp) + " Hostility: " + tostr(target.hostility); n = setadd(n, xph); if (target.weapon_types == {}) n = setadd(n, "Weapons: N/A"); else n = setadd(n, tostr("Weapons: ", $string_utils:title_list(target.weapon_types))); endif if (target.natural_def == 0) n = setadd(n, "Natural Defense: Bite"); elseif (target.natural_def == 1) n = setadd(n, "Natural Defense: Claw"); elseif (target.natural_def == 3) n = setadd(n, "Natural Defense: Hand"); endif n = setadd(n, tostr("Treasure: ", floatstr(target.money[1][2], 1), " Gold")); if (!target.edible) n = setadd(n, "Not Edible"); else n = setadd(n, tostr("Edible | Eat Healing: ", floatstr(target.eat_heal, 1))); endif tm = "Rot Time: " + tostr(target.rot_time) + " sec. | Gestate Time: " + tostr(target.gestate) + " sec."; n = setadd(n, tm); player:tell_lines(n); player:tell(); target.learn = n; player:tell("[purple]Knowledge for ", $string_utils:nn(target), " has been set.[normal]"); elseif (parent(target) == $weapon) n = {}; n = setadd(n, $string_utils:uppercase(target.name)); if (target.shoots) n = setadd(n, "Ranged Weapon"); else n = setadd(n, "Melee Weapon"); endif n = setadd(n, target.description); if (target.shoots) n = setadd(n, tostr(target.ammo_type != #-1 ? ("Ammunition Type: " + target.ammo_type.name) | "[Infinite Ammunition]")); if (target.ammo_type != #-1) n = setadd(n, tostr("Maximum Load: ", tostr(target.max_load))); endif n = setadd(n, tostr("Projectile Damage: ", tostr(target.projectile_dam))); else n = setadd(n, tostr("Damage Base: ", tostr(target.damage_base))); endif n = setadd(n, tostr("Value: ", tostr(target.value_base))); if (target.can_stun && target.can_paralyse) n = setadd(n, "Can Stun | Can Paralyze"); elseif (target.can_stun && !target.can_paralyse) n = setadd(n, "Can Stun | Cannot Paralyze"); elseif (!target.can_stun && target.can_paralyse) n = setadd(n, "Cannot Stun | Can Paralyze"); elseif (!target.can_stun && !target.can_paralyse) n = setadd(n, "Cannot Stun | Cannot Paralyze"); endif player:tell_lines(n); player:tell(); target.learn = n; player:tell("[purple]Knowledge for ", $string_utils:nn(target), " has been set.[normal]"); elseif (parent(target) == $clothing) n = {}; n = setadd(n, $string_utils:uppercase(target.name)); n = setadd(n, target.description); n = setadd(n, tostr("Armor: ", tostr(target.armor))); n = setadd(n, tostr("Value: ", tostr(target.value_base))); n = setadd(n, tostr("Body Area: ", $string_utils:capitalize(target.body_area))); player:tell_lines(n); player:tell(); target.learn = n; player:tell("[purple]Knowledge for ", $string_utils:nn(target), " has been set.[normal]"); else return player:tell("Parent of argument must be $monster, $weapon, or $clothing."); endif . ;"End of Patch 001"