Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Star selling NPC

Status
Not open for further replies.
Newbie Spellweaver
Joined
Feb 24, 2008
Messages
19
Reaction score
0
This makes Cody in Henesys sell Tobi, steely, Ilbi, and Hwabi stars for a set price you pick.

For reference in adding this, look at this tutorial: http://forum.ragezone.com/f427/tutorial-scripting-your-npc-381658/

Code:
int Star;
void NPCsScripts::npc_9200000(NPC* npc){
    int state = npc->getState();
    int map = npc->getPlayerMap();
    if(npc->getPlayerMap() == 100000000){
        if(state == 0){
      
             npc->addText("Hey, I sell all types of stars!");//Send Text For Cody To Output
             npc->sendNext();//Just think of this to enable you to Click "next" button for continuing....
        }
    else if(state == 1){     
             npc->addText("Which star would you like??\r\n#L0#Tobi - 50k#l\r\n#L1#Steely - 100k#l\r\n#L2#Ilbi -150k#l\r\n#L3#Hwabi -200k#l");
             npc->sendSimple();
                     } 
        }
    if(state == 2){
        Star = npc->getSelected();
        npc->setVariable("Star", Star);
        if(Star == 0){ // Tobi
            npc->addText("Are you sure you want to buy #bTobis#k?");
            npc->sendYesNo();
        }
        else if(Star == 1){ // Steely
            npc->addText("Are you sure you want to buy #bSteelys#k?");
            npc->sendYesNo();            
        }
        else if(Star == 2){ // Ilbi
            npc->addText("Are you sure you want to buy #bIlbis#k?");
            npc->sendYesNo();
        }
        else if(Star == 3){ // Hwabi
            npc->addText("Are you sure you want to buy #bHwabis#k?");
            npc->sendYesNo();
        }
    }
    if(state == 3 && Star == 0){
        if(npc->getSelected() == YES){
            npc->end();
            npc->giveItem(2070004, 1);
            npc->giveMesos(-50000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        npc->end();
    }
    if(state == 3 && Star == 1){
        if(npc->getSelected() == YES){
            npc->giveItem(2070005, 1);
            npc->giveMesos(-100000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        npc->end();
    }
    if(state == 3 && Star == 2){
        if(npc->getSelected() == YES){
            npc->giveItem(2070006, 1);
            npc->giveMesos(-150000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        npc->end();
    }
    if(state == 3 && Star == 3){
        if(npc->getSelected() == YES){
            npc->giveItem(2070007, 1);
            npc->giveMesos(-200000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        npc->end();
    }
}

Credits:
cPlusPlus - looked at his tutorial
 
Newbie Spellweaver
Joined
Apr 5, 2008
Messages
17
Reaction score
0
Re: [Release] Star selling NPC

Only need to add this code, nothing more?
 
Newbie Spellweaver
Joined
Feb 24, 2008
Messages
19
Reaction score
0
Re: [Release] Star selling NPC

You have to call the NPC in npcscripts.h
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
38
Reaction score
1
Re: [Release] Star selling NPC

There are two different errors;

error 1 - i put cody.cpp into NPCs;
1>.\NPCs\Cody.cpp(4) : error C2039: 'npc_9200000' : is not a member of 'NPCsScripts'
1> d:\forsakenms\maplestoryserver\npcs\NPCsScripts.h(29) : see declaration of 'NPCsScripts'

error 2 - i dont put cody.cpp in NPCs
1>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_9200000(class NPC *)" (?npc_9200000@NPCsScripts@@CAXPAVNPC@@@Z)
1>D:\forsakenMS\Release\MapleStoryServer.exe : fatal error LNK1120: 1 unresolved externals

help me out ^^?
 
Newbie Spellweaver
Joined
Aug 13, 2007
Messages
15
Reaction score
0
Re: [Release] Star selling NPC

no xml?
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
10
Reaction score
0
Re: [Release] Star selling NPC

There are two different errors;

error 1 - i put cody.cpp into NPCs;
1>.\NPCs\Cody.cpp(4) : error C2039: 'npc_9200000' : is not a member of 'NPCsScripts'
1> d:\forsakenms\maplestoryserver\npcs\NPCsScripts.h(29) : see declaration of 'NPCsScripts'

error 2 - i dont put cody.cpp in NPCs
1>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_9200000(class NPC *)" (?npc_9200000@NPCsScripts@@CAXPAVNPC@@@Z)
1>D:\forsakenMS\Release\MapleStoryServer.exe : fatal error LNK1120: 1 unresolved externals

help me out ^^?

Add
Code:
case 9200000: npc_9200000(npc); break;
before
Code:
 default: npc->end(); break;
and
Code:
static void npc_9200000(NPC* npc);
before
Code:
};

#endif

Also, with this code, you don't need the require amount of mesos to purchase the stars. So you can have no mesos and buy the stars and then end up with negative mesos.
 
Newbie Spellweaver
Joined
Aug 16, 2007
Messages
91
Reaction score
0
Re: [Release] Star selling NPC

Aw this doesn't have a check if they have enough mesos.
 
Newbie Spellweaver
Joined
Feb 24, 2008
Messages
19
Reaction score
0
Re: [Release] Star selling NPC

Yeah I didn't even think about that.. i'll add it later
 
Newbie Spellweaver
Joined
Aug 16, 2007
Messages
91
Reaction score
0
Re: [Release] Star selling NPC

Okay looking forward to it
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
38
Reaction score
1
Re: [Release] Star selling NPC

1>d:\forsakenms\maplestoryserver\NPCsScripts.h(41) : error C3861: 'npc_9900000': identifier not found
thats the new error;

heres my NPCsScripts.h (if anybody bothers to find the problem)
#ifndef NPCSSCRIPT_H
#define NPCSSCRIPT_H

class NPC;

int strval(char* buf);

class QuestsScripts {
public:
static void handle(int npcid, NPC* npc, bool start){
if(start){
switch(npcid){
case 2000: npc_2000s(npc); break;
default: npc->end(); break;
}
}
else{
switch(npcid){
case 2000: npc_2000e(npc); break;
default: npc->end(); break;
}
}
}
private:
static void npc_2000s(NPC* npc);
static void npc_2000e(NPC* npc);
};

class NPCsScripts {
public:
static void handle(int npcid, NPC* npc){
if(npc->isQuest()){
QuestsScripts::handle(npcid, npc, npc->isStart());
return;
}
switch(npcid){
case 2100: npc_2100(npc); break;
case 2101: npc_2101(npc); break;
case 2020005: npc_2020005(npc); break;
case 9101001: npc_9101001(npc); break;
case 9900000: npc_9900000(npc); break;
// Teleporters
case 1002000: npc_1002000(npc); break; // Phil - Lith Harbor (104000000)
case 1012000: npc_1012000(npc); break; // Regular Cab - Heneseys (100000000)
case 1022001: npc_1022001(npc); break; // Regular Cab - Perion (102000000)
case 1032000: npc_1032000(npc); break; // Regular Cab - Ellinia (101000000)
case 1052016: npc_1052016(npc); break; // Regular Cab - Kerning City (103000000)
case 1002004: npc_1002004(npc); break; // VIP Cab - Lith Harbor (104000000)
case 1032005: npc_1032005(npc); break; // VIP Cab - Ellinia (101000000)
case 1081001: npc_1081001(npc); break; // Pison - Florina Beach (110000000)
case 1002002: npc_1002002(npc); break; // Pason - Lith Harbor (104000000)
case 9201056: npc_9201056(npc); break; // NLC Taxi - New Leaf City (600000000) Phantom Forest (682000000)
case 9000020: npc_9000020(npc); break;
// Spinel - Amoria (680000000) Ellinia (101000000)
// Henesys (100000000) Kerning City (103000000)
// Leafre (240000000) Lith Harbor (104000000)
// Ludibrium (220000000) Mu Lung (250000000)
// Mushroom Shrine (800000000) Orbis (200000000)
// Perion (102000000)
case 2093004: npc_2093004(npc); break; // Dolphin - The Pier near Sea (251000100)
case 2060009: npc_2060009(npc); break; // Dolphin - Aquarium (230000000)
case 9201057: npc_9201057(npc); break; // Bell - Kerning City (103000000) New Leaf City (600000000)
case 2012000: npc_2012000(npc); break; // Agatha - Orbis Ticketing Booth (200000100)
case 2082000: npc_2082000(npc); break; // Mue - Leafre Ticketing Booth (240000100)
case 2040000: npc_2040000(npc); break; // Mel - Ludibrium Ticketing Place (220000100)
case 1032007: npc_1032007(npc); break; // Joel - Ellinia Station (101000300)
case 2090005: npc_2090005(npc); break; // Hak - Mu Lung (250000100) Herb Town (251000000)
case 22000: npc_22000(npc); break; // Shanks - Southperry (60000)
case 2030000: npc_2030000(npc); break; // Jeff - Ice Valley II (211040200)
case 1012100: npc_1012100(npc); break; //Athena Pierce
case 1032001: npc_1032001(npc); break; //Grendel the Really Old
case 1022000: npc_1022000(npc); break; //Dances with Balrog
case 1052001: npc_1052001(npc); break; //Dark Lord
case 2020008: npc_2020008(npc); break; //Tylus - 3rd Job Warrior
case 2020010: npc_2020010(npc); break; //Rene - 3rd Job Archer
case 2020011: npc_2020011(npc); break; //Arec - 3rd Job Thief
case 2020009: npc_2020009(npc); break; //Robeira - 3rd Job Wizard
case 9100100: npc_9100100(npc); break;
case 9100101: npc_9100101(npc); break;
case 9100102: npc_9100102(npc); break;
case 9100103: npc_9100103(npc); break;
case 9100104: npc_9100104(npc); break;
case 9100106: npc_9100106(npc); break;
case 9100109: npc_9100109(npc); break;
case 1021100: npc_1021100(npc); break;
case 1031000: npc_1031000(npc); break;
case 1031001: npc_1031001(npc); break;
case 1031100: npc_1031100(npc); break;
case 1011000: npc_1011000(npc); break;
case 1011001: npc_1011001(npc); break;
case 1011100: npc_1011100(npc); break;
case 1021000: npc_1021000(npc); break;
case 1021001: npc_1021001(npc); break;
case 1051000: npc_1051000(npc); break;
case 1051001: npc_1051001(npc); break;
case 1051002: npc_1051002(npc); break;
case 21000: npc_21000(npc); break;
case 11100: shop(npc); break; // Lucy - Amherst Department Store (1010003)
case 9201020: shop(npc); break; // Vivian Boutique - Amoria Wedding Shop (680000001)
case 2070003: shop(npc); break; // Dori - Korean Folk Town (222000000)
case 2070001: shop(npc); break; // Bung's Mama - Korean Folk Town (222000000)
case 2070002: shop(npc); break; // Moki - Korean Folk Town (222000000)
case 2041002: shop(npc); break; // Hid - Ludibrium Weapon Store (220000001)
case 2041003: shop(npc); break; // Miru - Ludibrium Weapon Store (220000001)
case 2041006: shop(npc); break; // Misky - Ludibrium Pharmacy (220000002)
case 2090002: shop(npc); break; // Bidiwon - Mu Lung (250000000)
case 2090001: shop(npc); break; // Gong Gong - Mu Lung (250000000)
case 2090003: shop(npc); break; // Dalsuk - Mu Lung Department Store (250000002)
case 9110003: shop(npc); break; // Janken - Mushroom Shrine (800000000)
case 9110004: shop(npc); break; // Taru - Mushroom Shrine (800000000)
case 9110005: shop(npc); break; // Bronze - Mushroom Shrine (800000000)
case 9110006: shop(npc); break; // Jin Jia - Mushroom Shrine (800000000)
case 9110007: shop(npc); break; // Robo - Mushroom Shrine (800000000)
case 9201058: shop(npc); break; // Delphi - New Leaf City - Town Center (600000000)
case 9201059: shop(npc); break; // Kyle - New Leaf City - Town Center (600000000)
case 9201060: shop(npc); break; // Miki - New Leaf City - Town Center (600000000)
case 1061001: shop(npc); break; // 24 Hr Mobile Store - Ant Tunnel Park (105070001)
case 1081000: shop(npc); break; // Valen - Florina Beach (110000000)
case 1001000: shop(npc); break; // Silver - Lith Harbor Weapon Shop (104000003)
case 1001001: shop(npc); break; // Natasha - Lith Harbor Armor Shop (104000001)
case 1001100: shop(npc); break; // Mina - Lith Harbor Department Store (104000002)
case 1061002: shop(npc); break; // Mr. Sweatbottom - Regular Sauna (105040401)
case 2022001: shop(npc); break; // Hana - El Nath Department Store (211000102)
case 2020001: shop(npc); break; // Scott - El Nath Weapon Store (211000101)
case 2022000: shop(npc); break; // Rumi - El Nath Weapon Store (211000101)
case 2060004: shop(npc); break; // Oannes - Department Store (230000002)
case 2060003: shop(npc); break; // Melias - Department Store (230000002)
case 2060007: shop(npc); break; // Calypso - Department Store (230000002)
case 2050000: shop(npc); break; // Dr. San - Silo (221000200)
case 2050003: shop(npc); break; // Spacen - Silo (221000200)
case 2051000: shop(npc); break; // Dr. Pepper - Silo (221000200)
case 2012003: shop(npc); break; // Neri the Fairy - Orbis Weapon Store (200000001)
case 2012004: shop(npc); break; // Nuri the Fairy - Orbis Weapon Store (200000001)
case 2012005: shop(npc); break; // Edel the Fairy - Orbis Department Store (200000002)
case 2093000: shop(npc); break; // Mu Tan - Herb Town (251000000)
case 2093002: shop(npc); break; // Lan Ming - Herb Town (251000000)
case 2093001: shop(npc); break; // So Won - Herb Town (251000000)
case 2080002: shop(npc); break; // Max - Leafre (240000000)
case 2080001: shop(npc); break; // Sly - Department Store (240000002)
case 1052104: shop(npc); break; // Tulcus - The Swamp of Despair II (107000100)
case 1032103: shop(npc); break; // El Moth - The Tree That Grew III (101010102)
case 2022002: shop(npc); break; // Barun - Orbis Tower <14th Floor> (200080800)
case 2041016: shop(npc); break; // Vega - Eos Tower 44th Floor (221022000)
case 2040049: shop(npc); break; // Gumball Machine - Eos Tower 26th ~ 40th Floor (221021600)
case 2030009: shop(npc); break; // Glibber - Ice Valley II (211040200)
case 1012103: npc_1012103(npc); break;
case 1012104: npc_1012104(npc); break;
case 1052100: npc_1052100(npc); break;
case 1052101: npc_1052101(npc); break;
case 2041007: npc_2041007(npc); break;
case 2041009: npc_2041009(npc); break;
case 1012105: npc_1012105(npc); break;
//case 9201022: npc_9201022(npc); break;
case 1052004: npc_1052004(npc); break;
case 1052005: npc_1052005(npc); break;
case 2041013: npc_2041013(npc); break;
case 2041010: npc_2041010(npc); break;
//case 2040019: npc_2040019(npc); break;
case 2010002: npc_2010002(npc); break;
case 2012008: npc_2012008(npc); break;
case 2010001: npc_2010001(npc); break;
case 2012007: npc_2012007(npc); break;
case 9200000: npc_9200000(npc); break;

default: npc->end(); break;
}
}
private:
static void npc_2100(NPC* npc);
static void npc_2101(NPC* npc);
static void npc_2020005(NPC* npc);
static void npc_9101001(NPC* npc);
// Teleporters
static void npc_1002000(NPC* npc);
static void npc_1012000(NPC* npc);
static void npc_1022001(NPC* npc);
static void npc_1032000(NPC* npc);
static void npc_1052016(NPC* npc);
static void npc_1002004(NPC* npc);
static void npc_1032005(NPC* npc);
static void npc_1081001(NPC* npc);
static void npc_1002002(NPC* npc);
static void npc_9201056(NPC* npc);
static void npc_9000020(NPC* npc);
static void npc_2093004(NPC* npc);
static void npc_2060009(NPC* npc);
static void npc_9201057(NPC* npc);
static void npc_2012000(NPC* npc);
static void npc_2082000(NPC* npc);
static void npc_2040000(NPC* npc);
static void npc_1032007(NPC* npc);
static void npc_2090005(NPC* npc);
static void npc_22000(NPC* npc);
static void npc_2030000(NPC* npc);
static void npc_1012100(NPC* npc); //Athena Pierce
static void npc_1032001(NPC* npc); //Grendel the Really Old
static void npc_1022000(NPC* npc); //Dances with Balrog
static void npc_1052001(NPC* npc); //Dark Lord
static void npc_2020008(NPC* npc); //Tylus - 3rd Job Warrior
static void npc_2020010(NPC* npc); //Rene - 3rd Job Archer
static void npc_2020011(NPC* npc); //Arec - 3rd Job Thief
static void npc_2020009(NPC* npc); //Robeira - 3rd Job
static void npc_9100100(NPC* npc);
static void npc_9100101(NPC* npc);
static void npc_9100102(NPC* npc);
static void npc_9100103(NPC* npc);
static void npc_9100104(NPC* npc);
static void npc_9100106(NPC* npc);
static void npc_9100109(NPC* npc);
static void npc_1031000(NPC* npc);
static void npc_1031001(NPC* npc);
static void npc_1031100(NPC* npc);
static void npc_1011000(NPC* npc);
static void npc_1011001(NPC* npc);
static void npc_1011100(NPC* npc);
static void npc_1021000(NPC* npc);
static void npc_1021001(NPC* npc);
static void npc_1021100(NPC* npc);
static void npc_1051000(NPC* npc);
static void npc_1051001(NPC* npc);
static void npc_1051002(NPC* npc);
static void npc_11000(NPC* npc);
static void npc_11100(NPC* npc);
static void npc_21000(NPC* npc);
static void npc_1012103(NPC* npc);
static void npc_1012104(NPC* npc);
static void npc_1052100(NPC* npc);
static void npc_1052101(NPC* npc);
static void npc_2041007(NPC* npc);
static void npc_2041009(NPC* npc);
//static void npc_9201022(NPC* npc);
static void npc_1012105(NPC* npc);
static void npc_1052004(NPC* npc);
static void npc_1052005(NPC* npc);
static void npc_2041013(NPC* npc);
static void npc_2041010(NPC* npc);
//static void npc_2040019(NPC* npc);
static void npc_2010002(NPC* npc);
static void npc_2012008(NPC* npc);
static void npc_2010001(NPC* npc);
static void npc_2012007(NPC* npc);
static void shop(NPC* npc);
static void npc_9200000(NPC* npc);

};

#endif
 
Experienced Elementalist
Joined
Dec 7, 2006
Messages
294
Reaction score
0
Re: [Release] Star selling NPC

Code:
#ifndef NPCSSCRIPT_H
#define NPCSSCRIPT_H

class NPC;

int strval(char* buf);

class QuestsScripts {
public:
static void handle(int npcid, NPC* npc, bool start){
if(start){
switch(npcid){
case 2000: npc_2000s(npc); break;
default: npc->end(); break;
}
}
else{
switch(npcid){
case 2000: npc_2000e(npc); break;
default: npc->end(); break;
}
}
}
private:
static void npc_2000s(NPC* npc);
static void npc_2000e(NPC* npc);
};

class NPCsScripts {
public:
static void handle(int npcid, NPC* npc){
if(npc->isQuest()){
QuestsScripts::handle(npcid, npc, npc->isStart());
return;
}
switch(npcid){
case 2100: npc_2100(npc); break;
case 2101: npc_2101(npc); break;
case 2020005: npc_2020005(npc); break;
case 9101001: npc_9101001(npc); break;
case 9900000: npc_9900000(npc); break;
// Teleporters
case 1002000: npc_1002000(npc); break; // Phil - Lith Harbor (104000000)
case 1012000: npc_1012000(npc); break; // Regular Cab - Heneseys (100000000)
case 1022001: npc_1022001(npc); break; // Regular Cab - Perion (102000000)
case 1032000: npc_1032000(npc); break; // Regular Cab - Ellinia (101000000)
case 1052016: npc_1052016(npc); break; // Regular Cab - Kerning City (103000000)
case 1002004: npc_1002004(npc); break; // VIP Cab - Lith Harbor (104000000)
case 1032005: npc_1032005(npc); break; // VIP Cab - Ellinia (101000000)
case 1081001: npc_1081001(npc); break; // Pison - Florina Beach (110000000)
case 1002002: npc_1002002(npc); break; // Pason - Lith Harbor (104000000)
case 9201056: npc_9201056(npc); break; // NLC Taxi - New Leaf City (600000000) Phantom Forest (682000000)
case 9000020: npc_9000020(npc); break;
// Spinel - Amoria (680000000) Ellinia (101000000)
// Henesys (100000000) Kerning City (103000000)
// Leafre (240000000) Lith Harbor (104000000)
// Ludibrium (220000000) Mu Lung (250000000)
// Mushroom Shrine (800000000) Orbis (200000000)
// Perion (102000000)
case 2093004: npc_2093004(npc); break; // Dolphin - The Pier near Sea (251000100)
case 2060009: npc_2060009(npc); break; // Dolphin - Aquarium (230000000)
case 9201057: npc_9201057(npc); break; // Bell - Kerning City (103000000) New Leaf City (600000000)
case 2012000: npc_2012000(npc); break; // Agatha - Orbis Ticketing Booth (200000100)
case 2082000: npc_2082000(npc); break; // Mue - Leafre Ticketing Booth (240000100)
case 2040000: npc_2040000(npc); break; // Mel - Ludibrium Ticketing Place (220000100)
case 1032007: npc_1032007(npc); break; // Joel - Ellinia Station (101000300)
case 2090005: npc_2090005(npc); break; // Hak - Mu Lung (250000100) Herb Town (251000000)
case 22000: npc_22000(npc); break; // Shanks - Southperry (60000)
case 2030000: npc_2030000(npc); break; // Jeff - Ice Valley II (211040200)
case 1012100: npc_1012100(npc); break; //Athena Pierce
case 1032001: npc_1032001(npc); break; //Grendel the Really Old
case 1022000: npc_1022000(npc); break; //Dances with Balrog
case 1052001: npc_1052001(npc); break; //Dark Lord
case 2020008: npc_2020008(npc); break; //Tylus - 3rd Job Warrior
case 2020010: npc_2020010(npc); break; //Rene - 3rd Job Archer
case 2020011: npc_2020011(npc); break; //Arec - 3rd Job Thief
case 2020009: npc_2020009(npc); break; //Robeira - 3rd Job Wizard
case 9100100: npc_9100100(npc); break;
case 9100101: npc_9100101(npc); break;
case 9100102: npc_9100102(npc); break;
case 9100103: npc_9100103(npc); break;
case 9100104: npc_9100104(npc); break;
case 9100106: npc_9100106(npc); break;
case 9100109: npc_9100109(npc); break;
case 1021100: npc_1021100(npc); break;
case 1031000: npc_1031000(npc); break;
case 1031001: npc_1031001(npc); break;
case 1031100: npc_1031100(npc); break;
case 1011000: npc_1011000(npc); break;
case 1011001: npc_1011001(npc); break;
case 1011100: npc_1011100(npc); break;
case 1021000: npc_1021000(npc); break;
case 1021001: npc_1021001(npc); break;
case 1051000: npc_1051000(npc); break;
case 1051001: npc_1051001(npc); break;
case 1051002: npc_1051002(npc); break;
case 21000: npc_21000(npc); break;
case 11100: shop(npc); break; // Lucy - Amherst Department Store (1010003)
case 9201020: shop(npc); break; // Vivian Boutique - Amoria Wedding Shop (680000001)
case 2070003: shop(npc); break; // Dori - Korean Folk Town (222000000)
case 2070001: shop(npc); break; // Bung's Mama - Korean Folk Town (222000000)
case 2070002: shop(npc); break; // Moki - Korean Folk Town (222000000)
case 2041002: shop(npc); break; // Hid - Ludibrium Weapon Store (220000001)
case 2041003: shop(npc); break; // Miru - Ludibrium Weapon Store (220000001)
case 2041006: shop(npc); break; // Misky - Ludibrium Pharmacy (220000002)
case 2090002: shop(npc); break; // Bidiwon - Mu Lung (250000000)
case 2090001: shop(npc); break; // Gong Gong - Mu Lung (250000000)
case 2090003: shop(npc); break; // Dalsuk - Mu Lung Department Store (250000002)
case 9110003: shop(npc); break; // Janken - Mushroom Shrine (800000000)
case 9110004: shop(npc); break; // Taru - Mushroom Shrine (800000000)
case 9110005: shop(npc); break; // Bronze - Mushroom Shrine (800000000)
case 9110006: shop(npc); break; // Jin Jia - Mushroom Shrine (800000000)
case 9110007: shop(npc); break; // Robo - Mushroom Shrine (800000000)
case 9201058: shop(npc); break; // Delphi - New Leaf City - Town Center (600000000)
case 9201059: shop(npc); break; // Kyle - New Leaf City - Town Center (600000000)
case 9201060: shop(npc); break; // Miki - New Leaf City - Town Center (600000000)
case 1061001: shop(npc); break; // 24 Hr Mobile Store - Ant Tunnel Park (105070001)
case 1081000: shop(npc); break; // Valen - Florina Beach (110000000)
case 1001000: shop(npc); break; // Silver - Lith Harbor Weapon Shop (104000003)
case 1001001: shop(npc); break; // Natasha - Lith Harbor Armor Shop (104000001)
case 1001100: shop(npc); break; // Mina - Lith Harbor Department Store (104000002)
case 1061002: shop(npc); break; // Mr. Sweatbottom - Regular Sauna (105040401)
case 2022001: shop(npc); break; // Hana - El Nath Department Store (211000102)
case 2020001: shop(npc); break; // Scott - El Nath Weapon Store (211000101)
case 2022000: shop(npc); break; // Rumi - El Nath Weapon Store (211000101)
case 2060004: shop(npc); break; // Oannes - Department Store (230000002)
case 2060003: shop(npc); break; // Melias - Department Store (230000002)
case 2060007: shop(npc); break; // Calypso - Department Store (230000002)
case 2050000: shop(npc); break; // Dr. San - Silo (221000200)
case 2050003: shop(npc); break; // Spacen - Silo (221000200)
case 2051000: shop(npc); break; // Dr. Pepper - Silo (221000200)
case 2012003: shop(npc); break; // Neri the Fairy - Orbis Weapon Store (200000001)
case 2012004: shop(npc); break; // Nuri the Fairy - Orbis Weapon Store (200000001)
case 2012005: shop(npc); break; // Edel the Fairy - Orbis Department Store (200000002)
case 2093000: shop(npc); break; // Mu Tan - Herb Town (251000000)
case 2093002: shop(npc); break; // Lan Ming - Herb Town (251000000)
case 2093001: shop(npc); break; // So Won - Herb Town (251000000)
case 2080002: shop(npc); break; // Max - Leafre (240000000)
case 2080001: shop(npc); break; // Sly - Department Store (240000002)
case 1052104: shop(npc); break; // Tulcus - The Swamp of Despair II (107000100)
case 1032103: shop(npc); break; // El Moth - The Tree That Grew III (101010102)
case 2022002: shop(npc); break; // Barun - Orbis Tower <14th Floor> (200080800)
case 2041016: shop(npc); break; // Vega - Eos Tower 44th Floor (221022000)
case 2040049: shop(npc); break; // Gumball Machine - Eos Tower 26th ~ 40th Floor (221021600)
case 2030009: shop(npc); break; // Glibber - Ice Valley II (211040200)
case 1012103: npc_1012103(npc); break;
case 1012104: npc_1012104(npc); break;
case 1052100: npc_1052100(npc); break;
case 1052101: npc_1052101(npc); break;
case 2041007: npc_2041007(npc); break;
case 2041009: npc_2041009(npc); break;
case 1012105: npc_1012105(npc); break;
//case 9201022: npc_9201022(npc); break;
case 1052004: npc_1052004(npc); break;
case 1052005: npc_1052005(npc); break;
case 2041013: npc_2041013(npc); break;
case 2041010: npc_2041010(npc); break;
//case 2040019: npc_2040019(npc); break;
case 2010002: npc_2010002(npc); break;
case 2012008: npc_2012008(npc); break;
case 2010001: npc_2010001(npc); break;
case 2012007: npc_2012007(npc); break;
case 9200000: npc_9200000(npc); break;

default: npc->end(); break;
}
}
private:
static void npc_2100(NPC* npc);
static void npc_2101(NPC* npc);
static void npc_2020005(NPC* npc);
static void npc_9101001(NPC* npc);
[B]static void npc_9900000(NPC* npc); // You deleted this line by mistake ;)[/B]
// Teleporters
static void npc_1002000(NPC* npc);
static void npc_1012000(NPC* npc);
static void npc_1022001(NPC* npc);
static void npc_1032000(NPC* npc);
static void npc_1052016(NPC* npc);
static void npc_1002004(NPC* npc);
static void npc_1032005(NPC* npc);
static void npc_1081001(NPC* npc);
static void npc_1002002(NPC* npc);
static void npc_9201056(NPC* npc);
static void npc_9000020(NPC* npc);
static void npc_2093004(NPC* npc);
static void npc_2060009(NPC* npc);
static void npc_9201057(NPC* npc);
static void npc_2012000(NPC* npc);
static void npc_2082000(NPC* npc);
static void npc_2040000(NPC* npc);
static void npc_1032007(NPC* npc);
static void npc_2090005(NPC* npc);
static void npc_22000(NPC* npc);
static void npc_2030000(NPC* npc);
static void npc_1012100(NPC* npc); //Athena Pierce
static void npc_1032001(NPC* npc); //Grendel the Really Old
static void npc_1022000(NPC* npc); //Dances with Balrog
static void npc_1052001(NPC* npc); //Dark Lord
static void npc_2020008(NPC* npc); //Tylus - 3rd Job Warrior
static void npc_2020010(NPC* npc); //Rene - 3rd Job Archer
static void npc_2020011(NPC* npc); //Arec - 3rd Job Thief
static void npc_2020009(NPC* npc); //Robeira - 3rd Job
static void npc_9100100(NPC* npc);
static void npc_9100101(NPC* npc);
static void npc_9100102(NPC* npc);
static void npc_9100103(NPC* npc);
static void npc_9100104(NPC* npc);
static void npc_9100106(NPC* npc);
static void npc_9100109(NPC* npc);
static void npc_1031000(NPC* npc);
static void npc_1031001(NPC* npc);
static void npc_1031100(NPC* npc);
static void npc_1011000(NPC* npc);
static void npc_1011001(NPC* npc);
static void npc_1011100(NPC* npc);
static void npc_1021000(NPC* npc);
static void npc_1021001(NPC* npc);
static void npc_1021100(NPC* npc);
static void npc_1051000(NPC* npc);
static void npc_1051001(NPC* npc);
static void npc_1051002(NPC* npc);
static void npc_11000(NPC* npc);
static void npc_11100(NPC* npc);
static void npc_21000(NPC* npc);
static void npc_1012103(NPC* npc);
static void npc_1012104(NPC* npc);
static void npc_1052100(NPC* npc);
static void npc_1052101(NPC* npc);
static void npc_2041007(NPC* npc);
static void npc_2041009(NPC* npc);
//static void npc_9201022(NPC* npc);
static void npc_1012105(NPC* npc);
static void npc_1052004(NPC* npc);
static void npc_1052005(NPC* npc);
static void npc_2041013(NPC* npc);
static void npc_2041010(NPC* npc);
//static void npc_2040019(NPC* npc);
static void npc_2010002(NPC* npc);
static void npc_2012008(NPC* npc);
static void npc_2010001(NPC* npc);
static void npc_2012007(NPC* npc);
static void shop(NPC* npc);
static void npc_9200000(NPC* npc);

};

#endif

There you go, all you ahve to do is find the bolded line ;)
 
Junior Spellweaver
Joined
Feb 24, 2008
Messages
175
Reaction score
3
Re: [Release] Star selling NPC

anyway to add a check?

c:\documents and settings\devin\desktop\ciderms\maplestoryserver\cody.cpp(2) : error C2653: 'NPCsScripts' : is not a class or namespace name
c:\documents and settings\devin\desktop\ciderms\maplestoryserver\cody.cpp(2) : error C2065: 'NPC' : undeclared identifier
c:\documents and settings\devin\desktop\ciderms\maplestoryserver\cody.cpp(2) : error C2065: 'npc' : undeclared identifier
c:\documents and settings\devin\desktop\ciderms\maplestoryserver\cody.cpp(2) : error C2448: 'npc_9200000' : function-style initializer appears to be a function definition
 
Junior Spellweaver
Joined
Feb 24, 2008
Messages
175
Reaction score
3
Re: [Release] Star selling NPC

forgot to add

#include "NPCs.h"
#include "NPCsScripts.h"


Im checking if I fixed the meso check atm
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
10
Reaction score
0
Re: [Release] Star selling NPC

anyway to add a check?


Here, i editted his script.
Code:
int Star;
void NPCsScripts::npc_9200000(NPC* npc){
    int state = npc->getState();
    int map = npc->getPlayerMap();
    if(npc->getPlayerMap() == 100000000){
        if(state == 0){
      
             npc->addText("Hey, I sell all types of stars!");//Send Text For Cody To Output
             npc->sendNext();//Just think of this to enable you to Click "next" button for continuing....
        }
    else if(state == 1){     
             npc->addText("Which star would you like??\r\n#L0#Tobi - 50k#l\r\n#L1#Steely - 100k#l\r\n#L2#Ilbi -150k#l\r\n#L3#Hwabi -200k#l");
             npc->sendSimple();
                     } 
        }
    if(state == 2){
        Star = npc->getSelected();
        npc->setVariable("Star", Star);
        if(Star == 0){ // Tobi
            npc->addText("Are you sure you want to buy #bTobis#k?");
            npc->sendYesNo();
        }
        else if(Star == 1){ // Steely
            npc->addText("Are you sure you want to buy #bSteelys#k?");
            npc->sendYesNo();            
        }
        else if(Star == 2){ // Ilbi
            npc->addText("Are you sure you want to buy #bIlbis#k?");
            npc->sendYesNo();
        }
        else if(Star == 3){ // Hwabi
            npc->addText("Are you sure you want to buy #bHwabis#k?");
            npc->sendYesNo();
        }
    }
    if(state == 3 && Star == 0){
            if(npc->getMesos() > 50000)  //
        if(npc->getSelected() == YES){
            npc->end();
            npc->giveItem(2070004, 1);
            npc->giveMesos(-50000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        else {
                npc->addText("You do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
    if(state == 3 && Star == 1){
            if(npc->getMesos() > 100000) 
        if(npc->getSelected() == YES){
            npc->giveItem(2070005, 1);
            npc->giveMesos(-100000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        else {
                npc->addText("You do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
    if(state == 3 && Star == 2){
            if(npc->getMesos() > 150000) 
        if(npc->getSelected() == YES){
            npc->giveItem(2070006, 1);
            npc->giveMesos(-150000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        else {
                npc->addText("You do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
    if(state == 3 && Star == 3){
            if(npc->getMesos() > 200000) 
        if(npc->getSelected() == YES){
            npc->giveItem(2070007, 1);
            npc->giveMesos(-200000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
            else {
                npc->addText("Sorry, but you do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
}
To change the minimun amount needed, edit the bolded numbers
Code:
 if(npc->getMesos() > [B]50000[/B])


Edit: Tested and works.
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
38
Reaction score
1
Re: [Release] Star selling NPC

aiites'; i followed cTz words ; added the bold part & the external error is gone;
Here comes another error ;O;

1>------ Build started: Project: MapleStoryServer, Configuration: Release Win32 ------
1>Compiling...
1>Cody.cpp
1>.\NPCs\Cody.cpp(4) : error C2039: 'npc_9200000' : is not a member of 'NPCsScripts'
1> d:\forsakenms\maplestoryserver\npcs\NPCsScripts.h(29) : see declaration of 'NPCsScripts'
1>Build log was saved at "file://d:\forsakenMS\MapleStoryServer\Release\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

My 'NPC script;
Code:
#ifndef NPCSSCRIPT_H
#define NPCSSCRIPT_H

class NPC;

int strval(char* buf);

class QuestsScripts {
public:
	static void handle(int npcid, NPC* npc, bool start){
		if(start){
			switch(npcid){
				case 2000: npc_2000s(npc); break;
				default: npc->end(); break;
			}
		}
		else{
			switch(npcid){
				case 2000: npc_2000e(npc); break;
				default: npc->end(); break;
			}
		}
	}
private:
	static void npc_2000s(NPC* npc);
	static void npc_2000e(NPC* npc);
};

class NPCsScripts {
public:
	static void handle(int npcid, NPC* npc){
		if(npc->isQuest()){
			QuestsScripts::handle(npcid, npc, npc->isStart());
			return;
		}
		switch(npcid){
			case 2100: npc_2100(npc); break;
			case 2101: npc_2101(npc); break;
			case 2020005: npc_2020005(npc); break;
			case 9101001: npc_9101001(npc); break;
			case 9900000: npc_9900000(npc); break;
					// Teleporters
            case 1002000: npc_1002000(npc); break; // Phil - Lith Harbor (104000000)
            case 1012000: npc_1012000(npc); break; // Regular Cab - Heneseys (100000000)
            case 1022001: npc_1022001(npc); break; // Regular Cab - Perion (102000000) 
            case 1032000: npc_1032000(npc); break; // Regular Cab - Ellinia (101000000)
            case 1052016: npc_1052016(npc); break; // Regular Cab - Kerning City (103000000)
            case 1002004: npc_1002004(npc); break; // VIP Cab - Lith Harbor (104000000)
            case 1032005: npc_1032005(npc); break; // VIP Cab - Ellinia (101000000)
            case 1081001: npc_1081001(npc); break; // Pison - Florina Beach (110000000)
            case 1002002: npc_1002002(npc); break; // Pason - Lith Harbor (104000000)
            case 9201056: npc_9201056(npc); break; // NLC Taxi - New Leaf City (600000000) Phantom Forest (682000000)
            case 9000020: npc_9000020(npc); break; 
            // Spinel - Amoria (680000000) Ellinia (101000000) 
            // Henesys (100000000) Kerning City (103000000) 
            // Leafre (240000000) Lith Harbor (104000000) 
            // Ludibrium (220000000) Mu Lung (250000000) 
            // Mushroom Shrine (800000000) Orbis (200000000) 
            // Perion (102000000)
            case 2093004: npc_2093004(npc); break; // Dolphin - The Pier near Sea (251000100)
            case 2060009: npc_2060009(npc); break; // Dolphin - Aquarium (230000000)
            case 9201057: npc_9201057(npc); break; // Bell - Kerning City (103000000) New Leaf City (600000000)
            case 2012000: npc_2012000(npc); break; // Agatha - Orbis Ticketing Booth (200000100)
            case 2082000: npc_2082000(npc); break; // Mue - Leafre Ticketing Booth (240000100)
            case 2040000: npc_2040000(npc); break; // Mel - Ludibrium Ticketing Place (220000100)
            case 1032007: npc_1032007(npc); break; // Joel - Ellinia Station (101000300)
            case 2090005: npc_2090005(npc); break; // Hak - Mu Lung (250000100) Herb Town (251000000)
            case 22000: npc_22000(npc); break; // Shanks - Southperry (60000)
            case 2030000: npc_2030000(npc); break; // Jeff - Ice Valley II (211040200)
		    case 1012100: npc_1012100(npc); break; //Athena Pierce
			case 1032001: npc_1032001(npc); break; //Grendel the Really Old
			case 1022000: npc_1022000(npc); break; //Dances with Balrog
			case 1052001: npc_1052001(npc); break; //Dark Lord
			case 2020008: npc_2020008(npc); break; //Tylus - 3rd Job Warrior
			case 2020010: npc_2020010(npc); break; //Rene - 3rd Job Archer
			case 2020011: npc_2020011(npc); break; //Arec - 3rd Job Thief
			case 2020009: npc_2020009(npc); break; //Robeira - 3rd Job Wizard
			case 9100100: npc_9100100(npc); break;  
case 9100101: npc_9100101(npc); break; 
case 9100102: npc_9100102(npc); break;  
case 9100103: npc_9100103(npc); break;  
case 9100104: npc_9100104(npc); break; 
case 9100106: npc_9100106(npc); break;  
case 9100109: npc_9100109(npc); break;
	case 1021100: npc_1021100(npc); break;
		case 1031000: npc_1031000(npc); break;
			case 1031001: npc_1031001(npc); break;
				case 1031100: npc_1031100(npc); break;
					case 1011000: npc_1011000(npc); break;
						case 1011001: npc_1011001(npc); break;
							case 1011100: npc_1011100(npc); break;
								case 1021000: npc_1021000(npc); break;
									case 1021001: npc_1021001(npc); break;
					case 1051000: npc_1051000(npc); break;
						case 1051001: npc_1051001(npc); break;
						case 1051002: npc_1051002(npc); break;
            case 21000: npc_21000(npc); break;
			case 11100: shop(npc); break; // Lucy - Amherst Department Store (1010003)
			case 9201020: shop(npc); break; // Vivian Boutique - Amoria Wedding Shop (680000001)
			case 2070003: shop(npc); break; // Dori - Korean Folk Town (222000000)
			case 2070001: shop(npc); break; // Bung's Mama - Korean Folk Town (222000000)
			case 2070002: shop(npc); break; // Moki - Korean Folk Town (222000000)
			case 2041002: shop(npc); break; // Hid - Ludibrium Weapon Store (220000001)
			case 2041003: shop(npc); break; // Miru - Ludibrium Weapon Store (220000001)
			case 2041006: shop(npc); break; // Misky - Ludibrium Pharmacy (220000002)
			case 2090002: shop(npc); break; // Bidiwon - Mu Lung (250000000)
			case 2090001: shop(npc); break; // Gong Gong - Mu Lung (250000000)
			case 2090003: shop(npc); break; // Dalsuk - Mu Lung Department Store (250000002)
			case 9110003: shop(npc); break; // Janken - Mushroom Shrine (800000000)
			case 9110004: shop(npc); break; // Taru - Mushroom Shrine (800000000)
			case 9110005: shop(npc); break; // Bronze - Mushroom Shrine (800000000)
			case 9110006: shop(npc); break; // Jin Jia - Mushroom Shrine (800000000)
			case 9110007: shop(npc); break; // Robo - Mushroom Shrine (800000000)
			case 9201058: shop(npc); break; // Delphi - New Leaf City - Town Center (600000000)
			case 9201059: shop(npc); break; // Kyle - New Leaf City - Town Center (600000000)
			case 9201060: shop(npc); break; // Miki - New Leaf City - Town Center (600000000)
			case 1061001: shop(npc); break; // 24 Hr Mobile Store - Ant Tunnel Park (105070001)
			case 1081000: shop(npc); break; // Valen - Florina Beach (110000000)
			case 1001000: shop(npc); break; // Silver - Lith Harbor Weapon Shop (104000003)
			case 1001001: shop(npc); break; // Natasha - Lith Harbor Armor Shop (104000001)
			case 1001100: shop(npc); break; // Mina - Lith Harbor Department Store (104000002)
			case 1061002: shop(npc); break; // Mr. Sweatbottom - Regular Sauna (105040401)
			case 2022001: shop(npc); break; // Hana - El Nath Department Store (211000102)
			case 2020001: shop(npc); break; // Scott - El Nath Weapon Store (211000101)
			case 2022000: shop(npc); break; // Rumi - El Nath Weapon Store (211000101)
			case 2060004: shop(npc); break; // Oannes - Department Store (230000002)
			case 2060003: shop(npc); break; // Melias - Department Store (230000002)
			case 2060007: shop(npc); break; // Calypso - Department Store (230000002)
			case 2050000: shop(npc); break; // Dr. San - Silo (221000200)
			case 2050003: shop(npc); break; // Spacen - Silo (221000200)
			case 2051000: shop(npc); break; // Dr. Pepper - Silo (221000200)
			case 2012003: shop(npc); break; // Neri the Fairy - Orbis Weapon Store (200000001)
			case 2012004: shop(npc); break; // Nuri the Fairy - Orbis Weapon Store (200000001)
			case 2012005: shop(npc); break; // Edel the Fairy - Orbis Department Store (200000002)
			case 2093000: shop(npc); break; // Mu Tan - Herb Town (251000000)
			case 2093002: shop(npc); break; // Lan Ming - Herb Town (251000000)
			case 2093001: shop(npc); break; // So Won - Herb Town (251000000)
			case 2080002: shop(npc); break; // Max - Leafre (240000000)
			case 2080001: shop(npc); break; // Sly - Department Store (240000002)
			case 1052104: shop(npc); break; // Tulcus - The Swamp of Despair II (107000100)
			case 1032103: shop(npc); break; // El Moth - The Tree That Grew III (101010102)
			case 2022002: shop(npc); break; // Barun - Orbis Tower <14th Floor> (200080800)
			case 2041016: shop(npc); break; // Vega - Eos Tower 44th Floor (221022000)
			case 2040049: shop(npc); break; // Gumball Machine - Eos Tower 26th ~ 40th Floor (221021600)
			case 2030009: shop(npc); break; // Glibber - Ice Valley II (211040200)
							case 1012103: npc_1012103(npc); break;
			case 1012104: npc_1012104(npc); break;
			case 1052100: npc_1052100(npc); break;
			case 1052101: npc_1052101(npc); break;
			case 2041007: npc_2041007(npc); break;
			case 2041009: npc_2041009(npc); break;
			case 1012105: npc_1012105(npc); break;
			//case 9201022: npc_9201022(npc); break;
			case 1052004: npc_1052004(npc); break;
			case 1052005: npc_1052005(npc); break;
			case 2041013: npc_2041013(npc); break;
			case 2041010: npc_2041010(npc); break;
			//case 2040019: npc_2040019(npc); break;
			case 2010002: npc_2010002(npc); break;
			case 2012008: npc_2012008(npc); break;
			case 2010001: npc_2010001(npc); break;
			case 2012007: npc_2012007(npc); break;
			case 9200000: npc_9200000(npc); break;

			default: npc->end(); break;
		}
	}
private:
	static void npc_2100(NPC* npc);
	static void npc_2101(NPC* npc);
	static void npc_2020005(NPC* npc);
	static void npc_9101001(NPC* npc);
	static void npc_9900000(NPC* npc);
	static void npc_9200000(NPC* npc);
	     // Teleporters
    static void npc_1002000(NPC* npc);
    static void npc_1012000(NPC* npc);
    static void npc_1022001(NPC* npc);
    static void npc_1032000(NPC* npc);
    static void npc_1052016(NPC* npc);
    static void npc_1002004(NPC* npc);
    static void npc_1032005(NPC* npc);
    static void npc_1081001(NPC* npc);
    static void npc_1002002(NPC* npc);
    static void npc_9201056(NPC* npc);
    static void npc_9000020(NPC* npc);
    static void npc_2093004(NPC* npc);
    static void npc_2060009(NPC* npc);
    static void npc_9201057(NPC* npc);
    static void npc_2012000(NPC* npc);
    static void npc_2082000(NPC* npc);
    static void npc_2040000(NPC* npc);
    static void npc_1032007(NPC* npc);
    static void npc_2090005(NPC* npc);
    static void npc_22000(NPC* npc);
    static void npc_2030000(NPC* npc);
    static void npc_1012100(NPC* npc); //Athena Pierce
	static void npc_1032001(NPC* npc); //Grendel the Really Old
	static void npc_1022000(NPC* npc); //Dances with Balrog
	static void npc_1052001(NPC* npc); //Dark Lord
	static void npc_2020008(NPC* npc); //Tylus - 3rd Job Warrior
	static void npc_2020010(NPC* npc); //Rene - 3rd Job Archer
	static void npc_2020011(NPC* npc); //Arec - 3rd Job Thief
	static void npc_2020009(NPC* npc); //Robeira - 3rd Job
	static void npc_9100100(NPC* npc);  
static void npc_9100101(NPC* npc);  
static void npc_9100102(NPC* npc);  
static void npc_9100103(NPC* npc);  
static void npc_9100104(NPC* npc);  
static void npc_9100106(NPC* npc);  
static void npc_9100109(NPC* npc);
static void npc_1031000(NPC* npc);
static void npc_1031001(NPC* npc);
static void npc_1031100(NPC* npc);
static void npc_1011000(NPC* npc);
static void npc_1011001(NPC* npc);
static void npc_1011100(NPC* npc);
static void npc_1021000(NPC* npc);
static void npc_1021001(NPC* npc);
static void npc_1021100(NPC* npc);
static void npc_1051000(NPC* npc);
static void npc_1051001(NPC* npc);
static void npc_1051002(NPC* npc);
    static void npc_11000(NPC* npc);
    static void npc_11100(NPC* npc);
    static void npc_21000(NPC* npc);
		static void npc_1012103(NPC* npc);
	static void npc_1012104(NPC* npc);
	static void npc_1052100(NPC* npc);
	static void npc_1052101(NPC* npc);
	static void npc_2041007(NPC* npc);
	static void npc_2041009(NPC* npc);
	//static void npc_9201022(NPC* npc);
	static void npc_1012105(NPC* npc);
	static void npc_1052004(NPC* npc);
	static void npc_1052005(NPC* npc);
	static void npc_2041013(NPC* npc);
	static void npc_2041010(NPC* npc);
	//static void npc_2040019(NPC* npc);
	static void npc_2010002(NPC* npc);
	static void npc_2012008(NPC* npc);
	static void npc_2010001(NPC* npc);
	static void npc_2012007(NPC* npc);
	static void shop(NPC* npc);

};

#endif
 
Newbie Spellweaver
Joined
Feb 24, 2008
Messages
19
Reaction score
0
Re: [Release] Star selling NPC

Here, i editted his script.
Code:
int Star;
void NPCsScripts::npc_9200000(NPC* npc){
    int state = npc->getState();
    int map = npc->getPlayerMap();
    if(npc->getPlayerMap() == 100000000){
        if(state == 0){
      
             npc->addText("Hey, I sell all types of stars!");//Send Text For Cody To Output
             npc->sendNext();//Just think of this to enable you to Click "next" button for continuing....
        }
    else if(state == 1){     
             npc->addText("Which star would you like??\r\n#L0#Tobi - 50k#l\r\n#L1#Steely - 100k#l\r\n#L2#Ilbi -150k#l\r\n#L3#Hwabi -200k#l");
             npc->sendSimple();
                     } 
        }
    if(state == 2){
        Star = npc->getSelected();
        npc->setVariable("Star", Star);
        if(Star == 0){ // Tobi
            npc->addText("Are you sure you want to buy #bTobis#k?");
            npc->sendYesNo();
        }
        else if(Star == 1){ // Steely
            npc->addText("Are you sure you want to buy #bSteelys#k?");
            npc->sendYesNo();            
        }
        else if(Star == 2){ // Ilbi
            npc->addText("Are you sure you want to buy #bIlbis#k?");
            npc->sendYesNo();
        }
        else if(Star == 3){ // Hwabi
            npc->addText("Are you sure you want to buy #bHwabis#k?");
            npc->sendYesNo();
        }
    }
    if(state == 3 && Star == 0){
            if(npc->getMesos() > 50000)  //
        if(npc->getSelected() == YES){
            npc->end();
            npc->giveItem(2070004, 1);
            npc->giveMesos(-50000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        else {
                npc->addText("You do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
    if(state == 3 && Star == 1){
            if(npc->getMesos() > 100000) 
        if(npc->getSelected() == YES){
            npc->giveItem(2070005, 1);
            npc->giveMesos(-100000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        else {
                npc->addText("You do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
    if(state == 3 && Star == 2){
            if(npc->getMesos() > 150000) 
        if(npc->getSelected() == YES){
            npc->giveItem(2070006, 1);
            npc->giveMesos(-150000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
        else {
                npc->addText("You do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
    if(state == 3 && Star == 3){
            if(npc->getMesos() > 200000) 
        if(npc->getSelected() == YES){
            npc->giveItem(2070007, 1);
            npc->giveMesos(-200000);
        }
        else{
            npc->addText("Fine don't buy, see if I care!");
            npc->sendOK();
        }
            else {
                npc->addText("Sorry, but you do not have enough mesos.");
                npc->sendOK();
                npc->end();
            }
        npc->end();
    }
}
To change the minimun amount needed, edit the bolded numbers
Code:
 if(npc->getMesos() > [B]50000[/B])
Edit: Tested and works.

Nice, haven't had time to do it, so thanks ;)
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
6
Reaction score
0
Re: [Release] Star selling NPC

I am not good English language .so this composition is link tutorial but i not translation tutorial so I want no where this code add [Ex) add this code in npcs.cpp under the this line,] ...

I want in detail !!!!!!! please ~


Thanks .
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
6
Reaction score
0
Re: [Release] Star selling NPC

who is npc9200000 in the maplestory.. ????????????????????????
 
Status
Not open for further replies.
Back
Top