Kaisus
Advanced User
- Joined
- Jan 21, 2012
- Messages
- 401
- Reaction score
- 25
Witam, przedstawi? wam jak doda? komend? !sex dzi?ki kt?rej mo?emy mie? dziecko.
Na pocz?tek tworzymy w folderze talkactions/scripts tworzymy plik pt. sex.lua
Wklejamy do niego ten tekst
Na pocz?tek tworzymy w folderze talkactions/scripts tworzymy plik pt. sex.lua
Wklejamy do niego ten tekst
Code:
local aidsCombat = createCombatObject()
local aidsCondition = createConditionObject(CONDITION_DROWN)
setConditionParam(aidsCondition, CONDITION_PARAM_DELAYED, 2)
addDamageCondition(aidsCondition, 10, 3000, -20)
setCombatCondition(aidsCombat, aidsCondition)
function onSay(cid, words, param)
local sex = {
limit = 30, -- co jaki czas mo?na 'robi?' sex
proposal = getPlayerStorageValue(cid, 30020),
accept = cid,
randomity = math.random(100),
effect = math.random(3),
child = 5,
aids = 80
}
local targetPos = getPlayerLookPos(cid)
targetPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local target = getThingfromPos(targetPos)
if isPlayer(target.uid) == TRUE then
local lookDir = FALSE
if getPlayerLookDir(target.uid) == getPlayerLookDir(cid)-2 then
lookDir = TRUE
elseif getPlayerLookDir(target.uid) == getPlayerLookDir(cid)+2 then
lookDir = TRUE
end
if lookDir == TRUE then
if getPlayerSex(target.uid) == getPlayerSex(cid) then
doPlayerSendCancel(cid, 'You cannot make sex with same gender as self, pervert!')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
else
if target.uid == sex.proposal then
if os.time(t) > getPlayerStorageValue(sex.proposal, 30021) and os.time(t) > getPlayerStorageValue(sex.accept, 30021) then
if getPlayerStorageValue(sex.proposal, 30022) > 0 or getPlayerStorageValue(sex.accept, 30022) > 0 then
doSendAnimatedText(getCreaturePosition(sex.proposal), 'Ahh, Ahh...', TEXTCOLOR_YELLOW)
doSendAnimatedText(getThingPos(sex.accept), 'Ohh, Ohh!', TEXTCOLOR_TEAL)
doSendMagicEffect(getPlayerPosition(sex.proposal),CONST_ME_STUN)
doSendMagicEffect(getPlayerPosition(sex.accept),CONST_ME_STUN)
setPlayerStorageValue(sex.proposal, 30022, 0)
setPlayerStorageValue(sex.accept, 30022, 0)
else
if sex.aids ~= 100 and sex.randomity >= sex.aids then
local returns = {
hurt = 'Sex without condoms brings consequences - You just got AIDS!\nYour sickness will hurt alot...',
partner = 'Sex without condoms brings consequences - Your partner just got AIDS!',
both = 'Sex without condoms brings consequences - You and Your partner just got AIDS!\nYour sickness will hurt alot...'
}
local aids = {
proposal = returns.both,
accept = returns.both,
player = FALSE
}
if sex.effect == 1 then
aids.proposal = returns.hurt
aids.accept = returns.partner
aids.player = sex.proposal
elseif sex.effect == 2 then
aids.proposal = returns.partner
aids.accept = returns.hurt
aids.player = sex.accept
end
doPlayerSendTextMessage(sex.proposal, MESSAGE_STATUS_WARNING, aids.proposal)
doPlayerSendTextMessage(sex.accept, MESSAGE_STATUS_WARNING, aids.accept)
if aids.player == FALSE then
doSendMagicEffect(getPlayerPosition(sex.proposal), CONST_ME_YELLOW_RINGS)
doSendMagicEffect(getPlayerPosition(sex.accept), CONST_ME_YELLOW_RINGS)
doCombat(0, aidsCombat, numberToVariant(sex.proposal))
doCombat(0, aidsCombat, numberToVariant(sex.accept))
else
doSendMagicEffect(getPlayerPosition(aids.player), CONST_ME_YELLOW_RINGS)
doCombat(0, aidsCombat, numberToVariant(aids.player))
end
elseif sex.randomity <= sex.child then
local child = {
mother = sex.proposal,
father = sex.accept,
motherMsg = '\nAs a good parent You spend whole Your gold for the child.',
fatherMsg = "",
payEr = sex.proposal
}
if getPlayerSex(sex.proposal) == 1 then
child.fatherMsg = child.motherMsg
child.payEr = child.father
child.mother = sex.accept
child.father = sex.proposal
child.motherMsg = ""
end
doPlayerSendTextMessage(child.father, MESSAGE_STATUS_WARNING, 'Sex without condoms brings consequences - '..getCreatureName(child.mother)..' just born a child!' .. child.fatherMsg)
doPlayerSendTextMessage(child.mother, MESSAGE_STATUS_WARNING, 'Sex without condoms brings consequences - You have just born a child!' .. child.motherMsg)
doSendMagicEffect(getPlayerPosition(child.father), CONST_ME_FIREWORK_YELLOW)
doSendMagicEffect(getPlayerPosition(child.mother), CONST_ME_FIREWORK_RED)
doPlayerRemoveMoney(child.payEr, getPlayerMoney(child.payEr))
local returns = {
item = doPlayerAddItem(child.mother, 6579, 1),
gender = "daughter"
}
if math.random(2) == 1 then
returns.gender = "son"
end
doSetItemSpecialDescription(returns.item, 'It is a '..returns.gender..' of '..getCreatureName(child.father)..' and '..getCreatureName(child.mother)..'.')
else
doSendAnimatedText(getCreaturePosition(sex.proposal), 'Ahh, Ahh...', TEXTCOLOR_YELLOW)
doSendMagicEffect(getPlayerPosition(sex.proposal),CONST_ME_STUN)
doSendAnimatedText(getThingPos(sex.accept), 'Ohh, Ohh!', TEXTCOLOR_TEAL)
doSendMagicEffect(getPlayerPosition(sex.accept),CONST_ME_STUN)
end
end
setPlayerStorageValue(sex.proposal, 30020, 0)
setPlayerStorageValue(sex.accept, 30020, 0)
setPlayerStorageValue(sex.proposal, 30021, (os.time(t) + sex.limit))
setPlayerStorageValue(sex.accept, 30021, (os.time(t) + sex.limit))
else
doPlayerSendCancel(cid, 'You can not have sex more than once per ' .. sex.limit.. ' seconds.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
if getPlayerStorageValue(target.uid, 30020) == cid then
doPlayerSendCancel(cid, 'You have already sent a sex proposal to '..getCreatureName(target.uid)..'.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
else
setPlayerStorageValue(target.uid, 30020, cid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have sent a sex proposal to '..getCreatureName(target.uid)..'.')
doPlayerSendTextMessage(target.uid, MESSAGE_INFO_DESCR, getCreatureName(cid)..' wants to have a sex with You.')
doSendMagicEffect(getPlayerPosition(target.uid), CONST_ME_HEARTS)
end
end
end
else
doPlayerSendCancel(cid, 'You must stand after your partner to have a sex.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, 'You may have sex only with players.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return FALSE
end
Nast?pnie w talkactions/talkactions.xm dodajemy tak? linijk? :
Code:
<talkaction words="!sex" script="sex.lua"/>
A w global.lua dodajemy co? takiego
Code:
function getPlayerLookPos(cid)
return getPosByDir(getThingPos(cid), getPlayerLookDir(cid))
end
function getPosByDir(basePos, dir)
local pos = basePos
if(dir == NORTH) then
pos.y = pos.y-1
elseif(dir == SOUTH) then
pos.y = pos.y + 1
elseif(dir == WEST) then
pos.x = pos.x-1
elseif(dir == EAST) then
pos.x = pos.x+1
elseif(dir == NORTHWEST) then
pos.y = pos.y-1
pos.x = pos.x-1
elseif(dir == NORTHEAST) then
pos.y = pos.y-1
pos.x = pos.x+1
elseif(dir == SOUTHWEST) then
pos.y = pos.y+1
pos.x = pos.x-1
elseif(dir == SOUTHEAST) then
pos.y = pos.y+1
pos.x = pos.x+1
end
return pos
end
function getPlayerMoney(cid)
return ((getPlayerItemCount(cid, ITEM_CRYSTAL_COIN) * 10000) + (getPlayerItemCount(cid, ITEM_PLATINUM_COIN) * 100) + getPlayerItemCount(cid, ITEM_GOLD_COIN))
end
I to tyle.
Skrypt dzia?a na wi?kszo?ci silnik?w.
Skrypt dzia?a na wi?kszo?ci silnik?w.
Kaisus