TFS 0.X Item for a specific player

warriorfrog

Member
Joined
Jul 29, 2015
Messages
255
Reaction score
20
How to give an item to a player with something like a attribute and only this player can have this item

I mean, when player try to trade send doPlayerSendCancel(cid, "You cant trade a UNIQUE item.")
Code:
???
lua_register(m_luaState, "getPlayerTradeState", LuaInterface::luaGetPlayerTradeState);
???
from https://github.com/Fir3element/3777/blob/master/src/luascript.cpp

On throw item

Code:
function onMoveItem(item, fromPosition, toPosition, cid)

    if item.itemid == UNIQUEID and toPosition.y == ONGAMESCREEN then

        doPlayerSendCancel(cid, "You cant throw a UNIQUE item.")

        return false

    end

    return true

end


When player dies: send the item to players depot

Code:
local player = ???
local item_id = ???
local count = ???

local town_id = 1

local chest = doCreateItemEx(2595)

doAddContainerItem(chest, item_id, count)

doPlayerSendMailByName(getPlayerNameByGUID(player), chest, town_id)


Is it possible?
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Joined
Mar 16, 2017
Messages
392
Reaction score
210
Location
London
You can not send articles with a virtual parent, you must create the article physically and then send it.
change:
Code:
doCreateItemEx(itemid[, count/subType])
to
Code:
doCreateItem(itemid[, type/count], pos)
some quick idea...
* create the container somewhere inaccessible map and manipulate the article in that way. but there are many methods to do this.
 
OP
warriorfrog

warriorfrog

Member
Joined
Jul 29, 2015
Messages
255
Reaction score
20
You can not send articles with a virtual parent, you must create the article physically and then send it.
change:
Code:
doCreateItemEx(itemid[, count/subType])
to
Code:
doCreateItem(itemid[, type/count], pos)
I don't undertand this sorry


some quick idea...
* create the container somewhere inaccessible map and manipulate the article in that way. but there are many methods to do this.
Just like Store Inbox?
It would be perfect, is that possible to do with an item like <item id="1990" article="a" name="present">?

 
Top