Quest - nie moge zrobi?

Status
Zamknięty.

Marlus

Advanced User
Zarejestrowany
Dołączył
Sierpień 26, 2010
Posty
168
Liczba reakcji
7
Mam problem z questem, poniewa? nie mam tych skrypt?w nowych pod TFS 0.3.6 i dlatego nie dzia?aj? mi skrypty kt?re robie! Jest to WAR mo?e kto? mi pom?c?

Pozdrawiam,
Marlus
 
Odp: Quest - nie moge zrobi?

Je?li chodzi ci o to, ?e skrzynia questowa nie dzia?a to prosz?, oto skrypt:


PHP:
local specialQuests = {
	[2001] = 30015 --Annihilator
}

local questsExperience = {
	[30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
		return true
	end

	local storage = specialQuests[item.actionid]
	if(not storage) then
		storage = item.uid
		if(storage > 65535) then
			return false
		end
	end

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		return true
	end

	local items = {}
	local reward = 0

	local size = isContainer(item.uid) and getContainerSize(item.uid) or 0
	if(size == 0) then
		reward = doCopyItem(item, false)
	else
		for i = 0, size do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				table.insert(items, tmp)
			end
		end
	end

	size = table.maxn(items)
	if(size == 1) then
		reward = doCopyItem(items[1], true)
	end

	local result = ""
	if(reward ~= 0) then
		local ret = getItemDescriptions(reward.uid)
		if(reward.type > 0 and isItemRune(reward.itemid)) then
			result = reward.type .. " charges " .. ret.name
		elseif(reward.type > 0 and isItemStackable(reward.itemid)) then
			result = reward.type .. " " .. ret.plural
		else
			result = ret.article .. " " .. ret.name
		end
	else
		if(size > 20) then
			reward = doCopyItem(item, false)
		elseif(size > 8) then
			reward = getThing(doCreateItemEx(1988, 1))
		else
			reward = getThing(doCreateItemEx(1987, 1))
		end

		for i = 1, size do
			local tmp = doCopyItem(items[i], true)
			if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
				print("[Warning] QuestSystem:", "Could not add quest reward")
			else
				local ret = ", "
				if(i == 2) then
					ret = " and "
				elseif(i == 1) then
					ret = ""
				end

				result = result .. ret
				ret = getItemDescriptions(tmp.uid)
				if(tmp.type > 0 and isItemRune(tmp.itemid)) then
					result = result .. tmp.type .. " charges " .. ret.name
				elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then
					result = result .. tmp.type .. " " .. ret.plural
				else
					result = result .. ret.article .. " " .. ret.name
				end
			end
		end
	end

	if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
		result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
	else
		result = "You have found " .. result .. "."
		setPlayerStorageValue(cid, storage, 1)
		if(questsExperience[storage] ~= nil) then
			doPlayerAddExp(cid, questsExperience[storage])
			doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
	return true
end


PHP:
    <action actionid="2000" event="script" value="quests/system.lua"/>
    <action actionid="2001" event="script" value="quests/system.lua"/>
 
Odp: Quest - nie moge zrobi?

Aha ale ten system quest?w dzia?a na nowej zasadzie czy na starej?
 
Odp: Quest - nie moge zrobi?

Skrzynce nadajesz actionid: 2000 w Uniqueid wpisujesz obojetnie, jest to storage, i w czarnym kwardaciku wybierasz item

@down

Nom, tylko Twoj sposob troszke nie dziala =/
 
Ostatnia edycja:
Odp: Quest - nie moge zrobi?

Skrzynce nadajesz actionid: 2000 w Uniqueid wpisujesz obojetnie, jest to storage, i w czarnym kwardaciku wybierasz item

Je?li nie wiesz to na chuj si? wypowiadasz?

#Marlus
Po prostu je?li w map edytorze nadasz skrzyni uid przypu??my dsm to po otworzeniu skrzyni otrzymamy ow? zbroj?.
 
Odp: Quest - nie moge zrobi?

ja znam doskona?y spos?b kt?ry mi pom?g? mia?em to samo m?czy?em sie tygodniami ale ju? wiem ;D
Tworzysz np item10.lua
--noobson1
function onUse(cid, item, frompos, item2, topos)

if item.uid ==9990 then -Liczby kt?re wpiszesz w skrzynce uniqueid (zmieniasz za ka?dym razem np 9991....
queststatus = getPlayerStorageValue(cid,9209) tego nie wpisujesz tylko gdy robisz nowy quest to samo co wy?ej zmieniasz liczby np 9210...
if queststatus == 1 then
doPlayerSendTextMessage(cid,22,"This Chest is empty.") Tekst kt?ry pokazuje sie gdy ju? zrobili?my wcze?niej quest

else
doPlayerSendTextMessage(cid,22,"Lap item") Tekst kt?ry b?dzie sie wy?wietla? podczas otwierania skrzynki.
doSendMagicEffect(topos,12)
coins_uid = doPlayerAddItem(cid,8870,1) 8870-ID Itemu
setPlayerStorageValue(cid,9209,1) wpisujesz tylko gdy robisz nowy quest to samo co wy?ej zmieniasz liczby np 9210... maj? by? te same co wy?ej da?em z (cid,9209,1)
end
return 0
end
return 1
end
Actions.xml
<action uniqueid="9990" script="item10.lua" />
pozniej tworzysz kolejne questy i wype?niasz oczywi?cie zmieniasz
action uniqueid na to co da?e? w lua.
Teraz w skrzynce dajesz Actionnid -Id itemu
uniqueid -9990 <- jesli takie ustawisz jak ja poda?em
za ka?dym razem zmieniasz w actions.xml i w lua to uniqueid!
Pami?taj ?e czarne pola w skrzynce zostawia? puste !
Mam nadzieje ?e pomog?em ! ;]
 
Odp: Quest - nie moge zrobi?

@up
rozjeba?e? mnie,ty my?lisz ?e za ka?dym razem trzeba nowego lua robi??
To jakby tak by?o to by ci silnik z real map? si? ?adowa? godzinami tyle skrypt?w by by?o.
A spos?b [USER]andy1995[/USER] dzia?a bo testowa?em.
 
Odp: Quest - nie moge zrobi?

Czy wy rozumiecie, ?e nie mam systemu quest?w i mi nie dzia?a ten spos?b co poda? andy?

nigdzie nie moge znale?? skrypt?w na questy.
 
Odp: Quest - nie moge zrobi?

Dziki Johnson kolego ja m?wi? tu o nowych questach a nie tych co s? ju? dodane mia?em problem ?e gdy tworzy?em quest on nie dzia?a? ja tego u?ywam i jak dodaje coraz to wi?cej nic mi sie d?u?ej nie ?aduje ....
Pozdrawiam noobson1
 
Odp: Quest - nie moge zrobi?

../data/actions/actions.xml
PHP:
<action actionid="2000" event="script" value="quests/system.lua"/>
../data/actions/scripts/system.lua
PHP:
local specialQuests = {
	[2001] = 30015 --Annihilator
}

local questsExperience = {
	[30015] = 10000
}

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

	local storage = specialQuests[item.actionid]
	if(not storage) then
		storage = item.uid
		if(storage > 65535) then
			return false
		end
	end

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		return true
	end

	local items = {}
	local reward = 0

	local size = isContainer(item.uid) and getContainerSize(item.uid) or 0
	if(size == 0) then
		reward = doCopyItem(item, false)
	else
		for i = 0, size do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				table.insert(items, tmp)
			end
		end
	end

	size = table.maxn(items)
	if(size == 1) then
		reward = doCopyItem(items[1], true)
	end

	local result = ""
	if(reward ~= 0) then
		local ret = getItemDescriptions(reward.uid)
		if(reward.type > 0 and isItemRune(reward.itemid)) then
			result = reward.type .. " charges " .. ret.name
		elseif(reward.type > 0 and isItemStackable(reward.itemid)) then
			result = reward.type .. " " .. ret.plural
		else
			result = ret.article .. " " .. ret.name
		end
	else
		if(size > 20) then
			reward = doCopyItem(item, false)
		elseif(size > 8) then
			reward = getThing(doCreateItemEx(1988, 1))
		else
			reward = getThing(doCreateItemEx(1987, 1))
		end

		for i = 1, size do
			local tmp = doCopyItem(items[i], true)
			if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
				print("[Warning] QuestSystem:", "Could not add quest reward")
			else
				local ret = ", "
				if(i == 2) then
					ret = " and "
				elseif(i == 1) then
					ret = ""
				end

				result = result .. ret
				ret = getItemDescriptions(tmp.uid)
				if(tmp.type > 0 and isItemRune(tmp.itemid)) then
					result = result .. tmp.type .. " charges " .. ret.name
				elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then
					result = result .. tmp.type .. " " .. ret.plural
				else
					result = result .. ret.article .. " " .. ret.name
				end
			end
		end
	end

	if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
		result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
	else
		result = "You have found " .. result .. "."
		setPlayerStorageValue(cid, storage, 1)
		if(questsExperience[storage] ~= nil) then
			doPlayerAddExp(cid, questsExperience[storage])
			doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
	return true
end

I potem w map edytorze zrob jak pisalem UP, a jezeli nie zadziala to radze kupic nowy komputer =/
@down
Oczywiscie, ze nie. Zartuje xD
 
Ostatnia edycja:
Odp: Quest - nie moge zrobi?

Zobacze czy zadzia?a, a co do nowego kompa to niby z jakiej racji? To chyba nie wina komputera ?e na tym silniku nie ma systemu ^^

@UP
Aha, to itemki dodawa? w te kratki tak/
 
Ostatnia edycja:
Odp: Quest - nie moge zrobi?

DZIA?A ALL! Lec? reputki,

TEMAT DO ZAMKNI?CIA!
 
Status
Zamknięty.
Back
Do góry