[Quest]Prevent switch bot

02/19/2014 14:39 Pedr0caz&Saddler#1
Hey, here's my old quest to prevent switch bot:
Code:
quest switch begin
	state start begin
		function switchItem()
			local a = number(1, 10) -- set here how much ids you want
			local item_list = {X,X,X,X,X,X,X,X,X,X} -- if you set more than 10 in top then you need to add here
			local give = true
			
			for k,v in ipairs(item_list) do
				if pc.count_item(v) >= 1 then
					give = false
				end
			end
			
			if give == false or pc.get_empty_inventory_count() < 1 then
				say_title("Title")
				say("")
				say_reward("Message error for dont have more than 1 pack on inventory")
				return
			end
			setskin(NOWINDOW)
			pc.give_item2(item_list[a], 50) -- you can set here the quantity of received item
		end
			
		when X.use begin -- dont forget to set here a NPC or item
			switch.switchItem()
		end
	end
end
After add the quest to server

Go to item_proto client/server
Search for 71084, copy the line
Then change only the ID's you put in the quest.
The name can be the same in all, just change the ID's

You need to give path in item_list and item_desc, just change the ID's.

Kind Regards
02/19/2014 14:45 Mr. 'Avenue™#2
Code:
quest switch begin
	state start begin
		function switchItem()
			local a = number(1, table.getn(item_list))
			local item_list = {X,X,X,X,X,X,X,X,X,X} -- if you set more than 10 in top then you need to add here
			local give = true
			
			for k,v in ipairs(item_list) do
				if pc.count_item(v) >= 1 then
					give = false
				end
			end
			
			if give == false or pc.get_empty_inventory_count() < 1 then
				say_title("Title")
				say("")
				say_reward("Message error for dont have more than 1 pack on inventory")
				return
			end
			setskin(NOWINDOW)
			pc.give_item2(item_list[a], 50) -- you can set here the quantity of received item
		end
			
		when X.use begin -- dont forget to set here a NPC or item
			switch.switchItem()
		end
	end
end
02/20/2014 00:35 .PolluX#3
Nice wenn sie geht - hat schon wer getestet?
02/20/2014 02:09 Pedr0caz&Saddler#4
Quote:
Originally Posted by .Poᴌᴌuᶍ View Post
Nice wenn sie geht - hat schon wer getestet?
I use that like.. 1 year, works perfectly.

Regards
02/20/2014 22:07 al3na66#5
tnx for share
02/21/2014 14:40 thespeedyy#6
ok und was bringt das jetzt? :D
02/22/2014 01:30 barbaques#7
Hello man. I didnt understand what i should do...
Can you give some examples please?
[Mine ID for Bonus Switch: 71084]
Now what should i do? :/
02/22/2014 08:15 paulbiris97#8
same for me..I don't get where should we write that things
02/22/2014 10:57 Pedr0caz&Saddler#9
Quote:
Originally Posted by barbaques View Post
Hello man. I didnt understand what i should do...
Can you give some examples please?
[Mine ID for Bonus Switch: 71084]
Now what should i do? :/
Just copy the ID 71084 for other lines(make new ones)
Then change the ID's instead 71084..

Like that

Code:
	<Item vnum="71084"  name="Àç°æºñ¼*" gb2312name="Feitiço para Itens" type="3" subtype="18" weight="0" size="1" antiflag="74112" flag="8196" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="0" socket2="0" socket3="0" socket4="0" socket5="0" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />

	<Item vnum="69696"  name="Àç°æºñ¼*" gb2312name="Feitiço para Itens" type="3" subtype="18" weight="0" size="1" antiflag="74112" flag="8196" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="0" socket2="0" socket3="0" socket4="0" socket5="0" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />

	<Item vnum="72378"  name="Àç°æºñ¼*" gb2312name="Feitiço para Itens" type="3" subtype="18" weight="0" size="1" antiflag="74112" flag="8196" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="0" socket2="0" socket3="0" socket4="0" socket5="0" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
You just change the ID, ingame nobody knows what the ID is, just see the same icon and the same name :)


Then edit the item_list.txt

Code:
71084	ETC	icon/item/71084.tga
69696	ETC	icon/item/71084.tga
72378	ETC	icon/item/71084.tga
After that just put item_desc.txt

Code:
71084	Feitiço para Itens	Roda os 5 primeiros bónus de um equipamento com bónus.

69696	Feitiço para Itens	Roda os 5 primeiros bónus de um equipamento com bónus.

72378	Feitiço para Itens	Roda os 5 primeiros bónus de um equipamento com bónus.

In Quest
Code:
local item_list = {71084, 69696, 72378} -- in that case, you can add more.
This is portuguese language but i hope you understand now.

Regards.
02/22/2014 14:43 barbaques#10
Uh, i am really bad.
Can you make it through tv or what ? Thanks a lot for your instant response! :)