Killedrid doesn't find Event Monster

RodRich

New member
Messages
38
Points
0
Age
35
Location
Brazil
Github
rodrich1991
Emulator
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!!

 
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:

Code:
-	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; }
 
Last edited by a moderator:
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!!

 
Did you read the second part? o.O

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

Code:
-	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; }
 
@@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!!

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


 
@@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!

 
It sets killedrid on killing monsters with special(defined by you) event.

 
Back
Top