function script MVPSummon {
mes "Select one:";
next;
set .@m, select(.smenu$) - 1;
} else {
close2;
atcommand "@spawn " + .mobid[.@m] + " " + .mobam[.@m];
end;
}
OnInit:
// Spawn ID
setarray .mobid[0],1511,1647,1785,1630,1039,1874,1272,1719,1046,1389,1112,1115,1418,1871,1252,1768,1086,1885,1649,1651,1832,1492,1734,1251,1779,1688,1646,1373,1147,1059,1150,1087,1190,1038,1157,1159,1623,1650,1583,1708,1312,1751,1648,1658;
// Spawn amount
setarray .mobam[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
set .smenu$,"";
for(set .@s,0; .@s < getarraysize(.mobid); set .@s,.@s + 1) {
// Skips an Monster if it does not exist in the db
if (getmonsterinfo(.mobid[.@s],0) == "" || getmonsterinfo(.mobid[.@s],0) == "null") {
debugmes .n$ + ": Mob ID " + .mobid[.@s] + " is not a valid ID.";
deletearray .mobid[.@s],1;
deletearray .mobam[.@s],1;
deletearray .mobze[.@s],1;
continue;
}
// else adding it to the menu
set .smenu$,.smenu$ + "- "+getmonsterinfo(.mobid[.@s],0) + ( (.mobid[.@s+1] == 0)?"":":");
}
end;
}
For item_db, add an usable item and change item script to:
callfunc "MVPSummon";
P/S: The script is ripped from Rikimaru so credits goes to him.