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

7 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1274
  • Reputation:   386
  • 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.

  • MVP 1
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

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  105
  • Reputation:   7
  • Joined:  04/11/22
  • Last Seen:  

On 8/24/2013 at 9:53 AM, Noire said:

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

Hello sir!

 

On 8/24/2013 at 1:22 AM, Skorm said:

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.

Hello! Thanks for this excelente idea!
Do you have a suggestion where I can kill ALL MONSTER EXCEPT ONE?
I am trying to invoke the MVP's without their slaves(like Baphomet without Baphomet Junior) but I tried so much and couldn't find a good way yet...

So I'm thinking if I could kill all the slaves(Baphomet Jr for example) and leave the MVP(Baphomet) alive...

Be safe! Thanks!

Link to comment
Share on other sites

  • 0

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

On 10/30/2024 at 10:49 PM, zeusc137 said:

Hello sir!

 

Hello! Thanks for this excelente idea!
Do you have a suggestion where I can kill ALL MONSTER EXCEPT ONE?
I am trying to invoke the MVP's without their slaves(like Baphomet without Baphomet Junior) but I tried so much and couldn't find a good way yet...

So I'm thinking if I could kill all the slaves(Baphomet Jr for example) and leave the MVP(Baphomet) alive...

Be safe! Thanks!

This is topic hijacking btw.

I would recommend creating another version of the MVPs without the slave spawns.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  105
  • Reputation:   7
  • Joined:  04/11/22
  • Last Seen:  

5 hours ago, Skorm said:

This is topic hijacking btw.

I would recommend creating another version of the MVPs without the slave spawns.

Hello! Thanks for the feedback, @Skorm! I wasn’t aware of “topic hijacking” — sorry about that!

I thought adding more information to existing posts would be helpful, but I can see how it might be misleading.

Thank you very much for the tip!

EDIT: I also created my own post/question related to this after your tip: 

 

Edited by zeusc137
addlink
Link to comment
Share on other sites

  • 0

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

3 hours ago, zeusc137 said:

Hello! Thanks for the feedback, @Skorm! I wasn’t aware of “topic hijacking” — sorry about that!

I thought adding more information to existing posts would be helpful, but I can see how it might be misleading.

Thank you very much for the tip!

EDIT: I also created my own post/question related to this after your tip: 

 

Thanks it's mainly for the search engines. What if someone else has the same question as you? They wouldn't find it buried under this topic. While your question might be related, it isn't exactly the same.

  • Like 1
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...