[Guild Master][100%Spolszczony]

Status
Zamknięty.

Pacyna86

User
Zarejestrowany
Dołączył
Grudzień 6, 2008
Posty
23
Liczba reakcji
0
Witam !
Chcia?bym wam zaprezentowa? Guild Mastera w 100% spolszczonego przeze mnie bez ?adnych nedznych translator?w z ktorych nic nie mozna zrozumiec i lepiej jest juz uzywac angielskiego GM ,tak jak w tym temacie... : tibia.net.pl/npc/19362-guild-master-spolszczony-99-9-8-1-a.html << ctrl+c i ctrl+v do translatora to kazdy g?upek umie...
Moj Guild Master jest w 100% spolszczony tak aby kazdy mogl zrozumiec a nie tylko to co rozumie translator... Zajelo mi to okolo 10 minut.
Oto Kod
Oczywiscie wklejamy to do ots\data\npc\scripts\guild.lua

Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
local talk_state = 0
local gstat = 0		-- guild status
local grank = ''		-- guild rank
local gname = ''		-- guild name
local cname = ''		-- name of player who talks to us
local pname = ''		-- name of some other player
local maxnamelen = 30
local maxranklen = 20
local maxnicklen = 20
local leaderlevel = 50
local NONE = 0
local INVITED = 1
local MEMBER = 2
local VICE = 3
local LEADER = 4
local allow_pattern = '^[a-zA-Z0-9 -]+$'

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)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Siema ' .. cname .. '! W czym moge Ci pomoc?')
  		talk_state = 0
  		focus = cid
  		talk_start = os.clock()

	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. cname .. '! Pogadamy za minute.')

  	elseif msgcontains(msg, 'bye') and (focus == cid) and getDistanceToCreature(cid) < 4 then
  			selfSay('Nara, ' .. cname .. '!')
  			talk_state = 0
  			focus = 0
  			talk_start = 0

  	elseif focus == cid then
  		if talk_state == 0 then
  			msg = string.lower(msg)

			if msgcontains(msg, 'found') then	-- found a new guild
  				level = getPlayerLevel(cid)

  				if level >= leaderlevel then
  					gstat = getPlayerGuildStatus(cname)

  					if gstat == NONE or gstat == INVITED then
  						selfSay('Podaj nazwe gildi!')
  						talk_state = 1
  					elseif gstat == MEMBER or gstat == VICE or gstat == LEADER then
  						selfSay('Masz juz gildie.')
  						talk_state = 0
  					end
  				else
  					selfSay('Sorry, potrzebujesz ' .. leaderlevel .. ' by zalozyc gildie.')
  				end

  				talk_start = os.clock()

  			elseif msgcontains(msg, 'join')  then	-- join a guild when invited
  				gstat = getPlayerGuildStatus(cname)

  				if gstat == NONE then
  					selfSay('Sorry, nie jestes zaproszony do zadnej gildi.')
  					talk_state = 0
  				elseif gstat == INVITED then
  					gname = getPlayerGuildName(cname)
  					selfSay('Czy chcesz dolaczyc do ' .. gname .. '?')
  					talk_state = 3
  				elseif gstat == MEMBER or gstat == VICE or gstat == LEADER then
  					selfSay('Masz juz gildie.')
  					talk_state = 0
  				end

  				talk_start = os.clock()

  			elseif msgcontains(msg, 'exclude') or msgcontains(msg, 'kick') then		-- kick player from a guild
  				gstat = getPlayerGuildStatus(cname)

  				if gstat == VICE or gstat == LEADER then
  					selfSay('Kogo chcesz wyrzucic?')
  					talk_state = 4
  				else
  					selfSay('Tylko Lider i vice liderzy moga wyrzucac z gildii.')
  					talk_state = 0
  				end

  				talk_start = os.clock()

  			elseif msgcontains(msg, 'invite') then		-- invite player to a guild
  				gstat = getPlayerGuildStatus(cname)

  				if gstat == VICE or gstat == LEADER then
  					selfSay('Kogo chcesz zaprosic?')
  					talk_state = 5
  				else
  					selfSay('Tylko Lider i Vice liderzy moga zapraszac do gildii.')
  					talk_state = 0
  				end

  				talk_start = os.clock()

  			elseif msgcontains(msg, 'leave') then		-- leave a guild
  				gstat = getPlayerGuildStatus(cname)

  				if gstat == NONE or gstat == INVITED then
  					selfSay('Nie jestes w gildii.')
  					talk_state = 0
  				elseif gstat == MEMBER or gstat == VICE then
  					gname = getPlayerGuildName(cname)
  					selfSay('Czy chcesz opuscic ' .. gname .. '?')
  					talk_state = 7
  				elseif gstat == LEADER then
  					selfSay('Jestes liderem. Czy na pewno chcesz opuscic gildie?')
  					talk_state = 7
  				end

  			elseif msgcontains(msg, 'pass') then		-- pass leadership
  				gstat = getPlayerGuildStatus(cname)

  				if gstat == LEADER then
  					selfSay('Kogo wybierasz na Lidera?')
  					talk_state = 8
  				else
  					selfSay('Tylko lider moze zmienic lidera.')
  					talk_state = 0
  				end

  			elseif msgcontains(msg, 'vice') then		-- set vice leader
  				gstat = getPlayerGuildStatus(cname)

				if gstat == LEADER then
					selfSay('Kogo wybierasz na vice lidera?')
  					talk_state = 9
  				else
  					selfSay('Tylko lider moze wybrac kogos na vice lidera.')
  					talk_state = 0
  				end

  			elseif msgcontains(msg, 'member') then		-- remove vice-leader
  				gstat = getPlayerGuildStatus(cname)

  				if gstat == LEADER then
  					selfSay('Kogo chcesz zdegradowac z lidera do zwyklego czlonka?')
  					talk_state = 10
  				else
  					selfSay('Tylko lider moze zdegradowac z lidera do zwyklego czlonka.')
  					talk_state = 0
  				end

  			elseif msgcontains(msg, 'nick') or msgcontains(msg, 'title') then	-- set nick
  				gstat = getPlayerGuildStatus(cname);

  				if gstat == LEADER then
  					selfSay('Komu chcesz zmienic tytul?')
  					talk_state = 11
  				else
  					selfSay('Tylko lider moze zmieniac tytul.')
  					talk_state = 0
  				end
  			end

  		else	-- talk_state != 0
  			talk_start = os.clock()

  			if talk_state == 1 then		-- get name of new guild
  				gname = msg

  				if string.len(gname) <= maxnamelen then
 					if string.find(gname, allow_pattern) then
 						if foundNewGuild(gname) == 0 then
							selfSay('Juz istnieje gildia o takiej nazwie.')
 							talk_state = 0
 						else
 							selfSay('Jaka range chcesz posiadac?')
 							talk_state = 2
 						end
 					else
 						selfSay('Gildia ma niepoprawne znaki!')
 						talk_state = 0
 					end
  				else
  					selfSay('Gildia nie moze byc dluzsza niz ' .. maxnamelen .. ' liter.')
  					talk_state = 0
  				end

  			elseif talk_state == 2 then		-- get rank of leader
  				grank = msg

  				if string.len(grank) <= maxranklen then
 					if string.find(grank, allow_pattern) then
 						setPlayerGuild(cname,LEADER,grank,gname)
 						selfSay('Gratulacje. Zostales nowym liderem.')
 						talk_state = 0
 					else
						selfSay('Ranga ma niepoprawne znaki.')
 						talk_state = 0
 					end
  				else
  					selfSay('Ranga nie moze byc dluzsza niz ' .. maxranklen .. ' liter.')
  					talk_state = 0
  				end

  			elseif talk_state == 3 then		-- join a guild
  				if msg == 'yes' then
  					setPlayerGuildStatus(cname, MEMBER)
  					selfSay('Jestes nowym czlonkiem gildi .. gname ..')
  					talk_state = 0
  				else
  					selfSay('Co moge dla ciebie zrobic?')
  					talk_state = 0
  				end

  			elseif talk_state == 4 then		-- kick player
  				pname = msg
  				gname = getPlayerGuildName(cname)
  				gname2 = getPlayerGuildName(pname)

  				if cname == pname then
  					selfSay('Zeby opuscic gildie napisz leave.')
  					talk_state = 0
  				elseif gname == gname2 then
  					gstat2 = getPlayerGuildStatus(pname)

  					if gstat > gstat2 then
  						clearPlayerGuild(pname)
  						selfSay('Wyrzuciles ' .. pname .. ' ze swojej gildii.')
  						talk_state = 0
  					else
  						selfSay('Tylko lider i vice liderzy moga wyrzucac czlonkow gildii.')
  						talk_state = 0
  					end
  				else
  					selfSay('Sorry, ' .. pname .. ' nie jest w twojej gildii.')
  					talk_state = 0
  				end

  			elseif talk_state == 5 then		-- get invited name
  				pname = msg
  				gstat = getPlayerGuildStatus(pname)

  				if gstat == MEMBER or gstat == VICE or gstat == LEADER then
  					selfSay('Sorry, ' .. pname .. ' jest w innej gildii.')
  					talk_state = 0
  				else
  					selfSay('Jaka range chcesz przydzielic jej/jemu?')
  					talk_state = 6
  				end

  			elseif talk_state == 6 then		-- get invited rank
  				grank = msg

  				if string.len(grank) <= maxranklen then
 					if string.find(grank, allow_pattern) then
 						gname = getPlayerGuildName(cname)
 						setPlayerGuild(pname, INVITED, grank, gname)
 						selfSay('Zaprosiles ' .. pname .. ' do swej gildii.')
 						talk_state = 0
 					else
 						selfSay('Ranga zawiera nieprawidlowe znaki.')
 						talk_state = 0
 					end
  				else
					selfSay('Ranga nie moze byc dluzsza niz ' .. maxranklen .. ' liter.')
  					talk_state = 0
  				end

  			elseif talk_state == 7 then		-- leave a guild
  				if msg == 'yes' then
  					clearPlayerGuild(cname)
  					selfSay('Opusciles gildie.')
  					talk_state = 0
  				else
					selfSay('Co moge dla ciebie zrobic?')
  					talk_state = 0
  				end

  			elseif talk_state == 8 then		-- pass leadership
  				pname = msg
  				level = getPlayerLevel(pname)

  				if level >= leaderlevel then
  					gname = getPlayerGuildName(cname)
  					gname2 = getPlayerGuildName(pname)

  					if gname == gname2 then
  						setPlayerGuildStatus(cname,MEMBER)
  						setPlayerGuildStatus(pname,LEADER)
  						gname = getPlayerGuildName(cname)
  						selfSay(pname .. ' jest nowym liderem ' .. gname .. '.')
  						talk_state = 0
  					else
  						selfSay('Sorry, ' .. pname .. ' nie jest w twojej gildi.')
  						talk_state = 0;
  					end
  				else
  					selfSay('Sorry, ' .. pname .. ' jest offline.')
  					talk_state = 0
  				end

  			elseif talk_state == 9 then		-- set vice-leader
  				pname = msg
  				gname = getPlayerGuildName(cname)
  				gname2 = getPlayerGuildName(pname)

  				if cname == pname then
  					selfSay('Aby ustapic z przywodztwa napisz pass.')
  					talk_state = 0
  				elseif gname == gname2 then
  					gstat = getPlayerGuildStatus(pname)

  					if gstat == INVITED then
						selfSay('Sorry, ' .. pname .. ' nie dolaczyl jeszcze do gildii.');
						talk_state = 0
  					elseif gstat == VICE then
  						selfSay(pname .. ' juz jest vice liderem.')
						talk_state = 0
  					elseif gstat == MEMBER then
  						setPlayerGuildStatus(pname, VICE)
  						selfSay(pname .. ' wlasnie zostal nowym vice liderem.')
						talk_state = 0
  					end
  				else
  					selfSay('Sorry, ' .. pname .. ' nie jest w twojej gildii.')
  					talk_state = 0
  				end

  			elseif talk_state == 10 then	-- set member
  				pname = msg
  				gname = getPlayerGuildName(cname)
  				gname2 = getPlayerGuildName(pname)

  				if cname == pname then
  					selfSay('Aby ustapic z przywodztwa napisz pass.')
  					talk_state = 0
  				elseif gname == gname2 then
  					gstat = getPlayerGuildStatus(pname)

  					if gstat == INVITED then
  						selfSay('Sorry, ' .. pname .. ' nie dolaczyl jeszcze do gildii.');
  						talk_state = 0
  					elseif gstat == VICE then
  						setPlayerGuildStatus(pname, MEMBER)
  						selfSay(pname .. ' zostal wlasnie normalnym czlonkiem.')
  						talk_state = 0
  					elseif gstat == MEMBER then
  						selfSay(pname .. ' jest juz normalnym czlonkiem.')
  						talk_state = 0
  					end
  				else
  					selfSay('Sorry, ' .. pname .. ' nie jest w tej gildii.')
  					talk_state = 0
  				end

  			elseif talk_state == 11 then	-- get name of player to change nick
  				pname = msg
				gname = getPlayerGuildName(cname)
  				gname2 = getPlayerGuildName(pname)

  				if gname == gname2 then
  					selfSay('Jaki tytul ma miec ta osoba (napisz none aby wyczyscic tytul)?')
  					talk_state = 12
  				else
  					selfSay('Sorry, ' .. pname .. ' nie jest w tej gildii.')
  					talk_state = 0
  				end

  			elseif talk_state == 12 then	-- get nick
  				if msg == 'none' then
  					setPlayerGuildNick(pname, '')
  					selfSay(pname .. ' teraz nie ma zadnego tytulu.')
  					talk_state = 0
  				else
  					if string.len(msg) <= maxnicklen then
 						if string.find(msg, allow_pattern) then
 							setPlayerGuildNick(pname, msg)
 							selfSay('Zmieniles ' .. pname .. '\'s tytul.')
 							talk_state = 0
 						else
							selfSay('Tytul zawiera niepoprawne znaki.')
 							talk_state = 0
 						end
  					else
  						selfSay('Tytul nie moze byc dluzszy niz ' .. maxnicklen .. ' liter.')
  						talk_state = 0
  					end
  				end
  			end
  		end
  	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
	doNpcSetCreatureFocus(focus)
  	if (os.clock() - talk_start) > 45 then
  		if focus > 0 then
  			selfSay('Nastepny...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Nara, '.. cname ..'.')
 			focus = 0
 		end
 	end
end

Testowalem to tylko na tibii 8.1 Evo
Jakby ktos zauwazyl jakas liter?wke prosze o PW.
!!UWAGA!!
Zezwalam na Kopiowanie i rozprowadzanie mojego w 100% spolszczonego Guild Mastera :) Ale je?eli ju? wstawiacie go na inne fora to musicie na ko?cu napisa? "Autor Pacyna86".
@anbu
dzi?ki ju? poprawi?em :)
 
Odp: [Guild Master][100%Spolszczony]

Super. Wreszcie kto? to porz?dnie zrobi? :up: . Raczej nie ma liter?wki. NPC w 100% dzia?a,
10/10

Pozdro :o
 
Odp: [Guild Master][100%Spolszczony]

Jest liter?wka
Kod:
elseif gstat == LEADER then
  					selfSay('Jetes [COLOR="Red"]iderem.[/COLOR] Czy na pewno chcesz opuscic gildie?')
  					talk_state = 7
przeglada?em na szybko
 
Ostatnia edycja:
Odp: [Guild Master][100%Spolszczony]

Jednak ch?opak si? postara?.. Szkoda, ?e Guild Master jest ju? nieprzydatny do 8.3+, ale kto? mo?e wykorzysta.
 
Odp: [Guild Master][100%Spolszczony]

@up
Chyba ?e kto? nie zna si? na SQL i robi ots XML to mu si? przyda

//Nie ma ots?w o silniku XML powy?ej 8.1. Sey

@EDIT
Ale ja nie twierdzi?em ?e to ma by? +8.1:P
 
Ostatnia edycja:
Odp: [Guild Master][100%Spolszczony]

Ja mam taki blad !
bladf.jpg
 
Odp: [Guild Master][100%Spolszczony]

@up Czyli brakuje Ci 2x end ,aby zamkn?? funkcje. :confused:
 
Odp: [Guild Master][100%Spolszczony]

Szkoda ?e nie dzia?a pod tibie 7.6 :(
 
Odp: [Guild Master][100%Spolszczony]

Thx Przyda mi sie na ots heh 100% dziala 10/10 THX
 
Odp: [Guild Master][100%Spolszczony]

mo?e byc [GRACZ][/GRACZ]dzieki za pomoc dostajesz +++ plusy:thx::thx::thx::thx::thx::thx::thx::thx::thx::thx::thx::thx::thx: :D
 
Odp: [Guild Master][100%Spolszczony]

?wietny Skrypt Bior? Go :D ?adnych b??d?w i w 100% Spolszczony wreszcie :D 10/10 + reput
 
Odp: [Guild Master][100%Spolszczony]

Bardzo fajnie postarales sie Mi dziala na ots 100% spolszczenia.
 
Odp: [Guild Master][100%Spolszczony]

Bardzo fajny pomysl i dobre wykonanie thx za skrypt i pozdro
 
Odp: [Guild Master][100%Spolszczony]

?wietny wezme go,thx za skrypt u?atwi?e? mi szukanie go ;)
 
Odp: [Guild Master][100%Spolszczony]

THX przydalo sie uwazam ze skrypcik bardzo przydatny i potrzebny dla osobek ktore angielski slabo znaja a w ots sie bawia (ja nimi nie jestem)
Takze bardzow ielkie thgx za skrypcik 10/10
I pozdrawiam czekam na wiecej spolszczonych npc (robie 2 servy angielski i polski)
 
Status
Zamknięty.
Back
Do góry