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

[GOOD IDEA] Undropable item and loot like in diablo ?

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello.
I have good idea and i need script for undropable item,

1) Untreadable/Dropable item
If you wanna trade/drop item (ID: 5495) or drop it says: "You cannot drop, trade this unique item." and you cannot trade/drop this item.

2) Loot like diablo.
If you play diablo you know what i mean, after killing monster, he will drop all of loot in ground (4 squares around corpse or etc.)

It's possible to make this script's ?
Thanks alot & repp++ if you make it.
 
I don't know if there is any function to prevent drop, but I guess you should equip it at a slot, so you can use onDeEquip.

LUA:
function onDeEquip(cid, item, slot)

	doPlayerSendCancel(cid,'You can\'t drop this unique item.')

return false

end

I guess that'll work.
 
I don't know if there is any function to prevent drop, but I guess you should equip it at a slot, so you can use onDeEquip.

LUA:
function onDeEquip(cid, item, slot)

	doPlayerSendCancel(cid,'You can\'t drop this unique item.')

return false

end

I guess that'll work.

That's messed up :p

LUA:
function onTradeAccept(cid, target, item, targetItem)
	if item.itemid == 5495 or targetItem.itemid == 5495 then
		doPlayerSendCancel(cid, "Sorry, you cannot trade this item.")
	end
end
 
Kk, not messed up.

LUA:
function onDeEquip(cid, item, slot)
	return doPlayerSendCancel(cid,'You can\'t drop this unique item.')
end

just link all items that are 'unique' items to this script.

Or make it that it sets a uniqueid to your unique items on your first login, and link the uniqueid to the script.
 
Kk, not messed up.

LUA:
function onDeEquip(cid, item, slot)
	return doPlayerSendCancel(cid,'You can\'t drop this unique item.')
end

just link all items that are 'unique' items to this script.

Or make it that it sets a uniqueid to your unique items on your first login, and link the uniqueid to the script.

Well, I doubt he knows how to make a list for it, so here it is.

LUA:
local uniqueitems = [xxxx, xxxx, xxxx, xxxx]--ID of items that cannot be dropped
function onDeEquip(cid, item, slot)
	if item.itemid == uniqueitems then
		doPlayerSendCancel(cid, "Sorry, you cannot drop this item.")
	end
end
 
tauku said:
local uniqueitems = [xxxx, xxxx, xxxx, xxxx]--ID of items that cannot be dropped
function onDeEquip(cid, item, slot)
if item.itemid == uniqueitems then
doPlayerSendCancel(cid, "Sorry, you cannot drop this item.")
end
end

Where to put that ? And in this script i didn't saw any Trade option. :/ I wanna untreadable and undropable in one script :/
 
Well, I doubt he knows how to make a list for it, so here it is.

LUA:
local uniqueitems = [xxxx, xxxx, xxxx, xxxx]--ID of items that cannot be dropped
function onDeEquip(cid, item, slot)
	if item.itemid == uniqueitems then
		doPlayerSendCancel(cid, "Sorry, you cannot drop this item.")
	end
end

You think I'm stupid? lol.

Dude, you can register the itemid's in movements.xml, no need to double check for the itemid.

And that script is really bad, lol.
 
Last edited:
You think I'm stupid? lol.

Dude, you can register the itemid's in movements.xml, no need to double check for the itemid.

And that script is really bad, lol.

Fine..

@Fresh

Man, you really are a retard.. Didn't you see the code I pasted for you above?

trade
LUA:
function onTradeAccept(cid, target, item, targetItem)
	if item.itemid == 5495 or targetItem.itemid == 5495 then
		doPlayerSendCancel(cid, "Sorry, you cannot trade this item.")
	end
end
 
Fine..

@Fresh

Man, you really are a retard.. Didn't you see the code I pasted for you above?

trade
LUA:
function onTradeAccept(cid, target, item, targetItem)
	if item.itemid == 5495 or targetItem.itemid == 5495 then
		doPlayerSendCancel(cid, "Sorry, you cannot trade this item.")
	end
end


he want this and undropable in the same script i think.. o.õ
 
Make an onKill event with a table of monsters you use in the server, add itemid's of what they drop and script which makes them drop it.
Maybe can do it monday or something since i'm too busy smoking weed and chillin' till sunday.
 

You cant have them both in 1 script since one is a movement and the other one is a creaturescript, jeez..

Make an onKill event with a table of monsters you use in the server, add itemid's of what they drop and script which makes them drop it.
Maybe can do it monday or something since i'm too busy smoking weed and chillin' till sunday.

Speaking of weed, I just went all the way out to Stockholm to buy some Super Lemon Haze, I bought 5g. We're propably going to get stoned tomorrow ;)
 
Last edited:
ok xD
LUA:
local function dropLoot(pos, v, cid)
	local corpse = getTileItemById(pos, v).uid
	if corpse > 0 and isContainer(corpse) then
		local n = getContainerSize(corpse)
		if n > 0 then
			local t, i = getArea(pos, 1, 1), 1
			while i <= #t do
				if queryTileAddThing(corpse, t[i]) ~= 1 then
					table.remove(t, i)
				else
					i = i + 1
				end
			end
			for i = 0, n-1 do
				local v = getContainerItem(corpse, 0)
				doRemoveItem(v.uid)
				doCreateItem(v.itemid, v.type, t[math.random(#t)])
			end
		end
	end
end

function onKill(cid, target, lastHit)
	if lastHit and isMonster(target) then
		local v = getMonsterInfo(getCreatureName(target)).lookCorpse
		if v > 0 then
			local master = getCreatureMaster(target)
			if not master or master == target then
				addEvent(dropLoot, 0, getThingPos(target), v,cid)
			end
		end
	end
	return true
end
weak weak :pwna? :/
 
aff, it doesn't drop from bags :p!

Where to add this script ? Creatureevents ?
And how define only Orc Warrior drops items after deaths on floor ? I want this scripts only for bosses (good idea for catch any item in raid with many people).
 
Last edited:
Back
Top