What's new

East kaio

Shibitos

New User
Joined
Sep 7, 2009
Messages
5
Reaction score
0
Mam npc east kaio ale jak wpisuje: train, training, sag to nic si? nie dzieje, prosz? o pomoc i z g?ry dzi?kuj?!
Code:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
talk_state = 0
cname = ''
vocation = 5
mainlevel = 15
bless = 0
blessa = 1
blessb = 0
blessc = 0
blessd = 0
blesse = 0
cost = 10000
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)
  	cname = creatureGetName(cid)
	msg = string.lower(msg)
if (msgcontains(msg, 'blessing') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
if isPremmium(cid) then	
blessaa = creatureGetBlessStatusa(cid)
if blessaa == 0 then
focus = cid
bless = creatureGetBless(cid) + 1
blesse = creatureGetBlessStatuse(cid)
blessb = creatureGetBlessStatusb(cid)
blessc = creatureGetBlessStatusc(cid)
blessd = creatureGetBlessStatusd(cid)
if pay(cid,cost) then
   		setNewBless(focus, 0,blesse, blessd, blessc, blessb, blessa, bless)
 		selfSay('You are blessed...')
focus = 0
	else
			selfSay('Sorry, you do not have enough money.')
focus = 0
		end
end
end
end
	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
 selfSay('Welcome on my awsome planet! eghm...')
	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
  		selfSay('Sorry, ' .. cname .. '! I talk to somebody other.')
  	elseif msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3 then
 		selfSay('Good bye, ' .. cname .. '!')
 		talk_state = 0
 		focus = 0
 		talk_start = 0
  	elseif focus == cid then
		talk_start = os.clock()
if (msgcontains(msg, 'training') or msgcontains(msg, 'train') or msgcontains(msg, 'sag'))  then
if getPlayerStorageValue(cid,8193992) == 53 then
rok = getPlayerStorageValue(cid,633)
miesiac = getPlayerStorageValue(cid,632)
dzien = getPlayerStorageValue(cid,631)
godzina = getPlayerStorageValue(cid,628)
minuta = getPlayerStorageValue(cid,629)
sekunda = getPlayerStorageValue(cid,630)
trok = os.date('%Y')
tmiesiac = os.date('%m')
tdzien = os.date('%d')
tgodzina = os.date('%H')
tminuta = os.date('%M')
tsekunda = os.date('%S')
ileby = rok*86400*30*12
ilebmi = miesiac*86400*30
ilebd = dzien*86400
ilebh = godzina*3600
ilebm = minuta*60
ilebs = sekunda
ilety = trok*86400*30*12
iletmi = tmiesiac*86400*30
iletd = tdzien*86400
ileth = tgodzina*3600
iletm = tminuta*60
ilets = tsekunda
ilesekundbylo = ilebh + ilebm + ilebs + ilebd + ilebmi + ileby
ilesekundjest = ileth + iletm + ilets + iletd + iletmi + ilety
uplynelo = ilesekundjest - ilesekundbylo
if uplynelo >= 180 then
selfSay('/m bubbles')
selfSay('You must beat Bubbles.')
setPlayerStorageValue(cid,628,os.date('%H'))
setPlayerStorageValue(cid,629,os.date('%M'))
setPlayerStorageValue(cid,630,os.date('%S'))
setPlayerStorageValue(cid,631,os.date('%d'))
setPlayerStorageValue(cid,632,os.date('%m'))
setPlayerStorageValue(cid,633,os.date('%Y'))
else
selfSay('Easy, we have time.')
end
end
if getPlayerStorageValue(cid,8193992) == 54 then
rok = getPlayerStorageValue(cid,633)
miesiac = getPlayerStorageValue(cid,632)
dzien = getPlayerStorageValue(cid,631)
godzina = getPlayerStorageValue(cid,628)
minuta = getPlayerStorageValue(cid,629)
sekunda = getPlayerStorageValue(cid,630)
trok = os.date('%Y')
tmiesiac = os.date('%m')
tdzien = os.date('%d')
tgodzina = os.date('%H')
tminuta = os.date('%M')
tsekunda = os.date('%S')
ileby = rok*86400*30*12
ilebmi = miesiac*86400*30
ilebd = dzien*86400
ilebh = godzina*3600
ilebm = minuta*60
ilebs = sekunda
ilety = trok*86400*30*12
iletmi = tmiesiac*86400*30
iletd = tdzien*86400
ileth = tgodzina*3600
iletm = tminuta*60
ilets = tsekunda
ilesekundbylo = ilebh + ilebm + ilebs + ilebd + ilebmi + ileby
ilesekundjest = ileth + iletm + ilets + iletd + iletmi + ilety
uplynelo = ilesekundjest - ilesekundbylo
uplynelo = ilesekundjest - ilesekundbylo
if uplynelo >= 180 then
selfSay('/m george')
selfSay('You must beat George with this hammer.')
buy(cid,2454,1,0)
setPlayerStorageValue(cid,628,os.date('%H'))
setPlayerStorageValue(cid,629,os.date('%M'))
setPlayerStorageValue(cid,630,os.date('%S'))
setPlayerStorageValue(cid,631,os.date('%d'))
setPlayerStorageValue(cid,632,os.date('%m'))
setPlayerStorageValue(cid,633,os.date('%Y'))
else
selfSay('Easy, we have time.')
end
end
if getPlayerStorageValue(cid,8193992) == 55 then
selfSay('It\'s end of your train. I learned you all what I know. Now you are ready to use powerful attacks.')
end
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
  	if (os.clock() - talk_start) > 45 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 2 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end
 
Top