Jump to content
Jelly

Maze monster spawn when another is killed

Recommended Posts

Hi, is there any way to program a maze to only spawn a monster at a location when another monster has been killed? preferably with a map notice, like

 

The minibosses have been killed! The big boss has spawned!

 

and then it spawns the boss.

Share this post


Link to post
Share on other sites

you can check how abb 5+ is done, there is ready scripts for that and here is small example to what u need for it..

 

function map_copy_run_hell( map_copy )
	if CheckMonsterDead ( AZRAEL[5] ) == 1 then
		if CRY[5]==0 then
			local Notice_all = "Saro: I'll revive and you all will fall into depths more deeper than despair!!!"
			MapCopyNotice ( map_copy , Notice_all )
			CRY[5]=1
		end
	end
	
	if CheckMonsterDead ( AZRAEL[6] ) == 1 then
		if CRY[6]==0 then
			local Notice_all = "Karu: You might have passed this stage, but prepare for the worst!"
			MapCopyNotice ( map_copy , Notice_all )
			CRY[6]=1
		end
	end
	
	if CheckMonsterDead ( AZRAEL[7] ) == 1 then
		if CRY[7]==0 then
			local Notice_all = "Aruthur: Please forgive me, my lord, I don't want to go back to hell, Ah!!!"
			MapCopyNotice ( map_copy , Notice_all )
			CRY[7]=1
		end
	end
	
	if CheckMonsterDead ( AZRAEL[8] ) == 1 then
		if CRY[8]==0 then
			local Notice_all = "Sacrois: Foolish humans, We will meet again! Ha-ha! Ha-ha!"
			MapCopyNotice ( map_copy , Notice_all )
			CRY[8]=1
		end
	end
	
	if CRY[5]==1 and CRY[6]==1 and CRY[7]==1 and CRY[8]==1 and HellNotice[1]==0 then
		local x = 100
		local y = 100
		local x1 = x * 100
		local y1 = y * 100
		local refresh = 6000000					
		local Life = 59000000
		local Mob_ID = 75
		BigBoss = CreateCha( Mob_ID , x1 , y1 , 145, refresh)
		SetChaLifeTime(BigBoss,Life)
		Notice ( "<Mysterious Voice>: Abaddon 5 - 8 all 4 boss is defeated and Boss is summoned at ("..x..","..y..")")
        HellNotice[1] = 1
	end
end


function map_copy_close_hell ( map_copy )
	HellNotice[1] = 0
	CRY[5]=0
	CRY[6]=0
	CRY[7]=0
	CRY[8]=0
end
          
          
          
---variable.lua lines need to be as them are in hell
CRY = {}
CRY[5]=0
CRY[6]=0
CRY[7]=0
CRY[8]=0
HellNotice = {}
HellNotice[1] = 0

--monster_conf.lua
AZRAEL[5] = CreateCha(974, 7200, 6200, 145, 21600)
AZRAEL[6] = CreateCha(975, 19100, 6200, 145, 21600)
AZRAEL[7] = CreateCha(976, 19000, 17900, 145, 21600)
AZRAEL[8] = CreateCha(977, 7200, 17900, 145, 21600)

 

Edited by Onioni

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

There is another way to trigger the monster, make it check, if the monster is dead, it will automatic spawn a monster into the assigned coordinate or random coordinates.

Exp_and_level.lua:
 

Function GetExp_New(dead, atk)
local map_copy = GetChaMapCopy(atk)
local monster_id = GetChaID(dead)
if monster_id = 679 then
     BossRewards(atk)
     BossNotice(atk)
     CreateCha(678,7820,6225,90,10800)
     MapCopyNotice(map_copy, "You have defeated Wandering Soul and it summons Snowman Warlord at 78,62.")
end

end --End of GetExp_New(dead, atk)

Function BossRewards(atk)
GiveItem(role, 0, 3457, 1, 4)
GiveItem(role, 0, 885, 1, 4)
Notice("Player "..GetChaDefaultName(role).." kill Wandering Soul and obtain 1x Kal Runestone & 1x Refining Gem")
local rand = Percentage_Random(0.25)
if rand = 1 then
      AddMoney ( role , 0 , 50000 )
     Notice("Player "..GetChaDefaultName(role).." have a great luck and gain 50000G.")
end


        local random_item=math.random ( 1, 5 )
        if random_item==1 then
            GiveItem ( role , 0 , 5845  , 1 , 4 ) 
        elseif random_item==2 then
            GiveItem ( role , 0 , 5846  , 1 , 4 ) 
        elseif random_item==3 then
            GiveItem ( role , 0 , 5847  , 1 , 4 ) 
        elseif random_item==4 then
            GiveItem ( role , 0 , 5848  , 1 , 4 ) 
        elseif random_item==5 then
            GiveItem ( role , 0 , 5849  , 1 , 4 ) 
        else
            GiveItem ( role , 0 , 885  , 1 , 4 ) 
        end

end --End of BossRewards(atk)


Function BossNotice(atk)
local Hour = os.date("%H")
local Minute = os.date("%M")
local Second = os.date("%S")
if HasGuild(atk) == 0 then
     local cha_name = GetChaDefaultName(atk)
     Notice("Player "..cha_name" defeated Snowman Walord ["..Hour..":"..Minute..":"..Second.."]")
end
end --End of BossNotice(atk)


Enjoy =D, u can add/edit/delete anything u want. 

Edited by Foxseiz
Added a code tag on code
  • Like 1

Share this post


Link to post
Share on other sites

Hello:

Someone, can help me??? I need to change the opening hour of Abanddone 5 (hell). Or I need the function where I can change the hour. 

My idea for Abandone 5 will be open every day, every 3  hours...

Thanks in advance

:) 

Share this post


Link to post
Share on other sites
7 hours ago, pepet said:

Hello:

Someone, can help me??? I need to change the opening hour of Abanddone 5 (hell). Or I need the function where I can change the hour. 

My idea for Abandone 5 will be open every day, every 3  hours...

Thanks in advance

:) 

 

 

function init_entry(map)
    SetMapEntryMapName(map, "jialebi") 
    SetMapEntryTime(map, "2016/1/1/20/0", "1/0/0", "0/1/0", "0/3/0") 

end

 

 

function can_open_entry_hell( map )  
    local Now_Week = GetNowWeek()
    if Now_Week == 1 or Now_Week == 3 or Now_Week == 5 or Now_Week == 6 then
    --or Now_Week == 2 ti
    --or Now_Week == 4 to
    --or Now_Week == 7 su
        return 1
    end
 


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.


×
×
  • Create New...