I understand that the project is a work in progress, so I hope you don't mind this early mod.
As I mentioned in a previous post, there is a fair bit of code in SRemu that doesn't really need to be in PUBLIC Sub's, or Functions. To preserve resources, I created two classes that can be dismissed from memory after use, rather than stay resident. In the code below, one Class calls the other.
A primary reason for creating the two classes is that we found on our PC's (Modern and with 1.5gig RAM) that SRO fell over when spawning all NPC's at once. Spawning each town, as required, makes it easier on our PC's and tempers.
Now, if we're in Jangan, we only need to type '.spawnallnpc jg'. Donwhang = '.spawnallnpc dw' etc (See the code for short names) from the interface. If you still want to spawn all towns, simply type '.spawnallnpc all'.
Create a class and call it clsNPCByTown.
Insert the following code:
'/CODE START
Option Explicit
Function NPCByTown(Index As Integer, Optional Town As String)
On Error GoTo NPC_ERR
Dim MassCLS As New clsMassSpawn
Select Case LCase$(Town)
Case "jg"
'#### Jagan City NPC ALL ####'
MassCLS.SpawnMassNPC Index, 2003, 1, 6369, 1099 'Blacksmith Chulsan
MassCLS.SpawnMassNPC Index, 2036, 1, 6177, 1145 'Soldier Jowi
MassCLS.SpawnMassNPC Index, 2032, 1, 6429, 1150 'Soldier Fengil
MassCLS.SpawnMassNPC Index, 2038, 1, 6439, 963 'Soldier Dangsam
MassCLS.SpawnMassNPC Index, 2033, 1, 6667, 1147 'Soldier lyang
MassCLS.SpawnMassNPC Index, 2035, 1, 6177, 1155 'Soldier Hogang [Teleport]
MassCLS.SpawnMassNPC Index, 2037, 1, 6429, 963 'Soldier Jingyo [Teleport]
MassCLS.SpawnMassNPC Index, 2034, 1, 6667, 1134 'Soldier Sangman [Teleport]
MassCLS.SpawnMassNPC Index, 2031, 1, 6437, 1150 'Soldier Choiyoung [Teleport]
MassCLS.SpawnMassNPC Index, 2041, 1, 6234, 1022 'So-OK
MassCLS.SpawnMassNPC Index, 2053, 1, 6494, 1100 'Herbatlist Bori
MassCLS.SpawnMassNPC Index, 2010, 1, 6511, 1007 'Trader Jodaesan
MassCLS.SpawnMassNPC Index, 2004, 1, 6368, 1068 'Protector Trader Mrs Jang
MassCLS.SpawnMassNPC Index, 2009, 1, 6368, 1004 'Stable-Keeper Machum
MassCLS.SpawnMassNPC Index, 2015, 1, 6546, 1051 'Tiket Seller Gyoun
MassCLS.SpawnMassNPC Index, 2016, 1, 6552, 1051 'Lottery Seller Wangwon
MassCLS.SpawnMassNPC Index, 2018, 1, 6615, 1103 'Village Chief Hwangno
MassCLS.SpawnMassNPC Index, 2008, 1, 6501, 1066 'Grocery Trader Jinjin
MassCLS.SpawnMassNPC Index, 2039, 1, 6283, 1014 'Bagger Sochil
MassCLS.SpawnMassNPC Index, 2044, 1, 6220, 1064 'Mihyang
MassCLS.SpawnMassNPC Index, 2043, 1, 6223, 1062 'Ahjim
MassCLS.SpawnMassNPC Index, 2019, 1, 6204, 1180 'General Sonhyeon
MassCLS.SpawnMassNPC Index, 2020, 1, 6304, 1192 'Hunter Associate Gwakwi
MassCLS.SpawnMassNPC Index, 2021, 1, 6246, 1208 'Guild Manager Leebaeak
MassCLS.SpawnMassNPC Index, 2022, 1, 6293, 1303 'Juho
MassCLS.SpawnMassNPC Index, 2023, 1, 6592, 1249 'Buddhist Priest Jeonghye
MassCLS.SpawnMassNPC Index, 2027, 1, 6511, 995 'Associate Hwajung
MassCLS.SpawnMassNPC Index, 2028, 1, 6502, 1017 'Islam Merchant Ishyak
MassCLS.SpawnMassNPC Index, 2029, 1, 6503, 986 'Adventurer Flora
MassCLS.SpawnMassNPC Index, 2030, 1, 6597, 1165 'Buddhist Priest Kushyan
MassCLS.SpawnMassNPC Index, 2040, 1, 6579, 1035 'Casino Guardian Huhoan
MassCLS.SpawnMassNPC Index, 2042, 1, 6284, 1079 'Juju
MassCLS.SpawnMassNPC Index, 2045, 1, 6294, 1056 'Juyeong
MassCLS.SpawnMassNPC Index, 2046, 1, 6208, 996 'Yumi
MassCLS.SpawnMassNPC Index, 2014, 1, 6434, 1057 'Storage-Keeper SanSan
MassCLS.SpawnMassNPC Index, 2013, 1, 6434, 1057 'Storage-Keeper Wangu
Case "jgevents"
'Others
MassCLS.SpawnMassNPC Index, 2017, 1, 5573, 1235 'Exorcist Miaorgyeong
MassCLS.SpawnMassNPC Index, 3861, 1, 6446, 1045 'Event So-OK
Case "dw"
'#### Downhang City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 2051, 1, 3575, 2041 'Blacksmith Agol
MassCLS.SpawnMassNPC Index, 2053, 1, 3515, 2033 'Herbalist Bori
MassCLS.SpawnMassNPC Index, 2052, 1, 3575, 2009 'Defense Trader Yeolah
MassCLS.SpawnMassNPC Index, 2054, 1, 3511, 1993 'Grocery Trader Yeosun
MassCLS.SpawnMassNPC Index, 2055, 1, 3597, 2085 'Stable-Keeper Makgo
MassCLS.SpawnMassNPC Index, 2057, 1, 3581, 1989 'Storekeeper Paedo
MassCLS.SpawnMassNPC Index, 2058, 1, 3581, 1989 'Storekeeper Irina
MassCLS.SpawnMassNPC Index, 2059, 1, 3495, 2076 'Specialty Shop Elder Leegak
MassCLS.SpawnMassNPC Index, 2060, 1, 3549, 2291 'Buddhist Priest Fa
MassCLS.SpawnMassNPC Index, 2061, 1, 3596, 2237 'Buddhist Priest Hyeon
MassCLS.SpawnMassNPC Index, 2062, 1, 3516, 2176 'Hunter Associate Haraho
MassCLS.SpawnMassNPC Index, 2063, 1, 3491, 1966 'Baekako
MassCLS.SpawnMassNPC Index, 2064, 1, 3501, 1966 'Honmusa
MassCLS.SpawnMassNPC Index, 2066, 1, 3627, 2116 'Soldier Moho
MassCLS.SpawnMassNPC Index, 2067, 1, 3627, 2106 'Soldier Hahun
MassCLS.SpawnMassNPC Index, 2068, 1, 3467, 2114 'Soldier Manho
MassCLS.SpawnMassNPC Index, 2069, 1, 3467, 2102 'Soldier Dooil
MassCLS.SpawnMassNPC Index, 2070, 1, 3551, 1946 'Soldier Baeksong
MassCLS.SpawnMassNPC Index, 2071, 1, 3519, 2258 'Buddhist Priest Bupgong
MassCLS.SpawnMassNPC Index, 2065, 1, 3500, 2076 'Merchant Associate Leegeuk
'MassCLS.SpawnMassNPC index, xxxx, 1, 3591, 1964 'Guild Manager Ryukang 'Need ID'
Case "dwevents"
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, 3552, 2090 'Event So-OK
Case "ht"
'#### Hotan City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 2072, 1, 50, 76 'Blacksmith Soboi
MassCLS.SpawnMassNPC Index, 2073, 1, 57, 18 'Defense Trader Gonishya
MassCLS.SpawnMassNPC Index, 2074, 1, 83, 109 'Potion Merchant Manina
MassCLS.SpawnMassNPC Index, 2075, 1, 86, -5 'Jewel Lapidary Mamoje
MassCLS.SpawnMassNPC Index, 2076, 1, 154, -5 'Stable-Keeper Salihap
MassCLS.SpawnMassNPC Index, 2077, 1, 151, 91 'Trade Shop Sanmok
MassCLS.SpawnMassNPC Index, 2083, 1, 113, 61 'Storekeeper Auisan
MassCLS.SpawnMassNPC Index, 2085, 1, 223, 154 'Hunter guild Ahmok
MassCLS.SpawnMassNPC Index, 2078, 1, 157, 83 'Merchant Guild Asaman
MassCLS.SpawnMassNPC Index, 2079, 1, 286, -65 'Boat Ticket Seller Ahgon
MassCLS.SpawnMassNPC Index, 2084, 1, 229, 450 'Nephrite Refiner Pahap
MassCLS.SpawnMassNPC Index, 2086, 1, 120, 352 'Soldier Pao
MassCLS.SpawnMassNPC Index, 2087, 1, 109, 352 'Soldier Tuolan
MassCLS.SpawnMassNPC Index, 2088, 1, 317, 53 'Soldier Boaman
MassCLS.SpawnMassNPC Index, 2089, 1, 317, 42 'Soldier Makhan
MassCLS.SpawnMassNPC Index, 2090, 1, 109, -155 'Soldier Duyun
MassCLS.SpawnMassNPC Index, 2091, 1, 118, -155 'Soldier Leihan
MassCLS.SpawnMassNPC Index, 2092, 1, -85, 52 'Soldier Wulan
MassCLS.SpawnMassNPC Index, 2093, 1, -85, 42 'Soldier Batu
'MassCLS.SpawnMassNPC index, xxxx, 1, 114, 442 'Guild Manager Musai 'Need ID'
'MassCLS.SpawnMassNPC index, 2080, 1, xxxx, xxxx 'Boatman Morap 'Need X, Y "
Case "htevents"
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, 103, 38 'Event So-OK
Case "sam"
'#### Samarkand City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 7544, 1, -5365, 2885 'Soldier Asahap
MassCLS.SpawnMassNPC Index, 7543, 1, -5365, 2898 'Soldier Ahu
MassCLS.SpawnMassNPC Index, 7542, 1, -5177, 2709 'Soldier Tapai
MassCLS.SpawnMassNPC Index, 7541, 1, -5190, 2709 'Soldier Dosowha
MassCLS.SpawnMassNPC Index, 7540, 1, -5002, 2883 'Soldier Pajeh
MassCLS.SpawnMassNPC Index, 7539, 1, -5002, 2897 'Soldier Jooha
MassCLS.SpawnMassNPC Index, 7538, 1, -5142, 3007 'Hunter Associate Shahad
MassCLS.SpawnMassNPC Index, 7534, 1, -5116, 2904 'Stable-Keeper Hoyun
MassCLS.SpawnMassNPC Index, 7537, 1, -5129, 2801 'Storage-Keeper Saesa
MassCLS.SpawnMassNPC Index, 7530, 1, -5200, 2960 'Weapon Trader Tricia
MassCLS.SpawnMassNPC Index, 7532, 1, -5234, 2873 'Nun Martel
MassCLS.SpawnMassNPC Index, 7533, 1, -5213, 2833 'Grocery Trader Saha
MassCLS.SpawnMassNPC Index, 7536, 1, -5118, 2870 'Merchant Associate Karen
MassCLS.SpawnMassNPC Index, 7535, 1, -5101, 2870 'Specialty Trader Toson
MassCLS.SpawnMassNPC Index, 7531, 1, -5247, 2915 'Protector Trader Aryoan
'MassCLS.SpawnMassNPC index, xxxx, 1, -5171, 2970 'Guild Manager Hapsa 'Need ID'
Case "samevents"
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, -5180, 2856 'Event So-OK
Case "con"
'#### Constantinople City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 7523, 1, -10872, 2315 'Soldier Justia
MassCLS.SpawnMassNPC Index, 7522, 1, -10495, 2473 'Soldier Kartino
MassCLS.SpawnMassNPC Index, 7521, 1, -10481, 2484 'Soldier Maximus
MassCLS.SpawnMassNPC Index, 7520, 1, -11005, 2636 'Soldier Alex
MassCLS.SpawnMassNPC Index, 7519, 1, -11005, 2651 'Soldier Takia
MassCLS.SpawnMassNPC Index, 7518, 1, -10638, 2935 'Soldier Riedo
MassCLS.SpawnMassNPC Index, 7517, 1, -10615, 2935 'Soldier Kotomo
MassCLS.SpawnMassNPC Index, 7516, 1, -10740, 2673 'Soldier Kasius
MassCLS.SpawnMassNPC Index, 7515, 1, -10750, 2663 'Soldier Vesaros
MassCLS.SpawnMassNPC Index, 7504, 1, -10835, 2703 'Hunter Associate Adria
MassCLS.SpawnMassNPC Index, 7509, 1, -10881, 2617 'Steward Yupitel
MassCLS.SpawnMassNPC Index, 7496, 1, -10753, 2604 'Protector Trader Jatomo
MassCLS.SpawnMassNPC Index, 7499, 1, -10765, 2532 'Stable-Keeper Treno
MassCLS.SpawnMassNPC Index, 7501, 1, -10736, 2513 'Merchant Associate Tana
MassCLS.SpawnMassNPC Index, 7500, 1, -10717, 2519 'Specialty Trader Tina
MassCLS.SpawnMassNPC Index, 7513, 1, -10885, 2351 'Association Boss Uvetino
MassCLS.SpawnMassNPC Index, 7512, 1, -10833, 2404 'Association Boss Kapros
MassCLS.SpawnMassNPC Index, 7514, 1, -10830, 2467 'General Rachel
MassCLS.SpawnMassNPC Index, 7498, 1, -10683, 2521 'Grocery Trader Bajel
MassCLS.SpawnMassNPC Index, 7508, 1, -10617, 2553 'Adventurer Demetri
MassCLS.SpawnMassNPC Index, 7503, 1, -10617, 2580 'Inn Master Sikeulro
MassCLS.SpawnMassNPC Index, 7497, 1, -10619, 2636 'Nun Retaldi
MassCLS.SpawnMassNPC Index, 7495, 1, -10674, 2649 'Weapon Trader Balbardo
MassCLS.SpawnMassNPC Index, 7525, 1, -10552, 2328 'Guild Manager Gilt
MassCLS.SpawnMassNPC Index, 7507, 1, -10386, 2775 'Clergy Gabriel
MassCLS.SpawnMassNPC Index, 7526, 1, -10618, 2921 'Guide Lipria
MassCLS.SpawnMassNPC Index, 7511, 1, -10862, 2786 'Consul Rialto
'MassCLS.SpawnMassNPC index, xxxx, 1, -10971, 2629 'Raffy 'Need ID'
'MassCLS.SpawnMassNPC index, xxxx, 1, -10696, 2607 'Guide Riise 'Need ID'
Case "conevents"
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, -10670, 2607 'Event So-OK
Case "thiefcity"
'#### Thief City NPC ####'
MassCLS.SpawnMassNPC Index, 2182, 1, 9087, 808 'Windy Phantom Thief
MassCLS.SpawnMassNPC Index, 2181, 1, 9166, 905 'Vicious Desperado
MassCLS.SpawnMassNPC Index, 2180, 1, 9138, 856 'Tiger Bandit Band
MassCLS.SpawnMassNPC Index, 2179, 1, 9148, 875 'Black Robber Band
MassCLS.SpawnMassNPC Index, 2178, 1, 9122, 823 'Thief Associate
MassCLS.SpawnMassNPC Index, 2177, 1, 9119, 890 'Stoten Goods Dealer
Case "ferryboat"
'#### Ferry and Boat ####'
MassCLS.SpawnMassNPC Index, 2011, 1, 5027, 1136 'Ferry Ticket Seller Doji
MassCLS.SpawnMassNPC Index, 2056, 1, 5043, 1664 'Ferry Ticket Seller Tayun
MassCLS.SpawnMassNPC Index, 2119, 1, 4450, 926 'Ferry Ticket Seller Chau
MassCLS.SpawnMassNPC Index, 2120, 1, 4121, 1188 'Ferry Ticket Seller Hageuk
MassCLS.SpawnMassNPC Index, 3824, 1, 1568, -18 'Boat Ticket Seller Salmai
MassCLS.SpawnMassNPC Index, 3825, 1, 1562, -296 'Boat Ticket Seller Asa
MassCLS.SpawnMassNPC Index, 3826, 1, 1078, -60 'Boat Ticket Seller Rahan
MassCLS.SpawnMassNPC Index, 3827, 1, 1124, -309 'Boat Ticket Seller Asimo
MassCLS.SpawnMassNPC Index, 7524, 1, -11424, 1161 'Harbor Manager Gale
MassCLS.SpawnMassNPC Index, 7527, 1, -8700, 2203 'Pirate Morgun
MassCLS.SpawnMassNPC Index, 7528, 1, -8700, 1828 'Pirate Blackbeard
'MassCLS.SpawnMassNPC index, 7502, 1, xxxx, xxxx 'Harbor Manager Georion 'Need X, Y "
Case "all"
'#### Jagan City NPC ALL ####'
MassCLS.SpawnMassNPC Index, 2003, 1, 6369, 1099 'Blacksmith Chulsan
MassCLS.SpawnMassNPC Index, 2036, 1, 6177, 1145 'Soldier Jowi
MassCLS.SpawnMassNPC Index, 2032, 1, 6429, 1150 'Soldier Fengil
MassCLS.SpawnMassNPC Index, 2038, 1, 6439, 963 'Soldier Dangsam
MassCLS.SpawnMassNPC Index, 2033, 1, 6667, 1147 'Soldier lyang
MassCLS.SpawnMassNPC Index, 2035, 1, 6177, 1155 'Soldier Hogang [Teleport]
MassCLS.SpawnMassNPC Index, 2037, 1, 6429, 963 'Soldier Jingyo [Teleport]
MassCLS.SpawnMassNPC Index, 2034, 1, 6667, 1134 'Soldier Sangman [Teleport]
MassCLS.SpawnMassNPC Index, 2031, 1, 6437, 1150 'Soldier Choiyoung [Teleport]
MassCLS.SpawnMassNPC Index, 2041, 1, 6234, 1022 'So-OK
MassCLS.SpawnMassNPC Index, 2053, 1, 6494, 1100 'Herbatlist Bori
MassCLS.SpawnMassNPC Index, 2010, 1, 6511, 1007 'Trader Jodaesan
MassCLS.SpawnMassNPC Index, 2004, 1, 6368, 1068 'Protector Trader Mrs Jang
MassCLS.SpawnMassNPC Index, 2009, 1, 6368, 1004 'Stable-Keeper Machum
MassCLS.SpawnMassNPC Index, 2015, 1, 6546, 1051 'Tiket Seller Gyoun
MassCLS.SpawnMassNPC Index, 2016, 1, 6552, 1051 'Lottery Seller Wangwon
MassCLS.SpawnMassNPC Index, 2018, 1, 6615, 1103 'Village Chief Hwangno
MassCLS.SpawnMassNPC Index, 2008, 1, 6501, 1066 'Grocery Trader Jinjin
MassCLS.SpawnMassNPC Index, 2039, 1, 6283, 1014 'Bagger Sochil
MassCLS.SpawnMassNPC Index, 2044, 1, 6220, 1064 'Mihyang
MassCLS.SpawnMassNPC Index, 2043, 1, 6223, 1062 'Ahjim
MassCLS.SpawnMassNPC Index, 2019, 1, 6204, 1180 'General Sonhyeon
MassCLS.SpawnMassNPC Index, 2020, 1, 6304, 1192 'Hunter Associate Gwakwi
MassCLS.SpawnMassNPC Index, 2021, 1, 6246, 1208 'Guild Manager Leebaeak
MassCLS.SpawnMassNPC Index, 2022, 1, 6293, 1303 'Juho
MassCLS.SpawnMassNPC Index, 2023, 1, 6592, 1249 'Buddhist Priest Jeonghye
MassCLS.SpawnMassNPC Index, 2027, 1, 6511, 995 'Associate Hwajung
MassCLS.SpawnMassNPC Index, 2028, 1, 6502, 1017 'Islam Merchant Ishyak
MassCLS.SpawnMassNPC Index, 2029, 1, 6503, 986 'Adventurer Flora
MassCLS.SpawnMassNPC Index, 2030, 1, 6597, 1165 'Buddhist Priest Kushyan
MassCLS.SpawnMassNPC Index, 2040, 1, 6579, 1035 'Casino Guardian Huhoan
MassCLS.SpawnMassNPC Index, 2042, 1, 6284, 1079 'Juju
MassCLS.SpawnMassNPC Index, 2045, 1, 6294, 1056 'Juyeong
MassCLS.SpawnMassNPC Index, 2046, 1, 6208, 996 'Yumi
MassCLS.SpawnMassNPC Index, 2014, 1, 6434, 1057 'Storage-Keeper SanSan
MassCLS.SpawnMassNPC Index, 2013, 1, 6434, 1057 'Storage-Keeper Wangu
'Others
MassCLS.SpawnMassNPC Index, 2017, 1, 5573, 1235 'Exorcist Miaorgyeong
MassCLS.SpawnMassNPC Index, 3861, 1, 6446, 1045 'Event So-OK
'#### Downhang City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 2051, 1, 3575, 2041 'Blacksmith Agol
MassCLS.SpawnMassNPC Index, 2053, 1, 3515, 2033 'Herbalist Bori
MassCLS.SpawnMassNPC Index, 2052, 1, 3575, 2009 'Defense Trader Yeolah
MassCLS.SpawnMassNPC Index, 2054, 1, 3511, 1993 'Grocery Trader Yeosun
MassCLS.SpawnMassNPC Index, 2055, 1, 3597, 2085 'Stable-Keeper Makgo
MassCLS.SpawnMassNPC Index, 2057, 1, 3581, 1989 'Storekeeper Paedo
MassCLS.SpawnMassNPC Index, 2058, 1, 3581, 1989 'Storekeeper Irina
MassCLS.SpawnMassNPC Index, 2059, 1, 3495, 2076 'Specialty Shop Elder Leegak
MassCLS.SpawnMassNPC Index, 2060, 1, 3549, 2291 'Buddhist Priest Fa
MassCLS.SpawnMassNPC Index, 2061, 1, 3596, 2237 'Buddhist Priest Hyeon
MassCLS.SpawnMassNPC Index, 2062, 1, 3516, 2176 'Hunter Associate Haraho
MassCLS.SpawnMassNPC Index, 2063, 1, 3491, 1966 'Baekako
MassCLS.SpawnMassNPC Index, 2064, 1, 3501, 1966 'Honmusa
MassCLS.SpawnMassNPC Index, 2066, 1, 3627, 2116 'Soldier Moho
MassCLS.SpawnMassNPC Index, 2067, 1, 3627, 2106 'Soldier Hahun
MassCLS.SpawnMassNPC Index, 2068, 1, 3467, 2114 'Soldier Manho
MassCLS.SpawnMassNPC Index, 2069, 1, 3467, 2102 'Soldier Dooil
MassCLS.SpawnMassNPC Index, 2070, 1, 3551, 1946 'Soldier Baeksong
MassCLS.SpawnMassNPC Index, 2071, 1, 3519, 2258 'Buddhist Priest Bupgong
MassCLS.SpawnMassNPC Index, 2065, 1, 3500, 2076 'Merchant Associate Leegeuk
'MassCLS.SpawnMassNPC index, xxxx, 1, 3591, 1964 'Guild Manager Ryukang 'Need ID'
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, 3552, 2090 'Event So-OK
'#### Hotan City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 2072, 1, 50, 76 'Blacksmith Soboi
MassCLS.SpawnMassNPC Index, 2073, 1, 57, 18 'Defense Trader Gonishya
MassCLS.SpawnMassNPC Index, 2074, 1, 83, 109 'Potion Merchant Manina
MassCLS.SpawnMassNPC Index, 2075, 1, 86, -5 'Jewel Lapidary Mamoje
MassCLS.SpawnMassNPC Index, 2076, 1, 154, -5 'Stable-Keeper Salihap
MassCLS.SpawnMassNPC Index, 2077, 1, 151, 91 'Trade Shop Sanmok
MassCLS.SpawnMassNPC Index, 2083, 1, 113, 61 'Storekeeper Auisan
MassCLS.SpawnMassNPC Index, 2085, 1, 223, 154 'Hunter guild Ahmok
MassCLS.SpawnMassNPC Index, 2078, 1, 157, 83 'Merchant Guild Asaman
MassCLS.SpawnMassNPC Index, 2079, 1, 286, -65 'Boat Ticket Seller Ahgon
MassCLS.SpawnMassNPC Index, 2084, 1, 229, 450 'Nephrite Refiner Pahap
MassCLS.SpawnMassNPC Index, 2086, 1, 120, 352 'Soldier Pao
MassCLS.SpawnMassNPC Index, 2087, 1, 109, 352 'Soldier Tuolan
MassCLS.SpawnMassNPC Index, 2088, 1, 317, 53 'Soldier Boaman
MassCLS.SpawnMassNPC Index, 2089, 1, 317, 42 'Soldier Makhan
MassCLS.SpawnMassNPC Index, 2090, 1, 109, -155 'Soldier Duyun
MassCLS.SpawnMassNPC Index, 2091, 1, 118, -155 'Soldier Leihan
MassCLS.SpawnMassNPC Index, 2092, 1, -85, 52 'Soldier Wulan
MassCLS.SpawnMassNPC Index, 2093, 1, -85, 42 'Soldier Batu
'MassCLS.SpawnMassNPC index, xxxx, 1, 114, 442 'Guild Manager Musai 'Need ID'
'MassCLS.SpawnMassNPC index, 2080, 1, xxxx, xxxx 'Boatman Morap 'Need X, Y "
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, 103, 38 'Event So-OK
'#### Samarkand City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 7544, 1, -5365, 2885 'Soldier Asahap
MassCLS.SpawnMassNPC Index, 7543, 1, -5365, 2898 'Soldier Ahu
MassCLS.SpawnMassNPC Index, 7542, 1, -5177, 2709 'Soldier Tapai
MassCLS.SpawnMassNPC Index, 7541, 1, -5190, 2709 'Soldier Dosowha
MassCLS.SpawnMassNPC Index, 7540, 1, -5002, 2883 'Soldier Pajeh
MassCLS.SpawnMassNPC Index, 7539, 1, -5002, 2897 'Soldier Jooha
MassCLS.SpawnMassNPC Index, 7538, 1, -5142, 3007 'Hunter Associate Shahad
MassCLS.SpawnMassNPC Index, 7534, 1, -5116, 2904 'Stable-Keeper Hoyun
MassCLS.SpawnMassNPC Index, 7537, 1, -5129, 2801 'Storage-Keeper Saesa
MassCLS.SpawnMassNPC Index, 7530, 1, -5200, 2960 'Weapon Trader Tricia
MassCLS.SpawnMassNPC Index, 7532, 1, -5234, 2873 'Nun Martel
MassCLS.SpawnMassNPC Index, 7533, 1, -5213, 2833 'Grocery Trader Saha
MassCLS.SpawnMassNPC Index, 7536, 1, -5118, 2870 'Merchant Associate Karen
MassCLS.SpawnMassNPC Index, 7535, 1, -5101, 2870 'Specialty Trader Toson
MassCLS.SpawnMassNPC Index, 7531, 1, -5247, 2915 'Protector Trader Aryoan
'MassCLS.SpawnMassNPC index, xxxx, 1, -5171, 2970 'Guild Manager Hapsa 'Need ID'
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, -5180, 2856 'Event So-OK
'#### Constantinople City ALL NPC ####'
MassCLS.SpawnMassNPC Index, 7523, 1, -10872, 2315 'Soldier Justia
MassCLS.SpawnMassNPC Index, 7522, 1, -10495, 2473 'Soldier Kartino
MassCLS.SpawnMassNPC Index, 7521, 1, -10481, 2484 'Soldier Maximus
MassCLS.SpawnMassNPC Index, 7520, 1, -11005, 2636 'Soldier Alex
MassCLS.SpawnMassNPC Index, 7519, 1, -11005, 2651 'Soldier Takia
MassCLS.SpawnMassNPC Index, 7518, 1, -10638, 2935 'Soldier Riedo
MassCLS.SpawnMassNPC Index, 7517, 1, -10615, 2935 'Soldier Kotomo
MassCLS.SpawnMassNPC Index, 7516, 1, -10740, 2673 'Soldier Kasius
MassCLS.SpawnMassNPC Index, 7515, 1, -10750, 2663 'Soldier Vesaros
MassCLS.SpawnMassNPC Index, 7504, 1, -10835, 2703 'Hunter Associate Adria
MassCLS.SpawnMassNPC Index, 7509, 1, -10881, 2617 'Steward Yupitel
MassCLS.SpawnMassNPC Index, 7496, 1, -10753, 2604 'Protector Trader Jatomo
MassCLS.SpawnMassNPC Index, 7499, 1, -10765, 2532 'Stable-Keeper Treno
MassCLS.SpawnMassNPC Index, 7501, 1, -10736, 2513 'Merchant Associate Tana
MassCLS.SpawnMassNPC Index, 7500, 1, -10717, 2519 'Specialty Trader Tina
MassCLS.SpawnMassNPC Index, 7513, 1, -10885, 2351 'Association Boss Uvetino
MassCLS.SpawnMassNPC Index, 7512, 1, -10833, 2404 'Association Boss Kapros
MassCLS.SpawnMassNPC Index, 7514, 1, -10830, 2467 'General Rachel
MassCLS.SpawnMassNPC Index, 7498, 1, -10683, 2521 'Grocery Trader Bajel
MassCLS.SpawnMassNPC Index, 7508, 1, -10617, 2553 'Adventurer Demetri
MassCLS.SpawnMassNPC Index, 7503, 1, -10617, 2580 'Inn Master Sikeulro
MassCLS.SpawnMassNPC Index, 7497, 1, -10619, 2636 'Nun Retaldi
MassCLS.SpawnMassNPC Index, 7495, 1, -10674, 2649 'Weapon Trader Balbardo
MassCLS.SpawnMassNPC Index, 7525, 1, -10552, 2328 'Guild Manager Gilt
MassCLS.SpawnMassNPC Index, 7507, 1, -10386, 2775 'Clergy Gabriel
MassCLS.SpawnMassNPC Index, 7526, 1, -10618, 2921 'Guide Lipria
MassCLS.SpawnMassNPC Index, 7511, 1, -10862, 2786 'Consul Rialto
'MassCLS.SpawnMassNPC index, xxxx, 1, -10971, 2629 'Raffy 'Need ID'
'MassCLS.SpawnMassNPC index, xxxx, 1, -10696, 2607 'Guide Riise 'Need ID'
'Others
MassCLS.SpawnMassNPC Index, 3861, 1, -10670, 2607 'Event So-OK
'#### Thief City NPC ####'
MassCLS.SpawnMassNPC Index, 2182, 1, 9087, 808 'Windy Phantom Thief
MassCLS.SpawnMassNPC Index, 2181, 1, 9166, 905 'Vicious Desperado
MassCLS.SpawnMassNPC Index, 2180, 1, 9138, 856 'Tiger Bandit Band
MassCLS.SpawnMassNPC Index, 2179, 1, 9148, 875 'Black Robber Band
MassCLS.SpawnMassNPC Index, 2178, 1, 9122, 823 'Thief Associate
MassCLS.SpawnMassNPC Index, 2177, 1, 9119, 890 'Stoten Goods Dealer
'#### Ferry and Boat ####'
MassCLS.SpawnMassNPC Index, 2011, 1, 5027, 1136 'Ferry Ticket Seller Doji
MassCLS.SpawnMassNPC Index, 2056, 1, 5043, 1664 'Ferry Ticket Seller Tayun
MassCLS.SpawnMassNPC Index, 2119, 1, 4450, 926 'Ferry Ticket Seller Chau
MassCLS.SpawnMassNPC Index, 2120, 1, 4121, 1188 'Ferry Ticket Seller Hageuk
MassCLS.SpawnMassNPC Index, 3824, 1, 1568, -18 'Boat Ticket Seller Salmai
MassCLS.SpawnMassNPC Index, 3825, 1, 1562, -296 'Boat Ticket Seller Asa
MassCLS.SpawnMassNPC Index, 3826, 1, 1078, -60 'Boat Ticket Seller Rahan
MassCLS.SpawnMassNPC Index, 3827, 1, 1124, -309 'Boat Ticket Seller Asimo
MassCLS.SpawnMassNPC Index, 7524, 1, -11424, 1161 'Harbor Manager Gale
MassCLS.SpawnMassNPC Index, 7527, 1, -8700, 2203 'Pirate Morgun
MassCLS.SpawnMassNPC Index, 7528, 1, -8700, 1828 'Pirate Blackbeard
'MassCLS.SpawnMassNPC index, 7502, 1, xxxx, xxxx 'Harbor Manager Georion 'Need X, Y "
End Select
NPC_ERR:
Set MassCLS = Nothing
End Function
'/END OF clsNPCByTown Class
Create another Class and call it clsMassSpawn
Insert the following code:
'/CODE START
Option Explicit
Private fData As String
Private pLen As Integer
Private i As Integer
Private x As Integer
Private Type spawndata
XPos As Double
YPos As Double
End Type
Function SpawnMassNPC(Index As Integer, NPCID As Integer, UniqueID As Integer, pozX As Double, pozY As Double)
Dim ID As String
fData = "0300CB300000"
fData = fData & "010100"
For i = 1 To UBound(PlayerData)
If PlayerData(i).Ingame = True Then
frmMain.GameSocket(i).SendData cv_StringFromHex(fData)
End If
Next i
fData = "17340000"
fData = fData & DWordFromInteger(NPCID)
'fData = fData & DWordFromInteger(UniqueID)
ID = (Inverse((DecToHexLong(CLng(Rnd * 1265535) + 101001))))
fData = fData & ID
fData = fData & Inverse(ByteFromInteger((PlayerData(Index).XSection))) 'X sector
fData = fData & Inverse(ByteFromInteger((PlayerData(Index).YSection))) 'ySector
fData = fData & Inverse(Float2Hex((pozX - ((PlayerData(Index).XSection) - 135) * 192) * 10)) 'X
fData = fData & "00000000" 'Z
fData = fData & Inverse(Float2Hex((pozY - ((PlayerData(Index).YSection) - 92) * 192) * 10)) 'Y
fData = fData & "0000"
fData = fData & "000100"
fData = fData & "0000"
fData = fData & "010000"
fData = fData & "00000000000000000000C842"
fData = fData & "0000"
'extra data(different for each shop,npcs that do nothing just use the 0000 above)
'fData = fData & "0002"
'fData = fData & "03040000"
'just testing
fData = WordFromInteger(((Len(fData) -
For i = 1 To UBound(PlayerData)
If PlayerData(i).Ingame = True Then
frmMain.GameSocket(i).SendData cv_StringFromHex(fData)
End If
Next
For i = 1 To UBound(NPCList)
If NPCList(i).ID = "" Then
NPCList(i).ID = ID
NPCList(i).NPCID = NPCID
Exit For
End If
Next
fData = "00000A330000"
For i = 1 To UBound(PlayerData)
If PlayerData(i).Ingame = True Then
frmMain.GameSocket(i).SendData cv_StringFromHex(fData)
End If
Next
End Function
'/END of clsMassSpawn class
To call the spawn class, replace the following code in the HandleChat sub:
Case ".spawnallnpc"
npcPleaces Index 'spawn all npc
with this:
Case ".spawnbytown"
Dim NPCCLS As New clsNPCByTown
NPCCLS.NPCByTown Index, sCommands(1)
Set NPCCLS = Nothing
You can now remove the Modules npcPleaces and npcSpawn from the project.
Any questions, PM me, or post here so everyone sees the answers.

Learning 


