Hello,
I would like to create an NPC that invokes MVPs using their ID, but I would like the invoked monster to be dynamically modified (HP, ATK, etc.) without having to modify the whole mob_db.yml.
I've seen that you can use setunitdata for this, but I'm not sure of the right way to use it in this context.
Could someone please help me?
Many thanks to the rAthena team for your hard work and invaluable help!
mes "[MVP Invoker]";
mes "Dis-moi l'ID du MVP que tu veux invoquer.";
input .@mvp_id;
if ( getmonsterinfo(.@mvp_id, MOB_NAME) == "" ) {
mes "Cet ID ne correspond à aucun monstre.";
close;
mes "[MVP Invoker]";
mes "Dis-moi l'ID du MVP que tu veux invoquer.";
input .@mvp_id;
if ( getmonsterinfo(.@mvp_id, MOB_NAME) == "" ) {
mes "Cet ID ne correspond à aucun monstre.";
close;
}
mes "Veux-tu vraiment invoquer " + getmonsterinfo(.@mvp_id, MOB_NAME) + " pour 1 000 000 Zeny ?";
if ( select("Oui:Non") == 2 ) {
mes "Très bien, une autre fois peut-être.";
close;
}
if ( Zeny < 1000000 ) {
mes "Tu n'as pas assez de Zeny. Il te faut 1 000 000 Z.";
close;
}
Zeny -= 1000000;
// Invoquer le monstre et modifier ses stats dans le même contexte (PAS via callfunc)
.@mob_gid = monster("db_room", 106, 62, getmonsterinfo(.@mvp_id, MOB_NAME), .@mvp_id, 1);
sleep 500; // Laisse le temps au monstre d'apparaître
Question
deafity
Hello,
I would like to create an NPC that invokes MVPs using their ID, but I would like the invoked monster to be dynamically modified (HP, ATK, etc.) without having to modify the whole mob_db.yml.
I've seen that you can use setunitdata for this, but I'm not sure of the right way to use it in this context.
Could someone please help me?
Many thanks to the rAthena team for your hard work and invaluable help!
mes "[MVP Invoker]";
mes "Dis-moi l'ID du MVP que tu veux invoquer.";
input .@mvp_id;
if ( getmonsterinfo(.@mvp_id, MOB_NAME) == "" ) {
mes "Cet ID ne correspond à aucun monstre.";
close;
mes "[MVP Invoker]";
mes "Dis-moi l'ID du MVP que tu veux invoquer.";
input .@mvp_id;
if ( getmonsterinfo(.@mvp_id, MOB_NAME) == "" ) {
mes "Cet ID ne correspond à aucun monstre.";
close;
}
mes "Veux-tu vraiment invoquer " + getmonsterinfo(.@mvp_id, MOB_NAME) + " pour 1 000 000 Zeny ?";
if ( select("Oui:Non") == 2 ) {
mes "Très bien, une autre fois peut-être.";
close;
}
if ( Zeny < 1000000 ) {
mes "Tu n'as pas assez de Zeny. Il te faut 1 000 000 Z.";
close;
}
Zeny -= 1000000;
// Invoquer le monstre et modifier ses stats dans le même contexte (PAS via callfunc)
.@mob_gid = monster("db_room", 106, 62, getmonsterinfo(.@mvp_id, MOB_NAME), .@mvp_id, 1);
sleep 500; // Laisse le temps au monstre d'apparaître
if (.@mob_gid > 0) {
setunitdata(.@mob_gid, UDT_HP, 20000000);
setunitdata(.@mob_gid, UDT_MAXHP, 20000000);
setunitdata(.@mob_gid, UDT_ATK1, 10000);
setunitdata(.@mob_gid, UDT_ATK2, 15000);
setunitdata(.@mob_gid, UDT_DEF, 200);
setunitdata(.@mob_gid, UDT_MDEF, 200);
setunitdata(.@mob_gid, UDT_AGI, 150);
setunitdata(.@mob_gid, UDT_STR, 200);
setunitdata(.@mob_gid, UDT_VIT, 200);
setunitdata(.@mob_gid, UDT_INT, 150);
}
mes "Le MVP a été invoqué et ses statistiques ont été ajustées pour être vraiment puissantes !";
Edited by deafityclose;
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.