Well As The Title Say, ill Release Some Funny/Util Things That You can Do With the onEquip/onDeEquip Functions.
-Teleport Amulet.
Function: When You Put This Amulet in Your Neck, This Will Save Your Current Pos And Teleport You To a Pos That you Configure in The Script, When you take off The
Amulet from your Neck it Will Teleport you back to the old pos.
Create a new File in movements/scripts called tpamulet.lua inside put this.
-Vocation Amulet.
Function: When You Put This Amulet in Your Neck, This Will Save Your Current Vocation and Change it to a new voc that you configure in the script,When you take off The
Amulet from your Neck it Will change your vocation to your old vocation.
Create a new File in movements/scripts called vocamulet.lua inside put this.
-Light Amulet.(simple)
Function: When You Put This Amulet in Your Neck, This Will increase your light,when you take off it will turn off the light.
Create a new File in movements/scripts called lightamulet.lua inside put this.
-Funny Boh.
Function: Funny Mesages and efects When put it on and when take it off.
Goto movements/scripts and Change your current boh.lua for this.
-Tranformation Boots.
Function: When You put it on This will save Your outfit and change your outfit to a item that you configure in the script, when you take it off it will return your outfit.
Create a new File in movements/scripts called transboots.lua inside put this.
-Skiller Helmet.
Function: When You put it on you will gain an skill of sword, when you take it off you will gain an skill of axe.(If someone need it ill add a configuration later, lol)
Create a new File in movements/scripts called skillhelmet.lua inside put this.
ok now go to movements.xml and add this lines.
and change this line:
for this:
Note: The Scripts Just are Some Examples That All You can do With That Functions.
Note: You Can Change slot="feet", to Feet,legs,armor,head,necklace,ring.
-Teleport Amulet.
Function: When You Put This Amulet in Your Neck, This Will Save Your Current Pos And Teleport You To a Pos That you Configure in The Script, When you take off The
Amulet from your Neck it Will Teleport you back to the old pos.
Create a new File in movements/scripts called tpamulet.lua inside put this.
Code:
local storage = 1800------change this to the storage where your back pos will save, example if you set it to 1800 make you sure you have not used
tha storages 1800, 1801, 1802.
local npos = {x=1000, y=1000, z=7} -----Where the Amulet Teleport you.
---------------------------------------End Config-------------------------------------------------------------------------------------
function onEquip(cid, item, slot)
setPlayerStorageValue(cid, storage, getPlayerPosition(cid).x)
setPlayerStorageValue(cid, storage+1, getPlayerPosition(cid).y)
setPlayerStorageValue(cid, storage+2, getPlayerPosition(cid).z)
doTeleportThing(cid,npos)
doSendMagicEffect(npos, 10)
end
function onDeEquip(cid, item, slot)
initial = { x = getPlayerStorageValue(cid, storage), y = getPlayerStorageValue(cid, storage+1), z = getPlayerStorageValue(cid, storage+2) }
doTeleportThing(cid,initial)
doSendMagicEffect(initial, 10)
end
-Vocation Amulet.
Function: When You Put This Amulet in Your Neck, This Will Save Your Current Vocation and Change it to a new voc that you configure in the script,When you take off The
Amulet from your Neck it Will change your vocation to your old vocation.
Create a new File in movements/scripts called vocamulet.lua inside put this.
Code:
local storage = 18009 ----Where Your initial voc will save.
local nvoc = 5 ---The new Voc.(From 0 to 8, if you have more voc you can put their id here)
-------------------------------------End Config---------------------------------
function onEquip(cid, item, slot)
setPlayerStorageValue(cid, storage, getPlayerVocation(cid))
doPlayerSetVocation(cid,nvoc)
end
function onDeEquip(cid, item, slot)
old = getPlayerStorageValue(cid, storage)
doPlayerSetVocation(cid,old)
end
-Light Amulet.(simple)
Function: When You Put This Amulet in Your Neck, This Will increase your light,when you take off it will turn off the light.
Create a new File in movements/scripts called lightamulet.lua inside put this.
Code:
function onEquip(cid, item, slot)
doSetCreatureLight(cid, 9, 65, 10*60*1000)
end
function onDeEquip(cid, item, slot)
doSetCreatureLight(cid, 7, 215, 1*1000)
end
-Funny Boh.
Function: Funny Mesages and efects When put it on and when take it off.
Goto movements/scripts and Change your current boh.lua for this.
Code:
function onEquip(cid, item, slot)
local pos = getPlayerPosition(cid)
doSendMagicEffect(pos, 14)
doSendAnimatedText(pos, "Boh In", 65)
end
function onDeEquip(cid, item, slot)
local pos = getPlayerPosition(cid)
doSendMagicEffect(pos, 13)
doSendAnimatedText(pos, "Boh Out", 65)
end
Function: When You put it on This will save Your outfit and change your outfit to a item that you configure in the script, when you take it off it will return your outfit.
Create a new File in movements/scripts called transboots.lua inside put this.
Code:
local storage = 1800 ---change this to the storage where your outfit will save, example if you set it to 1800 make you sure you have not used tha storages 1800, 1801, 1802, 1803, 1804, 1805.
local tran = 5080----change it to the item that you will get transformed.
---------------------------------------End Config-------------------------------------------------------------------------------------
function onEquip(cid, item, slot)
setPlayerStorageValue(cid, storage, getCreatureOutfit(cid).lookType)
setPlayerStorageValue(cid, storage+1, getCreatureOutfit(cid).lookHead)
setPlayerStorageValue(cid, storage+2, getCreatureOutfit(cid).lookBody)
setPlayerStorageValue(cid, storage+3, getCreatureOutfit(cid).lookLegs)
setPlayerStorageValue(cid, storage+4, getCreatureOutfit(cid).lookFeet)
setPlayerStorageValue(cid, storage+5, getCreatureOutfit(cid).lookAddons)
doSetItemOutfit(cid, tran, 300000)
end
function onDeEquip(cid, item, slot)
standardoutfit = { lookType = getPlayerStorageValue(cid, storage), lookHead = getPlayerStorageValue(cid, storage+1), lookBody = getPlayerStorageValue(cid, storage+2), lookLegs = getPlayerStorageValue(cid, storage+3), lookFeet = getPlayerStorageValue(cid, storage+4), lookAddons = getPlayerStorageValue(cid, storage+5) }
doSetCreatureOutfit(cid, standardoutfit, 1)
end
-Skiller Helmet.
Function: When You put it on you will gain an skill of sword, when you take it off you will gain an skill of axe.(If someone need it ill add a configuration later, lol)
Create a new File in movements/scripts called skillhelmet.lua inside put this.
Code:
function onEquip(cid, item, slot)
local pos = getPlayerPosition(cid)
doPlayerAddSkillTry(cid,2,1)
doSendMagicEffect(pos, 14)
end
function onDeEquip(cid, item, slot)
local pos = getPlayerPosition(cid)
doPlayerAddSkillTry(cid,3,1)
doSendMagicEffect(pos, 14)
end
ok now go to movements.xml and add this lines.
Code:
<movevent event="Equip" itemid="7459" slot="head" function="onEquipItem" script="skillhelmet.lua" />
<movevent event="DeEquip" itemid="7459" slot="head" function="onDeEquipItem" script="skillhelmet.lua" />
<movevent event="Equip" itemid="2131" slot="necklace" function="onEquipItem" script="vocamulet.lua" />
<movevent event="DeEquip" itemid="2131" slot="necklace" function="onDeEquipItem" script="vocamulet.lua" />
<movevent event="Equip" itemid="2136" slot="necklace" function="onEquipItem" script="lightamulet.lua" />
<movevent event="DeEquip" itemid="2136" slot="necklace" function="onDeEquipItem" script="lightamulet.lua" />
<movevent event="Equip" itemid="7457" slot="feet" function="onEquipItem" script="transboots.lua" />
<movevent event="DeEquip" itemid="7457" slot="feet" function="onDeEquipItem" script="transboots.lua" />
<movevent event="Equip" itemid="2130" slot="necklace" function="onEquipItem" script="tptamulet.lua" />
<movevent event="DeEquip" itemid="2130" slot="necklace" function="onDeEquipItem" script="tpamulet.lua" />
Code:
<movevent event="Equip" itemid="2195" slot="feet" function="onEquipItem" />
<movevent event="DeEquip" itemid="2195" slot="feet" function="onDeEquipItem" />
Code:
<movevent event="Equip" itemid="2195" slot="feet" function="onEquipItem" script="boh.lua" />
<movevent event="DeEquip" itemid="2195" slot="feet" function="onDeEquipItem" script="boh.lua" />
Note: The Scripts Just are Some Examples That All You can do With That Functions.
Note: You Can Change slot="feet", to Feet,legs,armor,head,necklace,ring.