
Nie tylko o Tibii i OTS...
Zbanowany
Siema.
Pokaże wam jak się robi Santa Claus.
Wchodzimy do data/npc i tworzymy plik XML o nazwie Santa Claus.xml i wklejamy do niego to:
<?xml version="1.0"?>
<npc name="Santa Claus" script="data/npc/scripts/santa.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="160" head="0" body="94" legs="0" feet="94"/>
</npc>
Potem wchodzimy do data/npc/scripts i robimy plik LUA o nazwie santa.lua i wklejamy to:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Merry Christmas!')
focus = 0
talk_start = 0
end
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*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Merry Christmas ' .. creatureGetName(cid) .. '!')
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! Please wait.')
end
if string.find(msg, '(%a*)present(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
present = getPlayerStorageValue(cid,1210)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,1210,1)
end
if present == 1 then
selfSay('Sorry, I dont have more presents for you.')
end
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Merry Christmas!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Merry Christmas!')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,25)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
if focus > 0 then
rand = math.random(1,6)
if rand == 1 then
item = 2969
elseif rand == 2 then
item = 2973
elseif rand == 3 then
item = 2981
elseif rand == 4 then
item = 3520
elseif rand == 5 then
item = 2930
else
item = 3524
end
end
if focus == 0 then
randsay = math.random(1,75)
if randsay == 1 then
selfSay('Hmmhmm...')
end
if randsay == 2 then
selfSay('Hoho...')
end
end
end
tam gdzue mamy present = getPlayerStorageValue(cid,1210) i gdzie jest (cid,1210) id zmieniamy na to co chcesz zeby mikolaj dal
to koniec PZDR. !!!
Gressis:
Edytowałem bo źle było w ramki złapane to co mamy wklejić u siebie.
Ostatnio edytowany przez Gressis (2006-11-29 13:19:47)
Offline

Jak zrobić zeby on na OTS był wszystko wkleiłem i nie ma go Prosze o odpowiedz
Offline
Zbanowany
Wchodzimy do data/world/npc i otwieramy go za pomoca notatnika i wklejamy taką linijkę :
<npc name="Santa Claus" x="136" y="51" z="7"/>
Tu gdzie masz 136 , 51, 7 czyli pozycja gdzie musi stać. Robi to się jasno i prosto wchodzisz na GM'a i piszesz /pos, wyświetla ci się wtedy pozycja.
Myślę że zrozumiałeś
PoSdro
Offline
Mam slinik evolution 0.7.8 xml i w data/world niema zadnego pliku o nazwie npc tylko jest evolutions.otmb , evolutions-house, evolutions-housestore, evolutions-mapstore i evolution-spawn co mam zrobić pomocy z góry thx.



Offline
Zbanowany
@up
To npc pod 7.6
Offline

mam pytank bo jestem zielony w tych sprawach jak go wlozyc na mapke !?!
Offline

Mam pytanie wytlumaczcie mi dokladnie jak sie stawia potwory na mapce do otsa
Offline

jak otorzysz map editora i mape to masz pasek zadan na górze tam masz coś przypominajacego czerwony kwadrat- spawn tools klikasz na to lpm i na mape gdzie chesz postawic potworki . potem masz taką liste rozwijanom wybierasz z tego monster i wybierasz potwora poczym stawaisz go na mape. A tak pozatym to pytanie nie mowino być w tym dziale i temacie
Offline

Niewarzne jakie IP ustawie on zawsze daje zabitego potwora lub na mape dodatek np. ostatnio present mówie a on dał wode na mape na ulice i trzeba edytować mapke przez to !!! Plis pomórzcie !
Offline

Wszystko super i dokładnie xD ale szkoda, że pod 7.6 ;/

Offline
Zbanowany
Mi wszysko działa tylko jak mowie do niego "hi" "present" to on mi daje jakiegos zabitego wilka :(
Offline
Soldier of the North
moze to inne id?? Pod jakiego OT jest ten skrypty? A jaki OTS masz?? TZN. np. pod 7.6

Offline
Ja powiem krótko i zwięźle... Trzeba wejść w folder items (ten w folderze data OTSa) i tam macie items.otb i items.xml no i wchodzicie w items.xml. wyszukujecie coś (nie podam tu konkretnego ip bo juz nie mam OTSów pod 7.6) i macie powiedzmy magic plate armor z ip np. 7777 (daje tu losowe ip) i teraz robicie coś takiego, że w tym npc przestawiacie to:
"then
present = getPlayerStorageValue(cid,1210)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,1210,1)
end"
na:
"then
present = getPlayerStorageValue(cid,7777)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,7777,1)
end"
Myślę, że jasno i prosto wyjaśniłem...
Aha i jeszcze jedno, żeby potem nie było tekstów typu "A mi przywołuje lave." "A mi przywołuje cośtam!" to ip zmyśliłem... nie mam bladego pojęcia co jest pod tym ip... Dałem je tylko jako przykład, więc proszę wszystkich i każdego z osobna, żeby sam sobie poszukał jakiegoś sensownego ip w pliku items.xml. Żeby jak wyżej mówił rby nie tworzył dziwacznych itemów, to trzeba te obydwa które powiększyłem edytować... Obydwa! Mam nadzieję, że ktoś skorzysta na mojej pomocy... Miłego stawiania tego npc!
Offline