Jump to content
  • 0

Script to spawn a monster


LeonZ

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   13
  • Joined:  07/11/12
  • Last Seen:  

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.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

//==================================================
// 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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   13
  • Joined:  07/11/12
  • Last Seen:  

Up

Link to comment
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
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.

×
×
  • Create New...