Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This patch file was generated by NetBeans IDE
- # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
- # This patch can be applied using context Tools: Patch action on respective folder.
- # It uses platform neutral UTF-8 encoding and \n newlines.
- # Above lines and this line are ignored by the patching process.
- Index: conf/mapflag/restricted.txt
- --- conf/mapflag/restricted.txt Base (BASE)
- +++ conf/mapflag/restricted.txt Locally Deleted
- @@ -1,128 +0,0 @@
- -//===== rAthena Script =======================================
- -//= Mapflag: Restricted.
- -//===== By: ==================================================
- -//= Komurka
- -//===== Current Version: =====================================
- -//= 1.3
- -//===== Compatible With: =====================================
- -//= rAthena SVN
- -//===== Description: =========================================
- -//= Disables items configured in item_noequip.txt
- -//= and skills configured in skill_nocast_db.txt.
- -//===== Additional Comments: =================================
- -//= 1.1 - Added WoE:SE Map restrictions. [L0ne_W0lf]
- -//= 1.2 - Added Endless Tower Restrictions. (bugreport:4707) [L0ne_W0lf]
- -//= 1.3 - Added Orc's Memory, Nidhoggur's Nest and towns restrictions. [Daegaladh]
- -//============================================================
- -
- -//Aldebaran Turbo Track
- -alde_tt02 mapflag restricted 1
- -turbo_n_1 mapflag restricted 1
- -turbo_n_4 mapflag restricted 1
- -turbo_n_8 mapflag restricted 1
- -turbo_n_16 mapflag restricted 1
- -turbo_e_4 mapflag restricted 1
- -turbo_e_8 mapflag restricted 1
- -turbo_e_16 mapflag restricted 1
- -
- -//Jail
- -sec_pri mapflag restricted 2
- -
- -//Izlude Battle Arena
- -force_1-1 mapflag restricted 3
- -force_2-1 mapflag restricted 3
- -force_3-1 mapflag restricted 3
- -force_4-1 mapflag restricted 3
- -force_5-1 mapflag restricted 3
- -force_1-2 mapflag restricted 3
- -force_1-3 mapflag restricted 3
- -prt_are_in mapflag restricted 3
- -
- -//WoE:SE Maps
- -schg_cas01 mapflag restricted 4
- -schg_cas02 mapflag restricted 4
- -schg_cas03 mapflag restricted 4
- -schg_cas04 mapflag restricted 4
- -schg_cas05 mapflag restricted 4
- -arug_cas01 mapflag restricted 4
- -arug_cas02 mapflag restricted 4
- -arug_cas03 mapflag restricted 4
- -arug_cas04 mapflag restricted 4
- -arug_cas05 mapflag restricted 4
- -
- -//Sealed Shrine ==================
- -1@cata mapflag restricted 5
- -2@cata mapflag restricted 5
- -
- -//Endless Tower ==================
- -1@tower mapflag restricted 6
- -2@tower mapflag restricted 6
- -3@tower mapflag restricted 6
- -4@tower mapflag restricted 6
- -5@tower mapflag restricted 6
- -6@tower mapflag restricted 6
- -
- -//Orc's Memory ===================
- -1@orcs mapflag restricted 6
- -2@orcs mapflag restricted 6
- -
- -// Nidhoggr's Instance ===========
- -1@nyd mapflag restricted 6
- -2@nyd mapflag restricted 6
- -
- -// Misty Forest Labyrinth ===========
- -1@mist mapflag restricted 6
- -
- -// Octopus Cave ===========
- -1@cash mapflag restricted 6
- -
- -// Drain ===========
- -1@pump mapflag restricted 6
- -2@pump mapflag restricted 6
- -
- -// Somatology Laboratory ===========
- -1@lhz mapflag restricted 6
- -
- -// Bangungot Hospital F2 ===========
- -1@ma_h mapflag restricted 6
- -
- -// Buwaya Cave ===========
- -1@ma_c mapflag restricted 6
- -
- -// Bakonawa Hideout ===========
- -1@ma_b mapflag restricted 6
- -
- -// Inside Eclage ===========
- -1@ecl mapflag restricted 6
- -
- -//Towns
- -alberta mapflag restricted 7
- -aldebaran mapflag restricted 7
- -amatsu mapflag restricted 7
- -ayothaya mapflag restricted 7
- -brasilis mapflag restricted 7
- -comodo mapflag restricted 7
- -einbroch mapflag restricted 7
- -einbech mapflag restricted 7
- -geffen mapflag restricted 7
- -gonryun mapflag restricted 7
- -izlude mapflag restricted 7
- -jawaii mapflag restricted 7
- -hugel mapflag restricted 7
- -lighthalzen mapflag restricted 7
- -louyang mapflag restricted 7
- -manuk mapflag restricted 7
- -mid_camp mapflag restricted 7
- -moc_ruins mapflag restricted 7
- -morocc mapflag restricted 7
- -moscovia mapflag restricted 7
- -niflheim mapflag restricted 7
- -prontera mapflag restricted 7
- -payon mapflag restricted 7
- -pay_arche mapflag restricted 7
- -rachel mapflag restricted 7
- -splendide mapflag restricted 7
- -umbala mapflag restricted 7
- -veins mapflag restricted 7
- -xmas mapflag restricted 7
- -yuno mapflag restricted 7
- Index: conf/mapflag/skillduration.txt
- --- conf/mapflag/skillduration.txt No Base Revision
- +++ conf/mapflag/skillduration.txt Locally New
- @@ -0,0 +1,22 @@
- +//===== Hercules Script ======================================
- +//= Mapflag: Adjust Skill Duration.
- +//===== By: ==================================================
- +//= Hercules Dev Team
- +//===== Current Version: =====================================
- +//= 1.0
- +//===== Description: =========================================
- +//= This mapflag allows you to control the duration of unit
- +//= skills in any map.
- +//= Example (1):
- +//= prontera mapflag adjust_unit_duration PR_SANCTUARY 50
- +//= Halves the duration of Sanctuary in Prontera.
- +//=
- +//= Example (2):
- +//= prontera mapflag adjust_unit_duration WZ_QUAGMIRE 250
- +//= Increases duration of Quagmire by 2.5 times in Prontera.
- +//===== Disclaimer: ==========================================
- +//= Be aware that some skill units have their visual effect
- +//= durations not controlled by the server (e.g. Storm Gust).
- +//===== Additional Comments: =================================
- +//= 1.0 - Initial script.
- +//============================================================
- \ No newline at end of file
- Index: conf/mapflag/skillmodifier.txt
- --- conf/mapflag/skillmodifier.txt No Base Revision
- +++ conf/mapflag/skillmodifier.txt Locally New
- @@ -0,0 +1,19 @@
- +//===== Hercules Script ======================================
- +//= Mapflag: Adjust Skill Damage.
- +//===== By: ==================================================
- +//= Hercules Dev Team
- +//===== Current Version: =====================================
- +//= 1.0
- +//===== Description: =========================================
- +//= This mapflag allows you to modify the damage of any skill
- +//= in any map.
- +//= Example (1):
- +//= prontera mapflag adjust_skill_damage MG_FIREBOLT 50
- +//= Halves the damage of Firebolt in Prontera.
- +//=
- +//= Example (2):
- +//= prontera mapflag adjust_skill_damage MG_FIREBOLT 200
- +//= Doubles the damage of Firebolt in Prontera.
- +//===== Additional Comments: =================================
- +//= 1.0 - Initial script.
- +//============================================================
- \ No newline at end of file
- Index: conf/mapflag/zone.txt
- --- conf/mapflag/zone.txt No Base Revision
- +++ conf/mapflag/zone.txt Locally New
- @@ -0,0 +1,122 @@
- +//===== rAthena ==============================================
- +//= Mapflag: Zone.
- +//===== By: ==================================================
- +//= Ind/Hercules
- +//===== Current Version: =====================================
- +//= 1.0
- +//===== Description: =========================================
- +//= Flags maps as part of zones defined in map_zone_db.txt
- +//===== Additional Comments: =================================
- +//============================================================
- +
- +//Aldebaran Turbo Track
- +alde_tt02 mapflag zone Aldebaran Turbo Track
- +turbo_n_1 mapflag zone Aldebaran Turbo Track
- +turbo_n_4 mapflag zone Aldebaran Turbo Track
- +turbo_n_8 mapflag zone Aldebaran Turbo Track
- +turbo_n_16 mapflag zone Aldebaran Turbo Track
- +turbo_e_4 mapflag zone Aldebaran Turbo Track
- +turbo_e_8 mapflag zone Aldebaran Turbo Track
- +turbo_e_16 mapflag zone Aldebaran Turbo Track
- +
- +//Jail
- +sec_pri mapflag zone Jail
- +
- +//Izlude Battle Arena
- +force_1-1 mapflag zone Izlude Battle Arena
- +force_2-1 mapflag zone Izlude Battle Arena
- +force_3-1 mapflag zone Izlude Battle Arena
- +force_4-1 mapflag zone Izlude Battle Arena
- +force_5-1 mapflag zone Izlude Battle Arena
- +force_1-2 mapflag zone Izlude Battle Arena
- +force_1-3 mapflag zone Izlude Battle Arena
- +prt_are_in mapflag zone Izlude Battle Arena
- +
- +//WoE:SE Maps
- +schg_cas01 mapflag zone GvG2
- +schg_cas02 mapflag zone GvG2
- +schg_cas03 mapflag zone GvG2
- +schg_cas04 mapflag zone GvG2
- +schg_cas05 mapflag zone GvG2
- +arug_cas01 mapflag zone GvG2
- +arug_cas02 mapflag zone GvG2
- +arug_cas03 mapflag zone GvG2
- +arug_cas04 mapflag zone GvG2
- +arug_cas05 mapflag zone GvG2
- +
- +//Sealed Shrine ==================
- +1@cata mapflag zone Sealed Shrine
- +2@cata mapflag zone Sealed Shrine
- +
- +//Endless Tower ==================
- +1@tower mapflag zone Memorial Dungeon
- +2@tower mapflag zone Memorial Dungeon
- +3@tower mapflag zone Memorial Dungeon
- +4@tower mapflag zone Memorial Dungeon
- +5@tower mapflag zone Memorial Dungeon
- +6@tower mapflag zone Memorial Dungeon
- +
- +//Orc's Memory ===================
- +1@orcs mapflag zone Memorial Dungeon
- +2@orcs mapflag zone Memorial Dungeon
- +
- +// Nidhoggr's Instance ===========
- +1@nyd mapflag zone Memorial Dungeon
- +2@nyd mapflag zone Memorial Dungeon
- +
- +// Misty Forest Labyrinth ===========
- +1@mist mapflag zone Memorial Dungeon
- +
- +// Octopus Cave ===========
- +1@cash mapflag zone Memorial Dungeon
- +
- +// Drain ===========
- +1@pump mapflag zone Memorial Dungeon
- +2@pump mapflag zone Memorial Dungeon
- +
- +// Somatology Laboratory ===========
- +1@lhz mapflag zone Memorial Dungeon
- +
- +// Bangungot Hospital F2 ===========
- +1@ma_h mapflag zone Memorial Dungeon
- +
- +// Buwaya Cave ===========
- +1@ma_c mapflag zone Memorial Dungeon
- +
- +// Bakonawa Hideout ===========
- +1@ma_b mapflag zone Memorial Dungeon
- +
- +// Inside Eclage ===========
- +1@ecl mapflag zone Memorial Dungeon
- +
- +//Towns
- +alberta mapflag zone Towns
- +aldebaran mapflag zone Towns
- +amatsu mapflag zone Towns
- +ayothaya mapflag zone Towns
- +brasilis mapflag zone Towns
- +comodo mapflag zone Towns
- +einbroch mapflag zone Towns
- +einbech mapflag zone Towns
- +geffen mapflag zone Towns
- +gonryun mapflag zone Towns
- +izlude mapflag zone Towns
- +jawaii mapflag zone Towns
- +hugel mapflag zone Towns
- +lighthalzen mapflag zone Towns
- +louyang mapflag zone Towns
- +manuk mapflag zone Towns
- +mid_camp mapflag zone Towns
- +moc_ruins mapflag zone Towns
- +morocc mapflag zone Towns
- +moscovia mapflag zone Towns
- +niflheim mapflag zone Towns
- +prontera mapflag zone Towns
- +payon mapflag zone Towns
- +pay_arche mapflag zone Towns
- +rachel mapflag zone Towns
- +splendide mapflag zone Towns
- +umbala mapflag zone Towns
- +veins mapflag zone Towns
- +xmas mapflag zone Towns
- +yuno mapflag zone Towns
- Index: conf/msg_conf/map_msg.conf
- --- conf/msg_conf/map_msg.conf Base (BASE)
- +++ conf/msg_conf/map_msg.conf Locally Modified (Based On LOCAL)
- @@ -836,7 +836,7 @@
- // @mapinfo
- 1038: Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
- 1039: ------ Map Info ------
- -1040: Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d
- +1040: Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
- 1041: ------ Map Flags ------
- 1042: Town Map
- 1043: Autotrade Enabled
- Index: config.pl
- --- config.pl Base (BASE)
- +++ config.pl Locally Deleted
- @@ -1,538 +0,0 @@
- -#!/usr/bin/perl
- -# config script by lighta
- -#TODO list :
- -#- don't always override import/file, sed grep ?
- -
- -use CPAN;
- -use strict;
- -use constant {
- - SERV_UID => "Serv_userid",
- - SERV_PW => "Serv_userpass",
- - SERV_WAN_IP => "Serv_wan_ip",
- - MAP_PORT => "Map_port",
- - CHAR_PORT => "Char_port",
- - LOGIN_PORT => "Login_port",
- - MD5_ENABLE => "enable_MD5",
- - SQL_HOST => "SQL_host",
- - SQL_PORT => "SQL_port",
- - SQL_UID => "SQL_userid",
- - SQL_PW => "SQL_userpass",
- - SQL_MAIN_DB => "SQL_maindb",
- - SQL_LOG_DB => ,"SQL_logdb",
- -
- - MAP_CONF_FILE => "map_conf.txt",
- - CHAR_CONF_FILE => "char_conf.txt",
- - LOGIN_CONF_FILE => "login_conf.txt",
- - INTER_CONF_FILE => "inter_conf.txt",
- - DESD_CONF_FILE => ".tmp-desd_conf.yml",
- - MIN_PORT => 2000, #below are usually reserved for system
- - MAX_PORT => 65535,
- -};
- -BEGIN { #check and install module
- - my @aCheckModule = ("DBI","DBD::mysql","YAML::XS","Cwd","Getopt::Long","Net::Ping");
- - my @aMarkInst = ();
- - foreach(@aCheckModule) { eval "require $_" or push(@aMarkInst,$_); }
- - CPAN::install("@aMarkInst") if(@aMarkInst > 0);
- - foreach(@aCheckModule) { $_->import(); }
- -}
- -# setup my defaults option
- -my $sDsdFile = DESD_CONF_FILE;
- -my $sAutoyes = 0;
- -my $sForce = 0;
- -my $sClean = 0;
- -my $sTarget = "All";
- -my $sHelp = 0;
- -GetArgs();
- -Main();
- -
- -sub GetArgs {
- - GetOptions(
- - 'f=s' => \$sDsdFile, #give desired conf file
- - 'auto=i' => \$sAutoyes, #Force (auto-yes)
- - 'C=i' => \$sClean, #Clean (like force but remove before adding)
- - 'target=s' => \$sTarget, #Target (wich setup to run)
- - 'Force=i' => \$sForce, #Force (bypass verification)
- - 'help!' => \$sHelp,
- - ) or $sHelp=1; #display help if invalid option
- - my $sValidTarget = "All|Conf|DB|Inst";
- -
- - if( $sHelp ) {
- - print "Incorect option specified, available option are:\n"
- - ."\t --f filename => file (specify desiredconf to use)\n"
- - ."\t --auto => auto-yes to question ? \n"
- - ."\t --C => Clean (remove file, db, user before adding new)\n"
- - ."\t --target => target (specify wich setup to run [$sValidTarget])\n"
- - ."\t --Force => Force (bypass verification)\n";
- - exit;
- - }
- - unless($sTarget =~ /$sValidTarget/){
- - print "Incorect target specified, available target are:\n"
- - ."\t --target => target (specify wich setup to run [(default)$sValidTarget])\n";
- - exit;
- - }
- - if($sDsdFile ne DESD_CONF_FILE && !(-e -r $sDsdFile)){
- - print "Incorect file specified: '$sDsdFile'\n"
- - ."\t this file doesn't seem to appear on filesystem or unable to read\n";
- - exit;
- - }
- -}
- -
- -sub Main {
- - print "Welcome to athena config-tool\n";
- - #default conf
- - my %hDefConf = ( SERV_UID => "s1",
- - SERV_PW => "p1",
- - SERV_WAN_IP => "localhost",
- - MAP_PORT => "5121",
- - CHAR_PORT => "6121",
- - LOGIN_PORT => "6900",
- - MD5_ENABLE => "yes",
- - SQL_HOST => "localhost",
- - SQL_PORT => "3306",
- - SQL_UID => "ragnarok",
- - SQL_PW => "ragnarok",
- - SQL_MAIN_DB => "ragnarok",
- - SQL_LOG_DB => ,"ragnarok",
- - );
- -
- - my $sBasedir = getcwd; #for setupdb
- - if($sTarget =~ /All|Inst/){ InstallSoft(); }
- - if($sTarget =~ /All|Conf/) { ConfigConf(\%hDefConf); chdir "$sBasedir"; }
- - if($sTarget =~ /All|DB/) { ConfigDB(\%hDefConf); chdir "$sBasedir"; }
- - print "Config done, you should be able to launch and connect server now\n";
- - print "NB : Don't forget to update your client clieninfo.xml to match change\n";
- -}
- -
- -sub InstallSoft {
- - print "\n Starting InstallSoft \n";
- - print "This autoinstall feature is experimental, package name varies from distri and version, couldn't support them all\n";
- - #yes we could $^0 or uname -r but $^0 only give perl binary build OS and uname hmm...
- - my @aSupportedOS = ("Debian","Ubuntu","Fedora","CentOs");
- - my $sOSregex = join("|",@aSupportedOS);
- - my $sOS;
- - until($sOS =~ /$sOSregex/i){
- - print "Please enter your OS:[$sOSregex] or enter 'quit' to exit\n";
- - $sOS = <>; chomp($sOS);
- - last if($sOS eq "quit");
- - }
- - if($sOS eq "quit"){ print "Skipping Software installation\n"; return; }
- - elsif($sOS =~ /Ubuntu|Debian/i) { #tested on ubuntu 12.10
- - my @aListSoft = ("gcc","gdb","zlibc","zlib1g-dev","make","subversion","mysql-client","mysql-server","mysql-common","libmysqlclient-dev","phpmyadmin","libpcre3-dev");
- - print "Going to install: @aListSoft\n";
- - system("sudo apt-get install @aListSoft");
- - }
- - elsif($sOS =~ /Fedora|CentOs/i){ #tested on fedora 18
- - my @aListSoft = ("gcc","gdb","zlib","zlib-devel","make","subversion","mysql-server","phpmyadmin","pcre-devel");
- - system("sudo yum install @aListSoft");
- - }
- -}
- -
- -sub ConfigConf { my ($rhDefConf) = @_;
- - print "\n Starting ConfigConf \n";
- - my $rhUserConf;
- - while(1) {
- - $rhUserConf = GetDesiredConf($rhDefConf);
- - print "SetupConf using conf : \n";
- - ShowConfig($rhUserConf);
- - last if($sForce || AutoCheckConf($rhUserConf));
- - }
- - ApplySetupConf($rhUserConf);
- -}
- -
- -sub ConfigDB { my ($rhDefConf) = @_;
- - print "\n Starting ConfigDB \n";
- - my $rhUserConf;
- - while(1) {
- - $rhUserConf = GetDesiredConf($rhDefConf);
- - print "SetupDb using conf : \n";
- - ShowConfig($rhUserConf);
- - last if($sForce || AutoCheckConf($rhUserConf));
- - }
- - ApplySetupDB($rhUserConf);
- -}
- -
- -#conf function
- -sub ApplySetupConf { my ($rhConfig) = @_;
- - print "\nApplying conf \n";
- - my @aTargetfile = (MAP_CONF_FILE,CHAR_CONF_FILE,LOGIN_CONF_FILE,INTER_CONF_FILE);
- - my $sConfDir = "conf";
- - my $sUserConfDir = "import";
- -
- - die "$sConfDir doesn't seem to exist or coudldn't be read/writte" unless(-d -r -w "../$sConfDir");
- - chdir "../$sConfDir";
- - print "Saving tmp user-conf \n";
- - YAML::XS::DumpFile(DESD_CONF_FILE,$rhConfig);
- - unless(-d "$sUserConfDir") {
- - print "conf/import directory doesn't exist, create it ? [y/n] (will be generated by compilation otherwise) \n";
- - if(GetValidAnwser("y|o|n") =~ /n/i) { die "Couldn't apply conf without import folder\n"; }
- - mkdir "$sUserConfDir";
- - }
- - chdir $sUserConfDir;
- -
- - if($sClean){ unlink @aTargetfile; } #deleting file before applying conf if clean
- - opendir(DIR, ".") or die $!;
- - my @aDirfile = grep { /\.txt/ && -f "$_" } readdir(DIR);
- - close DIR;
- - print "Current file in directory = [@aDirfile] target = [@aTargetfile] \n";
- -
- - foreach my $sCurfile(@aTargetfile) {
- - print "Checking if target file: [$sCurfile] exist ? ";
- - if(-e -r $sCurfile) {
- - print "Yes\n";
- - print "$sCurfile seem to exist, overwritte it [y/n] ?\n";
- - if(GetValidAnwser("y|o|n") =~ /n/i) {
- - print "Only overwritte option supported atm skip file\n\n";
- - next;
- - }
- - }
- - else { print "No\n" };
- -
- - print "\t Writting file $sCurfile \n";
- - if($sCurfile eq MAP_CONF_FILE) { ApplyMapConf($rhConfig,$sCurfile); }
- - elsif($sCurfile eq CHAR_CONF_FILE) { ApplyCharConf($rhConfig,$sCurfile); }
- - elsif($sCurfile eq LOGIN_CONF_FILE) { ApplyLoginConf($rhConfig,$sCurfile); }
- - elsif($sCurfile eq INTER_CONF_FILE) { ApplyInterConf($rhConfig,$sCurfile); }
- - }
- -}
- -
- -sub ApplyMapConf { my ($rhUserConf,$sCurfile) = @_;
- - open FILE, "> $sCurfile" || die "couldn't openfile/create $sCurfile \n";
- - print FILE "userid: " . $$rhUserConf{SERV_UID}."\n";
- - print FILE "passwd: " . $$rhUserConf{SERV_PW}."\n\n";
- -
- - print FILE "map_ip: " . $$rhUserConf{SERV_WAN_IP}."\n";
- - print FILE "map_port: " . $$rhUserConf{MAP_PORT}."\n";
- - print FILE "char_port: " . $$rhUserConf{CHAR_PORT}."\n";
- -}
- -
- -sub ApplyCharConf { my ($rhUserConf,$sCurfile) = @_;
- - open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
- - print FILE "userid: " . $$rhUserConf{SERV_UID}."\n";
- - print FILE "passwd: " . $$rhUserConf{SERV_PW}."\n\n";
- -
- - print FILE "char_ip: " . $$rhUserConf{SERV_WAN_IP}."\n";
- - print FILE "char_port: " . $$rhUserConf{CHAR_PORT}."\n";
- - print FILE "login_port: " . $$rhUserConf{LOGIN_PORT}."\n";
- -}
- -
- -sub ApplyLoginConf { my ($rhUserConf,$sCurfile) = @_;
- - open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
- - print FILE "login_port: " . $$rhUserConf{LOGIN_PORT}."\n";
- - print FILE "use_MD5_passwords: " . $$rhUserConf{MD5_ENABLE}."\n";
- -}
- -
- -sub ApplyInterConf { my ($rhUserConf,$sCurfile) = @_;
- - open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
- -
- - print FILE "sql.db_hostname: " . $$rhUserConf{SQL_HOST}."\n";
- - print FILE "sql.db_port: " . $$rhUserConf{SQL_PORT}."\n";
- - print FILE "sql.db_username: " . $$rhUserConf{SQL_UID}."\n";
- - print FILE "sql.db_password: " . $$rhUserConf{SQL_PW}."\n";
- - print FILE "sql.db_database: " . $$rhUserConf{SQL_MAIN_DB}."\n\n";
- -
- - print FILE "char_server_ip: " . $$rhUserConf{SQL_HOST}."\n";
- - print FILE "char_server_port: " . $$rhUserConf{SQL_PORT}."\n";
- - print FILE "char_server_id: " . $$rhUserConf{SQL_UID}."\n";
- - print FILE "char_server_pw: " . $$rhUserConf{SQL_PW}."\n";
- - print FILE "char_server_db: " . $$rhUserConf{SQL_MAIN_DB}."\n\n";
- -
- - print FILE "sql.map_server_ip: " . $$rhUserConf{SQL_HOST}."\n";
- - print FILE "sql.map_server_port: " . $$rhUserConf{SQL_PORT}."\n";
- - print FILE "map_server_id: " . $$rhUserConf{SQL_UID}."\n";
- - print FILE "map_server_pw: " . $$rhUserConf{SQL_PW}."\n";
- - print FILE "map_server_db: " . $$rhUserConf{SQL_MAIN_DB}."\n\n";
- -
- - #todo may we want 2 schema ??
- - print FILE "log_db_ip: " . $$rhUserConf{SQL_HOST} ."\n";
- - print FILE "log_db_port: " . $$rhUserConf{SQL_PORT}."\n";
- - print FILE "log_db_id: " . $$rhUserConf{SQL_UID}."\n";
- - print FILE "log_db_pw: " . $$rhUserConf{SQL_PW}."\n";
- - print FILE "log_db_db: " . $$rhUserConf{SQL_LOG_DB}."\n\n";
- -}
- -
- -sub AutoCheckConf { my ($rhConfig) = @_;
- - print "\n AutoCheckConf, \n you can use option --force=1 to bypass this \n";
- - foreach my $sKeys (keys %$rhConfig){
- - my $sVal = $$rhConfig{$sKeys};
- - if($sKeys =~ /PORT/) { #chek if valid port
- - if(($sVal<MIN_PORT) && ($sVal>MAX_PORT)) {
- - warn "Invalid port specified for $sKeys => $sVal, must be in [".MIN_PORT.":".MAX_PORT."]\n";
- - return 0;
- - }
- - elsif(!($sKeys =~ /SQL/) && CheckUsedPort($sVal)) { #skip SQL service
- - warn "Port:$sVal seem to be already in use by system \n";
- - return 0;
- - }
- - elsif(CheckDupPort($rhConfig,$sKeys)) {
- - warn "Port:$sVal seem to be already used by other key in config \n";
- - return 0;
- - }
- - }
- - elsif($sKeys =~ /IP|HOST/){ #chek if ip valid, can we reach it ? trough SYN ACK
- - my $p = Net::Ping->new("syn");
- - my $sTest = $p->ping($sVal);
- - $p->close();
- - unless($sTest) {
- - print "Invalide IP/Host, ping couldn't reach $sKeys => $sVal \n NB : ICMP may just be unallowed\n";
- - return 0;
- - }
- - }
- - }
- - return 1;
- -}
- -
- -sub CheckDupPort { my ($rhConfig,$sChkKeys) = @_;
- - my $sChkport = $$rhConfig{$sChkKeys};
- - foreach my $sKeys (keys %$rhConfig){
- - next if($sKeys eq $sChkKeys); #skip ourself
- - my $sVal = $$rhConfig{$sKeys};
- - return 1 if($sChkport eq $sVal);
- - }
- - return 0;
- -}
- -sub CheckUsedPort { my($sPort) = @_;
- - open PIPE,"netstat -nat |" or die $!;
- - my @line = grep { /$sPort/ } <PIPE>;
- - return scalar(@line);
- -}
- -
- -#Db function
- -sub ApplySetupDB { my($rhConfig) = @_;
- - my $sDbH; #db handle
- - my $sHost = $$rhConfig{SQL_HOST};
- - my $sPort = $$rhConfig{SQL_PORT};
- - my $sDsn = "dbi:mysql::$sHost:$sPort"; #don't try to auto connect to db
- - $$rhConfig{"Dsn"} = $sDsn;
- -
- - $sDbH = RootCo($rhConfig);
- - CreateDB($sDbH,$rhConfig); #create db if not exist
- - $sDbH = CreateUser($sDbH,$rhConfig); #loged as user now
- - LoadSqlFile($sDbH,$rhConfig); #Load .sql file into db
- - CreateServUser($sDbH,$rhConfig);
- - print "SetupDb done \n";
- -}
- -
- -sub RootCo { my($rhConfig) = @_;
- - print "\n Entering RootCo \n";
- - my $sDbH;
- - my $sDsn = $$rhConfig{"Dsn"}; #mysql server dest
- - my $sUser = $$rhConfig{SQL_UID}; #verify desired user
- - print "My dsn = $sDsn \n";
- - if($sUser eq "root"){
- - my $sPw = $$rhConfig{SQL_PW};
- - $sDbH = DBI->connect($sDsn, "root", $sPw);
- - unless($sDbH) { warn "Your root password doesn't seem valid for mysql, your desired-conf is wrong \n"; }
- - }
- - while($sDbH == 0) { #if can't use user to connect user root
- - print "Please inser DB root passeword (this won't be saved in any configuration file, needed to create dbs and user)\n";
- - my $sRPw = <>; chop($sRPw);
- - $sDbH = DBI->connect($sDsn, "root", $sRPw);
- - }
- -
- - return $sDbH;
- -}
- -
- -sub CreateDB { my($sDbH,$rhConfig) = @_;
- - print "\n Entering CreateDB \n";
- - my $sDBn = $$rhConfig{SQL_MAIN_DB};
- - my $sLogDBn = $$rhConfig{SQL_LOG_DB};
- - my @aQuery = ("create database IF NOT EXISTS $sDBn;","create database IF NOT EXISTS $sLogDBn;");
- - if($sClean){ #deleting database if clean
- - unshift(@aQuery,"drop database IF EXISTS $sDBn;");
- - unshift(@aQuery,"drop database IF EXISTS $sLogDBn;");
- - }
- - else {
- - my $sRes = $sDbH->selectcol_arrayref('show databases');
- - foreach my $db (@$sRes){ #relevant later for import
- - if($db eq "$sDBn") { ValidateDBMerge($db); } #may exit here
- - elsif ($db eq "$sLogDBn") { ValidateDBMerge($db); } #may exit here
- - }
- - }
- - ExeQuery($sDbH,@aQuery);
- -}
- -
- -sub ValidateDBMerge { my($sDBn) = @_;
- - warn "Database: '$sDBn' seem to already exist exiting\n";
- - warn "Continue will load data in existing db would you like to continue ? [y/n] \n";
- - if(GetValidAnwser("y|o|n") =~ /n/i) {
- - print "Exiting setup, please either setup with another dbname or manually\n";
- - exit;
- - }
- -}
- -
- -sub CreateUser { my($sDbH,$rhConfig) = @_;
- - print "\n Entering CreateUser \n";
- - my $sDsn = $$rhConfig{"Dsn"};
- - print "My dsn = $sDsn \n";
- - my $sHost = $$rhConfig{SQL_HOST};
- - my $sPw = $$rhConfig{SQL_PW};
- - my $sUser = $$rhConfig{SQL_UID};
- - my $sDBn = $$rhConfig{SQL_MAIN_DB};
- - my $sLogDBn = $$rhConfig{SQL_LOG_DB};
- -
- - my @aQuery= ("GRANT ALL PRIVILEGES ON $sDBn.* TO $sUser\@'$sHost' IDENTIFIED BY '$sPw' WITH GRANT OPTION", #maindb
- - "GRANT ALL PRIVILEGES ON $sLogDBn.* TO $sUser\@'$sHost' IDENTIFIED BY '$sPw' WITH GRANT OPTION"); #logdb
- - my $sUserDbh = DBI->connect($sDsn, $sUser, $sPw, {"PrintError" => 0}); #try connect with user
- -
- - if($sUserDbh && !$sClean) {
- - print "User : $sUser seem to already exist, skipping creation\n"
- - ."NB please check if you have correct privilege set for db: $sDBn \n";
- - }
- - else { #create user only if not exist (or mode clean)
- - if($sClean && $sUser ne "root"){ unshift(@aQuery,"DELETE FROM mysql.user WHERE User = '$sUser';"); }
- - print "Creating user $sUser for dbs : $sDBn and $sLogDBn on $sHost \n";
- - ExeQuery($sDbH,@aQuery);
- - $sUserDbh = DBI->connect($sDsn, $sUser, $sPw);
- - }
- - return $sUserDbh; #drop old co and connect with user now
- -}
- -
- -sub LoadSqlFile { my($sDbH,$rhConfig) = @_;
- - print "\n Entering LoadSqlFile \n";
- - my $sDBn = $$rhConfig{SQL_MAIN_DB};
- - my $sLogDBn = $$rhConfig{SQL_LOG_DB};
- -
- - my $sSqldir = "sql-files";
- - my @aMainFiles = ("main.sql"); #add other file to load for main db here
- - my @aLogFiles = ("logs.sql"); #add other file to load for log db here
- -
- - die "$sSqldir doesn't seem to exist or coudldn't be read" unless(-d -r "../$sSqldir");
- - chdir "../$sSqldir";
- - print "Checking if target files exist :\n\tMain: [@aMainFiles]\n\tLog: [@aLogFiles]\n";
- -
- - CheckAndLoad(\@aMainFiles,$rhConfig,$sDBn);
- - CheckAndLoad(\@aLogFiles,$rhConfig,$sLogDBn);
- -
- -# my $raMainQuerys = CheckAndAddQuery(\@aMainFiles,$rhConfig);
- -# my $raLogQuerys = CheckAndAddQuery(\@aLogFiles,$rhConfig);
- -# ExeQuery($sDbH,"use $sDBn;",@$raMainQuerys,"use $sLogDBn;", @$raLogQuerys);
- -}
- -
- -sub CheckAndLoad { my ($raFiles,$rhConfig,$sDBn) = @_;
- - my $sHost = $$rhConfig{SQL_HOST};
- - my $sPw = $$rhConfig{SQL_PW};
- - my $sUser = $$rhConfig{SQL_UID};
- -
- - foreach(@$raFiles) {
- - unless(-f -r $_){
- - print "File : $_ doesn't seem to exist or was unreadable skipped\n";
- - next;
- - }
- - my $sFileFullPath = Cwd::abs_path($_);
- - system("mysql -u $sUser --password=$sPw -h $sHost $sDBn < $sFileFullPath");
- - }
- -}
- -
- -# query failure atm (shitty perl)
- -#sub CheckAndAddQuery { my ($raFiles) = @_;
- -# my @aQuery = ();
- -# foreach(@$raFiles) {
- -# unless(-f -r $_){
- -# print "File : $_ doesn't seem to exist or was unreadable skipped\n";
- -# next;
- -# }
- -# my $sFileFullPath = Cwd::abs_path($_);
- -# my $sInfileQuery = "source $sFileFullPath";
- -# #my $sInfileQuery = "\\. $sFileFullPath;";
- -# push(@aQuery,$sInfileQuery);
- -#
- -# }
- -# return \@aQuery;
- -#}
- -
- -sub CreateServUser { my($sDbH,$rhConfig) = @_;
- - my $sUid = $$rhConfig{SERV_UID};
- - my $sUpw = $$rhConfig{SERV_PW};
- - my $sMD5 = $$rhConfig{MD5_ENABLE};
- - my $sDBn = $$rhConfig{SQL_MAIN_DB};
- - my @aQuery = ("use $sDBn;","DELETE FROM login WHERE sex='S';");
- - if($sMD5){ push(@aQuery,"INSERT INTO login(account_id, userid, user_pass, sex) values(1,'$sUid',MD5('$sUpw'),'S');"); }
- - else { push(@aQuery,"INSERT INTO login(account_id, userid, user_pass, sex) values(1,'$sUid','$sUpw','S');"); }
- - ExeQuery($sDbH,@aQuery);
- -}
- -
- -sub ExeQuery { my $sDbH = shift;
- - my @aQuery = @_;
- - print "my querys are = [ @aQuery ]\n";
- - foreach(@aQuery) {
- - unless($sDbH->do($_)){ print "Failed to execute query : $_ => $DBI::errstr \n"; }
- - }
- -}
- -
- -#Common
- -sub GetValidateConf { my($rhConfig) = @_;
- - my $rhUserConf;
- - while (1) {
- - $rhUserConf = GetUserConf($rhConfig);
- - print "\n Please Check desired conf \n";
- - ShowConfig($rhUserConf);
- - print "Would you like to apply those setting ? [y/n] ";
- - last if(GetValidAnwser("y|o|n") =~ /y|o/i);
- - print "\n Restarting configuration sequence \n";
- - }
- - return $rhUserConf;
- -}
- -
- -sub GetUserConf { my ($rhDefConf) = @_;
- - my %hConf;
- - my @sortedkeys = sort keys (%$rhDefConf);
- - foreach my $sKey (@sortedkeys){
- - my $sVal = $$rhDefConf{$sKey};
- - print "$sKey : [$sVal] ";
- - my $sAnwser = <>; chop($sAnwser);
- - $hConf{"$sKey"} = $sAnwser || $sVal;
- - }
- - return \%hConf;
- -}
- -
- -sub ShowConfig { my ($rhUserConf) = @_;
- - my @sortedkeys = sort keys (%$rhUserConf);
- - foreach my $sKey (@sortedkeys){
- - my $sVal = $$rhUserConf{$sKey};
- - if(ref($sVal) eq 'ARRAY') { print " $sKey => [@$sVal] \n";}
- - else { print " $sKey => [$sVal] \n"; }
- - }
- -}
- -
- -sub GetValidAnwser { my($sOptReg) = @_;
- - my $sAnwser = "";
- - if($sAutoyes) { $sAnwser="y"; print "\n"; }
- - else {
- - while(!($sAnwser =~ /$sOptReg/i)) {
- - $sAnwser = <>; chop($sAnwser);
- - print "Please enter a valid option : $sOptReg " unless($sAnwser =~ /$sOptReg/i);
- - }
- - }
- - return $sAnwser;
- -}
- -
- -sub GetDesiredConf { my ($rhDefConf) = @_;
- - print "Please enter desired confiration\n";
- - my $rhUserConf;
- - my $sDesdConfFile = $sDsdFile;
- - #if default search in conf otherwise get specified name with cwd
- - if($sDsdFile eq DESD_CONF_FILE) { $sDesdConfFile = "../conf/".$sDsdFile; }
- -
- - print "Checking if there an Desiredconf file \n";
- - if(-e -r $sDesdConfFile) {
- - print "Found Desiredconf \n";
- - $rhUserConf = YAML::XS::LoadFile($sDesdConfFile);
- - if(!($rhUserConf)){
- - print "Desiredconf seem invalid or empty, please check file and relaunch setup or entry Config\n";
- - $rhUserConf=GetValidateConf($rhDefConf);
- - }
- - else {
- - ShowConfig($rhUserConf);
- - print "Would you like to apply those setting ? [y/n] ";
- - if(GetValidAnwser("y|o|n") =~ /n/i) { #no take user entry
- - print "DesiredConf not applyed, please enter config\n";
- - $rhUserConf=GetValidateConf($rhDefConf);
- - }
- - }
- - }
- - else { #no files take user entry
- - print "No Desiredconf found, please enter config \n";
- - $rhUserConf=GetValidateConf($rhDefConf);
- - }
- - return $rhUserConf;
- -}
- Index: db/const.txt
- --- db/const.txt Base (BASE)
- +++ db/const.txt Locally Modified (Based On LOCAL)
- @@ -350,7 +350,7 @@
- mf_noreturn 33
- mf_nowarpto 34
- mf_nightmaredrop 35
- -mf_restricted 36
- +mf_zone 36
- mf_nocommand 37
- mf_nodrop 38
- mf_jexp 39
- Index: db/pre-re/item_noequip.txt
- --- db/pre-re/item_noequip.txt Base (BASE)
- +++ db/pre-re/item_noequip.txt Locally Deleted
- @@ -1,60 +0,0 @@
- -// The equipment/items/cards restriction file
- -// here you define which items may not be used at PvP / GvG
- -// format: <item id>,<mode>
- -// mode
- -// 1 - restricted in normal maps
- -// 2 - restricted in PVP
- -// 4 - restricted in GVG
- -// 8 - restricted in Battlegrounds
- -// Restricted zones - they're configured by 'restricted <number>' mapflag
- -// 32 - restricted in zone 1
- -// 64 - restricted in zone 2
- -// 128 - restricted in zone 3
- -// 256 - restricted in zone 4
- -// 512 - restricted in zone 5
- -// 1024 - restricted in zone 6
- -// 2048 - restricted in zone 7
- -
- -//Examples:
- -//1201,1 you can't use KNIFE(ID 1201) on normal maps
- -//608,4 you can't use Yggdrasil Seed(ID 608) on both GvG and WoE Castles
- -//4174,6 Forbid Deviling Card in every PVP or GVG map, and during woes.
- -//501,32 you can't use Red Potion on map marked as 'restricted zone 1'
- -//502,64 you can't use Orange Potion on map marked as 'restricted zone 2'
- -//503,128 you can't use Yellow Potion on map marked as 'restricted zone 3'
- -// you can even mix modes
- -//519,322 (256+64+2) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4'
- -
- -//PVP
- -14529,2 //Greed Scroll
- -
- -//GVG
- -12218,4 //LV5 Assumptio Scroll
- -14529,4 //Greed Scroll
- -14590,4 //Party Assumptio 5 Scroll
- -
- -//BATTLEGROUND
- -12218,8 //LV5 Assumptio Scroll
- -14590,8 //Party Assumptio 5 Scroll
- -
- -
- -//Zone 1 - Aldebaran Turbo Track
- -601,32 //Fly Wing
- -605,32 //Anodyne
- -506,32 //Green Potion
- -525,32 //Panacea
- -
- -//Zone 2 - Jail
- -601,64 //Fly Wing - not really needed here but ...
- -602,64 //Butterfly Wing - also not needed
- -12212,64 //Giant Fly Wing
- -14582,64
- -14583,64
- -14584,64
- -14585,64
- -
- -//Zone 3 - Izlude Battle Arena
- -601,128 //Fly Wing
- -
- -//Zone 7 - Towns
- -14529,2048 //Greed Scroll
- Index: db/pre-re/map_zone_db.conf
- --- db/pre-re/map_zone_db.conf No Base Revision
- +++ db/pre-re/map_zone_db.conf Locally New
- @@ -0,0 +1,288 @@
- +//= rAthena Map Zone Database
- +//== by [Ind/Hercules]
- +//= A unlimited number of zones may be created, a zone
- +//= may be used to create a set of disabled items, disabled skills
- +//= and mapflags to be used by as many maps as one chooses,
- +//= maps can be linked to a specific zone through the zone mapflag
- +//= '<map name><tab>mapflag<tab>zone<tab><zone name>'
- +//== available types for 'disabled_skills':
- +//= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE
- +zones: (
- +{
- + /* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */
- + /* However, it wont be applied to maps with its own zones (specified thru mapflag) */
- + name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + WM_LULLABY_DEEPSLEEP: "PLAYER"
- + WM_SIRCLEOFNATURE: "PLAYER"
- + WM_SATURDAY_NIGHT_FEVER: "PLAYER"
- + SO_ARRULLO: "PLAYER"
- + CG_HERMODE: "PLAYER"
- + }
- +
- + disabled_items: {
- +
- + }
- + mapflags: ( )
- +},
- +{
- + /* PvP zone is applied to all maps with a pvp mapflag */
- + name: "PvP" /* changing this name requires MAP_ZONE_PVP_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + BS_GREED: "PLAYER"
- + CG_HERMODE: "PLAYER"
- + }
- +
- + disabled_items: {
- + Greed_Scroll: true
- + }
- +},
- +{
- + /* PK Mode zone is only used when server is on pk_mode (battle.conf),
- + it applies to all pvp maps that don't have their own zone */
- + name: "PK Mode" /* changing this name requires MAP_ZONE_PK_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- +
- + }
- +
- + disabled_items: {
- +
- + }
- +
- + /* PK Mode Damage Reductions */
- + /* - weapon_damage_rate -40% */
- + /* - magic_damage_rate -40% */
- + /* - misc_damage_rate -40% */
- + /* - long_damage_rate -30% */
- + /* - short_damage_rate -20% */
- + mapflags: (
- + "weapon_damage_rate 60",
- + "magic_damage_rate 60",
- + "misc_damage_rate 60",
- + "long_damage_rate 70",
- + "short_damage_rate 80" )
- +},
- +{
- + /* GvG zone is applied to all maps with a pvp mapflag */
- + name: "GvG" /* changing this name requires MAP_ZONE_GVG_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + AL_TELEPORT: "PLAYER"
- + AL_WARP: "PLAYER"
- + WZ_ICEWALL: "PLAYER"
- + TF_BACKSLIDING: "PLAYER"
- + RG_INTIMIDATE: "PLAYER"
- + WE_CALLPARTNER: "PLAYER"
- + HP_ASSUMPTIO: "PLAYER"
- + HP_BASILICA: "PLAYER"
- + CG_MOONLIT: "PLAYER"
- + WE_CALLPARENT: "PLAYER"
- + WE_CALLBABY: "PLAYER"
- + CR_CULTIVATION: "PLAYER"
- + NJ_KIRIKAGE: "PLAYER"
- + CASH_ASSUMPTIO: "PLAYER"
- + BS_GREED: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +
- + disabled_items: {
- + Assumptio_5_Scroll: true
- + Greed_Scroll: true
- + Pty_Assumptio_Scroll: true
- + }
- + /* 5 second duration increase on GvG */
- + /* knockback disabled */
- + /* GvG Mode Damage Reductions */
- + /* - weapon_damage_rate -40% */
- + /* - magic_damage_rate -40% */
- + /* - misc_damage_rate -40% */
- + /* - long_damage_rate -20% */
- + /* - short_damage_rate -20% */
- + mapflags: ( "invincible_time_inc 5000",
- + "noknockback",
- + "weapon_damage_rate 60",
- + "magic_damage_rate 60",
- + "misc_damage_rate 60",
- + "long_damage_rate 80",
- + "short_damage_rate 80" )
- +
- +},
- +{
- + /* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */
- + name: "Battlegrounds" /* changing this name requires MAP_ZONE_BG_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + AL_TELEPORT: "PLAYER"
- + AL_WARP: "PLAYER"
- + WZ_ICEWALL: "PLAYER"
- + TF_BACKSLIDING: "PLAYER"
- + RG_INTIMIDATE: "PLAYER"
- + MO_BODYRELOCATION: "PLAYER"
- + WE_CALLPARTNER: "PLAYER"
- + HP_ASSUMPTIO: "PLAYER"
- + HP_BASILICA: "PLAYER"
- + CG_MOONLIT: "PLAYER"
- + WE_CALLPARENT: "PLAYER"
- + WE_CALLBABY: "PLAYER"
- + CR_CULTIVATION: "PLAYER"
- + TK_RUN: "PLAYER"
- + TK_HIGHJUMP: "PLAYER"
- + SG_FEEL: "PLAYER"
- + SG_SUN_WARM: "PLAYER"
- + SG_MOON_WARM: "PLAYER"
- + SG_STAR_WARM: "PLAYER"
- + SG_SUN_COMFORT: "PLAYER"
- + SG_MOON_COMFORT: "PLAYER"
- + SG_STAR_COMFORT: "PLAYER"
- + SG_HATE: "PLAYER"
- + SG_SUN_ANGER: "PLAYER"
- + SG_MOON_ANGER: "PLAYER"
- + SG_STAR_ANGER: "PLAYER"
- + SG_SUN_BLESS: "PLAYER"
- + SG_MOON_BLESS: "PLAYER"
- + SG_STAR_BLESS: "PLAYER"
- + NJ_KIRIKAGE: "PLAYER"
- + CASH_ASSUMPTIO: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- + disabled_items: {
- + Assumptio_5_Scroll: true
- + Pty_Assumptio_Scroll: true
- + }
- +
- + /* knockback disabled */
- + /* Battlegrounds Damage Reductions */
- + /* - weapon_damage_rate -30% */
- + /* - magic_damage_rate -30% */
- + /* - misc_damage_rate -30% */
- + /* - long_damage_rate -25% */
- + /* - short_damage_rate -25% */
- + mapflags: ( "noknockback",
- + "weapon_damage_rate 70",
- + "magic_damage_rate 70",
- + "misc_damage_rate 70",
- + "long_damage_rate 75",
- + "short_damage_rate 75" )
- +
- +},
- +{
- + name: "Aldebaran Turbo Track"
- +
- + disabled_skills: {
- + SM_ENDURE: "PLAYER"
- + AL_TELEPORT: "PLAYER"
- + AL_WARP: "PLAYER"
- + AL_CURE: "PLAYER"
- + TF_HIDING: "PLAYER"
- + WZ_ICEWALL: "PLAYER"
- + AS_CLOAKING: "PLAYER"
- + RG_INTIMIDATE: "PLAYER"
- + MO_BODYRELOCATION: "PLAYER"
- + LK_CONCENTRATION: "PLAYER"
- + LK_BERSERK: "PLAYER"
- + HP_BASILICA: "PLAYER"
- + WS_CARTBOOST: "PLAYER"
- + ST_CHASEWALK: "PLAYER"
- + CG_MOONLIT: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + GN_CARTBOOST: "PLAYER"
- + }
- +
- + disabled_items: {
- + Wing_Of_Fly: true
- + Anodyne: true
- + Green_Potion: true
- + Panacea: true
- + }
- +},
- +{
- + name: "Jail"
- +
- + disabled_skills: {
- + TK_JUMPKICK: "PLAYER"
- + TK_HIGHJUMP: "PLAYER"
- + }
- +
- + disabled_items: {
- + Wing_Of_Fly: true
- + Wing_Of_Butterfly: true
- + Giant_Fly_Wing: true
- + WOB_Rune: true
- + WOB_Schwaltz: true
- + WOB_Rachel: true
- + WOB_Local: true
- + }
- +},
- +{
- + name: "Izlude Battle Arena"
- +
- + disabled_skills: {
- + RG_INTIMIDATE: "PLAYER"
- + AL_TELEPORT: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +
- + disabled_items: {
- + Wing_Of_Fly: true
- + }
- +},
- +{
- + name: "GvG2"
- + inherit: ( "GvG" ) /* will import all gvg has */
- +
- + disabled_skills: {
- + TK_HIGHJUMP: "PLAYER"
- + SA_ABRACADABRA: "PLAYER"
- + }
- +},
- +{
- + name: "Sealed Shrine"
- +
- + disabled_skills: {
- + MG_SAFETYWALL: "PLAYER"
- + AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
- + RG_INTIMIDATE: "PLAYER | MONSTER"
- + HP_ASSUMPTIO: "PLAYER"
- + CASH_ASSUMPTIO: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +},
- +{
- + name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */
- +
- + disabled_skills: {
- + AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
- + WZ_ICEWALL: "PLAYER"
- + RG_INTIMIDATE: "PLAYER | MONSTER"
- + PF_SPIDERWEB: "PLAYER"
- + NPC_EXPULSION: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +},
- +{
- + name: "Towns"
- +
- + disabled_skills: {
- + AM_CANNIBALIZE: "PLAYER"
- + AM_SPHEREMINE: "PLAYER"
- + CR_CULTIVATION: "PLAYER"
- + BS_GREED: "PLAYER"
- + SC_MANHOLE: "PLAYER"
- + WM_POEMOFNETHERWORLD: "PLAYER"
- + GN_WALLOFTHORN: "PLAYER"
- + }
- +
- + disabled_items: {
- + Greed_Scroll: true
- + }
- +}
- +)
- \ No newline at end of file
- Index: db/pre-re/skill_db.txt
- --- db/pre-re/skill_db.txt Base (BASE)
- +++ db/pre-re/skill_db.txt Locally Modified (Based On LOCAL)
- @@ -38,6 +38,7 @@
- // 0x1000- disable usage on enemies (for non-offensive skills).
- // 0x2000- skill ignores land protector (e.g. arrow shower)
- // 0x4000- chorus skill
- +// 0x8000- skill wont be passed to clones
- // 13 maxcount: max amount of skill instances to place on the ground when
- // player_land_skill_limit/monster_land_skill_limit is enabled. For skills
- // that attack using a path, this is the path length to be used.
- @@ -735,7 +736,6 @@
- 2231,0,6,4,0,0x1,0,1,1,yes,0,0,0,magic,0, WL_READING_SB,Reading Spellbook
- 2232,0,0,0,0,0,0,5,0,no,0,0,0,none,0, WL_FREEZE_SP,Freeze Spell
- -
- //****
- // GC Guillotine Cross
- //****
- Index: db/pre-re/skill_nocast_db.txt
- --- db/pre-re/skill_nocast_db.txt Base (BASE)
- +++ db/pre-re/skill_nocast_db.txt Locally Deleted
- @@ -1,154 +0,0 @@
- -// Forbidden Skills Database
- -//
- -// Structure of Database:
- -// SkillID,Flag
- -//
- -// Legend for 'Flag' field (bitmask):
- -// 1 = Cannot be used in normal maps
- -// 2 = Cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
- -// 4 = Cannot be used in GvG maps
- -// 8 = Cannot be used in Battleground maps
- -// 16 = Cannot be cloned (clones will not copy this skill)
- -// Restricted zones - they're configured by 'restricted <number>' mapflag
- -// 32 = Cannot be used in zone 1 maps
- -// 64 = Cannot be used in zone 2 maps
- -// 128 = Cannot be used in zone 3 maps
- -// 256 = Cannot be used in zone 4 maps
- -// 512 = Cannot be used in zone 5 maps
- -// 1024 = Cannot be used in zone 6 maps
- -// 2048 = Cannot be used in zone 7 maps
- -//
- -// Example:
- -// 8,6 = Endure cannot be used in PvP and GvG maps (2+4)
- -
- -//Normal
- -2422,1 //WM_LULLABY_DEEPSLEEP
- -2423,1 //WM_SIRCLEOFNATURE
- -2430,1 //WM_SATURDAY_NIGHT_FEVER
- -2455,1 //SO_ARRULLO
- -
- -//PVP
- -1013,2 //BS_GREED
- -
- -//GVG
- -26,4 //AL_TELEPORT
- -27,4 //AL_WARP
- -87,4 //WZ_ICEWALL
- -150,4 //TF_BACKSLIDING
- -219,4 //RG_INTIMIDATE
- -336,4 //WE_CALLPARTNER
- -361,4 //HP_ASSUMPTIO
- -362,4 //HP_BASILICA
- -395,4 //CG_MOONLIT
- -409,4 //WE_CALLPARENT
- -410,4 //WE_CALLBABY
- -491,4 //CR_CULTIVATION
- -530,4 //NJ_KIRIKAGE
- -691,4 //CASH_ASSUMPTIO
- -1013,4 //BS_GREED
- -2284,4 //SC_FATALMENACE
- -2300,4 //SC_DIMENSIONDOOR
- -
- -//BATTLEGROUND
- -26,8 //AL_TELEPORT
- -27,8 //AL_WARP
- -87,8 //WZ_ICEWALL
- -150,8 //TF_BACKSLIDING
- -219,8 //RG_INTIMIDATE
- -264,8 //MO_BODYRELOCATION
- -336,8 //WE_CALLPARTNER
- -361,8 //HP_ASSUMPTIO
- -362,8 //HP_BASILICA
- -395,8 //CG_MOONLIT
- -409,8 //WE_CALLPARENT
- -410,8 //WE_CALLBABY
- -491,8 //CR_CULTIVATION
- -411,8 //TK_RUN
- -426,8 //TK_HIGHJUMP
- -427,8 //SG_FEEL
- -428,8 //SG_SUN_WARM
- -429,8 //SG_MOON_WARM
- -430,8 //SG_STAR_WARM
- -431,8 //SG_SUN_COMFORT
- -432,8 //SG_MOON_COMFORT
- -433,8 //SG_STAR_COMFORT
- -434,8 //SG_HATE
- -435,8 //SG_SUN_ANGER
- -436,8 //SG_MOON_ANGER
- -437,8 //SG_STAR_ANGER
- -438,8 //SG_SUN_BLESS
- -439,8 //SG_MOON_BLESS
- -440,8 //SG_STAR_BLESS
- -530,8 //NJ_KIRIKAGE
- -691,8 //CASH_ASSUMPITO
- -2284,8 //SC_FATALMENACE
- -2300,8 //SC_DIMENSIONDOOR
- -
- -//mixed
- -488,3 //CG_HERMODE
- -3013,3 //KO_KYOUGAKU
- -
- -//Clone Forbidden/pointless skills
- -77,16 //PR_TURNUNDEAD
- -79,16 //PR_MAGNUS
- -
- -//Zone 1 - Aldebaran Turbo Track
- -8,32 //SM_ENDURE
- -26,32 //AL_TELEPORT
- -27,32 //AL_WARP
- -35,32 //AL_CURE
- -51,32 //TF_HIDING
- -87,32 //WZ_ICEWALL
- -135,32 //AS_CLOAKING
- -219,32 //RG_INTIMIDATE
- -264,32 //MO_BODYRELOCATION
- -357,32 //LK_CONCENTRATION
- -359,32 //LK_BERSERK
- -362,32 //HP_BASILICA
- -387,32 //WS_CARTBOOST
- -389,32 //ST_CHASEWALK
- -395,32 //CG_MOONLIT
- -2284,32 //SC_FATALMENACE
- -2300,32 //SC_DIMENSIONDOOR
- -2478,32 //GN_CARTBOOST
- -
- -//Zone 2 - Jail
- -421,64 //TK_JUMPKICK
- -426,64 //TK_HIGHJUMP
- -
- -//Zone 3 - Izlude Battle Arena
- -219,128 //RG_INTIMIDATE
- -26,128 //AL_TELEPORT
- -2284,128 //SC_FATALMENACE
- -2300,128 //SC_DIMENSIONDOOR
- -
- -//Zone 4 - WoE:SE
- -426,256 //TK_HIGHJUMP
- -290,256 //SA_ABRACADABRA
- -
- -//Zone 5 - Sealed Shrine
- -12,512 //MG_SAFETYWALL
- -26,512 //AL_TELEPORT
- -219,512 //RG_INTIMIDATE
- -361,512 //HP_ASSUMPTIO
- -691,512 //CASH_ASSUMPTIO
- -2284,512 //SC_FATALMENACE
- -2300,512 //SC_DIMENSIONDOOR
- -
- -//Zone 6 - Endless Tower, Orc's Memory, Nidhoggur's Nest
- -26,1024 //AL_TELEPORT
- -87,1024 //WZ_ICEWALL
- -219,1024 //RG_INTIMIDATE
- -405,1024 //PF_SPIDERWEB
- -674,1024 //NPC_EXPULSION
- -2284,1024 //SC_FATALMENACE
- -2300,1024 //SC_DIMENSIONDOOR
- -
- -//Zone 7 - Towns
- -232,2048 //AM_CANNIBALIZE
- -233,2048 //AM_SPHEREMINE
- -491,2048 //CR_CULTIVATION
- -1013,2048 //BS_GREED
- -2299,2048 //SC_MANHOLE
- -2419,2048 //WM_POEMOFNETHERWORLD
- -2482,2048 //GN_WALLOFTHORN
- Index: db/re/item_noequip.txt
- --- db/re/item_noequip.txt Base (BASE)
- +++ db/re/item_noequip.txt Locally Deleted
- @@ -1,60 +0,0 @@
- -// The equipment/items/cards restriction file
- -// here you define which items may not be used at PvP / GvG
- -// format: <item id>,<mode>
- -// mode
- -// 1 - restricted in normal maps
- -// 2 - restricted in PVP
- -// 4 - restricted in GVG
- -// 8 - restricted in Battlegrounds
- -// Restricted zones - they're configured by 'restricted <number>' mapflag
- -// 32 - restricted in zone 1
- -// 64 - restricted in zone 2
- -// 128 - restricted in zone 3
- -// 256 - restricted in zone 4
- -// 512 - restricted in zone 5
- -// 1024 - restricted in zone 6
- -// 2048 - restricted in zone 7
- -
- -//Examples:
- -//1201,1 you can't use KNIFE(ID 1201) on normal maps
- -//608,4 you can't use Yggdrasil Seed(ID 608) on both GvG and WoE Castles
- -//4174,6 Forbid Deviling Card in every PVP or GVG map, and during woes.
- -//501,32 you can't use Red Potion on map marked as 'restricted zone 1'
- -//502,64 you can't use Orange Potion on map marked as 'restricted zone 2'
- -//503,128 you can't use Yellow Potion on map marked as 'restricted zone 3'
- -// you can even mix modes
- -//519,322 (256+64+2) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4'
- -
- -//PVP
- -14529,2 //Greed Scroll
- -
- -//GVG
- -12218,4 //LV5 Assumptio Scroll
- -14529,4 //Greed Scroll
- -14590,4 //Party Assumptio 5 Scroll
- -
- -//BATTLEGROUND
- -12218,8 //LV5 Assumptio Scroll
- -14590,8 //Party Assumptio 5 Scroll
- -
- -
- -//Zone 1 - Aldebaran Turbo Track
- -601,32 //Fly Wing
- -605,32 //Anodyne
- -506,32 //Green Potion
- -525,32 //Panacea
- -
- -//Zone 2 - Jail
- -601,64 //Fly Wing - not really needed here but ...
- -602,64 //Butterfly Wing - also not needed
- -12212,64 //Giant Fly Wing
- -14582,64
- -14583,64
- -14584,64
- -14585,64
- -
- -//Zone 3 - Izlude Battle Arena
- -601,128 //Fly Wing
- -
- -//Zone 7 - Towns
- -14529,2048 //Greed Scroll
- Index: db/re/map_zone_db.conf
- --- db/re/map_zone_db.conf No Base Revision
- +++ db/re/map_zone_db.conf Locally New
- @@ -0,0 +1,288 @@
- +//= rAthena Map Zone Database
- +//== by [Ind/Hercules]
- +//= A unlimited number of zones may be created, a zone
- +//= may be used to create a set of disabled items, disabled skills
- +//= and mapflags to be used by as many maps as one chooses,
- +//= maps can be linked to a specific zone through the zone mapflag
- +//= '<map name><tab>mapflag<tab>zone<tab><zone name>'
- +//== available types for 'disabled_skills':
- +//= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE
- +zones: (
- +{
- + /* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */
- + /* However, it wont be applied to maps with its own zones (specified thru mapflag) */
- + name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + WM_LULLABY_DEEPSLEEP: "PLAYER"
- + WM_SIRCLEOFNATURE: "PLAYER"
- + WM_SATURDAY_NIGHT_FEVER: "PLAYER"
- + SO_ARRULLO: "PLAYER"
- + CG_HERMODE: "PLAYER"
- + }
- +
- + disabled_items: {
- +
- + }
- + mapflags: ( )
- +},
- +{
- + /* PvP zone is applied to all maps with a pvp mapflag */
- + name: "PvP" /* changing this name requires MAP_ZONE_PVP_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + BS_GREED: "PLAYER"
- + CG_HERMODE: "PLAYER"
- + }
- +
- + disabled_items: {
- + Greed_Scroll: true
- + }
- +},
- +{
- + /* PK Mode zone is only used when server is on pk_mode (battle.conf),
- + it applies to all pvp maps that don't have their own zone */
- + name: "PK Mode" /* changing this name requires MAP_ZONE_PK_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- +
- + }
- +
- + disabled_items: {
- +
- + }
- +
- + /* PK Mode Damage Reductions */
- + /* - weapon_damage_rate -40% */
- + /* - magic_damage_rate -40% */
- + /* - misc_damage_rate -40% */
- + /* - long_damage_rate -30% */
- + /* - short_damage_rate -20% */
- + mapflags: (
- + "weapon_damage_rate 60",
- + "magic_damage_rate 60",
- + "misc_damage_rate 60",
- + "long_damage_rate 70",
- + "short_damage_rate 80" )
- +},
- +{
- + /* GvG zone is applied to all maps with a pvp mapflag */
- + name: "GvG" /* changing this name requires MAP_ZONE_GVG_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + AL_TELEPORT: "PLAYER"
- + AL_WARP: "PLAYER"
- + WZ_ICEWALL: "PLAYER"
- + TF_BACKSLIDING: "PLAYER"
- + RG_INTIMIDATE: "PLAYER"
- + WE_CALLPARTNER: "PLAYER"
- + HP_ASSUMPTIO: "PLAYER"
- + HP_BASILICA: "PLAYER"
- + CG_MOONLIT: "PLAYER"
- + WE_CALLPARENT: "PLAYER"
- + WE_CALLBABY: "PLAYER"
- + CR_CULTIVATION: "PLAYER"
- + NJ_KIRIKAGE: "PLAYER"
- + CASH_ASSUMPTIO: "PLAYER"
- + BS_GREED: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +
- + disabled_items: {
- + Assumptio_5_Scroll: true
- + Greed_Scroll: true
- + Pty_Assumptio_Scroll: true
- + }
- + /* 5 second duration increase on GvG */
- + /* knockback disabled */
- + /* GvG Mode Damage Reductions */
- + /* - weapon_damage_rate -40% */
- + /* - magic_damage_rate -40% */
- + /* - misc_damage_rate -40% */
- + /* - long_damage_rate -20% */
- + /* - short_damage_rate -20% */
- + mapflags: ( "invincible_time_inc 5000",
- + "noknockback",
- + "weapon_damage_rate 60",
- + "magic_damage_rate 60",
- + "misc_damage_rate 60",
- + "long_damage_rate 80",
- + "short_damage_rate 80" )
- +
- +},
- +{
- + /* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */
- + name: "Battlegrounds" /* changing this name requires MAP_ZONE_BG_NAME to also be changed in src/map/map.h file */
- +
- + disabled_skills: {
- + AL_TELEPORT: "PLAYER"
- + AL_WARP: "PLAYER"
- + WZ_ICEWALL: "PLAYER"
- + TF_BACKSLIDING: "PLAYER"
- + RG_INTIMIDATE: "PLAYER"
- + MO_BODYRELOCATION: "PLAYER"
- + WE_CALLPARTNER: "PLAYER"
- + HP_ASSUMPTIO: "PLAYER"
- + HP_BASILICA: "PLAYER"
- + CG_MOONLIT: "PLAYER"
- + WE_CALLPARENT: "PLAYER"
- + WE_CALLBABY: "PLAYER"
- + CR_CULTIVATION: "PLAYER"
- + TK_RUN: "PLAYER"
- + TK_HIGHJUMP: "PLAYER"
- + SG_FEEL: "PLAYER"
- + SG_SUN_WARM: "PLAYER"
- + SG_MOON_WARM: "PLAYER"
- + SG_STAR_WARM: "PLAYER"
- + SG_SUN_COMFORT: "PLAYER"
- + SG_MOON_COMFORT: "PLAYER"
- + SG_STAR_COMFORT: "PLAYER"
- + SG_HATE: "PLAYER"
- + SG_SUN_ANGER: "PLAYER"
- + SG_MOON_ANGER: "PLAYER"
- + SG_STAR_ANGER: "PLAYER"
- + SG_SUN_BLESS: "PLAYER"
- + SG_MOON_BLESS: "PLAYER"
- + SG_STAR_BLESS: "PLAYER"
- + NJ_KIRIKAGE: "PLAYER"
- + CASH_ASSUMPTIO: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- + disabled_items: {
- + Assumptio_5_Scroll: true
- + Pty_Assumptio_Scroll: true
- + }
- +
- + /* knockback disabled */
- + /* Battlegrounds Damage Reductions */
- + /* - weapon_damage_rate -30% */
- + /* - magic_damage_rate -30% */
- + /* - misc_damage_rate -30% */
- + /* - long_damage_rate -25% */
- + /* - short_damage_rate -25% */
- + mapflags: ( "noknockback",
- + "weapon_damage_rate 70",
- + "magic_damage_rate 70",
- + "misc_damage_rate 70",
- + "long_damage_rate 75",
- + "short_damage_rate 75" )
- +
- +},
- +{
- + name: "Aldebaran Turbo Track"
- +
- + disabled_skills: {
- + SM_ENDURE: "PLAYER"
- + AL_TELEPORT: "PLAYER"
- + AL_WARP: "PLAYER"
- + AL_CURE: "PLAYER"
- + TF_HIDING: "PLAYER"
- + WZ_ICEWALL: "PLAYER"
- + AS_CLOAKING: "PLAYER"
- + RG_INTIMIDATE: "PLAYER"
- + MO_BODYRELOCATION: "PLAYER"
- + LK_CONCENTRATION: "PLAYER"
- + LK_BERSERK: "PLAYER"
- + HP_BASILICA: "PLAYER"
- + WS_CARTBOOST: "PLAYER"
- + ST_CHASEWALK: "PLAYER"
- + CG_MOONLIT: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + GN_CARTBOOST: "PLAYER"
- + }
- +
- + disabled_items: {
- + Wing_Of_Fly: true
- + Anodyne: true
- + Green_Potion: true
- + Panacea: true
- + }
- +},
- +{
- + name: "Jail"
- +
- + disabled_skills: {
- + TK_JUMPKICK: "PLAYER"
- + TK_HIGHJUMP: "PLAYER"
- + }
- +
- + disabled_items: {
- + Wing_Of_Fly: true
- + Wing_Of_Butterfly: true
- + Giant_Fly_Wing: true
- + WOB_Rune: true
- + WOB_Schwaltz: true
- + WOB_Rachel: true
- + WOB_Local: true
- + }
- +},
- +{
- + name: "Izlude Battle Arena"
- +
- + disabled_skills: {
- + RG_INTIMIDATE: "PLAYER"
- + AL_TELEPORT: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +
- + disabled_items: {
- + Wing_Of_Fly: true
- + }
- +},
- +{
- + name: "GvG2"
- + inherit: ( "GvG" ) /* will import all gvg has */
- +
- + disabled_skills: {
- + TK_HIGHJUMP: "PLAYER"
- + SA_ABRACADABRA: "PLAYER"
- + }
- +},
- +{
- + name: "Sealed Shrine"
- +
- + disabled_skills: {
- + MG_SAFETYWALL: "PLAYER"
- + AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
- + RG_INTIMIDATE: "PLAYER | MONSTER"
- + HP_ASSUMPTIO: "PLAYER"
- + CASH_ASSUMPTIO: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +},
- +{
- + name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */
- +
- + disabled_skills: {
- + AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
- + WZ_ICEWALL: "PLAYER"
- + RG_INTIMIDATE: "PLAYER | MONSTER"
- + PF_SPIDERWEB: "PLAYER"
- + NPC_EXPULSION: "PLAYER"
- + SC_FATALMENACE: "PLAYER"
- + SC_DIMENSIONDOOR: "PLAYER"
- + }
- +},
- +{
- + name: "Towns"
- +
- + disabled_skills: {
- + AM_CANNIBALIZE: "PLAYER"
- + AM_SPHEREMINE: "PLAYER"
- + CR_CULTIVATION: "PLAYER"
- + BS_GREED: "PLAYER"
- + SC_MANHOLE: "PLAYER"
- + WM_POEMOFNETHERWORLD: "PLAYER"
- + GN_WALLOFTHORN: "PLAYER"
- + }
- +
- + disabled_items: {
- + Greed_Scroll: true
- + }
- +}
- +)
- \ No newline at end of file
- Index: db/re/skill_db.txt
- --- db/re/skill_db.txt Base (BASE)
- +++ db/re/skill_db.txt Locally Modified (Based On LOCAL)
- @@ -38,6 +38,7 @@
- // 0x1000- disable usage on enemies (for non-offensive skills).
- // 0x2000- skill ignores land protector (e.g. arrow shower)
- // 0x4000- chorus skill
- +// 0x8000- skill wont be passed to clones
- // 13 maxcount: max amount of skill instances to place on the ground when
- // player_land_skill_limit/monster_land_skill_limit is enabled. For skills
- // that attack using a path, this is the path length to be used.
- Index: db/re/skill_nocast_db.txt
- --- db/re/skill_nocast_db.txt Base (BASE)
- +++ db/re/skill_nocast_db.txt Locally Deleted
- @@ -1,154 +0,0 @@
- -// Forbidden Skills Database
- -//
- -// Structure of Database:
- -// SkillID,Flag
- -//
- -// Legend for 'Flag' field (bitmask):
- -// 1 = Cannot be used in normal maps
- -// 2 = Cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
- -// 4 = Cannot be used in GvG maps
- -// 8 = Cannot be used in Battleground maps
- -// 16 = Cannot be cloned (clones will not copy this skill)
- -// Restricted zones - they're configured by 'restricted <number>' mapflag
- -// 32 = Cannot be used in zone 1 maps
- -// 64 = Cannot be used in zone 2 maps
- -// 128 = Cannot be used in zone 3 maps
- -// 256 = Cannot be used in zone 4 maps
- -// 512 = Cannot be used in zone 5 maps
- -// 1024 = Cannot be used in zone 6 maps
- -// 2048 = Cannot be used in zone 7 maps
- -//
- -// Example:
- -// 8,6 = Endure cannot be used in PvP and GvG maps (2+4)
- -
- -//Normal
- -2422,1 //WM_LULLABY_DEEPSLEEP
- -2423,1 //WM_SIRCLEOFNATURE
- -2430,1 //WM_SATURDAY_NIGHT_FEVER
- -2455,1 //SO_ARRULLO
- -
- -//PVP
- -1013,2 //BS_GREED
- -
- -//GVG
- -26,4 //AL_TELEPORT
- -27,4 //AL_WARP
- -87,4 //WZ_ICEWALL
- -150,4 //TF_BACKSLIDING
- -219,4 //RG_INTIMIDATE
- -336,4 //WE_CALLPARTNER
- -361,4 //HP_ASSUMPTIO
- -362,4 //HP_BASILICA
- -395,4 //CG_MOONLIT
- -409,4 //WE_CALLPARENT
- -410,4 //WE_CALLBABY
- -491,4 //CR_CULTIVATION
- -530,4 //NJ_KIRIKAGE
- -691,4 //CASH_ASSUMPTIO
- -1013,4 //BS_GREED
- -2284,4 //SC_FATALMENACE
- -2300,4 //SC_DIMENSIONDOOR
- -
- -//BATTLEGROUND
- -26,8 //AL_TELEPORT
- -27,8 //AL_WARP
- -87,8 //WZ_ICEWALL
- -150,8 //TF_BACKSLIDING
- -219,8 //RG_INTIMIDATE
- -264,8 //MO_BODYRELOCATION
- -336,8 //WE_CALLPARTNER
- -361,8 //HP_ASSUMPTIO
- -362,8 //HP_BASILICA
- -395,8 //CG_MOONLIT
- -409,8 //WE_CALLPARENT
- -410,8 //WE_CALLBABY
- -491,8 //CR_CULTIVATION
- -411,8 //TK_RUN
- -426,8 //TK_HIGHJUMP
- -427,8 //SG_FEEL
- -428,8 //SG_SUN_WARM
- -429,8 //SG_MOON_WARM
- -430,8 //SG_STAR_WARM
- -431,8 //SG_SUN_COMFORT
- -432,8 //SG_MOON_COMFORT
- -433,8 //SG_STAR_COMFORT
- -434,8 //SG_HATE
- -435,8 //SG_SUN_ANGER
- -436,8 //SG_MOON_ANGER
- -437,8 //SG_STAR_ANGER
- -438,8 //SG_SUN_BLESS
- -439,8 //SG_MOON_BLESS
- -440,8 //SG_STAR_BLESS
- -530,8 //NJ_KIRIKAGE
- -691,8 //CASH_ASSUMPITO
- -2284,8 //SC_FATALMENACE
- -2300,8 //SC_DIMENSIONDOOR
- -
- -//mixed
- -488,3 //CG_HERMODE
- -3013,3 //KO_KYOUGAKU
- -
- -//Clone Forbidden/pointless skills
- -77,16 //PR_TURNUNDEAD
- -79,16 //PR_MAGNUS
- -
- -//Zone 1 - Aldebaran Turbo Track
- -8,32 //SM_ENDURE
- -26,32 //AL_TELEPORT
- -27,32 //AL_WARP
- -35,32 //AL_CURE
- -51,32 //TF_HIDING
- -87,32 //WZ_ICEWALL
- -135,32 //AS_CLOAKING
- -219,32 //RG_INTIMIDATE
- -264,32 //MO_BODYRELOCATION
- -357,32 //LK_CONCENTRATION
- -359,32 //LK_BERSERK
- -362,32 //HP_BASILICA
- -387,32 //WS_CARTBOOST
- -389,32 //ST_CHASEWALK
- -395,32 //CG_MOONLIT
- -2284,32 //SC_FATALMENACE
- -2300,32 //SC_DIMENSIONDOOR
- -2478,32 //GN_CARTBOOST
- -
- -//Zone 2 - Jail
- -421,64 //TK_JUMPKICK
- -426,64 //TK_HIGHJUMP
- -
- -//Zone 3 - Izlude Battle Arena
- -219,128 //RG_INTIMIDATE
- -26,128 //AL_TELEPORT
- -2284,128 //SC_FATALMENACE
- -2300,128 //SC_DIMENSIONDOOR
- -
- -//Zone 4 - WoE:SE
- -426,256 //TK_HIGHJUMP
- -290,256 //SA_ABRACADABRA
- -
- -//Zone 5 - Sealed Shrine
- -12,512 //MG_SAFETYWALL
- -26,512 //AL_TELEPORT
- -219,512 //RG_INTIMIDATE
- -361,512 //HP_ASSUMPTIO
- -691,512 //CASH_ASSUMPTIO
- -2284,512 //SC_FATALMENACE
- -2300,512 //SC_DIMENSIONDOOR
- -
- -//Zone 6 - Endless Tower, Orc's Memory, Nidhoggur's Nest
- -26,1024 //AL_TELEPORT
- -87,1024 //WZ_ICEWALL
- -219,1024 //RG_INTIMIDATE
- -405,1024 //PF_SPIDERWEB
- -674,1024 //NPC_EXPULSION
- -2284,1024 //SC_FATALMENACE
- -2300,1024 //SC_DIMENSIONDOOR
- -
- -//Zone 7 - Towns
- -232,2048 //AM_CANNIBALIZE
- -233,2048 //AM_SPHEREMINE
- -491,2048 //CR_CULTIVATION
- -1013,2048 //BS_GREED
- -2299,2048 //SC_MANHOLE
- -2419,2048 //WM_POEMOFNETHERWORLD
- -2482,2048 //GN_WALLOFTHORN
- Index: npc/scripts_mapflags.conf
- --- npc/scripts_mapflags.conf Base (BASE)
- +++ npc/scripts_mapflags.conf Locally Modified (Based On LOCAL)
- @@ -17,13 +17,15 @@
- npc: conf/mapflag/noskill.txt
- npc: conf/mapflag/nowarp.txt
- npc: conf/mapflag/nowarpto.txt
- -//npc: conf/mapflag/partylock.txt
- +npc: conf/mapflag/partylock.txt
- npc: conf/mapflag/pvp.txt
- npc: conf/mapflag/pvp_noparty.txt
- npc: conf/mapflag/pvp_noguild.txt
- npc: conf/mapflag/night.txt
- -npc: conf/mapflag/restricted.txt
- +npc: conf/mapflag/zone.txt
- npc: conf/mapflag/battleground.txt
- npc: conf/mapflag/novending.txt
- npc: conf/mapflag/town.txt
- npc: conf/mapflag/reset.txt
- +npc: conf/mapflag/skillmodifier.txt
- +npc: conf/mapflag/skillduration.txt
- \ No newline at end of file
- Index: src/char/char.c
- --- src/char/char.c Base (BASE)
- +++ src/char/char.c Locally Modified (Based On LOCAL)
- @@ -30,7 +30,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- -#define CHAR_MAX_MSG 200
- +#define CHAR_MAX_MSG 300
- static char* msg_table[CHAR_MAX_MSG]; // Login Server messages_conf
- char char_db[256] = "char";
- @@ -2724,10 +2724,8 @@
- return 0;
- }
- - while(RFIFOREST(fd) >= 2)
- - {
- - switch(RFIFOW(fd,0))
- - {
- + while(RFIFOREST(fd) >= 2){
- + switch(RFIFOW(fd,0)){
- case 0x2afa: // Receiving map names list from the map-server
- if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
- Index: src/common/ers.c
- --- src/common/ers.c Base (BASE)
- +++ src/common/ers.c Locally Modified (Based On LOCAL)
- @@ -278,8 +278,17 @@
- void ers_report(void)
- {
- - // FIXME: Someone use this? Is it really needed?
- + ers_cache_t *cache;
- + int i = 0;
- + for (cache = CacheList; cache; cache = cache->Next) {
- + ShowMessage(CL_BOLD"[Entry manager #%u report]\n"CL_NORMAL, ++i);
- + ShowMessage("\tinstances : %u\n", cache->ReferenceCount);
- + ShowMessage("\tblock array size : %u\n", cache->ObjectSize);
- + ShowMessage("\tallocated blocks : %u\n", cache->Free+cache->Used);
- + ShowMessage("\tentries being used : %u\n", cache->Used);
- + ShowMessage("\tunused entries : %u\n", cache->Free);
- }
- +}
- void ers_force_destroy_all(void)
- {
- Index: src/map/atcommand.c
- --- src/map/atcommand.c Base (BASE)
- +++ src/map/atcommand.c Locally Modified (Based On LOCAL)
- @@ -3725,7 +3725,8 @@
- * 0 = no additional information
- * 1 = Show users in that map and their location
- * 2 = Shows NPCs in that map
- - * 3 = Shows the shops/chats in that map (not implemented)
- + * 3 = Shows the chats in that map
- + TODO# add the missing mapflags e.g. adjust_skill_damage to display
- *------------------------------------------*/
- ACMD_FUNC(mapinfo)
- {
- @@ -3734,7 +3735,7 @@
- struct npc_data *nd = NULL;
- struct chat_data *cd = NULL;
- char direction[12];
- - int i, m_id, chat_num, list = 0;
- + int i, m_id, chat_num = 0, list = 0, vend_num = 0;
- unsigned short m_index;
- char mapname[24];
- @@ -3769,12 +3770,17 @@
- // count chats (for initial message)
- chat_num = 0;
- iter = mapit_getallusers();
- - for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
- - if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd )
- + for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) {
- + if( pl_sd->mapindex == m_index ) {
- + if( sd->state.vending )
- + vend_num++;
- + else if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd )
- chat_num++;
- + }
- + }
- mapit_free(iter);
- - sprintf(atcmd_output, msg_txt(1040), mapname, map[m_id].users, map[m_id].npc_num, chat_num); // Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d
- + sprintf(atcmd_output, msg_txt(1040), mapname, map[m_id].zone->name, map[m_id].users, map[m_id].npc_num, chat_num, vend_num); // Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
- clif_displaymessage(fd, atcmd_output);
- clif_displaymessage(fd, msg_txt(1041)); // ------ Map Flags ------
- if (map[m_id].flag.town)
- @@ -3862,11 +3868,6 @@
- strcat(atcmd_output, msg_txt(1077)); // Fireworks |
- if (map[m_id].flag.leaves)
- strcat(atcmd_output, msg_txt(1078)); // Leaves |
- - /**
- - * No longer available, keeping here just in case it's back someday. [Ind]
- - **/
- - //if (map[m_id].flag.rain)
- - // strcat(atcmd_output, msg_txt(1079)); // Rain |
- if (map[m_id].flag.nightenabled)
- strcat(atcmd_output, msg_txt(1080)); // Displays Night |
- clif_displaymessage(fd, atcmd_output);
- @@ -5621,7 +5622,7 @@
- struct map_session_data *pl_sd;
- nullpo_retr(-1, sd);
- - if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL || strcmp(g->master,sd->status.name)) {
- + if (sd->status.guild_id == 0 || (g = sd->guild) == NULL || strcmp(g->master,sd->status.name)) {
- clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
- return -1;
- }
- @@ -7585,7 +7586,7 @@
- checkflag(fog); checkflag(fireworks); checkflag(sakura); checkflag(leaves);
- checkflag(nogo); checkflag(nobaseexp);
- checkflag(nojobexp); checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled);
- - checkflag(restricted); checkflag(nodrop); checkflag(novending); checkflag(loadevent);
- + checkflag(nodrop); checkflag(novending); checkflag(loadevent);
- checkflag(nochat); checkflag(partylock); checkflag(guildlock); checkflag(src4instance);
- clif_displaymessage(sd->fd," ");
- clif_displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
- @@ -7604,7 +7605,7 @@
- setflag(fog); setflag(fireworks); setflag(sakura); setflag(leaves);
- setflag(nogo); setflag(nobaseexp);
- setflag(nojobexp); setflag(nomobloot); setflag(nomvploot); setflag(nightenabled);
- - setflag(restricted); setflag(nodrop); setflag(novending); setflag(loadevent);
- + setflag(nodrop); setflag(novending); setflag(loadevent);
- setflag(nochat); setflag(partylock); setflag(guildlock); setflag(src4instance);
- clif_displaymessage(sd->fd,msg_txt(1314)); // Invalid flag name or flag.
- @@ -7616,7 +7617,7 @@
- clif_displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,");
- clif_displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
- clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,");
- - clif_displaymessage(sd->fd,"nomvploot, nightenabled, restricted, nodrop, novending, loadevent, nochat, partylock,");
- + clif_displaymessage(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,");
- clif_displaymessage(sd->fd,"guildlock, src4instance");
- #undef checkflag
- Index: src/map/clif.c
- --- src/map/clif.c Base (BASE)
- +++ src/map/clif.c Locally Modified (Based On LOCAL)
- @@ -9032,14 +9032,6 @@
- WFIFOSET(fd, packet_len(0x7e6));
- }
- -
- -/// View player equip request denied
- -void clif_viewequip_fail(struct map_session_data* sd)
- -{
- - clif_msg(sd, 0x54d);
- -}
- -
- -
- /// Validates one global/guild/party/whisper message packet and tries to recognize its components.
- /// Returns true if the packet was parsed successfully.
- /// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00
- @@ -11055,7 +11047,7 @@
- if( sd->npc_id ){
- #ifdef RENEWAL
- - clif_msg(sd, 0x783); // TODO look for the client date that has this message.
- + clif_msg(sd, USAGE_FAIL); // TODO look for the client date that has this message.
- #endif
- return;
- }
- @@ -14766,7 +14758,7 @@
- if( tsd->status.show_equip || pc_has_permission(sd, PC_PERM_VIEW_EQUIPMENT) )
- clif_viewequip_ack(sd, tsd);
- else
- - clif_viewequip_fail(sd);
- + clif_msg(sd, VIEW_EQUIP_FAIL);
- }
- @@ -15124,9 +15116,8 @@
- /// 1 = Your mercenary soldier has been killed.
- /// 2 = Your mercenary soldier has been fired.
- /// 3 = Your mercenary soldier has ran away.
- -void clif_mercenary_message(struct map_session_data* sd, int message)
- -{
- - clif_msg(sd, 1266 + message);
- +void clif_mercenary_message(struct map_session_data* sd, int message){
- + clif_msg(sd, MERC_MSG_BASE + message);
- }
- Index: src/map/clif.h
- --- src/map/clif.h Base (BASE)
- +++ src/map/clif.h Locally Modified (Based On LOCAL)
- @@ -84,8 +84,7 @@
- BG_AREA_WOS,
- } send_target;
- -typedef enum emotion_type
- -{
- +typedef enum emotion_type {
- E_GASP = 0, // /!
- E_WHAT, // /?
- E_HO,
- @@ -315,6 +314,13 @@
- USESKILL_FAIL_THERE_ARE_NPC_AROUND = 83,
- };
- +enum clif_messages {
- + MERC_MSG_BASE = 1266, //0x4f2
- + SKILL_CANT_USE_AREA = 0x536,
- + VIEW_EQUIP_FAIL = 0x54d,
- + USAGE_FAIL = 0x783,
- +};
- +
- int clif_setip(const char* ip);
- void clif_setbindip(const char* ip);
- void clif_setport(uint16 port);
- @@ -632,7 +638,6 @@
- void clif_equiptickack(struct map_session_data* sd, int flag);
- void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd);
- -void clif_viewequip_fail(struct map_session_data* sd);
- void clif_equipcheckbox(struct map_session_data* sd);
- void clif_msg(struct map_session_data* sd, unsigned short id);
- Index: src/map/guild.c
- --- src/map/guild.c Base (BASE)
- +++ src/map/guild.c Locally Modified (Based On LOCAL)
- Index: src/map/itemdb.c
- --- src/map/itemdb.c Base (BASE)
- +++ src/map/itemdb.c Locally Modified (Based On LOCAL)
- @@ -586,27 +586,6 @@
- }
- /*==========================================
- - * Read item forbidden by mapflag (can't equip item)
- - *------------------------------------------*/
- -static bool itemdb_read_noequip(char* str[], int columns, int current)
- -{// <nameid>,<mode>
- - int nameid;
- - struct item_data *id;
- -
- - nameid = atoi(str[0]);
- -
- - if( ( id = itemdb_exists(nameid) ) == NULL )
- - {
- - ShowWarning("itemdb_read_noequip: Invalid item id %d.\n", nameid);
- - return false;
- - }
- -
- - id->flag.no_equip |= atoi(str[1]);
- -
- - return true;
- -}
- -
- -/*==========================================
- * Reads item trade restrictions [Skotlex]
- *------------------------------------------*/
- static bool itemdb_read_itemtrade(char* str[], int columns, int current)
- @@ -1310,7 +1289,6 @@
- itemdb_read_combos();
- itemdb_read_itemgroup();
- sv_readdb(db_path, "item_avail.txt", ',', 2, 2, -1, &itemdb_read_itemavail);
- - sv_readdb(db_path, DBPATH"item_noequip.txt", ',', 2, 2, -1, &itemdb_read_noequip);
- sv_readdb(db_path, DBPATH"item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade);
- sv_readdb(db_path, "item_delay.txt", ',', 2, 2, -1, &itemdb_read_itemdelay);
- sv_readdb(db_path, "item_stack.txt", ',', 3, 3, -1, &itemdb_read_stack);
- Index: src/map/itemdb.h
- --- src/map/itemdb.h Base (BASE)
- +++ src/map/itemdb.h Locally Modified (Based On LOCAL)
- @@ -124,7 +124,6 @@
- struct script_code *unequip_script;//Script executed once when unequipping.
- struct {
- unsigned available : 1;
- - short no_equip;
- unsigned no_refine : 1; // [celest]
- unsigned delay_consume : 1; // Signifies items that are not consumed immediately upon double-click [Skotlex]
- unsigned trade_restriction : 9; //Item restrictions mask [Skotlex]
- Index: src/map/map.c
- --- src/map/map.c Base (BASE)
- +++ src/map/map.c Locally Modified (Based On LOCAL)
- @@ -4,6 +4,7 @@
- #include "../common/cbasetypes.h"
- #include "../common/core.h"
- #include "../common/timer.h"
- +#include "../common/ers.h"
- #include "../common/grfio.h"
- #include "../common/malloc.h"
- #include "../common/socket.h" // WFIFO*()
- @@ -13,6 +14,7 @@
- #include "../common/strlib.h"
- #include "../common/utils.h"
- #include "../common/cli.h"
- +#include "../common/conf.h"
- #include "map.h"
- #include "path.h"
- @@ -1485,8 +1487,7 @@
- p = idb_ensure(nick_db, charid, create_charid2nick);
- safestrncpy(p->nick, nick, sizeof(p->nick));
- - while( p->requests )
- - {
- + while( p->requests ) {
- req = p->requests;
- p->requests = req->next;
- sd = map_charid2sd(req->charid);
- @@ -1508,8 +1509,7 @@
- if (!nick_db->remove(nick_db, db_i2key(charid), &data) || (p = db_data2ptr(&data)) == NULL)
- return;
- - while( p->requests )
- - {
- + while( p->requests ) {
- req = p->requests;
- p->requests = req->next;
- sd = map_charid2sd(req->charid);
- @@ -2660,8 +2660,7 @@
- return true;
- }
- -void map_iwall_get(struct map_session_data *sd)
- -{
- +void map_iwall_get(struct map_session_data *sd) {
- struct iwall_data *iwall;
- DBIterator* iter;
- int16 x1, y1;
- @@ -2671,13 +2670,11 @@
- return;
- iter = db_iterator(iwall_db);
- - for( iwall = dbi_first(iter); dbi_exists(iter); iwall = dbi_next(iter) )
- - {
- + for( iwall = dbi_first(iter); dbi_exists(iter); iwall = dbi_next(iter) ) {
- if( iwall->m != sd->bl.m )
- continue;
- - for( i = 0; i < iwall->size; i++ )
- - {
- + for( i = 0; i < iwall->size; i++ ) {
- map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
- clif_changemapcell(sd->fd, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), SELF);
- }
- @@ -2693,8 +2690,7 @@
- if( (iwall = (struct iwall_data *)strdb_get(iwall_db, wall_name)) == NULL )
- return; // Nothing to do
- - for( i = 0; i < iwall->size; i++ )
- - {
- + for( i = 0; i < iwall->size; i++ ) {
- map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
- map_setcell(iwall->m, x1, y1, CELL_SHOOTABLE, true);
- @@ -2908,27 +2904,139 @@
- }
- return 0;
- }
- +void map_zone_db_clear(void) {
- + struct map_zone_data *zone;
- + int i;
- + DBIterator *iter = db_iterator(zone_db);
- + for(zone = dbi_first(iter); dbi_exists(iter); zone = dbi_next(iter)) {
- + for(i = 0; i < zone->disabled_skills_count; i++) {
- + aFree(zone->disabled_skills[i]);
- + }
- + aFree(zone->disabled_skills);
- + aFree(zone->disabled_items);
- + for(i = 0; i < zone->mapflags_count; i++) {
- + aFree(zone->mapflags[i]);
- + }
- + aFree(zone->mapflags);
- + }
- + dbi_destroy(iter);
- +
- + db_destroy(zone_db);/* will aFree(zone) */
- +
- + /* clear the pk zone stuff */
- + for(i = 0; i < map_zone_pk.disabled_skills_count; i++) {
- + aFree(map_zone_pk.disabled_skills[i]);
- + }
- + aFree(map_zone_pk.disabled_skills);
- + aFree(map_zone_pk.disabled_items);
- + for(i = 0; i < map_zone_pk.mapflags_count; i++) {
- + aFree(map_zone_pk.mapflags[i]);
- + }
- + aFree(map_zone_pk.mapflags);
- + /* clear the main zone stuff */
- + for(i = 0; i < map_zone_all.disabled_skills_count; i++) {
- + aFree(map_zone_all.disabled_skills[i]);
- + }
- + aFree(map_zone_all.disabled_skills);
- + aFree(map_zone_all.disabled_items);
- + for(i = 0; i < map_zone_all.mapflags_count; i++) {
- + aFree(map_zone_all.mapflags[i]);
- + }
- + aFree(map_zone_all.mapflags);
- +}
- +
- +void do_final_maps(void) {
- + int i, v = 0;
- +
- + for( i = 0; i < map_num; i++ ) {
- +
- + if(map[i].cell) aFree(map[i].cell);
- + if(map[i].block) aFree(map[i].block);
- + if(map[i].block_mob) aFree(map[i].block_mob);
- +
- + if(battle_config.dynamic_mobs) { //Dynamic mobs flag by [random]
- + int j;
- + if(map[i].mob_delete_timer != INVALID_TIMER)
- + delete_timer(map[i].mob_delete_timer, map_removemobs_timer);
- + for (j=0; j<MAX_MOB_LIST_PER_MAP; j++)
- + if (map[i].moblist[j]) aFree(map[i].moblist[j]);
- + }
- +
- + if( map[i].unit_count ) {
- + for(v = 0; v < map[i].unit_count; v++) {
- + aFree(map[i].units[v]);
- + }
- + if( map[i].units ) {
- + aFree(map[i].units);
- + map[i].units = NULL;
- + }
- + map[i].unit_count = 0;
- + }
- +
- + if( map[i].skill_count ) {
- + for(v = 0; v < map[i].skill_count; v++) {
- + aFree(map[i].skills[v]);
- + }
- + if( map[i].skills ) {
- + aFree(map[i].skills);
- + map[i].skills = NULL;
- + }
- + map[i].skill_count = 0;
- + }
- + if( map[i].channel )
- + clif_chsys_delete(map[i].channel);
- + }
- +
- + map_zone_db_clear();
- +
- +}
- /// Initializes map flags and adjusts them depending on configuration.
- -void map_flags_init(void)
- -{
- - int i;
- +void map_flags_init(void) {
- + int i, v = 0;
- - for( i = 0; i < map_num; i++ )
- - {
- + for( i = 0; i < map_num; i++ ) {
- // mapflags
- memset(&map[i].flag, 0, sizeof(map[i].flag));
- // additional mapflag data
- - map[i].zone = 0; // restricted mapflag zone
- map[i].nocommand = 0; // nocommand mapflag level
- map[i].bexp = 100; // per map base exp multiplicator
- map[i].jexp = 100; // per map job exp multiplicator
- memset(map[i].drop_list, 0, sizeof(map[i].drop_list)); // pvp nightmare drop list
- + if( map[i].unit_count ) {
- + for(v = 0; v < map[i].unit_count; v++) {
- + aFree(map[i].units[v]);
- + }
- + aFree(map[i].units);
- + }
- + map[i].units = NULL;
- + map[i].unit_count = 0;
- +
- + if( map[i].skill_count ) {
- + for(v = 0; v < map[i].skill_count; v++) {
- + aFree(map[i].skills[v]);
- + }
- + aFree(map[i].skills);
- + }
- + map[i].skills = NULL;
- + map[i].skill_count = 0;
- +
- // adjustments
- - if( battle_config.pk_mode )
- + if( battle_config.pk_mode ) {
- map[i].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris]
- + map[i].zone = &map_zone_pk;
- + } else /* align with 'All' zone */
- + map[i].zone = &map_zone_all;
- +
- + map[i].invincible_time_inc = 0;
- +
- + map[i].weapon_damage_rate = 100;
- + map[i].magic_damage_rate = 100;
- + map[i].misc_damage_rate = 100;
- + map[i].short_damage_rate = 100;
- + map[i].long_damage_rate = 100;
- }
- }
- @@ -3184,6 +3292,8 @@
- runflag = 0;
- }
- }
- + else if( strcmpi("ers_report", type) == 0 )
- + ers_report();
- else if( strcmpi("help", type) == 0 )
- {
- ShowInfo("To use GM commands:\n");
- @@ -3493,7 +3603,361 @@
- #endif
- return 0;
- }
- +void map_zone_apply(int m, struct map_zone_data *zone,char* w1, const char* start, const char* buffer, const char* filepath) {
- + int i;
- + char empty[1] = "\0";
- + map[m].zone = zone;
- + for(i = 0; i < zone->mapflags_count; i++) {
- + char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
- + int len = strlen(zone->mapflags[i]);
- + int k;
- + params[0] = '\0';
- + memcpy(flag, zone->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
- + for(k = 0; k < len; k++) {
- + if( flag[k] == '\t' ) {
- + memcpy(params, &flag[k+1], len - k);
- + flag[k] = '\0';
- + break;
- + }
- + }
- + npc_parse_mapflag(w1,empty,flag,params,start,buffer,filepath);
- + }
- +}
- +/* used on npc load and reload to apply all "Normal" and "PK Mode" zones */
- +void map_zone_init(void) {
- + struct map_zone_data *zone;
- + char empty[1] = "\0";
- + int i,k,j;
- + zone = &map_zone_all;
- +
- + for(i = 0; i < zone->mapflags_count; i++) {
- + char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
- + int len = strlen(zone->mapflags[i]);
- + params[0] = '\0';
- + memcpy(flag, zone->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
- + for(k = 0; k < len; k++) {
- + if( flag[k] == '\t' ) {
- + memcpy(params, &flag[k+1], len - k);
- + flag[k] = '\0';
- + break;
- + }
- + }
- + for(j = 0; j < map_num; j++) {
- + if( map[j].zone == zone ) {
- + npc_parse_mapflag(map[j].name,empty,flag,params,empty,empty,empty);
- + }
- + }
- + }
- +
- + if( battle_config.pk_mode ) {
- + zone = &map_zone_pk;
- + for(i = 0; i < zone->mapflags_count; i++) {
- + char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
- + int len = strlen(zone->mapflags[i]);
- + params[0] = '\0';
- + memcpy(flag, zone->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
- + for(k = 0; k < len; k++) {
- + if( flag[k] == '\t' ) {
- + memcpy(params, &flag[k+1], len - k);
- + flag[k] = '\0';
- + break;
- + }
- + }
- + for(j = 0; j < map_num; j++) {
- + if( map[j].zone == zone ) {
- + npc_parse_mapflag(map[j].name,empty,flag,params,empty,empty,empty);
- + }
- + }
- + }
- + }
- +
- +}
- +enum bl_type map_zone_bl_type(const char *entry) {
- + char temp[200], *parse;
- + enum bl_type bl;
- + safestrncpy(temp, entry, 200);
- +
- + parse = strtok(temp,"|");
- +
- + while (parse != NULL) {
- + normalize_name(parse," ");
- + if( strcmpi(parse,"player") == 0 )
- + bl |= BL_PC;
- + else if( strcmpi(parse,"homun") == 0 )
- + bl |= BL_HOM;
- + else if( strcmpi(parse,"mercenary") == 0 )
- + bl |= BL_MER;
- + else if( strcmpi(parse,"monster") == 0 )
- + bl |= BL_MOB;
- + else if( strcmpi(parse,"elemental") == 0 )
- + bl |= BL_ELEM;
- + else if( strcmpi(parse,"all") == 0 )
- + bl |= BL_ALL;
- + else if( strcmpi(parse,"none") == 0 ) {
- + bl = 0;
- + } else {
- + ShowError("map_zone_db: '%s' unknown type, skipping...\n",parse);
- + }
- + parse = strtok(NULL,"|");
- + }
- + return bl;
- +}
- +void read_map_zone_db(void) {
- + config_t map_zone_db;
- + config_setting_t *zones = NULL;
- + /* TODO: #ifndef required for re/pre-re */
- +#ifdef RENEWAL
- + const char *config_filename = "db/re/map_zone_db.conf"; // FIXME hardcoded name
- +#else
- + const char *config_filename = "db/pre-re/map_zone_db.conf"; // FIXME hardcoded name
- +#endif
- + if (conf_read_file(&map_zone_db, config_filename))
- + return;
- +
- + zones = config_lookup(&map_zone_db, "zones");
- +
- + if (zones != NULL) {
- + struct map_zone_data *zone;
- + struct item_data *data;
- + config_setting_t *zone_e;
- + config_setting_t *skills;
- + config_setting_t *items;
- + config_setting_t *mapflags;
- + const char *name;
- + const char *zonename;
- + int i,h,v;
- + int zone_count = 0, disabled_skills_count = 0, disabled_items_count = 0, mapflags_count = 0;
- +
- + zone_count = config_setting_length(zones);
- + for (i = 0; i < zone_count; ++i) {
- + bool is_all = false;
- +
- + zone_e = config_setting_get_elem(zones, i);
- +
- + if (!config_setting_lookup_string(zone_e, "name", &zonename)) {
- + ShowError("map_zone_db: missing zone name, skipping... (%s:%d)\n",
- + config_setting_source_file(zone_e), config_setting_source_line(zone_e));
- + config_setting_remove_elem(zones,i);/* remove from the tree */
- + --zone_count;
- + --i;
- + continue;
- + }
- +
- + if( strdb_exists(zone_db, zonename) ) {
- + ShowError("map_zone_db: duplicate zone name '%s', skipping...\n",zonename);
- + config_setting_remove_elem(zones,i);/* remove from the tree */
- + --zone_count;
- + --i;
- + continue;
- + }
- +
- + /* is this the global template? */
- + if( strncmpi(zonename,MAP_ZONE_ALL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
- + zone = &map_zone_all;
- + is_all = true;
- + } else if( strncmpi(zonename,MAP_ZONE_PK_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
- + zone = &map_zone_pk;
- + is_all = true;
- + } else {
- + CREATE( zone, struct map_zone_data, 1 );
- + zone->disabled_skills_count = 0;
- + zone->disabled_items_count = 0;
- + }
- + safestrncpy(zone->name, zonename, MAP_ZONE_NAME_LENGTH);
- +
- + if( (skills = config_setting_get_member(zone_e, "disabled_skills")) != NULL ) {
- + disabled_skills_count = config_setting_length(skills);
- + /* validate */
- + for(h = 0; h < config_setting_length(skills); h++) {
- + config_setting_t *skill = config_setting_get_elem(skills, h);
- + name = config_setting_name(skill);
- + if( !strdb_exists(skilldb_name2id,name) ) {
- + ShowError("map_zone_db: unknown skill (%s) in disabled_skills for zone '%s', skipping skill...\n",name,zone->name);
- + config_setting_remove_elem(skills,h);
- + --disabled_skills_count;
- + --h;
- + continue;
- + }
- + if( !map_zone_bl_type(config_setting_get_string_elem(skills,h)) )/* we dont remove it from the three due to inheritance */
- + --disabled_skills_count;
- + }
- + /* all ok, process */
- + CREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, disabled_skills_count );
- + for(h = 0, v = 0; h < config_setting_length(skills); h++) {
- + config_setting_t *skill = config_setting_get_elem(skills, h);
- + struct map_zone_disabled_skill_entry * entry;
- + enum bl_type type;
- + name = config_setting_name(skill);
- +
- + if( (type = map_zone_bl_type(config_setting_get_string_elem(skills,h))) ) { /* only add if enabled */
- + CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
- +
- + entry->nameid = strdb_iget(skilldb_name2id, name);
- + entry->type = type;
- +
- + zone->disabled_skills[v++] = entry;
- + }
- +
- + }
- + zone->disabled_skills_count = disabled_skills_count;
- + }
- +
- + if( (items = config_setting_get_member(zone_e, "disabled_items")) != NULL ) {
- + disabled_items_count = config_setting_length(items);
- + /* validate */
- + for(h = 0; h < config_setting_length(items); h++) {
- + config_setting_t *item = config_setting_get_elem(items, h);
- + name = config_setting_name(item);
- + data = itemdb_searchname(name);
- + if( data == NULL ) {
- + ShowError("map_zone_db: unknown item (%s) in disabled_items for zone '%s', skipping item...\n",name,zone->name);
- + config_setting_remove_elem(items,h);
- + --disabled_items_count;
- + --h;
- + continue;
- + }
- + if( !config_setting_get_bool(item) )/* we dont remove it from the three due to inheritance */
- + --disabled_items_count;
- + }
- + /* all ok, process */
- + CREATE( zone->disabled_items, int, disabled_items_count );
- + for(h = 0, v = 0; h < config_setting_length(items); h++) {
- + config_setting_t *item = config_setting_get_elem(items, h);
- +
- + if( config_setting_get_bool(item) ) { /* only add if enabled */
- + name = config_setting_name(item);
- + data = itemdb_searchname(name);
- + zone->disabled_items[v++] = data->nameid;
- + }
- +
- + }
- + zone->disabled_items_count = disabled_items_count;
- + }
- +
- + if( (mapflags = config_setting_get_member(zone_e, "mapflags")) != NULL ) {
- + mapflags_count = config_setting_length(mapflags);
- + /* mapflags are not validated here, so we save all anyway */
- + CREATE( zone->mapflags, char *, mapflags_count );
- + for(h = 0; h < mapflags_count; h++) {
- + CREATE( zone->mapflags[h], char, MAP_ZONE_MAPFLAG_LENGTH );
- +
- + name = config_setting_get_string_elem(mapflags, h);
- +
- + safestrncpy(zone->mapflags[h], name, MAP_ZONE_MAPFLAG_LENGTH);
- +
- + }
- + zone->mapflags_count = mapflags_count;
- + }
- +
- +
- + if( !is_all ) /* global template doesn't go into db -- since it isn't a alloc'd piece of data */
- + strdb_put(zone_db, zonename, zone);
- +
- + }
- +
- + /* process inheritance, aka loop through the whole thing again :P */
- + for (i = 0; i < zone_count; ++i) {
- + config_setting_t *inherit_tree = NULL;
- +
- + zone_e = config_setting_get_elem(zones, i);
- +
- + if( (inherit_tree = config_setting_get_member(zone_e, "inherit")) != NULL ) {
- + int inherit_count = config_setting_length(inherit_tree);
- + for(h = 0; h < inherit_count; h++) {
- + struct map_zone_data *izone; /* inherit zone */
- + int disabled_skills_count_i = 0; /* disabled skill count from inherit zone */
- + int disabled_items_count_i = 0; /* disabled item count from inherit zone */
- + int mapflags_count_i = 0; /* mapflag count from inherit zone */
- + int j;
- +
- + name = config_setting_get_string_elem(inherit_tree, h);
- + config_setting_lookup_string(zone_e, "name", &zonename);/* will succeed for we validated it earlier */
- +
- + if( !(izone = strdb_get(zone_db, name)) ) {
- + ShowError("map_zone_db: Unknown zone '%s' being inherit by zone '%s', skipping...\n",name,zonename);
- + continue;
- + }
- +
- + zone = strdb_get(zone_db, zonename);/* will succeed for we just put it in here */
- +
- + disabled_skills_count_i = izone->disabled_skills_count;
- + disabled_items_count_i = izone->disabled_items_count;
- + mapflags_count_i = izone->mapflags_count;
- +
- + /* process everything to override, paying attention to config_setting_get_bool */
- + if( (skills = config_setting_get_member(zone_e, "disabled_skills")) != NULL ) {
- + disabled_skills_count = config_setting_length(skills);
- + for(j = 0; j < disabled_skills_count_i; j++) {
- + int k;
- + for(k = 0; k < disabled_skills_count; k++) {
- + config_setting_t *skill = config_setting_get_elem(skills, k);
- + if( strdb_iget(skilldb_name2id, config_setting_name(skill)) == izone->disabled_skills[j]->nameid ) {
- + break;
- + }
- + }
- + if( k == disabled_skills_count ) {/* we didn't find it */
- + struct map_zone_disabled_skill_entry *entry;
- + RECREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, ++zone->disabled_skills_count );
- + CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
- + entry->nameid = izone->disabled_skills[j]->nameid;
- + entry->type = izone->disabled_skills[j]->type;
- + zone->disabled_skills[zone->disabled_skills_count-1] = entry;
- + }
- + }
- + }
- +
- + if( (items = config_setting_get_member(zone_e, "disabled_items")) != NULL ) {
- + disabled_items_count = config_setting_length(items);
- + for(j = 0; j < disabled_items_count_i; j++) {
- + int k;
- + for(k = 0; k < disabled_items_count; k++) {
- + config_setting_t *item = config_setting_get_elem(items, k);
- +
- + name = config_setting_name(item);
- + data = itemdb_searchname(name);
- +
- + if( data->nameid == izone->disabled_items[j] ) {
- + if( config_setting_get_bool(item) )
- + continue;
- + break;
- + }
- + }
- + if( k == disabled_items_count ) {/* we didn't find it */
- + RECREATE( zone->disabled_items, int, ++zone->disabled_items_count );
- + zone->disabled_items[zone->disabled_items_count-1] = izone->disabled_items[j];
- + }
- + }
- + }
- +
- + if( (mapflags = config_setting_get_member(zone_e, "mapflags")) != NULL ) {
- + mapflags_count = config_setting_length(mapflags);
- + for(j = 0; j < mapflags_count_i; j++) {
- + int k;
- + for(k = 0; k < mapflags_count; k++) {
- + name = config_setting_get_string_elem(mapflags, k);
- +
- + if( strcmpi(name,izone->mapflags[j]) == 0 ) {
- + break;
- + }
- + }
- + if( k == mapflags_count ) {/* we didn't find it */
- + RECREATE( zone->mapflags, char*, ++zone->mapflags_count );
- + CREATE( zone->mapflags[zone->mapflags_count-1], char, MAP_ZONE_MAPFLAG_LENGTH );
- + safestrncpy(zone->mapflags[zone->mapflags_count-1], izone->mapflags[j], MAP_ZONE_MAPFLAG_LENGTH);
- + }
- + }
- + }
- + }
- + }
- + }
- +
- + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' zones in '"CL_WHITE"%s"CL_RESET"'.\n", zone_count, config_filename);
- + /* not supposed to go in here but in skill_final whatever */
- + config_destroy(&map_zone_db);
- + }
- +}
- +
- /**
- * @see DBApply
- */
- @@ -3615,21 +4079,10 @@
- do_final_battleground();
- do_final_duel();
- do_final_elemental();
- + do_final_maps();
- map_db->destroy(map_db, map_db_final);
- - for (i=0; i<map_num; i++) {
- - if(map[i].cell) aFree(map[i].cell);
- - if(map[i].block) aFree(map[i].block);
- - if(map[i].block_mob) aFree(map[i].block_mob);
- - if(battle_config.dynamic_mobs) { //Dynamic mobs flag by [random]
- - if(map[i].mob_delete_timer != INVALID_TIMER)
- - delete_timer(map[i].mob_delete_timer, map_removemobs_timer);
- - for (j=0; j<MAX_MOB_LIST_PER_MAP; j++)
- - if (map[i].moblist[j]) aFree(map[i].moblist[j]);
- - }
- - }
- -
- mapindex_final();
- if(enable_grf)
- grfio_final();
- @@ -3749,7 +4202,6 @@
- rnd_init();
- map_config_read(MAP_CONF_NAME);
- - /* only temporary until sirius's datapack patch is complete */
- // loads npcs
- map_reloadnpc(false);
- @@ -3791,7 +4243,9 @@
- regen_db = idb_alloc(DB_OPT_BASE); // efficient status_natural_heal processing
- iwall_db = strdb_alloc(DB_OPT_RELEASE_DATA,2*NAME_LENGTH+2+1); // [Zephyrus] Invisible Walls
- + zone_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, MAP_ZONE_NAME_LENGTH);
- +
- map_sql_init();
- if (log_config.sql_logs)
- log_sql_init();
- @@ -3815,6 +4269,7 @@
- do_init_script();
- do_init_itemdb();
- do_init_skill();
- + read_map_zone_db();/* read after item and skill initalization */
- do_init_mob();
- do_init_pc();
- do_init_status();
- Index: src/map/map.h
- --- src/map/map.h Base (BASE)
- +++ src/map/map.h Locally Modified (Based On LOCAL)
- @@ -11,9 +11,6 @@
- #include "../common/db.h"
- #include "../common/msg_conf.h"
- -/**
- - * [rAthena.org]
- - **/
- #include "../config/core.h"
- #include <stdarg.h>
- @@ -22,8 +19,7 @@
- struct item_data;
- struct raChSysCh;
- -enum E_MAPSERVER_ST
- -{
- +enum E_MAPSERVER_ST {
- MAPSERVER_ST_RUNNING = CORE_ST_LAST,
- MAPSERVER_ST_SHUTDOWN,
- MAPSERVER_ST_LAST
- @@ -507,6 +503,39 @@
- bool shootable;
- };
- +struct mapflag_skill_adjust {
- + unsigned short skill_id;
- + unsigned short modifier;
- +};
- +struct map_zone_disabled_skill_entry {
- + unsigned short nameid;
- + enum bl_type type;
- +};
- +
- +#define MAP_ZONE_NAME_LENGTH 30
- +#define MAP_ZONE_ALL_NAME "Normal"
- +#define MAP_ZONE_PVP_NAME "PvP"
- +#define MAP_ZONE_GVG_NAME "GvG"
- +#define MAP_ZONE_BG_NAME "Battlegrounds"
- +#define MAP_ZONE_PK_NAME "PK Mode"
- +#define MAP_ZONE_MAPFLAG_LENGTH 50
- +DBMap *zone_db;/* string => struct map_zone_data */
- +struct map_zone_data {
- + char name[MAP_ZONE_NAME_LENGTH];/* 20'd */
- + struct map_zone_disabled_skill_entry **disabled_skills;
- + int disabled_skills_count;
- + int *disabled_items;
- + int disabled_items_count;
- + char **mapflags;
- + int mapflags_count;
- +};
- +void map_zone_init(void);
- +void map_zone_apply(int m, struct map_zone_data *zone,char* w1, const char* start, const char* buffer, const char* filepath);
- +
- +struct map_zone_data map_zone_all;/* used as a base on all maps */
- +struct map_zone_data map_zone_pk;/* used for (pk_mode) */
- +
- +
- struct map_data {
- char name[MAP_NAME_LENGTH];
- uint16 index; // The map index used by the mapindex* functions.
- @@ -555,17 +584,12 @@
- unsigned fireworks : 1;
- unsigned sakura : 1; // [Valaris]
- unsigned leaves : 1; // [Valaris]
- - /**
- - * No longer available, keeping here just in case it's back someday. [Ind]
- - **/
- - //unsigned rain : 1; // [Valaris]
- unsigned nogo : 1; // [Valaris]
- unsigned nobaseexp : 1; // [Lorky] added by Lupus
- unsigned nojobexp : 1; // [Lorky]
- unsigned nomobloot : 1; // [Lorky]
- unsigned nomvploot : 1; // [Lorky]
- unsigned nightenabled :1; //For night display. [Skotlex]
- - unsigned restricted : 1; // [Komurka]
- unsigned nodrop : 1;
- unsigned novending : 1;
- unsigned loadevent : 1;
- @@ -575,6 +599,7 @@
- unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
- unsigned reset :1; // [Daegaladh]
- unsigned chsysnolocalaj : 1;
- + unsigned noknockback : 1;
- } flag;
- struct point save;
- struct npc_data *npc[MAX_NPC_PER_MAP];
- @@ -586,7 +611,6 @@
- struct spawn_data *moblist[MAX_MOB_LIST_PER_MAP]; // [Wizputer]
- int mob_delete_timer; // [Skotlex]
- - int zone; // zone number (for item/skill restrictions)
- int jexp; // map experience multiplicator
- int bexp; // map experience multiplicator
- int nocommand; //Blocks @/# commands for non-gms. [Skotlex]
- @@ -601,8 +625,30 @@
- int instance_id;
- int instance_src_map;
- - /* rAthena Local Chat */
- + /* adjust_unit_duration mapflag */
- + struct mapflag_skill_adjust **units;
- + unsigned short unit_count;
- + /* adjust_skill_damage mapflag */
- + struct mapflag_skill_adjust **skills;
- + unsigned short skill_count;
- +
- + /* Hercules nocast db overhaul */
- + struct map_zone_data *zone;
- + /* Local Chat */
- struct raChSysCh *channel;
- + /* invincible_time_inc mapflag */
- + unsigned int invincible_time_inc;
- +
- + /* weapon_damage_rate mapflag */
- + unsigned short weapon_damage_rate;
- + /* magic_damage_rate mapflag */
- + unsigned short magic_damage_rate;
- + /* misc_damage_rate mapflag */
- + unsigned short misc_damage_rate;
- + /* short_damage_rate mapflag */
- + unsigned short short_damage_rate;
- + /* long_damage_rate mapflag */
- + unsigned short long_damage_rate;
- };
- /// Stores information about a remote map (for multi-mapserver setups).
- Index: src/map/mob.c
- --- src/map/mob.c Base (BASE)
- +++ src/map/mob.c Locally Modified (Based On LOCAL)
- @@ -3403,8 +3403,7 @@
- for (i=0,j = MAX_SKILL_TREE-1;j>=0 && i< MAX_MOBSKILL ;j--) {
- skill_id = skill_tree[pc_class2idx(sd->status.class_)][j].id;
- if (!skill_id || sd->status.skill[skill_id].lv < 1 ||
- - (skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL)) ||
- - skill_get_nocast(skill_id)&16
- + (skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL|INF2_CLONE_NOCOPY))
- )
- continue;
- //Normal aggressive mob, disable skills that cannot help them fight
- Index: src/map/npc.c
- --- src/map/npc.c Base (BASE)
- +++ src/map/npc.c Locally Modified (Based On LOCAL)
- @@ -112,8 +112,7 @@
- return NULL;
- }
- -static int npc_isnear_sub(struct block_list* bl, va_list args)
- -{
- +static int npc_isnear_sub(struct block_list* bl, va_list args) {
- struct npc_data *nd = (struct npc_data*)bl;
- if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) )
- @@ -122,8 +121,8 @@
- return 1;
- }
- -bool npc_isnear(struct block_list * bl)
- -{
- +bool npc_isnear(struct block_list * bl) {
- +
- if( battle_config.min_npc_vendchat_distance > 0 &&
- map_foreachinrange(npc_isnear_sub,bl, battle_config.min_npc_vendchat_distance, BL_NPC) )
- return true;
- @@ -3166,8 +3165,7 @@
- * eg : bat_c01 mapflag battleground 2
- * also chking if mapflag conflict with another
- *------------------------------------------*/
- -static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath)
- -{
- +const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath) {
- int16 m;
- char mapname[32];
- int state = 1;
- @@ -3234,20 +3232,24 @@
- map[m].flag.nozenypenalty=state;
- }
- else if (!strcmpi(w3,"pvp")) {
- + struct map_zone_data *zone;
- map[m].flag.pvp = state;
- - if( state && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) )
- - {
- + if( state && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) ) {
- map[m].flag.gvg = 0;
- map[m].flag.gvg_dungeon = 0;
- map[m].flag.gvg_castle = 0;
- ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing GvG flags from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- }
- - if( state && map[m].flag.battleground )
- - {
- + if( state && map[m].flag.battleground ) {
- map[m].flag.battleground = 0;
- ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing BattleGround flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- }
- + if( state && (zone = strdb_get(zone_db, MAP_ZONE_PVP_NAME)) && map[m].zone != zone ) {
- + map_zone_apply(m,zone,w1,start,buffer,filepath);
- + } else if ( !state ) {
- + map[m].zone = &map_zone_pk;
- }
- + }
- else if (!strcmpi(w3,"pvp_noparty"))
- map[m].flag.pvp_noparty=state;
- else if (!strcmpi(w3,"pvp_noguild"))
- @@ -3286,18 +3288,21 @@
- else if (!strcmpi(w3,"pvp_nocalcrank"))
- map[m].flag.pvp_nocalcrank=state;
- else if (!strcmpi(w3,"gvg")) {
- + struct map_zone_data *zone;
- +
- map[m].flag.gvg = state;
- - if( state && map[m].flag.pvp )
- - {
- + if( state && map[m].flag.pvp ) {
- map[m].flag.pvp = 0;
- ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing PvP flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- }
- - if( state && map[m].flag.battleground )
- - {
- + if( state && map[m].flag.battleground ) {
- map[m].flag.battleground = 0;
- ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing BattleGround flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- }
- + if( state && (zone = strdb_get(zone_db, MAP_ZONE_GVG_NAME)) && map[m].zone != zone ) {
- + map_zone_apply(m,zone,w1,start,buffer,filepath);
- }
- + }
- else if (!strcmpi(w3,"gvg_noparty"))
- map[m].flag.gvg_noparty=state;
- else if (!strcmpi(w3,"gvg_dungeon")) {
- @@ -3309,29 +3314,30 @@
- if (state) map[m].flag.pvp=0;
- }
- else if (!strcmpi(w3,"battleground")) {
- - if( state )
- - {
- + struct map_zone_data *zone;
- + if( state ) {
- if( sscanf(w4, "%d", &state) == 1 )
- map[m].flag.battleground = state;
- else
- map[m].flag.battleground = 1; // Default value
- - }
- - else
- + } else
- map[m].flag.battleground = 0;
- - if( map[m].flag.battleground && map[m].flag.pvp )
- - {
- + if( map[m].flag.battleground && map[m].flag.pvp ) {
- map[m].flag.pvp = 0;
- ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing PvP flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- }
- - if( map[m].flag.battleground && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) )
- - {
- + if( map[m].flag.battleground && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) ) {
- map[m].flag.gvg = 0;
- map[m].flag.gvg_dungeon = 0;
- map[m].flag.gvg_castle = 0;
- ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing GvG flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- }
- +
- + if( state && (zone = strdb_get(zone_db, MAP_ZONE_BG_NAME)) && map[m].zone != zone ) {
- + map_zone_apply(m,zone,w1,start,buffer,filepath);
- }
- + }
- else if (!strcmpi(w3,"noexppenalty"))
- map[m].flag.noexppenalty=state;
- else if (!strcmpi(w3,"nozenypenalty"))
- @@ -3360,11 +3366,6 @@
- map[m].flag.sakura=state;
- else if (!strcmpi(w3,"leaves"))
- map[m].flag.leaves=state;
- - /**
- - * No longer available, keeping here just in case it's back someday. [Ind]
- - **/
- - //else if (!strcmpi(w3,"rain"))
- - // map[m].flag.rain=state;
- else if (!strcmpi(w3,"nightenabled"))
- map[m].flag.nightenabled=state;
- else if (!strcmpi(w3,"nogo"))
- @@ -3394,16 +3395,6 @@
- } else
- map[m].nocommand=0;
- }
- - else if (!strcmpi(w3,"restricted")) {
- - if (state) {
- - map[m].flag.restricted=1;
- - sscanf(w4, "%d", &state);
- - map[m].zone |= 1<<(state+1);
- - } else {
- - map[m].flag.restricted=0;
- - map[m].zone = 0;
- - }
- - }
- else if (!strcmpi(w3,"jexp")) {
- map[m].jexp = (state) ? atoi(w4) : 100;
- if( map[m].jexp < 0 ) map[m].jexp = 100;
- @@ -3424,9 +3415,69 @@
- map[m].flag.guildlock=state;
- else if (!strcmpi(w3,"reset"))
- map[m].flag.reset=state;
- - else if (!strcmpi(w3,"nomapchannelautojoin"))
- + else if (!strcmpi(w3,"adjust_unit_duration")) {
- + char *mod;
- + int skill_id;
- +
- + strtok(w4,"\t");/* makes w4 contain only 4th param */
- +
- + if( !(mod = strtok(NULL,"\t")) ) {/* makes mod contain only the 5th param */
- + ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_unit_duration' flag! removing flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- + } else if( !( skill_id = skill_name2id(w4) ) || !skill_get_unit_id( skill_name2id(w4), 0) ) {
- + ShowWarning("npc_parse_mapflag: Unknown skill (%s) for 'adjust_unit_duration' flag! removing flag from %s (file '%s', line '%d').\n", w4, map[m].name, filepath, strline(buffer,start-buffer));
- + } else if ( atoi(mod) < 1 || atoi(mod) > USHRT_MAX ) {
- + ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_unit_duration' flag! removing flag from %s (file '%s', line '%d').\n", atoi(mod), w4, map[m].name, filepath, strline(buffer,start-buffer));
- + } else {
- + int idx = map[m].unit_count;
- + RECREATE(map[m].units, struct mapflag_skill_adjust*, ++map[m].unit_count);
- + CREATE(map[m].units[idx],struct mapflag_skill_adjust,1);
- + map[m].units[idx]->skill_id = (unsigned short)skill_id;
- + map[m].units[idx]->modifier = (unsigned short)atoi(mod);
- + }
- + } else if (!strcmpi(w3,"adjust_skill_damage")) {
- + char *mod;
- + int skill_id;
- +
- + strtok(w4,"\t");/* makes w4 contain only 4th param */
- +
- + if( !(mod = strtok(NULL,"\t")) ) {/* makes mod contain only the 5th param */
- + ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
- + } else if( !( skill_id = skill_name2id(w4) ) ) {
- + ShowWarning("npc_parse_mapflag: Unknown skill (%s) for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", w4, map[m].name, filepath, strline(buffer,start-buffer));
- + } else if ( atoi(mod) < 1 || atoi(mod) > USHRT_MAX ) {
- + ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", atoi(mod), w4, map[m].name, filepath, strline(buffer,start-buffer));
- + } else {
- + int idx = map[m].skill_count;
- + RECREATE(map[m].skills, struct mapflag_skill_adjust*, ++map[m].skill_count);
- + CREATE(map[m].skills[idx],struct mapflag_skill_adjust,1);
- + map[m].skills[idx]->skill_id = (unsigned short)skill_id;
- + map[m].skills[idx]->modifier = (unsigned short)atoi(mod);
- + }
- + } else if (!strcmpi(w3,"zone")) {
- + struct map_zone_data *zone;
- +
- + if( !(zone = strdb_get(zone_db, w4)) ) {
- + ShowWarning("npc_parse_mapflag: Invalid zone '%s'! removing flag from %s (file '%s', line '%d').\n", w4, map[m].name, filepath, strline(buffer,start-buffer));
- + } else if( map[m].zone != zone ) { /* we do not override :P would mess everything */
- + map_zone_apply(m,zone,w1,start,buffer,filepath);
- + }
- + } else if ( !strcmpi(w3,"nomapchannelautojoin") ) {
- map[m].flag.chsysnolocalaj = state;
- - else
- + } else if ( !strcmpi(w3,"invincible_time_inc") ) {
- + map[m].invincible_time_inc = (state) ? atoi(w4) : 0;
- + } else if ( !strcmpi(w3,"noknockback") ) {
- + map[m].flag.noknockback = state;
- + } else if ( !strcmpi(w3,"weapon_damage_rate") ) {
- + map[m].weapon_damage_rate = (state) ? atoi(w4) : 100;
- + } else if ( !strcmpi(w3,"magic_damage_rate") ) {
- + map[m].magic_damage_rate = (state) ? atoi(w4) : 100;
- + } else if ( !strcmpi(w3,"misc_damage_rate") ) {
- + map[m].misc_damage_rate = (state) ? atoi(w4) : 100;
- + } else if ( !strcmpi(w3,"short_damage_rate") ) {
- + map[m].short_damage_rate = (state) ? atoi(w4) : 100;
- + } else if ( !strcmpi(w3,"long_damage_rate") ) {
- + map[m].long_damage_rate = (state) ? atoi(w4) : 100;
- + } else
- ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer));
- return strchr(start,'\n');// continue
- @@ -3765,6 +3816,8 @@
- for( i = 0; i < ARRAYLENGTH(instance); ++i )
- instance_init(instance[i].instance_id);
- + map_zone_init();
- +
- //Re-read the NPC Script Events cache.
- npc_read_event_script();
- @@ -3893,6 +3946,8 @@
- "\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
- npc_id - START_NPC_NUM, npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
- + map_zone_init();
- +
- // set up the events cache
- memset(script_event, 0, sizeof(script_event));
- npc_read_event_script();
- Index: src/map/npc.h
- --- src/map/npc.h Base (BASE)
- +++ src/map/npc.h Locally Modified (Based On LOCAL)
- @@ -124,6 +124,7 @@
- int npc_buylist(struct map_session_data* sd,int n, unsigned short* item_list);
- int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list);
- void npc_parse_mob2(struct spawn_data* mob);
- +const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath);
- struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y);
- int npc_globalmessage(const char* name,const char* mes);
- Index: src/map/path.c
- --- src/map/path.c Base (BASE)
- +++ src/map/path.c Locally Modified (Based On LOCAL)
- Index: src/map/pc.c
- --- src/map/pc.c Base (BASE)
- +++ src/map/pc.c Locally Modified (Based On LOCAL)
- @@ -123,10 +123,11 @@
- return 0;
- }
- -void pc_setinvincibletimer(struct map_session_data* sd, int val)
- -{
- +void pc_setinvincibletimer(struct map_session_data* sd, int val) {
- nullpo_retv(sd);
- + val += map[sd->bl.m].invincible_time_inc;
- +
- if( sd->invincible_timer != INVALID_TIMER )
- delete_timer(sd->invincible_timer,pc_invincible_timer);
- sd->invincible_timer = add_timer(gettick()+val,pc_invincible_timer,sd->bl.id,0);
- @@ -1240,18 +1241,18 @@
- static int pc_calc_skillpoint(struct map_session_data* sd)
- {
- - int i,skill,inf2,skill_point=0;
- + int i,skill_lv,inf2,skill_point=0;
- nullpo_ret(sd);
- for(i=1;i<MAX_SKILL;i++){
- - if( (skill = pc_checkskill(sd,i)) > 0) {
- + if( (skill_lv = pc_checkskill(sd,i)) > 0) {
- inf2 = skill_get_inf2(i);
- if((!(inf2&INF2_QUEST_SKILL) || battle_config.quest_skill_learn) &&
- !(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) //Do not count wedding/link skills. [Skotlex]
- ) {
- if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
- - skill_point += skill;
- + skill_point += skill_lv;
- else
- if(sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0)
- skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0);
- @@ -1366,7 +1367,6 @@
- for( i = 0; i < MAX_SKILL_TREE && (id = skill_tree[c][i].id) > 0; i++ )
- {
- int f;
- -
- if( sd->status.skill[id].id )
- continue; //Skill already known.
- @@ -4209,14 +4209,14 @@
- int pc_useitem(struct map_session_data *sd,int n)
- {
- unsigned int tick = gettick();
- - int amount, nameid;
- + int amount, nameid, i;
- struct script_code *script;
- nullpo_ret(sd);
- if( sd->npc_id ){
- #ifdef RENEWAL
- - clif_msg(sd, 0x783); // TODO look for the client date that has this message.
- + clif_msg(sd, USAGE_FAIL); // TODO look for the client date that has this message.
- #endif
- return 0;
- }
- @@ -4303,19 +4303,15 @@
- }
- /* on restricted maps the item is consumed but the effect is not used */
- - if (
- - (!map_flag_vs(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&1) || // Normal
- - (map[sd->bl.m].flag.pvp && sd->inventory_data[n]->flag.no_equip&2) || // PVP
- - (map_flag_gvg(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&4) || // GVG
- - (map[sd->bl.m].flag.battleground && sd->inventory_data[n]->flag.no_equip&8) || // Battleground
- - (map[sd->bl.m].flag.restricted && sd->inventory_data[n]->flag.no_equip&(8*map[sd->bl.m].zone)) // Zone restriction
- - ) {
- + for(i = 0; i < map[sd->bl.m].zone->disabled_items_count; i++) {
- + if( map[sd->bl.m].zone->disabled_items[i] == nameid ) {
- if( battle_config.item_restricted_consumption_type ) {
- clif_useitemack(sd,n,sd->status.inventory[n].amount-1,true);
- pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
- }
- - return 0;/* regardless, effect is not run */
- + return 0;
- }
- + }
- sd->itemid = sd->status.inventory[n].nameid;
- sd->itemindex = n;
- @@ -6505,8 +6501,7 @@
- if( !src || src == &sd->bl )
- return;
- - if( pc_issit(sd) )
- - {
- + if( pc_issit(sd) ) {
- pc_setstand(sd);
- skill_sit(sd,0);
- }
- Index: src/map/script.c
- --- src/map/script.c Base (BASE)
- +++ src/map/script.c Locally Modified (Based On LOCAL)
- @@ -383,7 +383,7 @@
- MF_NORETURN,
- MF_NOWARPTO,
- MF_NIGHTMAREDROP,
- - MF_RESTRICTED,
- + MF_ZONE,
- MF_NOCOMMAND,
- MF_NODROP,
- MF_JEXP,
- @@ -4790,8 +4790,10 @@
- {
- const char* name = reference_getname(data);
- if( name[0] == '.' ) {
- + if ( !ref ) {
- ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1);
- ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars);
- + }
- data->ref = ref;
- }
- }
- @@ -7266,7 +7268,7 @@
- }
- break;
- case 2:
- - if( ( g = guild_search(sd->status.guild_id) ) != NULL ) {
- + if( ( g = sd->guild ) != NULL ) {
- script_pushstrcopy(st,g->name);
- } else {
- script_pushconststr(st,"");
- @@ -10760,10 +10762,6 @@
- case MF_FOG: script_pushint(st,map[m].flag.fog); break;
- case MF_SAKURA: script_pushint(st,map[m].flag.sakura); break;
- case MF_LEAVES: script_pushint(st,map[m].flag.leaves); break;
- - /**
- - * No longer available, keeping here just in case it's back someday. [Ind]
- - **/
- - //case MF_RAIN: script_pushint(st,map[m].flag.rain); break;
- case MF_NOGO: script_pushint(st,map[m].flag.nogo); break;
- case MF_CLOUDS: script_pushint(st,map[m].flag.clouds); break;
- case MF_CLOUDS2: script_pushint(st,map[m].flag.clouds2); break;
- @@ -10778,7 +10776,6 @@
- case MF_NORETURN: script_pushint(st,map[m].flag.noreturn); break;
- case MF_NOWARPTO: script_pushint(st,map[m].flag.nowarpto); break;
- case MF_NIGHTMAREDROP: script_pushint(st,map[m].flag.pvp_nightmaredrop); break;
- - case MF_RESTRICTED: script_pushint(st,map[m].flag.restricted); break;
- case MF_NOCOMMAND: script_pushint(st,map[m].nocommand); break;
- case MF_NODROP: script_pushint(st,map[m].flag.nodrop); break;
- case MF_JEXP: script_pushint(st,map[m].jexp); break;
- @@ -10817,13 +10814,22 @@
- BUILDIN_FUNC(setmapflag)
- {
- int16 m,i;
- - const char *str;
- + const char *str, *val2 = NULL;
- + struct script_data* data;
- int val=0;
- str=script_getstr(st,2);
- i=script_getnum(st,3);
- if(script_hasdata(st,4)){
- - val=script_getnum(st,4);
- + data = script_getdata(st,4);
- + get_val(st, data);
- +
- +
- + if( data_isstring(data) )
- + val2 = script_getstr(st, 4);
- + else
- + val = script_getnum(st, 4);
- +
- }
- m = map_mapname2mapid(str);
- if(m >= 0) {
- @@ -10856,10 +10862,6 @@
- case MF_FOG: map[m].flag.fog = 1; break;
- case MF_SAKURA: map[m].flag.sakura = 1; break;
- case MF_LEAVES: map[m].flag.leaves = 1; break;
- - /**
- - * No longer available, keeping here just in case it's back someday. [Ind]
- - **/
- - //case MF_RAIN: map[m].flag.rain = 1; break;
- case MF_NOGO: map[m].flag.nogo = 1; break;
- case MF_CLOUDS: map[m].flag.clouds = 1; break;
- case MF_CLOUDS2: map[m].flag.clouds2 = 1; break;
- @@ -10874,9 +10876,13 @@
- case MF_NORETURN: map[m].flag.noreturn = 1; break;
- case MF_NOWARPTO: map[m].flag.nowarpto = 1; break;
- case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 1; break;
- - case MF_RESTRICTED:
- - map[m].zone |= 1<<(val+1);
- - map[m].flag.restricted=1;
- + case MF_ZONE: {
- + char zone[6] = "zone\0";
- + char empty[1] = "\0";
- + char params[MAP_ZONE_MAPFLAG_LENGTH];
- + memcpy(params, val2, MAP_ZONE_MAPFLAG_LENGTH);
- + npc_parse_mapflag(map[m].name, empty, zone, params, empty, empty, empty);
- + }
- break;
- case MF_NOCOMMAND: map[m].nocommand = (val <= 0) ? 100 : val; break;
- case MF_NODROP: map[m].flag.nodrop = 1; break;
- @@ -10940,10 +10946,6 @@
- case MF_FOG: map[m].flag.fog = 0; break;
- case MF_SAKURA: map[m].flag.sakura = 0; break;
- case MF_LEAVES: map[m].flag.leaves = 0; break;
- - /**
- - * No longer available, keeping here just in case it's back someday. [Ind]
- - **/
- - //case MF_RAIN: map[m].flag.rain = 0; break;
- case MF_NOGO: map[m].flag.nogo = 0; break;
- case MF_CLOUDS: map[m].flag.clouds = 0; break;
- case MF_CLOUDS2: map[m].flag.clouds2 = 0; break;
- @@ -10958,11 +10960,8 @@
- case MF_NORETURN: map[m].flag.noreturn = 0; break;
- case MF_NOWARPTO: map[m].flag.nowarpto = 0; break;
- case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 0; break;
- - case MF_RESTRICTED:
- - map[m].zone ^= 1<<(val+1);
- - if (map[m].zone == 0){
- - map[m].flag.restricted=0;
- - }
- + case MF_ZONE:/* reset zone state, mapflags cant be removed however */
- + map[m].zone = ( battle_config.pk_mode && map[m].flag.pvp ) ? &map_zone_pk : &map_zone_all;
- break;
- case MF_NOCOMMAND: map[m].nocommand = 0; break;
- case MF_NODROP: map[m].flag.nodrop = 0; break;
- Index: src/map/skill.c
- --- src/map/skill.c Base (BASE)
- +++ src/map/skill.c Locally Modified (Based On LOCAL)
- @@ -223,7 +223,6 @@
- int skill_get_mhp( uint16 skill_id ,uint16 skill_lv ) { skill_get (skill_db[skill_id].mhp[skill_lv-1], skill_id, skill_lv); }
- int skill_get_castnodex( uint16 skill_id ,uint16 skill_lv ) { skill_get (skill_db[skill_id].castnodex[skill_lv-1], skill_id, skill_lv); }
- int skill_get_delaynodex( uint16 skill_id ,uint16 skill_lv ){ skill_get (skill_db[skill_id].delaynodex[skill_lv-1], skill_id, skill_lv); }
- -int skill_get_nocast ( uint16 skill_id ) { skill_get (skill_db[skill_id].nocast, skill_id, 1); }
- int skill_get_type( uint16 skill_id ) { skill_get (skill_db[skill_id].skill_type, skill_id, 1); }
- int skill_get_unit_id ( uint16 skill_id, int flag ){ skill_get (skill_db[skill_id].unit_id[flag], skill_id, 1); }
- int skill_get_unit_interval( uint16 skill_id ) { skill_get (skill_db[skill_id].unit_interval, skill_id, 1); }
- @@ -540,15 +539,6 @@
- **/
- if( sd->skillitem == skill_id )
- return 0;
- - // Check skill restrictions [Celest]
- - if( (!map_flag_vs(m) && skill_get_nocast (skill_id) & 1) ||
- - (map[m].flag.pvp && skill_get_nocast (skill_id) & 2) ||
- - (map_flag_gvg(m) && skill_get_nocast (skill_id) & 4) ||
- - (map[m].flag.battleground && skill_get_nocast (skill_id) & 8) ||
- - (map[m].flag.restricted && map[m].zone && skill_get_nocast (skill_id) & (8*map[m].zone)) ){
- - clif_msg(sd, 0x536); // This skill cannot be used within this area
- - return 1;
- - }
- if( sd->sc.option&OPTION_MOUNTING )
- return 1;//You can't use skills while in the new mounts (The client doesn't let you, this is to make cheat-safe)
- @@ -2120,15 +2110,14 @@
- - if 'flag&0x1', position update packets must not be sent.
- - if 'flag&0x2', skill blown ignores players' special_state.no_knockback
- -------------------------------------------------------------------------*/
- -int skill_blown(struct block_list* src, struct block_list* target, int count, int8 dir, int flag)
- -{
- +int skill_blown(struct block_list* src, struct block_list* target, int count, int8 dir, int flag) {
- int dx = 0, dy = 0;
- struct skill_unit* su = NULL;
- nullpo_ret(src);
- - if (src != target && (map_flag_gvg(target->m) || map[target->m].flag.battleground))
- - return 0; //No knocking back in WoE
- + if (src != target && map[src->m].flag.noknockback)
- + return 0; //No knocking
- if (count == 0)
- return 0; //Actual knockback distance is 0.
- @@ -2171,8 +2160,7 @@
- //Checks if 'bl' should reflect back a spell cast by 'src'.
- //type is the type of magic attack: 0: indirect (aoe), 1: direct (targetted)
- -static int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type)
- -{
- +int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type) {
- struct status_change *sc = status_get_sc(bl);
- struct map_session_data* sd = BL_CAST(BL_PC, bl);
- @@ -5367,7 +5355,7 @@
- }
- }
- else
- - clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
- + clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
- break;
- case AL_INCAGI:
- @@ -6009,7 +5997,7 @@
- if(pc_steal_item(sd,bl,skill_lv))
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
- else
- - clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
- + clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
- }
- break;
- @@ -9986,7 +9974,7 @@
- else { // Create Basilica. Start SC on caster. Unit timer start SC on others.
- if( map_foreachinrange(skill_count_wos, src, 2, BL_MOB|BL_PC, src) ) {
- if( sd )
- - clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
- + clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
- return 1;
- }
- skill_clear_unitgroup(src);
- @@ -10372,7 +10360,7 @@
- map_foreachinarea(skill_area_sub,src->m,x-i,y-i,x+i,y+i,splash_target(src),
- src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
- } else if( sd )
- - clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
- + clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
- break;
- case WM_DOMINION_IMPULSE:
- @@ -10758,6 +10746,14 @@
- unit_flag = skill_get_unit_flag(skill_id);
- layout = skill_get_unit_layout(skill_id,skill_lv,src,x,y);
- + if( map[src->m].unit_count ) {
- + ARR_FIND(0, map[src->m].unit_count, i, map[src->m].units[i]->skill_id == skill_id );
- +
- + if( i < map[src->m].unit_count ) {
- + limit = limit * map[src->m].units[i]->modifier / 100;
- + }
- + }
- +
- sd = BL_CAST(BL_PC, src);
- status = status_get_status_data(src);
- sc = status_get_sc(src); // for traps, firewall and fogwall - celest
- @@ -13148,7 +13144,7 @@
- if( sc && sc->data[SC_INSPIRATION] )
- return 1; // Don't check for partner.
- if( !(sc && sc->data[SC_BANDING]) ) {
- - clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
- + clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
- return 0;
- } else if( skill_check_pc_partner(sd,skill_id,&skill_lv,skill_get_range(skill_id,skill_lv),0) < 1 )
- return 0; // Just fails, no msg here.
- @@ -15130,23 +15126,16 @@
- wall = false;
- }
- - if( sce )
- - {
- - if( !wall )
- - {
- + if( sce ) {
- + if( !wall ) {
- if( sce->val1 < 3 ) //End cloaking.
- status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
- - else
- - if( sce->val4&1 )
- - { //Remove wall bonus
- + else if( sce->val4&1 ) { //Remove wall bonus
- sce->val4&=~1;
- status_calc_bl(bl,SCB_SPEED);
- }
- - }
- - else
- - {
- - if( !(sce->val4&1) )
- - { //Add wall speed bonus
- + } else {
- + if( !(sce->val4&1) ) { //Add wall speed bonus
- sce->val4|=1;
- status_calc_bl(bl,SCB_SPEED);
- }
- @@ -15161,23 +15150,18 @@
- static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
- bool wall = true;
- - if( bl->type == BL_PC )
- - { //Check for walls.
- + if( bl->type == BL_PC ) { //Check for walls.
- int i;
- ARR_FIND( 0, 8, i, map_getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
- if( i == 8 )
- wall = false;
- }
- - if( sce )
- - {
- - if( !wall )
- - {
- + if( sce ) {
- + if( !wall ) {
- if( sce->val1 < 3 ) //End camouflage.
- status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
- - else
- - if( sce->val3&1 )
- - { //Remove wall bonus
- + else if( sce->val3&1 ) { //Remove wall bonus
- sce->val3&=~1;
- status_calc_bl(bl,SCB_SPEED);
- }
- @@ -15246,8 +15230,7 @@
- /*==========================================
- *
- *------------------------------------------*/
- -int skill_delunit (struct skill_unit* unit)
- -{
- +int skill_delunit (struct skill_unit* unit) {
- struct skill_unit_group *group;
- nullpo_ret(unit);
- @@ -15361,8 +15344,7 @@
- // find a free spot to store the new unit group
- ARR_FIND( 0, MAX_SKILLUNITGROUP, i, ud->skillunit[i] == NULL );
- - if(i == MAX_SKILLUNITGROUP)
- - {
- + if(i == MAX_SKILLUNITGROUP) {
- // array is full, make room by discarding oldest group
- int j=0;
- unsigned maxdiff=0,x,tick=gettick();
- @@ -15517,8 +15499,7 @@
- skill_delunit(&group->unit[i]);
- // clear Talkie-box string
- - if( group->valstr != NULL )
- - {
- + if( group->valstr != NULL ) {
- aFree(group->valstr);
- group->valstr = NULL;
- }
- @@ -15532,13 +15513,11 @@
- // locate this group, swap with the last entry and delete it
- ARR_FIND( 0, MAX_SKILLUNITGROUP, i, ud->skillunit[i] == group );
- ARR_FIND( i, MAX_SKILLUNITGROUP, j, ud->skillunit[j] == NULL ); j--;
- - if( i < MAX_SKILLUNITGROUP )
- - {
- + if( i < MAX_SKILLUNITGROUP ) {
- ud->skillunit[i] = ud->skillunit[j];
- ud->skillunit[j] = NULL;
- ers_free(skill_unit_ers, group);
- - }
- - else
- + } else
- ShowError("skill_delunitgroup: Group not found! (src_id: %d skill_id: %d)\n", group->src_id, group->skill_id);
- return 1;
- @@ -15562,8 +15541,7 @@
- /*==========================================
- *
- *------------------------------------------*/
- -struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick)
- -{
- +struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick) {
- int i,j=-1,k,s,id;
- struct unit_data *ud;
- struct skill_unit_group_tickset *set;
- @@ -15603,8 +15581,7 @@
- /*==========================================
- *
- *------------------------------------------*/
- -int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap)
- -{
- +int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap) {
- struct skill_unit* unit = va_arg(ap,struct skill_unit *);
- struct skill_unit_group* group = unit->group;
- unsigned int tick = va_arg(ap,unsigned int);
- @@ -15768,11 +15745,8 @@
- default:
- skill_delunit(unit);
- }
- - }
- - else
- - {// skill unit is still active
- - switch( group->unit_id )
- - {
- + } else {// skill unit is still active
- + switch( group->unit_id ) {
- case UNT_ICEWALL:
- // icewall loses 50 hp every second
- unit->val1 -= SKILLUNITTIMER_INTERVAL/20; // trap's hp
- @@ -15832,12 +15806,10 @@
- if(unit->range == -1) //Unit disabled, but it should not be deleted yet.
- group->unit_id = UNT_USED_TRAPS;
- -
- - if( group->unit_id == UNT_TATAMIGAESHI )
- - {
- + else if( group->unit_id == UNT_TATAMIGAESHI ) {
- unit->range = -1; //Disable processed cell.
- - if (--group->val1 <= 0) // number of live cells
- - { //All tiles were processed, disable skill.
- + if (--group->val1 <= 0) { // number of live cells
- + //All tiles were processed, disable skill.
- group->target_flag=BCT_NOONE;
- group->bl_flag= BL_NUL;
- }
- @@ -15851,8 +15823,7 @@
- /*==========================================
- * Executes on all skill units every SKILLUNITTIMER_INTERVAL miliseconds.
- *------------------------------------------*/
- -int skill_unit_timer(int tid, unsigned int tick, int id, intptr_t data)
- -{
- +int skill_unit_timer(int tid, unsigned int tick, int id, intptr_t data) {
- map_freeblock_lock();
- skillunit_db->foreach(skillunit_db, skill_unit_timer_sub, tick);
- @@ -15902,23 +15873,16 @@
- }
- //Target-type check.
- - if( !(group->bl_flag&target->type && battle_check_target(&unit->bl,target,group->target_flag) > 0) )
- - {
- - if( group->src_id == target->id && group->state.song_dance&0x2 )
- - { //Ensemble check to see if they went out/in of the area [Skotlex]
- - if( flag&1 )
- - {
- - if( flag&2 )
- - { //Clear this skill id.
- + if( !(group->bl_flag&target->type && battle_check_target(&unit->bl,target,group->target_flag) > 0) ) {
- + if( group->src_id == target->id && group->state.song_dance&0x2 ) { //Ensemble check to see if they went out/in of the area [Skotlex]
- + if( flag&1 ) {
- + if( flag&2 ) { //Clear this skill id.
- ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == skill_id );
- if( i < ARRAYLENGTH(skill_unit_temp) )
- skill_unit_temp[i] = 0;
- }
- - }
- - else
- - {
- - if( flag&2 )
- - { //Store this skill id.
- + } else {
- + if( flag&2 ) { //Store this skill id.
- ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
- if( i < ARRAYLENGTH(skill_unit_temp) )
- skill_unit_temp[i] = skill_id;
- @@ -15995,8 +15959,7 @@
- map_foreachincell(skill_unit_move_sub,bl->m,bl->x,bl->y,BL_SKILL,bl,tick,flag);
- - if( flag&2 && flag&1 )
- - { //Onplace, check any skill units you have left.
- + if( flag&2 && flag&1 ) { //Onplace, check any skill units you have left.
- int i;
- for( i = 0; i < ARRAYLENGTH(skill_unit_temp); i++ )
- if( skill_unit_temp[i] )
- @@ -16825,14 +16788,10 @@
- if (skill_get_nk(skill_id)&NK_NO_DAMAGE || !(skill_get_type(skill_id)&BF_MAGIC))
- return;
- - if (sc && sc->count && sc->data[SC_MAGICPOWER])
- - {
- - if (sc->data[SC_MAGICPOWER]->val4)
- - {
- + if (sc && sc->count && sc->data[SC_MAGICPOWER]) {
- + if (sc->data[SC_MAGICPOWER]->val4) {
- status_change_end(bl, SC_MAGICPOWER, INVALID_TIMER);
- - }
- - else
- - {
- + } else {
- sc->data[SC_MAGICPOWER]->val4 = 1;
- status_calc_bl(bl, status_sc2scb_flag(SC_MAGICPOWER));
- #ifndef RENEWAL
- @@ -17166,10 +17125,8 @@
- if( battle_config.display_status_timers )
- clif_skill_cooldown(sd, idx, tick);
- - if( !load )
- - {// not being loaded initially so ensure the skill delay is recorded
- - if( !(cd = idb_get(skillcd_db,sd->status.char_id)) )
- - {// create a new skill cooldown object for map storage
- + if( !load ) {// not being loaded initially so ensure the skill delay is recorded
- + if( !(cd = idb_get(skillcd_db,sd->status.char_id)) ) {// create a new skill cooldown object for map storage
- CREATE( cd, struct skill_cd, 1 );
- idb_put( skillcd_db, sd->status.char_id, cd );
- }
- @@ -17271,12 +17228,10 @@
- /*
- *
- */
- -int skill_split_str (char *str, char **val, int num)
- -{
- +int skill_split_str (char *str, char **val, int num) {
- int i;
- - for( i = 0; i < num && str; i++ )
- - {
- + for( i = 0; i < num && str; i++ ) {
- val[i] = str;
- str = strchr(str,',');
- if( str )
- @@ -17288,8 +17243,7 @@
- /*
- *
- */
- -int skill_split_atoi (char *str, int *val)
- -{
- +int skill_split_atoi (char *str, int *val) {
- int i, j, diff, step = 1;
- for (i=0; i<MAX_SKILL_LEVEL; i++) {
- @@ -17301,15 +17255,13 @@
- }
- if(i==0) //No data found.
- return 0;
- - if(i==1)
- - { //Single value, have the whole range have the same value.
- + if(i==1) { //Single value, have the whole range have the same value.
- for (; i < MAX_SKILL_LEVEL; i++)
- val[i] = val[i-1];
- return i;
- }
- //Check for linear change with increasing steps until we reach half of the data acquired.
- - for (step = 1; step <= i/2; step++)
- - {
- + for (step = 1; step <= i/2; step++) {
- diff = val[i-1] - val[i-step-1];
- for(j = i-1; j >= step; j--)
- if ((val[j]-val[j-step]) != diff)
- @@ -17318,8 +17270,7 @@
- if (j>=step) //No match, try next step.
- continue;
- - for(; i < MAX_SKILL_LEVEL; i++)
- - { //Apply linear increase
- + for(; i < MAX_SKILL_LEVEL; i++) { //Apply linear increase
- val[i] = val[i-step]+diff;
- if (val[i] < 1 && val[i-1] >=0) //Check if we have switched from + to -, cap the decrease to 0 in said cases.
- { val[i] = 1; diff = 0; step = 1; }
- @@ -17335,8 +17286,7 @@
- /*
- *
- */
- -void skill_init_unit_layout (void)
- -{
- +void skill_init_unit_layout (void) {
- int i,j,size,pos = 0;
- memset(skill_unit_layout,0,sizeof(skill_unit_layout));
- @@ -17624,8 +17574,7 @@
- inf = skill_get_inf2(skill_id);
- if( inf == INF2_SONG_DANCE || /*skill_get_inf2(skill_id) == INF2_CHORUS_SKILL ||*/ inf == INF2_SPIRIT_SKILL )
- return 1; // Can't do it.
- - switch( skill_id )
- - {
- + switch( skill_id ) {
- case NV_FIRSTAID: case TF_HIDING: case AS_CLOAKING: case WZ_SIGHTRASHER:
- case RG_STRIPWEAPON: case RG_STRIPSHIELD: case RG_STRIPARMOR: case WZ_METEOR:
- case RG_STRIPHELM: case SC_STRIPACCESSARY: case ST_FULLSTRIP: case WZ_SIGHTBLASTER:
- @@ -17699,14 +17648,12 @@
- // always check to make sure the session properly exists
- nullpo_retv(sd);
- - if( !(cd = idb_get(skillcd_db, sd->status.char_id)) )
- - {// no skill cooldown is associated with this character
- + if( !(cd = idb_get(skillcd_db, sd->status.char_id)) ) {// no skill cooldown is associated with this character
- return;
- }
- // process each individual cooldown associated with the character
- - for( i = 0; i < cd->cursor; i++ )
- - {
- + for( i = 0; i < cd->cursor; i++ ) {
- // block the skill from usage but ensure it is not recorded (load = true)
- skill_blockpc_start_( sd, cd->nameid[i], cd->duration[i], true );
- }
- @@ -17784,15 +17731,12 @@
- //Wich weapon type are required, see doc/item_db for types
- p = split[7];
- - for( j = 0; j < 32; j++ )
- - {
- + for( j = 0; j < 32; j++ ) {
- int l = atoi(p);
- - if( l == 99 ) // Any weapon
- - {
- + if( l == 99 ) { // Any weapon
- skill_db[idx].weapon = 0;
- break;
- - }
- - else
- + } else
- skill_db[idx].weapon |= 1<<l;
- p = strchr(p,':');
- if(!p)
- @@ -17802,15 +17746,12 @@
- //FIXME: document this
- p = split[8];
- - for( j = 0; j < 32; j++ )
- - {
- + for( j = 0; j < 32; j++ ) {
- int l = atoi(p);
- - if( l == 99 ) // Any ammo type
- - {
- + if( l == 99 ) { // Any ammo type
- skill_db[idx].ammo = 0xFFFFFFFF;
- break;
- - }
- - else if( l ) // 0 stands for no requirement
- + } else if( l ) // 0 stands for no requirement
- skill_db[idx].ammo |= 1<<l;
- p = strchr(p,':');
- if( !p )
- @@ -17887,25 +17828,13 @@
- return true;
- }
- -static bool skill_parse_row_nocastdb(char* split[], int columns, int current)
- -{// skill_id,Flag
- +bool skill_parse_row_unitdb(char* split[], int columns, int current) {
- +// ID,unit ID,unit ID 2,layout,range,interval,target,flag
- uint16 skill_id = atoi(split[0]);
- uint16 idx = skill_get_index(skill_id);
- if( !idx ) // invalid skill id
- return false;
- - skill_db[idx].nocast |= atoi(split[1]);
- -
- - return true;
- -}
- -
- -static bool skill_parse_row_unitdb(char* split[], int columns, int current)
- -{// ID,unit ID,unit ID 2,layout,range,interval,target,flag
- - uint16 skill_id = atoi(split[0]);
- - uint16 idx = skill_get_index(skill_id);
- - if( !idx ) // invalid skill id
- - return false;
- -
- skill_db[idx].unit_id[0] = strtol(split[1],NULL,16);
- skill_db[idx].unit_id[1] = strtol(split[2],NULL,16);
- skill_split_atoi(split[3],skill_db[idx].unit_layout_type);
- @@ -17953,8 +17882,7 @@
- skill_produce_db[current].req_skill = atoi(split[2]);
- skill_produce_db[current].req_skill_lv = atoi(split[3]);
- - for( x = 4, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_PRODUCE_RESOURCE; x += 2, y++ )
- - {
- + for( x = 4, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_PRODUCE_RESOURCE; x += 2, y++ ) {
- skill_produce_db[current].mat_id[y] = atoi(split[x]);
- skill_produce_db[current].mat_amount[y] = atoi(split[x+1]);
- }
- @@ -17972,8 +17900,7 @@
- skill_arrow_db[current].nameid = i;
- - for( x = 1, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_ARROW_RESOURCE; x += 2, y++ )
- - {
- + for( x = 1, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_ARROW_RESOURCE; x += 2, y++ ) {
- skill_arrow_db[current].cre_id[y] = atoi(split[x]);
- skill_arrow_db[current].cre_amount[y] = atoi(split[x+1]);
- }
- @@ -17993,8 +17920,7 @@
- ShowError("spellbook_db: Passive skills cannot be memorized (%d/%s)\n", skill_id, skill_get_name(skill_id));
- if( points < 1 )
- ShowError("spellbook_db: PreservePoints have to be 1 or above! (%d/%s)\n", skill_id, skill_get_name(skill_id));
- - else
- - {
- + else {
- skill_spellbook_db[current].skill_id = skill_id;
- skill_spellbook_db[current].point = points;
- skill_spellbook_db[current].nameid = nameid;
- @@ -18154,8 +18080,6 @@
- sv_readdb(db_path, DBPATH"skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
- sv_readdb(db_path, DBPATH"skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb);
- - sv_readdb(db_path, DBPATH"skill_nocast_db.txt" , ',', 2, 2, MAX_SKILL_DB, skill_parse_row_nocastdb);
- -
- skill_init_unit_layout();
- sv_readdb(db_path, "produce_db.txt" , ',', 4, 4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb);
- sv_readdb(db_path, "create_arrow_db.txt" , ',', 1+2, 1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb);
- Index: src/map/skill.h
- --- src/map/skill.h Base (BASE)
- +++ src/map/skill.h Locally Modified (Based On LOCAL)
- @@ -26,8 +26,7 @@
- DBMap* skilldb_name2id;
- //Constants to identify the skill's inf value:
- -enum e_skill_inf
- -{
- +enum e_skill_inf {
- INF_ATTACK_SKILL = 0x01,
- INF_GROUND_SKILL = 0x02,
- INF_SELF_SKILL = 0x04, // Skills casted on self where target is automatically chosen
- @@ -39,8 +38,7 @@
- //Constants to identify a skill's nk value (damage properties)
- //The NK value applies only to non INF_GROUND_SKILL skills
- //when determining skill castend function to invoke.
- -enum e_skill_nk
- -{
- +enum e_skill_nk {
- NK_NO_DAMAGE = 0x01,
- NK_SPLASH = 0x02|0x04, // 0x4 = splash & split
- NK_SPLASHSPLIT = 0x04,
- @@ -53,8 +51,7 @@
- //A skill with 3 would be no damage + splash: area of effect.
- //Constants to identify a skill's inf2 value.
- -enum e_skill_inf2
- -{
- +enum e_skill_inf2 {
- INF2_QUEST_SKILL = 0x0001,
- INF2_NPC_SKILL = 0x0002, //NPC skills are those that players can't have in their skill tree.
- INF2_WEDDING_SKILL = 0x0004,
- @@ -70,14 +67,14 @@
- INF2_NO_ENEMY = 0x1000,
- INF2_NOLP = 0x2000, // Spells that can ignore Land Protector
- INF2_CHORUS_SKILL = 0x4000, // Chorus skill
- + INF2_CLONE_NOCOPY = 0x8000, // Clones will not copy this skill
- };
- //Walk intervals at which chase-skills are attempted to be triggered.
- #define WALK_SKILL_INTERVAL 5
- // Flags passed to skill_attack/skill_area_sub
- -enum e_skill_display
- -{
- +enum e_skill_display {
- SD_LEVEL = 0x1000, // skill_attack will send -1 instead of skill level (affects display of some skills)
- SD_ANIMATION = 0x2000, // skill_attack will use '5' instead of the skill's 'type' (this makes skills show an animation)
- SD_SPLASH = 0x4000, // skill_area_sub will count targets in skill_area_temp[2]
- Index: src/map/status.c
- --- src/map/status.c Base (BASE)
- +++ src/map/status.c Locally Modified (Based On LOCAL)
- @@ -1559,6 +1559,17 @@
- return 0;
- }
- + if( skill_id ) {
- + int i;
- +
- + for(i = 0; i < map[src->m].zone->disabled_skills_count; i++) {
- + if( skill_id == map[src->m].zone->disabled_skills[i]->nameid && (map[src->m].zone->disabled_skills[i]->type&src->type) ) {
- + if( src->type == BL_PC )
- + clif_msg((TBL_PC*)src, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
- + return 0;
- + }
- + }
- +
- switch( skill_id ) {
- case PA_PRESSURE:
- if( flag && target ) {
- @@ -1582,6 +1593,7 @@
- default:
- break;
- }
- + }
- if ( src ) sc = status_get_sc(src);
- @@ -2295,7 +2307,7 @@
- const struct status_change *sc = &sd->sc;
- struct s_skill b_skill[MAX_SKILL]; // previous skill tree
- int b_weight, b_max_weight, b_cart_weight_max, // previous weight
- - i, index, skill,refinedef=0;
- + i, k, index, skill,refinedef=0;
- int64 i64;
- if (++calculating > 10) //Too many recursive calls!
- @@ -2459,19 +2471,15 @@
- if(!sd->inventory_data[index])
- continue;
- - if(sd->inventory_data[index]->flag.no_equip) { // Items may be equipped, their effects however are nullified.
- - if(map[sd->bl.m].flag.restricted && sd->inventory_data[index]->flag.no_equip&(8*map[sd->bl.m].zone))
- - continue;
- - if(!map_flag_vs(sd->bl.m) && sd->inventory_data[index]->flag.no_equip&1)
- - continue;
- - if(map[sd->bl.m].flag.pvp && sd->inventory_data[index]->flag.no_equip&2)
- - continue;
- - if(map_flag_gvg(sd->bl.m) && sd->inventory_data[index]->flag.no_equip&4)
- - continue;
- - if(map[sd->bl.m].flag.battleground && sd->inventory_data[index]->flag.no_equip&8)
- - continue;
- + for(k = 0; k < map[sd->bl.m].zone->disabled_items_count; k++) {
- + if( map[sd->bl.m].zone->disabled_items[k] == sd->inventory_data[index]->nameid ) {
- + break;
- }
- + }
- + if( k < map[sd->bl.m].zone->disabled_items_count )
- + continue;
- +
- status->def += sd->inventory_data[index]->def;
- if(first && sd->inventory_data[index]->equip_script)
- @@ -2606,28 +2614,24 @@
- data = itemdb_exists(c);
- if(!data)
- continue;
- - if(first && data->equip_script)
- - { //Execute equip-script on login
- + if(first && data->equip_script) {//Execute equip-script on login
- run_script(data->equip_script,0,sd->bl.id,0);
- if (!calculating)
- return 1;
- }
- if(!data->script)
- continue;
- - if(data->flag.no_equip) { //Card restriction checks.
- - if(map[sd->bl.m].flag.restricted && data->flag.no_equip&(8*map[sd->bl.m].zone))
- - continue;
- - if(!map_flag_vs(sd->bl.m) && data->flag.no_equip&1)
- - continue;
- - if(map[sd->bl.m].flag.pvp && data->flag.no_equip&2)
- - continue;
- - if(map_flag_gvg(sd->bl.m) && data->flag.no_equip&4)
- - continue;
- - if(map[sd->bl.m].flag.battleground && data->flag.no_equip&8)
- - continue;
- +
- + for(k = 0; k < map[sd->bl.m].zone->disabled_items_count; k++) {
- + if( map[sd->bl.m].zone->disabled_items[k] == sd->inventory_data[index]->nameid ) {
- + break;
- }
- - if(i == EQI_HAND_L && sd->status.inventory[index].equip == EQP_HAND_L)
- - { //Left hand status.
- + }
- +
- + if( k < map[sd->bl.m].zone->disabled_items_count )
- + continue;
- +
- + if(i == EQI_HAND_L && sd->status.inventory[index].equip == EQP_HAND_L) { //Left hand status.
- sd->state.lr_flag = 1;
- run_script(data->script,0,sd->bl.id,0);
- sd->state.lr_flag = 0;
- @@ -9117,8 +9123,7 @@
- * 2 - Do clif
- * 3 - Do not remove some permanent/time-independent effects
- *------------------------------------------*/
- -int status_change_clear(struct block_list* bl, int type)
- -{
- +int status_change_clear(struct block_list* bl, int type) {
- struct status_change* sc;
- int i;
- @@ -9127,14 +9132,12 @@
- if (!sc || !sc->count)
- return 0;
- - for(i = 0; i < SC_MAX; i++)
- - {
- + for(i = 0; i < SC_MAX; i++) {
- if(!sc->data[i])
- continue;
- if(type == 0)
- - switch (i)
- - { //Type 0: PC killed -> Place here statuses that do not dispel on death.
- + switch (i) { //Type 0: PC killed -> Place here statuses that do not dispel on death.
- case SC_ELEMENTALCHANGE://Only when its Holy or Dark that it doesn't dispell on death
- if( sc->data[i]->val2 != ELE_HOLY && sc->data[i]->val2 != ELE_DARK )
- break;
- @@ -9183,13 +9186,10 @@
- case SC_L_LIFEPOTION:
- case SC_PUSH_CART:
- continue;
- -
- }
- - if( type == 3 )
- - {
- - switch (i)
- - {// TODO: This list may be incomplete
- + if( type == 3 ) {
- + switch (i) {// TODO: This list may be incomplete
- case SC_WEIGHT50:
- case SC_WEIGHT90:
- case SC_NOCHAT:
- Index: src/map/status.h
- --- src/map/status.h Base (BASE)
- +++ src/map/status.h Locally Modified (Based On LOCAL)
- @@ -634,8 +634,8 @@
- //homon S
- SC_STYLE_CHANGE,
- - SC_TINDER_BREAKER, //@TODO rewritte me plz
- - SC_TINDER_BREAKER2, //for rewritte and other icone
- + SC_TINDER_BREAKER,
- + SC_TINDER_BREAKER2,
- SC_CBC,
- SC_EQC,
- SC_GOLDENE_FERSE,
- Index: src/map/unit.c
- --- src/map/unit.c Base (BASE)
- +++ src/map/unit.c Locally Modified (Based On LOCAL)
- @@ -1354,13 +1355,11 @@
- }
- - if( casttime > 0 )
- - {
- + if( casttime > 0 ) {
- ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
- if( sd && (pc_checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) )
- status_calc_bl(&sd->bl, SCB_SPEED);
- - }
- - else
- + } else
- skill_castend_id(ud->skilltimer,tick,src->id,0);
- return 1;
- @@ -1489,14 +1488,11 @@
- unit_stop_walking(src,1);
- // in official this is triggered even if no cast time.
- clif_skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill_get_ele(skill_id, skill_lv), casttime);
- - if( casttime > 0 )
- - {
- + if( casttime > 0 ) {
- ud->skilltimer = add_timer( tick+casttime, skill_castend_pos, src->id, 0 );
- if( (sd && pc_checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK)
- status_calc_bl(&sd->bl, SCB_SPEED);
- - }
- - else
- - {
- + } else {
- ud->skilltimer = INVALID_TIMER;
- skill_castend_pos(ud->skilltimer,tick,src->id,0);
- }
- @@ -1888,7 +1884,7 @@
- struct map_session_data *sd = NULL;
- struct unit_data *ud = unit_bl2ud( bl);
- unsigned int tick=gettick();
- - int ret=0, skill;
- + int ret=0, skill_id;
- nullpo_ret(bl);
- if (!ud || ud->skilltimer == INVALID_TIMER)
- @@ -1909,11 +1905,11 @@
- ud->canact_tick = tick;
- if(type&1 && sd)
- - skill = sd->skill_id_old;
- + skill_id = sd->skill_id_old;
- else
- - skill = ud->skill_id;
- + skill_id = ud->skill_id;
- - if (skill_get_inf(skill) & INF_GROUND_SKILL)
- + if (skill_get_inf(skill_id) & INF_GROUND_SKILL)
- ret=delete_timer( ud->skilltimer, skill_castend_pos );
- else
- ret=delete_timer( ud->skilltimer, skill_castend_id );
- @@ -1925,10 +1921,8 @@
- if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )
- status_calc_bl(&sd->bl, SCB_SPEED);
- - if( sd )
- - {
- - switch( skill )
- - {
- + if( sd ) {
- + switch( skill_id ) {
- case CG_ARROWVULCAN:
- sd->canequip_tick = tick;
- break;
- @@ -2075,7 +2069,7 @@
- case BL_PC: {
- struct map_session_data *sd = (struct map_session_data*)bl;
- - if(sd->shadowform_id){
- + if(sd->shadowform_id){ //if shadow target has leave the map
- struct block_list *d_bl = map_id2bl(sd->shadowform_id);
- if( d_bl )
- status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
- Index: src/map/vending.c
- --- src/map/vending.c Base (BASE)
- +++ src/map/vending.c Locally Modified (Based On LOCAL)
- @@ -12,6 +12,7 @@
- #include "chrif.h"
- #include "vending.h"
- #include "pc.h"
- +#include "npc.h"
- #include "skill.h"
- #include "battle.h"
- #include "log.h"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement