Advertisement
Lighta

ra_hercmerge_mapzone

Apr 4th, 2013
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 141.60 KB | None | 0 0
  1. # This patch file was generated by NetBeans IDE
  2. # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
  3. # This patch can be applied using context Tools: Patch action on respective folder.
  4. # It uses platform neutral UTF-8 encoding and \n newlines.
  5. # Above lines and this line are ignored by the patching process.
  6. Index: conf/mapflag/restricted.txt
  7. --- conf/mapflag/restricted.txt Base (BASE)
  8. +++ conf/mapflag/restricted.txt Locally Deleted
  9. @@ -1,128 +0,0 @@
  10. -//===== rAthena Script =======================================
  11. -//= Mapflag: Restricted.
  12. -//===== By: ==================================================
  13. -//= Komurka
  14. -//===== Current Version: =====================================
  15. -//= 1.3
  16. -//===== Compatible With: =====================================
  17. -//= rAthena SVN
  18. -//===== Description: =========================================
  19. -//= Disables items configured in item_noequip.txt
  20. -//= and skills configured in skill_nocast_db.txt.
  21. -//===== Additional Comments: =================================
  22. -//= 1.1 - Added WoE:SE Map restrictions. [L0ne_W0lf]
  23. -//= 1.2 - Added Endless Tower Restrictions. (bugreport:4707) [L0ne_W0lf]
  24. -//= 1.3 - Added Orc's Memory, Nidhoggur's Nest and towns restrictions. [Daegaladh]
  25. -//============================================================
  26. -
  27. -//Aldebaran Turbo Track
  28. -alde_tt02  mapflag restricted  1
  29. -turbo_n_1  mapflag restricted  1
  30. -turbo_n_4  mapflag restricted  1
  31. -turbo_n_8  mapflag restricted  1
  32. -turbo_n_16 mapflag restricted  1
  33. -turbo_e_4  mapflag restricted  1
  34. -turbo_e_8  mapflag restricted  1
  35. -turbo_e_16 mapflag restricted  1
  36. -
  37. -//Jail
  38. -sec_pri    mapflag restricted  2
  39. -
  40. -//Izlude Battle Arena
  41. -force_1-1  mapflag restricted  3
  42. -force_2-1  mapflag restricted  3
  43. -force_3-1  mapflag restricted  3
  44. -force_4-1  mapflag restricted  3
  45. -force_5-1  mapflag restricted  3
  46. -force_1-2  mapflag restricted  3
  47. -force_1-3  mapflag restricted  3
  48. -prt_are_in mapflag restricted  3
  49. -
  50. -//WoE:SE Maps
  51. -schg_cas01 mapflag restricted  4
  52. -schg_cas02 mapflag restricted  4
  53. -schg_cas03 mapflag restricted  4
  54. -schg_cas04 mapflag restricted  4
  55. -schg_cas05 mapflag restricted  4
  56. -arug_cas01 mapflag restricted  4
  57. -arug_cas02 mapflag restricted  4
  58. -arug_cas03 mapflag restricted  4
  59. -arug_cas04 mapflag restricted  4
  60. -arug_cas05 mapflag restricted  4
  61. -
  62. -//Sealed Shrine ==================
  63. -1@cata mapflag restricted  5
  64. -2@cata mapflag restricted  5
  65. -
  66. -//Endless Tower ==================
  67. -1@tower    mapflag restricted  6
  68. -2@tower    mapflag restricted  6
  69. -3@tower    mapflag restricted  6
  70. -4@tower    mapflag restricted  6
  71. -5@tower    mapflag restricted  6
  72. -6@tower    mapflag restricted  6
  73. -
  74. -//Orc's Memory ===================
  75. -1@orcs mapflag restricted  6
  76. -2@orcs mapflag restricted  6
  77. -
  78. -// Nidhoggr's Instance ===========
  79. -1@nyd  mapflag restricted  6
  80. -2@nyd  mapflag restricted  6
  81. -
  82. -// Misty Forest Labyrinth ===========
  83. -1@mist mapflag restricted  6
  84. -
  85. -// Octopus Cave ===========
  86. -1@cash mapflag restricted  6
  87. -
  88. -// Drain ===========
  89. -1@pump mapflag restricted  6
  90. -2@pump mapflag restricted  6
  91. -
  92. -// Somatology Laboratory ===========
  93. -1@lhz  mapflag restricted  6
  94. -
  95. -// Bangungot Hospital F2 ===========
  96. -1@ma_h mapflag restricted  6
  97. -
  98. -// Buwaya Cave ===========
  99. -1@ma_c mapflag restricted  6
  100. -
  101. -// Bakonawa Hideout ===========
  102. -1@ma_b mapflag restricted  6
  103. -
  104. -// Inside Eclage ===========
  105. -1@ecl  mapflag restricted  6
  106. -
  107. -//Towns
  108. -alberta    mapflag restricted  7
  109. -aldebaran  mapflag restricted  7
  110. -amatsu mapflag restricted  7
  111. -ayothaya   mapflag restricted  7
  112. -brasilis   mapflag restricted  7
  113. -comodo mapflag restricted  7
  114. -einbroch   mapflag restricted  7
  115. -einbech    mapflag restricted  7
  116. -geffen mapflag restricted  7
  117. -gonryun    mapflag restricted  7
  118. -izlude mapflag restricted  7
  119. -jawaii mapflag restricted  7
  120. -hugel  mapflag restricted  7
  121. -lighthalzen    mapflag restricted  7
  122. -louyang    mapflag restricted  7
  123. -manuk  mapflag restricted  7
  124. -mid_camp   mapflag restricted  7
  125. -moc_ruins  mapflag restricted  7
  126. -morocc mapflag restricted  7
  127. -moscovia   mapflag restricted  7
  128. -niflheim   mapflag restricted  7
  129. -prontera   mapflag restricted  7
  130. -payon  mapflag restricted  7
  131. -pay_arche  mapflag restricted  7
  132. -rachel mapflag restricted  7
  133. -splendide  mapflag restricted  7
  134. -umbala mapflag restricted  7
  135. -veins  mapflag restricted  7
  136. -xmas   mapflag restricted  7
  137. -yuno   mapflag restricted  7
  138. Index: conf/mapflag/skillduration.txt
  139. --- conf/mapflag/skillduration.txt No Base Revision
  140. +++ conf/mapflag/skillduration.txt Locally New
  141. @@ -0,0 +1,22 @@
  142. +//===== Hercules Script ======================================
  143. +//= Mapflag: Adjust Skill Duration.
  144. +//===== By: ==================================================
  145. +//= Hercules Dev Team
  146. +//===== Current Version: =====================================
  147. +//= 1.0
  148. +//===== Description: =========================================
  149. +//= This mapflag allows you to control the duration of unit
  150. +//= skills in any map.
  151. +//= Example (1):
  152. +//= prontera   mapflag adjust_unit_duration    PR_SANCTUARY    50
  153. +//= Halves the duration of Sanctuary in Prontera.
  154. +//=
  155. +//= Example (2):
  156. +//= prontera   mapflag adjust_unit_duration    WZ_QUAGMIRE 250
  157. +//= Increases duration of Quagmire by 2.5 times in Prontera.
  158. +//===== Disclaimer: ==========================================
  159. +//= Be aware that some skill units have their visual effect
  160. +//= durations not controlled by the server (e.g. Storm Gust).
  161. +//===== Additional Comments: =================================
  162. +//= 1.0 - Initial script.
  163. +//============================================================
  164. \ No newline at end of file
  165. Index: conf/mapflag/skillmodifier.txt
  166. --- conf/mapflag/skillmodifier.txt No Base Revision
  167. +++ conf/mapflag/skillmodifier.txt Locally New
  168. @@ -0,0 +1,19 @@
  169. +//===== Hercules Script ======================================
  170. +//= Mapflag: Adjust Skill Damage.
  171. +//===== By: ==================================================
  172. +//= Hercules Dev Team
  173. +//===== Current Version: =====================================
  174. +//= 1.0
  175. +//===== Description: =========================================
  176. +//= This mapflag allows you to modify the damage of any skill
  177. +//= in any map.
  178. +//= Example (1):
  179. +//= prontera   mapflag adjust_skill_damage MG_FIREBOLT 50
  180. +//= Halves the damage of Firebolt in Prontera.
  181. +//=
  182. +//= Example (2):
  183. +//= prontera   mapflag adjust_skill_damage MG_FIREBOLT 200
  184. +//= Doubles the damage of Firebolt in Prontera.
  185. +//===== Additional Comments: =================================
  186. +//= 1.0 - Initial script.
  187. +//============================================================
  188. \ No newline at end of file
  189. Index: conf/mapflag/zone.txt
  190. --- conf/mapflag/zone.txt No Base Revision
  191. +++ conf/mapflag/zone.txt Locally New
  192. @@ -0,0 +1,122 @@
  193. +//===== rAthena ==============================================
  194. +//= Mapflag: Zone.
  195. +//===== By: ==================================================
  196. +//= Ind/Hercules
  197. +//===== Current Version: =====================================
  198. +//= 1.0
  199. +//===== Description: =========================================
  200. +//= Flags maps as part of zones defined in map_zone_db.txt
  201. +//===== Additional Comments: =================================
  202. +//============================================================
  203. +
  204. +//Aldebaran Turbo Track
  205. +alde_tt02  mapflag zone    Aldebaran Turbo Track
  206. +turbo_n_1  mapflag zone    Aldebaran Turbo Track
  207. +turbo_n_4  mapflag zone    Aldebaran Turbo Track
  208. +turbo_n_8  mapflag zone    Aldebaran Turbo Track
  209. +turbo_n_16 mapflag zone    Aldebaran Turbo Track
  210. +turbo_e_4  mapflag zone    Aldebaran Turbo Track
  211. +turbo_e_8  mapflag zone    Aldebaran Turbo Track
  212. +turbo_e_16 mapflag zone    Aldebaran Turbo Track
  213. +
  214. +//Jail
  215. +sec_pri    mapflag zone    Jail
  216. +
  217. +//Izlude Battle Arena
  218. +force_1-1  mapflag zone    Izlude Battle Arena
  219. +force_2-1  mapflag zone    Izlude Battle Arena
  220. +force_3-1  mapflag zone    Izlude Battle Arena
  221. +force_4-1  mapflag zone    Izlude Battle Arena
  222. +force_5-1  mapflag zone    Izlude Battle Arena
  223. +force_1-2  mapflag zone    Izlude Battle Arena
  224. +force_1-3  mapflag zone    Izlude Battle Arena
  225. +prt_are_in mapflag zone    Izlude Battle Arena
  226. +
  227. +//WoE:SE Maps
  228. +schg_cas01 mapflag zone    GvG2
  229. +schg_cas02 mapflag zone    GvG2
  230. +schg_cas03 mapflag zone    GvG2
  231. +schg_cas04 mapflag zone    GvG2
  232. +schg_cas05 mapflag zone    GvG2
  233. +arug_cas01 mapflag zone    GvG2
  234. +arug_cas02 mapflag zone    GvG2
  235. +arug_cas03 mapflag zone    GvG2
  236. +arug_cas04 mapflag zone    GvG2
  237. +arug_cas05 mapflag zone    GvG2
  238. +
  239. +//Sealed Shrine ==================
  240. +1@cata mapflag zone    Sealed Shrine
  241. +2@cata mapflag zone    Sealed Shrine
  242. +
  243. +//Endless Tower ==================
  244. +1@tower    mapflag zone    Memorial Dungeon
  245. +2@tower    mapflag zone    Memorial Dungeon
  246. +3@tower    mapflag zone    Memorial Dungeon
  247. +4@tower    mapflag zone    Memorial Dungeon
  248. +5@tower    mapflag zone    Memorial Dungeon
  249. +6@tower    mapflag zone    Memorial Dungeon
  250. +
  251. +//Orc's Memory ===================
  252. +1@orcs mapflag zone    Memorial Dungeon
  253. +2@orcs mapflag zone    Memorial Dungeon
  254. +
  255. +// Nidhoggr's Instance ===========
  256. +1@nyd  mapflag zone    Memorial Dungeon
  257. +2@nyd  mapflag zone    Memorial Dungeon
  258. +
  259. +// Misty Forest Labyrinth ===========
  260. +1@mist mapflag zone    Memorial Dungeon
  261. +
  262. +// Octopus Cave ===========
  263. +1@cash mapflag zone    Memorial Dungeon
  264. +
  265. +// Drain ===========
  266. +1@pump mapflag zone    Memorial Dungeon
  267. +2@pump mapflag zone    Memorial Dungeon
  268. +
  269. +// Somatology Laboratory ===========
  270. +1@lhz  mapflag zone    Memorial Dungeon
  271. +
  272. +// Bangungot Hospital F2 ===========
  273. +1@ma_h mapflag zone    Memorial Dungeon
  274. +
  275. +// Buwaya Cave ===========
  276. +1@ma_c mapflag zone    Memorial Dungeon
  277. +
  278. +// Bakonawa Hideout ===========
  279. +1@ma_b mapflag zone    Memorial Dungeon
  280. +
  281. +// Inside Eclage ===========
  282. +1@ecl  mapflag zone    Memorial Dungeon
  283. +
  284. +//Towns
  285. +alberta    mapflag zone    Towns
  286. +aldebaran  mapflag zone    Towns
  287. +amatsu mapflag zone    Towns
  288. +ayothaya   mapflag zone    Towns
  289. +brasilis   mapflag zone    Towns
  290. +comodo mapflag zone    Towns
  291. +einbroch   mapflag zone    Towns
  292. +einbech    mapflag zone    Towns
  293. +geffen mapflag zone    Towns
  294. +gonryun    mapflag zone    Towns
  295. +izlude mapflag zone    Towns
  296. +jawaii mapflag zone    Towns
  297. +hugel  mapflag zone    Towns
  298. +lighthalzen    mapflag zone    Towns
  299. +louyang    mapflag zone    Towns
  300. +manuk  mapflag zone    Towns
  301. +mid_camp   mapflag zone    Towns
  302. +moc_ruins  mapflag zone    Towns
  303. +morocc mapflag zone    Towns
  304. +moscovia   mapflag zone    Towns
  305. +niflheim   mapflag zone    Towns
  306. +prontera   mapflag zone    Towns
  307. +payon  mapflag zone    Towns
  308. +pay_arche  mapflag zone    Towns
  309. +rachel mapflag zone    Towns
  310. +splendide  mapflag zone    Towns
  311. +umbala mapflag zone    Towns
  312. +veins  mapflag zone    Towns
  313. +xmas   mapflag zone    Towns
  314. +yuno   mapflag zone    Towns
  315. Index: conf/msg_conf/map_msg.conf
  316. --- conf/msg_conf/map_msg.conf Base (BASE)
  317. +++ conf/msg_conf/map_msg.conf Locally Modified (Based On LOCAL)
  318. @@ -836,7 +836,7 @@
  319.  // @mapinfo
  320.  1038: Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
  321.  1039: ------ Map Info ------
  322. -1040: Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d
  323. +1040: Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
  324.  1041: ------ Map Flags ------
  325.  1042: Town Map
  326.  1043: Autotrade Enabled
  327. Index: config.pl
  328. --- config.pl Base (BASE)
  329. +++ config.pl Locally Deleted
  330. @@ -1,538 +0,0 @@
  331. -#!/usr/bin/perl
  332. -# config script by lighta
  333. -#TODO list :
  334. -#- don't always override import/file, sed grep ?
  335. -
  336. -use CPAN;
  337. -use strict;
  338. -use constant {
  339. -    SERV_UID => "Serv_userid",
  340. -    SERV_PW => "Serv_userpass",
  341. -    SERV_WAN_IP => "Serv_wan_ip",
  342. -    MAP_PORT => "Map_port",
  343. -    CHAR_PORT => "Char_port",
  344. -    LOGIN_PORT => "Login_port",
  345. -    MD5_ENABLE => "enable_MD5",
  346. -    SQL_HOST => "SQL_host",
  347. -    SQL_PORT => "SQL_port",
  348. -    SQL_UID => "SQL_userid",
  349. -    SQL_PW => "SQL_userpass",
  350. -    SQL_MAIN_DB => "SQL_maindb",
  351. -    SQL_LOG_DB => ,"SQL_logdb",
  352. -
  353. -    MAP_CONF_FILE => "map_conf.txt",
  354. -    CHAR_CONF_FILE => "char_conf.txt",
  355. -    LOGIN_CONF_FILE => "login_conf.txt",
  356. -    INTER_CONF_FILE => "inter_conf.txt",
  357. -    DESD_CONF_FILE => ".tmp-desd_conf.yml",
  358. -    MIN_PORT => 2000, #below are usually reserved for system
  359. -    MAX_PORT => 65535,
  360. -};
  361. -BEGIN { #check and install module
  362. -    my @aCheckModule = ("DBI","DBD::mysql","YAML::XS","Cwd","Getopt::Long","Net::Ping");
  363. -    my @aMarkInst = ();
  364. -    foreach(@aCheckModule) { eval "require $_" or push(@aMarkInst,$_); }
  365. -    CPAN::install("@aMarkInst") if(@aMarkInst > 0);
  366. -    foreach(@aCheckModule) { $_->import(); }
  367. -}
  368. -# setup my defaults option
  369. -my $sDsdFile    = DESD_CONF_FILE;
  370. -my $sAutoyes    = 0;
  371. -my $sForce      = 0;
  372. -my $sClean = 0;
  373. -my $sTarget    = "All";
  374. -my $sHelp  = 0;
  375. -GetArgs();
  376. -Main();
  377. -
  378. -sub GetArgs {
  379. -    GetOptions(
  380. -    'f=s' => \$sDsdFile, #give desired conf file
  381. -    'auto=i' => \$sAutoyes,   #Force (auto-yes)
  382. -    'C=i'  => \$sClean,     #Clean (like force but remove before adding)
  383. -    'target=s' => \$sTarget,    #Target (wich setup to run)
  384. -    'Force=i'  => \$sForce,     #Force (bypass verification)
  385. -    'help!' => \$sHelp,
  386. -    ) or $sHelp=1; #display help if invalid option
  387. -    my $sValidTarget = "All|Conf|DB|Inst";
  388. -
  389. -    if( $sHelp ) {
  390. -   print "Incorect option specified, available option are:\n"
  391. -       ."\t --f filename => file (specify desiredconf to use)\n"
  392. -       ."\t --auto => auto-yes to question ? \n"
  393. -       ."\t --C => Clean (remove file, db, user before adding new)\n"
  394. -       ."\t --target => target (specify wich setup to run [$sValidTarget])\n"
  395. -       ."\t --Force => Force (bypass verification)\n";
  396. -   exit;
  397. -    }
  398. -    unless($sTarget =~ /$sValidTarget/){
  399. -   print "Incorect target specified, available target are:\n"
  400. -       ."\t --target => target (specify wich setup to run [(default)$sValidTarget])\n";
  401. -   exit;
  402. -    }
  403. -    if($sDsdFile ne DESD_CONF_FILE && !(-e -r $sDsdFile)){
  404. -   print "Incorect file specified: '$sDsdFile'\n"
  405. -       ."\t this file doesn't seem to appear on filesystem or unable to read\n";
  406. -   exit;
  407. -    }
  408. -}
  409. -
  410. -sub Main {
  411. -    print "Welcome to athena config-tool\n";
  412. -    #default conf
  413. -    my %hDefConf = (    SERV_UID => "s1",
  414. -           SERV_PW => "p1",
  415. -           SERV_WAN_IP => "localhost",
  416. -           MAP_PORT => "5121",
  417. -           CHAR_PORT => "6121",
  418. -           LOGIN_PORT => "6900",
  419. -           MD5_ENABLE => "yes",
  420. -           SQL_HOST => "localhost",
  421. -           SQL_PORT => "3306",
  422. -           SQL_UID => "ragnarok",
  423. -           SQL_PW => "ragnarok",
  424. -           SQL_MAIN_DB => "ragnarok",
  425. -           SQL_LOG_DB => ,"ragnarok",
  426. -           );
  427. -
  428. -    my $sBasedir = getcwd; #for setupdb
  429. -    if($sTarget =~ /All|Inst/){ InstallSoft(); }
  430. -    if($sTarget =~ /All|Conf/) { ConfigConf(\%hDefConf); chdir "$sBasedir"; }
  431. -    if($sTarget =~ /All|DB/) { ConfigDB(\%hDefConf); chdir "$sBasedir"; }
  432. -    print "Config done, you should be able to launch and connect server now\n";
  433. -    print "NB : Don't forget to update your client clieninfo.xml to match change\n";
  434. -}
  435. -
  436. -sub InstallSoft {
  437. -    print "\n Starting InstallSoft \n";
  438. -    print "This autoinstall feature is experimental, package name varies from distri and version, couldn't support them all\n";
  439. -    #yes we could $^0 or uname -r but $^0 only give perl binary build OS and uname hmm...
  440. -    my @aSupportedOS = ("Debian","Ubuntu","Fedora","CentOs");
  441. -    my $sOSregex = join("|",@aSupportedOS);
  442. -    my $sOS;
  443. -    until($sOS =~ /$sOSregex/i){
  444. -   print "Please enter your OS:[$sOSregex] or enter 'quit' to exit\n";
  445. -   $sOS = <>; chomp($sOS);
  446. -   last if($sOS eq "quit");
  447. -    }
  448. -    if($sOS eq "quit"){ print "Skipping Software installation\n"; return; }
  449. -    elsif($sOS =~ /Ubuntu|Debian/i) { #tested on ubuntu 12.10
  450. -   my @aListSoft = ("gcc","gdb","zlibc","zlib1g-dev","make","subversion","mysql-client","mysql-server","mysql-common","libmysqlclient-dev","phpmyadmin","libpcre3-dev");
  451. -   print "Going to install: @aListSoft\n";
  452. -   system("sudo apt-get install @aListSoft");
  453. -    }
  454. -    elsif($sOS =~ /Fedora|CentOs/i){ #tested on fedora 18
  455. -   my @aListSoft = ("gcc","gdb","zlib","zlib-devel","make","subversion","mysql-server","phpmyadmin","pcre-devel");
  456. -   system("sudo yum install @aListSoft");
  457. -    }
  458. -}
  459. -
  460. -sub ConfigConf { my ($rhDefConf) = @_;
  461. -    print "\n Starting ConfigConf \n";
  462. -    my $rhUserConf;
  463. -    while(1) {
  464. -   $rhUserConf = GetDesiredConf($rhDefConf);
  465. -   print "SetupConf using conf : \n";
  466. -   ShowConfig($rhUserConf);
  467. -   last if($sForce || AutoCheckConf($rhUserConf));
  468. -    }
  469. -    ApplySetupConf($rhUserConf);
  470. -}
  471. -
  472. -sub ConfigDB { my ($rhDefConf) = @_;
  473. -    print "\n Starting ConfigDB \n";
  474. -    my $rhUserConf;
  475. -    while(1) {
  476. -   $rhUserConf = GetDesiredConf($rhDefConf);
  477. -   print "SetupDb using conf : \n";
  478. -   ShowConfig($rhUserConf);
  479. -   last if($sForce || AutoCheckConf($rhUserConf));
  480. -    }
  481. -    ApplySetupDB($rhUserConf);
  482. -}
  483. -
  484. -#conf function
  485. -sub ApplySetupConf { my ($rhConfig) = @_;
  486. -    print "\nApplying conf \n";
  487. -    my @aTargetfile = (MAP_CONF_FILE,CHAR_CONF_FILE,LOGIN_CONF_FILE,INTER_CONF_FILE);
  488. -    my $sConfDir = "conf";
  489. -    my $sUserConfDir = "import";
  490. -
  491. -    die "$sConfDir doesn't seem to exist or coudldn't be read/writte" unless(-d -r -w "../$sConfDir");
  492. -    chdir "../$sConfDir";
  493. -    print "Saving tmp user-conf \n";
  494. -    YAML::XS::DumpFile(DESD_CONF_FILE,$rhConfig);
  495. -    unless(-d "$sUserConfDir") {
  496. -   print "conf/import directory doesn't exist, create it ? [y/n] (will be generated by compilation otherwise) \n";
  497. -   if(GetValidAnwser("y|o|n") =~ /n/i) { die "Couldn't apply conf without import folder\n"; }
  498. -   mkdir "$sUserConfDir";
  499. -    }
  500. -    chdir $sUserConfDir;
  501. -
  502. -    if($sClean){ unlink @aTargetfile; } #deleting file before applying conf if clean
  503. -    opendir(DIR, ".") or die $!;
  504. -    my @aDirfile = grep { /\.txt/ && -f "$_"  } readdir(DIR);
  505. -    close DIR;
  506. -    print "Current file in directory = [@aDirfile] target = [@aTargetfile] \n";
  507. -
  508. -    foreach my $sCurfile(@aTargetfile) {
  509. -   print "Checking if target file: [$sCurfile] exist ? ";
  510. -   if(-e -r $sCurfile) {
  511. -       print "Yes\n";
  512. -       print "$sCurfile seem to exist, overwritte it [y/n] ?\n";
  513. -       if(GetValidAnwser("y|o|n") =~ /n/i) {
  514. -       print "Only overwritte option supported atm skip file\n\n";
  515. -       next;
  516. -       }
  517. -   }
  518. -   else { print "No\n" };
  519. -
  520. -   print "\t Writting file $sCurfile \n";
  521. -   if($sCurfile eq MAP_CONF_FILE) { ApplyMapConf($rhConfig,$sCurfile); }
  522. -   elsif($sCurfile eq CHAR_CONF_FILE) { ApplyCharConf($rhConfig,$sCurfile); }
  523. -   elsif($sCurfile eq LOGIN_CONF_FILE) { ApplyLoginConf($rhConfig,$sCurfile); }
  524. -   elsif($sCurfile eq INTER_CONF_FILE) { ApplyInterConf($rhConfig,$sCurfile); }
  525. -    }
  526. -}
  527. -
  528. -sub ApplyMapConf { my ($rhUserConf,$sCurfile) = @_;
  529. -    open FILE, "> $sCurfile" || die "couldn't openfile/create $sCurfile \n";
  530. -    print FILE "userid: " . $$rhUserConf{SERV_UID}."\n";
  531. -    print FILE "passwd: " . $$rhUserConf{SERV_PW}."\n\n";
  532. -
  533. -    print FILE "map_ip: " . $$rhUserConf{SERV_WAN_IP}."\n";
  534. -    print FILE "map_port: " . $$rhUserConf{MAP_PORT}."\n";
  535. -    print FILE "char_port: " . $$rhUserConf{CHAR_PORT}."\n";
  536. -}
  537. -
  538. -sub ApplyCharConf { my ($rhUserConf,$sCurfile) = @_;
  539. -    open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
  540. -    print FILE "userid: " . $$rhUserConf{SERV_UID}."\n";
  541. -    print FILE "passwd: " . $$rhUserConf{SERV_PW}."\n\n";
  542. -
  543. -    print FILE "char_ip: " . $$rhUserConf{SERV_WAN_IP}."\n";
  544. -    print FILE "char_port: " . $$rhUserConf{CHAR_PORT}."\n";
  545. -    print FILE "login_port: " . $$rhUserConf{LOGIN_PORT}."\n";
  546. -}
  547. -
  548. -sub ApplyLoginConf { my ($rhUserConf,$sCurfile) = @_;
  549. -    open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
  550. -    print FILE "login_port: " . $$rhUserConf{LOGIN_PORT}."\n";
  551. -    print FILE "use_MD5_passwords: " . $$rhUserConf{MD5_ENABLE}."\n";
  552. -}
  553. -
  554. -sub ApplyInterConf { my ($rhUserConf,$sCurfile) = @_;
  555. -    open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
  556. -
  557. -    print FILE "sql.db_hostname: " . $$rhUserConf{SQL_HOST}."\n";
  558. -    print FILE "sql.db_port: " . $$rhUserConf{SQL_PORT}."\n";
  559. -    print FILE "sql.db_username: " . $$rhUserConf{SQL_UID}."\n";
  560. -    print FILE "sql.db_password: " . $$rhUserConf{SQL_PW}."\n";
  561. -    print FILE "sql.db_database: " . $$rhUserConf{SQL_MAIN_DB}."\n\n";
  562. -
  563. -    print FILE "char_server_ip: " . $$rhUserConf{SQL_HOST}."\n";
  564. -    print FILE "char_server_port: " . $$rhUserConf{SQL_PORT}."\n";
  565. -    print FILE "char_server_id: " . $$rhUserConf{SQL_UID}."\n";
  566. -    print FILE "char_server_pw: " . $$rhUserConf{SQL_PW}."\n";
  567. -    print FILE "char_server_db: " . $$rhUserConf{SQL_MAIN_DB}."\n\n";
  568. -
  569. -    print FILE "sql.map_server_ip: " . $$rhUserConf{SQL_HOST}."\n";
  570. -    print FILE "sql.map_server_port: " . $$rhUserConf{SQL_PORT}."\n";
  571. -    print FILE "map_server_id: " . $$rhUserConf{SQL_UID}."\n";
  572. -    print FILE "map_server_pw: " . $$rhUserConf{SQL_PW}."\n";
  573. -    print FILE "map_server_db: " . $$rhUserConf{SQL_MAIN_DB}."\n\n";
  574. -
  575. -    #todo may we want 2 schema ??
  576. -    print FILE "log_db_ip: " . $$rhUserConf{SQL_HOST} ."\n";
  577. -    print FILE "log_db_port: " . $$rhUserConf{SQL_PORT}."\n";
  578. -    print FILE "log_db_id: " . $$rhUserConf{SQL_UID}."\n";
  579. -    print FILE "log_db_pw: " . $$rhUserConf{SQL_PW}."\n";
  580. -    print FILE "log_db_db: " . $$rhUserConf{SQL_LOG_DB}."\n\n";
  581. -}
  582. -
  583. -sub AutoCheckConf { my ($rhConfig) = @_;
  584. -    print "\n AutoCheckConf, \n you can use option --force=1 to bypass this \n";
  585. -    foreach my $sKeys (keys %$rhConfig){
  586. -   my $sVal = $$rhConfig{$sKeys};
  587. -   if($sKeys =~ /PORT/) { #chek if valid port
  588. -       if(($sVal<MIN_PORT) && ($sVal>MAX_PORT)) {
  589. -       warn "Invalid port specified for $sKeys => $sVal, must be in [".MIN_PORT.":".MAX_PORT."]\n";
  590. -       return 0;
  591. -       }
  592. -       elsif(!($sKeys =~ /SQL/) && CheckUsedPort($sVal)) { #skip SQL service
  593. -       warn "Port:$sVal seem to be already in use by system \n";
  594. -       return 0;
  595. -       }
  596. -       elsif(CheckDupPort($rhConfig,$sKeys)) {
  597. -       warn "Port:$sVal seem to be already used by other key in config \n";
  598. -       return 0;
  599. -       }
  600. -   }
  601. -   elsif($sKeys =~ /IP|HOST/){ #chek if ip valid, can we reach it ? trough SYN ACK
  602. -       my $p = Net::Ping->new("syn");
  603. -       my $sTest = $p->ping($sVal);
  604. -       $p->close();
  605. -       unless($sTest) {
  606. -       print "Invalide IP/Host, ping couldn't reach $sKeys => $sVal \n NB : ICMP may just be unallowed\n";
  607. -       return 0;
  608. -       }
  609. -   }
  610. -    }
  611. -    return 1;
  612. -}
  613. -
  614. -sub CheckDupPort { my ($rhConfig,$sChkKeys) = @_;
  615. -    my $sChkport = $$rhConfig{$sChkKeys};
  616. -    foreach my $sKeys (keys %$rhConfig){
  617. -   next if($sKeys eq $sChkKeys); #skip ourself
  618. -   my $sVal = $$rhConfig{$sKeys};
  619. -   return 1 if($sChkport eq $sVal);
  620. -    }
  621. -    return 0;
  622. -}
  623. -sub CheckUsedPort { my($sPort) = @_;
  624. -    open PIPE,"netstat -nat |" or die $!;
  625. -    my @line = grep { /$sPort/ } <PIPE>;
  626. -    return scalar(@line);
  627. -}
  628. -
  629. -#Db function
  630. -sub ApplySetupDB { my($rhConfig) = @_;
  631. -    my $sDbH; #db handle
  632. -    my $sHost = $$rhConfig{SQL_HOST};
  633. -    my $sPort = $$rhConfig{SQL_PORT};
  634. -    my $sDsn = "dbi:mysql::$sHost:$sPort"; #don't try to auto connect to db
  635. -    $$rhConfig{"Dsn"} = $sDsn;
  636. -
  637. -    $sDbH = RootCo($rhConfig);
  638. -    CreateDB($sDbH,$rhConfig); #create db if not exist
  639. -    $sDbH = CreateUser($sDbH,$rhConfig); #loged as user now
  640. -    LoadSqlFile($sDbH,$rhConfig); #Load .sql file into db
  641. -    CreateServUser($sDbH,$rhConfig);
  642. -    print "SetupDb done \n";
  643. -}
  644. -
  645. -sub RootCo { my($rhConfig) = @_;
  646. -    print "\n Entering RootCo \n";
  647. -    my $sDbH;
  648. -    my $sDsn = $$rhConfig{"Dsn"}; #mysql server dest
  649. -    my $sUser = $$rhConfig{SQL_UID}; #verify desired user
  650. -    print "My dsn = $sDsn \n";
  651. -    if($sUser eq "root"){
  652. -   my $sPw = $$rhConfig{SQL_PW};
  653. -   $sDbH = DBI->connect($sDsn, "root", $sPw);
  654. -   unless($sDbH) { warn "Your root password doesn't seem valid for mysql, your desired-conf is wrong \n"; }
  655. -    }
  656. -    while($sDbH == 0) { #if can't use user to connect user root
  657. -   print "Please inser DB root passeword (this won't be saved in any configuration file, needed to create dbs and user)\n";
  658. -   my $sRPw = <>; chop($sRPw);
  659. -   $sDbH = DBI->connect($sDsn, "root", $sRPw);
  660. -    }
  661. -
  662. -    return $sDbH;
  663. -}
  664. -
  665. -sub CreateDB { my($sDbH,$rhConfig) = @_;
  666. -    print "\n Entering CreateDB \n";
  667. -    my $sDBn = $$rhConfig{SQL_MAIN_DB};
  668. -    my $sLogDBn = $$rhConfig{SQL_LOG_DB};
  669. -    my @aQuery = ("create database IF NOT EXISTS $sDBn;","create database IF NOT EXISTS $sLogDBn;");
  670. -    if($sClean){ #deleting database if clean
  671. -   unshift(@aQuery,"drop database IF EXISTS $sDBn;");
  672. -   unshift(@aQuery,"drop database IF EXISTS $sLogDBn;");
  673. -    }
  674. -    else {
  675. -   my $sRes = $sDbH->selectcol_arrayref('show databases');
  676. -   foreach my $db (@$sRes){ #relevant later for import
  677. -       if($db eq "$sDBn") { ValidateDBMerge($db); } #may exit here
  678. -       elsif ($db eq "$sLogDBn") { ValidateDBMerge($db); } #may exit here
  679. -   }
  680. -    }
  681. -    ExeQuery($sDbH,@aQuery);
  682. -}
  683. -
  684. -sub ValidateDBMerge { my($sDBn) = @_;
  685. -    warn "Database: '$sDBn' seem to already exist exiting\n";
  686. -    warn "Continue will load data in existing db would you like to continue ? [y/n] \n";
  687. -    if(GetValidAnwser("y|o|n") =~ /n/i) {
  688. -   print "Exiting setup, please either setup with another dbname or manually\n";
  689. -   exit;
  690. -    }
  691. -}
  692. -
  693. -sub CreateUser { my($sDbH,$rhConfig) = @_;
  694. -    print "\n Entering CreateUser \n";
  695. -    my $sDsn = $$rhConfig{"Dsn"};
  696. -    print "My dsn = $sDsn \n";
  697. -    my $sHost = $$rhConfig{SQL_HOST};
  698. -    my $sPw = $$rhConfig{SQL_PW};
  699. -    my $sUser = $$rhConfig{SQL_UID};
  700. -    my $sDBn = $$rhConfig{SQL_MAIN_DB};
  701. -    my $sLogDBn = $$rhConfig{SQL_LOG_DB};
  702. -
  703. -    my @aQuery= ("GRANT ALL PRIVILEGES ON $sDBn.* TO $sUser\@'$sHost' IDENTIFIED BY '$sPw' WITH GRANT OPTION", #maindb
  704. -        "GRANT ALL PRIVILEGES ON $sLogDBn.* TO $sUser\@'$sHost' IDENTIFIED BY '$sPw' WITH GRANT OPTION"); #logdb
  705. -    my $sUserDbh = DBI->connect($sDsn, $sUser, $sPw,  {"PrintError" => 0}); #try connect with user
  706. -
  707. -    if($sUserDbh && !$sClean) {
  708. -   print "User : $sUser seem to already exist, skipping creation\n"
  709. -       ."NB please check if you have correct privilege set for db: $sDBn \n";
  710. -    }
  711. -    else { #create user only if not exist (or mode clean)
  712. -   if($sClean && $sUser ne "root"){ unshift(@aQuery,"DELETE FROM mysql.user WHERE User = '$sUser';"); }
  713. -   print "Creating user $sUser for dbs : $sDBn and $sLogDBn on $sHost \n";
  714. -   ExeQuery($sDbH,@aQuery);
  715. -   $sUserDbh = DBI->connect($sDsn, $sUser, $sPw);
  716. -    }
  717. -    return $sUserDbh; #drop old co and connect with user now
  718. -}
  719. -
  720. -sub LoadSqlFile { my($sDbH,$rhConfig) = @_;
  721. -    print "\n Entering LoadSqlFile \n";
  722. -    my $sDBn = $$rhConfig{SQL_MAIN_DB};
  723. -    my $sLogDBn = $$rhConfig{SQL_LOG_DB};
  724. -
  725. -    my $sSqldir = "sql-files";
  726. -    my @aMainFiles = ("main.sql"); #add other file to load for main db here
  727. -    my @aLogFiles = ("logs.sql"); #add other file to load for log db here
  728. -
  729. -    die "$sSqldir doesn't seem to exist or coudldn't be read" unless(-d -r "../$sSqldir");
  730. -    chdir "../$sSqldir";
  731. -    print "Checking if target files exist :\n\tMain: [@aMainFiles]\n\tLog: [@aLogFiles]\n";
  732. -
  733. -    CheckAndLoad(\@aMainFiles,$rhConfig,$sDBn);
  734. -    CheckAndLoad(\@aLogFiles,$rhConfig,$sLogDBn);
  735. -
  736. -#    my $raMainQuerys = CheckAndAddQuery(\@aMainFiles,$rhConfig);
  737. -#    my $raLogQuerys = CheckAndAddQuery(\@aLogFiles,$rhConfig);
  738. -#    ExeQuery($sDbH,"use $sDBn;",@$raMainQuerys,"use $sLogDBn;", @$raLogQuerys);
  739. -}
  740. -
  741. -sub CheckAndLoad { my ($raFiles,$rhConfig,$sDBn) = @_;
  742. -    my $sHost = $$rhConfig{SQL_HOST};
  743. -    my $sPw = $$rhConfig{SQL_PW};
  744. -    my $sUser = $$rhConfig{SQL_UID};
  745. -
  746. -    foreach(@$raFiles) {
  747. -   unless(-f -r $_){
  748. -       print "File : $_ doesn't seem to exist or was unreadable skipped\n";
  749. -       next;
  750. -   }
  751. -   my $sFileFullPath = Cwd::abs_path($_);
  752. -   system("mysql -u $sUser --password=$sPw -h $sHost $sDBn < $sFileFullPath");
  753. -    }
  754. -}
  755. -
  756. -# query failure atm (shitty perl)
  757. -#sub CheckAndAddQuery { my ($raFiles) = @_;
  758. -#    my @aQuery = ();
  759. -#    foreach(@$raFiles) {
  760. -#  unless(-f -r $_){
  761. -#      print "File : $_ doesn't seem to exist or was unreadable skipped\n";
  762. -#      next;
  763. -#  }
  764. -#  my $sFileFullPath = Cwd::abs_path($_);
  765. -#  my $sInfileQuery = "source $sFileFullPath";
  766. -#  #my $sInfileQuery = "\\. $sFileFullPath;";
  767. -#  push(@aQuery,$sInfileQuery);
  768. -#
  769. -#    }
  770. -#    return \@aQuery;
  771. -#}
  772. -
  773. -sub CreateServUser { my($sDbH,$rhConfig) = @_;
  774. -    my $sUid = $$rhConfig{SERV_UID};
  775. -    my $sUpw = $$rhConfig{SERV_PW};
  776. -    my $sMD5 = $$rhConfig{MD5_ENABLE};
  777. -    my $sDBn = $$rhConfig{SQL_MAIN_DB};
  778. -    my @aQuery = ("use $sDBn;","DELETE FROM login WHERE sex='S';");
  779. -    if($sMD5){ push(@aQuery,"INSERT INTO login(account_id, userid, user_pass, sex) values(1,'$sUid',MD5('$sUpw'),'S');"); }
  780. -    else { push(@aQuery,"INSERT INTO login(account_id, userid, user_pass, sex) values(1,'$sUid','$sUpw','S');"); }
  781. -    ExeQuery($sDbH,@aQuery);
  782. -}
  783. -
  784. -sub ExeQuery { my $sDbH = shift;
  785. -    my @aQuery = @_;
  786. -    print "my querys are = [ @aQuery ]\n";
  787. -    foreach(@aQuery) {
  788. -   unless($sDbH->do($_)){ print "Failed to execute query : $_ =>  $DBI::errstr \n"; }
  789. -    }
  790. -}
  791. -
  792. -#Common
  793. -sub GetValidateConf { my($rhConfig) = @_;
  794. -    my $rhUserConf;
  795. -    while (1) {
  796. -   $rhUserConf = GetUserConf($rhConfig);
  797. -   print "\n Please Check desired conf \n";
  798. -   ShowConfig($rhUserConf);
  799. -   print "Would you like to apply those setting ? [y/n] ";
  800. -   last if(GetValidAnwser("y|o|n") =~ /y|o/i);
  801. -   print "\n Restarting configuration sequence \n";
  802. -    }
  803. -    return $rhUserConf;
  804. -}
  805. -
  806. -sub GetUserConf { my ($rhDefConf) = @_;
  807. -    my %hConf;
  808. -    my @sortedkeys = sort keys (%$rhDefConf);
  809. -    foreach my $sKey (@sortedkeys){
  810. -   my $sVal = $$rhDefConf{$sKey};
  811. -   print "$sKey : [$sVal] ";
  812. -   my $sAnwser = <>; chop($sAnwser);
  813. -   $hConf{"$sKey"} = $sAnwser || $sVal;
  814. -    }
  815. -    return \%hConf;
  816. -}
  817. -
  818. -sub ShowConfig { my ($rhUserConf) = @_;
  819. -    my @sortedkeys = sort keys (%$rhUserConf);
  820. -    foreach my $sKey (@sortedkeys){
  821. -   my $sVal = $$rhUserConf{$sKey};
  822. -   if(ref($sVal) eq 'ARRAY') {  print " $sKey => [@$sVal] \n";}
  823. -   else { print " $sKey => [$sVal] \n"; }
  824. -    }
  825. -}
  826. -
  827. -sub GetValidAnwser { my($sOptReg) = @_;
  828. -    my $sAnwser = "";
  829. -    if($sAutoyes) { $sAnwser="y"; print "\n"; }
  830. -    else {
  831. -   while(!($sAnwser =~ /$sOptReg/i)) {
  832. -       $sAnwser = <>; chop($sAnwser);
  833. -       print "Please enter a valid option : $sOptReg " unless($sAnwser =~ /$sOptReg/i);
  834. -   }
  835. -    }
  836. -    return $sAnwser;
  837. -}
  838. -
  839. -sub GetDesiredConf { my ($rhDefConf) = @_;
  840. -    print "Please enter desired confiration\n";
  841. -    my $rhUserConf;
  842. -    my $sDesdConfFile = $sDsdFile;
  843. -    #if default search in conf otherwise get specified name with cwd
  844. -    if($sDsdFile eq DESD_CONF_FILE) { $sDesdConfFile = "../conf/".$sDsdFile; }
  845. -
  846. -    print "Checking if there an Desiredconf file \n";
  847. -    if(-e -r $sDesdConfFile) {
  848. -   print "Found Desiredconf \n";
  849. -   $rhUserConf = YAML::XS::LoadFile($sDesdConfFile);
  850. -   if(!($rhUserConf)){
  851. -       print "Desiredconf seem invalid or empty, please check file and relaunch setup or entry Config\n";
  852. -       $rhUserConf=GetValidateConf($rhDefConf);
  853. -   }
  854. -   else {
  855. -       ShowConfig($rhUserConf);
  856. -       print "Would you like to apply those setting ? [y/n] ";
  857. -       if(GetValidAnwser("y|o|n") =~ /n/i) {  #no take user entry
  858. -       print "DesiredConf not applyed, please enter config\n";
  859. -       $rhUserConf=GetValidateConf($rhDefConf);
  860. -       }
  861. -   }
  862. -    }
  863. -    else { #no files take user entry
  864. -   print "No Desiredconf found, please enter config \n";
  865. -   $rhUserConf=GetValidateConf($rhDefConf);
  866. -    }
  867. -    return $rhUserConf;
  868. -}
  869. Index: db/const.txt
  870. --- db/const.txt Base (BASE)
  871. +++ db/const.txt Locally Modified (Based On LOCAL)
  872. @@ -350,7 +350,7 @@
  873.  mf_noreturn    33
  874.  mf_nowarpto    34
  875.  mf_nightmaredrop   35
  876. -mf_restricted  36
  877. +mf_zone    36
  878.  mf_nocommand   37
  879.  mf_nodrop  38
  880.  mf_jexp    39
  881. Index: db/pre-re/item_noequip.txt
  882. --- db/pre-re/item_noequip.txt Base (BASE)
  883. +++ db/pre-re/item_noequip.txt Locally Deleted
  884. @@ -1,60 +0,0 @@
  885. -// The equipment/items/cards restriction file
  886. -// here you define which items may not be used at PvP / GvG
  887. -// format: <item id>,<mode>
  888. -// mode
  889. -// 1    - restricted in normal maps
  890. -// 2    - restricted in PVP
  891. -// 4    - restricted in GVG
  892. -// 8    - restricted in Battlegrounds
  893. -// Restricted zones - they're configured by 'restricted <number>' mapflag
  894. -// 32   - restricted in zone 1
  895. -// 64   - restricted in zone 2
  896. -// 128  - restricted in zone 3
  897. -// 256  - restricted in zone 4
  898. -// 512  - restricted in zone 5
  899. -// 1024 - restricted in zone 6
  900. -// 2048 - restricted in zone 7
  901. -
  902. -//Examples:
  903. -//1201,1 you can't use KNIFE(ID 1201) on normal maps
  904. -//608,4 you can't use Yggdrasil Seed(ID 608) on both GvG and WoE Castles
  905. -//4174,6 Forbid Deviling Card in every PVP or GVG map, and during woes.
  906. -//501,32 you can't use Red Potion on map marked as 'restricted zone 1'
  907. -//502,64 you can't use Orange Potion on map marked as 'restricted zone 2'
  908. -//503,128 you can't use Yellow Potion on map marked as 'restricted zone 3'
  909. -// you can even mix modes
  910. -//519,322 (256+64+2) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4'
  911. -
  912. -//PVP
  913. -14529,2 //Greed Scroll
  914. -
  915. -//GVG
  916. -12218,4 //LV5 Assumptio Scroll
  917. -14529,4 //Greed Scroll
  918. -14590,4 //Party Assumptio 5 Scroll
  919. -
  920. -//BATTLEGROUND
  921. -12218,8 //LV5 Assumptio Scroll
  922. -14590,8 //Party Assumptio 5 Scroll
  923. -
  924. -
  925. -//Zone 1 - Aldebaran Turbo Track
  926. -601,32 //Fly Wing
  927. -605,32 //Anodyne
  928. -506,32 //Green Potion
  929. -525,32 //Panacea
  930. -
  931. -//Zone 2 - Jail
  932. -601,64 //Fly Wing - not really needed here but ...
  933. -602,64 //Butterfly Wing - also not needed
  934. -12212,64 //Giant Fly Wing
  935. -14582,64
  936. -14583,64
  937. -14584,64
  938. -14585,64
  939. -
  940. -//Zone 3 - Izlude Battle Arena
  941. -601,128 //Fly Wing
  942. -
  943. -//Zone 7 - Towns
  944. -14529,2048 //Greed Scroll
  945. Index: db/pre-re/map_zone_db.conf
  946. --- db/pre-re/map_zone_db.conf No Base Revision
  947. +++ db/pre-re/map_zone_db.conf Locally New
  948. @@ -0,0 +1,288 @@
  949. +//= rAthena Map Zone Database
  950. +//== by [Ind/Hercules]
  951. +//= A unlimited number of zones may be created, a zone
  952. +//= may be used to create a set of disabled items, disabled skills
  953. +//= and mapflags to be used by as many maps as one chooses,
  954. +//= maps can be linked to a specific zone through the zone mapflag
  955. +//= '<map name><tab>mapflag<tab>zone<tab><zone name>'
  956. +//== available types for 'disabled_skills':
  957. +//= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE
  958. +zones: (
  959. +{
  960. +   /* Normal zone is applied to all maps that are not pkable (where players cant fight each other)  */
  961. +   /* However, it wont be applied to maps with its own zones (specified thru mapflag) */
  962. +   name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
  963. +
  964. +   disabled_skills: {
  965. +       WM_LULLABY_DEEPSLEEP: "PLAYER"
  966. +       WM_SIRCLEOFNATURE: "PLAYER"
  967. +       WM_SATURDAY_NIGHT_FEVER: "PLAYER"
  968. +       SO_ARRULLO: "PLAYER"
  969. +       CG_HERMODE: "PLAYER"
  970. +   }
  971. +
  972. +   disabled_items: {
  973. +
  974. +   }
  975. +   mapflags: ( )
  976. +},
  977. +{
  978. +   /* PvP zone is applied to all maps with a pvp mapflag */
  979. +   name: "PvP" /* changing this name requires MAP_ZONE_PVP_NAME to also be changed in src/map/map.h file */
  980. +
  981. +   disabled_skills: {
  982. +       BS_GREED: "PLAYER"
  983. +       CG_HERMODE: "PLAYER"
  984. +   }
  985. +
  986. +   disabled_items: {
  987. +       Greed_Scroll: true
  988. +   }
  989. +},
  990. +{
  991. +   /* PK Mode zone is only used when server is on pk_mode (battle.conf),
  992. +       it applies to all pvp maps that don't have their own zone */
  993. +   name: "PK Mode" /* changing this name requires MAP_ZONE_PK_NAME to also be changed in src/map/map.h file */
  994. +
  995. +   disabled_skills: {
  996. +
  997. +   }
  998. +
  999. +   disabled_items: {
  1000. +
  1001. +   }
  1002. +
  1003. +   /* PK Mode Damage Reductions */
  1004. +   /* - weapon_damage_rate -40% */
  1005. +   /* - magic_damage_rate  -40% */
  1006. +   /* - misc_damage_rate   -40% */
  1007. +   /* - long_damage_rate   -30% */
  1008. +   /* - short_damage_rate  -20% */
  1009. +   mapflags: (
  1010. +       "weapon_damage_rate 60",
  1011. +       "magic_damage_rate  60",
  1012. +       "misc_damage_rate   60",
  1013. +       "long_damage_rate   70",
  1014. +       "short_damage_rate  80" )
  1015. +},
  1016. +{
  1017. +   /* GvG zone is applied to all maps with a pvp mapflag */
  1018. +   name: "GvG" /* changing this name requires MAP_ZONE_GVG_NAME to also be changed in src/map/map.h file */
  1019. +
  1020. +   disabled_skills: {
  1021. +       AL_TELEPORT: "PLAYER"
  1022. +       AL_WARP: "PLAYER"
  1023. +       WZ_ICEWALL: "PLAYER"
  1024. +       TF_BACKSLIDING: "PLAYER"
  1025. +       RG_INTIMIDATE: "PLAYER"
  1026. +       WE_CALLPARTNER: "PLAYER"
  1027. +       HP_ASSUMPTIO: "PLAYER"
  1028. +       HP_BASILICA: "PLAYER"
  1029. +       CG_MOONLIT: "PLAYER"
  1030. +       WE_CALLPARENT: "PLAYER"
  1031. +       WE_CALLBABY: "PLAYER"
  1032. +       CR_CULTIVATION: "PLAYER"
  1033. +       NJ_KIRIKAGE: "PLAYER"
  1034. +       CASH_ASSUMPTIO: "PLAYER"
  1035. +       BS_GREED: "PLAYER"
  1036. +       SC_FATALMENACE: "PLAYER"
  1037. +       SC_DIMENSIONDOOR: "PLAYER"
  1038. +   }
  1039. +
  1040. +   disabled_items: {
  1041. +       Assumptio_5_Scroll: true
  1042. +       Greed_Scroll: true
  1043. +       Pty_Assumptio_Scroll: true
  1044. +   }
  1045. +   /* 5 second duration increase on GvG */
  1046. +   /* knockback disabled */
  1047. +   /* GvG Mode Damage Reductions */
  1048. +   /* - weapon_damage_rate -40% */
  1049. +   /* - magic_damage_rate  -40% */
  1050. +   /* - misc_damage_rate   -40% */
  1051. +   /* - long_damage_rate   -20% */
  1052. +   /* - short_damage_rate  -20% */
  1053. +   mapflags: ( "invincible_time_inc    5000",
  1054. +               "noknockback",
  1055. +               "weapon_damage_rate 60",
  1056. +               "magic_damage_rate  60",
  1057. +               "misc_damage_rate   60",
  1058. +               "long_damage_rate   80",
  1059. +               "short_damage_rate  80" )
  1060. +
  1061. +},
  1062. +{
  1063. +   /* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */
  1064. +   name: "Battlegrounds" /* changing this name requires MAP_ZONE_BG_NAME to also be changed in src/map/map.h file */
  1065. +
  1066. +   disabled_skills: {
  1067. +       AL_TELEPORT: "PLAYER"
  1068. +       AL_WARP: "PLAYER"
  1069. +       WZ_ICEWALL: "PLAYER"
  1070. +       TF_BACKSLIDING: "PLAYER"
  1071. +       RG_INTIMIDATE: "PLAYER"
  1072. +       MO_BODYRELOCATION: "PLAYER"
  1073. +       WE_CALLPARTNER: "PLAYER"
  1074. +       HP_ASSUMPTIO: "PLAYER"
  1075. +       HP_BASILICA: "PLAYER"
  1076. +       CG_MOONLIT: "PLAYER"
  1077. +       WE_CALLPARENT: "PLAYER"
  1078. +       WE_CALLBABY: "PLAYER"
  1079. +       CR_CULTIVATION: "PLAYER"
  1080. +       TK_RUN: "PLAYER"
  1081. +       TK_HIGHJUMP: "PLAYER"
  1082. +       SG_FEEL: "PLAYER"
  1083. +       SG_SUN_WARM: "PLAYER"
  1084. +       SG_MOON_WARM: "PLAYER"
  1085. +       SG_STAR_WARM: "PLAYER"
  1086. +       SG_SUN_COMFORT: "PLAYER"
  1087. +       SG_MOON_COMFORT: "PLAYER"
  1088. +       SG_STAR_COMFORT: "PLAYER"
  1089. +       SG_HATE: "PLAYER"
  1090. +       SG_SUN_ANGER: "PLAYER"
  1091. +       SG_MOON_ANGER: "PLAYER"
  1092. +       SG_STAR_ANGER: "PLAYER"
  1093. +       SG_SUN_BLESS: "PLAYER"
  1094. +       SG_MOON_BLESS: "PLAYER"
  1095. +       SG_STAR_BLESS: "PLAYER"
  1096. +       NJ_KIRIKAGE: "PLAYER"
  1097. +       CASH_ASSUMPTIO: "PLAYER"
  1098. +       SC_FATALMENACE: "PLAYER"
  1099. +       SC_DIMENSIONDOOR: "PLAYER"
  1100. +   }
  1101. +   disabled_items: {
  1102. +       Assumptio_5_Scroll: true
  1103. +       Pty_Assumptio_Scroll: true
  1104. +   }
  1105. +
  1106. +   /* knockback disabled */
  1107. +   /* Battlegrounds Damage Reductions */
  1108. +   /* - weapon_damage_rate -30% */
  1109. +   /* - magic_damage_rate  -30% */
  1110. +   /* - misc_damage_rate   -30% */
  1111. +   /* - long_damage_rate   -25% */
  1112. +   /* - short_damage_rate  -25% */
  1113. +   mapflags: ( "noknockback",
  1114. +               "weapon_damage_rate 70",
  1115. +               "magic_damage_rate  70",
  1116. +               "misc_damage_rate   70",
  1117. +               "long_damage_rate   75",
  1118. +               "short_damage_rate  75" )
  1119. +
  1120. +},
  1121. +{
  1122. +   name: "Aldebaran Turbo Track"
  1123. +
  1124. +   disabled_skills: {
  1125. +       SM_ENDURE: "PLAYER"
  1126. +       AL_TELEPORT: "PLAYER"
  1127. +       AL_WARP: "PLAYER"
  1128. +       AL_CURE: "PLAYER"
  1129. +       TF_HIDING: "PLAYER"
  1130. +       WZ_ICEWALL: "PLAYER"
  1131. +       AS_CLOAKING: "PLAYER"
  1132. +       RG_INTIMIDATE: "PLAYER"
  1133. +       MO_BODYRELOCATION: "PLAYER"
  1134. +       LK_CONCENTRATION: "PLAYER"
  1135. +       LK_BERSERK: "PLAYER"
  1136. +       HP_BASILICA: "PLAYER"
  1137. +       WS_CARTBOOST: "PLAYER"
  1138. +       ST_CHASEWALK: "PLAYER"
  1139. +       CG_MOONLIT: "PLAYER"
  1140. +       SC_FATALMENACE: "PLAYER"
  1141. +       SC_DIMENSIONDOOR: "PLAYER"
  1142. +       GN_CARTBOOST: "PLAYER"
  1143. +   }
  1144. +
  1145. +   disabled_items: {
  1146. +       Wing_Of_Fly: true
  1147. +       Anodyne: true
  1148. +       Green_Potion: true
  1149. +       Panacea: true
  1150. +   }
  1151. +},
  1152. +{
  1153. +   name: "Jail"
  1154. +
  1155. +   disabled_skills: {
  1156. +       TK_JUMPKICK: "PLAYER"
  1157. +       TK_HIGHJUMP: "PLAYER"
  1158. +   }
  1159. +
  1160. +   disabled_items: {
  1161. +       Wing_Of_Fly: true
  1162. +       Wing_Of_Butterfly: true
  1163. +       Giant_Fly_Wing: true
  1164. +       WOB_Rune: true
  1165. +       WOB_Schwaltz: true
  1166. +       WOB_Rachel: true
  1167. +       WOB_Local: true
  1168. +   }
  1169. +},
  1170. +{
  1171. +   name: "Izlude Battle Arena"
  1172. +
  1173. +   disabled_skills: {
  1174. +       RG_INTIMIDATE: "PLAYER"
  1175. +       AL_TELEPORT: "PLAYER"
  1176. +       SC_FATALMENACE: "PLAYER"
  1177. +       SC_DIMENSIONDOOR: "PLAYER"
  1178. +   }
  1179. +
  1180. +   disabled_items: {
  1181. +       Wing_Of_Fly: true
  1182. +   }
  1183. +},
  1184. +{
  1185. +   name: "GvG2"
  1186. +   inherit: ( "GvG" ) /* will import all gvg has */
  1187. +
  1188. +   disabled_skills: {
  1189. +       TK_HIGHJUMP: "PLAYER"
  1190. +       SA_ABRACADABRA: "PLAYER"
  1191. +   }
  1192. +},
  1193. +{
  1194. +   name: "Sealed Shrine"
  1195. +
  1196. +   disabled_skills: {
  1197. +       MG_SAFETYWALL: "PLAYER"
  1198. +       AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
  1199. +       RG_INTIMIDATE: "PLAYER | MONSTER"
  1200. +       HP_ASSUMPTIO: "PLAYER"
  1201. +       CASH_ASSUMPTIO: "PLAYER"
  1202. +       SC_FATALMENACE: "PLAYER"
  1203. +       SC_DIMENSIONDOOR: "PLAYER"
  1204. +   }
  1205. +},
  1206. +{
  1207. +   name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */
  1208. +
  1209. +   disabled_skills: {
  1210. +       AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
  1211. +       WZ_ICEWALL: "PLAYER"
  1212. +       RG_INTIMIDATE: "PLAYER | MONSTER"
  1213. +       PF_SPIDERWEB: "PLAYER"
  1214. +       NPC_EXPULSION: "PLAYER"
  1215. +       SC_FATALMENACE: "PLAYER"
  1216. +       SC_DIMENSIONDOOR: "PLAYER"
  1217. +   }
  1218. +},
  1219. +{
  1220. +   name: "Towns"
  1221. +
  1222. +   disabled_skills: {
  1223. +       AM_CANNIBALIZE: "PLAYER"
  1224. +       AM_SPHEREMINE: "PLAYER"
  1225. +       CR_CULTIVATION: "PLAYER"
  1226. +       BS_GREED: "PLAYER"
  1227. +       SC_MANHOLE: "PLAYER"
  1228. +       WM_POEMOFNETHERWORLD: "PLAYER"
  1229. +       GN_WALLOFTHORN: "PLAYER"
  1230. +   }
  1231. +
  1232. +   disabled_items: {
  1233. +       Greed_Scroll: true
  1234. +   }
  1235. +}
  1236. +)
  1237. \ No newline at end of file
  1238. Index: db/pre-re/skill_db.txt
  1239. --- db/pre-re/skill_db.txt Base (BASE)
  1240. +++ db/pre-re/skill_db.txt Locally Modified (Based On LOCAL)
  1241. @@ -38,6 +38,7 @@
  1242.  //    0x1000- disable usage on enemies (for non-offensive skills).
  1243.  //    0x2000- skill ignores land protector (e.g. arrow shower)
  1244.  //    0x4000- chorus skill
  1245. +//    0x8000- skill wont be passed to clones
  1246.  // 13 maxcount: max amount of skill instances to place on the ground when
  1247.  //    player_land_skill_limit/monster_land_skill_limit is enabled. For skills
  1248.  //    that attack using a path, this is the path length to be used.
  1249. @@ -735,7 +736,6 @@
  1250.  2231,0,6,4,0,0x1,0,1,1,yes,0,0,0,magic,0,  WL_READING_SB,Reading Spellbook
  1251.  2232,0,0,0,0,0,0,5,0,no,0,0,0,none,0,      WL_FREEZE_SP,Freeze Spell
  1252.  
  1253. -
  1254.  //****
  1255.  // GC Guillotine Cross
  1256.  //****
  1257. Index: db/pre-re/skill_nocast_db.txt
  1258. --- db/pre-re/skill_nocast_db.txt Base (BASE)
  1259. +++ db/pre-re/skill_nocast_db.txt Locally Deleted
  1260. @@ -1,154 +0,0 @@
  1261. -// Forbidden Skills Database
  1262. -//
  1263. -// Structure of Database:
  1264. -// SkillID,Flag
  1265. -//
  1266. -// Legend for 'Flag' field (bitmask):
  1267. -//  1 = Cannot be used in normal maps
  1268. -//  2 = Cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
  1269. -//  4 = Cannot be used in GvG maps
  1270. -//  8 = Cannot be used in Battleground maps
  1271. -//  16 = Cannot be cloned (clones will not copy this skill)
  1272. -//  Restricted zones - they're configured by 'restricted <number>' mapflag
  1273. -//  32 = Cannot be used in zone 1 maps
  1274. -//  64 = Cannot be used in zone 2 maps
  1275. -//  128 = Cannot be used in zone 3 maps
  1276. -//  256 = Cannot be used in zone 4 maps
  1277. -//  512 = Cannot be used in zone 5 maps
  1278. -//  1024 = Cannot be used in zone 6 maps
  1279. -//  2048 = Cannot be used in zone 7 maps
  1280. -//
  1281. -// Example:
  1282. -// 8,6 = Endure cannot be used in PvP and GvG maps (2+4)
  1283. -
  1284. -//Normal
  1285. -2422,1 //WM_LULLABY_DEEPSLEEP
  1286. -2423,1 //WM_SIRCLEOFNATURE
  1287. -2430,1 //WM_SATURDAY_NIGHT_FEVER
  1288. -2455,1 //SO_ARRULLO
  1289. -
  1290. -//PVP
  1291. -1013,2 //BS_GREED
  1292. -
  1293. -//GVG
  1294. -26,4   //AL_TELEPORT
  1295. -27,4   //AL_WARP
  1296. -87,4   //WZ_ICEWALL
  1297. -150,4  //TF_BACKSLIDING
  1298. -219,4  //RG_INTIMIDATE
  1299. -336,4  //WE_CALLPARTNER
  1300. -361,4  //HP_ASSUMPTIO
  1301. -362,4  //HP_BASILICA
  1302. -395,4  //CG_MOONLIT
  1303. -409,4  //WE_CALLPARENT
  1304. -410,4  //WE_CALLBABY
  1305. -491,4  //CR_CULTIVATION
  1306. -530,4  //NJ_KIRIKAGE
  1307. -691,4  //CASH_ASSUMPTIO
  1308. -1013,4 //BS_GREED
  1309. -2284,4 //SC_FATALMENACE
  1310. -2300,4 //SC_DIMENSIONDOOR
  1311. -
  1312. -//BATTLEGROUND
  1313. -26,8   //AL_TELEPORT
  1314. -27,8   //AL_WARP
  1315. -87,8   //WZ_ICEWALL
  1316. -150,8  //TF_BACKSLIDING
  1317. -219,8  //RG_INTIMIDATE
  1318. -264,8  //MO_BODYRELOCATION
  1319. -336,8  //WE_CALLPARTNER
  1320. -361,8  //HP_ASSUMPTIO
  1321. -362,8  //HP_BASILICA
  1322. -395,8  //CG_MOONLIT
  1323. -409,8  //WE_CALLPARENT
  1324. -410,8  //WE_CALLBABY
  1325. -491,8  //CR_CULTIVATION
  1326. -411,8  //TK_RUN
  1327. -426,8  //TK_HIGHJUMP
  1328. -427,8  //SG_FEEL
  1329. -428,8  //SG_SUN_WARM
  1330. -429,8  //SG_MOON_WARM
  1331. -430,8  //SG_STAR_WARM
  1332. -431,8  //SG_SUN_COMFORT
  1333. -432,8  //SG_MOON_COMFORT
  1334. -433,8  //SG_STAR_COMFORT
  1335. -434,8  //SG_HATE
  1336. -435,8  //SG_SUN_ANGER
  1337. -436,8  //SG_MOON_ANGER
  1338. -437,8  //SG_STAR_ANGER
  1339. -438,8  //SG_SUN_BLESS
  1340. -439,8  //SG_MOON_BLESS
  1341. -440,8  //SG_STAR_BLESS
  1342. -530,8  //NJ_KIRIKAGE
  1343. -691,8  //CASH_ASSUMPITO
  1344. -2284,8 //SC_FATALMENACE
  1345. -2300,8 //SC_DIMENSIONDOOR
  1346. -
  1347. -//mixed
  1348. -488,3  //CG_HERMODE
  1349. -3013,3 //KO_KYOUGAKU
  1350. -
  1351. -//Clone Forbidden/pointless skills
  1352. -77,16  //PR_TURNUNDEAD
  1353. -79,16  //PR_MAGNUS
  1354. -
  1355. -//Zone 1 - Aldebaran Turbo Track
  1356. -8,32   //SM_ENDURE
  1357. -26,32  //AL_TELEPORT
  1358. -27,32  //AL_WARP
  1359. -35,32  //AL_CURE
  1360. -51,32  //TF_HIDING
  1361. -87,32  //WZ_ICEWALL
  1362. -135,32 //AS_CLOAKING
  1363. -219,32 //RG_INTIMIDATE
  1364. -264,32 //MO_BODYRELOCATION
  1365. -357,32 //LK_CONCENTRATION
  1366. -359,32 //LK_BERSERK
  1367. -362,32 //HP_BASILICA
  1368. -387,32 //WS_CARTBOOST
  1369. -389,32 //ST_CHASEWALK
  1370. -395,32 //CG_MOONLIT
  1371. -2284,32    //SC_FATALMENACE
  1372. -2300,32    //SC_DIMENSIONDOOR
  1373. -2478,32    //GN_CARTBOOST
  1374. -
  1375. -//Zone 2 - Jail
  1376. -421,64 //TK_JUMPKICK
  1377. -426,64 //TK_HIGHJUMP
  1378. -
  1379. -//Zone 3 - Izlude Battle Arena
  1380. -219,128 //RG_INTIMIDATE
  1381. -26,128 //AL_TELEPORT
  1382. -2284,128   //SC_FATALMENACE
  1383. -2300,128   //SC_DIMENSIONDOOR
  1384. -
  1385. -//Zone 4 - WoE:SE
  1386. -426,256 //TK_HIGHJUMP
  1387. -290,256    //SA_ABRACADABRA
  1388. -
  1389. -//Zone 5 - Sealed Shrine
  1390. -12,512 //MG_SAFETYWALL
  1391. -26,512 //AL_TELEPORT
  1392. -219,512    //RG_INTIMIDATE
  1393. -361,512    //HP_ASSUMPTIO
  1394. -691,512    //CASH_ASSUMPTIO
  1395. -2284,512   //SC_FATALMENACE
  1396. -2300,512   //SC_DIMENSIONDOOR
  1397. -
  1398. -//Zone 6 - Endless Tower, Orc's Memory, Nidhoggur's Nest
  1399. -26,1024    //AL_TELEPORT
  1400. -87,1024    //WZ_ICEWALL
  1401. -219,1024   //RG_INTIMIDATE
  1402. -405,1024   //PF_SPIDERWEB
  1403. -674,1024   //NPC_EXPULSION
  1404. -2284,1024  //SC_FATALMENACE
  1405. -2300,1024  //SC_DIMENSIONDOOR
  1406. -
  1407. -//Zone 7 - Towns
  1408. -232,2048   //AM_CANNIBALIZE
  1409. -233,2048   //AM_SPHEREMINE
  1410. -491,2048   //CR_CULTIVATION
  1411. -1013,2048  //BS_GREED
  1412. -2299,2048  //SC_MANHOLE
  1413. -2419,2048  //WM_POEMOFNETHERWORLD
  1414. -2482,2048  //GN_WALLOFTHORN
  1415. Index: db/re/item_noequip.txt
  1416. --- db/re/item_noequip.txt Base (BASE)
  1417. +++ db/re/item_noequip.txt Locally Deleted
  1418. @@ -1,60 +0,0 @@
  1419. -// The equipment/items/cards restriction file
  1420. -// here you define which items may not be used at PvP / GvG
  1421. -// format: <item id>,<mode>
  1422. -// mode
  1423. -// 1    - restricted in normal maps
  1424. -// 2    - restricted in PVP
  1425. -// 4    - restricted in GVG
  1426. -// 8    - restricted in Battlegrounds
  1427. -// Restricted zones - they're configured by 'restricted <number>' mapflag
  1428. -// 32   - restricted in zone 1
  1429. -// 64   - restricted in zone 2
  1430. -// 128  - restricted in zone 3
  1431. -// 256  - restricted in zone 4
  1432. -// 512  - restricted in zone 5
  1433. -// 1024 - restricted in zone 6
  1434. -// 2048 - restricted in zone 7
  1435. -
  1436. -//Examples:
  1437. -//1201,1 you can't use KNIFE(ID 1201) on normal maps
  1438. -//608,4 you can't use Yggdrasil Seed(ID 608) on both GvG and WoE Castles
  1439. -//4174,6 Forbid Deviling Card in every PVP or GVG map, and during woes.
  1440. -//501,32 you can't use Red Potion on map marked as 'restricted zone 1'
  1441. -//502,64 you can't use Orange Potion on map marked as 'restricted zone 2'
  1442. -//503,128 you can't use Yellow Potion on map marked as 'restricted zone 3'
  1443. -// you can even mix modes
  1444. -//519,322 (256+64+2) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4'
  1445. -
  1446. -//PVP
  1447. -14529,2 //Greed Scroll
  1448. -
  1449. -//GVG
  1450. -12218,4 //LV5 Assumptio Scroll
  1451. -14529,4 //Greed Scroll
  1452. -14590,4 //Party Assumptio 5 Scroll
  1453. -
  1454. -//BATTLEGROUND
  1455. -12218,8 //LV5 Assumptio Scroll
  1456. -14590,8 //Party Assumptio 5 Scroll
  1457. -
  1458. -
  1459. -//Zone 1 - Aldebaran Turbo Track
  1460. -601,32 //Fly Wing
  1461. -605,32 //Anodyne
  1462. -506,32 //Green Potion
  1463. -525,32 //Panacea
  1464. -
  1465. -//Zone 2 - Jail
  1466. -601,64 //Fly Wing - not really needed here but ...
  1467. -602,64 //Butterfly Wing - also not needed
  1468. -12212,64 //Giant Fly Wing
  1469. -14582,64
  1470. -14583,64
  1471. -14584,64
  1472. -14585,64
  1473. -
  1474. -//Zone 3 - Izlude Battle Arena
  1475. -601,128 //Fly Wing
  1476. -
  1477. -//Zone 7 - Towns
  1478. -14529,2048 //Greed Scroll
  1479. Index: db/re/map_zone_db.conf
  1480. --- db/re/map_zone_db.conf No Base Revision
  1481. +++ db/re/map_zone_db.conf Locally New
  1482. @@ -0,0 +1,288 @@
  1483. +//= rAthena Map Zone Database
  1484. +//== by [Ind/Hercules]
  1485. +//= A unlimited number of zones may be created, a zone
  1486. +//= may be used to create a set of disabled items, disabled skills
  1487. +//= and mapflags to be used by as many maps as one chooses,
  1488. +//= maps can be linked to a specific zone through the zone mapflag
  1489. +//= '<map name><tab>mapflag<tab>zone<tab><zone name>'
  1490. +//== available types for 'disabled_skills':
  1491. +//= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE
  1492. +zones: (
  1493. +{
  1494. +   /* Normal zone is applied to all maps that are not pkable (where players cant fight each other)  */
  1495. +   /* However, it wont be applied to maps with its own zones (specified thru mapflag) */
  1496. +   name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
  1497. +
  1498. +   disabled_skills: {
  1499. +       WM_LULLABY_DEEPSLEEP: "PLAYER"
  1500. +       WM_SIRCLEOFNATURE: "PLAYER"
  1501. +       WM_SATURDAY_NIGHT_FEVER: "PLAYER"
  1502. +       SO_ARRULLO: "PLAYER"
  1503. +       CG_HERMODE: "PLAYER"
  1504. +   }
  1505. +
  1506. +   disabled_items: {
  1507. +
  1508. +   }
  1509. +   mapflags: ( )
  1510. +},
  1511. +{
  1512. +   /* PvP zone is applied to all maps with a pvp mapflag */
  1513. +   name: "PvP" /* changing this name requires MAP_ZONE_PVP_NAME to also be changed in src/map/map.h file */
  1514. +
  1515. +   disabled_skills: {
  1516. +       BS_GREED: "PLAYER"
  1517. +       CG_HERMODE: "PLAYER"
  1518. +   }
  1519. +
  1520. +   disabled_items: {
  1521. +       Greed_Scroll: true
  1522. +   }
  1523. +},
  1524. +{
  1525. +   /* PK Mode zone is only used when server is on pk_mode (battle.conf),
  1526. +       it applies to all pvp maps that don't have their own zone */
  1527. +   name: "PK Mode" /* changing this name requires MAP_ZONE_PK_NAME to also be changed in src/map/map.h file */
  1528. +
  1529. +   disabled_skills: {
  1530. +
  1531. +   }
  1532. +
  1533. +   disabled_items: {
  1534. +
  1535. +   }
  1536. +
  1537. +   /* PK Mode Damage Reductions */
  1538. +   /* - weapon_damage_rate -40% */
  1539. +   /* - magic_damage_rate  -40% */
  1540. +   /* - misc_damage_rate   -40% */
  1541. +   /* - long_damage_rate   -30% */
  1542. +   /* - short_damage_rate  -20% */
  1543. +   mapflags: (
  1544. +       "weapon_damage_rate 60",
  1545. +       "magic_damage_rate  60",
  1546. +       "misc_damage_rate   60",
  1547. +       "long_damage_rate   70",
  1548. +       "short_damage_rate  80" )
  1549. +},
  1550. +{
  1551. +   /* GvG zone is applied to all maps with a pvp mapflag */
  1552. +   name: "GvG" /* changing this name requires MAP_ZONE_GVG_NAME to also be changed in src/map/map.h file */
  1553. +
  1554. +   disabled_skills: {
  1555. +       AL_TELEPORT: "PLAYER"
  1556. +       AL_WARP: "PLAYER"
  1557. +       WZ_ICEWALL: "PLAYER"
  1558. +       TF_BACKSLIDING: "PLAYER"
  1559. +       RG_INTIMIDATE: "PLAYER"
  1560. +       WE_CALLPARTNER: "PLAYER"
  1561. +       HP_ASSUMPTIO: "PLAYER"
  1562. +       HP_BASILICA: "PLAYER"
  1563. +       CG_MOONLIT: "PLAYER"
  1564. +       WE_CALLPARENT: "PLAYER"
  1565. +       WE_CALLBABY: "PLAYER"
  1566. +       CR_CULTIVATION: "PLAYER"
  1567. +       NJ_KIRIKAGE: "PLAYER"
  1568. +       CASH_ASSUMPTIO: "PLAYER"
  1569. +       BS_GREED: "PLAYER"
  1570. +       SC_FATALMENACE: "PLAYER"
  1571. +       SC_DIMENSIONDOOR: "PLAYER"
  1572. +   }
  1573. +
  1574. +   disabled_items: {
  1575. +       Assumptio_5_Scroll: true
  1576. +       Greed_Scroll: true
  1577. +       Pty_Assumptio_Scroll: true
  1578. +   }
  1579. +   /* 5 second duration increase on GvG */
  1580. +   /* knockback disabled */
  1581. +   /* GvG Mode Damage Reductions */
  1582. +   /* - weapon_damage_rate -40% */
  1583. +   /* - magic_damage_rate  -40% */
  1584. +   /* - misc_damage_rate   -40% */
  1585. +   /* - long_damage_rate   -20% */
  1586. +   /* - short_damage_rate  -20% */
  1587. +   mapflags: ( "invincible_time_inc    5000",
  1588. +               "noknockback",
  1589. +               "weapon_damage_rate 60",
  1590. +               "magic_damage_rate  60",
  1591. +               "misc_damage_rate   60",
  1592. +               "long_damage_rate   80",
  1593. +               "short_damage_rate  80" )
  1594. +
  1595. +},
  1596. +{
  1597. +   /* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */
  1598. +   name: "Battlegrounds" /* changing this name requires MAP_ZONE_BG_NAME to also be changed in src/map/map.h file */
  1599. +
  1600. +   disabled_skills: {
  1601. +       AL_TELEPORT: "PLAYER"
  1602. +       AL_WARP: "PLAYER"
  1603. +       WZ_ICEWALL: "PLAYER"
  1604. +       TF_BACKSLIDING: "PLAYER"
  1605. +       RG_INTIMIDATE: "PLAYER"
  1606. +       MO_BODYRELOCATION: "PLAYER"
  1607. +       WE_CALLPARTNER: "PLAYER"
  1608. +       HP_ASSUMPTIO: "PLAYER"
  1609. +       HP_BASILICA: "PLAYER"
  1610. +       CG_MOONLIT: "PLAYER"
  1611. +       WE_CALLPARENT: "PLAYER"
  1612. +       WE_CALLBABY: "PLAYER"
  1613. +       CR_CULTIVATION: "PLAYER"
  1614. +       TK_RUN: "PLAYER"
  1615. +       TK_HIGHJUMP: "PLAYER"
  1616. +       SG_FEEL: "PLAYER"
  1617. +       SG_SUN_WARM: "PLAYER"
  1618. +       SG_MOON_WARM: "PLAYER"
  1619. +       SG_STAR_WARM: "PLAYER"
  1620. +       SG_SUN_COMFORT: "PLAYER"
  1621. +       SG_MOON_COMFORT: "PLAYER"
  1622. +       SG_STAR_COMFORT: "PLAYER"
  1623. +       SG_HATE: "PLAYER"
  1624. +       SG_SUN_ANGER: "PLAYER"
  1625. +       SG_MOON_ANGER: "PLAYER"
  1626. +       SG_STAR_ANGER: "PLAYER"
  1627. +       SG_SUN_BLESS: "PLAYER"
  1628. +       SG_MOON_BLESS: "PLAYER"
  1629. +       SG_STAR_BLESS: "PLAYER"
  1630. +       NJ_KIRIKAGE: "PLAYER"
  1631. +       CASH_ASSUMPTIO: "PLAYER"
  1632. +       SC_FATALMENACE: "PLAYER"
  1633. +       SC_DIMENSIONDOOR: "PLAYER"
  1634. +   }
  1635. +   disabled_items: {
  1636. +       Assumptio_5_Scroll: true
  1637. +       Pty_Assumptio_Scroll: true
  1638. +   }
  1639. +
  1640. +   /* knockback disabled */
  1641. +   /* Battlegrounds Damage Reductions */
  1642. +   /* - weapon_damage_rate -30% */
  1643. +   /* - magic_damage_rate  -30% */
  1644. +   /* - misc_damage_rate   -30% */
  1645. +   /* - long_damage_rate   -25% */
  1646. +   /* - short_damage_rate  -25% */
  1647. +   mapflags: ( "noknockback",
  1648. +               "weapon_damage_rate 70",
  1649. +               "magic_damage_rate  70",
  1650. +               "misc_damage_rate   70",
  1651. +               "long_damage_rate   75",
  1652. +               "short_damage_rate  75" )
  1653. +
  1654. +},
  1655. +{
  1656. +   name: "Aldebaran Turbo Track"
  1657. +
  1658. +   disabled_skills: {
  1659. +       SM_ENDURE: "PLAYER"
  1660. +       AL_TELEPORT: "PLAYER"
  1661. +       AL_WARP: "PLAYER"
  1662. +       AL_CURE: "PLAYER"
  1663. +       TF_HIDING: "PLAYER"
  1664. +       WZ_ICEWALL: "PLAYER"
  1665. +       AS_CLOAKING: "PLAYER"
  1666. +       RG_INTIMIDATE: "PLAYER"
  1667. +       MO_BODYRELOCATION: "PLAYER"
  1668. +       LK_CONCENTRATION: "PLAYER"
  1669. +       LK_BERSERK: "PLAYER"
  1670. +       HP_BASILICA: "PLAYER"
  1671. +       WS_CARTBOOST: "PLAYER"
  1672. +       ST_CHASEWALK: "PLAYER"
  1673. +       CG_MOONLIT: "PLAYER"
  1674. +       SC_FATALMENACE: "PLAYER"
  1675. +       SC_DIMENSIONDOOR: "PLAYER"
  1676. +       GN_CARTBOOST: "PLAYER"
  1677. +   }
  1678. +
  1679. +   disabled_items: {
  1680. +       Wing_Of_Fly: true
  1681. +       Anodyne: true
  1682. +       Green_Potion: true
  1683. +       Panacea: true
  1684. +   }
  1685. +},
  1686. +{
  1687. +   name: "Jail"
  1688. +
  1689. +   disabled_skills: {
  1690. +       TK_JUMPKICK: "PLAYER"
  1691. +       TK_HIGHJUMP: "PLAYER"
  1692. +   }
  1693. +
  1694. +   disabled_items: {
  1695. +       Wing_Of_Fly: true
  1696. +       Wing_Of_Butterfly: true
  1697. +       Giant_Fly_Wing: true
  1698. +       WOB_Rune: true
  1699. +       WOB_Schwaltz: true
  1700. +       WOB_Rachel: true
  1701. +       WOB_Local: true
  1702. +   }
  1703. +},
  1704. +{
  1705. +   name: "Izlude Battle Arena"
  1706. +
  1707. +   disabled_skills: {
  1708. +       RG_INTIMIDATE: "PLAYER"
  1709. +       AL_TELEPORT: "PLAYER"
  1710. +       SC_FATALMENACE: "PLAYER"
  1711. +       SC_DIMENSIONDOOR: "PLAYER"
  1712. +   }
  1713. +
  1714. +   disabled_items: {
  1715. +       Wing_Of_Fly: true
  1716. +   }
  1717. +},
  1718. +{
  1719. +   name: "GvG2"
  1720. +   inherit: ( "GvG" ) /* will import all gvg has */
  1721. +
  1722. +   disabled_skills: {
  1723. +       TK_HIGHJUMP: "PLAYER"
  1724. +       SA_ABRACADABRA: "PLAYER"
  1725. +   }
  1726. +},
  1727. +{
  1728. +   name: "Sealed Shrine"
  1729. +
  1730. +   disabled_skills: {
  1731. +       MG_SAFETYWALL: "PLAYER"
  1732. +       AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
  1733. +       RG_INTIMIDATE: "PLAYER | MONSTER"
  1734. +       HP_ASSUMPTIO: "PLAYER"
  1735. +       CASH_ASSUMPTIO: "PLAYER"
  1736. +       SC_FATALMENACE: "PLAYER"
  1737. +       SC_DIMENSIONDOOR: "PLAYER"
  1738. +   }
  1739. +},
  1740. +{
  1741. +   name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */
  1742. +
  1743. +   disabled_skills: {
  1744. +       AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
  1745. +       WZ_ICEWALL: "PLAYER"
  1746. +       RG_INTIMIDATE: "PLAYER | MONSTER"
  1747. +       PF_SPIDERWEB: "PLAYER"
  1748. +       NPC_EXPULSION: "PLAYER"
  1749. +       SC_FATALMENACE: "PLAYER"
  1750. +       SC_DIMENSIONDOOR: "PLAYER"
  1751. +   }
  1752. +},
  1753. +{
  1754. +   name: "Towns"
  1755. +
  1756. +   disabled_skills: {
  1757. +       AM_CANNIBALIZE: "PLAYER"
  1758. +       AM_SPHEREMINE: "PLAYER"
  1759. +       CR_CULTIVATION: "PLAYER"
  1760. +       BS_GREED: "PLAYER"
  1761. +       SC_MANHOLE: "PLAYER"
  1762. +       WM_POEMOFNETHERWORLD: "PLAYER"
  1763. +       GN_WALLOFTHORN: "PLAYER"
  1764. +   }
  1765. +
  1766. +   disabled_items: {
  1767. +       Greed_Scroll: true
  1768. +   }
  1769. +}
  1770. +)
  1771. \ No newline at end of file
  1772. Index: db/re/skill_db.txt
  1773. --- db/re/skill_db.txt Base (BASE)
  1774. +++ db/re/skill_db.txt Locally Modified (Based On LOCAL)
  1775. @@ -38,6 +38,7 @@
  1776.  //    0x1000- disable usage on enemies (for non-offensive skills).
  1777.  //    0x2000- skill ignores land protector (e.g. arrow shower)
  1778.  //    0x4000- chorus skill
  1779. +//    0x8000- skill wont be passed to clones
  1780.  // 13 maxcount: max amount of skill instances to place on the ground when
  1781.  //    player_land_skill_limit/monster_land_skill_limit is enabled. For skills
  1782.  //    that attack using a path, this is the path length to be used.
  1783. Index: db/re/skill_nocast_db.txt
  1784. --- db/re/skill_nocast_db.txt Base (BASE)
  1785. +++ db/re/skill_nocast_db.txt Locally Deleted
  1786. @@ -1,154 +0,0 @@
  1787. -// Forbidden Skills Database
  1788. -//
  1789. -// Structure of Database:
  1790. -// SkillID,Flag
  1791. -//
  1792. -// Legend for 'Flag' field (bitmask):
  1793. -//  1 = Cannot be used in normal maps
  1794. -//  2 = Cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
  1795. -//  4 = Cannot be used in GvG maps
  1796. -//  8 = Cannot be used in Battleground maps
  1797. -//  16 = Cannot be cloned (clones will not copy this skill)
  1798. -//  Restricted zones - they're configured by 'restricted <number>' mapflag
  1799. -//  32 = Cannot be used in zone 1 maps
  1800. -//  64 = Cannot be used in zone 2 maps
  1801. -//  128 = Cannot be used in zone 3 maps
  1802. -//  256 = Cannot be used in zone 4 maps
  1803. -//  512 = Cannot be used in zone 5 maps
  1804. -//  1024 = Cannot be used in zone 6 maps
  1805. -//  2048 = Cannot be used in zone 7 maps
  1806. -//
  1807. -// Example:
  1808. -// 8,6 = Endure cannot be used in PvP and GvG maps (2+4)
  1809. -
  1810. -//Normal
  1811. -2422,1 //WM_LULLABY_DEEPSLEEP
  1812. -2423,1 //WM_SIRCLEOFNATURE
  1813. -2430,1 //WM_SATURDAY_NIGHT_FEVER
  1814. -2455,1 //SO_ARRULLO
  1815. -
  1816. -//PVP
  1817. -1013,2 //BS_GREED
  1818. -
  1819. -//GVG
  1820. -26,4   //AL_TELEPORT
  1821. -27,4   //AL_WARP
  1822. -87,4   //WZ_ICEWALL
  1823. -150,4  //TF_BACKSLIDING
  1824. -219,4  //RG_INTIMIDATE
  1825. -336,4  //WE_CALLPARTNER
  1826. -361,4  //HP_ASSUMPTIO
  1827. -362,4  //HP_BASILICA
  1828. -395,4  //CG_MOONLIT
  1829. -409,4  //WE_CALLPARENT
  1830. -410,4  //WE_CALLBABY
  1831. -491,4  //CR_CULTIVATION
  1832. -530,4  //NJ_KIRIKAGE
  1833. -691,4  //CASH_ASSUMPTIO
  1834. -1013,4 //BS_GREED
  1835. -2284,4 //SC_FATALMENACE
  1836. -2300,4 //SC_DIMENSIONDOOR
  1837. -
  1838. -//BATTLEGROUND
  1839. -26,8   //AL_TELEPORT
  1840. -27,8   //AL_WARP
  1841. -87,8   //WZ_ICEWALL
  1842. -150,8  //TF_BACKSLIDING
  1843. -219,8  //RG_INTIMIDATE
  1844. -264,8  //MO_BODYRELOCATION
  1845. -336,8  //WE_CALLPARTNER
  1846. -361,8  //HP_ASSUMPTIO
  1847. -362,8  //HP_BASILICA
  1848. -395,8  //CG_MOONLIT
  1849. -409,8  //WE_CALLPARENT
  1850. -410,8  //WE_CALLBABY
  1851. -491,8  //CR_CULTIVATION
  1852. -411,8  //TK_RUN
  1853. -426,8  //TK_HIGHJUMP
  1854. -427,8  //SG_FEEL
  1855. -428,8  //SG_SUN_WARM
  1856. -429,8  //SG_MOON_WARM
  1857. -430,8  //SG_STAR_WARM
  1858. -431,8  //SG_SUN_COMFORT
  1859. -432,8  //SG_MOON_COMFORT
  1860. -433,8  //SG_STAR_COMFORT
  1861. -434,8  //SG_HATE
  1862. -435,8  //SG_SUN_ANGER
  1863. -436,8  //SG_MOON_ANGER
  1864. -437,8  //SG_STAR_ANGER
  1865. -438,8  //SG_SUN_BLESS
  1866. -439,8  //SG_MOON_BLESS
  1867. -440,8  //SG_STAR_BLESS
  1868. -530,8  //NJ_KIRIKAGE
  1869. -691,8  //CASH_ASSUMPITO
  1870. -2284,8 //SC_FATALMENACE
  1871. -2300,8 //SC_DIMENSIONDOOR
  1872. -
  1873. -//mixed
  1874. -488,3  //CG_HERMODE
  1875. -3013,3 //KO_KYOUGAKU
  1876. -
  1877. -//Clone Forbidden/pointless skills
  1878. -77,16  //PR_TURNUNDEAD
  1879. -79,16  //PR_MAGNUS
  1880. -
  1881. -//Zone 1 - Aldebaran Turbo Track
  1882. -8,32   //SM_ENDURE
  1883. -26,32  //AL_TELEPORT
  1884. -27,32  //AL_WARP
  1885. -35,32  //AL_CURE
  1886. -51,32  //TF_HIDING
  1887. -87,32  //WZ_ICEWALL
  1888. -135,32 //AS_CLOAKING
  1889. -219,32 //RG_INTIMIDATE
  1890. -264,32 //MO_BODYRELOCATION
  1891. -357,32 //LK_CONCENTRATION
  1892. -359,32 //LK_BERSERK
  1893. -362,32 //HP_BASILICA
  1894. -387,32 //WS_CARTBOOST
  1895. -389,32 //ST_CHASEWALK
  1896. -395,32 //CG_MOONLIT
  1897. -2284,32    //SC_FATALMENACE
  1898. -2300,32    //SC_DIMENSIONDOOR
  1899. -2478,32    //GN_CARTBOOST
  1900. -
  1901. -//Zone 2 - Jail
  1902. -421,64 //TK_JUMPKICK
  1903. -426,64 //TK_HIGHJUMP
  1904. -
  1905. -//Zone 3 - Izlude Battle Arena
  1906. -219,128 //RG_INTIMIDATE
  1907. -26,128 //AL_TELEPORT
  1908. -2284,128   //SC_FATALMENACE
  1909. -2300,128   //SC_DIMENSIONDOOR
  1910. -
  1911. -//Zone 4 - WoE:SE
  1912. -426,256 //TK_HIGHJUMP
  1913. -290,256    //SA_ABRACADABRA
  1914. -
  1915. -//Zone 5 - Sealed Shrine
  1916. -12,512 //MG_SAFETYWALL
  1917. -26,512 //AL_TELEPORT
  1918. -219,512    //RG_INTIMIDATE
  1919. -361,512    //HP_ASSUMPTIO
  1920. -691,512    //CASH_ASSUMPTIO
  1921. -2284,512   //SC_FATALMENACE
  1922. -2300,512   //SC_DIMENSIONDOOR
  1923. -
  1924. -//Zone 6 - Endless Tower, Orc's Memory, Nidhoggur's Nest
  1925. -26,1024    //AL_TELEPORT
  1926. -87,1024    //WZ_ICEWALL
  1927. -219,1024   //RG_INTIMIDATE
  1928. -405,1024   //PF_SPIDERWEB
  1929. -674,1024   //NPC_EXPULSION
  1930. -2284,1024  //SC_FATALMENACE
  1931. -2300,1024  //SC_DIMENSIONDOOR
  1932. -
  1933. -//Zone 7 - Towns
  1934. -232,2048   //AM_CANNIBALIZE
  1935. -233,2048   //AM_SPHEREMINE
  1936. -491,2048   //CR_CULTIVATION
  1937. -1013,2048  //BS_GREED
  1938. -2299,2048  //SC_MANHOLE
  1939. -2419,2048  //WM_POEMOFNETHERWORLD
  1940. -2482,2048  //GN_WALLOFTHORN
  1941. Index: npc/scripts_mapflags.conf
  1942. --- npc/scripts_mapflags.conf Base (BASE)
  1943. +++ npc/scripts_mapflags.conf Locally Modified (Based On LOCAL)
  1944. @@ -17,13 +17,15 @@
  1945.  npc: conf/mapflag/noskill.txt
  1946.  npc: conf/mapflag/nowarp.txt
  1947.  npc: conf/mapflag/nowarpto.txt
  1948. -//npc: conf/mapflag/partylock.txt
  1949. +npc: conf/mapflag/partylock.txt
  1950.  npc: conf/mapflag/pvp.txt
  1951.  npc: conf/mapflag/pvp_noparty.txt
  1952.  npc: conf/mapflag/pvp_noguild.txt
  1953.  npc: conf/mapflag/night.txt
  1954. -npc: conf/mapflag/restricted.txt
  1955. +npc: conf/mapflag/zone.txt
  1956.  npc: conf/mapflag/battleground.txt
  1957.  npc: conf/mapflag/novending.txt
  1958.  npc: conf/mapflag/town.txt
  1959.  npc: conf/mapflag/reset.txt
  1960. +npc: conf/mapflag/skillmodifier.txt
  1961. +npc: conf/mapflag/skillduration.txt
  1962. \ No newline at end of file
  1963. Index: src/char/char.c
  1964. --- src/char/char.c Base (BASE)
  1965. +++ src/char/char.c Locally Modified (Based On LOCAL)
  1966. @@ -30,7 +30,7 @@
  1967.  #include <stdio.h>
  1968.  #include <stdlib.h>
  1969.  
  1970. -#define CHAR_MAX_MSG 200
  1971. +#define CHAR_MAX_MSG 300
  1972.  static char* msg_table[CHAR_MAX_MSG]; // Login Server messages_conf
  1973.  
  1974.  char char_db[256] = "char";
  1975. @@ -2724,10 +2724,8 @@
  1976.         return 0;
  1977.     }
  1978.  
  1979. -   while(RFIFOREST(fd) >= 2)
  1980. -   {
  1981. -       switch(RFIFOW(fd,0))
  1982. -       {
  1983. +   while(RFIFOREST(fd) >= 2){
  1984. +       switch(RFIFOW(fd,0)){
  1985.  
  1986.         case 0x2afa: // Receiving map names list from the map-server
  1987.             if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
  1988. Index: src/common/ers.c
  1989. --- src/common/ers.c Base (BASE)
  1990. +++ src/common/ers.c Locally Modified (Based On LOCAL)
  1991. @@ -278,8 +278,17 @@
  1992.  
  1993.  void ers_report(void)
  1994.  {
  1995. -   // FIXME: Someone use this? Is it really needed?
  1996. +   ers_cache_t *cache;
  1997. +   int i = 0;
  1998. +   for (cache = CacheList; cache; cache = cache->Next) {
  1999. +       ShowMessage(CL_BOLD"[Entry manager #%u report]\n"CL_NORMAL, ++i);
  2000. +       ShowMessage("\tinstances          : %u\n", cache->ReferenceCount);
  2001. +       ShowMessage("\tblock array size   : %u\n", cache->ObjectSize);
  2002. +       ShowMessage("\tallocated blocks   : %u\n", cache->Free+cache->Used);
  2003. +       ShowMessage("\tentries being used : %u\n", cache->Used);
  2004. +       ShowMessage("\tunused entries     : %u\n", cache->Free);
  2005.  }
  2006. +}
  2007.  
  2008.  void ers_force_destroy_all(void)
  2009.  {
  2010. Index: src/map/atcommand.c
  2011. --- src/map/atcommand.c Base (BASE)
  2012. +++ src/map/atcommand.c Locally Modified (Based On LOCAL)
  2013. @@ -3725,7 +3725,8 @@
  2014.   * 0 = no additional information
  2015.   * 1 = Show users in that map and their location
  2016.   * 2 = Shows NPCs in that map
  2017. - * 3 = Shows the shops/chats in that map (not implemented)
  2018. + * 3 = Shows the chats in that map
  2019. + TODO# add the missing mapflags e.g. adjust_skill_damage to display
  2020.   *------------------------------------------*/
  2021.  ACMD_FUNC(mapinfo)
  2022.  {
  2023. @@ -3734,7 +3735,7 @@
  2024.     struct npc_data *nd = NULL;
  2025.     struct chat_data *cd = NULL;
  2026.     char direction[12];
  2027. -   int i, m_id, chat_num, list = 0;
  2028. +   int i, m_id, chat_num = 0, list = 0, vend_num = 0;
  2029.     unsigned short m_index;
  2030.     char mapname[24];
  2031.  
  2032. @@ -3769,12 +3770,17 @@
  2033.     // count chats (for initial message)
  2034.     chat_num = 0;
  2035.     iter = mapit_getallusers();
  2036. -   for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  2037. -       if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd )
  2038. +   for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) {
  2039. +       if( pl_sd->mapindex == m_index ) {
  2040. +           if( sd->state.vending )
  2041. +               vend_num++;
  2042. +           else if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd )
  2043.             chat_num++;
  2044. +       }
  2045. +   }
  2046.     mapit_free(iter);
  2047.  
  2048. -   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
  2049. +   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
  2050.     clif_displaymessage(fd, atcmd_output);
  2051.     clif_displaymessage(fd, msg_txt(1041)); // ------ Map Flags ------
  2052.     if (map[m_id].flag.town)
  2053. @@ -3862,11 +3868,6 @@
  2054.         strcat(atcmd_output, msg_txt(1077)); // Fireworks |
  2055.     if (map[m_id].flag.leaves)
  2056.         strcat(atcmd_output, msg_txt(1078)); // Leaves |
  2057. -   /**
  2058. -    * No longer available, keeping here just in case it's back someday. [Ind]
  2059. -    **/
  2060. -   //if (map[m_id].flag.rain)
  2061. -   //  strcat(atcmd_output, msg_txt(1079)); // Rain |
  2062.     if (map[m_id].flag.nightenabled)
  2063.         strcat(atcmd_output, msg_txt(1080)); // Displays Night |
  2064.     clif_displaymessage(fd, atcmd_output);
  2065. @@ -5621,7 +5622,7 @@
  2066.     struct map_session_data *pl_sd;
  2067.     nullpo_retr(-1, sd);
  2068.  
  2069. -   if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL || strcmp(g->master,sd->status.name)) {
  2070. +   if (sd->status.guild_id == 0 || (g = sd->guild) == NULL || strcmp(g->master,sd->status.name)) {
  2071.         clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
  2072.         return -1;
  2073.     }
  2074. @@ -7585,7 +7586,7 @@
  2075.         checkflag(fog);                 checkflag(fireworks);           checkflag(sakura);      checkflag(leaves);
  2076.         checkflag(nogo);                checkflag(nobaseexp);
  2077.         checkflag(nojobexp);            checkflag(nomobloot);           checkflag(nomvploot);   checkflag(nightenabled);
  2078. -       checkflag(restricted);          checkflag(nodrop);              checkflag(novending);   checkflag(loadevent);
  2079. +       checkflag(nodrop);              checkflag(novending);   checkflag(loadevent);
  2080.         checkflag(nochat);              checkflag(partylock);           checkflag(guildlock);   checkflag(src4instance);
  2081.         clif_displaymessage(sd->fd," ");
  2082.         clif_displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
  2083. @@ -7604,7 +7605,7 @@
  2084.     setflag(fog);               setflag(fireworks);         setflag(sakura);            setflag(leaves);
  2085.     setflag(nogo);              setflag(nobaseexp);
  2086.     setflag(nojobexp);          setflag(nomobloot);         setflag(nomvploot);         setflag(nightenabled);
  2087. -   setflag(restricted);        setflag(nodrop);            setflag(novending);         setflag(loadevent);
  2088. +   setflag(nodrop);            setflag(novending);         setflag(loadevent);
  2089.     setflag(nochat);            setflag(partylock);         setflag(guildlock);         setflag(src4instance);
  2090.  
  2091.     clif_displaymessage(sd->fd,msg_txt(1314)); // Invalid flag name or flag.
  2092. @@ -7616,7 +7617,7 @@
  2093.     clif_displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,");
  2094.     clif_displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
  2095.     clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,");
  2096. -   clif_displaymessage(sd->fd,"nomvploot, nightenabled, restricted, nodrop, novending, loadevent, nochat, partylock,");
  2097. +   clif_displaymessage(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,");
  2098.     clif_displaymessage(sd->fd,"guildlock, src4instance");
  2099.  
  2100.  #undef checkflag
  2101. Index: src/map/clif.c
  2102. --- src/map/clif.c Base (BASE)
  2103. +++ src/map/clif.c Locally Modified (Based On LOCAL)
  2104. @@ -9032,14 +9032,6 @@
  2105.     WFIFOSET(fd, packet_len(0x7e6));
  2106.  }
  2107.  
  2108. -
  2109. -/// View player equip request denied
  2110. -void clif_viewequip_fail(struct map_session_data* sd)
  2111. -{
  2112. -   clif_msg(sd, 0x54d);
  2113. -}
  2114. -
  2115. -
  2116.  /// Validates one global/guild/party/whisper message packet and tries to recognize its components.
  2117.  /// Returns true if the packet was parsed successfully.
  2118.  /// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00
  2119. @@ -11055,7 +11047,7 @@
  2120.  
  2121.     if( sd->npc_id ){
  2122.  #ifdef RENEWAL
  2123. -       clif_msg(sd, 0x783); // TODO look for the client date that has this message.
  2124. +       clif_msg(sd, USAGE_FAIL); // TODO look for the client date that has this message.
  2125.  #endif
  2126.         return;
  2127.     }
  2128. @@ -14766,7 +14758,7 @@
  2129.     if( tsd->status.show_equip || pc_has_permission(sd, PC_PERM_VIEW_EQUIPMENT) )
  2130.         clif_viewequip_ack(sd, tsd);
  2131.     else
  2132. -       clif_viewequip_fail(sd);
  2133. +       clif_msg(sd, VIEW_EQUIP_FAIL);
  2134.  }
  2135.  
  2136.  
  2137. @@ -15124,9 +15116,8 @@
  2138.  ///     1 = Your mercenary soldier has been killed.
  2139.  ///     2 = Your mercenary soldier has been fired.
  2140.  ///     3 = Your mercenary soldier has ran away.
  2141. -void clif_mercenary_message(struct map_session_data* sd, int message)
  2142. -{
  2143. -   clif_msg(sd, 1266 + message);
  2144. +void clif_mercenary_message(struct map_session_data* sd, int message){
  2145. +   clif_msg(sd, MERC_MSG_BASE + message);
  2146.  }
  2147.  
  2148.  
  2149. Index: src/map/clif.h
  2150. --- src/map/clif.h Base (BASE)
  2151. +++ src/map/clif.h Locally Modified (Based On LOCAL)
  2152. @@ -84,8 +84,7 @@
  2153.     BG_AREA_WOS,
  2154.  } send_target;
  2155.  
  2156. -typedef enum emotion_type
  2157. -{
  2158. +typedef enum emotion_type {
  2159.     E_GASP = 0,     // /!
  2160.     E_WHAT,         // /?
  2161.     E_HO,
  2162. @@ -315,6 +314,13 @@
  2163.     USESKILL_FAIL_THERE_ARE_NPC_AROUND = 83,
  2164.  };
  2165.  
  2166. +enum clif_messages {
  2167. +   MERC_MSG_BASE = 1266, //0x4f2
  2168. +   SKILL_CANT_USE_AREA = 0x536,
  2169. +   VIEW_EQUIP_FAIL = 0x54d,
  2170. +   USAGE_FAIL = 0x783,
  2171. +};
  2172. +
  2173.  int clif_setip(const char* ip);
  2174.  void clif_setbindip(const char* ip);
  2175.  void clif_setport(uint16 port);
  2176. @@ -632,7 +638,6 @@
  2177.  
  2178.  void clif_equiptickack(struct map_session_data* sd, int flag);
  2179.  void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd);
  2180. -void clif_viewequip_fail(struct map_session_data* sd);
  2181.  void clif_equipcheckbox(struct map_session_data* sd);
  2182.  
  2183.  void clif_msg(struct map_session_data* sd, unsigned short id);
  2184. Index: src/map/guild.c
  2185. --- src/map/guild.c Base (BASE)
  2186. +++ src/map/guild.c Locally Modified (Based On LOCAL)
  2187. Index: src/map/itemdb.c
  2188. --- src/map/itemdb.c Base (BASE)
  2189. +++ src/map/itemdb.c Locally Modified (Based On LOCAL)
  2190. @@ -586,27 +586,6 @@
  2191.  }
  2192.  
  2193.  /*==========================================
  2194. - * Read item forbidden by mapflag (can't equip item)
  2195. - *------------------------------------------*/
  2196. -static bool itemdb_read_noequip(char* str[], int columns, int current)
  2197. -{// <nameid>,<mode>
  2198. -   int nameid;
  2199. -   struct item_data *id;
  2200. -
  2201. -   nameid = atoi(str[0]);
  2202. -
  2203. -   if( ( id = itemdb_exists(nameid) ) == NULL )
  2204. -   {
  2205. -       ShowWarning("itemdb_read_noequip: Invalid item id %d.\n", nameid);
  2206. -       return false;
  2207. -   }
  2208. -
  2209. -   id->flag.no_equip |= atoi(str[1]);
  2210. -
  2211. -   return true;
  2212. -}
  2213. -
  2214. -/*==========================================
  2215.   * Reads item trade restrictions [Skotlex]
  2216.   *------------------------------------------*/
  2217.  static bool itemdb_read_itemtrade(char* str[], int columns, int current)
  2218. @@ -1310,7 +1289,6 @@
  2219.     itemdb_read_combos();
  2220.     itemdb_read_itemgroup();
  2221.     sv_readdb(db_path, "item_avail.txt",         ',', 2, 2, -1, &itemdb_read_itemavail);
  2222. -   sv_readdb(db_path, DBPATH"item_noequip.txt", ',', 2, 2, -1, &itemdb_read_noequip);
  2223.     sv_readdb(db_path, DBPATH"item_trade.txt",   ',', 3, 3, -1, &itemdb_read_itemtrade);
  2224.     sv_readdb(db_path, "item_delay.txt",         ',', 2, 2, -1, &itemdb_read_itemdelay);
  2225.     sv_readdb(db_path, "item_stack.txt",         ',', 3, 3, -1, &itemdb_read_stack);
  2226. Index: src/map/itemdb.h
  2227. --- src/map/itemdb.h Base (BASE)
  2228. +++ src/map/itemdb.h Locally Modified (Based On LOCAL)
  2229. @@ -124,7 +124,6 @@
  2230.     struct script_code *unequip_script;//Script executed once when unequipping.
  2231.     struct {
  2232.         unsigned available : 1;
  2233. -       short no_equip;
  2234.         unsigned no_refine : 1; // [celest]
  2235.         unsigned delay_consume : 1; // Signifies items that are not consumed immediately upon double-click [Skotlex]
  2236.         unsigned trade_restriction : 9; //Item restrictions mask [Skotlex]
  2237. Index: src/map/map.c
  2238. --- src/map/map.c Base (BASE)
  2239. +++ src/map/map.c Locally Modified (Based On LOCAL)
  2240. @@ -4,6 +4,7 @@
  2241.  #include "../common/cbasetypes.h"
  2242.  #include "../common/core.h"
  2243.  #include "../common/timer.h"
  2244. +#include "../common/ers.h"
  2245.  #include "../common/grfio.h"
  2246.  #include "../common/malloc.h"
  2247.  #include "../common/socket.h" // WFIFO*()
  2248. @@ -13,6 +14,7 @@
  2249.  #include "../common/strlib.h"
  2250.  #include "../common/utils.h"
  2251.  #include "../common/cli.h"
  2252. +#include "../common/conf.h"
  2253.  
  2254.  #include "map.h"
  2255.  #include "path.h"
  2256. @@ -1485,8 +1487,7 @@
  2257.     p = idb_ensure(nick_db, charid, create_charid2nick);
  2258.     safestrncpy(p->nick, nick, sizeof(p->nick));
  2259.  
  2260. -   while( p->requests )
  2261. -   {
  2262. +   while( p->requests ) {
  2263.         req = p->requests;
  2264.         p->requests = req->next;
  2265.         sd = map_charid2sd(req->charid);
  2266. @@ -1508,8 +1509,7 @@
  2267.     if (!nick_db->remove(nick_db, db_i2key(charid), &data) || (p = db_data2ptr(&data)) == NULL)
  2268.         return;
  2269.  
  2270. -   while( p->requests )
  2271. -   {
  2272. +   while( p->requests ) {
  2273.         req = p->requests;
  2274.         p->requests = req->next;
  2275.         sd = map_charid2sd(req->charid);
  2276. @@ -2660,8 +2660,7 @@
  2277.     return true;
  2278.  }
  2279.  
  2280. -void map_iwall_get(struct map_session_data *sd)
  2281. -{
  2282. +void map_iwall_get(struct map_session_data *sd) {
  2283.     struct iwall_data *iwall;
  2284.     DBIterator* iter;
  2285.     int16 x1, y1;
  2286. @@ -2671,13 +2670,11 @@
  2287.         return;
  2288.  
  2289.     iter = db_iterator(iwall_db);
  2290. -   for( iwall = dbi_first(iter); dbi_exists(iter); iwall = dbi_next(iter) )
  2291. -   {
  2292. +   for( iwall = dbi_first(iter); dbi_exists(iter); iwall = dbi_next(iter) ) {
  2293.         if( iwall->m != sd->bl.m )
  2294.             continue;
  2295.  
  2296. -       for( i = 0; i < iwall->size; i++ )
  2297. -       {
  2298. +       for( i = 0; i < iwall->size; i++ ) {
  2299.             map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
  2300.             clif_changemapcell(sd->fd, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), SELF);
  2301.         }
  2302. @@ -2693,8 +2690,7 @@
  2303.     if( (iwall = (struct iwall_data *)strdb_get(iwall_db, wall_name)) == NULL )
  2304.         return; // Nothing to do
  2305.  
  2306. -   for( i = 0; i < iwall->size; i++ )
  2307. -   {
  2308. +   for( i = 0; i < iwall->size; i++ ) {
  2309.         map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
  2310.  
  2311.         map_setcell(iwall->m, x1, y1, CELL_SHOOTABLE, true);
  2312. @@ -2908,27 +2904,139 @@
  2313.     }
  2314.     return 0;
  2315.  }
  2316. +void map_zone_db_clear(void) {
  2317. +   struct map_zone_data *zone;
  2318. +   int i;
  2319.  
  2320. +   DBIterator *iter = db_iterator(zone_db);
  2321. +   for(zone = dbi_first(iter); dbi_exists(iter); zone = dbi_next(iter)) {
  2322. +       for(i = 0; i < zone->disabled_skills_count; i++) {
  2323. +           aFree(zone->disabled_skills[i]);
  2324. +       }
  2325. +       aFree(zone->disabled_skills);
  2326. +       aFree(zone->disabled_items);
  2327. +       for(i = 0; i < zone->mapflags_count; i++) {
  2328. +           aFree(zone->mapflags[i]);
  2329. +       }
  2330. +       aFree(zone->mapflags);
  2331. +   }
  2332. +   dbi_destroy(iter);
  2333. +
  2334. +   db_destroy(zone_db);/* will aFree(zone) */
  2335. +
  2336. +   /* clear the pk zone stuff */
  2337. +   for(i = 0; i < map_zone_pk.disabled_skills_count; i++) {
  2338. +       aFree(map_zone_pk.disabled_skills[i]);
  2339. +   }
  2340. +   aFree(map_zone_pk.disabled_skills);
  2341. +   aFree(map_zone_pk.disabled_items);
  2342. +   for(i = 0; i < map_zone_pk.mapflags_count; i++) {
  2343. +       aFree(map_zone_pk.mapflags[i]);
  2344. +   }
  2345. +   aFree(map_zone_pk.mapflags);
  2346. +   /* clear the main zone stuff */
  2347. +   for(i = 0; i < map_zone_all.disabled_skills_count; i++) {
  2348. +       aFree(map_zone_all.disabled_skills[i]);
  2349. +   }
  2350. +   aFree(map_zone_all.disabled_skills);
  2351. +   aFree(map_zone_all.disabled_items);
  2352. +   for(i = 0; i < map_zone_all.mapflags_count; i++) {
  2353. +       aFree(map_zone_all.mapflags[i]);
  2354. +   }
  2355. +   aFree(map_zone_all.mapflags);
  2356. +}
  2357. +
  2358. +void do_final_maps(void) {
  2359. +   int i, v = 0;
  2360. +
  2361. +   for( i = 0; i < map_num; i++ ) {
  2362. +
  2363. +       if(map[i].cell) aFree(map[i].cell);
  2364. +       if(map[i].block) aFree(map[i].block);
  2365. +       if(map[i].block_mob) aFree(map[i].block_mob);
  2366. +
  2367. +       if(battle_config.dynamic_mobs) { //Dynamic mobs flag by [random]
  2368. +           int j;
  2369. +           if(map[i].mob_delete_timer != INVALID_TIMER)
  2370. +               delete_timer(map[i].mob_delete_timer, map_removemobs_timer);
  2371. +           for (j=0; j<MAX_MOB_LIST_PER_MAP; j++)
  2372. +               if (map[i].moblist[j]) aFree(map[i].moblist[j]);
  2373. +       }
  2374. +
  2375. +       if( map[i].unit_count ) {
  2376. +           for(v = 0; v < map[i].unit_count; v++) {
  2377. +               aFree(map[i].units[v]);
  2378. +           }
  2379. +           if( map[i].units ) {
  2380. +               aFree(map[i].units);
  2381. +               map[i].units = NULL;
  2382. +           }
  2383. +           map[i].unit_count = 0;
  2384. +       }
  2385. +
  2386. +       if( map[i].skill_count ) {
  2387. +           for(v = 0; v < map[i].skill_count; v++) {
  2388. +               aFree(map[i].skills[v]);
  2389. +           }
  2390. +           if( map[i].skills ) {
  2391. +               aFree(map[i].skills);
  2392. +               map[i].skills = NULL;
  2393. +           }
  2394. +           map[i].skill_count = 0;
  2395. +       }
  2396. +       if( map[i].channel )
  2397. +           clif_chsys_delete(map[i].channel);
  2398. +   }
  2399. +
  2400. +   map_zone_db_clear();
  2401. +
  2402. +}
  2403.  /// Initializes map flags and adjusts them depending on configuration.
  2404. -void map_flags_init(void)
  2405. -{
  2406. -   int i;
  2407. +void map_flags_init(void) {
  2408. +   int i, v = 0;
  2409.  
  2410. -   for( i = 0; i < map_num; i++ )
  2411. -   {
  2412. +   for( i = 0; i < map_num; i++ ) {
  2413.         // mapflags
  2414.         memset(&map[i].flag, 0, sizeof(map[i].flag));
  2415.  
  2416.         // additional mapflag data
  2417. -       map[i].zone      = 0;  // restricted mapflag zone
  2418.         map[i].nocommand = 0;  // nocommand mapflag level
  2419.         map[i].bexp      = 100;  // per map base exp multiplicator
  2420.         map[i].jexp      = 100;  // per map job exp multiplicator
  2421.         memset(map[i].drop_list, 0, sizeof(map[i].drop_list));  // pvp nightmare drop list
  2422.  
  2423. +       if( map[i].unit_count ) {
  2424. +           for(v = 0; v < map[i].unit_count; v++) {
  2425. +               aFree(map[i].units[v]);
  2426. +           }
  2427. +           aFree(map[i].units);
  2428. +       }
  2429. +       map[i].units = NULL;
  2430. +       map[i].unit_count = 0;
  2431. +
  2432. +       if( map[i].skill_count ) {
  2433. +           for(v = 0; v < map[i].skill_count; v++) {
  2434. +               aFree(map[i].skills[v]);
  2435. +           }
  2436. +           aFree(map[i].skills);
  2437. +       }
  2438. +       map[i].skills = NULL;
  2439. +       map[i].skill_count = 0;
  2440. +
  2441.         // adjustments
  2442. -       if( battle_config.pk_mode )
  2443. +       if( battle_config.pk_mode ) {
  2444.             map[i].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris]
  2445. +           map[i].zone = &map_zone_pk;
  2446. +       } else /* align with 'All' zone */
  2447. +           map[i].zone = &map_zone_all;
  2448. +
  2449. +       map[i].invincible_time_inc = 0;
  2450. +
  2451. +       map[i].weapon_damage_rate = 100;
  2452. +       map[i].magic_damage_rate  = 100;
  2453. +       map[i].misc_damage_rate   = 100;
  2454. +       map[i].short_damage_rate  = 100;
  2455. +       map[i].long_damage_rate   = 100;
  2456.     }
  2457.  }
  2458.  
  2459. @@ -3184,6 +3292,8 @@
  2460.             runflag = 0;
  2461.         }
  2462.     }
  2463. +   else if( strcmpi("ers_report", type) == 0 )
  2464. +       ers_report();
  2465.     else if( strcmpi("help", type) == 0 )
  2466.     {
  2467.         ShowInfo("To use GM commands:\n");
  2468. @@ -3493,7 +3603,361 @@
  2469.  #endif
  2470.     return 0;
  2471.  }
  2472. +void map_zone_apply(int m, struct map_zone_data *zone,char* w1, const char* start, const char* buffer, const char* filepath) {
  2473. +   int i;
  2474. +   char empty[1] = "\0";
  2475. +   map[m].zone = zone;
  2476. +   for(i = 0; i < zone->mapflags_count; i++) {
  2477. +       char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
  2478. +       int len = strlen(zone->mapflags[i]);
  2479. +       int k;
  2480. +       params[0] = '\0';
  2481. +       memcpy(flag, zone->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
  2482. +       for(k = 0; k < len; k++) {
  2483. +           if( flag[k] == '\t' ) {
  2484. +               memcpy(params, &flag[k+1], len - k);
  2485. +               flag[k] = '\0';
  2486. +               break;
  2487. +           }
  2488. +       }
  2489. +       npc_parse_mapflag(w1,empty,flag,params,start,buffer,filepath);
  2490. +   }
  2491. +}
  2492. +/* used on npc load and reload to apply all "Normal" and "PK Mode" zones */
  2493. +void map_zone_init(void) {
  2494. +   struct map_zone_data *zone;
  2495. +   char empty[1] = "\0";
  2496. +   int i,k,j;
  2497.  
  2498. +   zone = &map_zone_all;
  2499. +
  2500. +   for(i = 0; i < zone->mapflags_count; i++) {
  2501. +       char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
  2502. +       int len = strlen(zone->mapflags[i]);
  2503. +       params[0] = '\0';
  2504. +       memcpy(flag, zone->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
  2505. +       for(k = 0; k < len; k++) {
  2506. +           if( flag[k] == '\t' ) {
  2507. +               memcpy(params, &flag[k+1], len - k);
  2508. +               flag[k] = '\0';
  2509. +               break;
  2510. +           }
  2511. +       }
  2512. +       for(j = 0; j < map_num; j++) {
  2513. +           if( map[j].zone == zone ) {
  2514. +               npc_parse_mapflag(map[j].name,empty,flag,params,empty,empty,empty);
  2515. +           }
  2516. +       }
  2517. +   }
  2518. +
  2519. +   if( battle_config.pk_mode ) {
  2520. +       zone = &map_zone_pk;
  2521. +       for(i = 0; i < zone->mapflags_count; i++) {
  2522. +           char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
  2523. +           int len = strlen(zone->mapflags[i]);
  2524. +           params[0] = '\0';
  2525. +           memcpy(flag, zone->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
  2526. +           for(k = 0; k < len; k++) {
  2527. +               if( flag[k] == '\t' ) {
  2528. +                   memcpy(params, &flag[k+1], len - k);
  2529. +                   flag[k] = '\0';
  2530. +                   break;
  2531. +               }
  2532. +           }
  2533. +           for(j = 0; j < map_num; j++) {
  2534. +               if( map[j].zone == zone ) {
  2535. +                   npc_parse_mapflag(map[j].name,empty,flag,params,empty,empty,empty);
  2536. +               }
  2537. +           }
  2538. +       }
  2539. +   }
  2540. +
  2541. +}
  2542. +enum bl_type map_zone_bl_type(const char *entry) {
  2543. +   char temp[200], *parse;
  2544. +   enum bl_type bl;
  2545. +   safestrncpy(temp, entry, 200);
  2546. +
  2547. +   parse = strtok(temp,"|");
  2548. +
  2549. +   while (parse != NULL) {
  2550. +       normalize_name(parse," ");
  2551. +       if( strcmpi(parse,"player") == 0 )
  2552. +           bl |= BL_PC;
  2553. +       else if( strcmpi(parse,"homun") == 0 )
  2554. +           bl |= BL_HOM;
  2555. +       else if( strcmpi(parse,"mercenary") == 0 )
  2556. +           bl |= BL_MER;
  2557. +       else if( strcmpi(parse,"monster") == 0 )
  2558. +           bl |= BL_MOB;
  2559. +       else if( strcmpi(parse,"elemental") == 0 )
  2560. +           bl |= BL_ELEM;
  2561. +       else if( strcmpi(parse,"all") == 0 )
  2562. +           bl |= BL_ALL;
  2563. +       else if( strcmpi(parse,"none") == 0 ) {
  2564. +           bl = 0;
  2565. +       } else {
  2566. +           ShowError("map_zone_db: '%s' unknown type, skipping...\n",parse);
  2567. +       }
  2568. +       parse = strtok(NULL,"|");
  2569. +   }
  2570. +   return bl;
  2571. +}
  2572. +void read_map_zone_db(void) {
  2573. +   config_t map_zone_db;
  2574. +   config_setting_t *zones = NULL;
  2575. +   /* TODO: #ifndef required for re/pre-re */
  2576. +#ifdef RENEWAL
  2577. +   const char *config_filename = "db/re/map_zone_db.conf"; // FIXME hardcoded name
  2578. +#else
  2579. +   const char *config_filename = "db/pre-re/map_zone_db.conf"; // FIXME hardcoded name
  2580. +#endif
  2581. +   if (conf_read_file(&map_zone_db, config_filename))
  2582. +       return;
  2583. +
  2584. +   zones = config_lookup(&map_zone_db, "zones");
  2585. +
  2586. +   if (zones != NULL) {
  2587. +       struct map_zone_data *zone;
  2588. +       struct item_data *data;
  2589. +       config_setting_t *zone_e;
  2590. +       config_setting_t *skills;
  2591. +       config_setting_t *items;
  2592. +       config_setting_t *mapflags;
  2593. +       const char *name;
  2594. +       const char *zonename;
  2595. +       int i,h,v;
  2596. +       int zone_count = 0, disabled_skills_count = 0, disabled_items_count = 0, mapflags_count = 0;
  2597. +
  2598. +       zone_count = config_setting_length(zones);
  2599. +       for (i = 0; i < zone_count; ++i) {
  2600. +           bool is_all = false;
  2601. +
  2602. +           zone_e = config_setting_get_elem(zones, i);
  2603. +
  2604. +           if (!config_setting_lookup_string(zone_e, "name", &zonename)) {
  2605. +               ShowError("map_zone_db: missing zone name, skipping... (%s:%d)\n",
  2606. +                         config_setting_source_file(zone_e), config_setting_source_line(zone_e));
  2607. +               config_setting_remove_elem(zones,i);/* remove from the tree */
  2608. +               --zone_count;
  2609. +               --i;
  2610. +               continue;
  2611. +           }
  2612. +
  2613. +           if( strdb_exists(zone_db, zonename) ) {
  2614. +               ShowError("map_zone_db: duplicate zone name '%s', skipping...\n",zonename);
  2615. +               config_setting_remove_elem(zones,i);/* remove from the tree */
  2616. +               --zone_count;
  2617. +               --i;
  2618. +               continue;
  2619. +           }
  2620. +
  2621. +           /* is this the global template? */
  2622. +           if( strncmpi(zonename,MAP_ZONE_ALL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
  2623. +               zone = &map_zone_all;
  2624. +               is_all = true;
  2625. +           } else if( strncmpi(zonename,MAP_ZONE_PK_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
  2626. +               zone = &map_zone_pk;
  2627. +               is_all = true;
  2628. +           } else {
  2629. +               CREATE( zone, struct map_zone_data, 1 );
  2630. +               zone->disabled_skills_count = 0;
  2631. +               zone->disabled_items_count  = 0;
  2632. +           }
  2633. +           safestrncpy(zone->name, zonename, MAP_ZONE_NAME_LENGTH);
  2634. +
  2635. +           if( (skills = config_setting_get_member(zone_e, "disabled_skills")) != NULL ) {
  2636. +               disabled_skills_count = config_setting_length(skills);
  2637. +               /* validate */
  2638. +               for(h = 0; h < config_setting_length(skills); h++) {
  2639. +                   config_setting_t *skill = config_setting_get_elem(skills, h);
  2640. +                   name = config_setting_name(skill);
  2641. +                   if( !strdb_exists(skilldb_name2id,name) ) {
  2642. +                       ShowError("map_zone_db: unknown skill (%s) in disabled_skills for zone '%s', skipping skill...\n",name,zone->name);
  2643. +                       config_setting_remove_elem(skills,h);
  2644. +                       --disabled_skills_count;
  2645. +                       --h;
  2646. +                       continue;
  2647. +                   }
  2648. +                   if( !map_zone_bl_type(config_setting_get_string_elem(skills,h)) )/* we dont remove it from the three due to inheritance */
  2649. +                       --disabled_skills_count;
  2650. +               }
  2651. +               /* all ok, process */
  2652. +               CREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, disabled_skills_count );
  2653. +               for(h = 0, v = 0; h < config_setting_length(skills); h++) {
  2654. +                   config_setting_t *skill = config_setting_get_elem(skills, h);
  2655. +                   struct map_zone_disabled_skill_entry * entry;
  2656. +                   enum bl_type type;
  2657. +                   name = config_setting_name(skill);
  2658. +
  2659. +                   if( (type = map_zone_bl_type(config_setting_get_string_elem(skills,h))) ) { /* only add if enabled */
  2660. +                       CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
  2661. +
  2662. +                       entry->nameid = strdb_iget(skilldb_name2id, name);
  2663. +                       entry->type = type;
  2664. +
  2665. +                       zone->disabled_skills[v++] = entry;
  2666. +                   }
  2667. +
  2668. +               }
  2669. +               zone->disabled_skills_count = disabled_skills_count;
  2670. +           }
  2671. +
  2672. +           if( (items = config_setting_get_member(zone_e, "disabled_items")) != NULL ) {
  2673. +               disabled_items_count = config_setting_length(items);
  2674. +               /* validate */
  2675. +               for(h = 0; h < config_setting_length(items); h++) {
  2676. +                   config_setting_t *item = config_setting_get_elem(items, h);
  2677. +                   name = config_setting_name(item);
  2678. +                   data = itemdb_searchname(name);
  2679. +                   if( data == NULL ) {
  2680. +                       ShowError("map_zone_db: unknown item (%s) in disabled_items for zone '%s', skipping item...\n",name,zone->name);
  2681. +                       config_setting_remove_elem(items,h);
  2682. +                       --disabled_items_count;
  2683. +                       --h;
  2684. +                       continue;
  2685. +                   }
  2686. +                   if( !config_setting_get_bool(item) )/* we dont remove it from the three due to inheritance */
  2687. +                       --disabled_items_count;
  2688. +               }
  2689. +               /* all ok, process */
  2690. +               CREATE( zone->disabled_items, int, disabled_items_count );
  2691. +               for(h = 0, v = 0; h < config_setting_length(items); h++) {
  2692. +                   config_setting_t *item = config_setting_get_elem(items, h);
  2693. +
  2694. +                   if( config_setting_get_bool(item) ) { /* only add if enabled */
  2695. +                       name = config_setting_name(item);
  2696. +                       data = itemdb_searchname(name);
  2697. +                       zone->disabled_items[v++] = data->nameid;
  2698. +                   }
  2699. +
  2700. +               }
  2701. +               zone->disabled_items_count = disabled_items_count;
  2702. +           }
  2703. +
  2704. +           if( (mapflags = config_setting_get_member(zone_e, "mapflags")) != NULL ) {
  2705. +               mapflags_count = config_setting_length(mapflags);
  2706. +               /* mapflags are not validated here, so we save all anyway */
  2707. +               CREATE( zone->mapflags, char *, mapflags_count );
  2708. +               for(h = 0; h < mapflags_count; h++) {
  2709. +                   CREATE( zone->mapflags[h], char, MAP_ZONE_MAPFLAG_LENGTH );
  2710. +
  2711. +                   name = config_setting_get_string_elem(mapflags, h);
  2712. +
  2713. +                   safestrncpy(zone->mapflags[h], name, MAP_ZONE_MAPFLAG_LENGTH);
  2714. +
  2715. +               }
  2716. +               zone->mapflags_count = mapflags_count;
  2717. +           }
  2718. +
  2719. +
  2720. +           if( !is_all ) /* global template doesn't go into db -- since it isn't a alloc'd piece of data */
  2721. +               strdb_put(zone_db, zonename, zone);
  2722. +
  2723. +       }
  2724. +
  2725. +       /* process inheritance, aka loop through the whole thing again :P */
  2726. +       for (i = 0; i < zone_count; ++i) {
  2727. +           config_setting_t *inherit_tree = NULL;
  2728. +
  2729. +           zone_e = config_setting_get_elem(zones, i);
  2730. +
  2731. +           if( (inherit_tree = config_setting_get_member(zone_e, "inherit")) != NULL ) {
  2732. +               int inherit_count = config_setting_length(inherit_tree);
  2733. +               for(h = 0; h < inherit_count; h++) {
  2734. +                   struct map_zone_data *izone; /* inherit zone */
  2735. +                   int disabled_skills_count_i = 0; /* disabled skill count from inherit zone */
  2736. +                   int disabled_items_count_i = 0; /* disabled item count from inherit zone */
  2737. +                   int mapflags_count_i = 0; /* mapflag count from inherit zone */
  2738. +                   int j;
  2739. +
  2740. +                   name = config_setting_get_string_elem(inherit_tree, h);
  2741. +                   config_setting_lookup_string(zone_e, "name", &zonename);/* will succeed for we validated it earlier */
  2742. +
  2743. +                   if( !(izone = strdb_get(zone_db, name)) ) {
  2744. +                       ShowError("map_zone_db: Unknown zone '%s' being inherit by zone '%s', skipping...\n",name,zonename);
  2745. +                       continue;
  2746. +                   }
  2747. +
  2748. +                   zone = strdb_get(zone_db, zonename);/* will succeed for we just put it in here */
  2749. +
  2750. +                   disabled_skills_count_i = izone->disabled_skills_count;
  2751. +                   disabled_items_count_i = izone->disabled_items_count;
  2752. +                   mapflags_count_i = izone->mapflags_count;
  2753. +
  2754. +                   /* process everything to override, paying attention to config_setting_get_bool */
  2755. +                   if( (skills = config_setting_get_member(zone_e, "disabled_skills")) != NULL ) {
  2756. +                       disabled_skills_count = config_setting_length(skills);
  2757. +                       for(j = 0; j < disabled_skills_count_i; j++) {
  2758. +                           int k;
  2759. +                           for(k = 0; k < disabled_skills_count; k++) {
  2760. +                               config_setting_t *skill = config_setting_get_elem(skills, k);
  2761. +                               if( strdb_iget(skilldb_name2id, config_setting_name(skill)) == izone->disabled_skills[j]->nameid ) {
  2762. +                                   break;
  2763. +                               }
  2764. +                           }
  2765. +                           if( k == disabled_skills_count ) {/* we didn't find it */
  2766. +                               struct map_zone_disabled_skill_entry *entry;
  2767. +                               RECREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, ++zone->disabled_skills_count );
  2768. +                               CREATE( entry, struct map_zone_disabled_skill_entry, 1 );
  2769. +                               entry->nameid = izone->disabled_skills[j]->nameid;
  2770. +                               entry->type = izone->disabled_skills[j]->type;
  2771. +                               zone->disabled_skills[zone->disabled_skills_count-1] = entry;
  2772. +                           }
  2773. +                       }
  2774. +                   }
  2775. +
  2776. +                   if( (items = config_setting_get_member(zone_e, "disabled_items")) != NULL ) {
  2777. +                       disabled_items_count = config_setting_length(items);
  2778. +                       for(j = 0; j < disabled_items_count_i; j++) {
  2779. +                           int k;
  2780. +                           for(k = 0; k < disabled_items_count; k++) {
  2781. +                               config_setting_t *item = config_setting_get_elem(items, k);
  2782. +
  2783. +                               name = config_setting_name(item);
  2784. +                               data = itemdb_searchname(name);
  2785. +
  2786. +                               if( data->nameid == izone->disabled_items[j] ) {
  2787. +                                   if( config_setting_get_bool(item) )
  2788. +                                       continue;
  2789. +                                   break;
  2790. +                               }
  2791. +                           }
  2792. +                           if( k == disabled_items_count ) {/* we didn't find it */
  2793. +                               RECREATE( zone->disabled_items, int, ++zone->disabled_items_count );
  2794. +                               zone->disabled_items[zone->disabled_items_count-1] = izone->disabled_items[j];
  2795. +                           }
  2796. +                       }
  2797. +                   }
  2798. +
  2799. +                   if( (mapflags = config_setting_get_member(zone_e, "mapflags")) != NULL ) {
  2800. +                       mapflags_count = config_setting_length(mapflags);
  2801. +                       for(j = 0; j < mapflags_count_i; j++) {
  2802. +                           int k;
  2803. +                           for(k = 0; k < mapflags_count; k++) {
  2804. +                               name = config_setting_get_string_elem(mapflags, k);
  2805. +
  2806. +                               if( strcmpi(name,izone->mapflags[j]) == 0 ) {
  2807. +                                   break;
  2808. +                               }
  2809. +                           }
  2810. +                           if( k == mapflags_count ) {/* we didn't find it */
  2811. +                               RECREATE( zone->mapflags, char*, ++zone->mapflags_count );
  2812. +                               CREATE( zone->mapflags[zone->mapflags_count-1], char, MAP_ZONE_MAPFLAG_LENGTH );
  2813. +                               safestrncpy(zone->mapflags[zone->mapflags_count-1], izone->mapflags[j], MAP_ZONE_MAPFLAG_LENGTH);
  2814. +                           }
  2815. +                       }
  2816. +                   }
  2817. +               }
  2818. +           }
  2819. +       }
  2820. +
  2821. +       ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' zones in '"CL_WHITE"%s"CL_RESET"'.\n", zone_count, config_filename);
  2822. +       /* not supposed to go in here but in skill_final whatever */
  2823. +       config_destroy(&map_zone_db);
  2824. +   }
  2825. +}
  2826. +
  2827.  /**
  2828.   * @see DBApply
  2829.   */
  2830. @@ -3615,21 +4079,10 @@
  2831.     do_final_battleground();
  2832.     do_final_duel();
  2833.     do_final_elemental();
  2834. +   do_final_maps();
  2835.  
  2836.     map_db->destroy(map_db, map_db_final);
  2837.  
  2838. -   for (i=0; i<map_num; i++) {
  2839. -       if(map[i].cell) aFree(map[i].cell);
  2840. -       if(map[i].block) aFree(map[i].block);
  2841. -       if(map[i].block_mob) aFree(map[i].block_mob);
  2842. -       if(battle_config.dynamic_mobs) { //Dynamic mobs flag by [random]
  2843. -           if(map[i].mob_delete_timer != INVALID_TIMER)
  2844. -               delete_timer(map[i].mob_delete_timer, map_removemobs_timer);
  2845. -           for (j=0; j<MAX_MOB_LIST_PER_MAP; j++)
  2846. -               if (map[i].moblist[j]) aFree(map[i].moblist[j]);
  2847. -       }
  2848. -   }
  2849. -
  2850.     mapindex_final();
  2851.     if(enable_grf)
  2852.         grfio_final();
  2853. @@ -3749,7 +4202,6 @@
  2854.  
  2855.     rnd_init();
  2856.     map_config_read(MAP_CONF_NAME);
  2857. -   /* only temporary until sirius's datapack patch is complete  */
  2858.  
  2859.     // loads npcs
  2860.     map_reloadnpc(false);
  2861. @@ -3791,7 +4243,9 @@
  2862.     regen_db = idb_alloc(DB_OPT_BASE); // efficient status_natural_heal processing
  2863.  
  2864.     iwall_db = strdb_alloc(DB_OPT_RELEASE_DATA,2*NAME_LENGTH+2+1); // [Zephyrus] Invisible Walls
  2865. +   zone_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, MAP_ZONE_NAME_LENGTH);
  2866.  
  2867. +
  2868.     map_sql_init();
  2869.     if (log_config.sql_logs)
  2870.         log_sql_init();
  2871. @@ -3815,6 +4269,7 @@
  2872.     do_init_script();
  2873.     do_init_itemdb();
  2874.     do_init_skill();
  2875. +   read_map_zone_db();/* read after item and skill initalization */
  2876.     do_init_mob();
  2877.     do_init_pc();
  2878.     do_init_status();
  2879. Index: src/map/map.h
  2880. --- src/map/map.h Base (BASE)
  2881. +++ src/map/map.h Locally Modified (Based On LOCAL)
  2882. @@ -11,9 +11,6 @@
  2883.  #include "../common/db.h"
  2884.  #include "../common/msg_conf.h"
  2885.  
  2886. -/**
  2887. - * [rAthena.org]
  2888. - **/
  2889.  #include "../config/core.h"
  2890.  
  2891.  #include <stdarg.h>
  2892. @@ -22,8 +19,7 @@
  2893.  struct item_data;
  2894.  struct raChSysCh;
  2895.  
  2896. -enum E_MAPSERVER_ST
  2897. -{
  2898. +enum E_MAPSERVER_ST {
  2899.     MAPSERVER_ST_RUNNING = CORE_ST_LAST,
  2900.     MAPSERVER_ST_SHUTDOWN,
  2901.     MAPSERVER_ST_LAST
  2902. @@ -507,6 +503,39 @@
  2903.     bool shootable;
  2904.  };
  2905.  
  2906. +struct mapflag_skill_adjust {
  2907. +   unsigned short skill_id;
  2908. +   unsigned short modifier;
  2909. +};
  2910. +struct map_zone_disabled_skill_entry {
  2911. +   unsigned short nameid;
  2912. +   enum bl_type type;
  2913. +};
  2914. +
  2915. +#define MAP_ZONE_NAME_LENGTH 30
  2916. +#define MAP_ZONE_ALL_NAME "Normal"
  2917. +#define MAP_ZONE_PVP_NAME "PvP"
  2918. +#define MAP_ZONE_GVG_NAME "GvG"
  2919. +#define MAP_ZONE_BG_NAME "Battlegrounds"
  2920. +#define MAP_ZONE_PK_NAME "PK Mode"
  2921. +#define MAP_ZONE_MAPFLAG_LENGTH 50
  2922. +DBMap *zone_db;/* string => struct map_zone_data */
  2923. +struct map_zone_data {
  2924. +   char name[MAP_ZONE_NAME_LENGTH];/* 20'd */
  2925. +   struct map_zone_disabled_skill_entry **disabled_skills;
  2926. +   int disabled_skills_count;
  2927. +   int *disabled_items;
  2928. +   int disabled_items_count;
  2929. +   char **mapflags;
  2930. +   int mapflags_count;
  2931. +};
  2932. +void map_zone_init(void);
  2933. +void map_zone_apply(int m, struct map_zone_data *zone,char* w1, const char* start, const char* buffer, const char* filepath);
  2934. +
  2935. +struct map_zone_data map_zone_all;/* used as a base on all maps */
  2936. +struct map_zone_data map_zone_pk;/* used for (pk_mode) */
  2937. +
  2938. +
  2939.  struct map_data {
  2940.     char name[MAP_NAME_LENGTH];
  2941.     uint16 index; // The map index used by the mapindex* functions.
  2942. @@ -555,17 +584,12 @@
  2943.         unsigned fireworks : 1;
  2944.         unsigned sakura : 1; // [Valaris]
  2945.         unsigned leaves : 1; // [Valaris]
  2946. -       /**
  2947. -        * No longer available, keeping here just in case it's back someday. [Ind]
  2948. -        **/
  2949. -       //unsigned rain : 1; // [Valaris]
  2950.         unsigned nogo : 1; // [Valaris]
  2951.         unsigned nobaseexp  : 1; // [Lorky] added by Lupus
  2952.         unsigned nojobexp   : 1; // [Lorky]
  2953.         unsigned nomobloot  : 1; // [Lorky]
  2954.         unsigned nomvploot  : 1; // [Lorky]
  2955.         unsigned nightenabled :1; //For night display. [Skotlex]
  2956. -       unsigned restricted : 1; // [Komurka]
  2957.         unsigned nodrop : 1;
  2958.         unsigned novending : 1;
  2959.         unsigned loadevent : 1;
  2960. @@ -575,6 +599,7 @@
  2961.         unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
  2962.         unsigned reset :1; // [Daegaladh]
  2963.         unsigned chsysnolocalaj : 1;
  2964. +       unsigned noknockback : 1;
  2965.     } flag;
  2966.     struct point save;
  2967.     struct npc_data *npc[MAX_NPC_PER_MAP];
  2968. @@ -586,7 +611,6 @@
  2969.  
  2970.     struct spawn_data *moblist[MAX_MOB_LIST_PER_MAP]; // [Wizputer]
  2971.     int mob_delete_timer;   // [Skotlex]
  2972. -   int zone;   // zone number (for item/skill restrictions)
  2973.     int jexp;   // map experience multiplicator
  2974.     int bexp;   // map experience multiplicator
  2975.     int nocommand; //Blocks @/# commands for non-gms. [Skotlex]
  2976. @@ -601,8 +625,30 @@
  2977.     int instance_id;
  2978.     int instance_src_map;
  2979.  
  2980. -   /* rAthena Local Chat */
  2981. +   /* adjust_unit_duration mapflag */
  2982. +   struct mapflag_skill_adjust **units;
  2983. +   unsigned short unit_count;
  2984. +   /* adjust_skill_damage mapflag */
  2985. +   struct mapflag_skill_adjust **skills;
  2986. +   unsigned short skill_count;
  2987. +
  2988. +   /* Hercules nocast db overhaul */
  2989. +   struct map_zone_data *zone;
  2990. +   /* Local Chat */
  2991.     struct raChSysCh *channel;
  2992. +   /* invincible_time_inc mapflag */
  2993. +   unsigned int invincible_time_inc;
  2994. +
  2995. +   /* weapon_damage_rate mapflag */
  2996. +   unsigned short weapon_damage_rate;
  2997. +   /* magic_damage_rate mapflag */
  2998. +   unsigned short magic_damage_rate;
  2999. +   /* misc_damage_rate mapflag */
  3000. +   unsigned short misc_damage_rate;
  3001. +   /* short_damage_rate mapflag */
  3002. +   unsigned short short_damage_rate;
  3003. +   /* long_damage_rate mapflag */
  3004. +   unsigned short long_damage_rate;
  3005.  };
  3006.  
  3007.  /// Stores information about a remote map (for multi-mapserver setups).
  3008. Index: src/map/mob.c
  3009. --- src/map/mob.c Base (BASE)
  3010. +++ src/map/mob.c Locally Modified (Based On LOCAL)
  3011. @@ -3403,8 +3403,7 @@
  3012.     for (i=0,j = MAX_SKILL_TREE-1;j>=0 && i< MAX_MOBSKILL ;j--) {
  3013.         skill_id = skill_tree[pc_class2idx(sd->status.class_)][j].id;
  3014.         if (!skill_id || sd->status.skill[skill_id].lv < 1 ||
  3015. -           (skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL)) ||
  3016. -           skill_get_nocast(skill_id)&16
  3017. +           (skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL|INF2_CLONE_NOCOPY))
  3018.         )
  3019.             continue;
  3020.         //Normal aggressive mob, disable skills that cannot help them fight
  3021. Index: src/map/npc.c
  3022. --- src/map/npc.c Base (BASE)
  3023. +++ src/map/npc.c Locally Modified (Based On LOCAL)
  3024. @@ -112,8 +112,7 @@
  3025.     return NULL;
  3026.  }
  3027.  
  3028. -static int npc_isnear_sub(struct block_list* bl, va_list args)
  3029. -{
  3030. +static int npc_isnear_sub(struct block_list* bl, va_list args) {
  3031.     struct npc_data *nd = (struct npc_data*)bl;
  3032.  
  3033.     if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) )
  3034. @@ -122,8 +121,8 @@
  3035.     return 1;
  3036.  }
  3037.  
  3038. -bool npc_isnear(struct block_list * bl)
  3039. -{
  3040. +bool npc_isnear(struct block_list * bl) {
  3041. +
  3042.     if( battle_config.min_npc_vendchat_distance > 0 &&
  3043.         map_foreachinrange(npc_isnear_sub,bl, battle_config.min_npc_vendchat_distance, BL_NPC) )
  3044.         return true;
  3045. @@ -3166,8 +3165,7 @@
  3046.   * eg : bat_c01    mapflag battleground    2
  3047.   * also chking if mapflag conflict with another
  3048.   *------------------------------------------*/
  3049. -static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath)
  3050. -{
  3051. +const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath) {
  3052.     int16 m;
  3053.     char mapname[32];
  3054.     int state = 1;
  3055. @@ -3234,20 +3232,24 @@
  3056.         map[m].flag.nozenypenalty=state;
  3057.     }
  3058.     else if (!strcmpi(w3,"pvp")) {
  3059. +       struct map_zone_data *zone;
  3060.         map[m].flag.pvp = state;
  3061. -       if( state && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) )
  3062. -       {
  3063. +       if( state && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) ) {
  3064.             map[m].flag.gvg = 0;
  3065.             map[m].flag.gvg_dungeon = 0;
  3066.             map[m].flag.gvg_castle = 0;
  3067.             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));
  3068.         }
  3069. -       if( state && map[m].flag.battleground )
  3070. -       {
  3071. +       if( state && map[m].flag.battleground ) {
  3072.             map[m].flag.battleground = 0;
  3073.             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));
  3074.         }
  3075. +       if( state && (zone = strdb_get(zone_db, MAP_ZONE_PVP_NAME)) && map[m].zone != zone ) {
  3076. +           map_zone_apply(m,zone,w1,start,buffer,filepath);
  3077. +       } else if ( !state ) {
  3078. +           map[m].zone = &map_zone_pk;
  3079.     }
  3080. +   }
  3081.     else if (!strcmpi(w3,"pvp_noparty"))
  3082.         map[m].flag.pvp_noparty=state;
  3083.     else if (!strcmpi(w3,"pvp_noguild"))
  3084. @@ -3286,18 +3288,21 @@
  3085.     else if (!strcmpi(w3,"pvp_nocalcrank"))
  3086.         map[m].flag.pvp_nocalcrank=state;
  3087.     else if (!strcmpi(w3,"gvg")) {
  3088. +       struct map_zone_data *zone;
  3089. +
  3090.         map[m].flag.gvg = state;
  3091. -       if( state && map[m].flag.pvp )
  3092. -       {
  3093. +       if( state && map[m].flag.pvp ) {
  3094.             map[m].flag.pvp = 0;
  3095.             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));
  3096.         }
  3097. -       if( state && map[m].flag.battleground )
  3098. -       {
  3099. +       if( state && map[m].flag.battleground ) {
  3100.             map[m].flag.battleground = 0;
  3101.             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));
  3102.         }
  3103. +       if( state && (zone = strdb_get(zone_db, MAP_ZONE_GVG_NAME)) && map[m].zone != zone ) {
  3104. +           map_zone_apply(m,zone,w1,start,buffer,filepath);
  3105.     }
  3106. +   }
  3107.     else if (!strcmpi(w3,"gvg_noparty"))
  3108.         map[m].flag.gvg_noparty=state;
  3109.     else if (!strcmpi(w3,"gvg_dungeon")) {
  3110. @@ -3309,29 +3314,30 @@
  3111.         if (state) map[m].flag.pvp=0;
  3112.     }
  3113.     else if (!strcmpi(w3,"battleground")) {
  3114. -       if( state )
  3115. -       {
  3116. +       struct map_zone_data *zone;
  3117. +       if( state ) {
  3118.             if( sscanf(w4, "%d", &state) == 1 )
  3119.                 map[m].flag.battleground = state;
  3120.             else
  3121.                 map[m].flag.battleground = 1; // Default value
  3122. -       }
  3123. -       else
  3124. +       } else
  3125.             map[m].flag.battleground = 0;
  3126.  
  3127. -       if( map[m].flag.battleground && map[m].flag.pvp )
  3128. -       {
  3129. +       if( map[m].flag.battleground && map[m].flag.pvp ) {
  3130.             map[m].flag.pvp = 0;
  3131.             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));
  3132.         }
  3133. -       if( map[m].flag.battleground && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) )
  3134. -       {
  3135. +       if( map[m].flag.battleground && (map[m].flag.gvg || map[m].flag.gvg_dungeon || map[m].flag.gvg_castle) ) {
  3136.             map[m].flag.gvg = 0;
  3137.             map[m].flag.gvg_dungeon = 0;
  3138.             map[m].flag.gvg_castle = 0;
  3139.             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));
  3140.         }
  3141. +
  3142. +       if( state && (zone = strdb_get(zone_db, MAP_ZONE_BG_NAME)) && map[m].zone != zone ) {
  3143. +           map_zone_apply(m,zone,w1,start,buffer,filepath);
  3144.     }
  3145. +   }
  3146.     else if (!strcmpi(w3,"noexppenalty"))
  3147.         map[m].flag.noexppenalty=state;
  3148.     else if (!strcmpi(w3,"nozenypenalty"))
  3149. @@ -3360,11 +3366,6 @@
  3150.         map[m].flag.sakura=state;
  3151.     else if (!strcmpi(w3,"leaves"))
  3152.         map[m].flag.leaves=state;
  3153. -   /**
  3154. -    * No longer available, keeping here just in case it's back someday. [Ind]
  3155. -    **/
  3156. -   //else if (!strcmpi(w3,"rain"))
  3157. -   //  map[m].flag.rain=state;
  3158.     else if (!strcmpi(w3,"nightenabled"))
  3159.         map[m].flag.nightenabled=state;
  3160.     else if (!strcmpi(w3,"nogo"))
  3161. @@ -3394,16 +3395,6 @@
  3162.         } else
  3163.             map[m].nocommand=0;
  3164.     }
  3165. -   else if (!strcmpi(w3,"restricted")) {
  3166. -       if (state) {
  3167. -           map[m].flag.restricted=1;
  3168. -           sscanf(w4, "%d", &state);
  3169. -           map[m].zone |= 1<<(state+1);
  3170. -       } else {
  3171. -           map[m].flag.restricted=0;
  3172. -           map[m].zone = 0;
  3173. -       }
  3174. -   }
  3175.     else if (!strcmpi(w3,"jexp")) {
  3176.         map[m].jexp = (state) ? atoi(w4) : 100;
  3177.         if( map[m].jexp < 0 ) map[m].jexp = 100;
  3178. @@ -3424,9 +3415,69 @@
  3179.         map[m].flag.guildlock=state;
  3180.     else if (!strcmpi(w3,"reset"))
  3181.         map[m].flag.reset=state;
  3182. -   else if (!strcmpi(w3,"nomapchannelautojoin"))
  3183. +   else if (!strcmpi(w3,"adjust_unit_duration")) {
  3184. +       char *mod;
  3185. +       int skill_id;
  3186. +
  3187. +       strtok(w4,"\t");/* makes w4 contain only 4th param */
  3188. +
  3189. +       if( !(mod = strtok(NULL,"\t")) ) {/* makes mod contain only the 5th param */
  3190. +           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));
  3191. +       } else if( !( skill_id = skill_name2id(w4) ) || !skill_get_unit_id( skill_name2id(w4), 0) ) {
  3192. +           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));
  3193. +       } else if ( atoi(mod) < 1 || atoi(mod) > USHRT_MAX ) {
  3194. +           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));
  3195. +       } else {
  3196. +           int idx = map[m].unit_count;
  3197. +           RECREATE(map[m].units, struct mapflag_skill_adjust*, ++map[m].unit_count);
  3198. +           CREATE(map[m].units[idx],struct mapflag_skill_adjust,1);
  3199. +           map[m].units[idx]->skill_id = (unsigned short)skill_id;
  3200. +           map[m].units[idx]->modifier = (unsigned short)atoi(mod);
  3201. +       }
  3202. +   } else if (!strcmpi(w3,"adjust_skill_damage")) {
  3203. +       char *mod;
  3204. +       int skill_id;
  3205. +
  3206. +       strtok(w4,"\t");/* makes w4 contain only 4th param */
  3207. +
  3208. +       if( !(mod = strtok(NULL,"\t")) ) {/* makes mod contain only the 5th param */
  3209. +           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));
  3210. +       } else if( !( skill_id = skill_name2id(w4) ) ) {
  3211. +           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));
  3212. +       } else if ( atoi(mod) < 1 || atoi(mod) > USHRT_MAX ) {
  3213. +           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));
  3214. +       } else {
  3215. +           int idx = map[m].skill_count;
  3216. +           RECREATE(map[m].skills, struct mapflag_skill_adjust*, ++map[m].skill_count);
  3217. +           CREATE(map[m].skills[idx],struct mapflag_skill_adjust,1);
  3218. +           map[m].skills[idx]->skill_id = (unsigned short)skill_id;
  3219. +           map[m].skills[idx]->modifier = (unsigned short)atoi(mod);
  3220. +       }
  3221. +   } else if (!strcmpi(w3,"zone")) {
  3222. +       struct map_zone_data *zone;
  3223. +
  3224. +       if( !(zone = strdb_get(zone_db, w4)) ) {
  3225. +           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));
  3226. +       } else if( map[m].zone != zone ) { /* we do not override :P would mess everything */
  3227. +           map_zone_apply(m,zone,w1,start,buffer,filepath);
  3228. +       }
  3229. +   } else if ( !strcmpi(w3,"nomapchannelautojoin") ) {
  3230.         map[m].flag.chsysnolocalaj = state;
  3231. -   else
  3232. +   } else if ( !strcmpi(w3,"invincible_time_inc") ) {
  3233. +       map[m].invincible_time_inc = (state) ? atoi(w4) : 0;
  3234. +   } else if ( !strcmpi(w3,"noknockback") ) {
  3235. +       map[m].flag.noknockback = state;
  3236. +   } else if ( !strcmpi(w3,"weapon_damage_rate") ) {
  3237. +       map[m].weapon_damage_rate = (state) ? atoi(w4) : 100;
  3238. +   } else if ( !strcmpi(w3,"magic_damage_rate") ) {
  3239. +       map[m].magic_damage_rate = (state) ? atoi(w4) : 100;
  3240. +   } else if ( !strcmpi(w3,"misc_damage_rate") ) {
  3241. +       map[m].misc_damage_rate = (state) ? atoi(w4) : 100;
  3242. +   } else if ( !strcmpi(w3,"short_damage_rate") ) {
  3243. +       map[m].short_damage_rate = (state) ? atoi(w4) : 100;
  3244. +   } else if ( !strcmpi(w3,"long_damage_rate") ) {
  3245. +       map[m].long_damage_rate = (state) ? atoi(w4) : 100;
  3246. +   } else
  3247.         ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer));
  3248.  
  3249.     return strchr(start,'\n');// continue
  3250. @@ -3765,6 +3816,8 @@
  3251.     for( i = 0; i < ARRAYLENGTH(instance); ++i )
  3252.         instance_init(instance[i].instance_id);
  3253.  
  3254. +   map_zone_init();
  3255. +
  3256.     //Re-read the NPC Script Events cache.
  3257.     npc_read_event_script();
  3258.  
  3259. @@ -3893,6 +3946,8 @@
  3260.         "\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
  3261.         npc_id - START_NPC_NUM, npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
  3262.  
  3263. +   map_zone_init();
  3264. +
  3265.     // set up the events cache
  3266.     memset(script_event, 0, sizeof(script_event));
  3267.     npc_read_event_script();
  3268. Index: src/map/npc.h
  3269. --- src/map/npc.h Base (BASE)
  3270. +++ src/map/npc.h Locally Modified (Based On LOCAL)
  3271. @@ -124,6 +124,7 @@
  3272.  int npc_buylist(struct map_session_data* sd,int n, unsigned short* item_list);
  3273.  int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list);
  3274.  void npc_parse_mob2(struct spawn_data* mob);
  3275. +const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath);
  3276.  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);
  3277.  int npc_globalmessage(const char* name,const char* mes);
  3278.  
  3279. Index: src/map/path.c
  3280. --- src/map/path.c Base (BASE)
  3281. +++ src/map/path.c Locally Modified (Based On LOCAL)
  3282. Index: src/map/pc.c
  3283. --- src/map/pc.c Base (BASE)
  3284. +++ src/map/pc.c Locally Modified (Based On LOCAL)
  3285. @@ -123,10 +123,11 @@
  3286.     return 0;
  3287.  }
  3288.  
  3289. -void pc_setinvincibletimer(struct map_session_data* sd, int val)
  3290. -{
  3291. +void pc_setinvincibletimer(struct map_session_data* sd, int val) {
  3292.     nullpo_retv(sd);
  3293.  
  3294. +   val += map[sd->bl.m].invincible_time_inc;
  3295. +
  3296.     if( sd->invincible_timer != INVALID_TIMER )
  3297.         delete_timer(sd->invincible_timer,pc_invincible_timer);
  3298.     sd->invincible_timer = add_timer(gettick()+val,pc_invincible_timer,sd->bl.id,0);
  3299. @@ -1240,18 +1241,18 @@
  3300.  
  3301.  static int pc_calc_skillpoint(struct map_session_data* sd)
  3302.  {
  3303. -   int  i,skill,inf2,skill_point=0;
  3304. +   int  i,skill_lv,inf2,skill_point=0;
  3305.  
  3306.     nullpo_ret(sd);
  3307.  
  3308.     for(i=1;i<MAX_SKILL;i++){
  3309. -       if( (skill = pc_checkskill(sd,i)) > 0) {
  3310. +       if( (skill_lv = pc_checkskill(sd,i)) > 0) {
  3311.             inf2 = skill_get_inf2(i);
  3312.             if((!(inf2&INF2_QUEST_SKILL) || battle_config.quest_skill_learn) &&
  3313.                 !(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) //Do not count wedding/link skills. [Skotlex]
  3314.                 ) {
  3315.                 if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
  3316. -                   skill_point += skill;
  3317. +                   skill_point += skill_lv;
  3318.                 else
  3319.                 if(sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0)
  3320.                     skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0);
  3321. @@ -1366,7 +1367,6 @@
  3322.         for( i = 0; i < MAX_SKILL_TREE && (id = skill_tree[c][i].id) > 0; i++ )
  3323.         {
  3324.             int f;
  3325. -
  3326.             if( sd->status.skill[id].id )
  3327.                 continue; //Skill already known.
  3328.  
  3329. @@ -4209,14 +4209,14 @@
  3330.  int pc_useitem(struct map_session_data *sd,int n)
  3331.  {
  3332.     unsigned int tick = gettick();
  3333. -   int amount, nameid;
  3334. +   int amount, nameid, i;
  3335.     struct script_code *script;
  3336.  
  3337.     nullpo_ret(sd);
  3338.  
  3339.     if( sd->npc_id ){
  3340.  #ifdef RENEWAL
  3341. -       clif_msg(sd, 0x783); // TODO look for the client date that has this message.
  3342. +       clif_msg(sd, USAGE_FAIL); // TODO look for the client date that has this message.
  3343.  #endif
  3344.         return 0;
  3345.     }
  3346. @@ -4303,19 +4303,15 @@
  3347.     }
  3348.  
  3349.     /* on restricted maps the item is consumed but the effect is not used */
  3350. -   if (
  3351. -       (!map_flag_vs(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&1) || // Normal
  3352. -       (map[sd->bl.m].flag.pvp && sd->inventory_data[n]->flag.no_equip&2) || // PVP
  3353. -       (map_flag_gvg(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&4) || // GVG
  3354. -       (map[sd->bl.m].flag.battleground && sd->inventory_data[n]->flag.no_equip&8) || // Battleground
  3355. -       (map[sd->bl.m].flag.restricted && sd->inventory_data[n]->flag.no_equip&(8*map[sd->bl.m].zone)) // Zone restriction
  3356. -       ) {
  3357. +   for(i = 0; i < map[sd->bl.m].zone->disabled_items_count; i++) {
  3358. +       if( map[sd->bl.m].zone->disabled_items[i] == nameid ) {
  3359.         if( battle_config.item_restricted_consumption_type ) {
  3360.             clif_useitemack(sd,n,sd->status.inventory[n].amount-1,true);
  3361.             pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
  3362.         }
  3363. -       return 0;/* regardless, effect is not run */
  3364. +           return 0;
  3365.     }
  3366. +   }
  3367.  
  3368.     sd->itemid = sd->status.inventory[n].nameid;
  3369.     sd->itemindex = n;
  3370. @@ -6505,8 +6501,7 @@
  3371.     if( !src || src == &sd->bl )
  3372.         return;
  3373.  
  3374. -   if( pc_issit(sd) )
  3375. -   {
  3376. +   if( pc_issit(sd) ) {
  3377.         pc_setstand(sd);
  3378.         skill_sit(sd,0);
  3379.     }
  3380. Index: src/map/script.c
  3381. --- src/map/script.c Base (BASE)
  3382. +++ src/map/script.c Locally Modified (Based On LOCAL)
  3383. @@ -383,7 +383,7 @@
  3384.     MF_NORETURN,
  3385.     MF_NOWARPTO,
  3386.     MF_NIGHTMAREDROP,
  3387. -   MF_RESTRICTED,
  3388. +   MF_ZONE,
  3389.     MF_NOCOMMAND,
  3390.     MF_NODROP,
  3391.     MF_JEXP,
  3392. @@ -4790,8 +4790,10 @@
  3393.         {
  3394.             const char* name = reference_getname(data);
  3395.             if( name[0] == '.' ) {
  3396. +               if ( !ref ) {
  3397.                 ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1);
  3398.                 ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars);
  3399. +               }
  3400.                 data->ref = ref;
  3401.             }
  3402.         }
  3403. @@ -7266,7 +7268,7 @@
  3404.             }
  3405.             break;
  3406.         case 2:
  3407. -           if( ( g = guild_search(sd->status.guild_id) ) != NULL ) {
  3408. +           if( ( g = sd->guild ) != NULL ) {
  3409.                 script_pushstrcopy(st,g->name);
  3410.             } else {
  3411.                 script_pushconststr(st,"");
  3412. @@ -10760,10 +10762,6 @@
  3413.             case MF_FOG:                script_pushint(st,map[m].flag.fog); break;
  3414.             case MF_SAKURA:             script_pushint(st,map[m].flag.sakura); break;
  3415.             case MF_LEAVES:             script_pushint(st,map[m].flag.leaves); break;
  3416. -           /**
  3417. -            * No longer available, keeping here just in case it's back someday. [Ind]
  3418. -            **/
  3419. -           //case MF_RAIN:             script_pushint(st,map[m].flag.rain); break;
  3420.             case MF_NOGO:               script_pushint(st,map[m].flag.nogo); break;
  3421.             case MF_CLOUDS:             script_pushint(st,map[m].flag.clouds); break;
  3422.             case MF_CLOUDS2:            script_pushint(st,map[m].flag.clouds2); break;
  3423. @@ -10778,7 +10776,6 @@
  3424.             case MF_NORETURN:           script_pushint(st,map[m].flag.noreturn); break;
  3425.             case MF_NOWARPTO:           script_pushint(st,map[m].flag.nowarpto); break;
  3426.             case MF_NIGHTMAREDROP:      script_pushint(st,map[m].flag.pvp_nightmaredrop); break;
  3427. -           case MF_RESTRICTED:         script_pushint(st,map[m].flag.restricted); break;
  3428.             case MF_NOCOMMAND:          script_pushint(st,map[m].nocommand); break;
  3429.             case MF_NODROP:             script_pushint(st,map[m].flag.nodrop); break;
  3430.             case MF_JEXP:               script_pushint(st,map[m].jexp); break;
  3431. @@ -10817,13 +10814,22 @@
  3432.  BUILDIN_FUNC(setmapflag)
  3433.  {
  3434.     int16 m,i;
  3435. -   const char *str;
  3436. +   const char *str, *val2 = NULL;
  3437. +   struct script_data* data;
  3438.     int val=0;
  3439.  
  3440.     str=script_getstr(st,2);
  3441.     i=script_getnum(st,3);
  3442.     if(script_hasdata(st,4)){
  3443. -       val=script_getnum(st,4);
  3444. +       data = script_getdata(st,4);
  3445. +       get_val(st, data);
  3446. +
  3447. +
  3448. +       if( data_isstring(data) )
  3449. +           val2 = script_getstr(st, 4);
  3450. +       else
  3451. +           val = script_getnum(st, 4);
  3452. +
  3453.     }
  3454.     m = map_mapname2mapid(str);
  3455.     if(m >= 0) {
  3456. @@ -10856,10 +10862,6 @@
  3457.             case MF_FOG:                map[m].flag.fog = 1; break;
  3458.             case MF_SAKURA:             map[m].flag.sakura = 1; break;
  3459.             case MF_LEAVES:             map[m].flag.leaves = 1; break;
  3460. -           /**
  3461. -            * No longer available, keeping here just in case it's back someday. [Ind]
  3462. -            **/
  3463. -           //case MF_RAIN:             map[m].flag.rain = 1; break;
  3464.             case MF_NOGO:               map[m].flag.nogo = 1; break;
  3465.             case MF_CLOUDS:             map[m].flag.clouds = 1; break;
  3466.             case MF_CLOUDS2:            map[m].flag.clouds2 = 1; break;
  3467. @@ -10874,9 +10876,13 @@
  3468.             case MF_NORETURN:           map[m].flag.noreturn = 1; break;
  3469.             case MF_NOWARPTO:           map[m].flag.nowarpto = 1; break;
  3470.             case MF_NIGHTMAREDROP:      map[m].flag.pvp_nightmaredrop = 1; break;
  3471. -           case MF_RESTRICTED:
  3472. -               map[m].zone |= 1<<(val+1);
  3473. -               map[m].flag.restricted=1;
  3474. +           case MF_ZONE: {
  3475. +               char zone[6] = "zone\0";
  3476. +               char empty[1] = "\0";
  3477. +               char params[MAP_ZONE_MAPFLAG_LENGTH];
  3478. +               memcpy(params, val2, MAP_ZONE_MAPFLAG_LENGTH);
  3479. +               npc_parse_mapflag(map[m].name, empty, zone, params, empty, empty, empty);
  3480. +               }
  3481.                 break;
  3482.             case MF_NOCOMMAND:          map[m].nocommand = (val <= 0) ? 100 : val; break;
  3483.             case MF_NODROP:             map[m].flag.nodrop = 1; break;
  3484. @@ -10940,10 +10946,6 @@
  3485.             case MF_FOG:                map[m].flag.fog = 0; break;
  3486.             case MF_SAKURA:             map[m].flag.sakura = 0; break;
  3487.             case MF_LEAVES:             map[m].flag.leaves = 0; break;
  3488. -           /**
  3489. -            * No longer available, keeping here just in case it's back someday. [Ind]
  3490. -            **/
  3491. -           //case MF_RAIN:             map[m].flag.rain = 0; break;
  3492.             case MF_NOGO:               map[m].flag.nogo = 0; break;
  3493.             case MF_CLOUDS:             map[m].flag.clouds = 0; break;
  3494.             case MF_CLOUDS2:            map[m].flag.clouds2 = 0; break;
  3495. @@ -10958,11 +10960,8 @@
  3496.             case MF_NORETURN:           map[m].flag.noreturn = 0; break;
  3497.             case MF_NOWARPTO:           map[m].flag.nowarpto = 0; break;
  3498.             case MF_NIGHTMAREDROP:      map[m].flag.pvp_nightmaredrop = 0; break;
  3499. -           case MF_RESTRICTED:
  3500. -               map[m].zone ^= 1<<(val+1);
  3501. -               if (map[m].zone == 0){
  3502. -                   map[m].flag.restricted=0;
  3503. -               }
  3504. +           case MF_ZONE:/* reset zone state, mapflags cant be removed however */
  3505. +               map[m].zone = ( battle_config.pk_mode && map[m].flag.pvp ) ? &map_zone_pk : &map_zone_all;
  3506.                 break;
  3507.             case MF_NOCOMMAND:          map[m].nocommand = 0; break;
  3508.             case MF_NODROP:             map[m].flag.nodrop = 0; break;
  3509. Index: src/map/skill.c
  3510. --- src/map/skill.c Base (BASE)
  3511. +++ src/map/skill.c Locally Modified (Based On LOCAL)
  3512. @@ -223,7 +223,6 @@
  3513.  int    skill_get_mhp( uint16 skill_id ,uint16 skill_lv )       { skill_get (skill_db[skill_id].mhp[skill_lv-1], skill_id, skill_lv); }
  3514.  int    skill_get_castnodex( uint16 skill_id ,uint16 skill_lv ) { skill_get (skill_db[skill_id].castnodex[skill_lv-1], skill_id, skill_lv); }
  3515.  int    skill_get_delaynodex( uint16 skill_id ,uint16 skill_lv ){ skill_get (skill_db[skill_id].delaynodex[skill_lv-1], skill_id, skill_lv); }
  3516. -int    skill_get_nocast ( uint16 skill_id )           { skill_get (skill_db[skill_id].nocast, skill_id, 1); }
  3517.  int    skill_get_type( uint16 skill_id )              { skill_get (skill_db[skill_id].skill_type, skill_id, 1); }
  3518.  int    skill_get_unit_id ( uint16 skill_id, int flag ){ skill_get (skill_db[skill_id].unit_id[flag], skill_id, 1); }
  3519.  int    skill_get_unit_interval( uint16 skill_id )     { skill_get (skill_db[skill_id].unit_interval, skill_id, 1); }
  3520. @@ -540,15 +539,6 @@
  3521.      **/
  3522.     if( sd->skillitem == skill_id )
  3523.         return 0;
  3524. -   // Check skill restrictions [Celest]
  3525. -   if( (!map_flag_vs(m) && skill_get_nocast (skill_id) & 1) ||
  3526. -       (map[m].flag.pvp && skill_get_nocast (skill_id) & 2) ||
  3527. -       (map_flag_gvg(m) && skill_get_nocast (skill_id) & 4) ||
  3528. -       (map[m].flag.battleground && skill_get_nocast (skill_id) & 8) ||
  3529. -       (map[m].flag.restricted && map[m].zone && skill_get_nocast (skill_id) & (8*map[m].zone)) ){
  3530. -           clif_msg(sd, 0x536); // This skill cannot be used within this area
  3531. -           return 1;
  3532. -   }
  3533.  
  3534.     if( sd->sc.option&OPTION_MOUNTING )
  3535.         return 1;//You can't use skills while in the new mounts (The client doesn't let you, this is to make cheat-safe)
  3536. @@ -2120,15 +2110,14 @@
  3537.   - if 'flag&0x1', position update packets must not be sent.
  3538.   - if 'flag&0x2', skill blown ignores players' special_state.no_knockback
  3539.   -------------------------------------------------------------------------*/
  3540. -int skill_blown(struct block_list* src, struct block_list* target, int count, int8 dir, int flag)
  3541. -{
  3542. +int skill_blown(struct block_list* src, struct block_list* target, int count, int8 dir, int flag) {
  3543.     int dx = 0, dy = 0;
  3544.     struct skill_unit* su = NULL;
  3545.  
  3546.     nullpo_ret(src);
  3547.  
  3548. -   if (src != target && (map_flag_gvg(target->m) || map[target->m].flag.battleground))
  3549. -       return 0; //No knocking back in WoE
  3550. +   if (src != target && map[src->m].flag.noknockback)
  3551. +       return 0; //No knocking
  3552.     if (count == 0)
  3553.         return 0; //Actual knockback distance is 0.
  3554.  
  3555. @@ -2171,8 +2160,7 @@
  3556.  
  3557.  //Checks if 'bl' should reflect back a spell cast by 'src'.
  3558.  //type is the type of magic attack: 0: indirect (aoe), 1: direct (targetted)
  3559. -static int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type)
  3560. -{
  3561. +int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type) {
  3562.     struct status_change *sc = status_get_sc(bl);
  3563.     struct map_session_data* sd = BL_CAST(BL_PC, bl);
  3564.  
  3565. @@ -5367,7 +5355,7 @@
  3566.             }
  3567.         }
  3568.         else
  3569. -           clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
  3570. +           clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
  3571.         break;
  3572.  
  3573.     case AL_INCAGI:
  3574. @@ -6009,7 +5997,7 @@
  3575.             if(pc_steal_item(sd,bl,skill_lv))
  3576.                 clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
  3577.             else
  3578. -               clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
  3579. +               clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
  3580.         }
  3581.         break;
  3582.  
  3583. @@ -9986,7 +9974,7 @@
  3584.         else { // Create Basilica. Start SC on caster. Unit timer start SC on others.
  3585.             if( map_foreachinrange(skill_count_wos, src, 2, BL_MOB|BL_PC, src) ) {
  3586.                 if( sd )
  3587. -                   clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
  3588. +                   clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
  3589.                 return 1;
  3590.             }
  3591.             skill_clear_unitgroup(src);
  3592. @@ -10372,7 +10360,7 @@
  3593.             map_foreachinarea(skill_area_sub,src->m,x-i,y-i,x+i,y+i,splash_target(src),
  3594.                 src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
  3595.         } else if( sd )
  3596. -           clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
  3597. +           clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
  3598.         break;
  3599.  
  3600.     case WM_DOMINION_IMPULSE:
  3601. @@ -10758,6 +10746,14 @@
  3602.     unit_flag = skill_get_unit_flag(skill_id);
  3603.     layout = skill_get_unit_layout(skill_id,skill_lv,src,x,y);
  3604.  
  3605. +   if( map[src->m].unit_count ) {
  3606. +       ARR_FIND(0, map[src->m].unit_count, i, map[src->m].units[i]->skill_id == skill_id );
  3607. +
  3608. +       if( i < map[src->m].unit_count ) {
  3609. +           limit = limit * map[src->m].units[i]->modifier / 100;
  3610. +       }
  3611. +   }
  3612. +
  3613.     sd = BL_CAST(BL_PC, src);
  3614.     status = status_get_status_data(src);
  3615.     sc = status_get_sc(src);    // for traps, firewall and fogwall - celest
  3616. @@ -13148,7 +13144,7 @@
  3617.             if( sc && sc->data[SC_INSPIRATION]  )
  3618.                 return 1;   // Don't check for partner.
  3619.             if( !(sc && sc->data[SC_BANDING]) ) {
  3620. -               clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
  3621. +               clif_skill_fail(sd,skill_id,USAGE_FAIL,0);
  3622.                 return 0;
  3623.             } else if( skill_check_pc_partner(sd,skill_id,&skill_lv,skill_get_range(skill_id,skill_lv),0) < 1 )
  3624.                 return 0; // Just fails, no msg here.
  3625. @@ -15130,23 +15126,16 @@
  3626.             wall = false;
  3627.     }
  3628.  
  3629. -   if( sce )
  3630. -   {
  3631. -       if( !wall )
  3632. -       {
  3633. +   if( sce ) {
  3634. +       if( !wall ) {
  3635.             if( sce->val1 < 3 ) //End cloaking.
  3636.                 status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
  3637. -           else
  3638. -           if( sce->val4&1 )
  3639. -           {   //Remove wall bonus
  3640. +           else if( sce->val4&1 ) { //Remove wall bonus
  3641.                 sce->val4&=~1;
  3642.                 status_calc_bl(bl,SCB_SPEED);
  3643.             }
  3644. -       }
  3645. -       else
  3646. -       {
  3647. -           if( !(sce->val4&1) )
  3648. -           {   //Add wall speed bonus
  3649. +       } else {
  3650. +           if( !(sce->val4&1) ) { //Add wall speed bonus
  3651.                 sce->val4|=1;
  3652.                 status_calc_bl(bl,SCB_SPEED);
  3653.             }
  3654. @@ -15161,23 +15150,18 @@
  3655.     static int dy[] = {-1, 0, 1,  0, -1, -1, 1,  1};
  3656.     bool wall = true;
  3657.  
  3658. -   if( bl->type == BL_PC )
  3659. -   {   //Check for walls.
  3660. +   if( bl->type == BL_PC ) { //Check for walls.
  3661.         int i;
  3662.         ARR_FIND( 0, 8, i, map_getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
  3663.         if( i == 8 )
  3664.             wall = false;
  3665.     }
  3666.  
  3667. -   if( sce )
  3668. -   {
  3669. -       if( !wall )
  3670. -       {
  3671. +   if( sce ) {
  3672. +       if( !wall ) {
  3673.             if( sce->val1 < 3 ) //End camouflage.
  3674.                 status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
  3675. -           else
  3676. -           if( sce->val3&1 )
  3677. -           {   //Remove wall bonus
  3678. +           else if( sce->val3&1 ) { //Remove wall bonus
  3679.                 sce->val3&=~1;
  3680.                 status_calc_bl(bl,SCB_SPEED);
  3681.             }
  3682. @@ -15246,8 +15230,7 @@
  3683.  /*==========================================
  3684.   *
  3685.   *------------------------------------------*/
  3686. -int skill_delunit (struct skill_unit* unit)
  3687. -{
  3688. +int skill_delunit (struct skill_unit* unit) {
  3689.     struct skill_unit_group *group;
  3690.  
  3691.     nullpo_ret(unit);
  3692. @@ -15361,8 +15344,7 @@
  3693.  
  3694.     // find a free spot to store the new unit group
  3695.     ARR_FIND( 0, MAX_SKILLUNITGROUP, i, ud->skillunit[i] == NULL );
  3696. -   if(i == MAX_SKILLUNITGROUP)
  3697. -   {
  3698. +   if(i == MAX_SKILLUNITGROUP) {
  3699.         // array is full, make room by discarding oldest group
  3700.         int j=0;
  3701.         unsigned maxdiff=0,x,tick=gettick();
  3702. @@ -15517,8 +15499,7 @@
  3703.             skill_delunit(&group->unit[i]);
  3704.  
  3705.     // clear Talkie-box string
  3706. -   if( group->valstr != NULL )
  3707. -   {
  3708. +   if( group->valstr != NULL ) {
  3709.         aFree(group->valstr);
  3710.         group->valstr = NULL;
  3711.     }
  3712. @@ -15532,13 +15513,11 @@
  3713.     // locate this group, swap with the last entry and delete it
  3714.     ARR_FIND( 0, MAX_SKILLUNITGROUP, i, ud->skillunit[i] == group );
  3715.     ARR_FIND( i, MAX_SKILLUNITGROUP, j, ud->skillunit[j] == NULL ); j--;
  3716. -   if( i < MAX_SKILLUNITGROUP )
  3717. -   {
  3718. +   if( i < MAX_SKILLUNITGROUP ) {
  3719.         ud->skillunit[i] = ud->skillunit[j];
  3720.         ud->skillunit[j] = NULL;
  3721.         ers_free(skill_unit_ers, group);
  3722. -   }
  3723. -   else
  3724. +   } else
  3725.         ShowError("skill_delunitgroup: Group not found! (src_id: %d skill_id: %d)\n", group->src_id, group->skill_id);
  3726.  
  3727.     return 1;
  3728. @@ -15562,8 +15541,7 @@
  3729.  /*==========================================
  3730.   *
  3731.   *------------------------------------------*/
  3732. -struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick)
  3733. -{
  3734. +struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick) {
  3735.     int i,j=-1,k,s,id;
  3736.     struct unit_data *ud;
  3737.     struct skill_unit_group_tickset *set;
  3738. @@ -15603,8 +15581,7 @@
  3739.  /*==========================================
  3740.   *
  3741.   *------------------------------------------*/
  3742. -int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap)
  3743. -{
  3744. +int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap) {
  3745.     struct skill_unit* unit = va_arg(ap,struct skill_unit *);
  3746.     struct skill_unit_group* group = unit->group;
  3747.     unsigned int tick = va_arg(ap,unsigned int);
  3748. @@ -15768,11 +15745,8 @@
  3749.             default:
  3750.                 skill_delunit(unit);
  3751.         }
  3752. -   }
  3753. -   else
  3754. -   {// skill unit is still active
  3755. -       switch( group->unit_id )
  3756. -       {
  3757. +   } else {// skill unit is still active
  3758. +       switch( group->unit_id ) {
  3759.             case UNT_ICEWALL:
  3760.                 // icewall loses 50 hp every second
  3761.                 unit->val1 -= SKILLUNITTIMER_INTERVAL/20; // trap's hp
  3762. @@ -15832,12 +15806,10 @@
  3763.  
  3764.         if(unit->range == -1) //Unit disabled, but it should not be deleted yet.
  3765.             group->unit_id = UNT_USED_TRAPS;
  3766. -
  3767. -       if( group->unit_id == UNT_TATAMIGAESHI )
  3768. -       {
  3769. +       else if( group->unit_id == UNT_TATAMIGAESHI ) {
  3770.             unit->range = -1; //Disable processed cell.
  3771. -           if (--group->val1 <= 0) // number of live cells
  3772. -           {   //All tiles were processed, disable skill.
  3773. +           if (--group->val1 <= 0) { // number of live cells
  3774. +               //All tiles were processed, disable skill.
  3775.                 group->target_flag=BCT_NOONE;
  3776.                 group->bl_flag= BL_NUL;
  3777.             }
  3778. @@ -15851,8 +15823,7 @@
  3779.  /*==========================================
  3780.   * Executes on all skill units every SKILLUNITTIMER_INTERVAL miliseconds.
  3781.   *------------------------------------------*/
  3782. -int skill_unit_timer(int tid, unsigned int tick, int id, intptr_t data)
  3783. -{
  3784. +int skill_unit_timer(int tid, unsigned int tick, int id, intptr_t data) {
  3785.     map_freeblock_lock();
  3786.  
  3787.     skillunit_db->foreach(skillunit_db, skill_unit_timer_sub, tick);
  3788. @@ -15902,23 +15873,16 @@
  3789.     }
  3790.  
  3791.     //Target-type check.
  3792. -   if( !(group->bl_flag&target->type && battle_check_target(&unit->bl,target,group->target_flag) > 0) )
  3793. -   {
  3794. -       if( group->src_id == target->id && group->state.song_dance&0x2 )
  3795. -       {   //Ensemble check to see if they went out/in of the area [Skotlex]
  3796. -           if( flag&1 )
  3797. -           {
  3798. -               if( flag&2 )
  3799. -               {   //Clear this skill id.
  3800. +   if( !(group->bl_flag&target->type && battle_check_target(&unit->bl,target,group->target_flag) > 0) ) {
  3801. +       if( group->src_id == target->id && group->state.song_dance&0x2 ) { //Ensemble check to see if they went out/in of the area [Skotlex]
  3802. +           if( flag&1 ) {
  3803. +               if( flag&2 ) { //Clear this skill id.
  3804.                     ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == skill_id );
  3805.                     if( i < ARRAYLENGTH(skill_unit_temp) )
  3806.                         skill_unit_temp[i] = 0;
  3807.                 }
  3808. -           }
  3809. -           else
  3810. -           {
  3811. -               if( flag&2 )
  3812. -               {   //Store this skill id.
  3813. +           } else {
  3814. +               if( flag&2 ) { //Store this skill id.
  3815.                     ARR_FIND( 0, ARRAYLENGTH(skill_unit_temp), i, skill_unit_temp[i] == 0 );
  3816.                     if( i < ARRAYLENGTH(skill_unit_temp) )
  3817.                         skill_unit_temp[i] = skill_id;
  3818. @@ -15995,8 +15959,7 @@
  3819.  
  3820.     map_foreachincell(skill_unit_move_sub,bl->m,bl->x,bl->y,BL_SKILL,bl,tick,flag);
  3821.  
  3822. -   if( flag&2 && flag&1 )
  3823. -   {   //Onplace, check any skill units you have left.
  3824. +   if( flag&2 && flag&1 ) { //Onplace, check any skill units you have left.
  3825.         int i;
  3826.         for( i = 0; i < ARRAYLENGTH(skill_unit_temp); i++ )
  3827.             if( skill_unit_temp[i] )
  3828. @@ -16825,14 +16788,10 @@
  3829.     if (skill_get_nk(skill_id)&NK_NO_DAMAGE || !(skill_get_type(skill_id)&BF_MAGIC))
  3830.         return;
  3831.  
  3832. -   if (sc && sc->count && sc->data[SC_MAGICPOWER])
  3833. -   {
  3834. -       if (sc->data[SC_MAGICPOWER]->val4)
  3835. -       {
  3836. +   if (sc && sc->count && sc->data[SC_MAGICPOWER]) {
  3837. +       if (sc->data[SC_MAGICPOWER]->val4) {
  3838.             status_change_end(bl, SC_MAGICPOWER, INVALID_TIMER);
  3839. -       }
  3840. -       else
  3841. -       {
  3842. +       } else {
  3843.             sc->data[SC_MAGICPOWER]->val4 = 1;
  3844.             status_calc_bl(bl, status_sc2scb_flag(SC_MAGICPOWER));
  3845.  #ifndef RENEWAL
  3846. @@ -17166,10 +17125,8 @@
  3847.     if( battle_config.display_status_timers )
  3848.         clif_skill_cooldown(sd, idx, tick);
  3849.  
  3850. -   if( !load )
  3851. -   {// not being loaded initially so ensure the skill delay is recorded
  3852. -       if( !(cd = idb_get(skillcd_db,sd->status.char_id)) )
  3853. -       {// create a new skill cooldown object for map storage
  3854. +   if( !load ) {// not being loaded initially so ensure the skill delay is recorded
  3855. +       if( !(cd = idb_get(skillcd_db,sd->status.char_id)) ) {// create a new skill cooldown object for map storage
  3856.             CREATE( cd, struct skill_cd, 1 );
  3857.             idb_put( skillcd_db, sd->status.char_id, cd );
  3858.         }
  3859. @@ -17271,12 +17228,10 @@
  3860.  /*
  3861.   *
  3862.   */
  3863. -int skill_split_str (char *str, char **val, int num)
  3864. -{
  3865. +int skill_split_str (char *str, char **val, int num) {
  3866.     int i;
  3867.  
  3868. -   for( i = 0; i < num && str; i++ )
  3869. -   {
  3870. +   for( i = 0; i < num && str; i++ ) {
  3871.         val[i] = str;
  3872.         str = strchr(str,',');
  3873.         if( str )
  3874. @@ -17288,8 +17243,7 @@
  3875.  /*
  3876.   *
  3877.   */
  3878. -int skill_split_atoi (char *str, int *val)
  3879. -{
  3880. +int skill_split_atoi (char *str, int *val) {
  3881.     int i, j, diff, step = 1;
  3882.  
  3883.     for (i=0; i<MAX_SKILL_LEVEL; i++) {
  3884. @@ -17301,15 +17255,13 @@
  3885.     }
  3886.     if(i==0) //No data found.
  3887.         return 0;
  3888. -   if(i==1)
  3889. -   {   //Single value, have the whole range have the same value.
  3890. +   if(i==1) {  //Single value, have the whole range have the same value.
  3891.         for (; i < MAX_SKILL_LEVEL; i++)
  3892.             val[i] = val[i-1];
  3893.         return i;
  3894.     }
  3895.     //Check for linear change with increasing steps until we reach half of the data acquired.
  3896. -   for (step = 1; step <= i/2; step++)
  3897. -   {
  3898. +   for (step = 1; step <= i/2; step++) {
  3899.         diff = val[i-1] - val[i-step-1];
  3900.         for(j = i-1; j >= step; j--)
  3901.             if ((val[j]-val[j-step]) != diff)
  3902. @@ -17318,8 +17270,7 @@
  3903.         if (j>=step) //No match, try next step.
  3904.             continue;
  3905.  
  3906. -       for(; i < MAX_SKILL_LEVEL; i++)
  3907. -       {   //Apply linear increase
  3908. +       for(; i < MAX_SKILL_LEVEL; i++) { //Apply linear increase
  3909.             val[i] = val[i-step]+diff;
  3910.             if (val[i] < 1 && val[i-1] >=0) //Check if we have switched from + to -, cap the decrease to 0 in said cases.
  3911.             { val[i] = 1; diff = 0; step = 1; }
  3912. @@ -17335,8 +17286,7 @@
  3913.  /*
  3914.   *
  3915.   */
  3916. -void skill_init_unit_layout (void)
  3917. -{
  3918. +void skill_init_unit_layout (void) {
  3919.     int i,j,size,pos = 0;
  3920.  
  3921.     memset(skill_unit_layout,0,sizeof(skill_unit_layout));
  3922. @@ -17624,8 +17574,7 @@
  3923.             inf = skill_get_inf2(skill_id);
  3924.             if( inf == INF2_SONG_DANCE || /*skill_get_inf2(skill_id) == INF2_CHORUS_SKILL ||*/ inf == INF2_SPIRIT_SKILL )
  3925.                 return 1; // Can't do it.
  3926. -           switch( skill_id )
  3927. -           {
  3928. +           switch( skill_id ) {
  3929.                 case NV_FIRSTAID:       case TF_HIDING:         case AS_CLOAKING:       case WZ_SIGHTRASHER:
  3930.                 case RG_STRIPWEAPON:        case RG_STRIPSHIELD:        case RG_STRIPARMOR:     case WZ_METEOR:
  3931.                 case RG_STRIPHELM:      case SC_STRIPACCESSARY:     case ST_FULLSTRIP:      case WZ_SIGHTBLASTER:
  3932. @@ -17699,14 +17648,12 @@
  3933.     // always check to make sure the session properly exists
  3934.     nullpo_retv(sd);
  3935.  
  3936. -   if( !(cd = idb_get(skillcd_db, sd->status.char_id)) )
  3937. -   {// no skill cooldown is associated with this character
  3938. +   if( !(cd = idb_get(skillcd_db, sd->status.char_id)) ) {// no skill cooldown is associated with this character
  3939.         return;
  3940.     }
  3941.  
  3942.     // process each individual cooldown associated with the character
  3943. -   for( i = 0; i < cd->cursor; i++ )
  3944. -   {
  3945. +   for( i = 0; i < cd->cursor; i++ ) {
  3946.         // block the skill from usage but ensure it is not recorded (load = true)
  3947.         skill_blockpc_start_( sd, cd->nameid[i], cd->duration[i], true );
  3948.     }
  3949. @@ -17784,15 +17731,12 @@
  3950.  
  3951.      //Wich weapon type are required, see doc/item_db for types
  3952.     p = split[7];
  3953. -   for( j = 0; j < 32; j++ )
  3954. -   {
  3955. +   for( j = 0; j < 32; j++ ) {
  3956.         int l = atoi(p);
  3957. -       if( l == 99 ) // Any weapon
  3958. -       {
  3959. +       if( l == 99 ) { // Any weapon
  3960.             skill_db[idx].weapon = 0;
  3961.             break;
  3962. -       }
  3963. -       else
  3964. +       } else
  3965.             skill_db[idx].weapon |= 1<<l;
  3966.         p = strchr(p,':');
  3967.         if(!p)
  3968. @@ -17802,15 +17746,12 @@
  3969.  
  3970.     //FIXME: document this
  3971.     p = split[8];
  3972. -   for( j = 0; j < 32; j++ )
  3973. -   {
  3974. +   for( j = 0; j < 32; j++ ) {
  3975.         int l = atoi(p);
  3976. -       if( l == 99 ) // Any ammo type
  3977. -       {
  3978. +       if( l == 99 ) { // Any ammo type
  3979.             skill_db[idx].ammo = 0xFFFFFFFF;
  3980.             break;
  3981. -       }
  3982. -       else if( l ) // 0 stands for no requirement
  3983. +       } else if( l ) // 0 stands for no requirement
  3984.             skill_db[idx].ammo |= 1<<l;
  3985.         p = strchr(p,':');
  3986.         if( !p )
  3987. @@ -17887,25 +17828,13 @@
  3988.     return true;
  3989.  }
  3990.  
  3991. -static bool skill_parse_row_nocastdb(char* split[], int columns, int current)
  3992. -{// skill_id,Flag
  3993. +bool skill_parse_row_unitdb(char* split[], int columns, int current) {
  3994. +// ID,unit ID,unit ID 2,layout,range,interval,target,flag
  3995.     uint16 skill_id = atoi(split[0]);
  3996.     uint16 idx = skill_get_index(skill_id);
  3997.     if( !idx ) // invalid skill id
  3998.         return false;
  3999.  
  4000. -   skill_db[idx].nocast |= atoi(split[1]);
  4001. -
  4002. -   return true;
  4003. -}
  4004. -
  4005. -static bool skill_parse_row_unitdb(char* split[], int columns, int current)
  4006. -{// ID,unit ID,unit ID 2,layout,range,interval,target,flag
  4007. -   uint16 skill_id = atoi(split[0]);
  4008. -   uint16 idx = skill_get_index(skill_id);
  4009. -   if( !idx ) // invalid skill id
  4010. -       return false;
  4011. -
  4012.     skill_db[idx].unit_id[0] = strtol(split[1],NULL,16);
  4013.     skill_db[idx].unit_id[1] = strtol(split[2],NULL,16);
  4014.     skill_split_atoi(split[3],skill_db[idx].unit_layout_type);
  4015. @@ -17953,8 +17882,7 @@
  4016.     skill_produce_db[current].req_skill = atoi(split[2]);
  4017.     skill_produce_db[current].req_skill_lv = atoi(split[3]);
  4018.  
  4019. -   for( x = 4, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_PRODUCE_RESOURCE; x += 2, y++ )
  4020. -   {
  4021. +   for( x = 4, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_PRODUCE_RESOURCE; x += 2, y++ ) {
  4022.         skill_produce_db[current].mat_id[y] = atoi(split[x]);
  4023.         skill_produce_db[current].mat_amount[y] = atoi(split[x+1]);
  4024.     }
  4025. @@ -17972,8 +17900,7 @@
  4026.  
  4027.     skill_arrow_db[current].nameid = i;
  4028.  
  4029. -   for( x = 1, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_ARROW_RESOURCE; x += 2, y++ )
  4030. -   {
  4031. +   for( x = 1, y = 0; x+1 < columns && split[x] && split[x+1] && y < MAX_ARROW_RESOURCE; x += 2, y++ ) {
  4032.         skill_arrow_db[current].cre_id[y] = atoi(split[x]);
  4033.         skill_arrow_db[current].cre_amount[y] = atoi(split[x+1]);
  4034.     }
  4035. @@ -17993,8 +17920,7 @@
  4036.         ShowError("spellbook_db: Passive skills cannot be memorized (%d/%s)\n", skill_id, skill_get_name(skill_id));
  4037.     if( points < 1 )
  4038.         ShowError("spellbook_db: PreservePoints have to be 1 or above! (%d/%s)\n", skill_id, skill_get_name(skill_id));
  4039. -   else
  4040. -   {
  4041. +   else {
  4042.         skill_spellbook_db[current].skill_id = skill_id;
  4043.         skill_spellbook_db[current].point = points;
  4044.         skill_spellbook_db[current].nameid = nameid;
  4045. @@ -18154,8 +18080,6 @@
  4046.     sv_readdb(db_path, DBPATH"skill_castnodex_db.txt", ',',   2,  3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
  4047.     sv_readdb(db_path, DBPATH"skill_unit_db.txt"     , ',',   8,  8, MAX_SKILL_DB, skill_parse_row_unitdb);
  4048.  
  4049. -   sv_readdb(db_path, DBPATH"skill_nocast_db.txt"   , ',',   2,  2, MAX_SKILL_DB, skill_parse_row_nocastdb);
  4050. -
  4051.     skill_init_unit_layout();
  4052.     sv_readdb(db_path, "produce_db.txt"        , ',',   4,  4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb);
  4053.     sv_readdb(db_path, "create_arrow_db.txt"   , ',', 1+2,  1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb);
  4054. Index: src/map/skill.h
  4055. --- src/map/skill.h Base (BASE)
  4056. +++ src/map/skill.h Locally Modified (Based On LOCAL)
  4057. @@ -26,8 +26,7 @@
  4058.  DBMap* skilldb_name2id;
  4059.  
  4060.  //Constants to identify the skill's inf value:
  4061. -enum e_skill_inf
  4062. -{
  4063. +enum e_skill_inf {
  4064.     INF_ATTACK_SKILL  = 0x01,
  4065.     INF_GROUND_SKILL  = 0x02,
  4066.     INF_SELF_SKILL    = 0x04, // Skills casted on self where target is automatically chosen
  4067. @@ -39,8 +38,7 @@
  4068.  //Constants to identify a skill's nk value (damage properties)
  4069.  //The NK value applies only to non INF_GROUND_SKILL skills
  4070.  //when determining skill castend function to invoke.
  4071. -enum e_skill_nk
  4072. -{
  4073. +enum e_skill_nk {
  4074.     NK_NO_DAMAGE      = 0x01,
  4075.     NK_SPLASH         = 0x02|0x04, // 0x4 = splash & split
  4076.     NK_SPLASHSPLIT    = 0x04,
  4077. @@ -53,8 +51,7 @@
  4078.  
  4079.  //A skill with 3 would be no damage + splash: area of effect.
  4080.  //Constants to identify a skill's inf2 value.
  4081. -enum e_skill_inf2
  4082. -{
  4083. +enum e_skill_inf2 {
  4084.     INF2_QUEST_SKILL    = 0x0001,
  4085.     INF2_NPC_SKILL      = 0x0002, //NPC skills are those that players can't have in their skill tree.
  4086.     INF2_WEDDING_SKILL  = 0x0004,
  4087. @@ -70,14 +67,14 @@
  4088.     INF2_NO_ENEMY       = 0x1000,
  4089.     INF2_NOLP           = 0x2000, // Spells that can ignore Land Protector
  4090.     INF2_CHORUS_SKILL   = 0x4000, // Chorus skill
  4091. +   INF2_CLONE_NOCOPY   = 0x8000, // Clones will not copy this skill
  4092.  };
  4093.  
  4094.  //Walk intervals at which chase-skills are attempted to be triggered.
  4095.  #define WALK_SKILL_INTERVAL 5
  4096.  
  4097.  // Flags passed to skill_attack/skill_area_sub
  4098. -enum e_skill_display
  4099. -{
  4100. +enum e_skill_display {
  4101.     SD_LEVEL     = 0x1000, // skill_attack will send -1 instead of skill level (affects display of some skills)
  4102.     SD_ANIMATION = 0x2000, // skill_attack will use '5' instead of the skill's 'type' (this makes skills show an animation)
  4103.     SD_SPLASH    = 0x4000, // skill_area_sub will count targets in skill_area_temp[2]
  4104. Index: src/map/status.c
  4105. --- src/map/status.c Base (BASE)
  4106. +++ src/map/status.c Locally Modified (Based On LOCAL)
  4107. @@ -1559,6 +1559,17 @@
  4108.             return 0;
  4109.     }
  4110.  
  4111. +   if( skill_id ) {
  4112. +       int i;
  4113. +
  4114. +       for(i = 0; i < map[src->m].zone->disabled_skills_count; i++) {
  4115. +           if( skill_id == map[src->m].zone->disabled_skills[i]->nameid && (map[src->m].zone->disabled_skills[i]->type&src->type) ) {
  4116. +               if( src->type == BL_PC )
  4117. +                   clif_msg((TBL_PC*)src, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
  4118. +               return 0;
  4119. +           }
  4120. +       }
  4121. +
  4122.     switch( skill_id ) {
  4123.         case PA_PRESSURE:
  4124.             if( flag && target ) {
  4125. @@ -1582,6 +1593,7 @@
  4126.         default:
  4127.             break;
  4128.     }
  4129. +   }
  4130.  
  4131.     if ( src ) sc = status_get_sc(src);
  4132.  
  4133. @@ -2295,7 +2307,7 @@
  4134.     const struct status_change *sc = &sd->sc;
  4135.     struct s_skill b_skill[MAX_SKILL]; // previous skill tree
  4136.     int b_weight, b_max_weight, b_cart_weight_max, // previous weight
  4137. -   i, index, skill,refinedef=0;
  4138. +   i, k, index, skill,refinedef=0;
  4139.     int64 i64;
  4140.  
  4141.     if (++calculating > 10) //Too many recursive calls!
  4142. @@ -2459,19 +2471,15 @@
  4143.         if(!sd->inventory_data[index])
  4144.             continue;
  4145.  
  4146. -       if(sd->inventory_data[index]->flag.no_equip) { // Items may be equipped, their effects however are nullified.
  4147. -           if(map[sd->bl.m].flag.restricted && sd->inventory_data[index]->flag.no_equip&(8*map[sd->bl.m].zone))
  4148. -               continue;
  4149. -           if(!map_flag_vs(sd->bl.m) && sd->inventory_data[index]->flag.no_equip&1)
  4150. -               continue;
  4151. -           if(map[sd->bl.m].flag.pvp && sd->inventory_data[index]->flag.no_equip&2)
  4152. -               continue;
  4153. -           if(map_flag_gvg(sd->bl.m) && sd->inventory_data[index]->flag.no_equip&4)
  4154. -               continue;
  4155. -           if(map[sd->bl.m].flag.battleground && sd->inventory_data[index]->flag.no_equip&8)
  4156. -               continue;
  4157. +       for(k = 0; k < map[sd->bl.m].zone->disabled_items_count; k++) {
  4158. +           if( map[sd->bl.m].zone->disabled_items[k] == sd->inventory_data[index]->nameid ) {
  4159. +               break;
  4160.         }
  4161. +       }
  4162.  
  4163. +       if( k < map[sd->bl.m].zone->disabled_items_count )
  4164. +           continue;
  4165. +
  4166.         status->def += sd->inventory_data[index]->def;
  4167.  
  4168.         if(first && sd->inventory_data[index]->equip_script)
  4169. @@ -2606,28 +2614,24 @@
  4170.                 data = itemdb_exists(c);
  4171.                 if(!data)
  4172.                     continue;
  4173. -               if(first && data->equip_script)
  4174. -               {   //Execute equip-script on login
  4175. +               if(first && data->equip_script) {//Execute equip-script on login
  4176.                     run_script(data->equip_script,0,sd->bl.id,0);
  4177.                     if (!calculating)
  4178.                         return 1;
  4179.                 }
  4180.                 if(!data->script)
  4181.                     continue;
  4182. -               if(data->flag.no_equip) { //Card restriction checks.
  4183. -                   if(map[sd->bl.m].flag.restricted && data->flag.no_equip&(8*map[sd->bl.m].zone))
  4184. -                       continue;
  4185. -                   if(!map_flag_vs(sd->bl.m) && data->flag.no_equip&1)
  4186. -                       continue;
  4187. -                   if(map[sd->bl.m].flag.pvp && data->flag.no_equip&2)
  4188. -                       continue;
  4189. -                   if(map_flag_gvg(sd->bl.m) && data->flag.no_equip&4)
  4190. -                       continue;
  4191. -                   if(map[sd->bl.m].flag.battleground && data->flag.no_equip&8)
  4192. -                       continue;
  4193. +
  4194. +               for(k = 0; k < map[sd->bl.m].zone->disabled_items_count; k++) {
  4195. +                   if( map[sd->bl.m].zone->disabled_items[k] == sd->inventory_data[index]->nameid ) {
  4196. +                       break;
  4197.                 }
  4198. -               if(i == EQI_HAND_L && sd->status.inventory[index].equip == EQP_HAND_L)
  4199. -               {   //Left hand status.
  4200. +               }
  4201. +
  4202. +               if( k < map[sd->bl.m].zone->disabled_items_count )
  4203. +                   continue;
  4204. +
  4205. +               if(i == EQI_HAND_L && sd->status.inventory[index].equip == EQP_HAND_L) { //Left hand status.
  4206.                     sd->state.lr_flag = 1;
  4207.                     run_script(data->script,0,sd->bl.id,0);
  4208.                     sd->state.lr_flag = 0;
  4209. @@ -9117,8 +9123,7 @@
  4210.   * 2 - Do clif
  4211.   * 3 - Do not remove some permanent/time-independent effects
  4212.   *------------------------------------------*/
  4213. -int status_change_clear(struct block_list* bl, int type)
  4214. -{
  4215. +int status_change_clear(struct block_list* bl, int type) {
  4216.     struct status_change* sc;
  4217.     int i;
  4218.  
  4219. @@ -9127,14 +9132,12 @@
  4220.     if (!sc || !sc->count)
  4221.         return 0;
  4222.  
  4223. -   for(i = 0; i < SC_MAX; i++)
  4224. -   {
  4225. +   for(i = 0; i < SC_MAX; i++) {
  4226.         if(!sc->data[i])
  4227.           continue;
  4228.  
  4229.         if(type == 0)
  4230. -       switch (i)
  4231. -       {   //Type 0: PC killed -> Place here statuses that do not dispel on death.
  4232. +       switch (i) {    //Type 0: PC killed -> Place here statuses that do not dispel on death.
  4233.         case SC_ELEMENTALCHANGE://Only when its Holy or Dark that it doesn't dispell on death
  4234.             if( sc->data[i]->val2 != ELE_HOLY && sc->data[i]->val2 != ELE_DARK )
  4235.                 break;
  4236. @@ -9183,13 +9186,10 @@
  4237.         case SC_L_LIFEPOTION:
  4238.         case SC_PUSH_CART:
  4239.             continue;
  4240. -
  4241.         }
  4242.  
  4243. -       if( type == 3 )
  4244. -       {
  4245. -           switch (i)
  4246. -           {// TODO: This list may be incomplete
  4247. +       if( type == 3 ) {
  4248. +           switch (i) {// TODO: This list may be incomplete
  4249.                 case SC_WEIGHT50:
  4250.                 case SC_WEIGHT90:
  4251.                 case SC_NOCHAT:
  4252. Index: src/map/status.h
  4253. --- src/map/status.h Base (BASE)
  4254. +++ src/map/status.h Locally Modified (Based On LOCAL)
  4255. @@ -634,8 +634,8 @@
  4256.  
  4257.     //homon S
  4258.     SC_STYLE_CHANGE,
  4259. -   SC_TINDER_BREAKER, //@TODO rewritte me plz
  4260. -   SC_TINDER_BREAKER2, //for rewritte and other icone
  4261. +   SC_TINDER_BREAKER,
  4262. +   SC_TINDER_BREAKER2,
  4263.     SC_CBC,
  4264.     SC_EQC,
  4265.     SC_GOLDENE_FERSE,
  4266. Index: src/map/unit.c
  4267. --- src/map/unit.c Base (BASE)
  4268. +++ src/map/unit.c Locally Modified (Based On LOCAL)
  4269. @@ -1354,13 +1355,11 @@
  4270.     }
  4271.  
  4272.  
  4273. -   if( casttime > 0 )
  4274. -   {
  4275. +   if( casttime > 0 ) {
  4276.         ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
  4277.         if( sd && (pc_checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) )
  4278.             status_calc_bl(&sd->bl, SCB_SPEED);
  4279. -   }
  4280. -   else
  4281. +   } else
  4282.         skill_castend_id(ud->skilltimer,tick,src->id,0);
  4283.  
  4284.     return 1;
  4285. @@ -1489,14 +1488,11 @@
  4286.     unit_stop_walking(src,1);
  4287.     // in official this is triggered even if no cast time.
  4288.     clif_skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill_get_ele(skill_id, skill_lv), casttime);
  4289. -   if( casttime > 0 )
  4290. -   {
  4291. +   if( casttime > 0 ) {
  4292.         ud->skilltimer = add_timer( tick+casttime, skill_castend_pos, src->id, 0 );
  4293.         if( (sd && pc_checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK)
  4294.             status_calc_bl(&sd->bl, SCB_SPEED);
  4295. -   }
  4296. -   else
  4297. -   {
  4298. +   } else {
  4299.         ud->skilltimer = INVALID_TIMER;
  4300.         skill_castend_pos(ud->skilltimer,tick,src->id,0);
  4301.     }
  4302. @@ -1888,7 +1884,7 @@
  4303.     struct map_session_data *sd = NULL;
  4304.     struct unit_data *ud = unit_bl2ud( bl);
  4305.     unsigned int tick=gettick();
  4306. -   int ret=0, skill;
  4307. +   int ret=0, skill_id;
  4308.  
  4309.     nullpo_ret(bl);
  4310.     if (!ud || ud->skilltimer == INVALID_TIMER)
  4311. @@ -1909,11 +1905,11 @@
  4312.     ud->canact_tick = tick;
  4313.  
  4314.     if(type&1 && sd)
  4315. -       skill = sd->skill_id_old;
  4316. +       skill_id = sd->skill_id_old;
  4317.     else
  4318. -       skill = ud->skill_id;
  4319. +       skill_id = ud->skill_id;
  4320.  
  4321. -   if (skill_get_inf(skill) & INF_GROUND_SKILL)
  4322. +   if (skill_get_inf(skill_id) & INF_GROUND_SKILL)
  4323.         ret=delete_timer( ud->skilltimer, skill_castend_pos );
  4324.     else
  4325.         ret=delete_timer( ud->skilltimer, skill_castend_id );
  4326. @@ -1925,10 +1921,8 @@
  4327.     if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )
  4328.         status_calc_bl(&sd->bl, SCB_SPEED);
  4329.  
  4330. -   if( sd )
  4331. -   {
  4332. -       switch( skill )
  4333. -       {
  4334. +   if( sd ) {
  4335. +       switch( skill_id ) {
  4336.         case CG_ARROWVULCAN:
  4337.             sd->canequip_tick = tick;
  4338.             break;
  4339. @@ -2075,7 +2069,7 @@
  4340.         case BL_PC: {
  4341.             struct map_session_data *sd = (struct map_session_data*)bl;
  4342.  
  4343. -           if(sd->shadowform_id){
  4344. +           if(sd->shadowform_id){ //if shadow target has leave the map
  4345.                 struct block_list *d_bl = map_id2bl(sd->shadowform_id);
  4346.                 if( d_bl )
  4347.                     status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
  4348. Index: src/map/vending.c
  4349. --- src/map/vending.c Base (BASE)
  4350. +++ src/map/vending.c Locally Modified (Based On LOCAL)
  4351. @@ -12,6 +12,7 @@
  4352.  #include "chrif.h"
  4353.  #include "vending.h"
  4354.  #include "pc.h"
  4355. +#include "npc.h"
  4356.  #include "skill.h"
  4357.  #include "battle.h"
  4358.  #include "log.h"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement