What's new

Skrypt na quest tfs

Status
Not open for further replies.

$peqto

Senior User
Joined
Jun 20, 2008
Messages
797
Reaction score
69
Szuka?em ale nie mog?em znale?? ?adnego skryptu kt?ry dzia?a? by na tfs'ie 8.42 na quest. Pom??cie i zapodajcie skrypt na quest :p
 

Maximuss

Advanced User
Joined
May 23, 2009
Messages
447
Reaction score
17
Odp: Skrypt na quest tfs

@Up Daje Skrypt Nie jest M?j
Daje Skrypt :
W Actions/Scripts/Quests/ tworzymy plik quest_system.lua

HTML:
unction onUse(cid, item, fromPosition, itemEx, toPosition)
local count = {
[1000] = 1
}
local level = {
[1000] = 8
}
local itemid = {
[1000] = 10001
}
local storageid = {
[1000] = 10001
}
local expierence = {
[1000] = 100
}
local exp = expierence[item.uid]
local storage = storageid[item.uid]
local queststatus = getPlayerStorageValue(cid, storage)
local itemid = itemid[item.uid]
local count = count[item.uid]
local itemname = getItemNameById(itemid)
local needlvl = level[item.uid]
local need = "You must have ".. needlvl .." level to get reward."
local found_one = "You have found ".. itemname .."."
local found_more = "You have found ".. count .." of ".. itemname .."."
local empty = "This ".. getItemNameById(item.itemid) .." is empty."
	if queststatus == -1 and getPlayerLevel(cid) >= needlvl and count == 1 then
			doPlayerSetStorageValue(cid, storage, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_one)
			doPlayerAddItem(cid, itemid, count)
			doPlayerAddExp(cid, exp)
			doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
			return TRUE
	elseif queststatus == -1 and getPlayerLevel(cid) >= needlvl and count > 1 then
			doPlayerSetStorageValue(cid, storage, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_more)
			doPlayerAddItem(cid, itemid, count)
			doPlayerAddExp(cid, exp)
			doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
			return TRUE
	elseif getPlayerLevel(cid) < needlvl then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, need)
	elseif queststatus > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, empty)
end
		return TRUE
end

W actions.xml
HTML:
<action actionid="1000" script="quests/quest_system.lua" />
O to ci chodzi?o..
Pozdrawiam
 

$peqto

Senior User
Joined
Jun 20, 2008
Messages
797
Reaction score
69
Odp: Skrypt na quest tfs

Nie wychodzi co? xd
Wyja?nij od pocz?tku do ko?ca co zrobi?, co zmieni? w tym skrypcie aby to dzia?a?o itd.
 

Amino12

Advanced User
Joined
Jun 12, 2008
Messages
292
Reaction score
48
Odp: Skrypt na quest tfs

Code:
[B]f[/B]unction onUse(cid, item, fromPosition, itemEx, toPosition)
local count = {
[1000] = 1
}
local level = {
[1000] = 8
}
local itemid = {
[1000] = 10001
}
local storageid = {
[1000] = 10001
}
local expierence = {
[1000] = 100
}
local exp = expierence[item.uid]
local storage = storageid[item.uid]
local queststatus = getPlayerStorageValue(cid, storage)
local itemid = itemid[item.uid]
local count = count[item.uid]
local itemname = getItemNameById(itemid)
local needlvl = level[item.uid]
local need = "You must have ".. needlvl .." level to get reward."
local found_one = "You have found ".. itemname .."."
local found_more = "You have found ".. count .." of ".. itemname .."."
local empty = "This ".. getItemNameById(item.itemid) .." is empty."
	if queststatus == -1 and getPlayerLevel(cid) >= needlvl and count == 1 then
			doPlayerSetStorageValue(cid, storage, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_one)
			doPlayerAddItem(cid, itemid, count)
			doPlayerAddExp(cid, exp)
			doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
			return TRUE
	elseif queststatus == -1 and getPlayerLevel(cid) >= needlvl and count > 1 then
			doPlayerSetStorageValue(cid, storage, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_more)
			doPlayerAddItem(cid, itemid, count)
			doPlayerAddExp(cid, exp)
			doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
			return TRUE
	elseif getPlayerLevel(cid) < needlvl then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, need)
	elseif queststatus > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, empty)
end
		return TRUE
end

on da? bez f-unction, popraw to a tera t?umacze,
[1000] zmieniasz na taki actionid jaki ustawi?e? w map edytorze,
count - ilo?? przedmiot?w
level - od jakiego lvla quest
itemid - id przedmiotu-nagrody
storageid - numer questu
experience - ilo?? expa kt?re ci daje quest,
gdy chcesz doda? drugi skrypt to dajesz w ka?dej zmiennej
np. [1001] = ... .

<action actionid="1000" script="quests/quest_system.lua" />
actionid to ten "numer questa", kt?ry da?e? w skrypcie czyli 1000, 1001 itd.
 

$peqto

Senior User
Joined
Jun 20, 2008
Messages
797
Reaction score
69
Odp: Skrypt na quest tfs

Nie wiem ju? co nie tak xD
Zrobi?em tak:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local count = {
[9658] = 1
}
local level = {
[9658] = 8
}
local itemid = {
[9658] = 2489
}
local storageid = {
[9658] = 10001
}
local expierence = {
[9658] = 0
}
local exp = expierence[item.uid]
local storage = storageid[item.uid]
local queststatus = getPlayerStorageValue(cid, storage)
local itemid = itemid[item.uid]
local count = count[item.uid]
local itemname = getItemNameById(itemid)
local needlvl = level[item.uid]
local need = "You must have ".. needlvl .." level to get reward."
local found_one = "You have found ".. itemname .."."
local found_more = "You have found ".. count .." of ".. itemname .."."
local empty = "This ".. getItemNameById(item.itemid) .." is empty."
if queststatus == -1 and getPlayerLevel(cid) >= needlvl and count == 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_one)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif queststatus == -1 and getPlayerLevel(cid) >= needlvl and count > 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_more)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif getPlayerLevel(cid) < needlvl then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, need)
elseif queststatus > 0 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, empty)
end
return TRUE
end

i dalej nie dzia?a :p
 

Amino12

Advanced User
Joined
Jun 12, 2008
Messages
292
Reaction score
48
Odp: Skrypt na quest tfs

a doda?e? linijk?
Code:
<action actionid="9658" script="quests/quest_system.lua" />
i w map edytorze zmieni?e? actionid i uniqueid skrzynki na 9658?
 

$peqto

Senior User
Joined
Jun 20, 2008
Messages
797
Reaction score
69
Odp: Skrypt na quest tfs

Gdy kto? nie ma 8 lvl to dzia?a poprawnie i pokazuje ?e nie ma 8 lvl.
Jednak gdy kto? z 8 lvlem pr?buje wzi?? to skrzynka si? otwiera( nie mo?na jej przepcha? ani na ni? wej?? jak na quest) a nie daje nagrod? xd
Taki b??d w silniku wyskakuje gdy kto? pr?buje wzi??:


up
Zrobi?em to tyle ze dark armor zamiast quest_system ale to chyba r??nicy nie robi bo tak nazwa?em plik i tak wpisa?em w actions xml.
 

Amino12

Advanced User
Joined
Jun 12, 2008
Messages
292
Reaction score
48
Odp: Skrypt na quest tfs

pozamieniaj w skrypcie wszystkie
doPlayerSetStorageValue
na
setPlayerStorageValue
 

$peqto

Senior User
Joined
Jun 20, 2008
Messages
797
Reaction score
69
Odp: Skrypt na quest tfs

Zadzia?a?o, polecam ten skrypt xd

Notka moderatorska:
Skoro problem rozwi?zany, zamykam.
 
Last edited by a moderator:
Status
Not open for further replies.
Top