Skarbnica OTS

Wszystko Do Twojego Ots'a :)


#1 03-03-2008 21:42:52

Max Dragon

Administrator

Zarejestrowany: 02-03-2008
Posty: 3
Punktów :   -1 

[8.0]Wasp pilnujący porządku...

Działa to na takie zasadzie-Wasp(tzw."porządkowy"), który po usłyszeniu przekleństwa pozostawia gracza z ilością życia równą 1. Gdy graczowi pozostanie 1hp, a nadal będzie używał nieprzyzwoitych słów-zostanie zabity .

1.Tworzymy plik Wasp Security.xml w folderze data/npc i wklejamy to:

<?xml version="1.0"?>

Kod:

<npc name="Wasp Security" script="data/npc/scripts/wasphp.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="44" head="20" body="30" legs="40" feet="50" corpse="2131"/>
</npc>

2.Nastepnie tworzymy plik wasphp.lua w data/npc/scripts i wklejamy to:

Kod:

-----NPC by Max Dragon-----

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)

end


function onCreatureTurn(creature)

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)
  	msg = string.lower(msg)

  	if ((string.find(msg, '(%a*)kurw(%a*)')) 
	or (string.find(msg, '(%a*)dziwk(%a*)'))
 	or (string.find(msg, '(%a*)suk(%a*)')) 
	or (string.find(msg, '(%a*)debil(%a*)')) 
	or (string.find(msg, '(%a*)h**(%a*)')) 
	or (string.find(msg, '(%a*)spierd(%a*)')) 
	or (string.find(msg, '(%a*)jeb(%a*)')) 
	or (string.find(msg, '(%a*)pierdol(%a*)')) 
	or (string.find(msg, '(%a*)qrw(%a*)')) 
	or (string.find(msg, '(%a*)pizd(%a*)')) 
	or (string.find(msg, '(%a*)fuck(%a*)')) 
	or (string.find(msg, '(%a*)bitch(%a*)')) 
	or (string.find(msg, '(%a*)qurw(%a*)')) 
	and (focus == 0)) and getDistanceToCreature(cid) < 8 then
  		selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

hp = getPlayerHealth(cid)-1

mana = getPlayerMana(cid)



		doPlayerAddMana(cid,-mana)
		doPlayerAddHealth(cid,-hp)

	end

	if ((string.find(msg, '(%a*)kurw(%a*)')) 
	or (string.find(msg, '(%a*)dziwk(%a*)'))
 	or (string.find(msg, '(%a*)suk(%a*)')) 
	or (string.find(msg, '(%a*)debil(%a*)'))
	or (string.find(msg, '(%a*)h**(%a*)'))  
	or (string.find(msg, '(%a*)spierd(%a*)')) 
	or (string.find(msg, '(%a*)jeb(%a*)')) 
	or (string.find(msg, '(%a*)pierdol(%a*)')) 
	or (string.find(msg, '(%a*)qrw(%a*)')) 
	or (string.find(msg, '(%a*)pizd(%a*)')) 
	or (string.find(msg, '(%a*)fuck(%a*)')) 
	or (string.find(msg, '(%a*)bitch(%a*)')) 
	or (string.find(msg, '(%a*)qurw(%a*)')) 
	and (focus == 0)) and mana == 0 and hp <= 1 and getDistanceToCreature(cid) < 8 then
  		selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

		
		doPlayerAddHealth(cid,-(hp+1))
		

		
  		focus = cid
  		talk_start = os.clock()
	end
end

function onCreatureChangeOutfit(creature)

end


function onThink()

	doNpcSetCreatureFocus(focus)
  	if (os.clock() - talk_start) > 0 then

  	focus = 0
  	end

	if focus == 0 then
		randsay = math.random(1,60)
	
	if randsay == 1 then
			selfSay('Nie przeklinaj...')
	end
	if randsay == 2 then
		selfSay('Nie uzywaj wulgaryzmow...')
	end
	end
end

Mam nadzieję że NPC komuś się przyda ;]
Pozdrawiam.


http://img128.imageshack.us/img128/1609/avtkl4.gif
I radzę ci-stosuj się do tego ;]

Offline

 

#2 04-05-2008 21:23:16

mikier

Administrator

Zarejestrowany: 02-03-2008
Posty: 12
Punktów :   

Re: [8.0]Wasp pilnujący porządku...

pucuj torpede koleś


http://www.ubar.pl/www/img_14800_normal.gif
http://www.ubar.pl/www/img_14611_normal.gif

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.smanager09.pun.pl www.otservers.pun.pl www.narutozone.pun.pl www.bakugan-adventures.pun.pl www.firataleague.pun.pl