Jump to content
  • 0

Script to spawn a monster


Question

Posted

I wanted a script to spawn a monster after x amount of the map is killed.
For example for every 10000 monsters killed in gef_fild10 a global appears on the map and spawns a Lord of Orcs randomly across the map.

3 answers to this question

Recommended Posts

  • 0
Posted
//==================================================
// gef_fild10 - Geffen Field
//==================================================
gef_fild10,0,0	monster	Orc Warrior	1023,179,5000,0,"sample_npc_name::OnKill"
gef_fild10,0,0	monster	Orc Lady	1273,55,5000,0,"sample_npc_name::OnKill"
gef_fild10,0,0	monster	Orc Baby	1686,27,5000,0,"sample_npc_name::OnKill"
gef_fild10,0,0,0,0	boss_monster	Orc Lord	1190,1,7200000,600000,0,"sample_npc_name::OnKill"
gef_fild10,46,350,5,5	monster	Blue Plant	1079,3,900000,450000,"sample_npc_name::OnKill"
gef_fild10,287,61,5,5	monster	Blue Plant	1079,3,900000,450000,"sample_npc_name::OnKill"
gef_fild10,300,253,5,5	monster	Green Plant	1080,3,360000,180000,"sample_npc_name::OnKill"

add a npc event to each of the monster in gef_fild10, and load the npc.

-	script	sample_npc_name	-1,{
	OnKill:
		if (!mobcount(strcharinfo(3), strnpcinfo(3)+"::OnBossKill")) {
			if (.monster_kill < 10000) {
				.monster_kill++;
				if (.monster_kill >= 10000) {
					monster strcharinfo(3), 0, 0, "Lord of Orcs", 1190, 1, strnpcinfo(3)+"::OnBossKill";
				}
			}
			else {
				.monster_kill = 0;
			}
		}
		end;
		
	OnBossKill:
		// rewards
		end;
}

 

  • MVP 1
  • 0
Posted (edited)

Im on my phone but here the idea .


Set how much monster total in map
ex: Set monster,100;

Every time you killed the monster will be deduct -1
ex: set monster,-1;

Add condition
if ( monster == 50 ){
 "if true do this";
}
"if false do this"
end;

Edited by Poring King

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...