• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Skrypt

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Solutions
14
Reaction score
81
Witam, mam pewnie problem i proszę o pomoc.
Oto on:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local hp = {
	[1] = 5,
	[2] = 5,
	[3] = 10,
	[4] = 15}

	local mp = {
	[1] = 30,
	[2] = 30,
	[3] = 15,
	[4] = 5}

		if(doPlayerRemoveItem(cid,6104,1) == true) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"Magic Box took you... ~3 levels~.")
			doPlayerAddLevel(cid, -3)
			setCreatureMaxHealth(cid, 3*(-hp[getPlayerVocation(cid)]))
			setCreatureMaxMana(cid, 3*(-mp[getPlayerVocation(cid)]))
                        doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
		end

Chciałem żeby skrypt przy zabieraniu levela zmniejszał mane oraz hp w zależności od profesji. Lecz skrypt nie zabiera hp i mp. Ma może ktoś pomysł jak zrobić aby zawsze przy odejmowaniu 3 leveli w zależności od profesji odejmowało hp i mp ile przystaje na 3 levele?

Prosze o pomoc.
Pozdrawiam GarQet.
 
Last edited:
Działa ale nie do końca, nie wiem jak zrobić z tym aby odbierało tyle hp i mp ile przystaje graczowi na 3 levele. Bo to co jest w skrypcie nie działa. I tylko o to proszę.
 
Tutaj fragment środkowy skryptu: możesz wkleić go w jakieś warunki itd.

Code:
[COLOR="DarkOrange"]--Jako pierwszy element podajesz ile ta profesja dostaje hp przy level advance (o ile zwieksza sie pasek), a jako drugi ile many[/COLOR]
[COLOR="Lime"]--1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight[/COLOR]
perLevel = {
[[B][COLOR="Lime"]1[/COLOR][/B]] = {[COLOR="DarkOrange"][B]element 1[/B][/COLOR], [COLOR="DarkOrange"][B]element 2[/B][/COLOR]}
[[B][COLOR="Lime"]2[/COLOR][/B]] = {[COLOR="DarkOrange"][B]element 1[/B][/COLOR], [COLOR="DarkOrange"][B]element 2[/B][/COLOR]}
[[B][COLOR="Lime"]3[/COLOR][/B]] = {[COLOR="DarkOrange"][B]element 1[/B][/COLOR], [COLOR="DarkOrange"][B]element 2[/B][/COLOR]}
[[B][COLOR="Lime"]4[/COLOR][/B]] = {[COLOR="DarkOrange"][B]element 1[/B][/COLOR], [COLOR="DarkOrange"][B]element 2[/B][/COLOR]}
}
levelAmount = 3 --Ile leveli traci postac
doPlayerAddLevel(cid, levelAmount, 0)
doCreatureAddHealth(cid, -(perLevel[getCreatureVocation(cid)][1]*levelAmount))
doCreatureAddMana(cid, -(perLevel[getCreatureVocation(cid)][2]*levelAmount))

--by Freewolny

Działanie skryptu: odbiera graczowi ileś leveli (do ustawienia) i tyle many i hp, o ile zwiększył się mu pasek w ciągu tych leveli.
Przykład: koleś jest knightem. Traci 3 levele. Wiemy, że na level dostaje 30 hp i 20 many. Traci 3*30 = 90 hp i 3*20 = 60 many.
 
Last edited:
Hehe, nie działa.
Jak testowałem to crashowało silnik.
 
To już zamknij pysk i przestań spamować. Nic do temu nie wnosisz.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	perLevel = {
	[1] = {5,30},
	[2] = {5,30},
	[3] = {10,15},
	[4] = {15,5} }

		if(doPlayerRemoveItem(cid,6104,1) == true) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"Magic Box took you... ~3 levels~.")
			doPlayerAddLevel(cid, -3)
			levelAmount = 3
			doPlayerAddLevel(cid, levelAmount, 0)
			doCreatureAddHealth(cid, -(perLevel[getCreatureVocation(cid)][1]*levelAmount))
			doCreatureAddMana(cid, -(perLevel[getCreatureVocation(cid)][2]*levelAmount))
                        doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
		end
 
Proszę, oto kod:

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

	local perLevel = {
	[1] = {5,30},
	[2] = {5,30},
	[3] = {10,15},
	[4] = {15,5} }

		if(doPlayerRemoveItem(cid,6104,1) == true) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"Magic Box took you... ~3 levels~.")
			doPlayerAddLevel(cid, -3)
			local levelAmount = 3
			doPlayerAddLevel(cid, levelAmount, 0)
			doCreatureAddHealth(cid, -(perLevel[getCreatureVocation(cid)][1]*levelAmount))
			doCreatureAddMana(cid, -(perLevel[getCreatureVocation(cid)][2]*levelAmount))
                        doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
		end
 
Ahh... Wybacz mi, przeoczyłem jeszcze jedno... Daję ci jeszcze jedną wersję. I może byś powiedział, co wywala silnik?

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

	local perLevel = {
	[1] = {5,30},
	[2] = {5,30},
	[3] = {10,15},
	[4] = {15,5} }

		if(doPlayerRemoveItem(cid,6104,1) == true) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"Magic Box took you... ~3 levels~.")
			local levelAmount = 3
			doPlayerAddLevel(cid, -levelAmount)
			doCreatureAddHealth(cid, -(perLevel[getCreatureVocation(cid)][1]*levelAmount))
			doCreatureAddMana(cid, -(perLevel[getCreatureVocation(cid)][2]*levelAmount))
                        doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
		end
 
Jest błąd:
fb6bf0e4f52f.png.html


A skrypt jakoś dziwnie kasuje (tylko) życie.
 
Błędu w poście nie widać, bynajmniej u mnie. Spróbuj zwykłą postacią, nie żadnym GM'em ani God'em, może się uda.
 
Back
Top