Jump to content
  • 0

kill specific monster through script


Noire

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  103
  • Reputation:   1
  • Joined:  06/26/13
  • Last Seen:  

How to kill a certain monster on a map via script? for Ex. i summon in prontera city 1 Poring | 1 Drops | 1 Poporing  and i only need to kill the Poring is there any possible way to do it ?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Like this?

 

prontera,150,150,5	script	Monster Spawner	100,{
	monster "prontera",151,151,"Poringz0rd",2341,1,"Monster Spawner::OnDeath";
	monster "prontera",151,150,"Drops",1113,1;
	monster "prontera",151,149,"Poporing",1031,1;
	sleep 1000;
	npctalk "I will now kill the Poringz0rd!";
	sleep 1000;
	killmonster "prontera","Monster Spawner::OnDeath",1;
	end;
	
OnDeath:
	npctalk "Fear not! The Poringz0rd has been slain!";
}

 

This is the only way I know of currently... So you have to spawn the monster with a specific event label and target it through that method.

Until the mobsearch and new getmapxy commands are implemented.

 


 

Edit--

 I thought of a few more that I used previously.

 

Using bg_monster and .@gid with unitkill I'm not sure if it triggers the death event still though.

 

prontera,150,150,5	script	Monster Spawner	100,{
	set .@gid, bg_monster(.@foo,"prontera",151,151,"Poringz0rd",1002,"Monster Spawner::OnDeath");
	monster "prontera",151,150,"Drops",1113,1;
	monster "prontera",151,149,"Poporing",1031,1;
	sleep 1000;
	npctalk "I will now kill the Poringz0rd!";
	sleep 1000;
	unitkill .@gid;
	end;
	
OnDeath:
	npctalk "Fear not! The Poringz0rd has been slain!";
}

 

Another way with bg_monster.

 

prontera,150,150,5	script	Monster Spawner	100,{
	set .@gid, bg_monster(.@foo,"prontera",0,0,"bar",1002,"Monster Spawner::OnDeath");
	mercenary_create 6017,999; .@gid++;
	killmonster "prontera","Monster Spawner::OnDeath";
	sleep 1000;
	npctalk "I will now kill you helping hand!";
	sleep 1000;
	unitkill .@gid;
	npctalk "The Mercenary has been slain!";
	end;
}

In this example I summoned a fake monster with bg_monster off screen to get the gameid for our next summoned creature... This can be used to return the gameid of anything we cannot normally. If using in the right way even players.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  73
  • Reputation:   6
  • Joined:  06/16/12
  • Last Seen:  

I remember when i could right click the monster and click " kill monster " i don't know why it doesnt work anymore.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  103
  • Reputation:   1
  • Joined:  06/26/13
  • Last Seen:  

Like this?

 

prontera,150,150,5	script	Monster Spawner	100,{
	monster "prontera",151,151,"Poringz0rd",2341,1,"Monster Spawner::OnDeath";
	monster "prontera",151,150,"Drops",1113,1;
	monster "prontera",151,149,"Poporing",1031,1;
	sleep 1000;
	npctalk "I will now kill the Poringz0rd!";
	sleep 1000;
	killmonster "prontera","Monster Spawner::OnDeath",1;
	end;
	
OnDeath:
	npctalk "Fear not! The Poringz0rd has been slain!";
}

 

This is the only way I know of currently... So you have to spawn the monster with a specific event label and target it through that method.

Until the mobsearch and new getmapxy commands are implemented.

 


 

Edit--

 I thought of a few more that I used previously.

 

Using bg_monster and .@gid with unitkill I'm not sure if it triggers the death event still though.

 

prontera,150,150,5	script	Monster Spawner	100,{
	set .@gid, bg_monster(.@foo,"prontera",151,151,"Poringz0rd",1002,"Monster Spawner::OnDeath");
	monster "prontera",151,150,"Drops",1113,1;
	monster "prontera",151,149,"Poporing",1031,1;
	sleep 1000;
	npctalk "I will now kill the Poringz0rd!";
	sleep 1000;
	unitkill .@gid;
	end;
	
OnDeath:
	npctalk "Fear not! The Poringz0rd has been slain!";
}

 

Another way with bg_monster.

 

prontera,150,150,5	script	Monster Spawner	100,{
	set .@gid, bg_monster(.@foo,"prontera",0,0,"bar",1002,"Monster Spawner::OnDeath");
	mercenary_create 6017,999; .@gid++;
	killmonster "prontera","Monster Spawner::OnDeath";
	sleep 1000;
	npctalk "I will now kill you helping hand!";
	sleep 1000;
	unitkill .@gid;
	npctalk "The Mercenary has been slain!";
	end;
}

In this example I summoned a fake monster with bg_monster off screen to get the gameid for our next summoned creature... This can be used to return the gameid of anything we cannot normally. If using in the right way even players.

Thanks for the reply and help, though i'm gonna test it first if my request will meet this script you've made. (:

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...