Jump to content
  • 0
leadtech

Instant Spawn Mob Script

Question

I got tried this MVP Instant Spawning script and i have problem .. MVP's are not instant spawning ..

- script mvp spawned -1,{
OnInit:
setarray [email protected][0],1511,1674,1785,1039,1874,1272,1719,1046,1389,1112,1115,1658,1957,
1418,1871,1252,1786,1086,1885,1649,1651,1832,1492,1734,1251,1779,1688,1646,1373,
1147,1059,1150,1956,1087,1190,1038,1157,1159,1052,1623,1917,1650,1583,1389,1312,
1751,1685,1630,1648;
for(set .i,0; .i<getarraysize([email protected]); set .i,.i+1)
{monster "mapname",0,0,""+getmonsterinfo([email protected][.i],0)+"",[email protected][.i],1;}
end;

OnNPCKillEvent:
getmapxy(@map$,@x,@y,0);
if (@map$ == "mapname")
 {for(set @i,0; @i<getarraysize([email protected]); set @i,@i+1)
    {if ([email protected])
       {monster "@map$",0,0,""+getmonsterinfo([email protected][@i],0)+"",[email protected][@i],1;}}}
end;
}

I got error when i start the server ..

[Debug]: mapindex_name2id: Map "mapname" not found in index list!

Help me plss ..

Thanks in advance :)

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Just as the map server says: This map does not exist. If you have copied this script from somewhere, than don't forget to rename the map where mvps have to spawn...

E.g.

- script mvp spawned -1,{
OnInit:
setarray [email protected][0],1511,1674,1785,1039,1874,1272,1719,1046,1389,1112,1115,1658,1957,
1418,1871,1252,1786,1086,1885,1649,1651,1832,1492,1734,1251,1779,1688,1646,1373,
1147,1059,1150,1956,1087,1190,1038,1157,1159,1052,1623,1917,1650,1583,1389,1312,
1751,1685,1630,1648;
for(set .i,0; .i<getarraysize([email protected]); set .i,.i+1)
{monster "prontera",0,0,""+getmonsterinfo([email protected][.i],0)+"",[email protected][.i],1;}
end;
OnNPCKillEvent:
getmapxy(@map$,@x,@y,0);
if (@map$ == "prontera")
 {for(set @i,0; @i<getarraysize([email protected]); set @i,@i+1)
 {if ([email protected])
    {monster "@map$",0,0,""+getmonsterinfo([email protected][@i],0)+"",[email protected][@i],1;}}}
end;
}

  • Upvote 1
Link to comment
Share on other sites

  • 0

I would totally re do this... you are only spawning mvp's in 1 map... thus you don't need to run the OnNPCKillEvent everytime something is dead and determine the map, you just need to add a trigger...

// Assuming you want to spawn ALL these NPC's in prontera... (crazy btw)

// If Not, I've started a .maps$ array, that will house every map name the npc release each corresponding MVP ID

- script mvp spawned -1,{

OnInit:
// Set Spawn Map
set .map$, "prontera";

//setarray .maps$[0],"prontera","geffen",//etc
setarray .mvpID[0],1511,1674,1785,1039,1874,1272,1719,1046,1389,1112,1115,1658,1957,1418,1871,1252,1786,1086,1885,1649,1651,1832,1492,1734,1251,1779,1688,1646,1373,1147,1059,1150,1956,1087,1190,1038,1157,1159,1052,1623,1917,1650,1583,1389,1312,1751,1685,1630,1648;

// If using the array .maps$ change hte below .map$ to .maps$[[email protected]]

for(set .i,0; .i<getarraysize(.mvpID); set .i,.i+1) {
monster .map$,0,0,""+getmonsterinfo(.mvpID[.i],0)+"",.mvpID[.i],1,"spawned::OnMVPKill";
}

end;

OnMVPKill:
// Uncomment if using the multiple map technique

// getmapxy([email protected]$, [email protected], [email protected], 0);

// If Using the multiple map (change the below .map$) to [email protected]$

  monster .map$,0,0,""+getmonsterinfo(.mvpID[@i],0)+"",.mvpID[@i],1;
end;
}

Link to comment
Share on other sites

  • 0

So it will be look like this ?

// Set Spawn Map

setarray .maps$[0], "prontera,moc_fild17";

Small change, you need " before and after the map name, then the comma to separate strings within the array (Im pretty sure you need to O.O) So change it to:

setarray .maps$[0], "prontera","moc_fild17";

Link to comment
Share on other sites

  • 0

let's suppose you have 3 mob id's and each one spawns on a different map...

// MVP ID's
setarray .mvpID[0],123,456,789;

// Map Locations
setarray .maps$[0],"morc_field_1","prt_field1","gef_dun01";

// Loop Through Each Mob ID and Spawn in Correct Field
for (set [email protected], 0; [email protected] < getarraysize(.mvpID); set [email protected], [email protected] + 1) {
 monster .maps$[[email protected]],0,0,""+getmonsterinfo(.mvpID[.i],0)+"",.mvpID[.i],1,"spawned::OnMVPKill";
}

Link to comment
Share on other sites

  • 0

- script mvp spawned -1,{
}

// Map Locations
setarray .maps$[0],"morc_field_1","prt_field1","gef_dun01";
monster .maps$[[email protected]],0,0,""+getmonsterinfo(.mvpID[.i],0)+"",.mvpID[.i],1,"spawned::OnMVPKill";
}

I found two "typos" ^^:

1st: "morc_field_1" > does not exist except custom map, so > "moc_fild01" should be correct, same goes for "prt_field01" > "prt_fild01" ^^

2nd: In the 2nd quote the NPC name is wrong, according to the 1st quote > "mvp spawned", but you wrote "spawned" only.

Regards,

Chris

Edited by llchrisll
  • Upvote 1
Link to comment
Share on other sites

  • 0

- script mvp spawned -1,{
}

// Map Locations
setarray .maps$[0],"morc_field_1","prt_field1","gef_dun01";
monster .maps$[[email protected]],0,0,""+getmonsterinfo(.mvpID[.i],0)+"",.mvpID[.i],1,"spawned::OnMVPKill";
}

I found two "typos" ^^:

1st: "morc_field_1" > does not exist except custom map, so > "moc_fild01" should be correct, same goes for "prt_field01" > "prt_fild01" ^^

2nd: In the 2nd quite the NPC name is wrong, according to the 1st quote > "mvp spawned", but you wrote "spawned" only.

Regards,

Chris

erm..Z3R0 put the correct header..while you miss looked at the "mvp" word

LOL..i looked at the Header only..>.<

didnt wonder inside the content..LOL....

Edited by Emistry
Link to comment
Share on other sites

  • 0

LOL!

First off the "morc_field" thing was simply a filler, I didn't know or care what the maps where... (that's for him to find out)

Second, completely my bad on the mvp spawned thingy

Link to comment
Share on other sites

  • 0

To avoid any problems when changing the NPC's (unique) name, I'd suggest to use strnpcinfo(3)+"::OnMVPKill" instead of "mvp spawned::OnMVPKill". It prevents potential errors when changing the name (e.g. you might forget to change the name at every position; or typod the name ).

Also getmonsterinfo(x, 0) already returns a string, so there is no need to concatenate an empty string to it's return value. And instead of looking up the name with getmonsterinfo, you could also just write "--ja--" or "--en--" and the name would be added appropriately, especially if you'd might prefer to use the English/iRO name over of the Korean one (e.g. Korean: Civil Servant; English: Mao Guai).

Updated Z3R0's script from this post with the mentioned changes.

// Assuming you want to spawn ALL these NPC's in prontera... (crazy btw)
// If Not, I've started a .maps$ array, that will house every map name the npc release each corresponding MVP ID

- script mvp spawned -1,{

OnInit:
// Set Spawn Map
set .map$, "prontera";
//setarray .maps$[0],"prontera","geffen";	//etc

setarray .mvpID[0],1511,1674,1785,1039,1874,1272,1719,1046,1389,1112,1115,1658,1957,1418,1871,1252,1786,1086,1885,1649,1651,1832,1492,1734,1251,1779,1688,1646,1373,1147,1059,1150,1956,1087,1190,1038,1157,1159,1052,1623,1917,1650,1583,1389,1312,1751,1685,1630,1648;

// If using the array .maps$ change the below .map$ to .maps$[[email protected]]
for(set .i,0; .i<getarraysize(.mvpID); set .i,.i+1) {
	monster .map$,0,0,getmonsterinfo(.mvpID[.i],0),.mvpID[.i],1,strnpcinfo(3)+"::OnMVPKill";
}
end;

OnMVPKill:
// Uncomment if using the multiple map technique
// getmapxy([email protected]$, [email protected], [email protected], 0);
// If Using the multiple map (change the below .map$) to [email protected]$

monster .map$,0,0,getmonsterinfo(.mvpID[@i],0),.mvpID[@i],1;
end;
}

Link to comment
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.   Paste as plain text instead

  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.



×
×
  • Create New...

Important Information

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