• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[MOD] Red Skull Amulet

Status
Not open for further replies.

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
115
Please test this and post your comments.
Credits to Slawkens for original code and JDB for updating.

Mod:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Red Skull Amulet" version="1.0" author="--" contact="--" enabled="yes">
	<description><![CDATA[
		This amulet will protect anyone who wears it from loss of equipment.
	]]></description>

	<item id="2196" article="a" name="Red Skull Amulet" override="yes"/>

	<event type="login" name="RedSkullAmulet_Login" event="buffer"><![CDATA[
		registerCreatureEvent(cid, "RedSkullAmulet_Login")
	]]></event>

	<event type="death" name="RedSkullAmulet_Login" event="script"><![CDATA[
		function onDeath(cid, corpse, deathList)
			if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
				if (getCreatureSkullType(cid) == SKULL_RED) then
					doCreatureSetDropLoot(cid, false)
				end
			end
			return true
		end
	]]></event>
</mod>
 
Last edited:
Nice, but what is that doCreatureSetDropLoot for?
 
That function will determine whether (cid) drops loot or not.
 
Well, for me that bug it dosnt matter.

But.. the player loss lvl?

If the player loss lvl i will be happy :D
 
You can also add this for some extra feature.

Code:
function onLogin(cid)
	if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are protected by the amulet.")
		return true
	end
end
 
JDB, U Script Have The Bug Of Frag ?
If No Have, U Can Edit My Script ? ;)

Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
                doCreatureSetDropLoot(cid, false)       
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) 
        return true
        end
    end
    return true
end

Thx, Repp++ ;]
 
Frag is not counted if he's a red skull.
But if you want it in his deathlist you can add it with a query :)
 
JDB, U Script Have The Bug Of Frag ?
If No Have, U Can Edit My Script ? ;)

Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
                doCreatureSetDropLoot(cid, false)       
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) 
        return true
        end
    end
    return true
end

This mod shouldn't affect frags at all.
Have you tried it?
 
Frag is not counted if he's a red skull.
But if you want it in his deathlist you can add it with a query :)

More, If Player Kill Player Without RedSkull, The No Take Frag Too


JDB

How I Install The Mod ?
My Ot No Have Paste MOD.
 
If you use 0.3.5pl1 then you should have a mod folder.
 
More, If Player Kill Player Without RedSkull, The No Take Frag Too


JDB

How I Install The Mod ?
My Ot No Have Paste MOD.

Add a line that checks if the player has a red skull do JDb's code otherwise normal code for keeping stuff (dunno on top of my head)
 
I updated the first post, but I am not sure if that is correct.
Feel free to try it.
 
Debugger;
Code:
input:7: unexpected symbol near ':'
Replace : with <space>.
 
Alright, I think I fixed it. :thumbup:
 
Alright, I think I fixed it. :thumbup:
Do you need "return error" or just "error"?
Just "error" because you need to return true in the end, too.
Or you can do "return true, error("You did not have a red skull.")"

edit: xddddddddddddddddd
 
Just "error" because you need to return true in the end, too.
Or you can do "return true, error("You did not have a red skull.")"

Oh, okay. I just put error. :)
 
Status
Not open for further replies.
Back
Top