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

Talkaction /i 2930 (You see a shield . It was made by GM Ivory)

ivory

New Member
Joined
Dec 28, 2009
Messages
13
Reaction score
0
Howdy ;)
I'm a pretty new scripter and member, I've been browsing this forum for ages, never had to make an acc but now I see that people around here are nice and I want to make some contacts.

And I really need an script for ITEM CREATION that will make something like :

/i Shield
And when you look at it it will show :
(You see a shield. It was made by GM Ivory)
can u help me out
very useful (my opinion)


question : can it be done to countables too?
 
Of course, its so simple [;

data/talkactions/scripts/createitem.lua

Change:
Code:
	if(ret ~= RETURNVALUE_NOERROR) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
		return true
	end

To:
Code:
	if(ret ~= RETURNVALUE_NOERROR) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
		return true
	else
		doItemSetAttribute(item, "description", "It was made by " .. getCreatureName(cid) .. ".")
	end
(TFS 0.3.6+ only)
 
If version < 0.3.6 use
Lua:
function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, 

MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end

	local t = string.explode

(param, ",")
	local ret = RETURNVALUE_NOERROR
	local tmp = getCreaturePosition(cid)

	local id = tonumber(t[1])
	

if(not id) then
		id = getItemIdByName(t[1])
		if(id == LUA_ERROR) then
			

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
			

return TRUE
		end
	end

	local amount = 100
	if(t[2]) then
		amount = t[2]
	end

	

local item = doCreateItemEx(id, amount)
	if(t[3] and getBooleanFromString(t[3]) == TRUE) then
		if(t[4] and 

getBooleanFromString(t[4]) == TRUE) then
			tmp = getPlayerLookPos(cid)
		end

		

ret = doTileAddItemEx(tmp, item)	
	else
		ret = doPlayerAddItemEx(cid, item)
	end

		

if(ret ~= RETURNVALUE_NOERROR) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
		return TRUE
	else
		doSetItemSpecialDescription(item, "It was made by " .. getCreatureName(cid) .. ".")
	end

	doSendMagicEffect(tmp, CONST_ME_MAGIC_RED)
	return TRUE
end

I had some trouble to addapt it, but thanks guys.
 
Back
Top