Jump to content
  • 0
Sign in to follow this  
Guest Axiom

Embedding a script into normal spawns

Question

Guest Axiom

Hey, so I built this quest for Novices where they kill a specific kind of Poring that spawns regularly around town. My first approach was to only have the mobs spawn upon activating the quest like so:

 

 

monster prontera,0,0,"Pesky Poring",1002,20,"Sari#Elmina::OnPeskyDeath";

 

The embedded behavior is to keep track of how many have been killed using a variable. This approach is problematic though, firstly because spawns are at a set number and if any other player kills the marks, whoever is performing the quest is screwed. Instead, I planned on making the Porings spawn automatically like so:

 

 

prontera,0,0,0,0	monster	Pesky Poring	1002,30,0,0,0,"Sari#Elmina::OnPeskyDeath";

 

... I'm actually not sure it's possible to embed a behavior into naturally spawning mobs. Is there a better way to handle this, or did I not format this behavior properly?

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You could probabbly do something like

 

 

 

OnNPCKillEvent:if (custom_quest == 1) {if (killerrid == custom_mob_id_for_quest) killed_mob += 1;mes "You killed "+killed_mob+" so far";} 

Its a really cheap-basic code, but should be able to get the job done. 

 

I just thought of another possible approach. 

Say the monsters spawn in a specific map with a function triggered on their death.Assuming each character who beings the quest spawns X set of monster, in the OnPeskyDeath event, you could check wether or not the character has the quest enabled. If the quest has not been taken/enabled/isnt active/whatever. Respawn another mob. Otherwise add the points. (This could probabbly be a lot healthier than the suggestion I posted above :P)

Edited by Xgear

Share this post


Link to post
Share on other sites
  • 0
Guest Axiom

One thing about the first suggestion:

I didn't set these as custom mobs, just Porings renamed to something else because I also have normal Porings spawning with them. Is there any way to distinguish between the two using OnNPCKillEvent?

 

Also, I'm now testing the second solution. Seems like a smarter way to handle it than the first anyway. Thank you!

Edited by Axiom

Share this post


Link to post
Share on other sites
  • 0

Right. I didnt notice the IDs thing. As far as I know no, since the rid only returns the Class/ID of the killed mob. Which again, proves the second suggestion is far better :P

Share this post


Link to post
Share on other sites
  • 0
Guest Axiom

It is, and it's so simple I feel stupid for not figuring it out myself. Thank you!

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
Answer this question...

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

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.