RodRich 6 Posted April 4, 2015 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!! Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted April 12, 2015 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; } Quote Share this post Link to post Share on other sites
0 RodRich 6 Posted April 13, 2015 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!! Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted April 13, 2015 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; } Quote Share this post Link to post Share on other sites
0 RodRich 6 Posted April 13, 2015 @@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!! Quote Share this post Link to post Share on other sites
0 Garr 117 Posted April 13, 2015 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 Quote Share this post Link to post Share on other sites
0 RodRich 6 Posted April 13, 2015 @@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! Quote Share this post Link to post Share on other sites
0 Garr 117 Posted April 13, 2015 It sets killedrid on killing monsters with special(defined by you) event. Quote Share this post Link to post Share on other sites
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:
I also has tried like this:
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