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

TalkAction Advanced Sex System

kilergui

New Member
Joined
Apr 20, 2010
Messages
40
Reaction score
0
Name: Advanced sex System
Version: 8.1
Type of Script: Talkaction
Tested Server: The Forgotten Server (TFS)
Credits (Author): 60% & 40% Elf Nostradamus
-------------------------------------------------- -------------------------

Features:
- Condoms (After using it, you have to have sex in the next five minutes. And of course only once. After having sex you have to "wear" other
- Now you have to stay behind the player you want to have sex
- The second player has to accept the offer of sex; D
- You have to have sex with players of different sexes of yourself
- After sex without a condom is 1 / 4 chance of a child, one quarter of catching AIDS, and 2 / 4 of a safe sex, normal
- AIDS can be obtained by the player who made the "proposal" for sex, at which agreed or two
- Obviously, the females to stop the child
- The father's name always appears first in the description of the child (more specifically - "I am little BLA2 son of BLA (<- Dad) from BlaBla!")
- The player who proposed the sex loses money in case of a child
- The proposal of sex is removed when another player calls you for sex
- AIDS takes ~ 200 HP

Let the codes:
-------------------------------------------------- -----------------------

1. Create a folder called sex.lua data/talkactions/scripts and insert:

Code:
local combat = createCombatObject()
local condition = createConditionObject(CONDITION_DROWN)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 20, 2000, -10)
setCombatCondition(combat, condition)

function onSay(cid, words, param)
sexProposal = getPlayerStorageValue(cid, 66600)
sexAccept = cid
noCondom = math.random(4)
aidsEffect = math.random(3)

	local playerPos = getCreaturePosition(cid)
	if getPlayerLookDir(cid) == 1 then 
		posDir = {x = playerPos.x + 1, y = playerPos.y, z = playerPos.z, stackpos = 253}
	elseif getPlayerLookDir(cid) == 2 then
		posDir = {x = playerPos.x, y = playerPos.y + 1, z = playerPos.z, stackpos = 253}
	elseif getPlayerLookDir(cid) == 3 then
		posDir = {x = playerPos.x - 1, y = playerPos.y, z = playerPos.z, stackpos = 253}
	else
		posDir = {x = playerPos.x, y = playerPos.y - 1, z = playerPos.z, stackpos = 253}
	end
	target = getThingfromPos(posDir)
	if isPlayer(target.uid) == TRUE then
		if getPlayerLookDir(target.uid) == getPlayerLookDir(cid)-2 then
			sameLookDir = TRUE
		elseif getPlayerLookDir(target.uid) == getPlayerLookDir(cid)+2 then
			sameLookDir = TRUE
		else
			sameLookDir = FALSE
		end
		if sameLookDir == 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 getPlayerGroupId(cid) > 3 and getPlayerGroupId(cid) >= getPlayerGroupId(target.uid) then
					sexProposal = cid
					sexAccept = target.uid
					allowSex = TRUE
				elseif target.uid == sexProposal then
					allowSex = TRUE
				else
					allowSex = FALSE
				end
				if allowSex == TRUE then
					if getPlayerStorageValue(sexProposal, 66660) > 0 or getPlayerStorageValue(sexAccept, 66660) > 0 then
						doSendAnimatedText(getCreaturePosition(sexProposal), 'Ahh, Ahh...', TEXTCOLOR_YELLOW)
						doSendMagicEffect(getPlayerPosition(sexProposal),CONST_ME_STUN)
						doSendAnimatedText(getThingPos(sexAccept), 'Ohh, Ohh!', TEXTCOLOR_TEAL)
						doSendMagicEffect(getPlayerPosition(sexAccept),CONST_ME_STUN)
						setPlayerStorageValue(sexProposal, 66660, 0)
						setPlayerStorageValue(sexAccept, 66660, 0)
					else
						if noCondom == 3 then
							hurtMessage = 'Sex without condoms brings consequences - You just got AIDS!\nYour sickness will hurt alot...'
							partnerMessage = 'Sex without condoms brings consequences - Your partner just got AIDS!'
							bothMessage = 'Sex without condoms brings consequences - You and Your partner just got AIDS!\nYour sickness will hurt alot...'
							if aidsEffect == 1 then
								proposalMessage = hurtMessage
								acceptMessage = partnerMessage
								hurtPlayer = sexProposal
							elseif aidsEffect == 2 then
								proposalMessage = partnerMessage
								acceptMessage = hurtMessage
								hurtPlayer = sexAccept
							else
								proposalMessage = bothMessage
								acceptMessage = bothMessage
								hurtPlayer = FALSE
							end
							doPlayerSendTextMessage(sexProposal, MESSAGE_STATUS_WARNING, proposalMessage)
							doPlayerSendTextMessage(sexAccept, MESSAGE_STATUS_WARNING, acceptMessage)
							if hurtPlayer == FALSE then
								doSendMagicEffect(getPlayerPosition(sexProposal),CONST_ME_YELLOW_RINGS)
								doCombat(0,combat,numberToVariant(sexProposal))
								doSendMagicEffect(getPlayerPosition(sexAccept),CONST_ME_YELLOW_RINGS)
								doCombat(0,combat,numberToVariant(sexAccept))
							else
								doSendMagicEffect(getPlayerPosition(hurtPlayer),CONST_ME_YELLOW_RINGS)
								doCombat(0,combat,numberToVariant(hurtPlayer))
							end
						elseif noCondom == 2 then
							payMessage = '\nAs a good parent You spend whole Your gold for the child.'
							if getPlayerSex(sexProposal) == 0 then
								childMother = sexProposal
								childFather = sexAccept
								motherMsg = payMessage
								fatherMsg = ""
							elseif getPlayerSex(sexProposal) == 1 then
								childMother = sexAccept
								childFather = sexProposal
								motherMsg = ""
								fatherMsg = payMessage
							else
								if getPlayerSex(sexAccept) == 0 then
									childMother = sexAccept
									childFather = sexProposal
									motherMsg = ""
									fatherMsg = payMessage
								else
									childMother = sexProposal
									childFather = sexAccept
									motherMsg = payMessage
									fatherMsg = ""
								end
							end
							[QUOTE]doPlayerSendTextMessage(childFather, MESSAGE_STATUS_WARNING, 'Sex without condoms brings consequences - '..getCreatureName(childMother)..' just born a child!' .. fatherMsg)
							doPlayerSendTextMessage(childMother, MESSAGE_STATUS_WARNING, 'Sex without condoms brings consequences - You have just born a child!' .. motherMsg)
							doSendMagicEffect(getPlayerPosition(childFather), CONST_ME_FIREWORK_YELLOW)
							doSendMagicEffect(getPlayerPosition(childMother), CONST_ME_FIREWORK_RED)
							if math.random(2) == 1 then
								childGender = "son"
							else
								childGender = "daughter"
							end
							doSetItemSpecialDescription(doPlayerAddItem(childMother,6579,1),'It is a '..childGender..' of '..getCreatureName(childFather)..' and '..getCreatureName(childMother)..'.')
							local gps = getPlayerItemCount(sexProposal, ITEM_GOLD)
							local pcs = getPlayerItemCount(sexProposal, ITEM_PLATINUM)
							local ccs = getPlayerItemCount(sexProposal, ITEM_CRYSTAL)
							if gps > 0 or pcs > 0 or ccs > 0 then
								doPlayerRemoveItem(sexProposal, ITEM_GOLD, gps)
								doPlayerRemoveItem(sexProposal, ITEM_PLATINUM, pcs)
								doPlayerRemoveItem(sexProposal, ITEM_CRYSTAL, ccs)
							end
						else
							doSendAnimatedText(getCreaturePosition(sexProposal), 'Ahh, Ahh...', TEXTCOLOR_YELLOW)
							doSendMagicEffect(getPlayerPosition(sexProposal),CONST_ME_STUN)
							doSendAnimatedText(getThingPos(sexAccept), 'Ohh, Ohh!', TEXTCOLOR_TEAL)
							doSendMagicEffect(getPlayerPosition(sexAccept),CONST_ME_STUN)
						end
					end
					setPlayerStorageValue(sexProposal, 66600, 0)
					setPlayerStorageValue(sexAccept, 66600, 0)
				else
					if getPlayerStorageValue(target.uid, 66600) == 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, 66600, cid)
						doPlayerSendTextMessage(cid, 22, 'You have sent a sex proposal to '..getCreatureName(target.uid)..'.')
						doPlayerSendTextMessage(target.uid, 22, 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 do sex.')
			doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, 'You may do sex only with players.')
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
	end
	doPlayerSendTextMessage(cid, 25, words)
	return FALSE
end

Save and close.


2. In the folder data/talkactions/talkactions.xml open the file and add:

Code:
<talkaction words="!sex" script="sex.lua"/>

Save and close.

3. Create a file called condom.lua folder data/actions/scripts and insert:

Code:
function onUse(cid, item, frompos, item2, topos)
	local time_for = getPlayerStorageValue(cid, 66660) + 300
	if (os.time() >= time_for) then
		setPlayerStorageValue(cid, 66660, os.time())
		doSendMagicEffect(topos,CONST_ME_GIFT_WRAPS)
		doPlayerSendTextMessage(cid, 22, 'You are now wearing a condom for next 5 minutes.')
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid, 'You are already safe for sex!')
	end
	return TRUE
end

Save and close.

4. In the folder data/actions, actions.xml open the file and add this line:

Code:
<action itemid="6527" script="condom.lua" />

Save and close.


5. In the folder data/items items.xml open the file and look for:

Code:
<item id="6527" article="a" name="christmas token" plural="christmas tokens">
		<attribute key="weight" value="5"/>
	</item>

And then replace with:

Code:
<item id="6527" article="a" name="condom" plural="condoms">
		<attribute key="weight" value="5"/>
		<attribute key="description" value="May be used for safe sex, last 5 minutes."/>
	</item>

Also look for this line:

Code:
<item id="6579" article="a" name="tibia doll">
		<attribute key="weight" value="750"/>
	</item>

And replace with:

Code:
<item id="6579" article="a" name="child">
		<attribute key="weight" value="5000"/>
	</item>

Save and close.
Test and post your opinions.
If you did everything correctly it should work without problems.

Rep++ :D
 
ow dude, this one rox:D i like it
but can u explain more about how to add it in the distro and how it exatly works ingame. i readed ur thread but i want more explaiment if possible:)

thanks in advance.
 
This will not work for 0.3.6pl1 nor will it work for 0.4 (I guess).
 
whats the advantage ?
plz put if the sex are done sussefully, both players win lot of hp and mana
 
Back
Top