Adding_new_mapflag
Pages 190
Getting Started
- Installation instructions
- Transitioning from SVN to GIT
- Compiling on your OS
- Connecting & Starting rAthena
Configure your Server
- Scripting like a pro!
- Server Modifications and what to expect
- Database Configuration
Customization
- Adding Custom Items
- Adding Custom Monsters
- GRF Encryption
Setup the Client
- Data folder
- Diff files
Misc Databases
Third-Party Software
Clone this wiki locally
title: Adding new mapflag permalink: /Adding_new_mapflag/
Introduction
When scripting, or creating custom automated events, you may wish to add your own custom mapflags. In order to do so, you'll need to complete some source edits. This article will explain how.
This article was originally created by TecnoCronus on the eAthena forums.
Open /src/map/map.h
Find:
unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
Add below:
unsigned mymapflag : 1;
Open /src/map/script.c
Find:
MF_GUILDLOCK
Replace with:
MF_GUILDLOCK, // Added comma for then next map-flag.
MF_MYMAPFLAG
Find:
case MF_GUILDLOCK: script_pushint(st,map[m].flag.guildlock); break;
Below add:
case MF_MYMAPFLAG: script_pushint(st,map[m].flag.mymapflag); break;
Find:
case MF_GUILDLOCK: map[m].flag.guildlock=1; break;
Below add:
case MF_MYMAPFLAG: map[m].flag.mymapflag=1; break;
Find:
case MF_GUILDLOCK: map[m].flag.guildlock=0; break;
Below add:
case MF_MYMAPFLAG: map[m].flag.mymapflag=0; break;
Open /src/map/npc.c
Find:
else if (!strcmpi(w3,"guildlock"))
map[m].flag.guildlock=state;
Below add:
else if (!strcmpi(w3,"mymapflag"))
map[m].flag.mymapflag=state;
Open /db/const.txt
Find:
mf_guildlock45
Below add:
mf_mymapflag46
Conclusion
Recompile and you can now set "mymapflag" to any value. Remember, you can rename the mapflag to whatever, and later use the flag option anywhere else in your source code.