• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Podpowiedz fachowca?

Backy

Vivere militare est
Joined
Feb 25, 2009
Messages
157
Reaction score
2
Location
P(r)oland/Sanok
Witam rodaków.
Panowie mianowicie trzeba mi pomocy jakiegoś dobrego skryptera.
Jestem w sumie na poziomie rozumienia lua.
Chciałbym żeby jakiś dobry w tych sprawach użytkownik, udzielił się co do tego skryptu.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if currentVoc > 9 and currentVoc < 12 then
        doPlayerSendCancel(cid,'Wybacz, osiagnoles juz stan transformacji!')
    else
        if doRemoveItem(item.uid,ITEM-ID)
     currentVoc = getPlayerVocation(cid)
    if currentVoc > 0 and currentVoc < 8 then
            doPlayerSetVocation(cid, currentVoc+4)
        end
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Skonczyles medytacje, awansowales na klase wyzej!')
        else
            doPlayerSendCancel(cid, "Musisz miec (NAZWAITEMU), aby dokonac transformacji!")
        end
    end    
    return 1
end

Czy taki skrypt by działał ?
Tak że przykładowo z Master Sorcera, po użyciu itemu X postać otrzymuje "epic" promocje ?

@edit
Jeszcze jedna prośba, ma ktoś dobry program do lua?

Pozdrawiam i proszę nie offtopic'ować.
 
Last edited:
doRemoveItem(cid, item.uid)

currentVoc = getPlayerVocation(cid)
daj pod onuse

doPlayerSetVocation(cid, currentVoc + 4)

doPlayerSendCancel(cid, "Musisz miec (NAZWAITEMU), aby dokonac transformacji!")
Jest chyba funkcja getItemNamebyid(item)
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local promotionLevel = getPlayerPromotionLevel(cid)
	if(promotionLevel == 2) then
		doPlayerSendCancel(cid, "Wybacz, osiagnoles juz stan transformacji!")
		return true
	end
	
	if(getPlayerItemCount(cid, ITEM_ID) >= 1) then
		doPlayerRemoveItem(cid, ITEM_ID, 1)
		doPlayerSetPromotionLevel(cid, 2)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Skonczyles medytacje, awansowales na klase wyzej!')
	else
		doPlayerSendCancel(cid, "Musisz miec (NAZWAITEMU), aby dokonac transformacji!")
	end
	return true
end
Chech, ale się namęczyłem chech. :)

Co do "programu" do LUA polecam Notepad++.
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerPromotionLevel(cid) == 1 then
		setPlayerPromotionLevel(cid, 2)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a master of your vocation!")
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid, "You need to be promoted in order to use this item.")
	end
	
	return true
end

Hermes, dzięki za tabulację :p
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerPromotionLevel(cid) == 1 then
		setPlayerPromotionLevel(cid, 2)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a master of your vocation!")
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid, "You need to be promoted in order to use this item.")
	end
	
	return true
end
 
A tą linijkę jak można zastąpić?
Code:
        if currentVoc > 9 and currentVoc < 12 then

Jeśli postać ma już promocję, to nie może ponownie użyć?

@edit
Sorka widzę że Piotrek1447 to zrobił.
 

Z "Save All" w polskiej wersji jak przyuwazylem na Twoim SS! :thumbup:

Tak w ogole Notepad++ jest dobry, ladnie koloruje, mozna fajnie re-placowac texty, zakladki itd. Ale zazwyczaj uzywam wordpada :D
 
#Chojrak
+1, notepad++ O/

1262869713_by_shymoon_500.jpg
 
Back
Top