• 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!

doCreateCustomItem?? :D

Dominik ms

Member
Joined
Jan 20, 2010
Messages
424
Reaction score
6
What do you thing about this code?? :D

doCreateCustomItem(itemid, spriteid, moveable, pickable, weight, attributes)

Itemid - manual or automatic.


I will try To do this, but first i need To check how is reading items.otb and creating items.
 
moveable should be the same as for .dat
everything excluding id an attributes stored only in itemtype class can be done by creating item and changing attriutes

it should be possible, and not that hard if you know what you do, to make it completly new id(but client gonna receive the same id, so adding runes or potions like that wont work)
 
In
PHP:
void Items::parseItemNode(xmlNodePtr itemNode, uint32_t id)
PHP:
	if(id == 15000)
	{
		ItemType* iType = new ItemType();
		iType->id = id;

		if(readXMLString(itemNode, "newItem", strValue))
			iType->clientId = 105;

		items.addElement(iType, iType->id);
    }

This can create new item without items.otb!! :D


@edit
if(readXMLString(itemAttributesNode, "test", strValue))
iType->clientId = strValue;
why i got error??
items.cpp cannot convert `std::string' to `uint16_t' in assignment

-------------------------------------------------------------------------------------------------------------------------------
int32_t LuaScriptInterface::luaCustomItem(lua_State* L)
{
//doCreateCustomItem(cid)
uint32_t id = 15000;

ItemType* iType = new ItemType();
iType->id = id;
iType->clientId = 105;
items.addElement(iType, iType->id);

ScriptEnviroment* env = getEnv();
lua_pushnumber(L, 1);
return 1;
}
Then i got error with declate "items" in items.addElement(iType, iType->id);
 
Last edited:
Back
Top