summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/042-5/ctrl.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/npc/042-5/ctrl.txt b/npc/042-5/ctrl.txt
index c8ef7c836..4c8ff01be 100644
--- a/npc/042-5/ctrl.txt
+++ b/npc/042-5/ctrl.txt
@@ -155,7 +155,22 @@ function script KamelotTreasure {
mesc l("You find @@ inside!", getitemlink(.@loot));
// TODO: If itemtype == Armor/Weapon, make it guild bound and put bonus
- getitem .@loot, 1;
+ .@t=getiteminfo(.@loot, ITEMINFO_TYPE);
+ if (.@t == IT_WEAPON) {
+ getitembound .@loot, 1, 2;
+ delinventorylist(); // Needed, because we'll rely on rfind()
+ getinventorylist();
+ .@index=array_rfind(@inventorylist_id, .@loot);
+ setitemoptionbyindex(.@index, 0, IOPT_SPLASHDAMAGE, 1);
+ } else if (.@t == IT_ARMOR) {
+ getitembound .@loot, 1, 2;
+ delinventorylist(); // Needed, because we'll rely on rfind()
+ getinventorylist();
+ .@index=array_rfind(@inventorylist_id, .@loot);
+ setitemoptionbyindex(.@index, 0, ATTR_TOLERACE_ALL, 10);
+ } else {
+ getitem .@loot, 1;
+ }
} else {
mesc l("You find @@ inside!", l("nothing"));
mesc l("Seems like someone else opened this chest before you!");