What's new
  • logo_cipsoft
    Latest servers:
    New servers will open on: 19th Feb 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Actions Prosty Exp Scroll (Nie Testowany)

Status
Not open for further replies.

adissko

Active User
Joined
Dec 19, 2009
Messages
70
Reaction score
1
cooltext1_neanxwe.png


ExpScroll_neanxwq.png


cooltext1_neanxsw.png


Exp Scroll - Rzecz kt?ra po klikni?ciu na ni? w grze dodaje expa graczowi. Exp Scroll mozna uzyc tylko od 200 levela.

cooltext1_neanxaa.png


Wejdz w folder Data->Actions
Nastepnie wejdz w plik actions.xml

Znajdz :
Code:
<!-- Other -->

Ponizej dodaj :
Code:
<action itemid="9004" event="script" value="other/expscroll.lua"/>

Nastepnie wejdz w folder Scripts->Other
Stw?rz plik o nazwie expscroll.lua

Do pliku wklej :
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) == 200) then
	doPlayerAddExp(cid, 100000)
	doPlayerRemoveItem(cid, 9004 ,1) 
	
elseif(getPlayerLevel(cid) > 200) then
	doPlayerSendTextMessage(cid, 4, "Masz Wiekszy Level niz 200. Nie Mozesz Uzyc Exp Scrolla !")

elseif(getPlayerLevel(cid) < 200) then
	doPlayerSendTextMessage(cid, 4, "Masz Mniejszy Level niz 200. Nie Mozesz Uzyc Exp Scrolla !")
	
end
 

Raa

Senior User
Joined
Aug 9, 2009
Messages
715
Reaction score
50
Age
30
Odp: Prosty Exp Scroll (Nie Testowany)

B. rozwini?ty skrypt. Do tego pi?knie napisany.

.
Code:
reqLv=200
local texts = {"Exp dodany", "Za maly lv", "Za duzy lv"}
function useScroll(cid)
	return getPlayerLevel(cid)>reqLv and 3 or getPlayerLevel(cid)<reqLv and 2 or 1
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerAddExp(cid, useScroll(cid) == 1 and 100000 or 0)
	doPlayerSendTextMessage(cid, 4, texts[useScroll]);
	removeS = useScroll(cid)==1 and doPlayerRemoveItem(cid, 9004 ,1) or 0
	return true
end
Zrobi?em lepsz? wersje. Przy okazji w twoim skrypcie brakuje linijki "end".
 

Kahras

Senior User
Joined
Aug 26, 2011
Messages
2,714
Reaction score
167
Age
26
Odp: Prosty Exp Scroll (Nie Testowany)

Chujowo ?e tylko od 200 levla praktycznie nie op?acalne.
 

arcane

Active User
Joined
Jan 5, 2013
Messages
73
Reaction score
1
Odp: Prosty Exp Scroll (Nie Testowany)

Jakby? nie zauwa?y?, to minimalny level do u?ycia tego scrolla mo?na zmieni?.
 
Status
Not open for further replies.
Top