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

Skull Amulet (Aol That works when skulled)

Relicz

Programmer
Joined
Mar 18, 2010
Messages
18
Reaction score
4
Location
Australia
I need help please make this for me :D
ty...
I will rep++ even if it doesn't work because I am feeling nice :D
 
data/creaturescripts/scripts
Code:
local corpse_ids = {
	[0] = 3065, -- female
	[1] = 3058  -- male
}
function onPrepareDeath(cid, deathList)
	if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
               
		doCreatureSetDropLoot(cid, false)
               
		doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
		local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""		
		for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
			killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
		end
		doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
	end
	return true
end
data/creaturescripts/creaturescripts.xml
Code:
<event type="preparedeath" name="onPrepareDeath" event="script" value="rs.lua"/>
data/creaturescripts/scripts/login.lua
add this line one line up of return TRUE
Code:
	registerCreatureEvent(cid, "onPrepareDeath")
 
It works good for me, but it is unlimited, I don't want it to be unlimited. I tryed add

Code:
		doRemoveItem(item.uid, 1)

But then the player has 0 hp, no status bar or name and is invincible. He can still talk or attack players.
How do I fix this please !
 
Go to your items.xml file an add this
Code:
<attribute key="charges" value="1"/>
to you amulet ID.

Example:
Code:
	<item id="2196" article="a" name="red skull amulet">
		<attribute key="weight" value="420"/>
		[COLOR="Red"]<attribute key="charges" value="1"/>[/COLOR]
		<attribute key="slotType" value="necklace"/>
	</item>

I think it should work then
 
another way to do it is this

Data > Creaturescripts > Scripts

Rsamulet.lua
Lua:
  function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
                doSetCreatureDropLoot(cid, false)      
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		if getPlayerSlotItem(cid, 2).itemid == 2196 then
                doPlayerRemoveItem(cid, 2196, 1)
end  
        return true
        end

and
Data > CreatureScripts > CreatureScripts.xml

Lua:
<event type="preparedeath" name="onPrepareDeath" event="script" value="RsAmulet.lua"/>

Then in data > creaturescripts > scripts > login.lua add
Code:
registerCreatureEvent(cid, "onPrepareDeath")

just above this it will be at the bottom of the file.
Lua:
	return true
end


then in Data > Items > items.xml find item id "2196"

and override it with this

Lua:
<item id="2196" article="a" name="red skull amulet">
		<attribute key="description" value="This amulet will stop you from dropping equipment while having a red skull."/>
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="charges" value="1"/>
		<attribute key="preventDrop" value="1"/>
	</item>
 
Last edited:
@calum69
Doesn't work, I lose all my EQ and I still have the amulet. Using 0.3.6pl1
@SpO0KIe
Also doesn't work, I still have the amulet..

EDIT:

Code:
function onPrepareDeath(cid, deathList)
	if getCreatureSkullType(cid) < 5 and doPlayerRemoveItem(cid, 2196, 1) then
		doSetCreatureDropLoot(cid, false)
		doSendAnimatedText(getThingPos(cid), 'AOL Ownz', getCreatureSkullType(cid) == 4 and 180 or 215)
	end
	return true
end

Works !
 
Last edited:
ah i see my mistake it should be

Lua:
doSetCreatureDropLoot(cid, false)

i had

Lua:
doCreatureSetDropLoot(cid, false)

my previous post is fixed if you want to try it :)
 
Back
Top