Jump to content
  • 0

Instant Spawn Mob Script


leadtech

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   2
  • Joined:  11/12/11
  • Last Seen:  

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

- script mvp spawned -1,{
OnInit:
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;
for(set .i,0; .i<getarraysize($@mvpID); set .i,.i+1)
{monster "mapname",0,0,""+getmonsterinfo($@mvpID[.i],0)+"",$@mvpID[.i],1;}
end;

OnNPCKillEvent:
getmapxy(@map$,@x,@y,0);
if (@map$ == "mapname")
 {for(set @i,0; @i<getarraysize($@mvpID); set @i,@i+1)
    {if (killedrid==$@mvpID)
       {monster "@map$",0,0,""+getmonsterinfo($@mvpID[@i],0)+"",$@mvpID[@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

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  61
  • Reputation:   153
  • Joined:  11/10/11
  • Last Seen:  

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 $@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;
for(set .i,0; .i<getarraysize($@mvpID); set .i,.i+1)
{monster "prontera",0,0,""+getmonsterinfo($@mvpID[.i],0)+"",$@mvpID[.i],1;}
end;
OnNPCKillEvent:
getmapxy(@map$,@x,@y,0);
if (@map$ == "prontera")
 {for(set @i,0; @i<getarraysize($@mvpID); set @i,@i+1)
 {if (killedrid==$@mvpID)
    {monster "@map$",0,0,""+getmonsterinfo($@mvpID[@i],0)+"",$@mvpID[@i],1;}}}
end;
}

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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$[.@i]

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(.@map$, .@x, .@y, 0);

// If Using the multiple map (change the below .map$) to .@map$

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   2
  • Joined:  11/12/11
  • Last Seen:  

Do i need to put all that maps where the MVP are spawneda ?

like this

// Set Spawn Map

set .map$, "prontera,moc_fild17";

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

no, disable the // set .map$

and use the

setarray .maps$[0] // array insead

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   2
  • Joined:  11/12/11
  • Last Seen:  

So it will be look like this ?

// Set Spawn Map

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  201
  • Reputation:   47
  • Joined:  11/17/11
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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 .@a, 0; .@a < getarraysize(.mvpID); set .@a, .@a + 1) {
 monster .maps$[.@a],0,0,""+getmonsterinfo(.mvpID[.i],0)+"",.mvpID[.i],1,"spawned::OnMVPKill";
}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

- script mvp spawned -1,{
}

// Map Locations
setarray .maps$[0],"morc_field_1","prt_field1","gef_dun01";
monster .maps$[.@a],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

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

- script mvp spawned -1,{
}

// Map Locations
setarray .maps$[0],"morc_field_1","prt_field1","gef_dun01";
monster .maps$[.@a],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

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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$[.@i]
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(.@map$, .@x, .@y, 0);
// If Using the multiple map (change the below .map$) to .@map$

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

did I actually type that?

""+getmonsterinfo(.mvpID, 0)+""

???

Edit: Wow I did! Very noobish of me sorry... lolz

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