Jump to content
×
×
  • Create New...

Event System


Aveline™

Recommended Posts

  • Moon

M2 Download Center

This is the hidden content, please
( Internal )

I'll share a little quest with your :P

 

Quest:

---------------------------------------------------------------
--- Copyright (c) 2014-2015 by  HaveBeen
---------------------------------------------------------------
quest events begin
	state start begin
		function event()
			local data = {}
			data.eventName = {"Event Tanaka","Rain Metin","Event Mob","Close"}
			data.what_do = {
				[1] = {
					["mapIndexs"] = {1,21,41}, -- For Shinsoo,Chunjo,Jinno					
					["regenMode"] = true,
					["regenFile"] = "data/event/tanaka.txt",					
				},
				[2] = {
					["mapIndexs"] = {1,21,41}, -- For shinsoo,Chunjo,Jinno
					["regenMode"] = true,
					["regenFile"] = "data/event/metin.txt",
				},
				[3] = {
					["mapIndexs"] = {1,21,41}, -- For shinoso,Chunjo,Jinno
					["regenMode"] = true,
					["regenFile"] = "data/event/mob.txt",					
				},
			}
			data.notices = {
				[1] = {"EVENT_TANAKA","CLOSE_METIN"},
				[2] = {"EVENT_RAIN_METIN","CLOSE_METIN"},
				[3] = {"EVENT_MOB","CLOSE_METIN"},
			}
			data.eventFlags = {
				[1] = "tanaka",
				[2] = "rainmetin",
				[3] = "eventmob",
			}
			return data
		end
		when letter with pc.is_gm() and pc.name == "HaveBeen™" begin
			send_letter("Launch Event")
		end
		when button or info begin
			say_title("Launch Event:")
			say("")
			---
			say("Please select event.")
			say("")
			local data = events.event()
			local s = select_table(data.eventName)
			say_title("Launch Event:")
			say("")
			---
			if(s >= table.getn(data.eventName)) then
				return
			end
			say_title(string.format("%s:",data.eventName[s]))
			say("")
			---
			if(game.get_event_flag("event_"..data.eventFlags[s]) > 0) then
				say("Do you want to stop "..data.eventName[s].." ? ")
				say("")
				if(select(locale.yes,locale.no) >= 1) then
					say("Event is closing, please wait..")
					game.set_event_flag("event_"..data.eventFlags[s],0)
					notice_multiline(data.notices[s][2])
				end
			else
				say("Event opening, please wait..")
				say("")
				notice_multiline(data.notices[s][1])
				game.set_event_flag("event_"..data.eventFlags[s],1)
				for i = 1,table.getn(data.what_do[s]["mapIndexs"]), 1 do
					regen_in_map(data.what_do[s]["mapIndexs"][i],data.what_do[s]["regenFile"])
				end
			end
		end
	end
end

I hope you're like it.

 

Regards.

  • Metin2 Dev 14
  • Love 12
  • Lmao 1
  • Think 1
  • Dislove 1

Plain logic saves lives.

Link to comment
Share on other sites

  • Moon

can u show examples for the tanaka.txt metin.txt mob.txt ?

 

and where are the informations about the data.notice?

 

data.notice has 2 text.

 

First is when event is opened, show 1 text. Another is when event is closed, show 2 text.

 

This system like dungeon system. You should be look at regen files.

 

Regards.

Plain logic saves lives.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 7

      Wear (use) item only on specific map

    2. 4

      Python tool for analyzing average yang drop per hour in each map.

    3. 162

      Plechito - Halloween 2022

    4. 0

      disable quest esc

    5. 7

      Wear (use) item only on specific map

    6. 7

      Wear (use) item only on specific map

    7. 7

      Wear (use) item only on specific map

    8. 4

      max level exp

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.