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!

Event NPCs (Andy, Paul, Martin) [Updated, fixed]

Status
Not open for further replies.
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Status:
Tested and retested. The current version works flawlessly, along with the commands posted to update the event's type, town, and status (on or off).​

Downloads:
[FIXED]
Download that & place it into your GameServer folder within the Solution Explorer. Place these into your NPCsScripts.h:
Code:
			case 9000011: npc_9000011(npc); break;
			case 9000000: npc_9000000(npc); break;
			case 9000013: npc_9000013(npc); break;
                  	case 9000001: npc_9000001(npc); break;

Code:
	static void npc_9000011(NPC* npc);
	static void npc_9000000(NPC* npc);
	static void npc_9000013(NPC* npc);
	static void npc_9000001(NPC* npc);

I finally figured out how to fetch information from the database, so things will be A LOT easier now. :]

I'm here to offer support if you need it. I haven't actually compiled the scripts yet so you may experience a few errors, but I'll get right on it.

Anyway, here they are. The event NPCs Paul, Andy, and Martin in Lith Harbour, Orbis, and Maple Island. (If there are more, PLEASE tell me, I can't think of any at the moment).

First, let's cover the database part.
Run this query in your database manager (SQLYog, Navicat, whatever):
Code:
DROP TABLE IF EXISTS `events`;
CREATE TABLE `events` (
  `type` int(1) NOT NULL,
  `ID` int(1) NOT NULL,
  `start` int(1) NOT NULL,
  `town` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `events` VALUES ('0', '1', '0', '0');
Now, let's go over what each field does.

Note: If you wish to have an NPC fetch anything new you might add, use the MySQL::getString,Int,etc. functions.

type = What type of event you're shooting for. You can set the event types to tell the NPC(s) what map to teleport the player wishing to enter the event to. The map can be set within the source, but I might just change this later on. (By default, there are 3 types set in the source, but you can increase it).
Values (so far): 0, 1, 2

ID = Nothing really. Just used to identify which record to target.

start = Indicates whether or not an event is on or not. I'm working on creating a command for GMs to be able to set do this so it can be controlled by people other than the server administrator.
Values: 0, 1

town = This indicates which town an event will take place in.
Values: 0, 1, 2, 3
0: All towns
1: Lith Harbour
2: Orbis
3: Maple
Basically, if you set the value to 0, 1, 2, or 3 the event NPC in that town or all towns will be activated.

Now, on to the source itself:
NOTE: WHEREVER IT SAYS TO PLACE A VALUE OTHER THAN WHAT'S ALREADY THERE, DO IT OR YOU'RE IN FOR A SERVER CRASH.

Downloads:
[FIXED]
Download that & place it into your GameServer folder within the Solution Explorer. Place these into your NPCsScripts.h:
Code:
			case 9000011: npc_9000011(npc); break;
			case 9000000: npc_9000000(npc); break;
			case 9000013: npc_9000013(npc); break;
                  	case 9000001: npc_9000001(npc); break;

Code:
	static void npc_9000011(NPC* npc);
	static void npc_9000000(NPC* npc);
	static void npc_9000013(NPC* npc);
	static void npc_9000001(NPC* npc);

Images:

With the 'town' field set to '0':
iGoofy - Event NPCs (Andy, Paul, Martin) [Updated, fixed] - RaGEZONE Forums



'town' field set to '1' (Lith):
iGoofy - Event NPCs (Andy, Paul, Martin) [Updated, fixed] - RaGEZONE Forums


Selection menu:
iGoofy - Event NPCs (Andy, Paul, Martin) [Updated, fixed] - RaGEZONE Forums


Choice 'Gotta go':
iGoofy - Event NPCs (Andy, Paul, Martin) [Updated, fixed] - RaGEZONE Forums


Choice 'I'd like to know more about the events.':
iGoofy - Event NPCs (Andy, Paul, Martin) [Updated, fixed] - RaGEZONE Forums


Being teleported to an event map specified in my own source:
iGoofy - Event NPCs (Andy, Paul, Martin) [Updated, fixed] - RaGEZONE Forums
 
Last edited:
Master Summoner
Joined
Apr 2, 2008
Messages
538
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

Nice guide/release :3. Very very useful when it comes to making events.
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

Yes, and it was a lot easier than I thought it'd be, to be honest. :v
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
55
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

so ithink i need to change this no?

}
if(state == 1){//Add in as many else's and if's as you have event types. :>
if(eventtype == 0){
npc->teleport(INSERT EVENT MAP ID HERE);
}
else{
if(eventtype == 1){
npc->teleport(INSERT EVENT MAP ID HERE);
}
else{
if(eventtype == 2){
npc->teleport(INSERT EVENT MAP ID HERE);
}
}
}
}

if u can help me i i want to test it so i want to make 3 or 4 code for the events^^
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

@Above: Yep. Just add in the ID's for the map. If you want to make more, find the left brace (}) that matches the right brace ({) for if(eventtype == 2) and then add an else if(eventtype == 3){ under that and then match it up.

@Everyone else: C'mon post any errors you're getting! I don't want to feel rejected! D';
 
Newbie Spellweaver
Joined
Apr 11, 2008
Messages
31
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

forgot dude in ludi? o.o
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

Oh damn, I forgot Ludi. D: I'll get to it once I compile the script and wipe away any errors~

EDIT: Read the original post. I'll be re-posting an entirely new .cpp file for the NPCs, and maybe even a little bonus. Also, I made quite a few stupid mistakes. <__<;
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
55
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

but is cool so only the people want victoria and orbis so i see sometimes i see the people only goes to the ludi when the admin opens so
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

Updates:
Completely separate .cpp file posted in the first post. Cases and static voids posted. Ludibrium event NPC added.
---
!setevent & !eventtype commands:

!setevent & !eventtype commands:

!setevent (Starts or ends an event and sends out a notice for players)
Code:
		else if(strcmp(command, "setevent") == 0){
			MySQL::setInt("events", "start", 1, strval(strtok_s(NULL, " ",&next_token)));
							if(strcmp(next_token, "0") == 0){
								MySQL::setInt("events", "start", 1, 0);
							}
							else if(strcmp(next_token, "1") == 0){
								MySQL::setInt("events", "start", 1, 1);
							}
							PlayersPacket::showMassage("The event has started! It's up to you to find the event town!", 0);
		}

!eventtype (Sets the event's type)
Code:
else if(strcmp(command, "eventtype") == 0){
			MySQL::setInt("events", "type", 1, strval(strtok_s(NULL, " ",&next_token)));
							if(strcmp(next_token, "0") == 0){
								MySQL::setInt("events", "type", 1, 0);
							}
							else if(strcmp(next_token, "1") == 0){
								MySQL::setInt("events", "type", 1, 1);
							}
							else if(strcmp(next_token, "2") == 0){
								MySQL::setInt("events", "type", 1, 2);
							}
							else if(strcmp(next_token, "3") == 0){
								MySQL::setInt("events", "type", 1, 3);
							}
							PlayersPacket::showMassage("The event has started! It's up to you to find the event town!", 0);
		}
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin)

If you're using it, then quit being a damned fool and post! If you've got an error I'M HERE TO SUPPORT YOU, I'm HERE to listen to your problems. I'M HERE.

Also, I'm testing out an !eventtown command as I type this. It will activate the NPC in the town you specify.

Code:
0: All towns
1: Lith Harbour
2: Orbis
3: Maple
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
55
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

so i need help to make the summon monster TT_TT
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

Well, you can have an NPC on your event maps that summons monsters or have monsters spawning there normally. Have a few jump quest events in the Physical Fitness Test map or the Eastern Fields.
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
55
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

so i want 4 event snackbar event, golden slime, bosses event, Jump quest so if u can help me

9410015 <--snack mosnter
902002 <--Slime nx event
and bosses plz

so and i have this error

------ Build started: Project: MapleStoryServer, Configuration: Debug Win32 ------
Compiling...
Players.cpp
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(82) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(82) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(84) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(84) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(87) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(87) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(92) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(92) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(94) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(94) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(97) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(97) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(100) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(100) : error C3861: 'setInt': identifier not found
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(103) : error C2653: 'MySQL' : is not a class or namespace name
c:\documents and settings\juan\mis documentos\jorge\macms\titanmsver007fixed\maplestoryserver\maplestoryserver\players.cpp(103) : error C3861: 'setInt': identifier not found
Events.cpp
Generating Code...
Compiling...
NPCs.cpp
Generating Code...
Skipping... (no relevant changes detected)
Happyville.cpp
PlasticSurgery.cpp
Salons.cpp
Skillseller.cpp
SkinCare.cpp
Gachapon.cpp
GameMasters.cpp
MapleIsland.cpp
MonsterRidingNPC.cpp
ShopNPCs.cpp
TeleportNPCs.cpp
Build log was saved at "file://c:\Documents and Settings\Juan\Mis documentos\jorge\MacMs\TitanMSVer007Fixed\MapleStoryServer\MapleStoryServer\Debug\BuildLog.htm"
MapleStoryServer - 16 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
 
Newbie Spellweaver
Joined
Apr 27, 2007
Messages
55
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

and i have i idea for thsi code

else if(strcmp(command, "eventtype") == 0){
MySQL::setInt("events", "type", 1, strval(strtok_s(NULL, " ",&next_token)));
if(strcmp(next_token, "0") == 0){
MySQL::setInt("events", "type", 1, 0);
}
else if(strcmp(next_token, "1") == 0){
MySQL::setInt("events", "type", 1, 1);
}
else if(strcmp(next_token, "2") == 0){
MySQL::setInt("events", "type", 1, 2);
}
else if(strcmp(next_token, "3") == 0){
MySQL::setInt("events", "type", 1, 3);
}
PlayersPacket::showMassage("The event has started! It's up to you to find the event town!", 0);
}

change that in bold to
The event has already will start ... Look for the city
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

so i want 4 event snackbar event, golden slime, bosses event, Jump quest so if u can help me

9410015 <--snack mosnter
902002 <--Slime nx event
and bosses plz

so and i have this error
Add this to the top of your file:
Code:
#include "MySQLM.h"

To spawn monsters with an NPC use the Mobs::spawnMobs(player, MOBID) function. Just place the monster's ID where MOBID is. I'm here to help with this script alone, not to give you things to copy and return nothing for it.
 
Newbie Spellweaver
Joined
Mar 25, 2008
Messages
51
Reaction score
3
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

3>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_9000001(class NPC *)" (?npc_9000001@NPCsScripts@@CAXPAVNPC@@@Z)
3>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_9000013(class NPC *)" (?npc_9000013@NPCsScripts@@CAXPAVNPC@@@Z)
3>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_9000000(class NPC *)" (?npc_9000000@NPCsScripts@@CAXPAVNPC@@@Z)
3>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_9000011(class NPC *)" (?npc_9000011@NPCsScripts@@CAXPAVNPC@@@Z)
3>NPCs.obj : error LNK2001: unresolved external symbol "private: static void __cdecl NPCsScripts::npc_2080005(class NPC *)" (?npc_2080005@NPCsScripts@@CAXPAVNPC@@@Z)

it wont even compile events.cpp its like it cant find it but its with all my other cpp's >.<
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

I get that all of the time. I suggest taking a look at your static voids and cases in NPCsScripts.h it's usually something to do with NPC IDs.
 
Experienced Elementalist
Joined
Apr 5, 2008
Messages
287
Reaction score
1
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

you have the npcs for that map :S?

i will try to make them
 
Newbie Spellweaver
Joined
Mar 25, 2008
Messages
51
Reaction score
3
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

well i only get NPC.obj's when the id is in NPCScripts.h but it can't find the .cpp the code is in... thats my problem.
 
Newbie Spellweaver
Joined
Apr 9, 2008
Messages
5
Reaction score
0
Re: [Release] Event NPCs (Andy, Paul, Martin) [Updated, fixed]

well i only get NPC.obj's when the id is in NPCScripts.h but it can't find the .cpp the code is in... thats my problem.

Fix credit to AngelSel - Open your MapleStoryServer solution and at the same time , open your Events.cpp file and from the events.cpp file do this . File > Move Events.cpp into > MapleStoryServer. Recompile and try again.
 
Status
Not open for further replies.
Back
Top