Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

Olá pessoal do tk, com tutoriais de script que vi por ai,resolvi bolar meu 1° Sistema,e deu meu primeiro e único sistema útil

Advanced Reproduction System !!

O Script funciona assim :

O Player tem 1kk na sua backpack,então ele fala !prostituta e aparece o Npc Prostituta..

Hayashii : Hi

Prostituta : Olá Hayashii. Eu faco Programas.

Hayashii : Programas

Prostituta : Voce quer fazer um programa ?

Hayashii : Yes

Então o player será teletransportado para x lugar com o looktype de uma cama por 5 segundos,ganha item x,e volta para seu looktype comum,ganhando item x.

O item x (no caso,o 5952), ao usa-lo,ira nascer 1 de 4 monstros :

- Filho Bombado

- Filho Fraco

- Filho Homosexual

- Filho Vagabundo

-------------------------------------------------------------------------------------------------------------------------

SCRIPTS

1- Crie um arquivo em data/actions/scripts com o nome summonfilho.lua

function onUse(cid, item, fromPosition, itemEx, toPosition)




local tab = {

[1] = "Filho Vagabundo",

[2] = "Filho Bombado",

[3] = "Filho Fraco",

[4] = "Filho Homosexual",

}

local config = {

item = 5952, -- Item que ira usar



pos = getCreaturePosition(cid)

}




if getPlayerLevel(cid) >= 150 then


doSummonMonster(cid, tab[math.random(1, 4)])


doPlayerRemoveItem(cid, config.item, 1)



else


doPlayerSendCancel(cid, 'Voce so pode ter um filho se for level 150 pra cima.')



return true


end



end
2- Em actions.xml
action itemid="5952" event="script" value="talkprostituta.lua"
3- Crie um arquivo em data/talkactions/scripts com o nome talkprostituta.lua

function onSay (cid, words, fromPosition, param, channel)

local dinheiro = 100000



if getPlayerLevel(cid) >;= 150 then

else

doPlayerSendCancel (cid, 'Voce e muito novo para isso!Pegue level 150 antes!')

return true

end



if doPlayerRemoveMoney (cid,dinheiro) then

doCreateNpc ("Prostituta" , getCreaturePosition(cid))

else

doPlayerSendCancel (cid, 'Voce nao tem dinheiro para contratar uma prostituta')

return true

end



end

4- Em talkactions.xml
<talkaction words="!prostituta" event="script" value="talkprostituta.lua"/>
5- Crie um arquivo em data/npcs com o nome Prostituta.xml

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Prostituta" script="data/npc/scripts/prostituta.lua" walkinterval="2000" floorchange="0">

	<health now="150" max="150"/>

	<look type="136" head="58" body="84" legs="86" feet="114" addons="0"/>

	<parameters>

		<parameter key="message_greet" value="Ola |PLAYERNAME|. Eu faco {Programas}." />

	</parameters>

</npc>


6- Crie um arquivo em data/npcs/scripts com o nome prostituta.lua

local Config = {

				pos = {x = 160, y = 54, z = 7},

				itemid = 2160,

		addid = {2154, 2}, -- id, quant

				time = 5 -- Tempo em segundos que o player ficará transformado

}


local condition = createConditionObject(CONDITION_OUTFIT)

				setConditionParam(condition, CONDITION_PARAM_TICKS, Config.time * 1000)

				addOutfitCondition(condition, {lookTypeEx = Config.itemid})


local focus = 0

local talk_start = 0

local talkState = {}


function onCreatureDisappear(cid, pos)

   if (focus ~= 0) then

		  selfSay("Good bye too!")

		  focus, talk_start = 0, 0

   end

end



function msgcontains(txt, str)

   return (string.find(txt, str) and not string.find(txt, "(%w+)" .. str) and not string.find(txt, str .. "(%w+)"))

end


function onCreatureSay(cid, type, msg)

   local msg = string.lower(msg)

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid


   if (msgcontains(msg, "bye") and (focus == cid)) then

		  focus, talk_start, talkState[talkUser] = 0, 0, 0


		  selfSay("Adeus " .. getCreatureName(cid) .. "!", cid)

   elseif (msgcontains(msg, "hi") and (focus == 0)) then

		  local playerguid = getPlayerGUIDByName(getCreatureName(getNpcId()))


		  focus, talk_start, talkState[talkUser] = cid, os.clock(), 1

				  selfSay("Olá {" .. getCreatureName(cid) .. "}, você quer fazer um {programa}?", cid)

   elseif (msgcontains(msg, "sim")) and (talkState[talkUser] == 1) and (focus == cid) then

		  focus, talk_start = 0, 0

				  doTeleportThing(cid, Config.pos)

								doAddCondition(cid, condition)

				doPlayerAddItem(cid, Config.addid[1], Config.addid[2])

				elseif (msgcontains(msg, "nao")) and (talkState[talkUser] == 1) and (focus == cid) then

		  focus, talk_start = 0, 0

				  selfSay("Então saia daqui vagabundo!", cid)

   end

end


function onCreatureChangeOutfit(creature)

end


function onThink()

				 doNpcSetCreatureFocus(focus)

				if (os.clock() - talk_start) > 60 then

						if focus > 0 then

						   selfSay("Flw!", cid)

						end

						   focus = 0

						   talk_start = 0

				end


				if focus ~= 0 then

				   if getDistanceToCreature(focus) > 3 then

						  selfSay("FLW AEW!", cid)

						  focus = 0

						  talk_start = 0

				   end

				end

end

---------------------------------------------------------------------------------------

Qualquer bug avisar imediatamente para mim,obrigado.

Se for postar em um lugar,colocar créditos.

Créditos :

60% Hayashii (Por Criação e idéia)

10% Kimoszin (Por dar funções e ajudar em bugs)

10% EddyHavoc (Por dar funções)

10% MaxWellden (Por fazer o npc)

10% Thalia (Pelos tutoriais)

---------------------------------------------------------------------------------------------------------
Monsters
1- Vá em data/monster e crie os seguintes arquivos :
filhovagabundo.lua

<?xml version="1.0" encoding="UTF-8"?>

<monster name="Filho vagabundo" nameDescription="a mal exemplo" race="blood" experience="35" speed="134" manacost="300">

<health now="800" max="800"/>

<look type="153" body="38" feet="97" head="59" legs="38" addons="3" corpse="3058"/>

<targetchange interval="2000" chance="0"/>

<strategy attack="100" defense="35"/>

<flags>

<flag summonable="1"/>

<flag attackable="1"/>

<flag hostile="1"/>

<flag illusionable="1"/>

<flag convinceable="1"/>

<flag pushable="1"/>

<flag canpushitems="0"/>

<flag canpushcreatures="0"/>

<flag staticattack="80"/>

<flag targetdistance="1"/>

<flag runonhealth="10"/>

</flags>

<attacks>

<attack name="melee" interval="2000" skill="15" attack="35"/>

</attacks>

<defenses armor="11" defense="16"/>

<elements>

<element physicalPercent="10"/>

<element energyPercent="20"/>

<element holyPercent="10"/>

<element earthPercent="-10"/>

<element deathPercent="-10"/>

</elements>

<voices interval="2000" chance="9">

<voice sentence="Hehehe!"/>

<voice sentence="Alguem tem cerveja sobrando?"/>

<voice sentence="Me de dinheiro,tenho um filho sem perna em casa!"/>


</voices>

<loot>

	<item id="2567" chance="9775" /><!-- wooden spoon -->

	<item id="2148" countmax="9" chance="49550" /><!-- gold coin -->

	<item id="2237" chance="62650" /><!-- dirty cape -->

	<item id="2690" chance="19800" /><!-- roll -->

	<item id="2666" countmax="2" chance="9700" /><!-- meat -->

	<item id="2556" chance="10150" /><!-- wooden hammer -->

	<item id="2570" chance="5500" /><!-- rolling pin -->

	<item id="2744" chance="4950" /><!-- red rose -->

	<item id="1987" chance="100000"><!-- bag -->

		<inside>

			<item id="1681" chance="850" /><!-- small blue pillow -->

			<item id="5553" chance="850" /><!-- rum flask -->

			<item id="2072" chance="775" /><!-- lute -->

			<item id="9808" chance="1150" /><!-- rusty armor -->

			<item id="2802" chance="850" /><!-- sling herb -->

			<item id="6091" chance="775" /><!-- very noble-looking watch -->

			<item id="2213" chance="600" /><!-- dwarven ring -->

		</inside>

	</item>

</loot>

</monster>

filhobombado.lua

<?xml version="1.0" encoding="UTF-8"?>

<monster name="Filho Bombado" nameDescription="a senhor musculos" race="blood" experience="35" speed="134" manacost="300">[/center]


<health now="1100" max="1100"/>

<look type="142" body="94" feet="114" head="79" legs="87" addons="3" corpse="3058"/>

<targetchange interval="2000" chance="0"/>

<strategy attack="150" defense="0"/>

<flags>

<flag summonable="1"/>

<flag attackable="1"/>

<flag hostile="1"/>

<flag illusionable="1"/>

<flag convinceable="1"/>

<flag pushable="1"/>

<flag canpushitems="0"/>

<flag canpushcreatures="0"/>

<flag staticattack="80"/>

<flag targetdistance="1"/>

<flag runonhealth="10"/>

[</flags>

<attacks>

<attack name="melee" interval="2000" skill="20" attack="35"/>

</attacks>

<defenses armor="11" defense="16"/>

<elements>

<element physicalPercent="10"/>

<element energyPercent="20"/>

<element holyPercent="10"/>

<element earthPercent="-10"/>

<element deathPercent="-10"/>

</elements>

<voices interval="2000" chance="9">

<voice sentence="Olhe meus musculos,que lindos!"/>

<voice sentence="Como voce e fraco,kkkk"/>

<voice sentence="Quer apanha mlk ? E so 1 hit.."/>



</voices>

<loot>

   <item id="2567" chance="9775" /><!-- wooden spoon -->

   <item id="2148" countmax="9" chance="49550" /><!-- gold coin -->

   <item id="2237" chance="62650" /><!-- dirty cape -->

  <item id="2690" chance="19800" /><!-- roll -->

	<item id="2666" countmax="2" chance="9700" /><!-- meat -->

   <item id="2556" chance="10150" /><!-- wooden hammer -->

   <item id="2570" chance="5500" /><!-- rolling pin -->

  <item id="2744" chance="4950" /><!-- red rose -->

  <item id="1987" chance="100000"><!-- bag -->

	   <inside>

		 <item id="1681" chance="850" /><!-- small blue pillow -->

			<item id="5553" chance="850" /><!-- rum flask -->

		   <item id="2072" chance="775" /><!-- lute -->

		  <item id="9808" chance="1150" /><!-- rusty armor -->

		  <item id="2802" chance="850" /><!-- sling herb -->

	   <item id="6091" chance="775" /><!-- very noble-looking watch -->

			<item id="2213" chance="600" /><!-- dwarven ring -->

	   </inside>

   </item>

</loot>

</monster>

filhohomosexual.lua
<?xml version="1.0" encoding="UTF-8"?>

<monster name="Filho Homosexual" nameDescription="a baitola" race="blood" experience="35" speed="134" manacost="300">

<health now="650" max="650"/>

<look type="128" body="92" feet="91" head="114" legs="92" addons="1" corpse="3058"/>

<targetchange interval="2000" chance="0"/>

<strategy attack="85" defense="5"/>

<flags>

<flag summonable="1"/>

<flag attackable="1"/>

<flag hostile="1"/>

<flag illusionable="1"/>

<flag convinceable="1"/>

<flag pushable="1"/>

<flag canpushitems="0"/>

<flag canpushcreatures="0"/>

<flag staticattack="80"/>

<flag targetdistance="1"/>

<flag runonhealth="10"/>

</flags>

<attacks>

<attack name="melee" interval="2000" skill="15" attack="15"/>

</attacks>

<defenses armor="11" defense="16"/>

<elements>

<element physicalPercent="10"/>

<element energyPercent="20"/>

<element holyPercent="10"/>

<element earthPercent="-10"/>

<element deathPercent="-10"/>

</elements>

<voices interval="2000" chance="9">

<voice sentence="Viva a uniao restart! S2 S2"/>

<voice sentence="Oiii gatinhoo (:"/>

<voice sentence="Nuss como voce e bonitinhoo s2"/>

</voices>

<loot>

	<item id="2567" chance="9775" /><!-- wooden spoon -->

	<item id="2148" countmax="9" chance="49550" /><!-- gold coin -->

	<item id="2237" chance="62650" /><!-- dirty cape -->

	<item id="2690" chance="19800" /><!-- roll -->

	<item id="2666" countmax="2" chance="9700" /><!-- meat -->

	<item id="2556" chance="10150" /><!-- wooden hammer -->

	<item id="2570" chance="5500" /><!-- rolling pin -->

	<item id="2744" chance="4950" /><!-- red rose -->

	<item id="1987" chance="100000"><!-- bag -->

		<inside>

			<item id="1681" chance="850" /><!-- small blue pillow -->

			<item id="5553" chance="850" /><!-- rum flask -->

			<item id="2072" chance="775" /><!-- lute -->

			<item id="9808" chance="1150" /><!-- rusty armor -->

			<item id="2802" chance="850" /><!-- sling herb -->

			<item id="6091" chance="775" /><!-- very noble-looking watch -->

			<item id="2213" chance="600" /><!-- dwarven ring -->

		</inside>

	</item>

</loot>

</monster>
filhofraco.lua
:("/> </voices> <loot> <item id="2567" chance="9775" /><!-- wooden spoon --> <item id="2148" countmax="9" chance="49550" /><!-- gold coin --> <item id="2237" chance="62650" /><!-- dirty cape --> <item id="2690" chance="19800" /><!-- roll --> <item id="2666" countmax="2" chance="9700" /><!-- meat --> <item id="2556" chance="10150" /><!-- wooden hammer --> <item id="2570" chance="5500" /><!-- rolling pin --> <item id="2744" chance="4950" /><!-- red rose --> <item id="1987" chance="100000"><!-- bag --> <inside> <item id="1681" chance="850" /><!-- small blue pillow --> <item id="5553" chance="850" /><!-- rum flask --> <item id="2072" chance="775" /><!-- lute --> <item id="9808" chance="1150" /><!-- rusty armor --> <item id="2802" chance="850" /><!-- sling herb --> <item id="6091" chance="775" /><!-- very noble-looking watch --> <item id="2213" chance="600" /><!-- dwarven ring --> </inside> </item> </loot> </monster>


<?xml version="1.0" encoding="UTF-8"?>

<monster name="Filho Fraco" nameDescription="a fracote" race="blood" experience="35" speed="134" manacost="300">

<health now="710" max="710"/>

<look type="146" body="3" feet="43" head="95" legs="88" addons="3" corpse="3058"/>

<targetchange interval="2000" chance="0"/>

<strategy attack="115" defense="8"/>

<flags>

<flag summonable="1"/>

<flag attackable="1"/>

<flag hostile="1"/>

<flag illusionable="1"/>

<flag convinceable="1"/>

<flag pushable="1"/>

<flag canpushitems="0"/>

<flag canpushcreatures="0"/>

<flag staticattack="80"/>

<flag targetdistance="1"/>

<flag runonhealth="10"/>

</flags>

<attacks>

<attack name="melee" interval="2000" skill="15" attack="20"/>

</attacks>

<defenses armor="11" defense="16"/>

<elements>

<element physicalPercent="10"/>

<element energyPercent="20"/>

<element holyPercent="10"/>

<element earthPercent="-10"/>

<element deathPercent="-10"/>

</elements>

<voices interval="2000" chance="9">

<voice sentence="Puts,estou muito cansado,me ajude por favor!"/>

<voice sentence="Que vida cruel..."/>

<voice sentence="Tenho que andar mais ? Vsf 
2- Em monsters.xml

<monster name="Filho Vagabundo" file="filhovagabundo.xml"/>

   <monster name="Filho Homosexual" file="filhohomosexual.xml"/>

<monster name="Filho Bombado" file="filhobombado.xml"/>

<monster name="Filho Fraco" file="filhofraco.xml"/>

Editado por Hayashii (veja o histórico de edições)

  • Respostas 10
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

rsrsrsrs, ficou bacana seu sistema! parabéns rapaz, vc progrediu mto na suas aulas de scripting xD

Só uma dica:

ao invés de usar

doPlayerRemoveItem(cid, config.item, 1)
você poderia usar
doRemoveItem(item.uid, 1)

porque você já identificou o item que será usado na tag xD

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo