Hello maybe u know it already but my name is vincent and i'm bored again xD
1.
paste this in to a new .cpp file
if u wanna let her spawn for less money just change :
,
and
to your price =D
2.
In NPCsScripts.h add:
sumwhere between the other case things.
and add:
to static void things.
3.
add this to the 180000000.xml file(can be found in /ur repack/maplestoryserver/maps/180000000.xml):
so ur 180000000.xml file looks something like this(can be an npc more or less):
Credits:
Me, for starting with npc coding and release.
mudkip, for fixing some bugs in npc code.
Asianboy, for the idea
For this to work you need to Add my "spawnMob" feature :Code:http://forum.ragezone.com/showthread.php?t=398364
1.
paste this in to a new .cpp file
Code:
#include "NPCs.h"
#include "Player.h"
#include "NPCsScripts.h"
#include "Inventory.h"
void NPCsScripts::npc_9010003(NPC* npc){
Player* player = npc->getPlayer();
int state = npc->getState();
if(state == 0){
npc->addText("Hello, I can spawn Golden Slimes for 1 milion mesos. Do you want me to spawn Golden Slimes?");
state = 1;
npc->sendYesNo();
}
else if(state == 1){
if(npc->getMesos() >= 1000000){
if(npc->getSelected() == YES){
npc->addText("Okay, Poopiedoo.");
npc->giveMesos(-1000000);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->spawnMob(9400202);
npc->sendOK();
npc->end();
}
else if(npc->getSelected() == NO){
npc->addText("Fine, I won't spawn!");
npc->sendOK();
npc->end();
}
}
else if(npc->getMesos() <=1000000){
if(npc->getSelected() == YES){
npc->addText("You don't have enough mesos.");
npc->sendOK();
npc->end();
}
}
}
}
if u wanna let her spawn for less money just change :
Code:
("Hello, I can spawn Golden Slimes for [COLOR=DarkOrange]1 milion[/COLOR] mesos. Do you want me to spawn Golden Slimes?");
Code:
else if(state == 1){
if(npc->getMesos() >= [COLOR=DarkOrange]1000000[/COLOR]){
if(npc->getSelected() == YES){
npc->addText("Okay, Poopiedoo.");
npc->giveMesos(-[COLOR=DarkOrange]1000000[/COLOR]);
npc->spawnMob(9400202);
Code:
}
else if(npc->getMesos() <=[COLOR=DarkOrange]1000000[/COLOR]){
if(npc->getSelected() == YES){
npc->addText("You don't have enough mesos.");
npc->sendOK();
npc->end();
2.
In NPCsScripts.h add:
Code:
case 9010003: npc_9010003(npc); break;
and add:
Code:
static void npc_9010003(NPC* npc);
3.
add this to the 180000000.xml file(can be found in /ur repack/maplestoryserver/maps/180000000.xml):
Code:
<NPC>
<id>9010003</id>
<x>300</x>
<cy>95</cy>
<fh>23</fh>
<rx0>300</rx0>
<rx1>300</rx1>
</NPC>
Code:
<?xml version="1.0" ?>
<Map>
<returnMap>100000000</returnMap>
<NPCs>
<NPC>
<id>9900000</id>
<x>374</x>
<cy>95</cy>
<fh>23</fh>
<rx0>324</rx0>
<rx1>379</rx1>
</NPC>
[COLOR=DarkOrange] <NPC>
<id>9010003</id>
<x>300</x>
<cy>95</cy>
<fh>23</fh>
<rx0>300</rx0>
<rx1>300</rx1>
</NPC>[/COLOR]
<NPC>
<id>9900001</id>
<x>283</x>
<cy>-85</cy>
<fh>26</fh>
<rx0>233</rx0>
<rx1>289</rx1>
</NPC>
<NPC>
<id>9201052</id>
<x>150</x>
<cy>-82</cy>
<fh>28</fh>
<rx0>200</rx0>
<rx1>200</rx1>
</NPC>
</NPCs>
<Mobs />
<Portals>
<Portal>
<id>0</id>
<from>sp</from>
<to></to>
<toid>999999999</toid>
<type>0</type>
<x>0</x>
<y>0</y>
</Portal>
</Portals>
<Footholds>
<Foothold>
<x1>-270</x1>
<y1>-205</y1>
<x2>-180</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>-399</x1>
<y1>-180</y1>
<x2>-399</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>-399</x1>
<y1>-205</y1>
<x2>-321</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>-321</x1>
<y1>-205</y1>
<x2>-270</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>270</x1>
<y1>-205</y1>
<x2>321</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>-180</x1>
<y1>-205</y1>
<x2>-90</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>-90</x1>
<y1>-205</y1>
<x2>0</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>0</x1>
<y1>-205</y1>
<x2>90</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>90</x1>
<y1>-205</y1>
<x2>180</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>180</x1>
<y1>-205</y1>
<x2>270</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>321</x1>
<y1>-205</y1>
<x2>360</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>360</x1>
<y1>-205</y1>
<x2>399</x2>
<y2>-205</y2>
</Foothold>
<Foothold>
<x1>399</x1>
<y1>-205</y1>
<x2>399</x2>
<y2>-180</y2>
</Foothold>
<Foothold>
<x1>-399</x1>
<y1>120</y1>
<x2>-399</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>-399</x1>
<y1>95</y1>
<x2>-321</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>-321</x1>
<y1>95</y1>
<x2>-270</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>-270</x1>
<y1>95</y1>
<x2>-180</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>-180</x1>
<y1>95</y1>
<x2>-90</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>0</x1>
<y1>95</y1>
<x2>90</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>-90</x1>
<y1>95</y1>
<x2>0</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>90</x1>
<y1>95</y1>
<x2>180</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>180</x1>
<y1>95</y1>
<x2>270</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>321</x1>
<y1>95</y1>
<x2>399</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>399</x1>
<y1>95</y1>
<x2>399</x2>
<y2>120</y2>
</Foothold>
<Foothold>
<x1>270</x1>
<y1>95</y1>
<x2>321</x2>
<y2>95</y2>
</Foothold>
<Foothold>
<x1>231</x1>
<y1>-85</y1>
<x2>309</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>309</x1>
<y1>-85</y1>
<x2>309</x2>
<y2>-60</y2>
</Foothold>
<Foothold>
<x1>180</x1>
<y1>-85</y1>
<x2>231</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>90</x1>
<y1>-85</y1>
<x2>180</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>0</x1>
<y1>-85</y1>
<x2>90</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>-90</x1>
<y1>-85</y1>
<x2>0</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>-219</x1>
<y1>-60</y1>
<x2>-219</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>-219</x1>
<y1>-85</y1>
<x2>-141</x2>
<y2>-85</y2>
</Foothold>
<Foothold>
<x1>-141</x1>
<y1>-85</y1>
<x2>-90</x2>
<y2>-85</y2>
</Foothold>
</Footholds>
</Map>
Credits:
Me, for starting with npc coding and release.
mudkip, for fixing some bugs in npc code.
Asianboy, for the idea