Jump to content
  • 0
RodRich

Killedrid doesn't find Event Monster

Question

Hey guys...

 

First, apollogies for my english...

 

I'm looking for you help in here, 'cause no one could helped me in my idiom!!

 

My problem is:

 

 

I'm typing a script that sumons some mvp's ... and those monster have a Label!!

 

at their Label, I'm trying to make the npc to annunciate:  "Char's name has killed the MVP's name".

 

But instead to annunciate a MvP's name, it's showing the mob's name.

 

Example:

 

For Baphomet the npc's announce is Like that:

 

"James has killed Baphomet Jr." instead "James has killed Baphomet"

 

My script:

 

OnKILLMOB:	$mob--;	announce strcharinfo(0)+" has killed "+getmonsterinfo(killedrid,0),bc_yellow;

I also has tried like this:

 

OnKILLMOB:		if ( getmonsterinfo(killedrid,MOB_MVPEXP) ){        announce strcharinfo(0)+" has killed "+getmonsterinfo(killedrid,0),bc_yellow;}

But this way doesn't annunciate anything.

 

 

And I tried to do instead at monster label (OnKILLMOB:), do this at event (OnNPCKillEvent:) but anyway that's works!!

 

 

So I hope you can help me!!

 

Once again, I'm sorry about my english!!

 

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

You're over-thinking your implementation.
 
On a smaller scale, you could write something like:

-	script	summon_mvp	-1,{	OnInit:		monster "prt_fild08", 0, 0, "Baphomet", BAPHOMET, 1, strnpcinfo(0) +"::OnKilledBapho";		end;			OnKilledBapho:		announce strcharinfo(0) +" has killed "+ getmonsterinfo(BAPHOMET, MOB_NAME) +"!", bc_all;		end;}

 
...but since you've already specified a very particular event (OnKilledBapho) for your Baphomet mob, you don't really need to pull the RID to display the name, nor do you even need to use getmonsterinfo(). Since you told the script to run OnKilledBapho when the event Baphomet is killed, you could just simply write your announcement like this:

		announce strcharinfo(0) +" has killed Baphomet!", bc_all;


If you were randomizing MVP summons, however, you could do something like this:

-	script	summon_mvp	-1,{	OnInit:        // Set MVP IDs        setarray .mvp_id[0], BAPHOMET, GOLDEN_BUG, KNIGHT_OF_WINDSTORM, GARM, ORK_HERO;            OnSetID:        // Randomly select MVP to summon        .summon_id = .mvp_id[rand(getarraysize(.mvp_id))];        		// Summon Random MVP		monster "prt_fild08", 0, 0, getmonsterinfo(.summon_id, MOB_NAME), .summon_id, 1, strnpcinfo(0) +"::OnKilledMVP";		end;			OnKilledMVP:		// Announce MVP death		announce strcharinfo(0) +" has killed "+ getmonsterinfo(.summon_id, MOB_NAME) +"!", bc_all;				// Respawn new MVP		donpcevent strnpcinfo(3) +"::OnSetID";		end; }

Share this post


Link to post
Share on other sites
  • 0

 

You're over-thinking your implementation.

 

On a smaller scale, you could write something like:

-	script	summon_mvp	-1,{	OnInit:		monster "prt_fild08", 0, 0, "Baphomet", BAPHOMET, 1, strnpcinfo(0) +"::OnKilledBapho";		end;			OnKilledBapho:		announce strcharinfo(0) +" has killed "+ getmonsterinfo(BAPHOMET, MOB_NAME) +"!", bc_all;		end;}

 

...but since you've already specified a very particular event (OnKilledBapho) for your Baphomet mob, you don't really need to pull the RID to display the name, nor do you even need to use getmonsterinfo(). Since you told the script to run OnKilledBapho when the event Baphomet is killed, you could just simply write your announcement like this:

		announce strcharinfo(0) +" has killed Baphomet!", bc_all;

 

If you were randomizing MVP summons, however, you could do something like this:

-	script	summon_mvp	-1,{	OnInit:        // Set MVP IDs        setarray .mvp_id[0], BAPHOMET, GOLDEN_BUG, KNIGHT_OF_WINDSTORM, GARM, ORK_HERO;            OnSetID:        // Randomly select MVP to summon        .summon_id = .mvp_id[rand(getarraysize(.mvp_id))];        		// Summon Random MVP		monster "prt_fild08", 0, 0, getmonsterinfo(.summon_id, MOB_NAME), .summon_id, 1, strnpcinfo(0) +"::OnKilledMVP";		end;			OnKilledMVP:		// Announce MVP death		announce strcharinfo(0) +" has killed "+ getmonsterinfo(.summon_id, MOB_NAME) +"!", bc_all;				// Respawn new MVP		donpcevent strnpcinfo(3) +"::OnSetID";		end; }

I undestand your quote... but this just work if I summon just one monster!!

 

My script summons many monsters, that's why is hard to do the npc Announce the mob name!! Because is the same label for all of them!!

Share this post


Link to post
Share on other sites
  • 0

Did you read the second part? o.O



 

If you were randomizing MVP summons, however, you could do something like this:

-	script	summon_mvp	-1,{	OnInit:        // Set MVP IDs        setarray .mvp_id[0], BAPHOMET, GOLDEN_BUG, KNIGHT_OF_WINDSTORM, GARM, ORK_HERO;            OnSetID:        // Randomly select MVP to summon        .summon_id = .mvp_id[rand(getarraysize(.mvp_id))];        		// Summon Random MVP		monster "prt_fild08", 0, 0, getmonsterinfo(.summon_id, MOB_NAME), .summon_id, 1, strnpcinfo(0) +"::OnKilledMVP";		end;			OnKilledMVP:		// Announce MVP death		announce strcharinfo(0) +" has killed "+ getmonsterinfo(.summon_id, MOB_NAME) +"!", bc_all;				// Respawn new MVP		donpcevent strnpcinfo(3) +"::OnSetID";		end; }

Share this post


Link to post
Share on other sites
  • 0

@@Mumbles I guess you didn't understand...

 

I've read your full post, but the question is:

 

I know you made a way to summon a random mvp, but just 1!!

 

So you can "guess" the mvp's name.

 

But in my case, I summon many mvp at same time, then when its calls the Label, I can't use a variable with a mvp's name, 'cause it will be always the same name!!

 

Sorry for my english, but I guess you could understand!!

Share this post


Link to post
Share on other sites
  • 0

You can edit src for that. Find:

if( md->npc_event[0] && !md->state.npc_killmonster ) {			if( sd && battle_config.mob_npc_event_type ) {				pc->setparam(sd, SP_KILLERRID, sd->bl.id);				npc->event(sd,md->npc_event,0);			} else if( mvp_sd ) {				pc->setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);				npc->event(mvp_sd,md->npc_event,0);			} else				npc->event_do(md->npc_event);		} else if( mvp_sd && !md->state.npc_killmonster ) {			pc->setparam(mvp_sd, SP_KILLEDRID, md->class_);			npc->script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]		}

Change to:

   	 if( md->npc_event[0] && !md->state.npc_killmonster ) {            if( sd && battle_config.mob_npc_event_type ) {                pc->setparam(sd, SP_KILLERRID, sd->bl.id);                pc->setparam(sd, SP_KILLEDRID, md->class_);                npc->event(sd,md->npc_event,0);            } else if( mvp_sd ) {                pc->setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);                pc->setparam(sd, SP_KILLEDRID, md->class_);                npc->event(mvp_sd,md->npc_event,0);            } else                npc->event_do(md->npc_event);        } else if( mvp_sd && !md->state.npc_killmonster ) {            pc->setparam(mvp_sd, SP_KILLEDRID, md->class_);            npc->script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]        }

Not tested, so comment how it goes :D

Share this post


Link to post
Share on other sites
  • 0

@@Garr

 

May you explain better for me, what does this modification do?

 

Because I'm lil bit afraid about change the src!! I wanted make this without change src!! For everyone who wants could download my script!

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

×
×
  • Create New...

Important Information

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