lol ur trying shorten my codes? aha
Printable View
lol ur trying shorten my codes? aha
@rampage this is my code wats wrong why im not getting the msgbox?
Quote:
#include "NPCs.h"
#include "NPCsScripts.h"
#include "Player.h"
#include "Levels.h"
void NPCsScripts::npc_1012100(NPC *npc) //job
{
Player *player= npc->getPlayer();
int state = npc->getState();
if(state ==0)
{
if(player->getJob() == 000)
{
if(player->getLevel() >= 10)
{
npc->addText("Hey You wanna be a 1st Job bowman?");
state = 1;
npc->sendYesNo();
}
else
{
npc->addText("Sorry You Need To Be Level 10 & Above");
npc->end();
}
}
}
else if(state == 1)
{
if(npc->getSelected() == YES)
{
player->setJob(300);
npc->addText("Congrats, you have becomed an archer the first step to the greatest of all bowman!\n");
npc->addText("May The Bless'ing Of Henesys be with you...");
npc->end();
}
else
{
npc->addText("I See..If You Changed your mind please come back here");
npc->end();
}
}
}
@metroix: Don't include
#include "Player.h"
#include "Levels.h"
In the NPC units.
if i remove them i got this
Quote:
1>------ Build started: Project: MapleStoryServer, Configuration: Debug Win32 ------
1>Compiling...
1>henesys.cpp
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(10) : error C2027: use of undefined type 'Player'
1> c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\npcs.h(15) : see declaration of 'Player'
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(10) : error C2227: left of '->getJob' must point to class/struct/union/generic type
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(12) : error C2027: use of undefined type 'Player'
1> c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\npcs.h(15) : see declaration of 'Player'
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(12) : error C2227: left of '->getLevel' must point to class/struct/union/generic type
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(29) : error C2027: use of undefined type 'Player'
1> c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\npcs.h(15) : see declaration of 'Player'
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(29) : error C2227: left of '->setJob' must point to class/struct/union/generic type
1>Build log was saved at "file://c:\Documents and Settings\Alejandro sanchez\Escritorio\TitanMSSource\MapleStoryServer\MapleStoryServer\Debug\BuildLog.htm"
1>MapleStoryServer - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
@metroix, u put an extra brackets, anyway replace the code with this,
Code:#include "NPCs.h"
#include "NPCsScripts.h"
#include "Player.h"
#include "Levels.h"
void NPCsScripts::npc_1012100(NPC *npc) //job
{
Player *player= npc->getPlayer();
int state = npc->getState();
if(state ==0)
{
if(player->getJob() == 000)
{
if(player->getLevel() >= 10)
{
npc->addText("Hey You wanna be a 1st Job bowman?");
state = 1;
npc->sendYesNo();
}
else
{
npc->addText("Sorry You Need To Be Level 10 & Above");
npc->end();
}
}
else if(state == 1)
{
if(npc->getSelected() == YES)
{
player->setJob(300);
npc->addText("Congrats, you have becomed an archer the first step to the greatest of all bowman!\n");
npc->addText("May The Bless'ing Of Henesys be with you...");
npc->end();
}
else
{
npc->addText("I See..If You Changed your mind please come back here");
npc->end();
}
}
}
never mind...
?_?
lol compile error
Quote:
1>------ Build started: Project: MapleStoryServer, Configuration: Debug Win32 ------
1>Compiling...
1>henesys.cpp
1>c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(42) : fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\alejandro sanchez\escritorio\titanmssource\maplestoryserver\maplestoryserver\henesys.cpp(7)' was matched
1>Build log was saved at "file://c:\Documents and Settings\Alejandro sanchez\Escritorio\TitanMSSource\MapleStoryServer\MapleStoryServer\Debug\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
my code
Quote:
#include "NPCs.h"
#include "NPCsScripts.h"
#include "Player.h"
#include "Levels.h"
void NPCsScripts::npc_1012100(NPC *npc) //job
{
Player *player= npc->getPlayer();
int state = npc->getState();
if(state ==0)
{
if(player->getJob() == 000)
{
if(player->getLevel() >= 10)
{
npc->addText("Hey You wanna be a 1st Job bowman?");
state = 1;
npc->sendYesNo();
}
else
{
npc->addText("Sorry You Need To Be Level 10 & Above");
npc->end();
}
}
else if(state == 1)
{
if(npc->getSelected() == YES)
{
player->setJob(300);
npc->addText("Congrats, you have becomed an archer the first step to the greatest of all bowman!\n");
npc->addText("May The Bless'ing Of Henesys be with you...");
npc->end();
}
else
{
npc->addText("I See..If You Changed your mind please come back here");
npc->end();
}
}
}
Quote:
IM COPING AND PASTING FROM U SO THAT UR SAME SCRIPT
omg lol missing brackets?
Code:#include "NPCs.h"
#include "NPCsScripts.h"
#include "Player.h"
#include "Levels.h"
void NPCsScripts::npc_1012100(NPC *npc) //job
{
Player *player= npc->getPlayer();
int state = npc->getState();
if(state ==0)
{
if(player->getJob() == 000)
{
if(player->getLevel() >= 10)
{
npc->addText("Hey You wanna be a 1st Job bowman?");
state = 1;
npc->sendYesNo();
}
else
{
npc->addText("Sorry You Need To Be Level 10 & Above");
npc->end();
}
}
else if(state == 1)
{
if(npc->getSelected() == YES)
{
player->setJob(300);
npc->addText("Congrats, you have becomed an archer the first step to the greatest of all bowman!\n");
npc->addText("May The Bless'ing Of Henesys be with you...");
npc->end();
}
else
{
npc->addText("I See..If You Changed your mind please come back here");
npc->end();
}
}
}
}
can some1 give me link to download cpp?
What is the name for thief job file?
KerningCity or
Kerning City
Tranks alot
any name u like.
is not working if u say yes she dosent make u bowman and if u say yes or no u cant talk again to her =/
Compiled 100% without errors, i double click on Athena Pierce and nothing appear....
By the looks of the npc->getPlayer(), it can only return 1 player at a time? What if multiple people are talking to the same NPC?
Seems like a pretty big oversight to me!
no errors but when i click the npc no pop up massage
guys any idea how to fix 2nd job.. i tried fixing it.. but kinda buggy
@kikiness,
each time a person click it will get that individual user, example,
you clicked, it will return your player,
ur friend clicked it will return his player,
well, if both click @ the same time, i havent tried it out yet, why don u try?
@driocut, try relogging in and make sure u don talk to any npc except for job npc, probaly the other npc you talked to doesn't have npc->close();
@akakori,
well it's simple use the sample above just edit abit.
i cant.. try this..
Quote:
void NPCsScripts::npc_1072005(NPC* npc){ //2nd job
Player *player= npc->getPlayer();
short cSP = player->getSp();
int state = npc->getState();
if(state == 0)
{
if(player->getLevel() >= 30)
{
if(player->getJob() == 200)
{
npc->addText("I see you have become more versed in magic..");
npc->addText("What do you want to advance into?\r\n\r\n#L0#Fire/Poison Mage#l\r\n#L1#Ice/Lightning Mage#l\r\n#L2#Cleric#l");
npc->sendSimple();
}
else
{
npc->addText("You seem to be lost.");
npc->end();
}
}
else
{
npc->addText("You have not met the required level");
npc->end();
}
}
if(state == 1)
{
int type = npc->getSelected();
npc->end();
npc->setVariable("type", type);
if(type == 0){ // Fire/Poison Mage
player->setJob(210);
player->setAp(cSP+1);
npc->addText("You have become closer with the nature...");
npc->addText("..May Mother Nature be with you.");
npc->end();
}
else if(type == 1){ //Ice/Lightning Mage
player->setJob(220);
player->setAp(cSP+1);
npc->addText("You have become closer with the nature...");
npc->addText("..May Mother Nature be with you.");
npc->end();
}
else if(type == 2){ // Cleric
player->setJob(230);
player->setAp(cSP+1);
npc->addText("You have become closer to the great power that created us...");
npc->addText("..Now go forth my child.");
npc->end();
}
}
}
y do u endnpc(); so quickly in state 1?
Code:if(state == 1)
{
int type = npc->getSelected();
npc->end();
npc->setVariable("type", type);
if(type == 0){ // Fire/Poison Mage
player->setJob(210);
player->setAp(cSP+1);
npc->addText("You have become closer with the nature...");
npc->addText("..May Mother Nature be with you.");
npc->end();
}
er typo.. lol.. but just remove that line.. anyway it doesnt work
revive nao!
not bad, not bad...
i will testing it
i hope it works... xD