Jump to content
Sign in to follow this  
tellon

Function Map

Recommended Posts

Hello, I would like to make a map that opens 1x a day, and that every day of the week has a different boss from Monday to Sunday. Thanks

Share this post


Link to post
Share on other sites

Make map a day:
Root>resource>mapname>ctrl.lua

function init_entry(map)

    SetMapEntryMapName(map, "garner")
    SetMapEntryTime(map, "2006/10/19/13/0", "1/0/0", "0/0/30", "0/0/50")

end

This will set map to open portal in argent everyday, portal open until :30 and close at :50

 

Summon monster

	local now_day= os.date("%d")		-------------ÈÕ          
	local now_hour= os.date("%H")		-------------ʱ          
	local now_miniute= os.date("%M")	-------------·Ö          
	local now_scend=  os.date("%S")	
	local Now_Week = GetNowWeek () -- 0= Sunday 1=Monday and etc
	local MapName = GetChaMapName(role)
	local Monster_ID = 215
	local Monster2_ID = 216
	local Monster3_ID = 217
	local Monster4_ID = 218
	local Monster5_ID = 219
	local Monster6_ID = 220
	local Monster7_ID = 221

	if MapName == "garner" then
		if Now_Week == 0 then
			SystemNotice ( role , "Sunday: Today's event is Orange Mystic Shrub" )
			local new1 = CreateCha(Monster_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 1 then
			SystemNotice ( role , "Sunday: Today's event is Snowy Mystic Shrub" )
			local new1 = CreateCha(Monster2_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 2 then
			SystemNotice ( role , "Sunday: Today's event is Red Mystic Shrub" )
			local new1 = CreateCha(Monster3_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 3 then
			SystemNotice ( role , "Sunday: Today's event is Dry Mystic Shrub" )
			local new1 = CreateCha(Monster4_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 4 then
			SystemNotice ( role , "Sunday: Today's event is Blue Mystic Shrub" )
			local new1 = CreateCha(Monster5_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 5 then
			SystemNotice ( role , "Sunday: Today's event is Purple Mystic Shrub" )
			local new1 = CreateCha(Monster6_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 6 then
			SystemNotice ( role , "Sunday: Today's event is Ancient Mystic Shrub" )
			local new1 = CreateCha(Monster7_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		else 
			Notice ( role , "There are no events! Enjoy!" )
		end
	end

Hopefully the summon new1 wont trigger any problems.
 

IDK if it works but u can try. NOT TESTED!

Share this post


Link to post
Share on other sites

I think the cleanest way to do so is as follow:

 

BossDay[0] = 678

BossDay[1] = 679

-- where index is the day of the week and value is the boss.

 

upon entering map, have a flag ready to determine whether boss is already summoned or not.

if flag is false then

  summon()

  set flag to true

otherwise

  return


kong.png

a2.png

Share this post


Link to post
Share on other sites
On 11/08/2017 at 8:54 PM, DangThao said:

Make map a day:
Root>resource>mapname>ctrl.lua


function init_entry(map)

    SetMapEntryMapName(map, "garner")
    SetMapEntryTime(map, "2006/10/19/13/0", "1/0/0", "0/0/30", "0/0/50")

end

This will set map to open portal in argent everyday, portal open until :30 and close at :50

 

Summon monster


	local now_day= os.date("%d")		-------------ÈÕ          
	local now_hour= os.date("%H")		-------------ʱ          
	local now_miniute= os.date("%M")	-------------·Ö          
	local now_scend=  os.date("%S")	
	local Now_Week = GetNowWeek () -- 0= Sunday 1=Monday and etc
	local MapName = GetChaMapName(role)
	local Monster_ID = 215
	local Monster2_ID = 216
	local Monster3_ID = 217
	local Monster4_ID = 218
	local Monster5_ID = 219
	local Monster6_ID = 220
	local Monster7_ID = 221

	if MapName == "garner" then
		if Now_Week == 0 then
			SystemNotice ( role , "Sunday: Today's event is Orange Mystic Shrub" )
			local new1 = CreateCha(Monster_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 1 then
			SystemNotice ( role , "Sunday: Today's event is Snowy Mystic Shrub" )
			local new1 = CreateCha(Monster2_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 2 then
			SystemNotice ( role , "Sunday: Today's event is Red Mystic Shrub" )
			local new1 = CreateCha(Monster3_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 3 then
			SystemNotice ( role , "Sunday: Today's event is Dry Mystic Shrub" )
			local new1 = CreateCha(Monster4_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 4 then
			SystemNotice ( role , "Sunday: Today's event is Blue Mystic Shrub" )
			local new1 = CreateCha(Monster5_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 5 then
			SystemNotice ( role , "Sunday: Today's event is Purple Mystic Shrub" )
			local new1 = CreateCha(Monster6_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		elseif Now_Week == 6 then
			SystemNotice ( role , "Sunday: Today's event is Ancient Mystic Shrub" )
			local new1 = CreateCha(Monster7_ID, 214800, 277700, 145, 30)
			SetChaLifeTime(new1, 90000)
		else 
			Notice ( role , "There are no events! Enjoy!" )
		end
	end

Hopefully the summon new1 wont trigger any problems.
 

IDK if it works but u can try. NOT TESTED!

Dont works for me :( but Thanks xD

Share this post


Link to post
Share on other sites
20 hours ago, KONG said:

I think the cleanest way to do so is as follow:

 

BossDay[0] = 678

BossDay[1] = 679

-- where index is the day of the week and value is the boss.

 

upon entering map, have a flag ready to determine whether boss is already summoned or not.

if flag is false then

  summon()

  set flag to true

otherwise

  return

Where I add that kong?

Share this post


Link to post
Share on other sites
1 hour ago, tellon said:

Where I add that kong?

function ItemUse_125Skill(role)
	local Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ~=  nil then
		SystemNotice( role , "Cannot use in boat" )
		UseItemFailed ( role )
		return
	end
	local cha_name = GetChaDefaultName(role)
	local RandomSkillT = {}

	RandomSkillT[1] =  7637
	RandomSkillT[2] =  7638
	RandomSkillT[3] =  7639
	RandomSkillT[4] =  7640
	RandomSkillT[5] =  7641
	RandomSkillT[6] =  7642
	RandomSkillT[7] =  7643
	RandomSkillT[8] =  7644
	RandomSkillT[9] =  7645
	RandomSkillT[10] = 7646


	local r = math.random(1,10)
	GiveItem(role,0,RandomSkillT[r],1,4)
	local itemname = GetItemName ( RandomSkillT[r] ) 
	GMNotice ( cha_name.." Opened Skill Treasure Chest And obtained "..itemname.." Skill book!")
end

look this box how its made.


Download: Nightmare Demonic Helm

Dimension Pirates Online files: get now

New map Project: Flag PK

Black Skin 3.1.3 for pko 1: Get now

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...