diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-05-01 00:23:58 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-05-01 00:23:58 -0300 |
commit | e49dcbc1ac6c3a5c9f1721c727d75136f812bbec (patch) | |
tree | ab9b2d63079907a3d84b6bb88d0120501067db43 /npc/042-5 | |
parent | 05e6280646b3857d1658af738fc4521e8b4d573a (diff) | |
download | serverdata-e49dcbc1ac6c3a5c9f1721c727d75136f812bbec.tar.gz serverdata-e49dcbc1ac6c3a5c9f1721c727d75136f812bbec.tar.bz2 serverdata-e49dcbc1ac6c3a5c9f1721c727d75136f812bbec.tar.xz serverdata-e49dcbc1ac6c3a5c9f1721c727d75136f812bbec.zip |
Equipment found in Kamelot belongs to guild.
Also, weapons come with splash and armor with 10% elemental defense
Diffstat (limited to 'npc/042-5')
-rw-r--r-- | npc/042-5/ctrl.txt | 17 |
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!"); |