From e49dcbc1ac6c3a5c9f1721c727d75136f812bbec Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 1 May 2020 00:23:58 -0300 Subject: Equipment found in Kamelot belongs to guild. Also, weapons come with splash and armor with 10% elemental defense --- npc/042-5/ctrl.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'npc/042-5') 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!"); -- cgit v1.2.3-60-g2f50