function onCastSpell(cid, item, fromPosition, itemEx, toPosition)
if( getPlayerSex(cid) == 0 )then
doPlayerSetSex(cid, 1)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
else
if( getPlayerSex(cid) == 1 ) then
doPlayerSetSex(cid, 0)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
end
return true
end
end
in items.xml<rune name="Sex Rune" id="2267" allowfaruse="1" charges="1" lvl="20" maglv="3" exhaustion="10000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="adress of lua file"/>
change to<item id="2267" article="a" name="spell rune">
<attribute key="weight" value="120" />
<item id="2267" article="a" name="sex rune">
<attribute key="weight" value="120" />
Would be cool to have a doll wich removes any skull on use, but disappears after use.
I also would need a doll that reset your frags, it should reset both black skull and red skull to 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray({SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) then
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerAccountId(cid) .. ")")
doCreatureSetSkullType(cid, SKULL_NONE)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Hermes" contact="otland.net" enabled="yes">
<action itemid="9969" event="script"><![CDATA[
local noRemove = {SKULL_WHITE, SKULL_YELLOW}
local playerSkull = getPlayerSkullType(cid)
if isInArray(noRemove, playerSkull) then
doPlayerSendCancel(cid, "You can't remove this type of skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
elseif playerSkull == SKULL_NONE then
doPlayerSendCancel(cid, "You don't have skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
doCreatureSetSkullType(cid,0)
doPlayerSetSkullEnd(cid, 0, playerSkull)
doRemoveItem(item.uid, 1)
end
return true
]]></action>
</mod>
How to install a mod? Just place in in the mod folder or what?