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

NPC Marriage System for TFS 0.3.5

Yea obviously? What is more similar to 0.3.6? 0.3.5 or 0.3.4? <_<
 
haha, Well, is it possible to make that Players that are married cant changesex through a command and you can see ingame "He/She is married with xxx"?
 
Players that are married cant changesex through a command
Edit your mods/changender_command.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Change gender command" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<description>
		This mod will add new command for players - !changender.
		Players will be able to change gender, cost can be configured.
	</description>

	<config name="changender_config"><![CDATA[
		config = {
			costPremiumDays = 3
		}
	]]></config>
	<talkaction words="!changender" event="buffer"><![CDATA[
		domodlib('changender_config')
[B][COLOR="red"]		if getPlayerMarriage(getPlayerGUID(cid)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender while you are married.")
			return
		end[/COLOR][/B]

		if(getPlayerSex(cid) >= 2) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
			return
		end

		if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time - changing gender costs " .. config.costPremiumDays .. " premium days.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			return
		end

		if(getPlayerPremiumDays(cid) < 65535) then
			doPlayerAddPremiumDays(cid, -config.costPremiumDays)
		end

		doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	]]></talkaction>
</mod>
you can see ingame "He/She is married with xxx"?
Code:
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		local k = getPlayerMarriage(getPlayerGUID(thing.uid))
		if k then
			doPlayerSetSpecialDescription(thing.uid,'. ' .. (thing.uid == cid and 'You are' or (getPlayerSex(thing.uid) == 0 and 'She' or 'He') .. ' is') .. ' married to ' .. getPlayerNameByGUID(k))
		end
	end
	return true
end
 
Code:
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		local k = getPlayerMarriage(getPlayerGUID(thing.uid))
		if k then
			doPlayerSetSpecialDescription(thing.uid,'. ' .. (thing.uid == cid and 'You are' or (getPlayerSex(thing.uid) == 0 and 'She' or 'He') .. ' is') .. ' married to ' .. getPlayerNameByGUID(k))
		end
	end
	return true
end

Where to put this?
 
@Sweddy

Code:
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
local k = getPlayerMarriage(getPlayerGUID(thing.uid))
if k then
doPlayerSetSpecialDescription(thing.uid,'. ' .. (thing.uid == cid and 'You are' or (getPlayerSex(thing.uid) == 0 and 'She' or 'He') .. ' is') .. ' married to ' .. getPlayerNameByGUID(k))
end
end
return true
end
Where to put this?

put this in creaturescripts.xml
register in login.lua

]work in TFS 0.3.6 too
 
Last edited:
Actually fixed this last night for a buddie lol. the xml is scripted wrong. this is wat he used and it worked. i can probably make one that is in english. anywho this is wat you need have as the npc.
Priest.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Priest" script="wedding.lua" walkinterval="2000" floorchange="0">
	<health now="800" max="800"/>
	<look type="57" head="20" body="30" legs="40" feet="50"/>
	<parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|, Would u like to get married?"/>
	</parameters>
</npc>
 
Back
Top