• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.2] Add item in locker

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hello everyone, which files at sources I suppost edit to add a new item in locker and when do you click on this item do you be teletransported to a position?

Check the image below where it suppost to be.
A-9ItNu5H.png


Thanks.
 
At player.cpp
Code:
DepotLocker* depotLocker = new DepotLocker(ITEM_LOCKER1);
   depotLocker->setDepotId(depotId);
   depotLocker->internalAddThing(Item::CreateItem(ITEM_MARKET));
   depotLocker->internalAddThing(inbox);
   depotLocker->internalAddThing(ITEM'S ID);
   depotLocker->internalAddThing(getDepotChest(depotId, true));
   depotLockerMap[depotId] = depotLocker;

and at depotlocker.cpp
Code:
DepotLocker::DepotLocker(uint16_t _type) :
   Container(_type)
{
   depotId = 0;
   maxSize = 5;
}

Correct, @Ninja ?
 
Ops, sorry.. You have to use Item::CreateItem.
Code:
depotLocker->internalAddThing(Item::CreateItem(2195));

-- Too slow :p
 
Fixed it in lua.

Code:
if item.itemid == 2195 then
   self:sendCancelMessage('You cannot move this object.')
   return false
end
 
Back
Top