diff --git a/code/modules/events/wizard/rpgloot.dm b/code/modules/events/wizard/rpgloot.dm
index d9ad09ab906..636395194f7 100644
--- a/code/modules/events/wizard/rpgloot.dm
+++ b/code/modules/events/wizard/rpgloot.dm
@@ -9,11 +9,13 @@
var/list/prefixespositive = list("greater", "major", "blessed", "superior", "enpowered", "honed", "true", "glorious", "robust")
var/list/prefixesnegative = list("lesser", "minor", "blighted", "inferior", "enfeebled", "rusted", "unsteady", "tragic", "gimped")
var/list/suffixes = list("orc slaying", "elf slaying", "corgi slaying", "strength", "dexterity", "constitution", "intelligence", "wisdom", "charisma", "the forest", "the hills", "the plains", "the sea", "the sun", "the moon", "the void", "the world", "the fool", "many secrets", "many tales", "many colors", "rending", "sundering", "the night", "the day")
-
+ var/upgrade_scroll_chance = 0
for(var/obj/item/I in world)
if(istype(I,/obj/item/organ/))
continue
- var/quality = rand(-5,5)
+ var/quality = pick(1;15, 2;14, 2;13, 2;12, 3;11, 3;10, 3;9, 4;8, 4;7, 4;6, 5;5, 5;4, 5;3, 6;2, 6;1, 6;0)
+ if(prob(50))
+ quality = -quality
if(quality > 0)
I.name = "[pick(prefixespositive)] [I.name] of [pick(suffixes)] +[quality]"
else if(quality < 0)
@@ -21,7 +23,38 @@
else
I.name = "[I.name] of [pick(suffixes)]"
- I.force += quality
- I.force = max(0,I.force)
- I.throwforce += quality
- I.throwforce = max(0,I.throwforce)
\ No newline at end of file
+ I.force = max(0,I.force + quality)
+ I.throwforce = max(0,I.throwforce + quality)
+ I.armor += quality
+
+ if(istype(I,/obj/item/weapon/storage))
+ var/obj/item/weapon/storage/S = I
+ if(prob(upgrade_scroll_chance) && S.contents.len < S.storage_slots)
+ var/obj/item/upgradescroll/scroll = new
+ S.handle_item_insertion(scroll,1)
+ upgrade_scroll_chance = max(0,upgrade_scroll_chance-100)
+ upgrade_scroll_chance += 25
+
+/obj/item/upgradescroll
+ name = "Item Fortification Scroll"
+ desc = "Somehow, this piece of paper can be applied to items to make them \"better\". Apparently there's a risk of losing the item if it's already \"too good\". This all feels so arbitrary..."
+ icon = 'icons/obj/wizard.dmi'
+ icon_state = "scroll"
+ w_class = 1
+
+/obj/item/upgradescroll/afterattack(obj/item/target, mob/user , proximity)
+ if(!proximity || !istype(target))
+ return
+ var/quality = target.force - initial(target.force)
+ if(quality > 9 && prob((quality - 9)*10))
+ user << "[target] catches fire!"
+ if(target.burn_state == -1)
+ target.burn_state = 0
+ target.fire_act()
+ qdel(src)
+ return
+ target.force += 1
+ target.throwforce += 1
+ target.armor += 1
+ user << "[target] glows blue and seems vaguely \"better\"!"
+ qdel(src)
\ No newline at end of file