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/
Credits:
cPlusPlus - looked at his tutorial
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