Hello guys!
Here is npc for change your sex!
go to data/npcs/scripts and create a lua file named change_sex.lua
1)NPC change your sex for premium days:
Config:
priceindays = number of days will be removed from the account to be exchanged sex
2)Change Sex per Money (gold, platinum, crystal coins...)
Config:
priceinmoney = price in gold pieces (ex: 30000 = 30k).
3)Change you sex per "x" Item
Config:
local itemtochange = id of "x" item
local counttochange = amount of "x" item to change
ITEMNAME = name of "x" item
Go to data/npcs and create a sex_changer.xml and place:
4)All in one:
Go to post: http://otland.net/f83/change-sex-per-items-premium-days-money-136936/#post1329126
READY!!
/s sex_changer
I know it's a simple NPCs, but many people may need it. If you help REP ++
Here is npc for change your sex!
go to data/npcs/scripts and create a lua file named change_sex.lua
1)NPC change your sex for premium days:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
[COLOR="#FF0000"]local priceindays = 3[/COLOR]
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'sex') or msgcontains(msg, 'change')) then
selfSay('I can change your sex per '..priceindays..' days of premium account! Do you want?', cid)
talkState[talkUser] = 40
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 40) then
if(getPlayerSex(cid) >= 2) then
selfSay('You cannot change your gender.', cid)
return
end
if(getPlayerPremiumDays(cid) < priceindays) then
selfSay('Sorry, not enough '..priceindays..' days of premium account.', cid)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return
end
if(getPlayerPremiumDays(cid) < 65535) then
doPlayerAddPremiumDays(cid, -priceindays)
end
doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
selfSay('You have changed your gender and lost '..priceindays..' days of premium time.', cid)
talkState[talkUser] = 0
doSendMagicEffect(getCreaturePosition(cid), 35)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Config:
priceindays = number of days will be removed from the account to be exchanged sex
2)Change Sex per Money (gold, platinum, crystal coins...)
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
[COLOR="#FF0000"]local priceinmoney = 30000[/COLOR]
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'change') or msgcontains(msg, 'sex')) then
selfSay('I can change your sex per '..priceinmoney..' gold pieces! Do you want?', cid)
talkState[talkUser] = 4
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
if(doPlayerRemoveMoney(cid, priceinmoney) == TRUE) then
doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
doSendMagicEffect(getCreaturePosition(cid), 35)
selfSay('You have changed your gender and lost '..priceinmoney..' days of premium time.', cid)
else
selfSay('Sorry, not enough '..priceinmoney..' gold pieces.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok then.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Config:
priceinmoney = price in gold pieces (ex: 30000 = 30k).
3)Change you sex per "x" Item
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
[COLOR="#FF0000"]local itemtochange = 9971[/COLOR]
[COLOR="#800080"]local counttochange = 10[/COLOR]
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'change') or msgcontains(msg, 'sex')) then
selfSay('I can change your sex per '..counttochange..' [COLOR="#00FFFF"][B]ITEMNAME[/B][/COLOR] gold pieces! Do you want?', cid)
talkState[talkUser] = 7
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 7) then
if(getPlayerItemCount(cid, itemtochange) >= counttochange) then
doPlayerRemoveItem(cid, itemtochange, counttochange)
doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
doSendMagicEffect(getCreaturePosition(cid), 35)
selfSay('You have changed your gender and lost '..counttochange..' [COLOR="#00FFFF"][B]ITEMNAME[/B][/COLOR].', cid)
else
selfSay('Sorry, not enough '..counttochange..' of [COLOR="#00FFFF"][B]ITEMNAME[/B][/COLOR].', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok then.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Config:
local itemtochange = id of "x" item
local counttochange = amount of "x" item to change
ITEMNAME = name of "x" item
Go to data/npcs and create a sex_changer.xml and place:
Code:
<?xml version="1.0"?>
<npc name="Lovely" script="data/npc/scripts/change_sex.lua" walkinterval="50000" floorchange="0">
<health now="100" max="100"/>
<look type="324" head="78" body="90" legs="0" feet="19" addons="1" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|.I {change} your sex!" />
</parameters>
</npc>
4)All in one:
Go to post: http://otland.net/f83/change-sex-per-items-premium-days-money-136936/#post1329126
READY!!
/s sex_changer
I know it's a simple NPCs, but many people may need it. If you help REP ++
Attachments
-
change.jpg75.7 KB · Views: 278 · VirusTotal
Last edited: