Feature Quiver [TFS 1.X + 0.X]

kor

PHP ziom
Premium User
Joined
Jul 12, 2008
Messages
86
Reaction score
53
Location
Bialystok, Poland
Hello. Inspired @xydius solution I've created possibility to make use for quivers for both TFS (1.X based on otland/forgottenserver (https://github.com/otland/forgottenserver) and 0.X on Fir3element/3777 (https://github.com/Fir3element/3777)).

I won't post what to change in what line, instead here you have GitHub branches:
My solution will require creating an item which have name set to Quiver:
- TFS 1.X
Lua:
local item = Game.createItem(11241, 1) -- example ID, in my case Expedition Backpack
item:setAttribute(ITEM_ATTRIBUTE_NAME, 'Quiver')
item:setAttribute(ITEM_ATTRIBUTE_ARTICLE, 'a') -- in my case Expedition Backpack have prefix "an", so I'm changing it here
player:addItemEx(item)
- TFS 0.X
Lua:
local item = doCreateItemEx(11241, 1)
doItemSetAttribute(item, 'name', 'Quiver')
doItemSetAttribute(item, 'article', 'a')
doPlayerAddItemEx(cid, item)
Created Quiver will:
  • not allow to put inside otems other than ammo (container.cpp part)
  • have max items amount set to 4 both in "look at" and "put into" (container.h, item.cpp and protocolgame.cpp part); if you don't want to set max amout, just skip that changes
  • get first matching ammo item from Quiver in arrow slot
  • allow in newer versions to put Quiver in arrow slot without enabling CLASSIC_EQUIPMENT_SLOTS option
Hope you enjoy :)
 
Top