Nie tylko o Tibii i OTS...
Witam Chciałbym oświadczyć ze wracam powrotnie do robienia skryptów a wiec na sam początek dodam skrypta NPC Wasp który pilnuje porządków, niestety srypt nie moj ale fajny na koncu dodam link do strony w ktorej ten skrypt się znajduje a wiec lecimy :
Chciałbym wam przedstawić kontynuację Npc na tibie 7.6
1.Wasp, 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.
Tak wiec, tworzymy plik Wasp Security.xml w folderze data/npc i wklejamy to:
<?xml version="1.0"?>
<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>
Nastepnie tworzymy plik wasphp.lua w data/npc/scripts i wklejamy to:
-----NPC by Mefis-----
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*)huj(%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*)huj(%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
2. Wasp, 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 teleportowany do danego miejsca(np.więzienia).
Tworzymy plik Wasp Security.xml w folderze data/npc i wklejamy to:
<?xml version="1.0"?>
<npc name="Wasp Security" script="data/npc/scripts/wasptp.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>
Nastepnie tworzymy plik wasptp.lua w data/npc/scripts i wklejamy to:
-----NPC by Mefis-----
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*)huj(%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*)huj(%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...!!')
tppos = {x=współrzędne x, y=współrzędne y, z=współrzędne z}
doTeleportThing(cid,tppos)
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
Współrzędne miejsca, do którego ma teleportować gracza wpisujemy w tej linijce:
tppos = {x=współrzędne x, y=współrzędne y, z=współrzędne z}
(przyklad: tppos = {x=160, y=54, z=7})
--------------------------------------------------------
3. NPC w działaniu identyczny co Wasp Security nr1, lecz jest on bardziej "realistyczny" (wygląd gracza, po napisaniu "hi" odpowiada mówiąc kim jest i co robi).
Tworzymy plik Straznik.xml w folderze data/npc i wklejamy to:
<?xml version="1.0"?>
<npc name="Straznik" script="data/npc/scripts/straznik.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="131" head="0" body="114" legs="0" feet="0"/>
</npc>
Nastepnie tworzymy plik straznik.lua w data/npc/scripts i wklejamy to:
----NPC by Mefis----
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*)huj(%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*)huj(%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))
end
if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Witaj ' .. creatureGetName(cid) .. '! Jestem straznikiem tego miasta i za wszelka cene dopilnuje, aby panowal tu porzadek!')
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
end
--------------------------------------------------------
Aby umieścić NPC na mapie otwieramy plik test-spawn.xml w data/word i dopisujemy to:
<spawn centerx="współrzędne x" centery="współrzędne y" centerz="współrzędne z" radius="8">
<npc name="nazwa npc" x="0" y="0"/>
</spawn>
Mam nadzieję, że komu się przyda.
a tu obiecany link do orginalnego srypta
http://forum.tibia.org.pl/showthread.php?t=250630
Offline
Bardzo, ale to BARDZO się przyda... u mnie jak na OTS były pierwsze 4 osoby, to przeklinali w depocie jak szewce... Teraz mam na nich hacka Plusik leci...
Offline
Czyż to nie temat z Torga? Widziałem ten temat i to nie byłeś ty
Offline
Kurcze nie wiem czemu ale u mnie nie działa nawet nie widać tej postaci ;/
Już działa tylko teraz powiedzcie jak zrobić zeby on biegał po całej mapce ??
Ostatnio edytowany przez Alex (2008-03-27 18:54:22)
Offline