Xylio - 2008-05-20 16:17:21

Zaawansowany skrypt na sex, co potrafi?
- Możesz uprawiać sex tylko z płcią przeciwną
- Druga osoba musi zaakceptować 'propozycję' sexu
- W pełni konfigurowywalne wartości takie jak szansa na dziecko czy limit czasu (ze względu, iż ludzie tym wręcz spamują )
- Female zawsze 'rodzi' dziecko
- Należy stać przodem do siebie, aby wysłać propozycję, bądź 'zamoczyć' ()
- 3 różne efekty aids - dla gracza proponującego, dla gracza akceptującego lub dla obojga
- Dziecko może być synem lub córką
- Proponujący gracz traci wszystkie pieniądze w przypadku 'urodzenia się' dziecka
- Aids zabiera od 200 do 400 HP


Tworzymy plik talkactions/scripts/sex.lua i umieszczamy w nim:

Kod:

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, -- zakres szansy na dziecko (od 0 do 5 = 5)
		aids = 80 -- zakres szansy na aids (od 80 do 100 = 20)
	}

	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

Otwieramy talkactions/talkactions.xml i dodajemy linijkę:

Kod:

<talkaction words="!sex" script="sex.lua"/>
www.shahrukh-juhi.pun.pl www.dianne-forum.pun.pl www.robaki.pun.pl www.adapciak.pun.pl www.haxball.pun.pl