-Skrypt Dbko Bug LvL

Status
Zamknięty.

tomix96

New User
Zarejestrowany
Dołączył
Maj 2, 2010
Posty
3
Liczba reakcji
0
Witam, mam serwer dbko 3.11 od Lutzena (thx dla Cb.) I jest all git,lecz nie wiem jak zrobi? d?wignie/npc/nutke co odbugowuje lvl:<. Prosi?bym kogo? najlepiej o skrypt na nutke czyli ?e kto? wpisuje Bug level i daje mu nutk?/item za 50g i potem mo?e on u?ywa? to ile razy chce i p?aci 15g za ka?de u?ycie,kt?re daje mu lvl.Mo?e by? te? npc co dodaje lvl po napisaniu do niego hi...bug...yes , a co do d?wigni to wole nie bo pr?bowa?em ze skryptem z wodbo ale nie dzia?a?o :< Za pomoc daje reputa.
 
Odp: Dbko Bug LvL

Sry ?e tak 3 pod rzad ale problem rozwi?zany daje skrypt na npc <dzia?aj?cy!>

Npc Bug LvL:
Wiec tak wchodzimy w data/npc i robimy npc o nazwie bug level<nawa oczywiscie moze byc inna>
Potem w niml piszemy:
<npc name="Bug Level" script="data/npc/scripts/bug level.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="75" head="132" body="79" legs="97" feet="132" corpse="2212"/>
</npc>

Nastepnie wchodzimy w data/npc/scripts i robimy npc o nazwie bug level:

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)
if focus == cid then
selfSay('Good bye then.')
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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Czesc, ' .. getCreatureName(cid) .. '! Chcesz odblokowac level za 50g?.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,2160,50) == 0 then
selfSay('Przepraszam nie masz 50 golda.')
else
selfSay('Odblokowales level!.')
addLevel(cid,1)
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. ' wpadaj czesciej!')
focus = 0
talk_start = 0
end
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
 
Status
Zamknięty.
Back
Do góry