Jump to content

Recommended Posts

quest item_drop begin
	state start begin
		function GetMapIndex()
			local maps = {
				1, 3, 5, 21, 23, 25, 41.
			}
			for m in maps do
				if pc.get_map_index() == maps[m] then
					return true
				end
			end
			return maps
		end
		when 9006.click with pc.is_gm() begin
		local options = ("Metin drop", "Anuleaza")
		if options == 1 then
			if item_drop.GetMapIndex() == true then
				if game.get_event_flag("item_open") == 0 then
					say("Hello "..pc.get_name().." ")
					say("Aici pui codul itm-ului si acesta va pica din pietrele metin si boss")
					say("!REGULA!NU ABUZA DE ACEASTA FUNCTIE!")
					say("Vrei sa faci un event de genu asta?")
					if select("da","nu") == 2 then 
					return 
				end
					say("Introdu codul itemului care doresti sa fie dropat la metine si boss!")
					kill_item = tonumber(input()) or 0
					if kill_item == 0 then
						say("Datele au fost introduse gresit. Incercati din nou!")
						return
					end
				say("Sansa de drop trebuie sa fie 1,2,3 sau maxim 4,care vrei sa fie sansa dropului?")
				kill_prozent = tonumber(input()) or 0
				if kill_prozent == 0 then
					say("Datele au fost introduse gresit. Incercati din nou!")
					return
				end
				say("Acest event trebuie sa tina cel mult 2 ore,adica 120 minute,cat timp vrei sa se dropeze? Minute!")
				zeit = tonumber(input()) or 0
				if zeit == 0 then
					say("Datele au fost introduse gresit. Incercati din nou!")
					return
				end
			game.set_event_flag("item_time", get_time()+zeit*60)
			game.set_event_flag("item_open", 1)
			notice_all("Item drop activat")
			notice_all("Itemul "..item_name(kill_item).." este dropabil la pietre metin si boss!.")
			notice_all("Pentru "..zeit.." Minute")
		else
			say("Eventul metin drop este deja activ")
			say("Opriti eventul?")
			if select("Da", "NU")==2 then 
			return 
		end
			game.set_event_flag("item_open", 0)
			kill_prozent, kill_item = nil, nil
		end
			when 8001.kill or 8002.kill or 8003.kill or 8004.kill or 8005.kill or 8005.kill or 8006.kill or 8007.kill or 8008.kill or 8009.kill or 8010.kill or 8011.kill or 8012.kill or 8013.kill or 8014.kill or 8024.kill or 8025.kill or 8026.kill or 8027.kill or 591.kill or 691.kill or 791.kill or 1093.kill or 1095.kill or 1901.kill or 1304.kill or 2091.kill or 2191.kill with game.get_event_flag("item_open") == 1 and not npc.is_pc()begin
			if kill_prozent == nil then game.set_event_flag("item_open", 0) 
			return 
		end
			if game.get_event_flag("item_time") < get_time() then
				notice_all("Eventul metin drop a luat sfarsit!")
				notice_all("Multumim tuturor ce sunt alatori de noi la evenimente!")
				game.set_event_flag("item_open", 0)
				kill_prozent, kill_item = nil, nil
			return
		end
			local s=number(1, 101-kill_prozent)
			if s==1 then
				game.drop_item_with_ownership(kill_item, 1)
			end
		end
			when login with game.get_event_flag("item_open") == 1 begin
			notice("Event item drop este activat")
			notice("Itemul "..item_name(kill_item).." este dropabil la metine si boss.")
		end
	end

 

Hy!

I have this quest and I tryed 4 days to fix it,can someone help me please.When I compile appear killed message in putty and I don't know how to fix it. Thank for you support!

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

  • Premium

Indentation and code are indeed both romanian level. Also missing quite a few "end" here and there, no wonder it doesn't compile it.

 

Use of global vars is not recommended, either.

Edited by Syreldar

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

2 hours ago, Syreldar said:

Indentation and code are indeed both romanian level. Also missing quite a few "end" here and there, no wonder it doesn't compile it.

 

Use of global vars is not recommended, either.

With this quest I want to start drop from stones and boss,also can say me please where is missing this ends please? I can't observe where I must insert it,I'm begginer.

Link to comment
Share on other sites

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.