From e1be7203f4c3366a9d278c9bb625a9c678c2ef24 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 14 Jun 2021 21:37:10 +0200 Subject: Add loot boxes --- plugins/sword/sword.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/sword/sword.c') diff --git a/plugins/sword/sword.c b/plugins/sword/sword.c index bac963f..31bb87a 100644 --- a/plugins/sword/sword.c +++ b/plugins/sword/sword.c @@ -4,6 +4,7 @@ #include "../movement/movement.h" #include "../inventory/inventory.h" #include "../recharge/recharge.h" +#include "../loot/loot.h" static bool use_broken_sword(struct itemstack *stack) { @@ -73,4 +74,11 @@ __attribute__((constructor)) static void init() .run_if_dead = false, .callback = &handle_e, }); + + register_loot((struct loot) { + .chance = 7, + .item = &sword, + .min = 1, + .max = 1, + }); } -- cgit v1.2.3