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

Request - This script is really hard for me

Memerto

PHP, JS, LUA, HTML...
Joined
Oct 18, 2009
Messages
131
Solutions
6
Reaction score
25
Hello guys. First of all, thanks for all the resources you post on these forums, you're helping me a lot.

Well, I need a script(creaturescript I guess) that scan the loot of monsters when they die, and if it detects any item that are in a configurable item list in the script, it sends an orange message saying "Epic" and the effect number 65, both of them in the corpse position. Is it possible? I tried hard for some hours and I just got headache.

Distro 0.3.6 (8.60) V5 - Crying Damson

I'll rep++ hard whoever helps me succesfully :p .

Thx for all!!
 
Not tested
Lua:
function scanContainer(uid, list, position) --function by Jano. Edited by me.
	for k = (getContainerSize(uid) - 1), 0, -1 do
		local tmp = getContainerItem(uid, k)
		if (isInArray(list, tmp.itemid)) then
			doSendAnimatedText(position, "Epic", TEXTCOLOR_ORANGE)
			doSendMagicEffect(position, 65)
			return true
		elseif isContainer(tmp.uid) then
			scanContainer(tmp.uid, list, position)
		end
	end
	return true
end

local list = {2195, 2472}

function onDeath(cid, corpse, deathList)
	if not isMonster(cid) then return true end
	return scanContainer(corpse.uid, list, getCreaturePosition(cid)
end
 
I guess I must add something like this to creaturescripts.xml:

PHP:
<event type="onDeath" name="scanContainer" event="script" value="blablabla.lua"/>

Allright?
 
XML:
<event type="death" name="ScanContainer" event="script" value="blablabla.lua"/>

And this to login.lua
Lua:
registerCreatureEvent(cid, "ScanContainer")
 
Thanks you a lot, but doesn't work. The server doesn't show any error, but the effect and the text don't appear.

Any idea?


-----

BUMP

- - - Updated - - -

Bump
 
Last edited:
Back
Top