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

CreatureEvent Forever-Skull amulet <count Frags>

SpiderOT

™ツʂριԃҽɾσƚ➽ ٩(•‿•)۶★彡
Joined
Sep 29, 2008
Messages
1,062
Solutions
9
Reaction score
289
Location
Egypt/cairo
Hi all :]
today i decide to share with you my
- forever amulet of loss
- forever red/black skull amulet
yes there is like 100 thread about forever /skull amulet xD
but what make them different ?
both will count frags
tested on tfs 3.5 pl1 and should work on 3.6
~note
this script for some reason wont work on all amulet but it work perfect on the 2 amulet in script
we will use item id :2198 for forever amulet and item id :2131 for skull amulet
now open data/item/item.xml
search for item id :2198
and change it to this
Code:
	<item id="2198" article="an" name="Forever amulet">
		<attribute key="weight" value="660"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="charges" value="2"/>
		<attribute key="preventDrop" value="1"/>
	</item>
and search item id :2131
and change it to this
Code:
	<item id="2131" article="a" name="Skull Amulet">
		<attribute key="weight" value="660"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="charges" value="2"/>
		<attribute key="preventDrop" value="1"/>
	</item>
now open data/creaturescripts/script/login.lua
and add this
Lua:
	registerCreatureEvent(cid, "forever amulet")
	registerCreatureEvent(cid, "skull amulet")
	registerCreatureEvent(cid, "charge amulet")
then open data/creaturescripts/creaturescripts.xml
and add this
Code:
	<event type="preparedeath" name="forever amulet" event="script" value="forever amulet.lua"/>	
	<event type="preparedeath" name="skull amulet" event="script" value="skull amulet.lua"/>
	<event type="preparedeath" name="charge amulet" event="script" value="charge amulet.lua"/>
now time for the script :p
in data\creaturescripts\scripts create forever amulet.lua
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2198) then 
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doCreatureSay(cid, "Forever Amulet!", TALKTYPE_ORANGE_1)
	elseif (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2131) and (getCreatureSkullType(cid)  < 4) then 
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doCreatureSay(cid, "Skull Amulet!", TALKTYPE_ORANGE_1)
		
	end
	return true
	end
and skull amulet.lua
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (getCreatureSkullType(cid)  >= 4) then
	if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2131) then
		doCreatureSetDropLoot(cid, false)      
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doCreatureSay(cid, "Skull Amulet!", TALKTYPE_ORANGE_1)
	end
	return true
	end
	return true
	end
and last script to make the amulets infinite
charge amulet.lua
Lua:
  function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
  local amulet = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
        if ((getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2131) or (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2198)) then
			doChangeTypeItem(amulet.uid, amulet.type+1)    
                doSendMagicEffect(getCreaturePosition(cid), 39)
 	end
	return true
	end
now we are done :thumbup:
any error or problem post it
hope you guys like it :)
 
Last edited:
Man, i test this script and work 99%, i use with 2 charges, and i dont use the "charge script" and never spend charges, it never desaper.

I like to use this on vip shop but, this nedd end.

but great job man.

meybe "(amulet.uid, amulet.type-1)" ?
 
Code:
amulet.uid, amulet.type+1
to add 1 charge to amulet when player die is my ot when they die the amulet loss 1 charge
that is why i add this
hope you like it :]
 
only if you heave a skull the amulet dont loss charge, becouse it is like a pvp arena system you go to temple before die, but if u use with a non skull player it work like an aol.
 
that is why i add the charge amulet.lua
to make it infinite
 
WOW cool man...
OFF-- I played your OT a long time a ago... Really cool!
You put this feature on the Spider OT?
 
yes it is the same one i use in spiderot
 
Is 2 Amulet, One For Aol Forever And Other For Skull Amulet?

You Can Make One Amulet Forever And Skull. I Have One More No Count Frag ;S

Here The Code, If You Can Help Me ;S

items.xml

<item id="2196" article="a" name="aol vip">
<attribute key="weight" value="420"/>
<attribute key="slotType" value="necklace"/>
</item>

creaturescripts.xml

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

preparedeath.lua

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (isPlayer(cid) == TRUE) then
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
if not(getPlayerBlessing(cid, bless)) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
doCreatureSetDropLoot(cid, FALSE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
end
end
end
end
return TRUE
end

THANKS :peace:
 
I dont belive thats possible make this amulet count frags for red skuls, becouse if you are red skul the script teleport u to temple before u die like pvp-zone, when u die with this , skul, no dead body.

And if u skul the amulet dont loss charge i heave to make a little change to loss
doChangeTypeItem(amulet.uid, amulet.type-1) "type+1" to "type-1" in charge script
 
lol it suppose to be forever amulet
if you are rs/bs and used the forever amulet you will drop it if you died
and usually if you killed rs/bs you never get frag
 
lol it suppose to be forever amulet
if you are rs/bs and used the forever amulet you will drop it if you died
and usually if you killed rs/bs you never get frag

Yes u dont get frag, but its dont registry in site for exemply ,Red skul killed by Noob , and u dont heave a dead body, and i am talking about skul amulet, the onbly way that i found to add charge was using your charge.lua and changing "amulet.uid, amulet.type-1". becouse in the reality the skull player dont die, he go to temple before die like in pvp-zone, so the charge can't be removed with out "amulet.uid, amulet.type+1" =s
 
the skull amulet not work
foreveraol work
charge amulet work

can any one give me skull amulet work :(
 
Is 2 Amulet, One For Aol Forever And Other For Skull Amulet?

You Can Make One Amulet Forever And Skull. I Have One More No Count Frag ;S

Here The Code, If You Can Help Me ;S

items.xml

<item id="2196" article="a" name="aol vip">
<attribute key="weight" value="420"/>
<attribute key="slotType" value="necklace"/>
</item>

creaturescripts.xml

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

preparedeath.lua

local bless = {1, 2, 3, 4, 5}
local amulet = 2196

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (isPlayer(cid) == TRUE) then
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == amulet) then
if not(getPlayerBlessing(cid, bless)) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
if (getCreatureSkullType(cid) == SKULL_RED or SKULL_BLACK) then
doCreatureSetDropLoot(cid, FALSE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
end
end
end
end
return TRUE
end

THANKS :peace:


Lawl, seen one of these threads before like you mentioned but.. Good work! :D
 
do it work for 0.4?
i used skull aol dint work my char got 0hp and still be atack abel...
 
Last edited:
both work on 3.5 pl1 and 0.4 and should work with 3.6
 
hey bro the forever amulet is still droping my backpack and i know i put in every thing exactly right because the amulet doesnt dissapear
can you please help me!
 
Back
Top