What's new

Reborn

Status
Not open for further replies.

Rikimaru

Active User
Joined
Sep 26, 2008
Messages
85
Reaction score
3
Witam!
Prosi?bym aby kto? z Was zrobi? mi skrypt. G?ownie chodzi?oby oto aby gdy gracz wbije "xxx" lvl, i kliknie na item o ID "xxxx" to teleportuje do miasta o pozycji 1000:1000:7, pokazuje sie efekt magiczny, pokazuje sie tekst "xxx" oraz dostaje nowa profesje o numerze "xxx" .
Kto mi zrobi oczywi?cie reput !
Pozdrawiam serdecznie !

Notka moderatorska:
Problem rozwi?zany - zamykam.
 

Deyvv

Active User
Joined
Nov 3, 2010
Messages
69
Reaction score
8
Odp: Reborn

data/actions/scripts/nazwa.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
pos = [COLOR="Red"]{x=1000, y=1000, z=7}[/COLOR]
ppos = getCreaturePosition(cid)
if getPlayerLevel(cid) >= [COLOR="Lime"]100[/COLOR] and getPlayerVocation(cid) == [COLOR="orange"]5[/COLOR] then
doTeleportThing(cid, pos)
doSendMagicEffect(ppos, [COLOR="Blue"]14[/COLOR])
doPlayerSendTextMessage(cid, "tekst", [COLOR="White"]21[/COLOR])
doPlayerSetVocation(cid,[COLOR="Yellow"]10[/COLOR])
end
return TRUE
end

Pozycja.
Wymagany level.
Wymagana profesja.
Id efektu.
Rodzaj wiadomo?ci.
Id Profesji, w kt?r? zmienia.
Code:
<action itemid="id itemu" event="script" value="nazwa.lua"/>

Powinno gra?. :)
 
Last edited:

Rikimaru

Active User
Joined
Sep 26, 2008
Messages
85
Reaction score
3
Odp: Reborn

wszystko jest ok, tylko m?g?by? zmieni? co? z wymagana profesja ? Chcia?bym aby wszystkie profesje m?g?by si? zmieni? w lepsz?. I prosi?bym Cie jeszcze aby mo?na by?o u?y? ten item tylko 3 razy, oraz gdy nie b?dzie mia? wymaganego lvl na reborn z?by pisa?o
Code:
Niestety nie masz wymaganego poziomu na reborn
 
Last edited:

Deyvv

Active User
Joined
Nov 3, 2010
Messages
69
Reaction score
8
Odp: Reborn

Hm.. Something like this. xd
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
pos = {x=1000, y=1000, z=7}
ppos = getCreaturePosition(cid)
storage = getPlayerStorageValue(cid,33399)
if storage <= 3 then
if getPlayerLevel(cid) >= 100 then
setPlayerStorageValue(cid,33399,storage + 1)
doTeleportThing(cid, pos)
doSendMagicEffect(ppos, 14)
doPlayerSendTextMessage(cid, "tekst", 21)
doPlayerSetVocation(cid,10)
else
doPlayerSendTextMessage(cid, "Niestety nie masz wymaganego poziomu na reborn.", 21)
end
else
doPlayerSendTextMessage(cid, "Reborn mozesz wykonac tylko 3 razy.", 21)
end
return TRUE
end
 

Sassin

Forum friend
Joined
Jun 13, 2009
Messages
1,281
Reaction score
107
Odp: Reborn

Ka?dej profesji chcecie nadawa? nr 10 - tak? Jak przyjdzie knight z 100lvl i profesja 10 to jaka? odmiana druida, co w tedy?

PHP:
local config = {
pos = {x=1000, y=1000, z=7},
lvl = 100,
tekst1 = "PISZE JAK TELEPROTNIE GRACZA I WSZYSTKIE WARUNKI ZOSTANA SPELNOINE",
tekst2 = "PISZE JAK CIE NIE MA DANEJ PROFESI",
tekst3 = "PISZE JAK MA SIE ZA MALY LVL",
tekst4 = " PISZE JAK WYKONALO SIE JUZ MAXYMALNA ILOSC RAZY",
stor = 33399,
ile = 3,
prof = 4,
newprof = 8
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

local ppos = getCreaturePosition(cid)
local storage = getPlayerStorageValue(cid,config.stor)

	if (storage <= config.ile) then
		if (getPlayerLevel(cid) >= config.lvl) then
			if (getPlayerVocation(cid) == config.prof) then
				setPlayerStorageValue(cid, config.stor, storage + 1)
				doPlayerSetVocation(cid, config.newprof)
				doTeleportThing(cid, config.pos)
				doSendMagicEffect(ppos, 14)
				doSendMagicEffect(config.pos, 14)
				doPlayerSendTextMessage(cid, "..tekst1..", 21)
			else
				doPlayerSendCancel(cid, "..tekst2..")
			end
		else
			doPlayerSendCancel(cid, "..tekst3..")
		end
	else
		doPlayerSendCancel(cid, "..tekst4..")
	end
return TRUE
end

Ca?y config jest do Twojej dyspozycji opisa?em tam jakie teksty, kiedy si? wy?wietlaj?, reszta to:

pos = {x=1000, y=1000, z=7}, -- na jaka pozycje teleportnie
lvl = 100, -- jaki lvl jest wymagany
stor = 33399, -- sotrage, lepiej zostaw
ile = 3, -- ile mo?na razy u?y? tego itemka
prof = 4, -- wymagana profesja
newprof = 8 -- profesja jaka nada po u?yciu
 
Status
Not open for further replies.
Top