-
[Release] PQ with a 'party'
Wtf, party's aren't out yet, so why a partyquest?
Indeed, it's not a real party.
You can see it as a team, only 4 people can enter at the same time.
Does it work?
Normally it works fine. The only 'bug' I know is:
- When somebody goes offline and doesn't return, the script will see there's a person inside,
but actually he/she is just offline... (Everybody has to leave the exit map before other people can enter)
Reply in this topic when you found a bug and I'll try to fix it.
Is there a timer?
Nope.. I have no clue how to add it.. o.O
Which MySQL code do I have to execute in my database?
This should work, here you go:
Code:
CREATE TABLE `pqkerning` (
`id` int(1) NOT NULL,
`aplayers` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `pqkerning` VALUES ('0', '0');
INSERT INTO `pqkerning` VALUES ('1', '0');
Script pl0x
You may make a new .cpp file in VC++2008 in the 'map' 'NPCs'.
The name doesn't matter, I called it 'PqKerning'.
Code:
// KERNING CITY PQ, WITH PLAYER AMOUNT CHECK INSTEAD OF A PARTY
// VERSION 1 Made by Vawk/DragonEyes
// http://yeti.animesafari.net
#include "NPCs.h"
#include "NPCsScripts.h"
#include "Levels.h"
#include "Player.h"
#include "MySQLM.h"
void NPCsScripts::npc_9020000(NPC* npc){
Player* player = npc->getPlayer();
int state = npc->getState();
int playerspq = MySQL::getInt("pqkerning",1,"aplayers");
int playersexit = MySQL::getInt("pqkerning",1,"aplayers");
if(player->getLevel() >= 21 && player->getLevel() <= 30){
if(state == 0){
if(playerspq == 0){
npc->addText("There are currently no players in the PQ. Would you like to enter PQ?");
npc->sendYesNo();
}
else if(playerspq == 1){
npc->addText("There is currently 1 player in the PQ. Would you like to enter the PQ?");
npc->sendYesNo();
}
else if(playerspq == 2){
npc->addText("There are currently 2 players in the PQ. Would you like to enter the PQ?");
npc->sendYesNo();
}
else if(playerspq == 3){
npc->addText("There are currently 3 players in the PQ. Would you like to enter the PQ?");
npc->sendYesNo();
}
else if(playerspq == 4){
npc->addText("I'm sorry, but there's already a party inside.");
npc->sendSimple();
npc->end();
}
else if(playerspq == -1){
npc->addText("Kerning City PQ is currently disabeled");
npc->sendSimple();
npc->end();
}
else{
npc->addText("It seems like there's something wrong with the PQ system. Warn your developper so he can fix it.");
npc->sendSimple();
npc->end();
}
}
else if(state == 1){
if(npc->getSelected() == YES){
MySQL::setInt("pqkerning","aplayers",1,playerspq+1);
npc->teleport(103000800);
npc->end();
}
else if(npc->getSelected() == NO){
npc->addText("Ok... If you think you're not ready for the challenge, then go train a bit. You can always return!");
npc->end();
}
else{
npc->addText("It seems like there's something wrong with the PQ system. Warn your developper so he can fix it.");
npc->sendSimple();
npc->end();
}
}
}
else{
npc->addText("You have to be between level 21 and 30 if you want to participate this PQ.");
npc->sendSimple();
npc->end();
}
}
void NPCsScripts::npc_9020002(NPC* npc){
int playerMap = npc->getPlayerMap();
int playerspq = MySQL::getInt("pqkerning",1,"aplayers");
int playersexit = MySQL::getInt("pqkerning",0,"aplayers");
int state = npc->getState();
if(playerMap == 103000890){
if(state == 0){
npc->addText("Do you want to return to Kerning City?");
npc->sendYesNo();
}
else if(state == 1){
if(npc->getSelected() == YES){
MySQL::setInt("pqkerning","aplayers",0,playersexit+1);
int playersexit = MySQL::getInt("pqkerning",1,"aplayers");
if(playersexit == 4){
MySQL::setInt("pqkerning","aplayers",1,0);
MySQL::setInt("pqkerning","aplayers",0,0);
}
int coupons = npc->getItemNum(4001007);
npc->giveItem(4001007, -coupons);
npc->teleport(103000000);
npc->end();
}
else{
npc->end();
}
}
}
else{
if(state == 0){
npc->addText("Do you want to leave the PQ?");
npc->sendYesNo();
}
else if(state == 1){
if(npc->getSelected() == YES){
npc->teleport(103000890);
npc->end();
}
else{
npc->end();
}
}
}
}
Look for a smiliar code in NPCsScripts.h and add those things:
Code:
case 9020000: npc_9020000(npc); break; // PQ KERNING : Cloto.
case 9020002: npc_9020002(npc); break; // PQ KERNING : Exit NPC.
Code:
static void npc_9020000(NPC* npc); // PQ KERNING : Cloto.
static void npc_9020002(NPC* npc); // PQ KERNING : Exit NPC.
Extra information
When you set the value of id 1 in the pqkerning table to -1, it will show this when you
click on the npc: "Kerning City PQ is currently disabeled".
And btw, the exit map NPC deletes all the coupons in your inventory to.
Gonna add a check for the bigger yellow passes to for a next version.
-
v1
Only the basic of the whole PQ system is done. (so only 4 people can enter).
Busy with:
Currently I'm busy with the first stage, since the PQ system is almost done...
Have fun!
Any suggestion is welcome!
Vawk/DragonEyes
-
Re: [Release] PQ with a 'party'
-
Re: [Release] PQ with a 'party'
Tested...
edit: not work
i try to put it on TeleportNPC.cpp
i hope its will work.
edit : not work :((((
-
Re: [Release] PQ with a 'party'
i have kerning pq working coded by my own expet the enternace to the by pq by frostms !
and this is not good O_0
-
Re: [Release] PQ with a 'party'
-
Re: [Release] PQ with a 'party'
Quote:
Originally Posted by
Pro-Surf
i have kerning pq working coded by my own expet the enternace to the by pq by frostms !
and this is not good O_0
why is this not good then?
-
Re: [Release] PQ with a 'party'
when i click on the npc not happned nothing........
-
Re: [Release] PQ with a 'party'
-
Re: [Release] PQ with a 'party'
first, we need the npc files... because we don't have anything to talk about.
+ i didn't understood..
i create the table then when i get into the PQ i can start alone? or i need to create party and add 4 people? or all can join and at full cap no1 will be able to join?
+ its all 4 maps + buss? or only few?
-
Re: [Release] PQ with a 'party'
This isn't going to work if party isnt.
-
Re: [Release] PQ with a 'party'
Great job for the effort though :X
-
Re: [Release] PQ with a 'party'
Quote:
Originally Posted by
xnBlaze
This isn't going to work if party isnt.
Ehm, read the first post. Did I say it's a real party with leader/invite/expel?
I'm now running my server with exactly the same script and it does work...
Make sure you're between lvl 21-30.
Maybe it's because another NPC didn't close right (npc->end(); thing ..)
-
Re: [Release] PQ with a 'party'
I didn't test it, I'm just saying.
-
Re: [Release] PQ with a 'party'
when i click on the npc not happned nothing........
-
Re: [Release] PQ with a 'party'
TY, works ^^
for all whos copy pasters u need to move the file that u creat to Maplestory server.
Learn C++ T.T
-
Re: [Release] PQ with a 'party'
Ehm people, did you made a new CPP file for the code or did you just put it somwhere at the bottom of another CPP file?
--
Edit: Nvm, I red the post above. ^^
I knew it has to work x'D
Good luck with it, np ;)
-
Re: [Release] PQ with a 'party'
ye i do it and its not work :\
-
Re: [Release] PQ with a 'party'
Quote:
Originally Posted by
oshri221
ye i do it and its not work :\
- Did you made a new CPP file inside the program and placed the whole big code into it?
- How's your pqkerning database?
I found a bug btw. There's something wrong with the count things (how many people there are inside)
When you go in, leave, go in leave,.. the amount just increases instead of how it has to work..
-
Re: [Release] PQ with a 'party'
I fixed the bug I told above!
I just had to let the variable check a MySQL thing again.
Don't want to replace the whole code (if you changed text par example),
Look for this:
Code:
if(playersexit == 4){
MySQL::setInt("pqkerning","aplayers",1,0);
MySQL::setInt("pqkerning","aplayers",0,0);
}
Place this, ABOVE IT:
Code:
int playersexit = MySQL::getInt("pqkerning",1,"aplayers");
-
Re: [Release] PQ with a 'party'
i still dont get whats the point...
w/e
-
Re: [Release] PQ with a 'party'
-
Re: [Release] PQ with a 'party'
Quote:
Originally Posted by
oshri221
ye i do it and its not work :\
After you add it, your suppose to rebuild(if you didn't)
and you have to make the table in your MySQL Query Browser/Navicat/Whatever you use.
and you probably put the file in the wrong folder?
-
Re: [Release] PQ with a 'party'
[Alert] Noob question -
Which NPC do I talk to >.<
-
Re: [Release] PQ with a 'party'
Quote:
Originally Posted by
Spyker710
[Alert] Noob question -
Which NPC do I talk to >.<
Ehm, the same as in gMS, so Lakelis. ^^
-
Re: [Release] PQ with a 'party'
well it is some idiots who shouldent even be here T-T
Initialise saying god job even if he havent test the stuff ...
xnBlaze spamming and talking about partys Oo he dident read the post .. stupid like always.... double post
npmaple point of what ? making a code and post it in released sector ?