diff options
90 files changed, 2470 insertions, 1438 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..c661cbd47 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,54 @@ +[//]: # (**********************************) +[//]: # (** Fill in the following fields **) +[//]: # (**********************************) + +[//]: # (Note: Lines beginning with syntax such as this one, are comments and will not be visible in your report!) + +### Issue Prelude + +[//]: # (Please complete these mandatory steps and check the following boxes by putting an `x` inside the brackets _before_ filing your issue) + +- [ ] I have not modified the source prior to reproducing this issue. +- [ ] I am using the latest version of Hercules. +- [ ] I am aware that this report will be closed or deleted if it becomes obvious that I am stating the false. + +### Description + +[//]: # (Description of the problem or issue at length.) +[//]: # (Please specify any battle configuration related to the components of this issue that have been changed from the default values. This will allow quicker determination of the cause of the problem.) + +### Current Behavior + +[//]: # (Describe at length what you noticed during your analysis.) +[//]: # (If this is a crash, post the core/stack-dump or crash-log to https://gist.github.com/) +[//]: # (If you are referencing from sources such as iROwiki or ratemyserver.net, please quote specific information rather than providing the links alone.) + +### Expected Behavior + +[//]: # (Tell us what should happen instead.) + +### Steps To Reproduce The Issue + +1. Step 1 +2. Step 2 +3. Step 3 + +**Branch(es):** +- [ ] master +- [ ] other + +**Hercules rev. hash/commit:** + +Git revision src: + +[//]: # (Copy the first 3 lines of the login-server, char-server or map-server startup.) +[//]: # ( [Info]: Hercules 64-bit for Mac OS X ) +[//]: # ( [Info]: Git revision src: 'a5918b329ca0826b04dca32ede783586403f58db' ) +[//]: # ( [Info]: Git revision scripts: 'a5918b329ca0826b04dca32ede783586403f58db' ) + +### Operating System + +[//]: # (Mac OS X 10.12.3 16D32 [x86_64]) +[//]: # (Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.) +[//]: # (This template is for problem reports. For other types of report, edit it accordingly.) +[//]: # (For fixes please create a Pull Request.) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..c62641f08 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,37 @@ +[//]: # (**********************************) +[//]: # (** Fill in the following fields **) +[//]: # (**********************************) + +[//]: # (Note: Lines beginning with syntax such as this one, are comments and will not be visible in your report!) + +### Pull Request Prelude + +[//]: # (Thank you for working on improving Hercules!) + +[//]: # (Please complete these steps and check the following boxes by putting an `x` inside the brackets _before_ filing your Pull Request.) + +- [ ] I have followed [proper Hercules code styling][code]. +- [ ] I have read and understood the [contribution guidelines][cont] before making this PR. +- [ ] I am aware that this PR will be closed if the above-mentioned criteria are not fulfilled. + +### Changes Proposed + +[//]: # (Describe at length, the changes that this pull request makes.) + +**Affected Branches:** + +[//]: # (Master? Slave?) + +**Issues addressed:** + +[//]: # (Issue Tracker Number if any.) + +### Known Issues and TODO List + +[//]: # (Insert checklist here) +[//]: # (Syntax: - [ ] Checkbox) + +[//]: # (**NOTE** Enable the setting "[√] Allow edits from maintainers." when creating your pull request if you have not already enabled it.) + +[cont]: https://github.com/HerculesWS/Hercules/blob/master/CONTRIBUTING.md +[code]: https://github.com/HerculesWS/Hercules/wiki/Coding-Style diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbdc2caae..8a3eb53c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ variables: &base_vars - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok mysql - ./tools/ci/travis.sh getplugins || true services: @@ -37,10 +37,10 @@ pre_re:clang-3.9: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: clang-3.9 mysql-client + INSTALL_PACKAGES: clang-3.9 mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=clang-3.9 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -49,22 +49,46 @@ re:clang-3.9: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: clang-3.9 mysql-client + INSTALL_PACKAGES: clang-3.9 mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=clang-3.9 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql +pre_re:clang-4.0: + <<: *branch_exceptions + <<: *prerequisites + stage: primary + image: debian:unstable + variables: + <<: *base_vars + INSTALL_PACKAGES: clang-4.0 mysql-client libmysqlclient-dev + script: + - ./tools/ci/travis.sh build CC=clang-4.0 --enable-debug --enable-Werror --enable-buildbot --disable-renewal + - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql + +re:clang-4.0: + <<: *branch_exceptions + <<: *prerequisites + stage: primary + image: debian:unstable + variables: + <<: *base_vars + INSTALL_PACKAGES: clang-4.0 mysql-client libmysqlclient-dev + script: + - ./tools/ci/travis.sh build CC=clang-4.0 --enable-debug --enable-Werror --enable-buildbot + - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql + pre_re:gcc-4.6: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:oldstable + image: debian:wheezy variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.6 mysql-client + INSTALL_PACKAGES: gcc-4.6 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.6 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -73,10 +97,10 @@ re:gcc-4.6: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:oldstable + image: debian:wheezy variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.6 mysql-client + INSTALL_PACKAGES: gcc-4.6 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.6 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -85,10 +109,10 @@ pre_re:gcc-4.7: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:oldstable + image: debian:wheezy variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.7 mysql-client + INSTALL_PACKAGES: gcc-4.7 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.7 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -97,10 +121,10 @@ re:gcc-4.7: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:oldstable + image: debian:wheezy variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.7 mysql-client + INSTALL_PACKAGES: gcc-4.7 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.7 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -109,10 +133,10 @@ pre_re:gcc-4.8: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.8 mysql-client + INSTALL_PACKAGES: gcc-4.8 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.8 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -121,10 +145,10 @@ re:gcc-4.8: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.8 mysql-client + INSTALL_PACKAGES: gcc-4.8 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.8 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -133,10 +157,10 @@ pre_re:gcc-4.9: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.9 mysql-client + INSTALL_PACKAGES: gcc-4.9 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.9 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -145,10 +169,10 @@ re:gcc-4.9: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc-4.9 mysql-client + INSTALL_PACKAGES: gcc-4.9 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-4.9 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -156,11 +180,11 @@ re:gcc-4.9: pre_re:gcc-5: <<: *branch_exceptions <<: *prerequisites - stage: primary + stage: secondary image: debian:unstable variables: <<: *base_vars - INSTALL_PACKAGES: gcc-5 mysql-client + INSTALL_PACKAGES: gcc-5 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-5 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -168,11 +192,11 @@ pre_re:gcc-5: re:gcc-5: <<: *branch_exceptions <<: *prerequisites - stage: primary + stage: secondary image: debian:unstable variables: <<: *base_vars - INSTALL_PACKAGES: gcc-5 mysql-client + INSTALL_PACKAGES: gcc-5 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-5 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -181,10 +205,10 @@ pre_re:gcc-6: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -193,10 +217,10 @@ re:gcc-6: <<: *branch_exceptions <<: *prerequisites stage: primary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -208,7 +232,7 @@ pre_re:gcc-6_i386: image: vicamo/debian:sid-i386 variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -220,7 +244,7 @@ re:gcc-6_i386: image: vicamo/debian:sid-i386 variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -229,10 +253,10 @@ pre_re:gcc-6_sanitize: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-renewal --disable-manager --enable-sanitize=full - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -241,10 +265,10 @@ re:gcc-6_sanitize: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-manager --enable-sanitize=full - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -256,7 +280,7 @@ pre_re:gcc-6_i386_sanitize: image: vicamo/debian:sid-i386 variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-renewal --disable-manager --enable-sanitize=full - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -268,7 +292,7 @@ re:gcc-6_i386_sanitize: image: vicamo/debian:sid-i386 variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 mysql-client + INSTALL_PACKAGES: gcc-6 mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-manager --enable-sanitize=full - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -277,10 +301,10 @@ pre_re:gcc-6_cov: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 gcovr mysql-client + INSTALL_PACKAGES: gcc-6 gcovr mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot --disable-renewal CFLAGS="-coverage" LDFLAGS="-coverage" - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -296,10 +320,10 @@ re:gcc-6_cov: <<: *branch_exceptions <<: *prerequisites stage: secondary - image: debian:unstable + image: debian:stretch variables: <<: *base_vars - INSTALL_PACKAGES: gcc-6 gcovr mysql-client + INSTALL_PACKAGES: gcc-6 gcovr mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build CC=gcc-6 --enable-debug --enable-Werror --enable-buildbot CFLAGS="-coverage" LDFLAGS="-coverage" - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -317,10 +341,10 @@ pre_re:debian-oldstable: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:wheezy + image: debian:oldstable variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -329,10 +353,10 @@ re:debian-oldstable: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:wheezy + image: debian:oldstable variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -341,10 +365,10 @@ pre_re:debian-stable: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:jessie + image: debian:stable variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -353,10 +377,10 @@ re:debian-stable: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:jessie + image: debian:stable variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -365,10 +389,10 @@ pre_re:debian-testing: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:stretch + image: debian:testing variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -377,10 +401,10 @@ re:debian-testing: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:stretch + image: debian:testing variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mariadb-client libmariadbclient-dev-compat script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -474,7 +498,7 @@ pre_re:ubuntu-xenial: - mysql:latest variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -488,7 +512,7 @@ re:ubuntu-xenial: - mysql:latest variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql @@ -499,10 +523,10 @@ pre_re:mysql-5.5: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client-5.5 + INSTALL_PACKAGES: gcc mysql-client-5.5 libmysqlclient-dev services: - mysql:5.5 script: @@ -513,10 +537,10 @@ re:mysql-5.5: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client-5.5 + INSTALL_PACKAGES: gcc mysql-client-5.5 libmysqlclient-dev services: - mysql:5.5 script: @@ -527,10 +551,10 @@ pre_re:mysql-5.6: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:unstable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client-5.6 + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev services: - mysql:5.6 script: @@ -541,10 +565,10 @@ re:mysql-5.6: <<: *branch_exceptions <<: *prerequisites stage: platforms - image: debian:unstable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client-5.6 + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev services: - mysql:5.6 script: @@ -558,8 +582,7 @@ pre_re:mysql-5.7: image: debian:unstable variables: <<: *base_vars - # mysql-client-5.7 is not available - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client-5.7 libmysqlclient-dev services: - mysql:5.7 script: @@ -573,26 +596,25 @@ re:mysql-5.7: image: debian:unstable variables: <<: *base_vars - # mysql-client-5.7 is not available - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client-5.7 libmysqlclient-dev services: - mysql:5.7 script: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql -pre_re:mariadb-10: +pre_re:mariadb-10.0: <<: *branch_exceptions stage: platforms - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mariadb-client-10.0 + INSTALL_PACKAGES: gcc mariadb-client-10.0 libmysqlclient-dev before_script: - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok mariadb - ./tools/ci/travis.sh getplugins || true services: @@ -601,18 +623,18 @@ pre_re:mariadb-10: - ./tools/ci/travis.sh build --enable-debug --enable-Werror --enable-buildbot --disable-renewal - ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mariadb -re:mariadb-10: +re:mariadb-10.0: <<: *branch_exceptions stage: platforms - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mariadb-client-10.0 + INSTALL_PACKAGES: gcc mariadb-client-10.0 libmysqlclient-dev before_script: - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok mariadb - ./tools/ci/travis.sh getplugins || true services: @@ -624,15 +646,15 @@ re:mariadb-10: pre_re:mariadb-latest: <<: *branch_exceptions stage: platforms - image: debian:stable + image: debian:unstable variables: <<: *base_vars - INSTALL_PACKAGES: gcc mariadb-client-10.0 + INSTALL_PACKAGES: gcc mariadb-client-10.1 libmariadbclient-dev-compat before_script: - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok mariadb - ./tools/ci/travis.sh getplugins || true services: @@ -644,15 +666,15 @@ pre_re:mariadb-latest: re:mariadb-latest: <<: *branch_exceptions stage: platforms - image: debian:stable + image: debian:unstable variables: <<: *base_vars - INSTALL_PACKAGES: gcc mariadb-client-10.0 + INSTALL_PACKAGES: gcc mariadb-client-10.1 libmariadbclient-dev-compat before_script: - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok mariadb - ./tools/ci/travis.sh getplugins || true services: @@ -664,15 +686,15 @@ re:mariadb-latest: pre_re:percona: <<: *branch_exceptions stage: platforms - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev before_script: - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok percona - ./tools/ci/travis.sh getplugins || true services: @@ -684,15 +706,15 @@ pre_re:percona: re:percona: <<: *branch_exceptions stage: platforms - image: debian:stable + image: debian:jessie variables: <<: *base_vars - INSTALL_PACKAGES: gcc mysql-client + INSTALL_PACKAGES: gcc mysql-client libmysqlclient-dev before_script: - echo "Building $CI_BUILD_NAME" - uname -a - ./tools/ci/retry.sh apt-get update - - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES libmysqlclient-dev + - ./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES - ./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok percona - ./tools/ci/travis.sh getplugins || true services: diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf index 818db3142..c3409b578 100644 --- a/conf/map/battle/client.conf +++ b/conf/map/battle/client.conf @@ -69,6 +69,9 @@ pet_hair_style: 100 // Visible area size (how many squares away from a player can they see) area_size: 14 +// Chat area size (how many squares away from a player can they chat) +chat_area_size: 9 + // Maximum walk path (how many cells a player can walk going to cursor) // default: 17(official) max_walk_path: 17 @@ -107,7 +110,7 @@ save_body_style: false // Do not display cloth colors for the wedding costume? // Note: Both save_clothcolor and wedding_modifydisplay have to be enabled -// for this option to take effect. Set this to true if your cloth palettes +// for this option to take effect. Set this to true if your cloth palettes // pack doesn't has wedding palettes (or has less than the other jobs) wedding_ignorepalette: false @@ -156,3 +159,8 @@ client_accept_chatdori: 0 // A value of 100 (allowing 100% blank pixels) disables this check. // NOTE: Enabling this option slightly degrades performance. client_emblem_max_blank_percent: 100 + +// Show the MVP EXP reward message for clients 2013-12-23cRagexe and newer? (Note 1) +// kRO removed the packet and this re-enables the message. +// Official: false. +mvp_exp_reward_message: false diff --git a/conf/map/logs.conf b/conf/map/logs.conf index aa4e16e95..4f3a8a4db 100644 --- a/conf/map/logs.conf +++ b/conf/map/logs.conf @@ -34,29 +34,38 @@ map_log: { // Enable Logs? (Note 3) - // 0x00000 - Don't log at all - // 0x00001 - (T) Log trades - // 0x00002 - (V) Log vending transactions - // 0x00004 - (P) Log items drop/picked by players - // 0x00008 - (L) Log items drop/looted by monsters - // 0x00010 - (S) Log NPC transactions (buy/sell) - // 0x00020 - (N) Log Script transactions (items deleted/acquired through quests) - // 0x00040 - (D) Log items stolen from mobs (Steal/Gank) - // 0x00080 - (C) Log player-used items (consumables/pet&hom&merc food/items used for skills&attacks) - // 0x00100 - (O) Log produced/ingredient items - // 0x00200 - (U) Log MVP prize items - // 0x00400 - (A) Log player created/deleted items (through @/# commands) - // 0x00800 - (R) Log items placed/retrieved from storage. - // 0x01000 - (G) Log items placed/retrieved from guild storage. - // 0x02000 - (E) Log mail system transactions. - // 0x04000 - (I) Log auction system transactions. - // 0x08000 - (B) Log buying store transactions - // 0x20000 - (K) Log account bank transactions - // 0x10000 - (X) Log all other transactions (rentals expiring/inserting cards/items removed by item_check/ - // rings deleted by divorce/pet egg (un)hatching/pet armor (un)equipping/Weapon Refine skill/Remove Trap skill) + // 0x0000000 - Don't log at all + // 0x0000001 - (T) Log trades + // 0x0000002 - (V) Log vending transactions + // 0x0000004 - (P) Log items drop/picked by players + // 0x0000008 - (L) Log items drop/looted by monsters + // 0x0000010 - (S) Log NPC transactions (buy/sell) + // 0x0000020 - (N) Log Script transactions (items deleted/acquired through quests) + // 0x0000040 - (D) Log items stolen from mobs (Steal/Gank) + // 0x0000080 - (C) Log player-used items (consumables/pet&hom&merc food/items used for skills&attacks) + // 0x0000100 - (O) Log produced/ingredient items + // 0x0000200 - (U) Log MVP prize items + // 0x0000400 - (A) Log player created/deleted items (through @/# commands) + // 0x0000800 - (R) Log items placed/retrieved from storage. + // 0x0001000 - (G) Log items placed/retrieved from guild storage. + // 0x0002000 - (E) Log mail system transactions. + // 0x0004000 - (I) Log auction system transactions. + // 0x0008000 - (B) Log buying store transactions + // 0x0010000 - (X) Log other transactions + // 0x0020000 - (K) Log account bank transactions + // 0x0040000 - (Y) Divorce + // 0x0080000 - (Z) Roulette + // 0x0100000 - (W) Rental + // 0x0200000 - (Q) Card + // 0x0400000 - (J) Invalid in inventory + // 0x0800000 - (H) Invalid in cart + // 0x1000000 - (@) Egg + // 0x2000000 - (0) Quest + // 0x4000000 - (1) Skill + // 0x8000000 - (2) Refine // Example: Log trades+vending+script items+created items: 1+2+32+1024 = 1059 // Please note that moving items from inventory to cart and back is not logged by design. - enable: 0xFFFFF + enable: 0xFFFFFFF // Logging files/tables // Following settings specify where to log to. If 'use_sql' is diff --git a/conf/messages.conf b/conf/messages.conf index a97a755f7..efc8d8a36 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -612,6 +612,9 @@ //670-855 FREE (please start using from the top if you need, leave the 670+ range for new jobs) +// MVP exp message issue clients 2013-12-23cRagexe and newer. +855: Congratulations! You are the MVP! Your reward EXP Points are %u !! + // MvP Tomb 856: Tomb 857: [ ^EE0000%s^000000 ] @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac b947fde. +# From configure.ac b7b45b7c3. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -5153,17 +5153,19 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$enable_lto" != "no" ; then OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -flto" + CFLAGS="$CFLAGS -flto -ffat-lto-objects -Werror" OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -flto" + LDFLAGS="$LDFLAGS -flto -ffat-lto-objects" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto" >&5 -$as_echo_n "checking whether $CC supports -flto... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto -ffat-lto-objects" >&5 +$as_echo_n "checking whether $CC supports -flto -ffat-lto-objects... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: guessing no" >&5 $as_echo "guessing no" >&6; } + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" else @@ -5171,6 +5173,8 @@ else /* end confdefs.h. */ int main(int argc, char **argv){ + (void)argc; + (void)argv; return 0; } @@ -5179,13 +5183,53 @@ if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -flto -ffat-lto-objects" + LDFLAGS="$OLD_LDFLAGS -flto -ffat-lto-objects" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - LDFLAGS="$OLD_LDFLAGS" + CFLAGS="$OLD_CFLAGS -flto" + LDFLAGS="$OLD_LDFLAGS -flto" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto" >&5 +$as_echo_n "checking whether $CC supports -flto... " >&6; } + if test "$cross_compiling" = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: guessing no" >&5 +$as_echo "guessing no" >&6; } + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main(int argc, char **argv){ + (void)argc; + (void)argv; + return 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8346,7 +8390,7 @@ Linux* ) LIBS="$LIBS -ldl" ;; FreeBSD*) - CPPFLAGS="$CPPFLAGS -D__FREEBSD__" + CPPFLAGS="$CPPFLAGS -D__FREEBSD__ -fvisibility=hidden" ;; NetBSD*) CPPFLAGS="$CPPFLAGS -D__NETBSD__" diff --git a/configure.ac b/configure.ac index efe1f802e..6fef4ee4e 100644 --- a/configure.ac +++ b/configure.ac @@ -726,28 +726,57 @@ AC_LINK_IFELSE( if test "$enable_lto" != "no" ; then OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -flto" + CFLAGS="$CFLAGS -flto -ffat-lto-objects -Werror" OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -flto" + LDFLAGS="$LDFLAGS -flto -ffat-lto-objects" - AC_MSG_CHECKING([whether $CC supports -flto]) + AC_MSG_CHECKING([whether $CC supports -flto -ffat-lto-objects]) AC_RUN_IFELSE( [AC_LANG_SOURCE([ int main(int argc, char **argv){ + (void)argc; + (void)argv; return 0; } ])], [ AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -flto -ffat-lto-objects" + LDFLAGS="$OLD_LDFLAGS -flto -ffat-lto-objects" ], [ AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - LDFLAGS="$OLD_LDFLAGS" + CFLAGS="$OLD_CFLAGS -flto" + LDFLAGS="$OLD_LDFLAGS -flto" + AC_MSG_CHECKING([whether $CC supports -flto]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([ + int main(int argc, char **argv){ + (void)argc; + (void)argv; + return 0; + } + ])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + ], + [ + AC_MSG_RESULT([guessing no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + ] + ) ], [ AC_MSG_RESULT([guessing no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" ] ) fi diff --git a/db/constants.conf b/db/constants.conf index 09c0fa9e4..79530e7d1 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3664,14 +3664,14 @@ constants_db: { PC_PARTY: 1 PC_GUILD: 2 PC_MAP: 3 - + comment__: "strnpcinfo" NPC_NAME: 0 NPC_NAME_VISIBLE: 1 NPC_NAME_HIDDEN: 2 NPC_NAME_UNIQUE: 3 NPC_MAP: 4 - + comment__: "getcharid" CHAR_ID_CHAR: 0 CHAR_ID_PARTY: 1 @@ -3709,6 +3709,11 @@ constants_db: { GETTIME_YEAR: 7 GETTIME_DAYOFYEAR: 8 + comment__: "gettimer" + TIMER_COUNT: 0 + TIMER_TICK_NEXT: 1 + TIMER_TICK_LAST: 2 + comment__: "unit types" UNITTYPE_PC: 0 UNITTYPE_NPC: 1 diff --git a/db/pre-re/job_db.conf b/db/pre-re/job_db.conf index 5f5131726..74a765fbf 100644 --- a/db/pre-re/job_db.conf +++ b/db/pre-re/job_db.conf @@ -335,6 +335,7 @@ Priest: { Mace: 600 TwoHandMace: 600 Rod: 600 + // Knuckle: 500 /* Note. Official value is 2000 (default). To normalize aspd remove comment to this line. */ Book: 600 TwoHandRod: 600 } diff --git a/db/pre-re/map_zone_db.conf b/db/pre-re/map_zone_db.conf index cab00bbb9..b8797a6d3 100644 --- a/db/pre-re/map_zone_db.conf +++ b/db/pre-re/map_zone_db.conf @@ -66,7 +66,7 @@ zones: ( //heal: 70 } skill_damage_cap: { - //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage, + //Example Below caps Cold Bolt damage in maps within this zone to a maximum 50 damage, // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h) // when cast vs players and monsters. //MG_COLDBOLT: (50,"PLAYER | MONSTER") @@ -334,6 +334,19 @@ zones: ( SC_FATALMENACE: "PLAYER" SC_DIMENSIONDOOR: "PLAYER" } + + mapflags: ( + "nobranch", + "noicewall", + "nomemo", + "nosave SavePoint", + "noteleport", + "monster_noteleport", + "nowarpto", + "partylock", + "pvp off", + "src4instance", + ) }, { name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */ @@ -347,6 +360,19 @@ zones: ( SC_FATALMENACE: "PLAYER" SC_DIMENSIONDOOR: "PLAYER" } + + mapflags: ( + "nobranch", + "noicewall", + "nomemo", + "nosave SavePoint", + "noteleport", + "monster_noteleport", + "nowarpto", + "partylock", + "pvp off", + "src4instance", + ) }, { name: "Towns" diff --git a/db/pre-re/mob_db.conf b/db/pre-re/mob_db.conf index 82501748d..40635cd68 100644 --- a/db/pre-re/mob_db.conf +++ b/db/pre-re/mob_db.conf @@ -57,8 +57,8 @@ mob_db: ( } ViewRange: view range (int, defaults to 1) ChaseRange: chase range (int, defaults to 1) - Size: size (int, defaults to 1) - Race: race (int, defaults to 0) + Size: size (string, defaults to "Size_Medium") + Race: race (string, defaults to "RC_Formless") Element: (type, level) Mode: { CanMove: true/false (bool, defaults to false) diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf index 95683a9e0..39ae0b313 100644 --- a/db/pre-re/skill_db.conf +++ b/db/pre-re/skill_db.conf @@ -9,7 +9,7 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2014-2016 Hercules Dev Team +//= Copyright (C) 2014-2017 Hercules Dev Team //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -6041,7 +6041,7 @@ skill_db: ( DamageType: { NoDamage: true } - SkillData2: 3000 + SkillData2: 5000 CoolDown: 0 }, { @@ -6177,18 +6177,7 @@ skill_db: ( } SplashRange: 1 SkillData1: 5000 - SkillData2: { - Lv1: 8000 - Lv2: 9000 - Lv3: 10000 - Lv4: 11000 - Lv5: 12000 - Lv6: 13000 - Lv7: 14000 - Lv8: 15000 - Lv9: 16000 - Lv10: 17000 - } + SkillData2: 30000 CoolDown: 0 Requirements: { SPCost: 20 @@ -14881,11 +14870,10 @@ skill_db: ( Range: -9 Hit: "BDT_MULTIHIT" SkillType: { - Self: true + Enemy: true } SkillInfo: { Spirit: true - NoCastSelf: true } AttackType: "Weapon" Element: "Ele_Weapon" @@ -17953,7 +17941,7 @@ skill_db: ( SplashRange: 1 KnockBackTiles: 5 AfterCastActDelay: 2000 - SkillData2: 2000 + SkillData2: 5000 CoolDown: 0 Requirements: { HPCost: 10 @@ -24041,16 +24029,11 @@ skill_db: ( } AttackType: "Weapon" SkillData1: { - Lv1: 3500 - Lv2: 4000 - Lv3: 4500 - Lv4: 5000 - Lv5: 5500 - Lv6: 6000 - Lv7: 6500 - Lv8: 7000 - Lv9: 7500 - Lv10: 8000 + Lv1: 5500 + Lv2: 6000 + Lv3: 6500 + Lv4: 7000 + Lv5: 7500 } CoolDown: 2000 Requirements: { @@ -24806,7 +24789,13 @@ skill_db: ( Lv9: 9 Lv10: 10 } - SkillData1: 1000 + SkillData1: { + Lv1: 1000 + Lv2: 2000 + Lv3: 2000 + Lv4: 3000 + Lv5: 3000 + } CoolDown: 3000 Requirements: { SPCost: { diff --git a/db/quest_db.conf b/db/quest_db.conf index 015692b07..49952d94b 100644 --- a/db/quest_db.conf +++ b/db/quest_db.conf @@ -9040,6 +9040,14 @@ quest_db: ( Name: "Shortage of Roast Beef" }, { + Id: 11204 + Name: "Mora Village..." +}, +{ + Id: 11205 + Name: "Pauchon's Friend" +}, +{ Id: 11206 Name: "Quick Delivery Yoneseu" }, @@ -15275,6 +15283,18 @@ quest_db: ( TimeLimit: 14400 }, { + Id: 60211 + Name: "Thor Volcano base camp" +}, +{ + Id: 60212 + Name: "Thor Volcano base camp" +}, +{ + Id: 60213 + Name: "Thor Volcano base camp" +}, +{ Id: 60301 Name: "Dragon Hunting" Targets: ( diff --git a/db/re/item_db.conf b/db/re/item_db.conf index cac13166d..b54876b23 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -31571,7 +31571,8 @@ item_db: ( EquipLv: 100 Script: <" bonus bMaxSP,40; - bonus bAgi,-7+min(getequiprefinerycnt(EQI_SHOES),8); + if (getrefine() >= 8) + bonus bAgi, getrefine() - 7; "> }, { @@ -146789,7 +146790,7 @@ item_db: ( nomail: true noauction: true } - Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT), "AL_TELEPORT", 3; "> + Script: <" warp "moc_para01", 171, 115; "> }, { Id: 22514 diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf index 282a85abb..133cc5337 100644 --- a/db/re/map_zone_db.conf +++ b/db/re/map_zone_db.conf @@ -55,37 +55,6 @@ zones: ( //Both examples below disable apple (id 501) //Apple: true //ID501: true - } - - mapflags: ( - ) - - /* "command:min-group-lv-to-override" e.g. "heal: 70" */ - disabled_commands: { - //Example Below makes @heal be used in maps within this zone only by those group lv 70 and above - //heal: 70 - } - skill_damage_cap: { - //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage, - // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h) - // when cast vs players and monsters. - //MG_COLDBOLT: (50,"PLAYER | MONSTER") - } -}, -{ - /* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */ - /* However, it wont be applied to maps with its own zones (specified through mapflag) */ - name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */ - - disabled_skills: { - WM_LULLABY_DEEPSLEEP: "PLAYER" - WM_SIRCLEOFNATURE: "PLAYER" - WM_SATURDAY_NIGHT_FEVER: "PLAYER" - SO_ARRULLO: "PLAYER" - CG_HERMODE: "PLAYER" - } - - disabled_items: { Velum_Jamadhar: true Velum_Scare: true Velum_Buster: true @@ -124,6 +93,37 @@ zones: ( mapflags: ( ) + /* "command:min-group-lv-to-override" e.g. "heal: 70" */ + disabled_commands: { + //Example Below makes @heal be used in maps within this zone only by those group lv 70 and above + //heal: 70 + } + skill_damage_cap: { + //Example Below caps Cold Bolt damage in maps within this zone to a maximum 50 damage, + // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h) + // when cast vs players and monsters. + //MG_COLDBOLT: (50,"PLAYER | MONSTER") + } +}, +{ + /* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */ + /* However, it wont be applied to maps with its own zones (specified through mapflag) */ + name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */ + + disabled_skills: { + WM_LULLABY_DEEPSLEEP: "PLAYER" + WM_SIRCLEOFNATURE: "PLAYER" + WM_SATURDAY_NIGHT_FEVER: "PLAYER" + SO_ARRULLO: "PLAYER" + CG_HERMODE: "PLAYER" + } + + disabled_items: { + } + + mapflags: ( + ) + }, { /* PvP zone is applied to all maps with a pvp mapflag */ @@ -137,6 +137,38 @@ zones: ( disabled_items: { Greed_Scroll: true C_Beginner_Cap: true + Velum_Jamadhar: false + Velum_Scare: false + Velum_Buster: false + Velum_Guillotine: false + Velum_Spear: false + Velum_Glaive: false + Velum_Bible: false + Velum_Encyclopedia: false + Velum_Claw: false + Velum_Arc_Wand: false + Velum_Damascus: false + Velum_Stunner: false + Velum_Flail: false + Velum_Arbalest: false + Velum_CrossBow: false + Velum_Claymore: false + Velum_Katzbalger: false + Siege_Arrow_A: false + Siege_Arrow_S: false + Siege_Greave: false + Siege_Boots: false + Siege_Shoes: false + Siege_Manteau: false + Siege_Muffler: false + Siege_White_Potion: false + Siege_Blue_Potion: false + Woe_Violet_Potion: false + Woe_White_Potion: false + Woe_Blue_Potion: false + Siege_Plate: false + Siege_Suits: false + Siege_Robe: false } /* cashshop disabled in pvp maps */ @@ -298,40 +330,6 @@ zones: ( disabled_items: { Assumptio_5_Scroll: true Pty_Assumptio_Scroll: true - Velum_Jamadhar: true - Velum_Scare: true - Velum_Buster: true - Velum_Guillotine: true - Velum_Spear: true - Velum_Glaive: true - Velum_Bible: true - Velum_Encyclopedia: true - Velum_Claw: true - Velum_Arc_Wand: true - Velum_Damascus: true - Velum_Stunner: true - Velum_Flail: true - Velum_Arbalest: true - Velum_CrossBow: true - Velum_Claymore: true - Velum_Katzbalger: true - Siege_Arrow_A: true - Siege_Arrow_S: true - Siege_Greave: true - Siege_Boots: true - Siege_Shoes: true - Siege_Manteau: true - Siege_Muffler: true - Siege_White_Potion: true - Siege_Blue_Potion: true - Woe_Violet_Potion: true - Woe_White_Potion: true - Woe_Blue_Potion: true - TE_White_Potion: true - TE_White_Slim_Potion: true - Siege_Plate: true - Siege_Suits: true - Siege_Robe: true C_Beginner_Cap: true } @@ -445,6 +443,19 @@ zones: ( SC_FATALMENACE: "PLAYER" SC_DIMENSIONDOOR: "PLAYER" } + + mapflags: ( + "nobranch", + "noicewall", + "nomemo", + "nosave SavePoint", + "noteleport", + "monster_noteleport", + "nowarpto", + "partylock", + "pvp off", + "src4instance", + ) }, { name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */ @@ -458,6 +469,19 @@ zones: ( SC_FATALMENACE: "PLAYER" SC_DIMENSIONDOOR: "PLAYER" } + + mapflags: ( + "nobranch", + "noicewall", + "nomemo", + "nosave SavePoint", + "noteleport", + "monster_noteleport", + "nowarpto", + "partylock", + "pvp off", + "src4instance", + ) }, { name: "Towns" @@ -474,40 +498,6 @@ zones: ( disabled_items: { Greed_Scroll: true - Velum_Jamadhar: true - Velum_Scare: true - Velum_Buster: true - Velum_Guillotine: true - Velum_Spear: true - Velum_Glaive: true - Velum_Bible: true - Velum_Encyclopedia: true - Velum_Claw: true - Velum_Arc_Wand: true - Velum_Damascus: true - Velum_Stunner: true - Velum_Flail: true - Velum_Arbalest: true - Velum_CrossBow: true - Velum_Claymore: true - Velum_Katzbalger: true - Siege_Arrow_A: true - Siege_Arrow_S: true - Siege_Greave: true - Siege_Boots: true - Siege_Shoes: true - Siege_Manteau: true - Siege_Muffler: true - Siege_White_Potion: true - Siege_Blue_Potion: true - Woe_Violet_Potion: true - Woe_White_Potion: true - Woe_Blue_Potion: true - TE_White_Potion: true - TE_White_Slim_Potion: true - Siege_Plate: true - Siege_Suits: true - Siege_Robe: true } } ) diff --git a/db/re/mob_db.conf b/db/re/mob_db.conf index caa92b718..188654cf8 100644 --- a/db/re/mob_db.conf +++ b/db/re/mob_db.conf @@ -57,8 +57,8 @@ mob_db: ( } ViewRange: view range (int, defaults to 1) ChaseRange: chase range (int, defaults to 1) - Size: size (int, defaults to 1) - Race: race (int, defaults to 0) + Size: size (string, defaults to "Size_Medium") + Race: race (string, defaults to "RC_Formless") Element: (type, level) Mode: { CanMove: true/false (bool, defaults to false) diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index 8eb2b40fa..ffc5e4e52 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -9,7 +9,7 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2014-2016 Hercules Dev Team +//= Copyright (C) 2014-2017 Hercules Dev Team //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -6271,7 +6271,7 @@ skill_db: ( DamageType: { NoDamage: true } - SkillData2: 3000 + SkillData2: 5000 FixedCastTime: 0 }, { @@ -6408,18 +6408,7 @@ skill_db: ( } SplashRange: 3 SkillData1: 5000 - SkillData2: { - Lv1: 8000 - Lv2: 9000 - Lv3: 10000 - Lv4: 11000 - Lv5: 12000 - Lv6: 13000 - Lv7: 14000 - Lv8: 15000 - Lv9: 16000 - Lv10: 17000 - } + SkillData2: 20000 FixedCastTime: 0 Requirements: { SPCost: 20 @@ -18494,7 +18483,7 @@ skill_db: ( SplashRange: 1 KnockBackTiles: 5 AfterCastActDelay: 2000 - SkillData2: 2000 + SkillData2: 5000 FixedCastTime: -1 Requirements: { HPCost: 10 @@ -24690,16 +24679,11 @@ skill_db: ( } AttackType: "Weapon" SkillData1: { - Lv1: 3500 - Lv2: 4000 - Lv3: 4500 - Lv4: 5000 - Lv5: 5500 - Lv6: 6000 - Lv7: 6500 - Lv8: 7000 - Lv9: 7500 - Lv10: 8000 + Lv1: 5500 + Lv2: 6000 + Lv3: 6500 + Lv4: 7000 + Lv5: 7500 } CoolDown: 2000 FixedCastTime: -1 @@ -25464,7 +25448,13 @@ skill_db: ( Lv9: 9 Lv10: 10 } - SkillData1: 1000 + SkillData1: { + Lv1: 1000 + Lv2: 2000 + Lv3: 2000 + Lv4: 3000 + Lv5: 3000 + } CoolDown: 3000 FixedCastTime: -1 Requirements: { @@ -33999,18 +33989,7 @@ skill_db: ( NoDamage: true } NumberOfHits: 0 - SkillData2: { - Lv1: 60000 - Lv2: 70000 - Lv3: 80000 - Lv4: 90000 - Lv5: 129000 - Lv6: 129000 - Lv7: 129000 - Lv8: 129000 - Lv9: 129000 - Lv10: 129000 - } + CoolDown: 1000 FixedCastTime: -1 Requirements: { SPCost: 10 diff --git a/doc/constants.md b/doc/constants.md index 208d6dad2..22d285412 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -3624,6 +3624,12 @@ - `GETTIME_YEAR`: 7 - `GETTIME_DAYOFYEAR`: 8 +### gettimer + +- `TIMER_COUNT`: 0 +- `TIMER_TICK_NEXT`: 1 +- `TIMER_TICK_LAST`: 2 + ### unit types - `UNITTYPE_PC`: 0 diff --git a/doc/mob_db.txt b/doc/mob_db.txt new file mode 100644 index 000000000..29d2ab465 --- /dev/null +++ b/doc/mob_db.txt @@ -0,0 +1,219 @@ +//===== Hercules Documentation =============================== +//= Monster Database +//===== By: ================================================== +//= Hercules Dev Team +//===== Current Version: ===================================== +//= 20170311 +//===== Description: ========================================= +//= Explanation of the mob_db.conf file and structure. +//============================================================ + +mob_db: ( +{ + // ================ Mandatory fields ============================== + Id: ID (int) + SpriteName: "SPRITE_NAME" (string) + Name: "Mob name" (string) + // ================ Optional fields =============================== + JName: "Mob name" (string) + Lv: level (int, defaults to 1) + Hp: health (int, defaults to 1) + Sp: mana (int, defaults to 0) + Exp: basic experience (int, defaults to 0) + JExp: job experience (int, defaults to 0) + AttackRange: attack range (int, defaults to 1) + Attack: [attack1, attack2] (int, defaults to 0) + Def: defence (int, defaults to 0) + Mdef: magic defence (int, defaults to 0) + Stats: { + Str: strength (int, defaults to 0) + Agi: agility (int, defaults to 0) + Vit: vitality (int, defaults to 0) + Int: intelligence (int, defaults to 0) + Dex: dexterity (int, defaults to 0) + Luk: luck (int, defaults to 0) + } + ViewRange: view range (int, defaults to 1) + ChaseRange: chase range (int, defaults to 1) + Size: size (string, defaults to "Size_Medium") + Race: race (string, defaults to "RC_Formless") + Element: (type, level) + Mode: { + CanMove: true/false (bool, defaults to false) + Looter: true/false (bool, defaults to false) + Aggressive: true/false (bool, defaults to false) + Assist: true/false (bool, defaults to false) + CastSensorIdle:true/false (bool, defaults to false) + Boss: true/false (bool, defaults to false) + Plant: true/false (bool, defaults to false) + CanAttack: true/false (bool, defaults to false) + Detector: true/false (bool, defaults to false) + CastSensorChase: true/false (bool, defaults to false) + ChangeChase: true/false (bool, defaults to false) + Angry: true/false (bool, defaults to false) + ChangeTargetMelee: true/false (bool, defaults to false) + ChangeTargetChase: true/false (bool, defaults to false) + TargetWeak: true/false (bool, defaults to false) + NoKnockback: true/false (bool, defaults to false) + } + MoveSpeed: move speed (int, defaults to 0) + AttackDelay: attack delay (int, defaults to 4000) + AttackMotion: attack motion (int, defaults to 2000) + DamageMotion: damage motion (int, defaults to 0) + MvpExp: mvp experience (int, defaults to 0) + MvpDrops: { + AegisName: chance (string: int) + // ... + } + Drops: { + AegisName: chance (string: int) + // ... + } +}, +... +) + +Id: Monster id + +Sprite: Monster name as it is named on client. + Allowed characters: [A-Za-z0-9_] + +Name: Name displaying as output for @ and script commands. + This is the name shown when summon a monster with "--en--" as monster name. + +JName: Name displaying as output for @ and script commands. + When provided, this has preference over Name value. + This is the name shown when summon a monster with "--ja--" as monster name. + +Lv: Monster level + When not specified, becomes 1. + +Hp: Monster Hp + When not specified, becomes 1. + +Sp: Monster Sp + When not specified, becomes 0. + +Exp: Base Experience given by the monster. + When not specified, becomes 0. + +JExp: Job Experience given by the monster. + When not specified, becomes 0. + +AttackRange: Range for monster's attack. + When the range between monster and target is greater than 3 the skill is considered long-range, + otherwise it's a melee range. + When not specified, becomes 1. + +Attack: Attack of the monster, represented in two values: attack1 and attack2. + attack1 is minimal attack for the monster. + attack2, when pre-renewal is set, it's a value that sets maximum attack for monster. + Example: Familiar's attack is "Attack: [68, 77]", that is min attack of 68 and max attack of 77. + attack2, when renewal is set, it's a value added to attack1 to calculate maximum attack for monster. + Example: Familiar's attack is "Attack: [68, 9]", that is min attack of 68 and max attack of 77 (68+9). + When not specified, becomes 0. + +Def: Monster defense to physical attacks. + When not specified, becomes 0. + +Mdef: Monster defense to magical attacks. + When not specified, becomes 0. + +Stats: { + Str: monster strength points (When not specified, becomes 0) + Agi: monster agility points (When not specified, becomes 0) + Vit: monster vitality points (When not specified, becomes 0) + Int: monster intelligence points (When not specified, becomes 0) + Dex: monster dexterity points (When not specified, becomes 0) + Luk: monster luck points (When not specified, becomes 0) +} + +ViewRange: Range for monster's view. + Aggressive monsters will attack when Player is inside view range. + When not specified, becomes 1. + +ChaseRange: Range for monster's chase. + Aggressive and attacking monsters will stop chasing when Player gets outside chase range. + When not specified, becomes 1. + +Size: Sets monster's size. Accepts these constants: + "Size_Small" + "Size_Medium" + "Size_Large" + When not specified, becomes "Size_Medium". + +Race: Sets monster's race. Accepts these constants: + "RC_Formless" + "RC_Undead" + "RC_Brute" + "RC_Plant" + "RC_Insect" + "RC_Fish" + "RC_Demon" + "RC_DemiHuman" + "RC_Angel" + "RC_Dragon" + When not specified, becomes "RC_Formless". + +Element: Monster's element. Sets element type and level. + Required format: ("Element Type", Level). + Accepts these constants for Element Type: + "Ele_Neutral" + "Ele_Water" + "Ele_Earth" + "Ele_Fire" + "Ele_Wind" + "Ele_Poison" + "Ele_Holy" + "Ele_Dark" + "Ele_Ghost" + "Ele_Undead" + Level is an integer. Valid values: 1 ~ 4. + +Mode: Monster AI behaviour. If this block is omitted, monster doesn't react to anything. + All the settings in this group are boolean values, + Default value is false (mode not set) for any missing setting. + See /doc/sample/mob_db_mode_list.txt for more information about monsters Mode types. + +MoveSpeed: Monster's speed. Sets speed (cells/sec). + MoveSpeed is calculated to Hercules with this formula: 1000 / SPEED (CELLS/SEC) + When not specified, becomes 0. + +AttackDelay: Sets time delay between monster attack. Also refered as aspd. + Monster will not be able to do new attack until AttackDelay ends. + If AttackMotion is bigger than AttackDelay, monster will need to wait to AttackMotion delay. + When not specified, becomes 4000. + +AttackMotion: Sets time delay between animation motion. + Monster will not be able to do new attack until AttackMotion ends. + If AttackDelay is bigger than AttackMotion, monster will need to wait to AttackDelay delay. + AttackMotion is calculated to Hercules with this formula: 1000 / ASPD (ATTACKS/SEC) + When not specified, becomes 2000. + +DamageMotion: Sets time delay between damage motion. + When not specified, becomes 2000. + +MvpExp: Base Experience given by the monster to the player who inflict more attack. + Having any value except 0 will trigger MVP banner to the player who inflict more attack. + When not specified, becomes 0. + + +MvpDrops: Sets monster mvp drops list. Requires to have MvpExp to trigger. + Accepted values are AegisName as defined on item_db.conf and a chance. + Chance is an integer from 1 to 10000 (10000 = 100%). + Required format: + MvpDrops: { + AegisName: chance + // ... + } + When not specified, becomes false. + +Drops: Sets monster drops list. + Accepted values are AegisName as defined on item_db.conf and a chance. + Chance is an integer from 1 to 10000 (10000 = 100%). + Required format: + Drops: { + AegisName: chance + // ... + } + When not specified, becomes false. diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a0e3a783d..581ec182c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1409,6 +1409,27 @@ getvariableofnpc() should not be used on them. --------------------------------------- +*getvariableofpc(<variable>, <account id>{, <default value>}) + +Returns a reference to a PC variable from the target player. +If <default value> is passed, it will return this value if the player is +not found. + +Examples: + +//This will return the value of @var, note that this can't be used, since +//the value isn't caught. + getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")); + +//This will set the .@v variable to the value of the player's @var +//variable. + .@v = getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")); + +//This will set the @var variable of the player to 1. + set(getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")), 1); + +--------------------------------------- + *goto(<label>) This command will make the script jump to a label, usually used in @@ -2341,7 +2362,7 @@ deleted. //===================================== --------------------------------------- -*strcharinfo(<type>) +*strcharinfo(<type>{, <default value>{, <GID>}}) This function will return either the name, party name or guild name for the invoking character. Whatever it returns is determined by type. @@ -2349,6 +2370,10 @@ the invoking character. Whatever it returns is determined by type. (1) PC_PARTY - The name of the party they're in if any. (2) PC_GUILD - The name of the guild they're in if any. (3) PC_MAP - The name of the map the character is in. + +If <GID> is passed, it will return the value of the specified player instead +the attached player. If the player is not found, it will return +<default value>, if any, or else return an empty string. If a character is not a member of any party or guild, an empty string will be returned when requesting that information. @@ -2358,7 +2383,7 @@ using only numbers reduces script readability --------------------------------------- -*strnpcinfo(<type>) +*strnpcinfo(<type>{, <default value>{, <GID>}}) This function will return the various parts of the name of the calling NPC. Whatever it returns is determined by type. @@ -2369,6 +2394,10 @@ Whatever it returns is determined by type. (3) NPC_NAME_UNIQUE - The NPC's unique name (::name) (4) NPC_MAP - The name of the map the NPC is in. +If <GID> is passed, it will return the value of the specified NPC instead of +the attached NPC. If the NPC is not found, it will return <default value>, +if any, or else return an empty string. + --------------------------------------- *charid2rid(<char id>) @@ -4292,7 +4321,7 @@ Example: --------------------------------------- -*warpguild("<mapname>", <x>, <y>, <guild_id>) +*warpguild("<mapname>", <x>, <y>, <guild_id>, {"<from_mapname>"}) Warps a guild to specified map and coordinate given the guild id, which you can get with getcharid(CHAR_ID_GUILD). You can also request another guild id given @@ -4306,9 +4335,12 @@ SavePoint: All guild members are warped to the save point of the currently attached player (will fail if there's no player attached). +If you specify a from_mapname, warpguild() will only affect those on that map. + Example: warpguild("prontera", x, y, Guild_ID); + warpguild("prontera", x, y, Guild_ID, "payon"); // warp member from Payon map only. --------------------------------------- @@ -4507,26 +4539,17 @@ changebase(Class); // Changes player back to default sprite. --------------------------------------- -*classchange(<view id>, <type>) +*classchange(<view id>, <type> {, <char id>}) This command is very ancient, it's origins are clouded in mystery. -It will send a 'display id change' packet to everyone in the immediate -area of the NPC object, which will supposedly make the NPC look like a -different sprite, an NPC sprite ID, or a monster ID. This effect is not -stored anywhere and will not persist (Which is odd, cause it would be -relatively easy to make it do so) and most importantly, will not work at -all since this command was broken with the introduction of advanced -classes. The code is written with the assumption that the lowest sprite -IDs are the job sprites and the anything beyond them is monster and NPC -sprites, but since the advanced classes rolled in, they got the ID numbers -on the other end of the number pool where monster sprites float. +It will send a 'display id change' packet to player with given char ID +or to everyone in the immediate area of the NPC object if char ID is 0 or +not passed, which will make the NPC look like a different sprite, an NPC +sprite ID, or a monster ID. This effect is not stored anywhere and will +not persist. +Note that you can't send a Job sprite ID -As a result it is currently impossible to call this command with a valid -view id. It will do nothing whatsoever if the view ID is below 4047. -Getting it to run will actually just crash the client. - -It could be a real gem if it can be gotten to actually do what it's -supposed to do, but this will only happen in a later Git revision. +type is not used and should always be 0. --------------------------------------- @@ -6455,17 +6478,14 @@ Size is 0 = normal 1 = small 2 = big. //===================================== --------------------------------------- -*addtimer(<ticks>, "NPC::OnLabel") -*deltimer("NPC::OnLabel") -*addtimercount("NPC::OnLabel", <ticks>) +*addtimer(<ticks>, "NPC::OnLabel"{, <account id>}) -These commands will create, destroy, and delay a countdown timer - -addtimer() to create, deltimer() to destroy and addtimercount() to delay -it by the specified number of ticks. For all three cases, the event label -given is the identifier of that timer. The timer runs on the character -object that is attached to the script, and can have multiple instances. -When the label is run, it is run as if the player that the timer runs on -has clicked the NPC. +This command will create a countdown timer. +The event label given is the identifier of that timer. +The timer runs on the character object that is attached to the script, +and can have multiple instances. If <acccount id> is passed, this player +will be used instead. When the label is run, it is run as if the player +that the timer runs on has clicked the NPC. When this timer runs out, a new execution thread will start in the specified NPC object at the specified label. @@ -6489,6 +6509,39 @@ On5secs: --------------------------------------- +*deltimer("NPC::OnLabel"{, <account id>}) + +Deletes timers created by addtimer() that matches the given event +label. Refer to addtimer() for additional information. + +--------------------------------------- + +*addtimercount("NPC::OnLabel", <ticks>{, <account id>}) + +Delays a timer that was created with addtimer() by <ticks> ticks +if it matches the given event label. Refer to addtimer() for additional +information. + +--------------------------------------- + +*gettimer(<type>{, <account id>{, "<event>"}}) + +Returns informations on timers that were created by addtimer(). + +valid <type> for gettimer() are: + +(0) TIMER_COUNT + Will return the total number of timers for the specified or + attached player. Can be filtered by <event>. +(1) TIMER_TICK_NEXT + Will return the number of ticks until the next timer runs + for the specified or attached player. Can be filtered by <event>. +(2) TIMER_TICK_LAST + Will return the number of ticks until the last timer runs + for the specified or attached player. Can be filtered by <event>. + +--------------------------------------- + *initnpctimer({ "<NPC name>" {, <Attach Flag>} } | { "<NPC name>" | <Attach Flag> }) *stopnpctimer({ "<NPC name>" {, <Detach Flag>} } | @@ -8046,6 +8099,26 @@ Example: --------------------------------------- +*chr(<int>) + +Returns a char from its ASCII value. + +Example: + + chr(99); //returns "c" + +--------------------------------------- + +*ord(<chr>) + +Returns the ASCII value of char <chr>. + +Example: + + ord("c"); //returns 99 + +--------------------------------------- + *setchar(<string>, <char>, <index>) Returns the original string with the char at the specified index set to diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt index e6947d2a4..f94bc177a 100644 --- a/npc/instances/EndlessTower.txt +++ b/npc/instances/EndlessTower.txt @@ -36,13 +36,6 @@ //= 2.4 //========================================================================= -1@tower mapflag src4instance -2@tower mapflag src4instance -3@tower mapflag src4instance -4@tower mapflag src4instance -5@tower mapflag src4instance -6@tower mapflag src4instance - alberta,214,77,6 script Captain Janssen 4_M_SEAMAN,{ if (checkweight(Knife,1) == 0) { mes "^008800Wait here!!"; diff --git a/npc/instances/NydhoggsNest.txt b/npc/instances/NydhoggsNest.txt index bad1aacec..2c583d441 100644 --- a/npc/instances/NydhoggsNest.txt +++ b/npc/instances/NydhoggsNest.txt @@ -33,9 +33,6 @@ //= 1.6 //========================================================================= -1@nyd mapflag src4instance -2@nyd mapflag src4instance - nyd_dun02,100,201,3 script Yggdrasil Gatekeeper HIDDEN_NPC,8,8,{ if (ins_nyd == 0) { mes "A great stone gate stands before you. The sculpture of a terrible dragon spreads its powerful looking wings."; @@ -165,6 +162,10 @@ nyd_dun02,100,201,3 script Yggdrasil Gatekeeper HIDDEN_NPC,8,8,{ close; goto L_Enter; } else { + .@instance = has_instance2("1@nyd"); + if (.@instance >= 0) { + instance_attach(.@instance); + } if (.@ins_nyd_check == 1) { if ('ins_nyd2 == 3 || 'ins_nyd2 == 4) { mes "[Yggdrasil Gatekeeper]"; @@ -2168,27 +2169,27 @@ OnTouch: 2@nyd,1,1,0 script ins_nyd2_spawn_mobs FAKE_NPC,{ OnInstanceInit: - .@map$ = instance_mapname("2@nyd"); - areamonster .@map$,200,92,180,80,"Rhyncho",2020,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyRhynDead"; - areamonster .@map$,200,92,180,80,"Phylla",2021,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPhyDead"; - areamonster .@map$,200,92,180,80,"Dark Shadow",2023,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyDarkshaDead"; - areamonster .@map$,200,92,180,80,"Dark Pinguicula",2015,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPingDead"; + .@map$ = instance_mapname("2@nyd"); //temp fix since all mobs spawn on the same (inaccessable) area + areamonster .@map$,14,20,382,180,"Rhyncho",2020,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyRhynDead"; + areamonster .@map$,14,20,382,180,"Phylla",2021,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPhyDead"; + areamonster .@map$,14,20,382,180,"Dark Shadow",2023,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyDarkshaDead"; + areamonster .@map$,14,20,382,180,"Dark Pinguicula",2015,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPingDead"; end; OnMyRhynDead: - areamonster instance_mapname("2@nyd"),200,92,180,80,"Rhyncho",2020,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyRhynDead"; + areamonster instance_mapname("2@nyd"),14,20,382,180,"Rhyncho",2020,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyRhynDead"; end; OnMyPhyDead: - areamonster instance_mapname("2@nyd"),200,92,180,80,"Phylla",2021,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPhyDead"; + areamonster instance_mapname("2@nyd"),14,20,382,180,"Phylla",2021,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPhyDead"; end; OnMyDarkshaDead: - areamonster instance_mapname("2@nyd"),200,92,180,80,"Dark Shadow",2023,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyDarkshaDead"; + areamonster instance_mapname("2@nyd"),14,20,382,180,"Dark Shadow",2023,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyDarkshaDead"; end; OnMyPingDead: - areamonster instance_mapname("2@nyd"),200,92,180,80,"Dark Pinguicula",2015,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPingDead"; + areamonster instance_mapname("2@nyd"),14,20,382,180,"Dark Pinguicula",2015,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPingDead"; end; } diff --git a/npc/instances/OrcsMemory.txt b/npc/instances/OrcsMemory.txt index 48412a631..28cc9bbd5 100644 --- a/npc/instances/OrcsMemory.txt +++ b/npc/instances/OrcsMemory.txt @@ -33,9 +33,6 @@ //= 1.7 //========================================================================= -1@orcs mapflag src4instance -2@orcs mapflag src4instance - //== Entrance ============================================== gef_fild10,242,202,0 script Dimensional Gorge Piece 2_MONEMUS,{ diff --git a/npc/instances/SealedShrine.txt b/npc/instances/SealedShrine.txt index 90efe6f5c..de59b7599 100644 --- a/npc/instances/SealedShrine.txt +++ b/npc/instances/SealedShrine.txt @@ -35,9 +35,6 @@ //= 2.3 //========================================================================= -1@cata mapflag src4instance -2@cata mapflag src4instance - //== Sealed Catacomb Entrance ============================== monk_test,309,146,3 script Friar Patrick#edq 4_M_OLDFRIAR,{ cutin "ins_cata_pri_n",2; diff --git a/npc/jobs/2-2/crusader.txt b/npc/jobs/2-2/crusader.txt index 1857539a5..b806d12c3 100644 --- a/npc/jobs/2-2/crusader.txt +++ b/npc/jobs/2-2/crusader.txt @@ -78,20 +78,6 @@ prt_castle,45,169,5 script Senior Crusader 4_M_CRU_OLD,{ mes "As it happened one thousand years ago, evil forces will one day attack in droves in an attempt to take over the world once again."; close; } - else if(CRUS_Q <= 3 && countitem(Patriotism_Marks) && countitem(Sacred_Marks)) { - mes "Ah..."; - mes "I see that you have been called to become a Crusader. We are assured of your will, but now we must test your capabilities."; - next; - mes "[Michael Halig]"; - mes "Meet with Moorenak Miyol who is training in the underground dungeon of the Prontera Castle. Go, and speak with him first."; - next; - delitem 1004, 1; - delitem 1009, 1; - CRUS_Q = 4; - mes "[Michael Halig]"; - mes "Moorenak and others like him will test the limits of your capabilities and help you find your path. Return to me after you have completed their tests..."; - close; - } else if(CRUS_Q == 0) { mes "We are Crusaders, warriors preparing for the Holy War."; mes "What brings you"; @@ -223,6 +209,28 @@ prt_castle,45,169,5 script Senior Crusader 4_M_CRU_OLD,{ else if(CRUS_Q >= 1 && CRUS_Q <= 3) { mes "Have you proven your determination with the task I have given you, or do you possess the items proving that you have received your calling?"; next; + if (countitem(Patriotism_Marks) >= 1 && countitem(Sacred_Marks) >= 1) { + mes "[Michael Halig]"; + mes "Ah..."; + mes "I see that you have been called to become a Crusader. We are assured of your will, but now we must test your capabilities."; + next; + mes "[Michael Halig]"; + mes "Meet with Moorenak Miyol who is training in the underground dungeon of the Prontera Castle. Go, and speak with him first."; + next; + delitem Patriotism_Marks, 1; + delitem Sacred_Marks, 1; + CRUS_Q = 4; + if (questprogress(3006)) { + changequest 3006,3009; + } else if (questprogress(3007)) { + changequest 3007,3009; + } else { + changequest 3008,3009; + } + mes "[Michael Halig]"; + mes "Moorenak and others like him will test the limits of your capabilities and help you find your path. Return to me after you have completed their tests..."; + close; + } switch(CRUS_Q) { case 1: .@item1 = 957; diff --git a/npc/mapflag/gvg.txt b/npc/mapflag/gvg.txt index 18b644615..b30ff1340 100644 --- a/npc/mapflag/gvg.txt +++ b/npc/mapflag/gvg.txt @@ -120,9 +120,5 @@ nguild_prt mapflag gvg_castle //nguild_prt mapflag monster_noteleport // Guild Dungeons ========= -gld_dun01 mapflag gvg_dungeon -gld_dun02 mapflag gvg_dungeon -gld_dun03 mapflag gvg_dungeon -gld_dun04 mapflag gvg_dungeon arug_dun01 mapflag gvg_dungeon schg_dun01 mapflag gvg_dungeon diff --git a/npc/mapflag/nobranch.txt b/npc/mapflag/nobranch.txt index 60db05cf5..4ad59ad67 100644 --- a/npc/mapflag/nobranch.txt +++ b/npc/mapflag/nobranch.txt @@ -306,15 +306,7 @@ que_qaru04 mapflag nobranch que_qaru05 mapflag nobranch // Episode 12 =========== -1@cata mapflag nobranch -2@cata mapflag nobranch e_tower mapflag nobranch -1@tower mapflag nobranch -2@tower mapflag nobranch -3@tower mapflag nobranch -4@tower mapflag nobranch -5@tower mapflag nobranch -6@tower mapflag nobranch // Episode 13.1 =========== mid_camp mapflag nobranch @@ -325,8 +317,6 @@ que_dan01 mapflag nobranch que_dan02 mapflag nobranch schg_que01 mapflag nobranch arug_que01 mapflag nobranch -1@orcs mapflag nobranch -2@orcs mapflag nobranch // Battle Grounds ============== bat_c01 mapflag nobranch @@ -339,8 +329,6 @@ bat_a01 mapflag nobranch bat_a02 mapflag nobranch // Episode 13.2 =========== -1@nyd mapflag nobranch -2@nyd mapflag nobranch manuk mapflag nobranch man_fild02 mapflag nobranch man_in01 mapflag nobranch @@ -377,7 +365,6 @@ s_atelier mapflag nobranch // Episode 14.1 & Dewata =========== mora mapflag nobranch -1@mist mapflag nobranch dewata mapflag nobranch dew_in01 mapflag nobranch @@ -385,16 +372,9 @@ dew_in01 mapflag nobranch malangdo mapflag nobranch mal_in01 mapflag nobranch mal_in02 mapflag nobranch -1@cash mapflag nobranch -1@pump mapflag nobranch -2@pump mapflag nobranch -1@lhz mapflag nobranch malaya mapflag nobranch ma_scene01 mapflag nobranch ma_in01 mapflag nobranch -1@ma_h mapflag nobranch -1@ma_c mapflag nobranch -1@ma_b mapflag nobranch // Episode 14.2 =========== eclage mapflag nobranch @@ -402,7 +382,6 @@ ecl_in01 mapflag nobranch ecl_in02 mapflag nobranch ecl_in03 mapflag nobranch ecl_in04 mapflag nobranch -1@ecl mapflag nobranch ecl_hub01 mapflag nobranch // Episode 14.3 =========== @@ -411,12 +390,6 @@ c_tower3_ mapflag nobranch gl_chyard_ mapflag nobranch gl_cas02_ mapflag nobranch -// Ghost Palace =========== -1@spa mapflag nobranch - -// Sara's Memory Instance =========== -1@sara mapflag nobranch - //evt_zombie mapflag nobranch // Poring War ================== diff --git a/npc/mapflag/noicewall.txt b/npc/mapflag/noicewall.txt index 6c1af1b09..195bec2bb 100644 --- a/npc/mapflag/noicewall.txt +++ b/npc/mapflag/noicewall.txt @@ -159,53 +159,6 @@ nguild_gef mapflag noicewall nguild_pay mapflag noicewall nguild_prt mapflag noicewall -//Endless Tower ================== -1@tower mapflag noicewall -2@tower mapflag noicewall -3@tower mapflag noicewall -4@tower mapflag noicewall -5@tower mapflag noicewall -6@tower mapflag noicewall - -// Orc's Memory =================== -1@orcs mapflag noicewall -2@orcs mapflag noicewall - -// Nidhoggr's Instance =========== -1@nyd mapflag noicewall -2@nyd mapflag noicewall - -// Misty Forest Labyrinth =========== -1@mist mapflag noicewall - -// Octopus Cave =========== -1@cash mapflag noicewall - -// Drain =========== -1@pump mapflag noicewall -2@pump mapflag noicewall - -// Somatology Laboratory =========== -1@lhz mapflag noicewall - -// Bangungot Hospital F2 =========== -1@ma_h mapflag noicewall - -// Buwaya Cave =========== -1@ma_c mapflag noicewall - -// Bakonawa Hideout =========== -1@ma_b mapflag noicewall - -// Inside Eclage =========== -1@ecl mapflag noicewall - -// Ghost Palace =========== -1@spa mapflag noicewall - -// Sara's Memory Instance =========== -1@sara mapflag noicewall - // Poring War ==================== poring_w01 mapflag noicewall poring_w02 mapflag noicewall diff --git a/npc/mapflag/nomemo.txt b/npc/mapflag/nomemo.txt index a0dd66e9d..662bf4c05 100644 --- a/npc/mapflag/nomemo.txt +++ b/npc/mapflag/nomemo.txt @@ -656,18 +656,8 @@ que_qaru03 mapflag nomemo que_qaru04 mapflag nomemo que_qaru05 mapflag nomemo -//Sealed Shrine ================== -1@cata mapflag nomemo -2@cata mapflag nomemo - //Endless Tower ================== e_tower mapflag nomemo -1@tower mapflag nomemo -2@tower mapflag nomemo -3@tower mapflag nomemo -4@tower mapflag nomemo -5@tower mapflag nomemo -6@tower mapflag nomemo // Battle Grounds ================ bat_c01 mapflag nomemo @@ -731,7 +721,6 @@ dic_dun02 mapflag nomemo // Episode 14 ==================== bif_fild01 mapflag nomemo bif_fild02 mapflag nomemo -1@mist mapflag nomemo mora mapflag nomemo dew_dun01 mapflag nomemo dew_dun02 mapflag nomemo @@ -740,13 +729,9 @@ dic_dun03 mapflag nomemo mal_in01 mapflag nomemo mal_in02 mapflag nomemo mal_dun01 mapflag nomemo -1@cash mapflag nomemo -1@pump mapflag nomemo -2@pump mapflag nomemo iz_dun05 mapflag nomemo lhz_dun04 mapflag nomemo que_lhz mapflag nomemo -1@lhz mapflag nomemo gld_dun01_2 mapflag nomemo gld_dun02_2 mapflag nomemo gld_dun03_2 mapflag nomemo @@ -758,9 +743,6 @@ gld2_prt mapflag nomemo ma_scene01 mapflag nomemo ma_in01 mapflag nomemo ma_dun01 mapflag nomemo -1@ma_h mapflag nomemo -1@ma_c mapflag nomemo -1@ma_b mapflag nomemo ma_zif01 mapflag nomemo ma_zif02 mapflag nomemo ma_zif03 mapflag nomemo @@ -776,7 +758,6 @@ ecl_in01 mapflag nomemo ecl_in02 mapflag nomemo ecl_in03 mapflag nomemo ecl_in04 mapflag nomemo -1@ecl mapflag nomemo ecl_tdun01 mapflag nomemo ecl_tdun02 mapflag nomemo ecl_tdun03 mapflag nomemo @@ -791,20 +772,6 @@ c_tower3_ mapflag nomemo gl_chyard_ mapflag nomemo gl_cas02_ mapflag nomemo -//Orc's Memory =================== -1@orcs mapflag nomemo -2@orcs mapflag nomemo - -// Nidhoggr's Instance =========== -1@nyd mapflag nomemo -2@nyd mapflag nomemo - -// Ghost Palace =========== -1@spa mapflag nomemo - -// Sara's Memory Instance =========== -1@sara mapflag nomemo - //evt_zombie mapflag nomemo // Poring War ==================== diff --git a/npc/mapflag/nopvp.txt b/npc/mapflag/nopvp.txt index 8a396bf69..41127332b 100644 --- a/npc/mapflag/nopvp.txt +++ b/npc/mapflag/nopvp.txt @@ -32,30 +32,6 @@ //= Prevents PvP mode on a map. //========================================================================= -1@cata mapflag pvp off -2@cata mapflag pvp off -1@nyd mapflag pvp off -2@nyd mapflag pvp off -1@orcs mapflag pvp off -2@orcs mapflag pvp off -1@tower mapflag pvp off -2@tower mapflag pvp off -3@tower mapflag pvp off -4@tower mapflag pvp off -5@tower mapflag pvp off -6@tower mapflag pvp off -1@mist mapflag pvp off -1@cash mapflag pvp off -1@pump mapflag pvp off -2@pump mapflag pvp off -1@lhz mapflag pvp off -1@ma_h mapflag pvp off -1@ma_c mapflag pvp off -1@ma_b mapflag pvp off -1@ecl mapflag pvp off -1@spa mapflag pvp off -1@sara mapflag pvp off - bat_a01 mapflag pvp off bat_a02 mapflag pvp off bat_b01 mapflag pvp off diff --git a/npc/mapflag/nosave.txt b/npc/mapflag/nosave.txt index 3465cc0c3..8137e500b 100644 --- a/npc/mapflag/nosave.txt +++ b/npc/mapflag/nosave.txt @@ -281,18 +281,8 @@ que_qaru03 mapflag nosave SavePoint que_qaru04 mapflag nosave SavePoint que_qaru05 mapflag nosave SavePoint -// Sealed Shrine ================== -1@cata mapflag nosave SavePoint -2@cata mapflag nosave SavePoint - // Endless Tower ================== e_tower mapflag nosave SavePoint -1@tower mapflag nosave SavePoint -2@tower mapflag nosave SavePoint -3@tower mapflag nosave SavePoint -4@tower mapflag nosave SavePoint -5@tower mapflag nosave SavePoint -6@tower mapflag nosave SavePoint // Battle Grounds ============== bat_c01 mapflag nosave SavePoint @@ -312,45 +302,8 @@ schg_dun01 mapflag nosave SavePoint arug_que01 mapflag nosave SavePoint arug_dun01 mapflag nosave SavePoint -// Orc's Memory =================== -1@orcs mapflag nosave SavePoint -2@orcs mapflag nosave SavePoint - -// Nidhoggr's Instance =========== -1@nyd mapflag nosave SavePoint -2@nyd mapflag nosave SavePoint - -// Misty Forest Labyrinth =========== -1@mist mapflag nosave SavePoint - -// Octopus Cave =========== -1@cash mapflag nosave SavePoint - -// Drain =========== -1@pump mapflag nosave SavePoint -2@pump mapflag nosave SavePoint - // Somatology Laboratory =========== que_lhz mapflag nosave SavePoint -1@lhz mapflag nosave SavePoint - -// Bangungot Hospital F2 =========== -1@ma_h mapflag nosave SavePoint - -// Buwaya Cave =========== -1@ma_c mapflag nosave SavePoint - -// Bakonawa Hideout =========== -1@ma_b mapflag nosave SavePoint - -// Inside Eclage =========== -1@ecl mapflag nosave SavePoint - -// Ghost Palace =========== -1@spa mapflag nosave SavePoint - -// Sara's Memory Instance =========== -1@sara mapflag nosave SavePoint //evt_zombie mapflag nosave SavePoint diff --git a/npc/mapflag/noteleport.txt b/npc/mapflag/noteleport.txt index 8b1109ef1..700964da4 100644 --- a/npc/mapflag/noteleport.txt +++ b/npc/mapflag/noteleport.txt @@ -368,26 +368,8 @@ que_qaru04 mapflag monster_noteleport que_qaru05 mapflag noteleport que_qaru05 mapflag monster_noteleport -//Sealed Shrine ================== -1@cata mapflag noteleport -1@cata mapflag monster_noteleport -2@cata mapflag noteleport -2@cata mapflag monster_noteleport - //Endless Tower ================== e_tower mapflag noteleport -1@tower mapflag noteleport -1@tower mapflag monster_noteleport -2@tower mapflag noteleport -2@tower mapflag monster_noteleport -3@tower mapflag noteleport -3@tower mapflag monster_noteleport -4@tower mapflag noteleport -4@tower mapflag monster_noteleport -5@tower mapflag noteleport -5@tower mapflag monster_noteleport -6@tower mapflag noteleport -6@tower mapflag monster_noteleport // Battle Grounds ============== bat_c01 mapflag noteleport @@ -413,29 +395,13 @@ bra_in01 mapflag noteleport dic_in01 mapflag noteleport // Episode 14 ==================== -1@mist mapflag noteleport -1@mist mapflag monster_noteleport dew_in01 mapflag noteleport mal_in01 mapflag noteleport mal_in02 mapflag noteleport -1@cash mapflag noteleport -1@cash mapflag monster_noteleport -1@pump mapflag noteleport -1@pump mapflag monster_noteleport -2@pump mapflag noteleport -2@pump mapflag monster_noteleport que_lhz mapflag noteleport que_lhz mapflag monster_noteleport -1@lhz mapflag noteleport -1@lhz mapflag monster_noteleport ma_scene01 mapflag noteleport ma_in01 mapflag noteleport -1@ma_h mapflag noteleport -1@ma_h mapflag monster_noteleport -1@ma_c mapflag noteleport -1@ma_c mapflag monster_noteleport -1@ma_b mapflag noteleport -1@ma_b mapflag monster_noteleport ma_zif01 mapflag noteleport ma_zif02 mapflag noteleport ma_zif03 mapflag noteleport @@ -449,35 +415,13 @@ ecl_in01 mapflag noteleport ecl_in02 mapflag noteleport ecl_in03 mapflag noteleport ecl_in04 mapflag noteleport -1@ecl mapflag noteleport -1@ecl mapflag monster_noteleport ecl_hub01 mapflag noteleport dali mapflag noteleport dali02 mapflag noteleport -//Orc's Memory =================== -1@orcs mapflag noteleport -1@orcs mapflag monster_noteleport -2@orcs mapflag noteleport -2@orcs mapflag monster_noteleport - // Yggdrasil Dungeon ============= nyd_dun02 mapflag noteleport -// Nidhoggr's Instance =========== -1@nyd mapflag noteleport -1@nyd mapflag monster_noteleport -2@nyd mapflag noteleport -2@nyd mapflag monster_noteleport - -// Ghost Palace =========== -1@spa mapflag noteleport -1@spa mapflag monster_noteleport - -// Sara's Memory Instance =========== -1@sara mapflag noteleport -1@sara mapflag monster_noteleport - //evt_zombie mapflag noteleport // Poring War ==================== diff --git a/npc/mapflag/nowarpto.txt b/npc/mapflag/nowarpto.txt index 34d093ae2..783dc8cc9 100644 --- a/npc/mapflag/nowarpto.txt +++ b/npc/mapflag/nowarpto.txt @@ -115,18 +115,8 @@ que_qaru03 mapflag nowarpto que_qaru04 mapflag nowarpto que_qaru05 mapflag nowarpto -//Sealed Shrine ================== -1@cata mapflag nowarpto -2@cata mapflag nowarpto - //Endless Tower ================== e_tower mapflag nowarpto -1@tower mapflag nowarpto -2@tower mapflag nowarpto -3@tower mapflag nowarpto -4@tower mapflag nowarpto -5@tower mapflag nowarpto -6@tower mapflag nowarpto // Battle Grounds ============== bat_c01 mapflag nowarpto @@ -160,17 +150,6 @@ splendide mapflag nowarpto spl_fild01 mapflag nowarpto spl_in01 mapflag nowarpto -//Orc's Memory =================== -1@orcs mapflag nowarpto -2@orcs mapflag nowarpto - -// Nidhoggr's Instance =========== -1@nyd mapflag nowarpto -2@nyd mapflag nowarpto - -// Ghost Palace =========== -1@spa mapflag nowarpto - // Poring War ==================== poring_w01 mapflag nowarpto poring_w02 mapflag nowarpto diff --git a/npc/mapflag/partylock.txt b/npc/mapflag/partylock.txt index 9e604fedc..1aa9d4991 100644 --- a/npc/mapflag/partylock.txt +++ b/npc/mapflag/partylock.txt @@ -33,54 +33,3 @@ //= Blocks all party modifications on a map: //= /organize, /leave, /invite, @changeleader //========================================================================= - -// Sealed Shrine ================== -1@cata mapflag partylock -2@cata mapflag partylock - -// Endless Tower ================== -1@tower mapflag partylock -2@tower mapflag partylock -3@tower mapflag partylock -4@tower mapflag partylock -5@tower mapflag partylock -6@tower mapflag partylock - -// Orc's Memory =================== -1@orcs mapflag partylock -2@orcs mapflag partylock - -// Nidhoggr's Instance =========== -1@nyd mapflag partylock -2@nyd mapflag partylock - -// Misty Forest Labyrinth =========== -1@mist mapflag partylock - -// Octopus Cave =========== -1@cash mapflag partylock - -// Drain =========== -1@pump mapflag partylock -2@pump mapflag partylock - -// Somatology Laboratory =========== -1@lhz mapflag partylock - -// Bangungot Hospital F2 =========== -1@ma_h mapflag partylock - -// Buwaya Cave =========== -1@ma_c mapflag partylock - -// Bakonawa Hideout =========== -1@ma_b mapflag partylock - -// Inside Eclage =========== -1@ecl mapflag partylock - -// Ghost Palace =========== -1@spa mapflag partylock - -// Sara's Memory Instance =========== -1@sara mapflag partylock diff --git a/npc/mapflag/zone.txt b/npc/mapflag/zone.txt index d3b88c0c7..b90116911 100644 --- a/npc/mapflag/zone.txt +++ b/npc/mapflag/zone.txt @@ -75,37 +75,6 @@ prt_are_in mapflag zone Izlude Battle Arena 1@nyd mapflag zone Memorial Dungeon 2@nyd mapflag zone Memorial Dungeon -// Misty Forest Labyrinth =========== -1@mist mapflag zone Memorial Dungeon - -// Octopus Cave =========== -1@cash mapflag zone Memorial Dungeon - -// Drain =========== -1@pump mapflag zone Memorial Dungeon -2@pump mapflag zone Memorial Dungeon - -// Somatology Laboratory =========== -1@lhz mapflag zone Memorial Dungeon - -// Bangungot Hospital F2 =========== -1@ma_h mapflag zone Memorial Dungeon - -// Buwaya Cave =========== -1@ma_c mapflag zone Memorial Dungeon - -// Bakonawa Hideout =========== -1@ma_b mapflag zone Memorial Dungeon - -// Inside Eclage =========== -1@ecl mapflag zone Memorial Dungeon - -// Ghost Palace =========== -1@spa mapflag zone Memorial Dungeon - -// Sara's Memory Instance =========== -1@sara mapflag zone Memorial Dungeon - //Towns alberta mapflag zone Towns aldebaran mapflag zone Towns @@ -137,3 +106,15 @@ umbala mapflag zone Towns veins mapflag zone Towns xmas mapflag zone Towns yuno mapflag zone Towns + +// WoE SE +arug_cas01 mapflag zone GvG2 +arug_cas02 mapflag zone GvG2 +arug_cas03 mapflag zone GvG2 +arug_cas04 mapflag zone GvG2 +arug_cas05 mapflag zone GvG2 +schg_cas01 mapflag zone GvG2 +schg_cas02 mapflag zone GvG2 +schg_cas03 mapflag zone GvG2 +schg_cas04 mapflag zone GvG2 +schg_cas05 mapflag zone GvG2 diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index f6068d598..544e3a672 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -156,16 +156,6 @@ function script F_Rand { return getarg(rand(getargcount())); } -//== Function F_Sex ======================================== -// Returns 1st argument if female, 2nd argument otherwise -// Example: mes callfunc("F_Sex","What a beautiful lady!","What a handsome man!"); -function script F_SexMes { - if (Sex == SEX_MALE) - return getarg(0); - else - return getarg(1); -} - //== Function F_Hi ========================================= // Returns random HELLO message function script F_Hi { diff --git a/npc/other/auction.txt b/npc/other/auction.txt index 21b2972a8..76e1a6042 100644 --- a/npc/other/auction.txt +++ b/npc/other/auction.txt @@ -113,7 +113,7 @@ auction_02,43,17,0 warp auction_enterance_lhz 1,1,lighthalzen,209,169 next; if (select("Yes", "No") == 1) { mes "[Auction Broker]"; - if ( getbattleflag( "feature.auction" ) ) { + if (getbattleflag("features/auction")) { mes "Very well."; mes "Please take"; mes "a look, and see"; diff --git a/npc/pre-re/mapflag/gvg.txt b/npc/pre-re/mapflag/gvg.txt new file mode 100644 index 000000000..39be0ee7b --- /dev/null +++ b/npc/pre-re/mapflag/gvg.txt @@ -0,0 +1,41 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2017 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Mapflag: Guild versus Guild mode. +//================= Current Version ======================================= +//= 1.0 +//================= Description =========================================== +//= Players can attack other guilds, and will have their guild +//= icons shown. WoE damage reductions will also take place. +//= gvg: Turns on GvG mode +//= gvg_castle: Describes castle maps for WoE. +//========================================================================= + +// Guild Dungeons ========= +gld_dun01 mapflag gvg_dungeon +gld_dun02 mapflag gvg_dungeon +gld_dun03 mapflag gvg_dungeon +gld_dun04 mapflag gvg_dungeon diff --git a/npc/pre-re/scripts_main.conf b/npc/pre-re/scripts_main.conf index 9381497ec..dda475310 100644 --- a/npc/pre-re/scripts_main.conf +++ b/npc/pre-re/scripts_main.conf @@ -62,6 +62,7 @@ npc_global_list: ( //- Pre-Renewal Script Files - @include "npc/pre-re/scripts.conf" @include "npc/pre-re/scripts_jobs.conf" +@include "npc/pre-re/scripts_mapflags.conf" @include "npc/pre-re/scripts_monsters.conf" @include "npc/pre-re/scripts_warps.conf" diff --git a/npc/pre-re/scripts_mapflags.conf b/npc/pre-re/scripts_mapflags.conf new file mode 100644 index 000000000..03c798aa6 --- /dev/null +++ b/npc/pre-re/scripts_mapflags.conf @@ -0,0 +1,30 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2017 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Map Flags +//========================================================================= + +"npc/pre-re/mapflag/gvg.txt", diff --git a/npc/quests/quests_hugel.txt b/npc/quests/quests_hugel.txt index 039e773a7..1ac300153 100644 --- a/npc/quests/quests_hugel.txt +++ b/npc/quests/quests_hugel.txt @@ -5836,7 +5836,7 @@ hugel,76,134,3 script Neha 4W_F_01,{ mes "for your impertinence, girl!"; } for (.@i = 8064; .@i <= 8067; ++.@i) { - if (questprogress(.@i) && questprogress(.@i) != 2) + if (questprogress(.@i) == 1) completequest .@i; } setquest 8068; @@ -8706,7 +8706,7 @@ hu_in01,14,11,4 script Laura 1_F_GYPSY,{ select("Yeah, yeah, whatever.", "Sure thing.", "I s-s-s-suppose...!", "Yes, Ma'am!"); hg_odin = 17; for(.@i = 11002; .@i <= 11005; ++.@i) { - if (questprogress(.@i) && questprogress(.@i) != 2) + if (questprogress(.@i) == 1) completequest .@i; } setquest 11006; diff --git a/npc/quests/quests_juperos.txt b/npc/quests/quests_juperos.txt index d43749b3e..558c80860 100644 --- a/npc/quests/quests_juperos.txt +++ b/npc/quests/quests_juperos.txt @@ -9,12 +9,13 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2012-2015 Hercules Dev Team +//= Copyright (C) 2012-2017 Hercules Dev Team //= Copyright (C) Euphy //= Copyright (C) Zephyrus //= Copyright (C) L0ne_W0lf //= Copyright (C) SinSloth //= Copyright (C) MasterOfMuppets +//= Copyright (C) Capuche //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -33,11 +34,11 @@ //================= Description =========================================== //= Juperos Ruins related Quests/Events //================= Current Version ======================================= -//= 1.9 +//= 2.0 //========================================================================= yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ - switch(yuno_hist) { + switch (yuno_book) { case 0: mes "[Scholar]"; mes "...Mm? "; @@ -155,7 +156,8 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ mes "service of his royal majesty,"; mes "the wise and benevolent"; mes "King Tristram III."; - yuno_hist = 2; + yuno_book = 2; + setquest(11017); next; mes "[Fayruz]"; mes "Well, "+strcharinfo(PC_NAME)+","; @@ -258,7 +260,8 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ mes "''You will see him, the one"; mes "who was vain and extravagant,"; mes "with your own eyes at the place where the light passes through."; - yuno_hist = 4; + yuno_book = 4; + changequest(11018, 11019); next; mes "[Fayruz]"; mes "Ah, usually, descriptions"; @@ -387,7 +390,7 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ next; switch(select("Take a look at this.", "Oh, I'm sorry...")) { case 1: - switch(jupe_hist) { + switch (jupe_book) { case 1: callfunc "Func_JupHist",7353,7354,7355,7352; case 2: callfunc "Func_JupHist",7352,7354,7355,7353; case 4: callfunc "Func_JupHist",7352,7353,7355,7354; @@ -419,7 +422,7 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ mes "last time is really helping me"; mes "in my research. If you get the"; mes "chance, please bring me more!"; - yuno_hist = 7; + yuno_book = 7; next; mes "[Fayruz]"; mes "This new data is adding"; @@ -438,7 +441,7 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ next; switch(select("Yeah, take a look at this.", "No, I'm sorry...")) { case 1: - switch(jupe_hist) { + switch (jupe_book) { case 3: callfunc "Func_JupHist",7354,7355,7352,7353; case 5: callfunc "Func_JupHist",7353,7355,7352,7354; case 6: callfunc "Func_JupHist",7352,7355,7353,7354; @@ -470,7 +473,7 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ mes "Alright. Okay. Yes."; mes "Yes! Of course, how"; mes "could I not see it before!"; - yuno_hist = 9; + yuno_book = 9; next; mes "[Fayruz]"; mes "I'll be with you"; @@ -487,7 +490,7 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ next; switch(select("Actually, I did find this...", "I'm sorry, I haven't...")) { case 1: - switch(jupe_hist) { + switch (jupe_book) { case 7: callfunc "Func_JupHist",7355,7352,7353,7354; case 11: callfunc "Func_JupHist",7354,7352,7353,7355; case 13: callfunc "Func_JupHist",7353,7352,7354,7355; @@ -564,7 +567,7 @@ yuno_in04,190,125,4 script Scholar 8_F_GIRL,{ } function script Func_JupHist { - switch(yuno_hist) { + switch (yuno_book) { case 4: mes "[Fayruz]"; mes "Thank you so much,"; @@ -588,8 +591,9 @@ function script Func_JupHist { mes "and you awaken from the trance,"; mes "gently brought back to reality.^000000"; delitem getarg(0),1; - yuno_hist = 5; - jupe_hist = getarg(1); + yuno_book = 5; + jupe_book = getarg(1); + changequest(11019, 11020); getexp RENEWAL_EXP?10000:100000,0; next; mes "[Fayruz]"; @@ -652,20 +656,21 @@ function script Func_JupHist { mes "mankind that can't be ignored."; if (countitem(getarg(0))) { delitem getarg(0),1; - if (getarg(0) == 7352) jupe_hist += 1; - else jupe_hist += 2; + if (getarg(0) == 7352) jupe_book += 1; + else jupe_book += 2; } else if (countitem(getarg(1))) { delitem getarg(1),1; - if (getarg(1) == 7353) jupe_hist += 2; - else jupe_hist += 4; + if (getarg(1) == 7353) jupe_book += 2; + else jupe_book += 4; } else { delitem getarg(2),1; - if (getarg(2) == 7354) jupe_hist += 4; - else jupe_hist += 8; + if (getarg(2) == 7354) jupe_book += 4; + else jupe_book += 8; } - yuno_hist = 6; + yuno_book = 6; + changequest(11020, 11021); getexp RENEWAL_EXP?10000:100000,0; next; mes "[Fayruz]"; @@ -779,17 +784,18 @@ function script Func_JupHist { mes "like the strange and grotesque."; if (countitem(getarg(0))) { delitem getarg(0),1; - if (getarg(0) == 7352) jupe_hist += 1; - else if (getarg(0) == 7353) jupe_hist += 2; - else jupe_hist += 4; + if (getarg(0) == 7352) jupe_book += 1; + else if (getarg(0) == 7353) jupe_book += 2; + else jupe_book += 4; } else if (countitem(getarg(1))) { delitem getarg(1),1; - if (getarg(1) == 7353) jupe_hist += 2; - else if (getarg(1) == 7354) jupe_hist += 4; - else jupe_hist += 8; + if (getarg(1) == 7353) jupe_book += 2; + else if (getarg(1) == 7354) jupe_book += 4; + else jupe_book += 8; } - yuno_hist = 8; + yuno_book = 8; + changequest(11021, 11022); getexp RENEWAL_EXP?10000:100000,0; next; mes "[Fayruz]"; @@ -881,12 +887,13 @@ function script Func_JupHist { mes "feeling of indefatigable"; mes "hope and inspiration..."; mes "You can make it if you try!^000000"; - if (getarg(0) == 7352) jupe_hist += 1; - else if (getarg(0) == 7353) jupe_hist += 2; - else if (getarg(0) == 7354) jupe_hist += 4; - else jupe_hist += 8; - yuno_hist = 10; - delitem getarg(0),1; + delitem(getarg(0), 1); + if (getarg(0) == 7352) jupe_book += 1; + else if (getarg(0) == 7353) jupe_book += 2; + else if (getarg(0) == 7354) jupe_book += 4; + else jupe_book += 8; + yuno_book = 10; + completequest(11022); getexp RENEWAL_EXP?10000:100000,0; next; mes "[Fayruz]"; @@ -941,7 +948,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ next; switch(select("Table of Contents.", "Leave it alone.")) { case 1: - if (yuno_hist > 4) { + if (yuno_book > 4) { mes "^8B6914 1. Preface"; mes " 2. Juperos Background"; mes " 3. Theory Behind Its Fall^000000"; @@ -954,7 +961,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ mes "ground, but it is now buried"; mes "beneath the El Mes Plateau."; mes "The reasons for the city's"; - if (yuno_hist < 9) { + if (yuno_book < 9) { mes "ruin are still nebulous...^000000"; next; mes "^8B6914There is much speculation"; @@ -971,7 +978,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ mes "may be able to learn much"; mes "from that ancient city's ruins."; mes "..................^000000"; - if (yuno_hist < 7) { + if (yuno_book < 7) { next; mes "["+strcharinfo(PC_NAME)+"]"; mes "Hmmm..."; @@ -991,7 +998,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ mes "us to make a few conclusions.^000000"; close; case 2: - if (yuno_hist < 9) { + if (yuno_book < 9) { mes "^8B6914..."; mes "......"; mes "..........^000000"; @@ -1003,7 +1010,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ mes "yet to be a real thesis..."; close; } - else if (yuno_hist == 9) { + else if (yuno_book == 9) { mes "^8B6914Juperos was built over"; mes "a thousand years ago in"; mes "an era of peace just after"; @@ -1041,7 +1048,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ mes "life. Science was reponsible for Juperos's rise and downfall."; close; case 3: - if (yuno_hist < 10) { + if (yuno_book < 10) { mes "^8B6914..."; mes "......"; mes "..........^000000"; @@ -1146,7 +1153,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ mes "may be able to learn much"; mes "from that ancient city's ruins."; mes "..................^000000"; - if (!yuno_hist) yuno_hist = 1; + if (!yuno_book) yuno_book = 1; next; mes "["+strcharinfo(PC_NAME)+"]"; mes "This..."; @@ -1165,26 +1172,26 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ close; } case 2: - if (yuno_hist < 5) { + if (yuno_book < 5) { mes "["+strcharinfo(PC_NAME)+"]"; mes "Nah..."; mes "I'm tired of reading."; mes "Ironically enough."; close; } - else if (yuno_hist < 7) { + else if (yuno_book < 7) { mes "["+strcharinfo(PC_NAME)+"]"; mes "I don't feel like"; mes "reading this. Not"; mes "enough pictures..."; close; } - else if (yuno_hist < 9) { + else if (yuno_book < 9) { mes "["+strcharinfo(PC_NAME)+"]"; mes "It looks very sophisticated..."; close; } - else if (yuno_hist < 10) { + else if (yuno_book < 10) { mes "["+strcharinfo(PC_NAME)+"]"; mes "I know this book..."; mes "But I don't feel like"; @@ -1203,7 +1210,7 @@ yuno_in04,186,125,4 script Bundle of Files HIDDEN_NPC,{ } yuno_in04,188,118,4 script Book#juperos HIDDEN_NPC,{ - if (yuno_hist > 7) { + if (yuno_book > 7) { mes "^8B6914*Self-Honesty*"; mes "*'Benefits Fo' Life!'*"; mes "By Stephen Oyoung"; @@ -1262,7 +1269,7 @@ yuno_in04,188,118,4 script Book#juperos HIDDEN_NPC,{ //- Bronze Statue - juperos_01 99 112 juperos_01,99,112,4 script Bronze Statue#1 CLEAR_NPC,{ - if (yuno_hist > 3) { + if (yuno_book > 3) { mes "^3355FF''Do you wish to see"; mes "the end of the madness?"; mes "He is waiting where the three"; @@ -1270,7 +1277,7 @@ juperos_01,99,112,4 script Bronze Statue#1 CLEAR_NPC,{ mes "two hundred illusions wander.''^000000"; close; } - else if (yuno_hist == 3) { + else if (yuno_book == 3) { mes "["+strcharinfo(PC_NAME)+"]"; mes "I better go and"; mes "see Fayruz in the"; @@ -1300,14 +1307,15 @@ juperos_01,99,112,4 script Bronze Statue#1 CLEAR_NPC,{ mes "I am. I know what sounds"; mes "all of these letters make..."; next; - if (yuno_hist == 2) { + if (yuno_book == 2) { mes "["+strcharinfo(PC_NAME)+"]"; mes "Then again, Fayruz did"; mes "say this was enchanted."; mes "Okay, I guess I'll go back"; mes "to the Juno Library and"; mes "tell her what I found."; - yuno_hist = 3; + yuno_book = 3; + changequest(11017, 11018); close; } mes "["+strcharinfo(PC_NAME)+"]"; @@ -1535,7 +1543,7 @@ yuno_in04,118,116,4 script Paper HIDDEN_NPC,{ next; switch(select("Read it.", "Leave it alone.")) { case 1: - if (yuno_hist > 7) { + if (yuno_book > 7) { mes "^8B6914P.S."; mes "Please..."; mes "Come back to me."; @@ -1582,7 +1590,7 @@ yuno_in04,118,116,4 script Paper HIDDEN_NPC,{ } juperos_01,123,92,4 script Stone Statue CLEAR_NPC,{ - if (yuno_hist) { + if (yuno_book) { mes "^3355FFIt's a stone statue"; mes "that looks exactly like"; mes "the one in the Juno Library."; diff --git a/npc/quests/quests_lighthalzen.txt b/npc/quests/quests_lighthalzen.txt index 0a80c25ae..66cfb0e73 100644 --- a/npc/quests/quests_lighthalzen.txt +++ b/npc/quests/quests_lighthalzen.txt @@ -8503,7 +8503,7 @@ L_Mission: mes "........."; mes "............"; for (.@i = 12015; .@i <= 12028; ++.@i) { - if (questprogress(.@i) && questprogress(.@i) != 2) + if (questprogress(.@i) == 1) completequest .@i; } close; diff --git a/npc/quests/quests_louyang.txt b/npc/quests/quests_louyang.txt index 40fd7b38e..e05cd3313 100644 --- a/npc/quests/quests_louyang.txt +++ b/npc/quests/quests_louyang.txt @@ -2123,7 +2123,7 @@ lou_in02,156,38,0 script Studying Officer#lou 4_M_CHNMAN,{ mes "so I was able to find it again pretty easily. I hope it's useful to you."; ch_par = 15; for (.@i = 11051; .@i <= 11054; ++.@i) { - if (questprogress(.@i) && questprogress(.@i) != 2) + if (questprogress(.@i) == 1) completequest .@i; } setquest 11055; diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt index 4a9ab322b..c722f2677 100644 --- a/npc/quests/quests_moscovia.txt +++ b/npc/quests/quests_moscovia.txt @@ -9,7 +9,7 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2012-2015 Hercules Dev Team +//= Copyright (C) 2012-2017 Hercules Dev Team //= Copyright (C) Lemongrass //= Copyright (C) Euphy //= Copyright (C) Joseph @@ -17,6 +17,7 @@ //= Copyright (C) Gepard //= Copyright (C) brianluau //= Copyright (C) Kisuka +//= Copyright (C) Asheraf //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -43,7 +44,7 @@ //= The Moving Island, Help Mikhail, Acorn Exchange, Banish Winter, Shafka //= Hat, Koshei the Immortal. //================= Current Version ======================================= -//= 2.3 +//= 2.4 //========================================================================= //== The Moving Island :: mos_whale_edq ==================== @@ -65,6 +66,7 @@ moscovia,171,71,3 script Berbayeff#npc 4_M_RUSMAN2,{ mes "seen many marvelous things"; mes "from near and far."; next; + setquest(18100); mes "[Berbayeff]"; mes "I'm sure you'll probably"; mes "be interested in my story."; @@ -189,6 +191,7 @@ moscovia,171,71,3 script Berbayeff#npc 4_M_RUSMAN2,{ mes "I'll definitely go up to that"; mes "island... and verify it with my own eyes!"; mos_whale_edq = 1; + changequest(18100, 18101); close; } else if (mos_whale_edq == 1) { .@speak = rand(1,5); @@ -235,6 +238,7 @@ moscovia,171,71,3 script Berbayeff#npc 4_M_RUSMAN2,{ mes "If you want to find the island"; mes "by ship, go to Mr. Ibanoff"; mes "and ask for a favor."; + changequest(18101, 18102); close; } else if (mos_whale_edq > 12 && mos_whale_edq < 42) { emotion e_omg; @@ -298,6 +302,8 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ mes "What's up?"; next; if(select("Tell me an adventure story.", "Lend me your ship.") == 1) { + completequest(18101, 18102); + setquest(18103); mes "[Mr. Ibanoff]"; mes "You are an adventurer, right?"; mes "You come from a strange land?"; @@ -399,6 +405,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ mes "If you ever need anything,"; mes "come talk to me whenever, hahaha!"; mos_whale_edq = 2; + changequest(18103, 18104); close; } if (mos_whale_edq == 2) { @@ -452,6 +459,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ mes "materials, bring them to me. I'll"; mes "repair the ship."; mos_whale_edq = 3; + changequest(18104, 18105); close; } emotion e_ag; @@ -483,6 +491,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ delitem Tube,5; delitem Jubilee,10; mos_whale_edq = 4; + changequest(18105, 18106); mes "[Mr. Ibanoff]"; mes "Okay, we are at the ready."; mes "When would you like to depart?"; @@ -603,6 +612,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ mes "back to the island, I want to go"; mes "together with you! Eh? Hahaha!"; mos_whale_edq = 16; + changequest(18111, 18112); close; } else if (mos_whale_edq < 18) { mes "[Mr. Ibanoff]"; @@ -640,6 +650,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ mes "[Mr. Ibanoff]"; mes "Again, let's get the ship ready and sail before the sun sets!"; mos_whale_edq = 19; + changequest(18113, 18114); close; } mes "[Mr. Ibanoff]"; @@ -676,6 +687,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{ mes "been, it's very good to see you"; mes "again."; mos_whale_edq = 19; + changequest(18113, 18114); next; mes "[Mr. Ibanoff]"; mes "I can guess you'd like to go to"; @@ -821,6 +833,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{ mes "At first, hold the rudder to go"; mes "forward, to the east."; mos_whale_edq = 5; + changequest(18106, 18107); close; } else if (mos_whale_edq == 5) { mes "[Mr. Ibanoff]"; @@ -874,6 +887,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{ mes "Go around the deck to look more"; mes "carefully! Go!"; mos_whale_edq = 12; + changequest(18107, 18108); donpcevent "#findship::OnEnable"; close; } else if (mos_whale_edq == 12) { @@ -904,6 +918,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{ mes "At first, hold the rudder to go"; mes "forward, to the east."; mos_whale_edq = 20; + changequest(18114, 18115); close; } else if (mos_whale_edq == 20) { mes "[Mr. Ibanoff]"; @@ -921,6 +936,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{ mes "There is a moving island!"; mes "We have done well!"; next; + changequest(18115, 18116); mes "[Mr. Ibanoff]"; mes "Oh...my..."; mes "It really is there..."; @@ -1230,6 +1246,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "the back of a gigantic whale!"; mes "That's why I call it Whale Island!"; next; + changequest(18109, 18110); mes "["+strcharinfo(PC_NAME)+"]"; mes "How...? How is it possible"; mes "that the water flows in streams"; @@ -1269,6 +1286,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ next; callsub S_AS_3; mos_whale_edq = 14; + changequest(18110, 18111); close2; sleep2 20000; mos_whale_edq = 15; @@ -1411,6 +1429,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "I'll send you back to the"; mes "mainland."; mos_whale_edq = 31; + changequest(18116, 18117); close; } else if (mos_whale_edq == 31) { mes "[Aged Stranger]"; @@ -1449,6 +1468,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ delitem Goats_Horn,20; delitem Sea_Otter_Leather,10; mos_whale_edq = 34; + changequest(18117, 18118); mes "[Aged Stranger]"; mes "Wait for a moment until I make the"; mes "instrument successfully."; @@ -1495,6 +1515,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "the ancestors of Moscovia."; getitem GUSLI, 1; mos_whale_edq = 35; + changequest(18118, 18119); next; mes "[Aged Stranger]"; mes "I am the last person who has"; @@ -1696,6 +1717,7 @@ S_AS_1: mes "With your ability to play, surely"; mes "you can win the admiration of all."; mos_whale_edq = 38; + changequest(18119, 18120); close; } mes "[Aged Stranger]"; @@ -1891,6 +1913,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ mes "banishing winter with magic,"; mes "announce that to me immediately."; mos_nowinter = 14; + changequest(18076, 18077); close; } } @@ -1934,6 +1957,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ mes "If you do that, I will arrest you immediately!"; mes "So take care of yourself."; mos_nowinter = 14; + changequest(18076, 18077); close; } mes "[Csar Alexsay III]"; @@ -2004,6 +2028,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ mes "I give it as an atonement"; mes "to make my people happy."; mos_nowinter = 21; + completequest(18079); getitem Old_Blue_Box,1; next; mes "[Csar Alexsay III]"; @@ -2111,6 +2136,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ mes "You have a heavy responsibility."; mes "Bring evidence of this whale island to me, to provide me with some relief. Now go."; mos_whale_edq = 18; + changequest(18112, 18113); close; } else if (mos_whale_edq > 17 && mos_whale_edq < 35) { mes "[Csar Alexsay III]"; @@ -2307,6 +2333,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ getitem Old_Violet_Box,1; getexp RENEWAL_EXP?100000:1200000,0; mos_whale_edq = 41; + completequest(18120); close; } mes "[Csar Alexsay III]"; @@ -2558,6 +2585,7 @@ OnTouch: mes "Watch out! "+strcharinfo(PC_NAME)+"!"; mes "Ah... That... That is... What..."; mos_whale_edq = 13; + changequest(18108, 18109); close2; warp "mosk_fild01",95,93; end; @@ -2697,6 +2725,7 @@ function script F_MOS_1 { mes "Mikhail is such a timid boy. I guess he didn't leave this village."; mes "Please bring him to me, then~"; mos_swan = 1; + setquest(18060); close; } @@ -2751,6 +2780,7 @@ mosk_in,144,279,5 script Gallina#mos 4_F_RUSWOMAN1,{ mes "Well, now I have to get to work!"; mes "I'll make you my hotcakes someday. Please visit me later"; mos_swan = 100; + completequest(18069); getexp RENEWAL_EXP?90000:1000000,0; close; } @@ -2863,7 +2893,10 @@ mosk_in,148,274,1 script Anna#mos 4_F_RUSCHILD,{ next; mes "["+strcharinfo(PC_NAME)+"]"; mes "It's the only clue, I guess I'll go to ^3131FFInn 'Sticky Herb Tree'^000000?"; - if (mos_swan == 2) mos_swan = 3; + if (mos_swan == 2) { + mos_swan = 3; + changequest(18060, 18061); + } next; break; case 4: @@ -3084,6 +3117,7 @@ mosk_in,205,268,3 script Fire pot#mos HIDDEN_NPC,{ mes "- I need to know what's required for the paste."; mes "I'll ask that guy ^3131FFMr. Victor^000000 about them. -"; mos_swan = 12; + changequest(18064, 18065); close; break; case 2: @@ -3139,6 +3173,7 @@ mosk_in,205,268,3 script Fire pot#mos HIDDEN_NPC,{ mes "Now I'm gonna give this back to Mom."; donpcevent "Mikhail#mos::OnInit"; mos_swan = 25; + changequest(18068, 18069); delitem High_Strength_Adhesive,1; close; } @@ -3302,6 +3337,7 @@ mosk_in,135,191,5 script Landlord#mos 4_F_RUSWOMAN3,{ mes "I was unkind to make you stay here but wasn't it easier for you? hoho."; mes "When it gets dark, promise me to come here again. Hoho"; mos_swan = 7; + changequest(18061, 18062); close; break; case 3: @@ -3380,6 +3416,7 @@ mosk_in,141,212,3 script Pub Owner#mos 4_M_RUSBALD,{ mes "[Pub Owner]"; mes "You're welcome."; mos_swan = 8; + changequest(18062, 18063); close; } mes "[Pub Owner]"; @@ -3596,6 +3633,7 @@ mosk_in,147,202,3 script Victor#mos 4_M_RUSMAN2,{ mes "[Victor]"; mes "He might've just hidden himself somewhere, haha!"; mos_swan = 10; + changequest(18062, 18063); close; } else if (mos_swan == 10 || mos_swan == 11) { mes "[Victor]"; @@ -3633,6 +3671,7 @@ mosk_in,147,202,3 script Victor#mos 4_M_RUSMAN2,{ mes "[Victor]"; mes "You should bring ^3131FF'10 sticky herbs'^000000 and ^3131FF 1 medicine bowl^000000 to me."; mos_swan = 13; + changequest(18065, 18066); close; } else if (mos_swan > 12 && mos_swan < 23) { mes "[Victor]"; @@ -3664,6 +3703,7 @@ mosk_in,147,202,3 script Victor#mos 4_M_RUSMAN2,{ delitem Sticky_Herb,10; delitem Medicine_Bowl,1; mos_swan = 24; + changequest(18067, 18068); getitem High_Strength_Adhesive,1; close; } @@ -3730,6 +3770,7 @@ mosk_dun03,153,90,3 script Bubbling Swamp#mos1 CLEAR_NPC,{ mes "["+strcharinfo(PC_NAME)+"]"; mes "I don't see any traces of Mikhail. I think I should go back and check his house one more time."; mos_swan = 11; + changequest(18063, 18064); close; } else if (mos_swan == 11 && mos_swan == 12) { mes "- You can see a small muddy swamp -"; @@ -3748,6 +3789,7 @@ mosk_dun03,153,90,3 script Bubbling Swamp#mos1 CLEAR_NPC,{ if (mos_swan == 22) { getitem Sticky_Herb,1; mos_swan = 23; + changequest(18066, 18067); close; } getitem Sticky_Herb,1; @@ -4461,6 +4503,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{ mes "a 1, 2, or 3 carat"; mes "^ff00001 Diamond^000000."; mos_nowinter = 6; + changequest(18070, 18071); next; } else { mes "[Baba Yaga, the Horrible]"; @@ -4481,6 +4524,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{ mes "a 1, 2, or 3 carat"; mes "^ff0000Diamond^000000."; mos_nowinter = 7; + changequest(18070, 18072); next; } mes "[Baba Yaga, the Horrible]"; @@ -4541,6 +4585,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{ mes "contain people's speech."; mes "I must have this."; next; + changequest(18071, 18073); mes "[Baba Yaga, the Horrible]"; mes "I don't know how strong you are,"; mes "but I would like to recommend that"; @@ -4742,6 +4787,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{ mes "[Baba Yaga, the Horrible]"; mes "Take care of yourself, cough, cough."; mos_nowinter = 10; + changequest(18074, 18075); close; } mes "[Baba Yaga, the Horrible]"; @@ -4888,8 +4934,9 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{ mes "If you do this, what the villagers want"; mes "will be happening,"; mes "forever."; - getitem Yaga_Secret_Medicine,1; mos_nowinter = 19; + changequest(18077, 18078); + getitem(Yaga_Secret_Medicine, 1); close; } else if (mos_nowinter == 19) { mes "[Baba Yaga, the Horrible]"; @@ -4935,6 +4982,7 @@ S_BY_1: mes "where it is."; mes "Could you please come back later?"; mos_nowinter = 5; + setquest(18070); close; } @@ -5472,6 +5520,7 @@ moscovia,224,190,0 script #nowinterplz CLEAR_NPC,{ delitem Yaga_Secret_Medicine,1; specialeffect EF_BARRIER; mos_nowinter = 20; + changequest(18078, 18079); next; mes "-You feel like your"; mes "body is heating up."; @@ -6166,7 +6215,10 @@ moscovia,196,71,3 script A Young Man#mos14 4_M_RUSMAN2,{ mes "I hope that winter never comes."; mes "It is my dream."; mos_middle = 1; - if (mos_kid == 1 && mos_elder == 1) mos_nowinter = 11; + if (mos_kid == 1 && mos_elder == 1) { + mos_nowinter = 11; + changequest(18075, 18076); + } close; } mes "[Fredek]"; @@ -6217,7 +6269,10 @@ moscovia,234,168,5 script A Man#mos15 4_M_RUSBALD,{ mes "But, design of coldness is"; mes "winter itself, isn't it?"; mos_elder = 1; - if (mos_kid == 1 && mos_middle == 1) mos_nowinter = 11; + if (mos_kid == 1 && mos_middle == 1) { + mos_nowinter = 11; + changequest(18075, 18076); + } close; } mes "[Gavrel]"; @@ -6267,7 +6322,10 @@ moscovia,228,80,3 script A Little Boy#mos16 4_M_RUSCHILD,{ mes "Do you think"; mes "the winter should come again?"; mos_kid = 1; - if (mos_middle == 1 && mos_elder == 1) mos_nowinter = 11; + if (mos_middle == 1 && mos_elder == 1) { + mos_nowinter = 11; + changequest(18075, 18076); + } close; } mes "[Rurik]"; @@ -6329,6 +6387,7 @@ OnTouch: mes "Here it is."; mes "That was easy to find."; mos_nowinter = 9; + changequest(18073, 18074); getitem Magic_Gourd_Bottle,1; close; } @@ -6337,6 +6396,7 @@ OnTouch: mes "Ah, I got it!"; mes "I better get out of here quickly."; mos_nowinter = 9; + changequest(18073, 18074); getitem Magic_Gourd_Bottle,1; close; } @@ -6503,6 +6563,7 @@ moscovia,211,93,3 script Irina#edq 4_F_RUSCHILD,{ mes "Shafka still keeps you warm!"; close; } + setquest(18121); mes "[Irina]"; mes "Do you want to make a Shafka hat?"; mes "Heheh. Good idea!"; @@ -6525,6 +6586,7 @@ moscovia,211,93,3 script Irina#edq 4_F_RUSCHILD,{ delitem Sea_Otter_Leather,20; delitem Spool,1; getitem Chullos,1; + completequest(18121); mes "[Irina]"; mes "Good, I made it. So, how about it?"; mes "Do you like it?"; @@ -6770,6 +6832,7 @@ mosk_dun01,167,160,3 script Gray Wolf#rus03 4_RUS_DWOLF,{ mes "I'm warning you again!"; mes "Unless you want to be killed, leave now."; rhea_rus_main = 3; + setquest(8136); emotion e_omg,1; specialeffect2 EF_HIT2; percentheal -50,0; @@ -6918,6 +6981,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{ mes "Please don't forget about me."; donpcevent "Gray Wolf#rus05::OnDisable"; rhea_rus_main = 6; + changequest(8136, 8137); close; } else if (rhea_rus_main > 5 && rhea_rus_main < 8) { mes "[Girl's Voice]"; @@ -7084,6 +7148,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{ mes "Stop! Where do you think you're going?!!!"; delitem Gold_Key,1; rhea_rus_main = 48; + changequest(8167, 8168); monster "mosk_dun01",45,256,"Koshei, the Immortal",1890,1,"Wall#rus04::OnMyMobDead"; donpcevent "Koshei#rus47::OnEnable"; close; @@ -7124,6 +7189,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{ mes "[Gray Wolf]"; mes "I can't keep her alive for much longer. You must find Baba Yaga."; rhea_rus_main = 49; + changequest(8168, 8169); close2; donpcevent "Gray Wolf#rus05::OnDisable"; end; @@ -7258,6 +7324,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{ mes "[Maria Morebna]"; mes "It's been a long time since I've felt the sunlight, fresh wind and the scent of grass. I'm so grateful."; rhea_rus_main = 52; + completequest(8171); .@rus_food = rand(1,6); switch (rand(1,6)) { case 1: getitem Dex_Dish08,1; break; @@ -7475,6 +7542,7 @@ moscovia,178,127,0 script The Blacksmith#rus06 1_M_SMITH,{ mes "Bahahaha~"; mes "I promise you, I'll explain when you bring the ^0000ff25 Steel^000000 to me. Please just get the Steel and come back."; rhea_rus_main = 7; + changequest(8137, 8138); close; } else if (rhea_rus_main == 7) { if (countitem(Steel) > 24) { @@ -7524,6 +7592,8 @@ moscovia,178,127,0 script The Blacksmith#rus06 1_M_SMITH,{ mes "And don't forget to wear these!"; delitem Steel,25; rhea_rus_main = 8; + // if (BaseClass != Job_Thief) + changequest(8138, 8139); if (BaseClass == Job_Merchant || BaseClass == Job_Swordman || BaseClass == Job_Thief || BaseClass == Job_Archer) getitem Iron_Boots01,1; else getitem Iron_Boots02,1; close; } mes "[The Blacksmith]"; @@ -7585,6 +7655,7 @@ moscovia,178,127,0 script The Blacksmith#rus06 1_M_SMITH,{ mes "Ah and you shouldn't be needing those Steel Boots anymore. Good luck!"; if (countitem(Iron_Boots01)) delitem Iron_Boots01,1; else delitem Iron_Boots02,1; rhea_rus_main = 9; + changequest(8139, 8154); close; } mes "[The Blacksmith]"; @@ -7753,6 +7824,7 @@ moscovia,206,81,0 script Vassili Grandpapa#rus07 4_M_05,{ mes "[Vassili Grandpapa]"; mes "She disappeared soon... after Now all I have is Ryubaba. She is also pretty and smart but nothing can relieve the sadnesss in my heart from losing Mashenka..."; rhea_rus_ring = 1; + setquest(8140); close; } else if (rhea_rus_ring && rhea_rus_ring < 8) { mes "[Vassili Grandpapa]"; @@ -7879,6 +7951,7 @@ moscovia,206,81,0 script Vassili Grandpapa#rus07 4_M_05,{ mes "...It is my fault that this tragedy between my daughters happened. I will spend the rest of my life trying to make up for it..."; delitem Pointed_Wooden_Flute,1; rhea_rus_ring = 10; + completequest(8144); getitem Red_Ring,1; if (RENEWAL_EXP) { if (BaseLevel < 56) getexp 470,0; @@ -8073,6 +8146,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{ mes "[Ryubaba]"; mes "Right... Let me finish talking. We tried searching for her but we couldn't find her. She must have been wearing the ring when she disappeared around the marsh."; rhea_rus_ring = 5; + changequest(8140, 8141); close; } else if (rhea_rus_ring > 4 && rhea_rus_ring < 7) { mes "[Ryubaba]"; @@ -8184,6 +8258,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{ mes "[Ryubaba]"; mes "W, wait!!!"; rhea_rus_ring = 8; + changequest(8143, 8144); close2; warp "moscovia",203,80; end; @@ -8195,6 +8270,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{ mes "I have to repent for my sins and atone for them for the rest of my life."; delitem Pointed_Wooden_Flute,1; rhea_rus_ring = 9; + completequest(8143); getitem Red_Ring,1; if (RENEWAL_EXP) { if (BaseLevel < 56) getexp 470,0; @@ -8367,6 +8443,7 @@ mosk_fild02,157,233,0 script Shepherdess#rus10 1_F_04,{ mes "[Shepherdess]"; mes "I am an excellent flute player! If you get me enough Pointed Branches, I will make a flute from them and play beautiful music for you. Please~!"; rhea_rus_ring = 6; + changequest(8141, 8142); close; } else if (rhea_rus_ring == 6) { if (countitem(Pointed_Branch) > 24) { @@ -8421,6 +8498,7 @@ mosk_fild02,157,233,0 script Shepherdess#rus10 1_F_04,{ mes "- ^0000ff'Pointed Wooden Flute'!!^000000 -"; delitem Pointed_Branch,25; rhea_rus_ring = 7; + changequest(8142, 8143); getitem Pointed_Wooden_Flute,1; close; } @@ -8544,6 +8622,7 @@ moscovia,166,145,1 script Worried Mother#rus19 4_F_RUSWOMAN3,{ mes "[Worried Mother]"; mes "Please, please find my daughter."; rhea_rus_hair = 1; + setquest(8145); close; } else if (rhea_rus_hair == 1) { mes "[Worried Mother]"; @@ -8567,6 +8646,7 @@ moscovia,166,145,1 script Worried Mother#rus19 4_F_RUSWOMAN3,{ mes "[Worried Mother]"; mes "I'm not sure where she would be but it has to be somewhere near water. Please, find where my daughter is. I beg of you."; rhea_rus_hair = 2; + changequest(8145, 8146); close; } else if (rhea_rus_hair > 1 && rhea_rus_hair < 9) { mes "[Worried Mother]"; @@ -8781,6 +8861,7 @@ mosk_fild02,124,202,3 script Lusalka#rus23 4_F_RUSGREEN,{ mes "- ^0000ffgolden earrings^000000 -"; mes "- ^0000fffrom Lusalka!^000000 -"; rhea_rus_hair = 3; + changequest(8146, 8147); donpcevent "Lusalka#rus23::OnDisable"; close; } else if (rhea_rus_hair > 2 && rhea_rus_hair < 7) { @@ -8861,6 +8942,7 @@ mosk_fild02,124,202,3 script Lusalka#rus23 4_F_RUSGREEN,{ mes "W, who are you!? Ahkkk!!"; sc_start SC_BLIND,10000,0; rhea_rus_hair = 8; + completequest(8150); donpcevent "Lusalka#rus23::OnDisable"; close; } else if (rhea_rus_hair > 7) { @@ -8992,6 +9074,7 @@ prontera,228,279,3 script Wanderer#rus24 4_M_RUSMAN2,{ mes "me that he wanted"; mes "to travel to a desert."; rhea_rus_hair = 4; + changequest(8147, 8148); close; } else if (rhea_rus_hair > 3 && rhea_rus_hair < 7) { mes "[A Wanderer from a strange land]"; @@ -9070,6 +9153,7 @@ morocc,165,82,0 script Morroc Villager#rus25 1_M_02,{ mes "[Morroc Villager]"; mes "Yep that's gotta be who you're looking for. I can see his gloomy face right now... that poor sad man."; rhea_rus_hair = 5; + changequest(8148, 8149); close; } else if (rhea_rus_hair > 4 && rhea_rus_hair < 7) { mes "[Morroc Villager]"; @@ -9208,6 +9292,7 @@ moc_pryd04,126,120,0 script Soldier#rus26 4_M_RUSMAN1,{ mes "[A gloomy looking soldier]"; mes "Before the full moon, I will be back to Moscovia and meet her. I will come back so strong and happy that when I go to see her she will not suffer anymore."; rhea_rus_hair = 7; + changequest(8149, 8150); close; } else if (rhea_rus_hair == 7) { mes "[A gloomy looking soldier]"; @@ -9292,6 +9377,7 @@ OnTouch: mes "[Voice unidentified]"; mes "Show me what you can do."; rhea_rus_quiz = 1; + setquest(8151); close; } } @@ -9489,6 +9575,7 @@ mosk_fild02,243,270,0 script Marozka#rus31 4_M_LGTGRAND,{ mes "[Marozka]"; mes "That was a test of your strength. Now you must pass the test of mind and wisdom."; rhea_rus_quiz = 29; + changequest(8152, 8153); close; } else if (rhea_rus_quiz == 29) { if (getequipid(EQI_SHOES) != 2429) { @@ -9556,6 +9643,7 @@ mosk_fild02,243,270,0 script Marozka#rus31 4_M_LGTGRAND,{ mes "[Marozka]"; mes "I hope you help Maria with your strength and kindness."; rhea_rus_quiz = 30; + completequest(8153); getitem Golden_Thread,10; close; } @@ -9687,6 +9775,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe."; rhea_rus_main = 11; + changequest(8154, 8155); close; } else if (BaseClass == Job_Acolyte) { mes "[Baba Yaga]"; @@ -9695,6 +9784,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe."; rhea_rus_main = 16; + changequest(8154, 8157); close; } else if (BaseClass == Job_Thief) { mes "[Baba Yaga]"; @@ -9703,6 +9793,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe."; rhea_rus_main = 21; + changequest(8154, 8159); close; } else if (BaseClass == Job_Mage) { mes "[Baba Yaga]"; @@ -9711,6 +9802,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe."; rhea_rus_main = 26; + changequest(8154, 8161); close; } else if (BaseClass == Job_Swordman) { mes "[Baba Yaga]"; @@ -9719,6 +9811,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe."; rhea_rus_main = 31; + changequest(8154, 8163); close; } mes "[Baba Yaga]"; @@ -9727,6 +9820,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe."; rhea_rus_main = 36; + changequest(8154, 8165); close; } else if (rhea_rus_main > 10 && rhea_rus_main < 16) { mes "[Baba Yaga]"; @@ -9855,6 +9949,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe."; rhea_rus_main = 47; getitem Gold_Key,1; + changequest(8156, 8167); close; } else if (rhea_rus_main == 42) { mes "["+ strcharinfo(PC_NAME) +"]"; @@ -9869,6 +9964,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe."; rhea_rus_main = 47; + changequest(8158, 8167); getitem Gold_Key,1; close; } else if (rhea_rus_main == 43) { @@ -9886,6 +9982,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe."; delitem Babayaga_Silver_Spoon,1; rhea_rus_main = 47; + changequest(8160, 8167); getitem Gold_Key,1; close; } @@ -9911,6 +10008,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe."; rhea_rus_main = 47; + changequest(8162, 8167); getitem Gold_Key,1; close; } else if (rhea_rus_main == 45) { @@ -9926,6 +10024,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe."; rhea_rus_main = 47; + changequest(8164, 8167); getitem Gold_Key,1; close; } else if (rhea_rus_main == 46) { @@ -9941,6 +10040,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe."; rhea_rus_main = 47; + changequest(8166, 8167); getitem Gold_Key,1; close; } else if (rhea_rus_main > 46 && rhea_rus_main < 49) { @@ -9979,6 +10079,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "[Baba Yaga]"; mes "Bring them to me quickly! Time is running out!"; rhea_rus_main = 50; + changequest(8169, 8170); close; } else if (rhea_rus_main == 50) { if (countitem(Holy_Water) && countitem(Water_Of_Darkness) && countitem(Leaf_Of_Yggdrasil) > 1 && countitem(Leaflet_Of_Hinal) > 9) { @@ -10031,6 +10132,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ delitem Leaf_Of_Yggdrasil,2; delitem Leaflet_Of_Hinal,10; rhea_rus_main = 51; + changequest(8170, 8171); close; } mes "[Baba Yaga]"; @@ -10383,6 +10485,7 @@ OnTouch: mes "["+ strcharinfo(PC_NAME) +"]"; mes "Ok, then. Let's get back to Baba Yaga..."; rhea_rus_main = 41; + changequest(8155, 8156); close; } else if (rhea_rus_main == 41) { mes "[Cow]"; @@ -10482,6 +10585,7 @@ OnTouch: mes "["+ strcharinfo(PC_NAME) +"]"; mes "Ok, then. Let's get back to Baba Yaga..."; rhea_rus_main = 41; + changequest(8155, 8156); close; } else if (rhea_rus_main == 41) { mes "[Cow]"; @@ -10570,6 +10674,7 @@ OnTouch: mes "["+ strcharinfo(PC_NAME) +"]"; mes "Ok, then. Let's get back to Baba Yaga..."; rhea_rus_main = 41; + changequest(8155, 8156); close; } else if (rhea_rus_main == 41) { mes "[Cow]"; @@ -10764,6 +10869,7 @@ mosk_dun02,65,232,0 script Noisy Coffin#rus36 4_NFCOFFIN,{ mes "Hu, the job has been done."; mes "Let's get back to Baba Yaga."; rhea_rus_main = 42; + changequest(8157, 8158); close; } else if (rhea_rus_main == 20) { mes "["+ strcharinfo(PC_NAME) +"]"; @@ -10777,6 +10883,7 @@ mosk_dun02,65,232,0 script Noisy Coffin#rus36 4_NFCOFFIN,{ mes "Hu, the job has been done."; mes "Let's get back to Baba Yaga."; rhea_rus_main = 42; + changequest(8157, 8158); close; } else if (rhea_rus_main == 42) { mes "["+ strcharinfo(PC_NAME) +"]"; @@ -10835,6 +10942,7 @@ treasure01,165,58,0 script Old Treasure Box#rus37 HIDDEN_NPC,{ next; mes "- ^0000ff You find Baba Yaga's spoon !!^000000 -"; rhea_rus_main = 43; + changequest(8159, 8160); getitem Babayaga_Silver_Spoon,1; close; } else if (rhea_rus_main == 43) { @@ -11111,6 +11219,7 @@ amatsu,233,234,3 script Momotoro Publisher#rus42 4_F_JPN2,{ mes "Thank you for buying our books. If you need more books, contact us please."; Zeny -= 5000; rhea_rus_main = 27; + changequest(8161, 8162); getitem Book_Of_Magic,1; close; } else if (rhea_rus_main > 26 && rhea_rus_main < 31) { @@ -11381,6 +11490,7 @@ mosk_dun02,57,220,0 script House Ghost Jar#rus43 HIDDEN_NPC,{ mes "[House Ghost]"; mes "I will never forget your kindness of entertaining me."; rhea_rus_main = 45; + changequest(8163, 8164); close; } else if (rhea_rus_main == 45) { mes "[House Ghost]"; @@ -11756,6 +11866,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ next; mes "- ^0000ff You receive the best broom from Payon !!^000000 - "; rhea_rus_main = 46; + changequest(8165, 8166); close; } mes "[Ghost Tree]"; diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt index dd3750543..cf593eaae 100644 --- a/npc/quests/the_sign_quest.txt +++ b/npc/quests/the_sign_quest.txt @@ -12249,11 +12249,12 @@ OnInit: end; OnTouch: - geffenia_warp = rand(1,4); - if (geffenia_warp == 1) warp "gefenia01",58,169; - else if (geffenia_warp == 2) warp "gefenia02",116,115; - else if (geffenia_warp == 3) warp "gefenia03",130,206; - else if (geffenia_warp == 4) warp "gefenia04",133,88; + callfunc("F_UpdateSignVars"); + .@geffenia_warp = rand(1,4); + if (.@geffenia_warp == 1) warp "gefenia01",58,169; + else if (.@geffenia_warp == 2) warp "gefenia02",116,115; + else if (.@geffenia_warp == 3) warp "gefenia03",130,206; + else if (.@geffenia_warp == 4) warp "gefenia04",133,88; else warp "geffen",116,115; end; @@ -12644,6 +12645,7 @@ function script F_UpdateSignVars { Sign_Branch2B = 0; serinring = 0; signmetzhour = 0; + geffenia_warp = 0; } return; } diff --git a/npc/re/instances/BakonawaLake.txt b/npc/re/instances/BakonawaLake.txt index 5e2ae7f33..2868cc589 100644 --- a/npc/re/instances/BakonawaLake.txt +++ b/npc/re/instances/BakonawaLake.txt @@ -33,8 +33,6 @@ //= 1.1 //========================================================================= -1@ma_b mapflag src4instance - ma_scene01,174,179,4 script Taho 4_M_DEWZATIMAN,{ disable_items; if (checkweight(Knife,1) == 0) { diff --git a/npc/re/instances/BangungotHospital.txt b/npc/re/instances/BangungotHospital.txt index 1504f892f..3962ee4fa 100644 --- a/npc/re/instances/BangungotHospital.txt +++ b/npc/re/instances/BangungotHospital.txt @@ -33,8 +33,6 @@ //= 1.1 //========================================================================= -1@ma_h mapflag src4instance - //== Instance Creation ===================================== ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{ if (BaseLevel < 100) end; diff --git a/npc/re/instances/BuwayaCave.txt b/npc/re/instances/BuwayaCave.txt index 242d0a8e4..859d6bd85 100644 --- a/npc/re/instances/BuwayaCave.txt +++ b/npc/re/instances/BuwayaCave.txt @@ -33,8 +33,6 @@ //= 1.0 //========================================================================= -1@ma_c mapflag src4instance - ma_fild02,312,317,5 script Guard#buwaya_cave 4_MAL_SOLDIER,{ if (BaseLevel < 130) { mes "[Guard]"; diff --git a/npc/re/instances/HazyForest.txt b/npc/re/instances/HazyForest.txt index 7f85fee50..c649171f8 100644 --- a/npc/re/instances/HazyForest.txt +++ b/npc/re/instances/HazyForest.txt @@ -33,8 +33,6 @@ //= 1.1 //========================================================================= -1@mist mapflag src4instance - //== Instance Creation ===================================== bif_fild01,158,340,5 script Laphine Soldier#mist 4_M_FAIRYSOLDIER,{ diff --git a/npc/re/instances/MalangdoCulvert.txt b/npc/re/instances/MalangdoCulvert.txt index 164caf548..1bd76aedb 100644 --- a/npc/re/instances/MalangdoCulvert.txt +++ b/npc/re/instances/MalangdoCulvert.txt @@ -35,9 +35,6 @@ //= 1.1 //========================================================================= -1@pump mapflag src4instance -2@pump mapflag src4instance - //== Quest NPCs ============================================ mal_in01,172,28,2 script Albo#mal 4_CAT_SAILOR5,{ if (checkweight(Knife,1) == 0) { diff --git a/npc/re/instances/OldGlastHeim.txt b/npc/re/instances/OldGlastHeim.txt index bf099cd2d..9f3f29fdf 100644 --- a/npc/re/instances/OldGlastHeim.txt +++ b/npc/re/instances/OldGlastHeim.txt @@ -36,8 +36,6 @@ //================= Current Version ======================================= //= 1.2 //========================================================================= -1@gl_k mapflag src4instance -2@gl_k mapflag src4instance glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{ if (BaseLevel < 130) { // iRO text diff --git a/npc/re/instances/WolfchevLaboratory.txt b/npc/re/instances/WolfchevLaboratory.txt index e88ec4332..51e2f8a06 100644 --- a/npc/re/instances/WolfchevLaboratory.txt +++ b/npc/re/instances/WolfchevLaboratory.txt @@ -33,8 +33,6 @@ //= 1.0.2 //========================================================================= -1@lhz mapflag src4instance - //== Giacomo Girolam ======================================= lighthalzen,303,303,6 script Giacomo Girolamo#kiup2 4_M_KHMAN,3,3,{ if ((MaxWeight - Weight) < 1000 || !checkweight(Knife, 1)) { diff --git a/npc/re/instances/ghost_palace.txt b/npc/re/instances/ghost_palace.txt index b1a8f3c10..6e77db2f8 100644 --- a/npc/re/instances/ghost_palace.txt +++ b/npc/re/instances/ghost_palace.txt @@ -30,7 +30,6 @@ //================= Current Version ======================================= //= 1.1 //========================================================================= -1@spa mapflag src4instance dali02,44,129,5 script Unpleasent Royal Guard 4_M_SAKRAYROYAL,{ if (BaseLevel < 120) { diff --git a/npc/re/instances/octopus_cave.txt b/npc/re/instances/octopus_cave.txt index b09d243ab..b134742c9 100644 --- a/npc/re/instances/octopus_cave.txt +++ b/npc/re/instances/octopus_cave.txt @@ -33,8 +33,6 @@ //= 1.1 //========================================================================= -1@cash mapflag src4instance - //== Instance Creation ===================================== mal_dun01,151,235,5 script Starfish 4_ASTER,{ diff --git a/npc/re/instances/saras_memory.txt b/npc/re/instances/saras_memory.txt index 2b3b4f2c0..38b598d5b 100644 --- a/npc/re/instances/saras_memory.txt +++ b/npc/re/instances/saras_memory.txt @@ -37,7 +37,6 @@ //================= Current Version ======================================= //= 1.1 //========================================================================= -1@sara mapflag src4instance dali,130,107,5 script Leon the Adventurer#Sara 4_M_DST_GRAND,{ // instance CD check only at the Dimensional Device mes("[Leon the Adventurer]"); diff --git a/npc/re/mapflag/gvg.txt b/npc/re/mapflag/gvg.txt new file mode 100644 index 000000000..2e0e85f32 --- /dev/null +++ b/npc/re/mapflag/gvg.txt @@ -0,0 +1,41 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2017 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Mapflag: Guild versus Guild mode. +//================= Current Version ======================================= +//= 1.0 +//================= Description =========================================== +//= Players can attack other guilds, and will have their guild +//= icons shown. WoE damage reductions will also take place. +//= gvg: Turns on GvG mode +//= gvg_castle: Describes castle maps for WoE. +//========================================================================= + +// Hall of the Abyss ====== +gld2_ald mapflag gvg_dungeon +gld2_gef mapflag gvg_dungeon +gld2_pay mapflag gvg_dungeon +gld2_prt mapflag gvg_dungeon diff --git a/npc/re/mapflag/zone.txt b/npc/re/mapflag/zone.txt index a6cfd95f1..24ffce665 100644 --- a/npc/re/mapflag/zone.txt +++ b/npc/re/mapflag/zone.txt @@ -32,6 +32,41 @@ //= Flags maps as part of zones defined in map_zone_db.txt //========================================================================= +// Misty Forest Labyrinth =========== +1@mist mapflag zone Memorial Dungeon + +// Octopus Cave =========== +1@cash mapflag zone Memorial Dungeon + +// Drain =========== +1@pump mapflag zone Memorial Dungeon +2@pump mapflag zone Memorial Dungeon + +// Somatology Laboratory =========== +1@lhz mapflag zone Memorial Dungeon + +// Bangungot Hospital F2 =========== +1@ma_h mapflag zone Memorial Dungeon + +// Buwaya Cave =========== +1@ma_c mapflag zone Memorial Dungeon + +// Bakonawa Hideout =========== +1@ma_b mapflag zone Memorial Dungeon + +// Inside Eclage =========== +1@ecl mapflag zone Memorial Dungeon + +// Old Glast Heim =========== +1@gl_k mapflag zone Memorial Dungeon +2@gl_k mapflag zone Memorial Dungeon + +// Ghost Palace =========== +1@spa mapflag zone Memorial Dungeon + +// Sara's Memory Instance =========== +1@sara mapflag zone Memorial Dungeon + // WoE:TE te_prt_gld mapflag zone WoE TE te_prtcas01 mapflag zone WoE TE diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index 4e5049e5f..2f8984498 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -158,7 +158,7 @@ itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{ } delitem .@choose,1; Zeny -= 20000; - if (getequippercentrefinery(.@SelectedPart) > rand(100) || getequippercentrefinery(.@SelectedPart) > rand(100)) { + if (getequippercentrefinery(.@SelectedPart) > rand(100) || ( .@option == 1 && getequippercentrefinery(.@SelectedPart) > rand(100))) { successrefitem .@SelectedPart; mes "[Shadow Blacksmith]"; mes "Refine was successful."; diff --git a/npc/re/quests/eden/eden_quests.txt b/npc/re/quests/eden/eden_quests.txt index f58c3ed5a..9e49a415b 100644 --- a/npc/re/quests/eden/eden_quests.txt +++ b/npc/re/quests/eden/eden_quests.txt @@ -9,7 +9,7 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2012-2015 Hercules Dev Team +//= Copyright (C) 2012-2016 Hercules Dev Team //= Copyright (C) Capuche //= Copyright (C) Euphy //= Copyright (C) Masao @@ -117,7 +117,7 @@ moc_para01,25,35,4 script Instructor Boya#para01 4_M_KNIGHT_GOLD,{ case 2: mes "You are so rude!"; specialeffect2 EF_HIT1; - percentheal -50,0; + percentheal -50, 0; next; mes "-Beats quickly and this shining Rune Knight turns invisible."; mes "It hurts too much-"; @@ -712,7 +712,7 @@ moc_fild11,180,253,5 script Talking Dog#para03 4_RUS_DWOLF,{ next; mes "-When the dog barked, your HP and SP recovered.-"; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 3) { @@ -750,7 +750,7 @@ moc_fild11,180,253,5 script Talking Dog#para03 4_RUS_DWOLF,{ next; mes "-When the dog barked, your HP and SP recovered.-"; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 4) { @@ -806,7 +806,7 @@ moc_fild11,180,253,5 script Talking Dog#para03 4_RUS_DWOLF,{ next; mes "-When the dog barked, your HP and SP recovered.-"; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 5) { @@ -952,7 +952,7 @@ prt_sewb1,131,262,3 script Timid Cat#para04 4_M_BABYCAT,{ mes "Take care to check your map so you don't get lost."; mes "It's a service meeow."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 8) { @@ -990,7 +990,7 @@ prt_sewb1,131,262,3 script Timid Cat#para04 4_M_BABYCAT,{ mes "I will help you a little."; mes "Here, I have recovered your strengh meow.."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 9) { @@ -1025,7 +1025,7 @@ prt_sewb1,131,262,3 script Timid Cat#para04 4_M_BABYCAT,{ mes "I will help you a little."; mes "Here, I have recovered your strengh meow.."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 >= 10) { @@ -1137,7 +1137,7 @@ pay_arche,41,136,3 script Eden Member Karl#para05 4_M_KHMAN,{ mes "Just in case I will recover all your energy."; mes "It's the last step so be careful."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 15) { @@ -1168,7 +1168,7 @@ pay_arche,41,136,3 script Eden Member Karl#para05 4_M_KHMAN,{ mes "Just in case I will recover all your energy."; mes "It's the last step so be careful."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 >= 16) { @@ -1290,7 +1290,7 @@ anthell01,29,264,5 script Eden Member Cloud#para06 4_M_HUMAN_02,{ mes "Can you stay longer?"; mes "Ok, I will recover your strengh so, keep going."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 19) { @@ -1329,7 +1329,7 @@ anthell01,29,264,5 script Eden Member Cloud#para06 4_M_HUMAN_02,{ mes "See, to cheer you up I will heal you until you finish the training."; mes "Chin up and cheer up."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 20) { @@ -1357,7 +1357,7 @@ anthell01,29,264,5 script Eden Member Cloud#para06 4_M_HUMAN_02,{ mes "Just Vitata, isn't that an easy opponent?"; mes "If you see Maya just run away."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 >= 21) { @@ -1472,7 +1472,7 @@ in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{ mes "You look tired I will recover your health."; mes "If you are in trouble just come back here to safety."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 26) { @@ -1503,7 +1503,7 @@ in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{ mes "You look tired, I will recover your health."; mes "If you are in trouble just come back here to safety."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 27) { @@ -1529,7 +1529,7 @@ in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{ mes "You look tired, I will recover your health."; mes "If you are in trouble just come back here to safety."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 28) { @@ -1602,7 +1602,7 @@ in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{ mes "You look tired, I will recover your health."; mes "If you are in trouble just come back here to safety."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 31) { @@ -1626,7 +1626,7 @@ in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{ mes "You look tired I will recover your health."; mes "If you are in trouble just come back here to safety."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 32) { @@ -1729,7 +1729,7 @@ iz_dun04,43,46,3 script Eden Member Callandiva 4_F_CRU,{ mes "Mermans are not easy opponents."; mes "I will help you recover so cheer up."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 == 35) { @@ -1763,7 +1763,7 @@ iz_dun04,43,46,3 script Eden Member Callandiva 4_F_CRU,{ mes "Strouf are not easy opponents."; mes "I can help you recover so cheer up."; npcskill "AL_HEAL",11,99,60; - percentheal 100,100; + percentheal 100, 100; close; } if (para_suv01 >= 36) { @@ -1855,38 +1855,31 @@ moc_para01,112,96,5 script Administrator Michael 4_M_RUSMAN1,{ close; } mes "[Michael]"; - if (Class == Job_Swordman || Class == Job_Swordman_High || Class == Job_Knight || Class == Job_Crusader) { + if (BaseClass == Job_Swordman) { callsub S_Select,"We have one and Two-handed swords", P_Slayer1,"Eden Slayer I","Two-handed sword","Attack 162","", P_Sabre1,"Eden Saber I","One-handed sword","Attack 147","This is what we strive for."; - } - if (Class == Job_Thief || Class == Job_Thief_High || Class == Job_Assassin || Class == Job_Rogue || Class == Job_Ninja || Class == Job_Novice || Class == Job_Novice_High) { + } else if (BaseClass == Job_Thief || BaseClass == Job_Ninja || BaseClass == Job_Novice) { callsub S_Select,"", P_Dagger1,"Eden Dagger I","Dagger","MATK+60, attack 124","This is what we strive for."; - } - if (Class == Job_Merchant || Class == Job_Merchant_High || Class == Job_Blacksmith || Class == Job_Alchemist) { + } else if (BaseClass == Job_Merchant) { callsub S_Select,"We have a mace and a One-handed sword", P_Sabre1,"Eden Saber I","One-handed sword","Attack 147","This is what we strive for.", P_Mace1,"Eden Mace I","Mace","Attack 142",""; - } - if (Class == Job_Archer || Class == Job_Archer_High || Class == Job_Hunter || Class == Job_Dancer || Class == Job_Bard) { + } else if (BaseClass == Job_Archer) { callsub S_Select,"", P_Bow1,"Eden Bow I","Bow","Attack 82",""; - } - if (Class == Job_Acolyte || Class == Job_Acolyte_High || Class == Job_Priest || Class == Job_Monk) { + } else if (BaseClass == Job_Acolyte) { callsub S_Select,"We have a mace and a staff", P_Mace1,"Eden Mace I","Mace","Attack 142","", P_Staff1,"Eden Staff I","Staff","INT+2, MATK+125, attack 60",""; - } - if (Class == Job_Mage || Class == Job_Mage_High || Class == Job_Wizard || Class == Job_Sage) { + } else if (BaseClass == Job_Mage) { callsub S_Select,"", P_Staff1,"Eden Staff I","Staff","INT+2, MATK+125, attack 60",""; - } - if (Class == Job_Gunslinger) { + } else if (BaseClass == Job_Gunslinger) { callsub S_Select,"", P_Revolver1,"Eden Revolver I","Revolver","HIT-5, attack 44",""; } - mes "Let me see... you will receive.."; mes "the Eden Group Boots II and Uniform II."; next; @@ -1933,34 +1926,28 @@ moc_para01,112,96,5 script Administrator Michael 4_M_RUSMAN1,{ close; } mes "[Michael]"; - if (Class == Job_Swordman || Class == Job_Swordman_High || Class == Job_Knight || Class == Job_Crusader) { + if (BaseClass == Job_Swordman) { callsub S_Select,"We have one and Two-handed swords", P_Sabre2,"Eden Saber II","One-handed sword","Attack 170","", P_Slayer2,"Eden Slayer II","Two-handed sword","Attack 185",""; - } - if (Class == Job_Thief || Class == Job_Thief_High || Class == Job_Assassin || Class == Job_Rogue || Class == Job_Novice || Class == Job_Novice_High || Class == Job_SuperNovice || Class == Job_Soul_Linker || Class == Job_Ninja) { + } else if (BaseClass == Job_Thief || BaseClass == Job_Novice || BaseJob == Job_Soul_Linker || BaseClass == Job_Ninja) { callsub S_Select,"", P_Dagger2,"Eden Dagger II","Dagger","MATK+70, attack 158",""; - } - if (Class == Job_Acolyte || Class == Job_Acolyte_High || Class == Job_Priest || Class == Job_Monk) { + } else if (BaseClass == Job_Acolyte) { callsub S_Select,"We have a mace and a staff", P_Mace2,"Eden Mace II","Mace","Attack 163","", P_Staff2,"Eden Staff II","Staff","INT+3, MATK+150, attack 60",""; - } - if (Class == Job_Archer || Class == Job_Archer_High || Class == Job_Hunter || Class == Job_Dancer || Class == Job_Bard) { + } else if (BaseClass == Job_Archer) { callsub S_Select,"", P_Bow2,"Eden Bow II","Bow","Attack 82",""; - } - if (Class == Job_Mage || Class == Job_Mage_High || Class == Job_Wizard || Class == Job_Sage) { + } else if (BaseClass == Job_Mage) { callsub S_Select,"", P_Staff2,"Eden Staff II","Staff","INT+3, MATK+155, attack 60",""; - } - if (Class == Job_Merchant || Class == Job_Merchant_High || Class == Job_Blacksmith || Class == Job_Alchemist) { + } else if (BaseClass == Job_Merchant) { callsub S_Select,"We have a mace and a One-handed sword", P_Sabre2,"Eden Saber II","One-handed sword","Attack 170","", P_Mace2,"Eden Mace II","Mace","Attack 163",""; - } - if (Class == Job_Gunslinger) { + } else if (BaseClass == Job_Gunslinger) { callsub S_Select,"", P_Revolver2,"Eden Revolver II","Revolver","HIT-5, attack 60",""; } @@ -2024,12 +2011,12 @@ moc_para01,112,96,5 script Administrator Michael 4_M_RUSMAN1,{ mes "What status bonus do you want to upgrade?"; next; switch (select("Upgrade STR", "Upgrade AGI", "Upgrade VIT", "Upgrade INT", "Upgrade DEX", "Upgrade LUK", "Nevermind.")) { - case 1: callsub S_Upgrade,"STR",4701; - case 2: callsub S_Upgrade,"AGI",4731; - case 3: callsub S_Upgrade,"VIT",4741; - case 4: callsub S_Upgrade,"INT",4711; - case 5: callsub S_Upgrade,"DEX",4721; - case 6: callsub S_Upgrade,"LUK",4751; + case 1: callsub S_Upgrade,"STR",Strength2; + case 2: callsub S_Upgrade,"AGI",Agility2; + case 3: callsub S_Upgrade,"VIT",Vitality2; + case 4: callsub S_Upgrade,"INT",Inteligence2; + case 5: callsub S_Upgrade,"DEX",Dexterity2; + case 6: callsub S_Upgrade,"LUK",Luck2; case 7: mes "[Michael]"; mes "Why? It'll be beter than it is."; @@ -2252,8 +2239,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{ mes "- After eating the meal, You feel a little bit full."; mes "You've recovered some HP and SP. -"; Zeny = Zeny - 2700; - percentheal 50,0; - percentheal 0,50; + percentheal 50, 50; close; } mes "[Chef]"; @@ -2269,8 +2255,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{ mes "- After eating the meal, You feel a little bit full."; mes "You've recovered some HP and SP. -"; Zeny = Zeny - 3000; - percentheal 50,0; - percentheal 0,50; + percentheal 50, 50; close; } mes "[Chef]"; @@ -2291,8 +2276,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{ mes "- After eating the meal, You feel a little bit full."; mes "You've recovered some HP and SP. -"; Zeny = Zeny - 3600; - percentheal 75,0; - percentheal 0,75; + percentheal 75, 75; close; } mes "[Chef]"; @@ -2308,8 +2292,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{ mes "- After eating the meal, You feel a little bit full."; mes "You've recovered some HP and SP. -"; Zeny = Zeny - 4000; - percentheal 75,0; - percentheal 0,75; + percentheal 75, 75; close; } mes "[Chef]"; @@ -2327,8 +2310,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{ mes "- After eating the meal, You feel a little bit full."; mes "You've recovered your HP and SP. -"; Zeny = Zeny - 4500; - percentheal 100,0; - percentheal 0,100; + percentheal 100, 100; close; } mes "[Chef]"; @@ -2346,8 +2328,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{ mes "- After eating the meal, You feel a little bit full."; mes "You've recovered your HP and SP. -"; Zeny = Zeny - 5000; - percentheal 100,0; - percentheal 0,100; + percentheal 100, 100; close; } mes "[Chef]"; @@ -2967,7 +2948,7 @@ comodo,173,354,5 script Dispatched Instructor#02 1_M_JOBTESTER,{ mes "[Romeo]"; mes "Let me help you recover if you are tired."; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 3) { @@ -3027,7 +3008,7 @@ um_fild01,34,280,5 script Instructor Romeo#2nd02 1_M_JOBTESTER,{ mes "[Romeo]"; mes "I'll help you recover if you are tired."; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 4) { @@ -3057,7 +3038,7 @@ um_fild01,34,280,5 script Instructor Romeo#2nd02 1_M_JOBTESTER,{ mes "[Romeo]"; mes "I'll help you recover if you are tired."; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else { @@ -3144,7 +3125,7 @@ glast_01,195,131,5 script Dispatched Instructor#03 4_F_SISTER,{ mes "I'll watch your back!."; mes "... Of.. Course.. I'll fight too!"; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 9) { @@ -3176,7 +3157,7 @@ glast_01,195,131,5 script Dispatched Instructor#03 4_F_SISTER,{ mes "I'll watch your back, like last time."; mes "... Of... Course... I'll fight them too!"; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 10) { @@ -3280,7 +3261,7 @@ ein_fild08,172,359,3 script Dispatched Instructor#04 4_M_4THPRIN1,{ mes "If you're hurt I'll heal you a bit."; } npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } else if (para_2nd01 == 14) { if (questprogress(7226,HUNTING) == 2 && questprogress(7227,HUNTING) == 2) { @@ -3312,7 +3293,7 @@ ein_fild08,172,359,3 script Dispatched Instructor#04 4_M_4THPRIN1,{ mes "Ugh this is difficult."; mes "I'll make you feel better though."; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 15) { @@ -3418,7 +3399,7 @@ ice_dun01,154,13,5 script Dispatched Instructor#05 4_F_JOB_BLACKSMITH,{ setquest 7231; // Hunting and Gathering getexp 40000,40000; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } else { mes "The biggest stumbling block is dealing with the Siromas."; @@ -3637,7 +3618,7 @@ man_fild01,43,234,3 script Dispatched Instructor#07 4_DST_SOLDIER,{ mes "You seem a bit flushed."; mes "Fine I'll heal you!"; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 25) @@ -3722,7 +3703,7 @@ spl_fild02,377,149,3 script Dispatched Instructor#08 4_M_DST_MASTER,{ mes "[Mine]"; mes "You're not lying about being a real adventurer are you?"; npcskill "AL_HEAL",10,99,60; - percentheal 0,100; + percentheal 0, 100; } } else if (para_2nd01 == 27) { @@ -3952,19 +3933,19 @@ moc_para01,111,83,3 script Blacksmith Thorn#2nd10 2_M_OLDBLSMITH,{ P_Bow3,"Eden Group Bow III","Bow, Attack 140", P_Tail1,"Eden Group Whip I","Whip, Attack 125"; } - else if (Class == Job_Ninja) { + else if (BaseClass == Job_Ninja) { callsub L_Select,"", P_Dagger3,"Eden Group Dagger III","Dagger, MATK +80, ATK 165", P_Huuma_Shuriken1,"Eden Group Huuma Shuriken I","Huuma Suriken, MATK +50, ATK 170"; } - else if (Class == Job_Star_Gladiator) + else if (BaseJob == Job_Star_Gladiator) getitem P_Dic1,1; - else if (Class == Job_Soul_Linker) { + else if (BaseJob == Job_Soul_Linker) { callsub L_Select,"", P_Dagger3,"Eden Group Dagger III","Dagger, MATK +80, ATK 165", P_Staff3,"Eden Group Staff III","Staff, MATK +170, INT +4, ATK 60"; } - else if (Class == Job_Gunslinger) + else if (BaseClass == Job_Gunslinger) getitem P_Revolver3,1; else { mes "Hmm, you are eligible to receive equipment."; @@ -4079,21 +4060,10 @@ moc_para01,112,79,3 script Weapons Expert BK#2nd11 4_M_REPAIR,{ P_Revolver3, P_Knuckle1, P_Huuma_Shuriken1; - .@menu$ = "Eden Group Slayer III:" + - "Eden Group Saber III:" + - "Eden Group Dagger III:" + - "Eden Group Katar I:" + - "Eden Group Axe I:" + - "Eden Group Spear I:" + - "Eden Group Staff III:" + - "Eden Group Mace III:" + - "Eden Group Bow III:" + - "Eden Group Dictionary I:" + - "Eden Group Guitar I:" + - "Eden Group Whip I:" + - "Eden Group Revolver III:" + - "Eden Group Knuckles I:" + - "Eden Group Huuma Shuriken I"; + .@wplist_size = getarraysize(.@wplist); + for ( .@i = 0; .@i < .@wplist_size; ++.@i ) { + .@menu$ += getitemname(.@wplist[.@i]) + ":"; + } mes "[BK]"; mes "What's happening?"; mes "No way?!"; diff --git a/npc/re/scripts_mapflags.conf b/npc/re/scripts_mapflags.conf index 8727d9b44..570294c47 100644 --- a/npc/re/scripts_mapflags.conf +++ b/npc/re/scripts_mapflags.conf @@ -28,4 +28,5 @@ //= Map Flags //========================================================================= +"npc/re/mapflag/gvg.txt", "npc/re/mapflag/zone.txt", diff --git a/npc/re/woe-fe/invest_main.txt b/npc/re/woe-fe/invest_main.txt index c912444cc..d743225df 100644 --- a/npc/re/woe-fe/invest_main.txt +++ b/npc/re/woe-fe/invest_main.txt @@ -107,16 +107,16 @@ function script F_Invest_Status { return 0; // Open for investments. - if (.@day >= 3 && (.@day < 5 || (.@day == 5 && .@hour <= 12))) + if (.@day >= WEDNESDAY && (.@day < FRIDAY || (.@day == FRIDAY && .@hour <= 12))) return 1; // Investments closed, calculating results. - if (.@day == 5 && .@hour == 12 && .@minute < 35) + if (.@day == FRIDAY && .@hour == 12 && .@minute < 35) return 2; // Calculations complete, dungeons open. - if ((.@day == 5 && (.@hour > 12 || (.@hour == 12 && .@minute >= 35))) || .@day > 5 || - .@day < 2 || (.@day == 2 && .@hour < 20)) + if ((.@day == FRIDAY && (.@hour > 12 || (.@hour == 12 && .@minute >= 35))) || .@day > FRIDAY || + .@day < TUESDAY || (.@day == TUESDAY && .@hour < 20)) return 3; // Dungeons closed. @@ -273,14 +273,14 @@ OnCalculate: else setd "$"+.@cas$[.@i]+"_invest_result",1; } - // No further actions if 20,000,000z isn't reached. - if (!.@total_2000) - end; // No further actions if any realm hits 70,000,000z. if (.@total_7000) { $2011_agit_invest = 4; end; } + // No further actions if 20,000,000z isn't reached. + if (!.@total_2000) + end; // Otherwise, highest investment above 20,000,000z opens Hall of Abyss. .@max = .@funds[0]; for(.@i = 1; .@i<4; ++.@i) { @@ -882,7 +882,7 @@ OnAgitInvest: close; } case 3: - if (checkweight(Knife,1) == 0 || MaxWeight - Weight < 1000) { + if (checkweight(Knife,1) == 0 || MaxWeight - Weight < 2000) { mes "- Currently you're carrying -"; mes "- too many items with you. -"; mes "- Please try again after you -"; @@ -1126,7 +1126,7 @@ OnAgitInvest: next; switch(select("Invest for gate connection", "Deepest Layer Dungeon Access", "Abyss Gate Access", "Cancel")) { case 1: - if (checkweight(Knife,1) == 0 || MaxWeight - Weight < 1000) { + if (checkweight(Knife,1) == 0 || MaxWeight - Weight < 2000) { mes "[Gate Manager]"; mes "You have too many items to receive the Thank You Ticket as a small gift for your investment."; mes "Please come back after making room in your inventory."; @@ -1401,27 +1401,48 @@ malangdo,218,123,1 script Namis#invest 4_CAT_SAILOR2,4,4,{ "Piece of Thanatos' armor","I hear Dragon Scales are tough 02","The identity of the creepy eye","If only I could see!"; .@i = select(implode(.@event1$[0],":"))-1; switch(.@i+1) { - case 1: callsub L_Check,"2 Pieces of Queen's Wing",6326,2,"Wings of the Insect Queen? What a pitiful name. I would've given some cool names!",.@event1$[.@i]; - case 2: callsub L_Check,"2 Broken Crowns",7754,2,"For crying out loud! Those cats working on these events must be playing around. Can't they think of a better name?",.@event1$[.@i]; - case 3: callsub L_Check,"2 Fire Dragon Scales",7451,2,"Dragon scales? Well... I guess they are tough. But what are they going to use them for?",.@event1$[.@i]; - case 4: callsub L_Check,"3 Mother's Nightmares",7020,3,"Even though I don't have the authority to find out, I wonder what they're doing with the collected items?",.@event1$[.@i]; - case 5: callsub L_Check,"5 Gemstones",7300,5,"Something useful for a change. The ore will end up as nice pieces of jewelry.",.@event1$[.@i]; - case 6: callsub L_Check,"5 Heroic Emblems",968,5,"Good, good. This is the kind of name I wanted!",.@event1$[.@i]; - case 7: callsub L_Check,"3 Taeguk Plates",7169,3,"Taking in something like this, maybe they're up to something dangerous.",.@event1$[.@i]; - case 8: callsub L_Check,"3 Broken Pharaoh Symbols and 3 Tutankhamen's Masks",7113,3,"I hear the pyramids are in Morroc, but I've never been there. Some humans call it Morco.",.@event1$[.@i],7114,3; - case 9: callsub L_Check,"2 Pocket Watches",7513,2,"Those lazy merchants, why do they need pocket watches they don't even use?",.@event1$[.@i]; - case 10: callsub L_Check,"3 Young Twigs",7018,3,"Mellow Island has a climate like with where we cats used to live. But the trees die out sometimes due to it being an island.",.@event1$[.@i]; - case 11: callsub L_Check,"5 Rossata Pieces",7211,5,"I guess they collect these because humans have them, but what's the use of researching ancient languages?",.@event1$[.@i]; - case 12: callsub L_Check,"5 Fangs of Garm",7036,5,"Weak humans need sharp weapons, but cats already have nice and sharp claws, so why are we collecting these!!",.@event1$[.@i]; - case 13: callsub L_Check,"3 Baphomet Dolls",750,3,"Baphomet dolls are great for playing around with.",.@event1$[.@i]; - case 14: callsub L_Check,"1 Tiger's Footskin and 5 Tiger Skins",1030,1,"Did you know that tigers are cats too? Therefore, cats are better than tigers.",.@event1$[.@i],1029,5; - case 15: callsub L_Check,"3 Broken Shield Pieces and 3 Shining Spear Blades",7108,3,"I don't know what they want with these.",.@event1$[.@i],7109,3; - case 16: callsub L_Check,"3 Osiris Dolls",751,3,"Shame~ I never got to play with an Osiris doll.",.@event1$[.@i]; - case 17: callsub L_Check,"1 Ice Scale",7562,1,"Mellow Island is a fabulous place to live. But the ships are too hot.",.@event1$[.@i]; - case 18: callsub L_Check,"1 Skeletal Armor Piece",7450,1,"Ewww... Why would they collect something so creepy?",.@event1$[.@i]; - case 19: callsub L_Check,"1 Darkred Scale Piece",6091,1,"Dragon scales? Well... I guess they are tough. But what are they going to use them for?",.@event1$[.@i]; - case 20: callsub L_Check,"2 Wills of Red Darkness",7566,2,"Interesting! Does it scream or something when I poke it in the eye?",.@event1$[.@i]; - case 21: callsub L_Check,"2 Foolishness of the Blind",7021,2,"This blind man is foolish in not knowing that gathering 300 cats cures blindness...",.@event1$[.@i]; + case 1: + callsub(L_Check, "2 Pieces of Queen's Wing", Queen_Wing_Piece, 2, "Wings of the Insect Queen? What a pitiful name. I would've given some cool names!", .@event1$[.@i]); + case 2: + callsub(L_Check, "2 Broken Crowns", Broken_Crown, 2, "For crying out loud! Those cats working on these events must be playing around. Can't they think of a better name?", .@event1$[.@i]); + case 3: + callsub(L_Check, "2 Fire Dragon Scales", Scale_Of_Red_Dragon, 2, "Dragon scales? Well... I guess they are tough. But what are they going to use them for?", .@event1$[.@i]); + case 4: + callsub(L_Check, "3 Mother's Nightmares", Mothers_Nightmare, 3, "Even though I don't have the authority to find out, I wonder what they're doing with the collected items?", .@event1$[.@i]); + case 5: + callsub(L_Check, "5 Gemstones", Gemstone, 5, "Something useful for a change. The ore will end up as nice pieces of jewelry.", .@event1$[.@i]); + case 6: + callsub(L_Check, "5 Heroic Emblems", Voucher_Of_Orcish_Hero, 5, "Good, good. This is the kind of name I wanted!", .@event1$[.@i]); + case 7: + callsub(L_Check, "3 Taeguk Plates", Taegeuk_Plate, 3, "Taking in something like this, maybe they're up to something dangerous.", .@event1$[.@i]); + case 8: + callsub(L_Check, "3 Broken Pharaoh Symbols and 3 Tutankhamen's Masks", Broken_Pharaoh_Symbol, 3, "I hear the pyramids are in Morroc, but I've never been there. Some humans call it Morco.", .@event1$[.@i], Tutankhamens_Mask, 3); + case 9: + callsub(L_Check, "2 Pocket Watches", Pocket_Watch, 2, "Those lazy merchants, why do they need pocket watches they don't even use?", .@event1$[.@i]); + case 10: + callsub(L_Check, "3 Young Twigs", Young_Twig, 3, "Mellow Island has a climate like with where we cats used to live. But the trees die out sometimes due to it being an island.", .@event1$[.@i]); + case 11: + callsub(L_Check, "5 Rossata Pieces", Rojerta_Piece, 5, "I guess they collect these because humans have them, but what's the use of researching ancient languages?", .@event1$[.@i]); + case 12: + callsub(L_Check, "5 Fangs of Garm", Fang_Of_Garm, 5, "Weak humans need sharp weapons, but cats already have nice and sharp claws, so why are we collecting these!!", .@event1$[.@i]); + case 13: + callsub(L_Check, "3 Baphomet Dolls", Baphomet_Doll, 3, "Baphomet dolls are great for playing around with.", .@event1$[.@i]); + case 14: + callsub(L_Check, "1 Tiger's Footskin and 5 Tiger Skins", Tiger_Footskin, 1, "Did you know that tigers are cats too? Therefore, cats are better than tigers.", .@event1$[.@i], Tigers_Skin, 5); + case 15: + callsub(L_Check, "3 Broken Shield Pieces and 3 Shining Spear Blades", Boroken_Shiled_Piece, 3, "I don't know what they want with these.", .@event1$[.@i], Shine_Spear_Blade, 3); + case 16: + callsub(L_Check, "3 Osiris Dolls", Osiris_Doll, 3, "Shame~ I never got to play with an Osiris doll.", .@event1$[.@i]); + case 17: + callsub(L_Check, "1 Ice Scale", Ice_Scale, 1, "Mellow Island is a fabulous place to live. But the ships are too hot.", .@event1$[.@i]); + case 18: + callsub(L_Check, "1 Skeletal Armor Piece", Piece_Of_Bone_Armor, 1, "Ewww... Why would they collect something so creepy?", .@event1$[.@i]); + case 19: + callsub(L_Check, "1 Darkred Scale Piece", Dark_Red_Scale, 1, "Dragon scales? Well... I guess they are tough. But what are they going to use them for?", .@event1$[.@i]); + case 20: + callsub(L_Check, "2 Wills of Red Darkness", Will_Of_Darkness_, 2, "Interesting! Does it scream or something when I poke it in the eye?", .@event1$[.@i]); + case 21: + callsub(L_Check, "2 Foolishness of the Blind", Foolishness_Of_Blind, 2, "This blind man is foolish in not knowing that gathering 300 cats cures blindness...", .@event1$[.@i]); } case 3: mes "[Namis]"; @@ -1496,21 +1517,36 @@ malangdo,215,119,4 script Thanks Ticket Machine 2_VENDING_MACHINE1,{ mes "The Vending Machine is selling items in the following list."; next; switch(select("Finish", "1 Siege Arrow Quiver A (2 Tickets)", "1 Siege Arrow Quiver S (2 Tickets)", "30 White Potion (12 Tickets)", "30 White Slim Potion (14 Tickets)", "10 Dark Water (20 Tickets)", "20 Siege_Violet_Potion (30 Tickets)", "10 Coldproof Potion (30 Tickets)", "10 Thunderproof Potion (30 Tickets)", "10 Earthproof Potion (30 Tickets)", "10 Fireproof Potion (30 Tickets)", "10 Elemental Converter[Fire] (30 Tickets)")) { - case 1: close; - case 2: callsub L_Purchase,2,12678,1; //Siege_Arrow_Quiver_A - case 3: callsub L_Purchase,2,12677,1; //Siege_Arrow_Quiver_S - case 4: callsub L_Purchase,12,504,30; //White_Potion - case 5: callsub L_Purchase,14,547,30; //White_Slim_Potion - case 6: callsub L_Purchase,20,12020,10; //Water_Of_Darkness - case 7: callsub L_Purchase,30,11547,20; //Woe_Violet_Potion - case 8: callsub L_Purchase,30,12119,10; //Resist_Water - case 9: callsub L_Purchase,30,12121,10; //Resist_Wind - case 10: callsub L_Purchase,30,12120,10; //Resist_Earth - case 11: callsub L_Purchase,30,12118,10; //Resist_Fire - case 12: callsub L_Purchase,30,12114,10,"Elemental Converter[Fire]"; //Elemental_Fire - case 13: callsub L_Purchase,30,12115,10,"Elemental Converter[Water]"; //Elemental_Water - case 14: callsub L_Purchase,30,12117,10,"Elemental Converter[Wind]"; //Elemental_Wind - case 15: callsub L_Purchase,30,12116,10,"Elemental Converter[Earth]"; //Elemental_Earth + case 1: + close; + case 2: + callsub(L_Purchase, 2, Siege_Arrow_Quiver_A, 1); + case 3: + callsub(L_Purchase, 2, Siege_Arrow_Quiver_S, 1); + case 4: + callsub(L_Purchase, 12, White_Potion, 30); + case 5: + callsub(L_Purchase, 14, White_Slim_Potion, 30); + case 6: + callsub(L_Purchase, 20, Water_Of_Darkness, 10); + case 7: + callsub(L_Purchase, 30, Woe_Violet_Potion, 20); + case 8: + callsub(L_Purchase, 30, Resist_Water, 10); + case 9: + callsub(L_Purchase, 30, Resist_Wind, 10); + case 10: + callsub(L_Purchase, 30, Resist_Earth, 10); + case 11: + callsub(L_Purchase, 30, Resist_Fire, 10); + case 12: + callsub(L_Purchase, 30, Elemental_Fire, 10, "Elemental Converter[Fire]"); + case 13: + callsub(L_Purchase, 30, Elemental_Water, 10, "Elemental Converter[Water]"); + case 14: + callsub(L_Purchase, 30, Elemental_Wind, 10, "Elemental Converter[Wind]"); + case 15: + callsub(L_Purchase, 30, Elemental_Earth, 10, "Elemental Converter[Earth]"); } end; case 3: @@ -1520,67 +1556,126 @@ malangdo,215,119,4 script Thanks Ticket Machine 2_VENDING_MACHINE1,{ mes "You don't have enough ^FF0000Invest Thanks Ticket^000000 to proceed."; close; } - delitem Thanks_Invest_Ticket,5; - .@i = rand(1,10000); - if (.@i <= 100) callsub L_Bag,12531,1; //White_Potion_Box - else if (.@i <= 200) callsub L_Bag,12549,1; //White_Slim_Pot_Box2 - else if (.@i <= 250) callsub L_Bag,11549,10; //Woe_Blue_Potion - else if (.@i <= 660) callsub L_Bag,617,1; //Old_Violet_Box - else if (.@i <= 710) callsub L_Bag,12532,1; //Royal_Jelly_Box2 - else if (.@i <= 760) callsub L_Bag,12533,1; //Blue_Herb_Box2 - else if (.@i <= 810) callsub L_Bag,505,5; //Blue_Potion - else if (.@i <= 1110) callsub L_Bag,644,1; //Gift_Box - else if (.@i <= 1120) callsub L_Bag,607,1; //Yggdrasilberry - else if (.@i <= 1130) callsub L_Bag,608,2; //Seed_Of_Yggdrasil - else if (.@i <= 1140) callsub L_Bag,12292,5; //Unripe_Fruit - else if (.@i <= 1150) callsub L_Bag,12293,5; //Dried_Yggdrasilberry - else if (.@i <= 1250) callsub L_Bag,12679,1; //Sg_White_Potion_Box - else if (.@i <= 1471) callsub L_Bag,603,1; //Old_Blue_Box - else if (.@i <= 1571) callsub L_Bag,12550,1,"Poison Bottle Box(30)"; //Poison_Bottle_Box2 - else if (.@i <= 1671) callsub L_Bag,12020,10; //Water_Of_Darkness - else if (.@i <= 1871) callsub L_Bag,12030,5; //Box_Of_Grudge - else if (.@i <= 2071) callsub L_Bag,12031,5; //Sleepy_Box - else if (.@i <= 2371) callsub L_Bag,12033,2; //Box_Of_Sunlight - else if (.@i <= 2571) callsub L_Bag,12114,5,"Elemental Converter[Fire]"; //Elemental_Fire - else if (.@i <= 2771) callsub L_Bag,12115,5,"Elemental Converter[Water]"; //Elemental_Water - else if (.@i <= 2971) callsub L_Bag,12117,5,"Elemental Converter[Wind]"; //Elemental_Wind - else if (.@i <= 3171) callsub L_Bag,12116,5,"Elemental Converter[Earth]"; //Elemental_Earth - else if (.@i <= 3271) callsub L_Bag,12680,1; //Sg_Blue_Potion_Box - else if (.@i <= 3471) callsub L_Bag,12118,5; //Resist_Fire - else if (.@i <= 3671) callsub L_Bag,12119,5; //Resist_Water - else if (.@i <= 3871) callsub L_Bag,12121,5; //Resist_Wind - else if (.@i <= 4071) callsub L_Bag,12120,5; //Resist_Earth - else if (.@i <= 4271) callsub L_Bag,929,20; //Immortal_Heart - else if (.@i <= 4471) callsub L_Bag,1059,20; //Transparent_Cloth - else if (.@i <= 4671) callsub L_Bag,905,20; //Stem - else if (.@i <= 4871) callsub L_Bag,606,10; //Aloebera - else if (.@i <= 5071) callsub L_Bag,609,10; //Amulet - else if (.@i <= 5271) callsub L_Bag,710,2; //Illusion_Flower - else if (.@i <= 5471) callsub L_Bag,576,20; //Prickly_Fruit - else if (.@i <= 5671) callsub L_Bag,621,10; //Bitter_Herb - else if (.@i <= 5871) callsub L_Bag,709,10; //Izidor - else if (.@i <= 6071) callsub L_Bag,605,10; //Anodyne - else if (.@i <= 6171) callsub L_Bag,11548,10; //Woe_White_Potion - else if (.@i <= 6371) callsub L_Bag,706,10; //Four_Leaf_Clover - else if (.@i <= 6571) callsub L_Bag,521,10; //Leaflet_Of_Aloe - else if (.@i <= 6771) callsub L_Bag,707,10; //Singing_Plant - else if (.@i <= 6971) callsub L_Bag,610,10; //Leaf_Of_Yggdrasil - else if (.@i <= 7021) callsub L_Bag,12676,1; //Sg_Violet_Potion_Box - else if (.@i <= 7171) callsub L_Bag,6249,10; //Savage_Meat - else if (.@i <= 7321) callsub L_Bag,6252,10; //Wolf_Blood - else if (.@i <= 7471) callsub L_Bag,6254,10; //Beef_Head_Meat - else if (.@i <= 7621) callsub L_Bag,6253,10; //Cold_Ice - else if (.@i <= 7771) callsub L_Bag,6256,10; //Ice_Fragment - else if (.@i <= 7921) callsub L_Bag,6257,10; //Ice_Crystal - else if (.@i <= 8071) callsub L_Bag,6260,10; //Petti_Tail - else if (.@i <= 8309) callsub L_Bag,7932,20; //Poison_Herb_Nerium - else if (.@i <= 8547) callsub L_Bag,7933,20; //Poison_Herb_Rantana - else if (.@i <= 8785) callsub L_Bag,7934,20; //Poison_Herb_Makulata - else if (.@i <= 9023) callsub L_Bag,7935,20; //Poison_Herb_Seratum - else if (.@i <= 9261) callsub L_Bag,7936,20; //Poison_Herb_Scopolia - else if (.@i <= 9499) callsub L_Bag,7937,20; //Poison_Herb_Amoena - else if (.@i <= 9699) callsub L_Bag,6217,20; //Mandragora_Flowerpot - else callsub L_Bag,12016,10; //Speed_Up_Potion + delitem(Thanks_Invest_Ticket, 5); + .@i = rand(1, 10000); + if (.@i <= 100) + callsub(L_Bag, White_Potion_Box, 1); + else if (.@i <= 200) + callsub(L_Bag, White_Slim_Pot_Box2, 1); + else if (.@i <= 250) + callsub(L_Bag, Woe_Blue_Potion, 10); + else if (.@i <= 660) + callsub(L_Bag, Old_Violet_Box, 1); + else if (.@i <= 710) + callsub(L_Bag, Royal_Jelly_Box2, 1); + else if (.@i <= 760) + callsub(L_Bag, Blue_Herb_Box2, 1); + else if (.@i <= 810) + callsub(L_Bag, Blue_Potion, 5); + else if (.@i <= 1110) + callsub(L_Bag, Gift_Box, 1); + else if (.@i <= 1120) + callsub(L_Bag, Yggdrasilberry, 1); + else if (.@i <= 1130) + callsub(L_Bag, Seed_Of_Yggdrasil, 2); + else if (.@i <= 1140) + callsub(L_Bag, Unripe_Fruit, 5); + else if (.@i <= 1150) + callsub(L_Bag, Dried_Yggdrasilberry, 5); + else if (.@i <= 1250) + callsub(L_Bag, Sg_White_Potion_Box, 1); + else if (.@i <= 1471) + callsub(L_Bag, Old_Blue_Box, 1); + else if (.@i <= 1571) + callsub(L_Bag, Poison_Bottle_Box2, 1, "Poison Bottle Box(30);"); + else if (.@i <= 1671) + callsub(L_Bag, Water_Of_Darkness, 10); + else if (.@i <= 1871) + callsub(L_Bag, Box_Of_Grudge, 5); + else if (.@i <= 2071) + callsub(L_Bag, Sleepy_Box, 5); + else if (.@i <= 2371) + callsub(L_Bag, Box_Of_Sunlight, 2); + else if (.@i <= 2571) + callsub(L_Bag, Elemental_Fire, 5, "Elemental Converter[Fire]"); + else if (.@i <= 2771) + callsub(L_Bag, Elemental_Water, 5, "Elemental Converter[Water]"); + else if (.@i <= 2971) + callsub(L_Bag, Elemental_Earth, 5, "Elemental Converter[Wind]"); + else if (.@i <= 3171) + callsub(L_Bag, Elemental_Wind, 5, "Elemental Converter[Earth]"); + else if (.@i <= 3271) + callsub(L_Bag, Sg_Blue_Potion_Box, 1); + else if (.@i <= 3471) + callsub(L_Bag, Resist_Fire, 5); + else if (.@i <= 3671) + callsub(L_Bag, Resist_Water, 5); + else if (.@i <= 3871) + callsub(L_Bag, Resist_Wind, 5); + else if (.@i <= 4071) + callsub(L_Bag, Resist_Earth, 5); + else if (.@i <= 4271) + callsub(L_Bag, Immortal_Heart, 20); + else if (.@i <= 4471) + callsub(L_Bag, Transparent_Cloth, 20); + else if (.@i <= 4671) + callsub(L_Bag, Stem, 20); + else if (.@i <= 4871) + callsub(L_Bag, Aloebera, 10); + else if (.@i <= 5071) + callsub(L_Bag, Amulet, 10); + else if (.@i <= 5271) + callsub(L_Bag, Illusion_Flower, 2); + else if (.@i <= 5471) + callsub(L_Bag, Prickly_Fruit, 20); + else if (.@i <= 5671) + callsub(L_Bag, Bitter_Herb, 10); + else if (.@i <= 5871) + callsub(L_Bag, Izidor, 10); + else if (.@i <= 6071) + callsub(L_Bag, Anodyne, 10); + else if (.@i <= 6171) + callsub(L_Bag, Woe_White_Potion, 10); + else if (.@i <= 6371) + callsub(L_Bag, Four_Leaf_Clover, 10); + else if (.@i <= 6571) + callsub(L_Bag, Leaflet_Of_Aloe, 10); + else if (.@i <= 6771) + callsub(L_Bag, Singing_Plant, 10); + else if (.@i <= 6971) + callsub(L_Bag, Leaf_Of_Yggdrasil, 10); + else if (.@i <= 7021) + callsub(L_Bag, Sg_Violet_Potion_Box, 1); + else if (.@i <= 7171) + callsub(L_Bag, Savage_Meat, 10); + else if (.@i <= 7321) + callsub(L_Bag, Wolf_Blood, 10); + else if (.@i <= 7471) + callsub(L_Bag, Beef_Head_Meat, 10); + else if (.@i <= 7621) + callsub(L_Bag, Cold_Ice, 10); + else if (.@i <= 7771) + callsub(L_Bag, Ice_Fragment, 10); + else if (.@i <= 7921) + callsub(L_Bag, Ice_Crystal, 10); + else if (.@i <= 8071) + callsub(L_Bag, Petti_Tail, 10); + else if (.@i <= 8309) + callsub(L_Bag, Poison_Herb_Nerium, 20); + else if (.@i <= 8547) + callsub(L_Bag, Poison_Herb_Rantana, 20); + else if (.@i <= 8785) + callsub(L_Bag, Poison_Herb_Makulata, 20); + else if (.@i <= 9023) + callsub(L_Bag, Poison_Herb_Seratum, 20); + else if (.@i <= 9261) + callsub(L_Bag, Poison_Herb_Scopolia, 20); + else if (.@i <= 9499) + callsub(L_Bag, Poison_Herb_Amoena, 20); + else if (.@i <= 9699) + callsub(L_Bag, Mandragora_Flowerpot, 20); + else + callsub(L_Bag, Speed_Up_Potion, 10); end; case 4: mes "Black Paw Jelly Bag Button chosen. Need to insert 50 ^FF0000Invest Thanks Ticket^000000 and a random item will appear."; @@ -1589,75 +1684,142 @@ malangdo,215,119,4 script Thanks Ticket Machine 2_VENDING_MACHINE1,{ mes "You don't have enough ^FF0000Invest Thanks Ticket^000000 to proceed."; close; } - delitem Thanks_Invest_Ticket,50; - .@i = rand(1,10000); - if (.@i <= 100) callsub L_Bag,12531,1; //White_Potion_Box - else if (.@i <= 200) callsub L_Bag,12549,1; //White_Slim_Pot_Box2 - else if (.@i <= 250) callsub L_Bag,11549,20; //Woe_Blue_Potion - else if (.@i <= 450) callsub L_Bag,617,1; //Old_Violet_Box - else if (.@i <= 500) callsub L_Bag,12532,1; //Royal_Jelly_Box2 - else if (.@i <= 550) callsub L_Bag,12533,1; //Blue_Herb_Box2 - else if (.@i <= 600) callsub L_Bag,505,10; //Blue_Potion - else if (.@i <= 800) callsub L_Bag,644,1; //Gift_Box - else if (.@i <= 810) callsub L_Bag,607,2; //Yggdrasilberry - else if (.@i <= 820) callsub L_Bag,608,3; //Seed_Of_Yggdrasil - else if (.@i <= 830) callsub L_Bag,12292,10; //Unripe_Fruit - else if (.@i <= 840) callsub L_Bag,12293,10; //Dried_Yggdrasilberry - else if (.@i <= 940) callsub L_Bag,12679,1; //Sg_White_Potion_Box - else if (.@i <= 1140) callsub L_Bag,603,1; //Old_Blue_Box - else if (.@i <= 1240) callsub L_Bag,12550,1,"Poison Bottle Box(30)"; //Poison_Bottle_Box2 - else if (.@i <= 1340) callsub L_Bag,12020,20; //Water_Of_Darkness - else if (.@i <= 1440) callsub L_Bag,12030,10; //Box_Of_Grudge - else if (.@i <= 1540) callsub L_Bag,12031,10; //Sleepy_Box - else if (.@i <= 1690) callsub L_Bag,12033,4; //Box_Of_Sunlight - else if (.@i <= 1790) callsub L_Bag,12114,10,"Elemental Converter[Fire]"; //Elemental_Fire - else if (.@i <= 1890) callsub L_Bag,12115,10,"Elemental Converter[Water]"; //Elemental_Water - else if (.@i <= 1990) callsub L_Bag,12117,10,"Elemental Converter[Wind]"; //Elemental_Wind - else if (.@i <= 2090) callsub L_Bag,12116,10,"Elemental Converter[Earth]"; //Elemental_Earth - else if (.@i <= 2190) callsub L_Bag,12680,1; //Sg_Blue_Potion_Box - else if (.@i <= 2290) callsub L_Bag,12118,10; //Resist_Fire - else if (.@i <= 2390) callsub L_Bag,12119,10; //Resist_Water - else if (.@i <= 2490) callsub L_Bag,12121,10; //Resist_Wind - else if (.@i <= 2590) callsub L_Bag,12120,10; //Resist_Earth - else if (.@i <= 2690) callsub L_Bag,929,40; //Immortal_Heart - else if (.@i <= 2790) callsub L_Bag,1059,40; //Transparent_Cloth - else if (.@i <= 2890) callsub L_Bag,905,40; //Stem - else if (.@i <= 2990) callsub L_Bag,606,20; //Aloebera - else if (.@i <= 3090) callsub L_Bag,609,20; //Amulet - else if (.@i <= 3190) callsub L_Bag,710,4; //Illusion_Flower - else if (.@i <= 3290) callsub L_Bag,576,40; //Prickly_Fruit - else if (.@i <= 3390) callsub L_Bag,621,20; //Bitter_Herb - else if (.@i <= 3490) callsub L_Bag,709,20; //Izidor - else if (.@i <= 3590) callsub L_Bag,605,20; //Anodyne - else if (.@i <= 3690) callsub L_Bag,11548,20; //Woe_White_Potion - else if (.@i <= 3790) callsub L_Bag,706,20; //Four_Leaf_Clover - else if (.@i <= 3890) callsub L_Bag,521,20; //Leaflet_Of_Aloe - else if (.@i <= 3990) callsub L_Bag,707,20; //Singing_Plant - else if (.@i <= 4090) callsub L_Bag,610,20; //Leaf_Of_Yggdrasil - else if (.@i <= 4140) callsub L_Bag,12676,1; //Sg_Violet_Potion_Box - else if (.@i <= 4240) callsub L_Bag,6249,20; //Savage_Meat - else if (.@i <= 4340) callsub L_Bag,6252,20; //Wolf_Blood - else if (.@i <= 4440) callsub L_Bag,6254,20; //Beef_Head_Meat - else if (.@i <= 4540) callsub L_Bag,6253,20; //Cold_Ice - else if (.@i <= 4640) callsub L_Bag,6256,20; //Ice_Fragment - else if (.@i <= 4740) callsub L_Bag,6257,20; //Ice_Crystal - else if (.@i <= 4840) callsub L_Bag,6260,20; //Petti_Tail - else if (.@i <= 4940) callsub L_Bag,7932,40; //Poison_Herb_Nerium - else if (.@i <= 5040) callsub L_Bag,7933,40; //Poison_Herb_Rantana - else if (.@i <= 5140) callsub L_Bag,7934,40; //Poison_Herb_Makulata - else if (.@i <= 5240) callsub L_Bag,7935,40; //Poison_Herb_Seratum - else if (.@i <= 5340) callsub L_Bag,7936,40; //Poison_Herb_Scopolia - else if (.@i <= 5440) callsub L_Bag,7937,40; //Poison_Herb_Amoena - else if (.@i <= 5540) callsub L_Bag,6217,40; //Mandragora_Flowerpot - else if (.@i <= 6000) callsub L_Bag,12016,20; //Speed_Up_Potion - else if (.@i <= 6500) callsub L_Bag,2483,1; //Siege_Greave - else if (.@i <= 7000) callsub L_Bag,2484,1; //Siege_Boots - else if (.@i <= 7500) callsub L_Bag,2485,1; //Siege_Shoes - else if (.@i <= 8000) callsub L_Bag,2586,1; //Siege_Manteau - else if (.@i <= 8500) callsub L_Bag,2587,1; //Siege_Muffler - else if (.@i <= 9000) callsub L_Bag,15046,1; //Siege_Plate - else if (.@i <= 9500) callsub L_Bag,15047,1; //Siege_Suits - else callsub L_Bag,15048,1; //Siege_Robe + delitem(Thanks_Invest_Ticket, 50); + .@i = rand(1, 10000); + if (.@i <= 100) + callsub(L_Bag, White_Potion_Box, 1); + else if (.@i <= 200) + callsub(L_Bag, White_Slim_Pot_Box2, 1); + else if (.@i <= 250) + callsub(L_Bag, Woe_Blue_Potion, 20); + else if (.@i <= 450) + callsub(L_Bag, Old_Violet_Box, 1); + else if (.@i <= 500) + callsub(L_Bag, Royal_Jelly_Box2, 1); + else if (.@i <= 550) + callsub(L_Bag, Blue_Herb_Box2, 1); + else if (.@i <= 600) + callsub(L_Bag, Blue_Potion, 10); + else if (.@i <= 800) + callsub(L_Bag, Gift_Box, 1); + else if (.@i <= 810) + callsub(L_Bag, Yggdrasilberry, 2); + else if (.@i <= 820) + callsub(L_Bag, Seed_Of_Yggdrasil, 3); + else if (.@i <= 830) + callsub(L_Bag, Unripe_Fruit, 10); + else if (.@i <= 840) + callsub(L_Bag, Dried_Yggdrasilberry, 10); + else if (.@i <= 940) + callsub(L_Bag, Sg_White_Potion_Box, 1); + else if (.@i <= 1140) + callsub(L_Bag, Old_Blue_Box, 1); + else if (.@i <= 1240) + callsub(L_Bag, Poison_Bottle_Box2, 1, "Poison Bottle Box(30)"); + else if (.@i <= 1340) + callsub(L_Bag, Water_Of_Darkness, 20); + else if (.@i <= 1440) + callsub(L_Bag, Box_Of_Grudge, 10); + else if (.@i <= 1540) + callsub(L_Bag, Sleepy_Box, 10); + else if (.@i <= 1690) + callsub(L_Bag, Box_Of_Sunlight, 4); + else if (.@i <= 1790) + callsub(L_Bag, Elemental_Fire, 10, "Elemental Converter[Fire]"); + else if (.@i <= 1890) + callsub(L_Bag, Elemental_Water, 10, "Elemental Converter[Water]"); + else if (.@i <= 1990) + callsub(L_Bag, Elemental_Wind, 10, "Elemental Converter[Wind]"); + else if (.@i <= 2090) + callsub(L_Bag, Elemental_Earth, 10, "Elemental Converter[Earth]"); + else if (.@i <= 2190) + callsub(L_Bag, Sg_Blue_Potion_Box, 1); + else if (.@i <= 2290) + callsub(L_Bag, Resist_Fire, 10); + else if (.@i <= 2390) + callsub(L_Bag, Resist_Water, 10); + else if (.@i <= 2490) + callsub(L_Bag, Resist_Wind, 10); + else if (.@i <= 2590) + callsub(L_Bag, Resist_Earth, 10); + else if (.@i <= 2690) + callsub(L_Bag, Immortal_Heart, 40); + else if (.@i <= 2790) + callsub(L_Bag, Transparent_Cloth, 40); + else if (.@i <= 2890) + callsub(L_Bag, Stem, 40); + else if (.@i <= 2990) + callsub(L_Bag, Aloebera, 20); + else if (.@i <= 3090) + callsub(L_Bag, Amulet, 20); + else if (.@i <= 3190) + callsub(L_Bag, Illusion_Flower, 4); + else if (.@i <= 3290) + callsub(L_Bag, Prickly_Fruit, 40); + else if (.@i <= 3390) + callsub(L_Bag, Bitter_Herb, 20); + else if (.@i <= 3490) + callsub(L_Bag, Izidor, 20); + else if (.@i <= 3590) + callsub(L_Bag, Anodyne, 20); + else if (.@i <= 3690) + callsub(L_Bag, Woe_White_Potion, 20); + else if (.@i <= 3790) + callsub(L_Bag, Four_Leaf_Clover, 20); + else if (.@i <= 3890) + callsub(L_Bag, Leaflet_Of_Aloe, 20); + else if (.@i <= 3990) + callsub(L_Bag, Singing_Plant, 20); + else if (.@i <= 4090) + callsub(L_Bag, Leaf_Of_Yggdrasil, 20); + else if (.@i <= 4140) + callsub(L_Bag, Sg_Violet_Potion_Box, 1); + else if (.@i <= 4240) + callsub(L_Bag, Savage_Meat, 20); + else if (.@i <= 4340) + callsub(L_Bag, Wolf_Blood, 20); + else if (.@i <= 4440) + callsub(L_Bag, Beef_Head_Meat, 20); + else if (.@i <= 4540) + callsub(L_Bag, Cold_Ice, 20); + else if (.@i <= 4640) + callsub(L_Bag, Ice_Fragment, 20); + else if (.@i <= 4740) + callsub(L_Bag, Ice_Crystal, 20); + else if (.@i <= 4840) + callsub(L_Bag, Petti_Tail, 20); + else if (.@i <= 4940) + callsub(L_Bag, Poison_Herb_Nerium, 40); + else if (.@i <= 5040) + callsub(L_Bag, Poison_Herb_Rantana, 40); + else if (.@i <= 5140) + callsub(L_Bag, Poison_Herb_Makulata, 40); + else if (.@i <= 5240) + callsub(L_Bag, Poison_Herb_Seratum, 40); + else if (.@i <= 5340) + callsub(L_Bag, Poison_Herb_Scopolia, 40); + else if (.@i <= 5440) + callsub(L_Bag, Poison_Herb_Amoena, 40); + else if (.@i <= 5540) + callsub(L_Bag, Mandragora_Flowerpot, 40); + else if (.@i <= 6000) + callsub(L_Bag, Speed_Up_Potion, 20); + else if (.@i <= 6500) + callsub(L_Bag, Siege_Greave, 1); + else if (.@i <= 7000) + callsub(L_Bag, Siege_Boots, 1); + else if (.@i <= 7500) + callsub(L_Bag, Siege_Shoes, 1); + else if (.@i <= 8000) + callsub(L_Bag, Siege_Manteau, 1); + else if (.@i <= 8500) + callsub(L_Bag, Siege_Muffler, 1); + else if (.@i <= 9000) + callsub(L_Bag, Siege_Plate, 1); + else if (.@i <= 9500) + callsub(L_Bag, Siege_Suits, 1); + else + callsub(L_Bag, Siege_Robe, 1); end; } end; diff --git a/npc/woe-se/agit_main_se.txt b/npc/woe-se/agit_main_se.txt index c9b34f610..5f291e658 100644 --- a/npc/woe-se/agit_main_se.txt +++ b/npc/woe-se/agit_main_se.txt @@ -1681,6 +1681,10 @@ OnEnable: if (.@num == 3) set getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)),4; else if (.@num) set getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)),6; setwall strnpcinfo(NPC_NAME_HIDDEN),.@wall[0],.@wall[1],.@wall[2],.@wall[3],.@wall[4],substr(strnpcinfo(NPC_NAME_HIDDEN),0,1)+substr(strnpcinfo(NPC_NAME_HIDDEN),8,9)+"_"+strnpcinfo(NPC_NAME_VISIBLE); + if (.@num == 0) + setcell(strnpcinfo(NPC_NAME_HIDDEN), .@x[0], .@y[0], .@x[getarraysize(.@x)-1], .@y[getarraysize(.@y)-1], cell_basilica, true); + if (.@num == 1 && (strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas01" || strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas04" || strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas05")) + setcell(strnpcinfo(NPC_NAME_HIDDEN), .@x[0], .@y[0], .@x[5], .@y[5], cell_basilica, true); .@j = (getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)))?getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)):getarraysize(.@x); for (.@i = 0; .@i<.@j; ++.@i) guardian strnpcinfo(NPC_NAME_HIDDEN),.@x[.@i],.@y[.@i]," ",1905,strnpcinfo(NPC_NAME)+"::OnBarrierDestroyed"; @@ -1700,6 +1704,31 @@ OnBarrierDestroyed: end; OnDisable: + if (compare(strnpcinfo(NPC_NAME_HIDDEN),"arug")) { + if (strnpcinfo(NPC_NAME_HIDDEN) == "arug_cas01") { + setarray(.@x[0], 239, 245); + setarray(.@y[0], 73, 73); + } else if (strnpcinfo(NPC_NAME_HIDDEN) == "arug_cas02") { + setarray(.@x[0], 137, 143); + setarray(.@y[0], 137, 137); + } else { // Castles 3, 4, 5 are identical. + setarray(.@x[0], 139, 145); + setarray(.@y[0], 111, 111); + } + } else { + if (strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas02") { + setarray(.@x[0], 289, 289); + setarray(.@y[0], 98, 104); + } else if (strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas03") { + setarray(.@x[0], 326, 330); + setarray(.@y[0], 300, 300); + } else { // Castles 1, 4, 5 are identical. + setarray(.@x[0], 115, 125); + setarray(.@y[0], 49, 49); + setcell(strnpcinfo(NPC_NAME_HIDDEN), 115, 50, 125, 50, cell_basilica, false); + } + } + setcell(strnpcinfo(NPC_NAME_HIDDEN), .@x[0], .@y[0], .@x[1], .@y[1], cell_basilica, false); delwall substr(strnpcinfo(NPC_NAME_HIDDEN),0,1)+substr(strnpcinfo(NPC_NAME_HIDDEN),8,9)+"_"+strnpcinfo(NPC_NAME_VISIBLE); killmonster strnpcinfo(NPC_NAME_HIDDEN),strnpcinfo(NPC_NAME)+"::OnBarrierDestroyed"; end; diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql index 825a51c5b..c639f2226 100644 --- a/sql-files/item_db_re.sql +++ b/sql-files/item_db_re.sql @@ -1633,7 +1633,7 @@ REPLACE INTO `item_db` VALUES ('2472','Shoes_Of_Judgement','Shoes Of Judgement', REPLACE INTO `item_db` VALUES ('2473','Para_Team_Boots4','Eden Group Boots IV','5','0','0','0','0','0','20','0','0','18446744073709551615','63','2','64','0','60',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,1; bonus bVit,1; bonus bHPrecovRate,28; bonus bSPrecovRate,12;','',''); REPLACE INTO `item_db` VALUES ('2474','Lehmannza_Shoes','Lehmannza Shoes','5','20','10','500','0','0','3','0','1','18446744073709551615','63','2','64','0','60',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,3;','',''); REPLACE INTO `item_db` VALUES ('2475','Ur_Greave','Ur\'s Greaves','5','20','10','900','0','0','32','0','1','128','56','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,40; if(getequiprefinerycnt(EQI_SHOES)>7) bonus bMaxHPrate,getequiprefinerycnt(EQI_SHOES)-7;','',''); -REPLACE INTO `item_db` VALUES ('2476','Peuz_Greave','Peuz\'s Greaves','5','20','10','900','0','0','32','0','1','128','56','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,40; bonus bAgi,-7+min(getequiprefinerycnt(EQI_SHOES),8);','',''); +REPLACE INTO `item_db` VALUES ('2476','Peuz_Greave','Peuz\'s Greaves','5','20','10','900','0','0','32','0','1','128','56','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,40; if (getrefine() >= 8) bonus bAgi, getrefine() - 7;','',''); REPLACE INTO `item_db` VALUES ('2477','Sabah_Shoes','Sapha Shoes','5','20','10','400','0','0','18','0','1','4096','56','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,30; bonus bLuk,3;','',''); REPLACE INTO `item_db` VALUES ('2478','Nab_Shoes','Nab Shoes','5','20','10','400','0','0','18','0','1','4096','56','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bFlee,3; bonus bInt,2;','',''); REPLACE INTO `item_db` VALUES ('2479','White_Wing_Boots','White Wing Boots','5','20','10','400','0','0','18','0','1','2048','56','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2; bonus2 bSkillUseSP,RA_AIMEDBOLT,10;','',''); @@ -9768,7 +9768,7 @@ REPLACE INTO `item_db` VALUES ('22077','Red_Eco_Friendly_Shoes','Red Eco-Friendl REPLACE INTO `item_db` VALUES ('22083','Private_Doram_Shoes','Private Doram Shoes','4','20','10','500','0','0','25','0','1','0','63','2','64','0','100',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHP, 100; bonus bMaxSP, 50; bonus bHPrecovRate, getrefine() * 10 / 3; bonus bSPrecovRate, getrefine() * 10 / 3;','',''); REPLACE INTO `item_db` VALUES ('22084','Luxury_Doram_Shoes','Luxury Doram Shoes','4','20','10','600','0','0','30','0','1','0','63','2','64','0','140',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHP, 300; bonus bMaxSP, 100; bonus bHPrecovRate, 20 * getrefine() / 3; bonus bSPrecovRate, 20 * getrefine() / 3;','',''); REPLACE INTO `item_db` VALUES ('22085','Elegant_Doram_Shoes','Elegant Doram Shoes','4','20','10','700','0','0','35','0','1','0','63','2','64','0','175',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHPrate, 10; bonus bMaxSPrate, 5; bonus bMaxHP, 100 * getrefine() / 2; bonus bMaxSP, 20 * getrefine() / 2; if ((getrefine() / 2) >= 4) bonus2 bSkillUseSP, SU_LOPE, 5;','',''); -REPLACE INTO `item_db` VALUES ('22508','Para_Team_Mark_','Eden Group Mark','11','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','1200000','507',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT), \"AL_TELEPORT\", 3;','',''); +REPLACE INTO `item_db` VALUES ('22508','Para_Team_Mark_','Eden Group Mark','11','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','1200000','507',NULL,'0',NULL,'0',NULL,'0','warp \"moc_para01\", 171, 115;','',''); REPLACE INTO `item_db` VALUES ('22514','Candy_Holder','Candy Holder','11','20','10','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','',''); REPLACE INTO `item_db` VALUES ('22515','Key_Of_Twisted_Time','Twisted Key of Time','3','10','5','300','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','',''); REPLACE INTO `item_db` VALUES ('22540','Runstone_Lux','Lux Anima Rune','11','2','1','100','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','60000','475',NULL,'0',NULL,'20','1','0','itemskill RK_LUXANIMA,1;','',''); diff --git a/src/char/char.c b/src/char/char.c index 9314e8c81..f47a8cc3c 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1544,7 +1544,7 @@ int char_check_char_name(char * name, char * esc_name) * -5: 'Symbols in Character Names are forbidden' * char_id: Success **/ -int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int16 starting_class) +int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int16 starting_class, uint8 sex) { char name[NAME_LENGTH]; char esc_name[NAME_LENGTH*2+1]; @@ -1587,17 +1587,17 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int if( sd->found_char[slot] != -1 ) return -2; /* character account limit exceeded */ + #if PACKETVER >= 20120307 // Insert the new char entry to the database if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `status_point`,`str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`," - "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES (" - "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')", + "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`, `sex`) VALUES (" + "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%c')", char_db, sd->account_id , slot, esc_name, starting_class, start_zeny, 48, str, agi, vit, int_, dex, luk, (40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color, - mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) ) - { - Sql_ShowDebug(inter->sql_handle); - return -2; //No, stop the procedure! + mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y, sex)) { + Sql_ShowDebug(inter->sql_handle); + return -2; //No, stop the procedure! } #else //Insert the new char entry to the database @@ -1647,7 +1647,7 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int } } - ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s\n", sd->account_id, char_id, slot, name); + ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s, sex: %c\n", sd->account_id, char_id, slot, name, sex); return char_id; } @@ -4633,13 +4633,25 @@ void char_parse_char_create_new_char(int fd, struct char_session_data* sd) //turn character creation on/off [Kevin] result = -2; } else { - #if PACKETVER >= 20151001 - result = chr->make_new_char_sql(sd, RFIFOP(fd,2), 1, 1, 1, 1, 1, 1, RFIFOB(fd,26), RFIFOW(fd,27), RFIFOW(fd,29), RFIFOW(fd, 31)); - #elif PACKETVER >= 20120307 - result = chr->make_new_char_sql(sd, RFIFOP(fd,2), 1, 1, 1, 1, 1, 1, RFIFOB(fd,26), RFIFOW(fd,27), RFIFOW(fd,29), JOB_NOVICE); - #else - result = chr->make_new_char_sql(sd, RFIFOP(fd,2), RFIFOB(fd,26), RFIFOB(fd,27), RFIFOB(fd,28), RFIFOB(fd,29), RFIFOB(fd,30), RFIFOB(fd,31), RFIFOB(fd,32), RFIFOW(fd,33), RFIFOW(fd,35), JOB_NOVICE); - #endif +#if PACKETVER >= 20151001 + uint8 sex = RFIFOB(fd, 35); + + switch (sex) { + case SEX_FEMALE: + sex = 'F'; + break; + case SEX_MALE: + sex = 'M'; + break; + default: + return -2; // Char Creation Denied + } + result = chr->make_new_char_sql(sd, RFIFOP(fd, 2), 1, 1, 1, 1, 1, 1, RFIFOB(fd, 26), RFIFOW(fd, 27), RFIFOW(fd, 29), RFIFOW(fd, 31), sex); +#elif PACKETVER >= 20120307 + result = chr->make_new_char_sql(sd, RFIFOP(fd, 2), 1, 1, 1, 1, 1, 1, RFIFOB(fd, 26), RFIFOW(fd, 27), RFIFOW(fd, 29), JOB_NOVICE, 'U'); +#else + result = chr->make_new_char_sql(sd, RFIFOP(fd, 2), RFIFOB(fd, 26), RFIFOB(fd, 27), RFIFOB(fd, 28), RFIFOB(fd, 29), RFIFOB(fd, 30), RFIFOB(fd, 31), RFIFOB(fd, 32), RFIFOW(fd, 33), RFIFOW(fd, 35), JOB_NOVICE, 'U'); +#endif } //'Charname already exists' (-1), 'Char creation denied' (-2) and 'You are underaged' (-3) @@ -5042,7 +5054,7 @@ int char_parse_char(int fd) // S 0a39 <name>.24B <slot>.B <hair color>.W <hair style>.W <starting job class ID>.W <Unknown>.(W or 2 B's)??? <sex>.B case 0xa39: { - FIFOSD_CHECK(36); + FIFOSD_CHECK(36); #elif PACKETVER >= 20120307 // S 0970 <name>.24B <slot>.B <hair color>.W <hair style>.W case 0x970: diff --git a/src/char/char.h b/src/char/char.h index d7bc96e13..499b633f7 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -147,7 +147,7 @@ struct char_interface { bool (*char_slotchange) (struct char_session_data *sd, int fd, unsigned short from, unsigned short to); int (*rename_char_sql) (struct char_session_data *sd, int char_id); int (*check_char_name) (char * name, char * esc_name); - int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job); + int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex); int (*divorce_char_sql) (int partner_id1, int partner_id2); int (*count_users) (void); int (*mmo_char_tobuf) (uint8* buffer, struct mmo_charstatus* p); diff --git a/src/char/int_party.c b/src/char/int_party.c index 2fc39c328..921bf6d9d 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -633,31 +633,21 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) return 0; //Member not found? mapif->party_withdraw(party_id, account_id, char_id); - - if (p->party.member[i].leader){ - p->party.member[i].account_id = 0; - for (j = 0; j < MAX_PARTY; j++) { - if (!p->party.member[j].account_id) - continue; - mapif->party_withdraw(party_id, p->party.member[j].account_id, p->party.member[j].char_id); - p->party.member[j].account_id = 0; - } - //Party gets deleted on the check_empty call below. - } else { - inter_party->tosql(&p->party,PS_DELMEMBER,i); - j = p->party.member[i].lv; - if(p->party.member[i].online) p->party.count--; - memset(&p->party.member[i], 0, sizeof(struct party_member)); - p->size--; - if (j == p->min_lv || j == p->max_lv || p->family) - { - if(p->family) p->family = 0; //Family state broken. - inter_party->check_lv(p); - } + + j = p->party.member[i].lv; + if (p->party.member[i].online > 0) + p->party.count--; + memset(&p->party.member[i], 0, sizeof(struct party_member)); + p->size--; + if (j == p->min_lv || j == p->max_lv || p->family) { + if(p->family) p->family = 0; //Family state broken. + inter_party->check_lv(p); } - if (inter_party->check_empty(p) == 0) + if (inter_party->check_empty(p) == 0) { + inter_party->tosql(&p->party, PS_DELMEMBER, i); mapif->party_info(-1, &p->party, 0); + } return 0; } // When member goes to other map or levels up. diff --git a/src/common/core.c b/src/common/core.c index 74c63a6d6..9a131d042 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -404,6 +404,8 @@ int cmdline_exec(int argc, char **argv, unsigned int options) struct CmdlineArgData *data = NULL; const char *arg = argv[i]; if (arg[0] != '-') { // All arguments must begin with '-' + if ((options&(CMDLINE_OPT_SILENT|CMDLINE_OPT_PREINIT)) != 0) + continue; ShowError("Invalid option '%s'.\n", argv[i]); exit(EXIT_FAILURE); } diff --git a/src/common/md5calc.c b/src/common/md5calc.c index bd6b48f10..d2fc32371 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -168,16 +168,15 @@ static void md5_Round_Calculate(const unsigned char *block, } /// @copydoc md5_interface::binary() -static void md5_string2binary(const char *string, unsigned char *output) +static void md5_buf2binary(const uint8 *buf, const int buf_size, uint8 *output) { //var /*8bit*/ unsigned char padding_message[64]; //Extended message 512bit 64byte - const unsigned char *pstring; // The position of string in the present scanning notes is held. + const uint8 *pbuf; // The position of string in the present scanning notes is held. /*32bit*/ - unsigned int string_byte_len, //The byte chief of string is held. - string_bit_len, //The bit length of string is held. + unsigned int buf_bit_len, //The bit length of string is held. copy_len, //The number of bytes which is used by 1-3 and which remained msg_digest[4]; //Message digest 128bit 4byte unsigned int *A = &msg_digest[0], //The message digest in accordance with RFC (reference) @@ -195,16 +194,15 @@ static void md5_string2binary(const char *string, unsigned char *output) //Step 1.Append Padding Bits (extension of a mark bit) //1-1 - string_byte_len = (unsigned int)strlen(string); //The byte chief of a character sequence is acquired. - pstring = (const unsigned char *)string; // The position of the present character sequence is set. + pbuf = buf; // The position of the present character sequence is set. //1-2 Repeat calculation until length becomes less than 64 bytes. - for (i=string_byte_len; 64<=i; i-=64,pstring+=64) - md5_Round_Calculate(pstring, A,B,C,D); + for (i=buf_size; 64<=i; i-=64,pbuf+=64) + md5_Round_Calculate(pbuf, A,B,C,D); //1-3 - copy_len = string_byte_len % 64; //The number of bytes which remained is computed. - strncpy((char *)padding_message, (const char *)pstring, copy_len); // A message is copied to an extended bit sequence. + copy_len = buf_size % 64; //The number of bytes which remained is computed. + strncpy((char *)padding_message, (const char *)pbuf, copy_len); // A message is copied to an extended bit sequence. memset(padding_message+copy_len, 0, 64 - copy_len); //It buries by 0 until it becomes extended bit length. padding_message[copy_len] |= 0x80; //The next of a message is 1. @@ -216,12 +214,12 @@ static void md5_string2binary(const char *string, unsigned char *output) } //Step 2.Append Length (the information on length is added) - string_bit_len = string_byte_len * 8; //From the byte chief to bit length (32 bytes of low rank) - memcpy(&padding_message[56], &string_bit_len, 4); //32 bytes of low rank is set. + buf_bit_len = buf_size * 8; //From the byte chief to bit length (32 bytes of low rank) + memcpy(&padding_message[56], &buf_bit_len, 4); //32 bytes of low rank is set. //When bit length cannot be expressed in 32 bytes of low rank, it is a beam raising to a higher rank. - if (UINT_MAX / 8 < string_byte_len) { - unsigned int high = (string_byte_len - UINT_MAX / 8) * 8; + if (UINT_MAX / 8 < (unsigned int)buf_size) { + unsigned int high = (buf_size - UINT_MAX / 8) * 8; memcpy(&padding_message[60], &high, 4); } else { memset(&padding_message[60], 0, 4); //In this case, it is good for a higher rank at 0. @@ -237,12 +235,12 @@ static void md5_string2binary(const char *string, unsigned char *output) /// @copydoc md5_interface::string() void md5_string(const char *string, char *output) { - unsigned char digest[16]; + uint8 digest[16]; nullpo_retv(string); nullpo_retv(output); - md5->binary(string,digest); + md5->binary((const uint8 *)string, (int)strlen(string), digest); snprintf(output, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", digest[ 0], digest[ 1], digest[ 2], digest[ 3], digest[ 4], digest[ 5], digest[ 6], digest[ 7], @@ -267,7 +265,7 @@ void md5_salt(int len, char *output) void md5_defaults(void) { md5 = &md5_s; - md5->binary = md5_string2binary; + md5->binary = md5_buf2binary; md5->string = md5_string; md5->salt = md5_salt; } diff --git a/src/common/md5calc.h b/src/common/md5calc.h index b4d4995f9..f55ebe312 100644 --- a/src/common/md5calc.h +++ b/src/common/md5calc.h @@ -46,7 +46,7 @@ struct md5_interface { * @param[in] string The source string. * @param[out] output Output buffer (at least 16 bytes available). */ - void (*binary) (const char *string, unsigned char *output); + void (*binary) (const uint8 *buf, const int buf_size, uint8 *output); /** * Generates a random salt. diff --git a/src/common/mmo.h b/src/common/mmo.h index 9c29b8a0e..16bc978bf 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -114,7 +114,15 @@ #define MAX_INVENTORY 100 //Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well. -#define MAX_CHARS 9 +#if PACKETVER >= 20100413 +#ifndef MAX_CHARS + #define MAX_CHARS 12 +#endif +#else +#ifndef MAX_CHARS + #define MAX_CHARS 9 +#endif +#endif //Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex] //Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size. #define MAX_SLOTS 4 diff --git a/src/common/strlib.c b/src/common/strlib.c index 75ce2a272..df8093456 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -344,6 +344,7 @@ int strlib_config_switch(const char *str) { } /// strncpy that always null-terminates the string +/// @remark this function will read at most `n` - 1 bytes from `src` (from 0 to `n` - 2) char *strlib_safestrncpy(char *dst, const char *src, size_t n) { if( n > 0 ) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2beb6c634..881e50497 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8366,6 +8366,36 @@ void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommand dbi_destroy(iter); clif->message(fd,line_buff); + if (atcommand->binding_count > 0) { + int i, count_bind = 0; + int gm_lvl = pc_get_group_level(sd); + + for (i = 0; i < atcommand->binding_count; i++) { + if (gm_lvl >= ((type == COMMAND_ATCOMMAND) ? atcommand->binding[i]->group_lv : atcommand->binding[i]->group_lv_char)) { + size_t slen = strlen(atcommand->binding[i]->command); + if (count_bind == 0) { + cur = line_buff; + memset(line_buff, ' ', CHATBOX_SIZE); + line_buff[CHATBOX_SIZE - 1] = 0; + clif->message(fd, "------------------"); + clif->message(fd, "Custom commands:"); + } + if (slen + cur - line_buff >= CHATBOX_SIZE) { + clif->message(fd, line_buff); + cur = line_buff; + memset(line_buff, ' ', CHATBOX_SIZE); + line_buff[CHATBOX_SIZE - 1] = 0; + } + memcpy(cur, atcommand->binding[i]->command, slen); + cur += slen + (10 - slen % 10); + count_bind++; + } + } + if (count_bind > 0) + clif->message(fd, line_buff); // Last Line + count += count_bind; + } + safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,274), count); // "%d commands found." clif->message(fd, atcmd_output); diff --git a/src/map/battle.c b/src/map/battle.c index bb20b94ff..8b6ac2cc0 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6814,14 +6814,23 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( flag&(BCT_PARTY|BCT_ENEMY) ) { int s_party = status->get_party_id(s_bl); int s_guild = status->get_guild_id(s_bl); - - if( s_party && s_party == status->get_party_id(t_bl) - && !(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty) - && !(map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !( s_guild && s_guild == status->get_guild_id(t_bl) )) - && (!map->list[m].flag.battleground || sbg_id == tbg_id) ) - state |= BCT_PARTY; - else + int t_guild = status->get_guild_id(t_bl); + + if (s_party && s_party == status->get_party_id(t_bl)) { + if (map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !(s_guild && s_guild == t_guild)) { + if (t_guild && guild->isallied(s_guild, t_guild)) + state |= BCT_PARTY; + else + state |= flag&BCT_ENEMY ? BCT_ENEMY : BCT_PARTY; + } else if (!(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty) + && (!map->list[m].flag.battleground || sbg_id == tbg_id)) { + state |= BCT_PARTY; + } else { + state |= BCT_ENEMY; + } + } else { state |= BCT_ENEMY; + } } if( flag&(BCT_GUILD|BCT_ENEMY) ) { int s_guild = status->get_guild_id(s_bl); @@ -7167,6 +7176,7 @@ static const struct battle_data { { "castrate_dex_scale", &battle_config.castrate_dex_scale, 150, 1, INT_MAX, }, { "vcast_stat_scale", &battle_config.vcast_stat_scale, 530, 1, INT_MAX, }, { "area_size", &battle_config.area_size, 14, 0, INT_MAX, }, + { "chat_area_size", &battle_config.chat_area_size, 9, 0, INT_MAX, }, { "zeny_from_mobs", &battle_config.zeny_from_mobs, 0, 0, 1, }, { "mobs_level_up", &battle_config.mobs_level_up, 0, 0, 1, }, { "mobs_level_up_exp_rate", &battle_config.mobs_level_up_exp_rate, 1, 1, INT_MAX, }, @@ -7320,6 +7330,7 @@ static const struct battle_data { { "player_warp_keep_direction", &battle_config.player_warp_keep_direction, 0, 0, 1, }, { "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, }, { "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, }, + { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, }, }; #ifndef STATS_OPT_OUT /** @@ -7598,6 +7609,13 @@ void battle_adjust_conf(void) { } #endif +#if PACKETVER < 20131223 + if (battle_config.mvp_exp_reward_message) { + ShowWarning("conf/map/battle/client.conf MVP EXP reward message is enabled but it requires PACKETVER 2013-12-23 or newer, disabling...\n"); + battle_config.mvp_exp_reward_message = 0; + } +#endif + #ifndef CELL_NOSTACK if (battle_config.custom_cell_stack_limit != 1) ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n"); diff --git a/src/map/battle.h b/src/map/battle.h index 7e7048a38..b7bde1aa9 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -362,6 +362,7 @@ struct Battle_Config { int castrate_dex_scale; // added by [MouseJstr] int area_size; // added by [MouseJstr] + int chat_area_size; // added by [gumi] int max_def, over_def_bonus; //added by [Skotlex] @@ -546,6 +547,7 @@ struct Battle_Config { int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs int max_summoner_parameter; // Summoner Max Stats + int mvp_exp_reward_message; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/clif.c b/src/map/clif.c index 887fa9d64..9e20510ad 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -451,8 +451,8 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target break; case AREA_CHAT_WOC: nullpo_retr(true, bl); - map->foreachinarea(clif->send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5), - bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC); + map->foreachinarea(clif->send_sub, bl->m, bl->x-CHAT_AREA_SIZE, bl->y-CHAT_AREA_SIZE, + bl->x+CHAT_AREA_SIZE, bl->y+CHAT_AREA_SIZE, BL_PC, buf, len, bl, AREA_WOC); break; case CHAT: @@ -677,7 +677,8 @@ void clif_authok(struct map_session_data *sd) #if PACKETVER >= 20080102 p.font = sd->status.font; #endif -#if PACKETVER >= 20141016 +// Some clients smaller than 20160330 cant be tested [4144] +#if PACKETVER >= 20141016 && PACKETVER < 20160330 p.sex = sd->status.sex; #endif clif->send(&p,sizeof(p),&sd->bl,SELF); @@ -1077,15 +1078,21 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu #endif #if PACKETVER >= 20150513 p.body = vd->body_style; +#endif +/* Might be earlier, this is when the named item bug began */ +#if PACKETVER >= 20131223 safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH); #endif - clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target); if (clif->isdisguised(bl)) { #if PACKETVER >= 20091103 p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE +#if PACKETVER >= 20131223 + p.AID = -bl->id; +#else p.GID = -bl->id; +#endif #else p.GID = -bl->id; #endif @@ -1220,6 +1227,9 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { #endif #if PACKETVER >= 20150513 p.body = vd->body_style; +#endif +/* Might be earlier, this is when the named item bug began */ +#if PACKETVER >= 20131223 safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH); #endif if (clif->isdisguised(bl)) { @@ -1228,7 +1238,11 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { clif->send(&p,sizeof(p),bl,target); #if PACKETVER >= 20091103 p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE +#if PACKETVER >= 20131223 + p.AID = -bl->id; +#else p.GID = -bl->id; +#endif #else p.GID = -bl->id; #endif @@ -1262,7 +1276,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, #endif #if PACKETVER >= 20131223 p.AID = bl->id; - p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE + p.GID = (sd) ? sd->status.char_id : 0; // CCODE #else p.GID = bl->id; #endif @@ -1312,6 +1326,9 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, #endif #if PACKETVER >= 20150513 p.body = vd->body_style; +#endif +/* Might be earlier, this is when the named item bug began */ +#if PACKETVER >= 20131223 safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH); #endif @@ -1320,7 +1337,11 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, if (clif->isdisguised(bl)) { #if PACKETVER >= 20091103 p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE +#if PACKETVER >= 20131223 + p.AID = -bl->id; +#else p.GID = -bl->id; +#endif #else p.GID = -bl->id; #endif @@ -1332,7 +1353,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, /// 01b0 <id>.L <type>.B <value>.L /// type: /// unused -void clif_class_change(struct block_list *bl, int class_, int type) +void clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd) { nullpo_retv(bl); @@ -1343,7 +1364,11 @@ void clif_class_change(struct block_list *bl, int class_, int type) WBUFL(buf,2)=bl->id; WBUFB(buf,6)=type; WBUFL(buf,7)=class_; - clif->send(buf,packet_len(0x1b0),bl,AREA); + + if (sd == NULL) + clif->send(buf, packet_len(0x1b0), bl, AREA); + else + clif->send(buf, packet_len(0x1b0), &sd->bl, SELF); } } @@ -7232,6 +7257,13 @@ void clif_mvp_item(struct map_session_data *sd,int nameid) /// 010b <exp>.L void clif_mvp_exp(struct map_session_data *sd, unsigned int exp) { +#if PACKETVER >= 20131223 // Kro removed this packet [Napster] + if (battle_config.mvp_exp_reward_message) { + char e_msg[CHAT_SIZE_MAX]; + sprintf(e_msg, msg_txt(855), exp); + clif->messagecolor_self(sd->fd, COLOR_CYAN, e_msg); // Congratulations! You are the MVP! Your reward EXP Points are %u !! + } +#else int fd; nullpo_retv(sd); @@ -7241,6 +7273,7 @@ void clif_mvp_exp(struct map_session_data *sd, unsigned int exp) WFIFOW(fd,0)=0x10b; WFIFOL(fd,2)=cap_value(exp,0,INT32_MAX); WFIFOSET(fd,packet_len(0x10b)); +#endif } /// Dropped MVP item reward message (ZC_THROW_MVPITEM). @@ -11594,7 +11627,12 @@ void clif_parse_NpcStringInput(int fd, struct map_session_data* sd) __attribute_ /// 01d5 <packet len>.W <npc id>.L <string>.?B void clif_parse_NpcStringInput(int fd, struct map_session_data* sd) { - int message_len = RFIFOW(fd,2)-8; +// [4144] can't confirm exact client version. At least >= correct for 20150513 +#if PACKETVER >= 20151029 + int message_len = RFIFOW(fd, 2) - 7; +#else + int message_len = RFIFOW(fd, 2) - 8; +#endif int npcid = RFIFOL(fd,4); const char *message = RFIFOP(fd,8); diff --git a/src/map/clif.h b/src/map/clif.h index b27adb5be..c3a42372a 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -65,6 +65,7 @@ struct view_data; #define MAX_ROULETTE_COLUMNS 9 /** client-defined value **/ #define RGB2BGR(c) (((c) & 0x0000FF) << 16 | ((c) & 0x00FF00) | ((c) & 0xFF0000) >> 16) +#define COLOR_CYAN 0x00ffffU #define COLOR_RED 0xff0000U #define COLOR_GREEN 0x00ff00U #define COLOR_WHITE 0xffffffU @@ -671,7 +672,7 @@ struct clif_interface { void (*changetraplook) (struct block_list *bl,int val); void (*refreshlook) (struct block_list *bl,int id,int type,int val,enum send_target target); void (*sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target); - void (*class_change) (struct block_list *bl,int class_,int type); + void (*class_change) (struct block_list *bl,int class_,int type, struct map_session_data *sd); void (*skill_delunit) (struct skill_unit *su); void (*skillunit_update) (struct block_list* bl); int (*clearunit_delayed_sub) (int tid, int64 tick, int id, intptr_t data); diff --git a/src/map/map.h b/src/map/map.h index b76128762..8c5372093 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -47,6 +47,7 @@ enum E_MAPSERVER_ST { #define MAX_NPC_PER_MAP 512 #define AREA_SIZE (battle->bc->area_size) +#define CHAT_AREA_SIZE (battle->bc->chat_area_size) #define DAMAGELOG_SIZE 30 #define LOOTITEM_SIZE 10 #define MAX_MOBSKILL 50 diff --git a/src/map/mob.c b/src/map/mob.c index d5932f195..74d25b805 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2832,7 +2832,7 @@ int mob_class_change (struct mob_data *md, int class_) { mob_stop_walking(md, STOPWALKING_FLAG_NONE); unit->skillcastcancel(&md->bl, 0); status->set_viewdata(&md->bl, class_); - clif->class_change(&md->bl, md->vd->class, 1); + clif->class_change(&md->bl, md->vd->class, 1, NULL); status_calc_mob(md, SCO_FIRST); md->ud.state.speed_changed = 1; //Speed change update. diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index e461eebe9..71a6bfd6e 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -141,8 +141,11 @@ enum packet_headers { authokType = 0x73, #elif PACKETVER < 20141022 authokType = 0x2eb, -#else +// Some clients smaller than 20160330 cant be tested [4144] +#elif PACKETVER < 20160330 authokType = 0xa18, +#else + authokType = 0x2eb, #endif script_clearType = 0x8d6, package_item_announceType = 0x7fd, @@ -400,7 +403,8 @@ struct packet_authok { #if PACKETVER >= 20080102 int16 font; #endif -#if PACKETVER >= 20141022 +// Some clients smaller than 20160330 cant be tested [4144] +#if PACKETVER >= 20141022 && PACKETVER < 20160330 uint8 sex; #endif } __attribute__((packed)); @@ -589,6 +593,9 @@ struct packet_spawn_unit { #endif #if PACKETVER >= 20150513 int16 body; +#endif +/* Might be earlier, this is when the named item bug began */ +#if PACKETVER >= 20131223 char name[NAME_LENGTH]; #endif } __attribute__((packed)); @@ -657,6 +664,9 @@ struct packet_unit_walking { #endif #if PACKETVER >= 20150513 int16 body; +#endif +/* Might be earlier, this is when the named item bug began */ +#if PACKETVER >= 20131223 char name[NAME_LENGTH]; #endif } __attribute__((packed)); @@ -723,6 +733,9 @@ struct packet_idle_unit { #endif #if PACKETVER >= 20150513 int16 body; +#endif +/* Might be earlier, this is when the named item bug began */ +#if PACKETVER >= 20131223 char name[NAME_LENGTH]; #endif } __attribute__((packed)); diff --git a/src/map/party.c b/src/map/party.c index 3bf9542c7..26b4bae8b 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -274,6 +274,7 @@ int party_recv_info(const struct party *sp, int char_id) int added_count = 0; int j; int member_id; + int leader_account_id = 0, leader_char_id = 0; nullpo_ret(sp); @@ -287,8 +288,12 @@ int party_recv_info(const struct party *sp, int char_id) ARR_FIND(0, MAX_PARTY, i, sp->member[i].account_id == member->account_id && sp->member[i].char_id == member->char_id); - if (i == MAX_PARTY) + if (i == MAX_PARTY) { removed[removed_count++] = member_id; + } else if (member->leader != 0) { + leader_account_id = member->account_id; + leader_char_id = member->char_id; + } } for (member_id = 0; member_id < MAX_PARTY; ++member_id) { member = &sp->member[member_id]; @@ -316,6 +321,7 @@ int party_recv_info(const struct party *sp, int char_id) continue;// not online party->member_withdraw(sp->party_id, sd->status.account_id, sd->status.char_id); } + memcpy(&p->party, sp, sizeof(struct party)); memset(&p->state, 0, sizeof(p->state)); memset(&p->data, 0, sizeof(p->data)); @@ -324,6 +330,8 @@ int party_recv_info(const struct party *sp, int char_id) if ( member->char_id == 0 ) continue;// empty p->data[member_id].sd = party->sd_check(sp->party_id, member->account_id, member->char_id); + if (member->account_id == leader_account_id && member->char_id == leader_char_id) + p->party.member[member_id].leader = 1; } party->check_state(p); while( added_count > 0 ) { // new in party @@ -591,11 +599,43 @@ int party_member_withdraw(int party_id, int account_id, int char_id) int i; ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id ); if( i < MAX_PARTY ) { + bool was_leader = false; + int prev_leader_accountId = 0; + if (p->party.member[i].leader != 0) { + was_leader = true; + prev_leader_accountId = p->party.member[i].account_id; + } + clif->party_withdraw(p,sd,account_id,p->party.member[i].name,0x0); memset(&p->party.member[i], 0, sizeof(p->party.member[0])); memset(&p->data[i], 0, sizeof(p->data[0])); p->party.count--; party->check_state(p); + + if (was_leader) { + int k; + // Member was party leader, try to pick a new leader from online members + ARR_FIND(0, MAX_PARTY, k, p->party.member[k].account_id != 0 && p->party.member[k].online == 1); + + if (k == MAX_PARTY) { + // No online members, get an offline one + ARR_FIND(0, MAX_PARTY, k, p->party.member[k].account_id != 0); + } + + if (k < MAX_PARTY) { + // Update party's leader + p->party.member[k].leader = 1; + + if (p->data[k].sd != NULL) { + /** update members **/ + clif->PartyLeaderChanged(p->data[k].sd, prev_leader_accountId, p->data[k].sd->status.account_id); + } + + //Update info. + intif->party_leaderchange(p->party.party_id, p->party.member[k].account_id, p->party.member[k].char_id); + clif->party_info(p, NULL); + } + } } } diff --git a/src/map/pc.c b/src/map/pc.c index 2cf5d75b4..9ef7d084f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -387,7 +387,6 @@ int pc_banding(struct map_session_data *sd, uint16 skill_lv) { return c; } -// Increases a player's fame points and displays a notice to him /** * Increases a player's fame points and displays a notice to them. * diff --git a/src/map/script.c b/src/map/script.c index eb2bd05ee..25f520450 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2825,7 +2825,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { char postfix; struct map_session_data *sd = NULL; - if( !data_isreference(data) ) + if (!data_isreference(data)) return data;// not a variable/constant name = reference_getname(data); @@ -2840,10 +2840,10 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { } //##TODO use reference_tovariable(data) when it's confirmed that it works [FlavioJS] - if( !reference_toconstant(data) && not_server_variable(prefix) ) { + if (!reference_toconstant(data) && not_server_variable(prefix) && reference_getref(data) == NULL) { sd = script->rid2sd(st); - if( sd == NULL ) {// needs player attached - if( postfix == '$' ) {// string variable + if (sd == NULL) {// needs player attached + if (postfix == '$') {// string variable ShowWarning("script_get_val: cannot access player variable '%s', defaulting to \"\"\n", name); data->type = C_CONSTSTR; data->u.str = ""; @@ -2861,32 +2861,44 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { const char *str = NULL; switch (prefix) { - case '@': + case '@': + if (data->ref) { + str = script->get_val_ref_str(st, data->ref, data); + } else { str = pc->readregstr(sd, data->u.num); - break; - case '$': - str = mapreg->readregstr(data->u.num); - break; - case '#': - if (name[1] == '#') - str = pc_readaccountreg2str(sd, data->u.num);// global - else - str = pc_readaccountregstr(sd, data->u.num);// local - break; - case '.': - if (data->ref) - str = script->get_val_ref_str(st, data->ref, data); - else if (name[1] == '@') - str = script->get_val_scope_str(st, &st->stack->scope, data); - else - str = script->get_val_npc_str(st, &st->script->local, data); - break; - case '\'': - str = script->get_val_instance_str(st, name, data); - break; - default: + } + break; + case '$': + str = mapreg->readregstr(data->u.num); + break; + case '#': + if (data->ref) { + str = script->get_val_ref_str(st, data->ref, data); + } else if (name[1] == '#') { + str = pc_readaccountreg2str(sd, data->u.num);// global + } else { + str = pc_readaccountregstr(sd, data->u.num);// local + } + break; + case '.': + if (data->ref) { + str = script->get_val_ref_str(st, data->ref, data); + } else if (name[1] == '@') { + str = script->get_val_scope_str(st, &st->stack->scope, data); + } else { + str = script->get_val_npc_str(st, &st->script->local, data); + } + break; + case '\'': + str = script->get_val_instance_str(st, name, data); + break; + default: + if (data->ref) { + str = script->get_val_ref_str(st, data->ref, data); + } else { str = pc_readglobalreg_str(sd, data->u.num); - break; + } + break; } if (str == NULL || str[0] == '\0') { @@ -2906,36 +2918,48 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { data->u.num = reference_getconstant(data); } else if( reference_toparam(data) ) { data->u.num = pc->readparam(sd, reference_getparamtype(data)); - } else - switch( prefix ) { - case '@': + } else { + switch (prefix) { + case '@': + if (data->ref) { + data->u.num = script->get_val_ref_num(st, data->ref, data); + } else { data->u.num = pc->readreg(sd, data->u.num); - break; - case '$': - data->u.num = mapreg->readreg(data->u.num); - break; - case '#': - if( name[1] == '#' ) - data->u.num = pc_readaccountreg2(sd, data->u.num);// global - else - data->u.num = pc_readaccountreg(sd, data->u.num);// local - break; - case '.': - if (data->ref) - data->u.num = script->get_val_ref_num(st, data->ref, data); - else if (name[1] == '@') - data->u.num = script->get_val_scope_num(st, &st->stack->scope, data); - else - data->u.num = script->get_val_npc_num(st, &st->script->local, data); - break; - case '\'': - data->u.num = script->get_val_instance_num(st, name, data); - break; - default: + } + break; + case '$': + data->u.num = mapreg->readreg(data->u.num); + break; + case '#': + if (data->ref) { + data->u.num = script->get_val_ref_num(st, data->ref, data); + } else if (name[1] == '#') { + data->u.num = pc_readaccountreg2(sd, data->u.num);// global + } else { + data->u.num = pc_readaccountreg(sd, data->u.num);// local + } + break; + case '.': + if (data->ref) { + data->u.num = script->get_val_ref_num(st, data->ref, data); + } else if (name[1] == '@') { + data->u.num = script->get_val_scope_num(st, &st->stack->scope, data); + } else { + data->u.num = script->get_val_npc_num(st, &st->script->local, data); + } + break; + case '\'': + data->u.num = script->get_val_instance_num(st, name, data); + break; + default: + if (data->ref) { + data->u.num = script->get_val_ref_num(st, data->ref, data); + } else { data->u.num = pc_readglobalreg(sd, data->u.num); - break; + } + break; } - + } } data->ref = NULL; @@ -3108,38 +3132,43 @@ void script_array_add_member(struct script_array *sa, unsigned int idx) { **/ struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) { struct reg_db *src = NULL; - nullpo_retr(NULL, name); - switch( name[0] ) { + + switch (name[0]) { /* from player */ - default: /* char reg */ - case '@':/* temp char reg */ - case '#':/* account reg */ + default: /* char reg */ + case '@':/* temp char reg */ + case '#':/* account reg */ + if (ref != NULL) { + src = ref; + } else { nullpo_retr(NULL, sd); src = &sd->regs; - break; - case '$':/* map reg */ - src = &mapreg->regs; - break; - case '.':/* npc/script */ - if (ref != NULL) { - src = ref; - } else { - nullpo_retr(NULL, st); - src = (name[1] == '@') ? &st->stack->scope : &st->script->local; - } - break; - case '\'':/* instance */ + } + break; + case '$':/* map reg */ + src = &mapreg->regs; + break; + case '.':/* npc/script */ + if (ref != NULL) { + src = ref; + } else { nullpo_retr(NULL, st); - if( st->instance_id >= 0 ) { - src = &instance->list[st->instance_id].regs; - } - break; + src = (name[1] == '@') ? &st->stack->scope : &st->script->local; + } + break; + case '\'':/* instance */ + nullpo_retr(NULL, st); + if (st->instance_id >= 0) { + src = &instance->list[st->instance_id].regs; + } + break; } - if( src ) { - if( !src->arrays ) + if (src) { + if (!src->arrays) { src->arrays = idb_alloc(DB_OPT_BASE); + } return src; } return NULL; @@ -3292,48 +3321,65 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con return 0; } - if( is_string_variable(name) ) {// string variable + if (is_string_variable(name)) {// string variable const char *str = (const char*)value; switch (prefix) { - case '@': + case '@': + if (ref) { + script->set_reg_ref_str(st, ref, num, name, str); + } else { pc->setregstr(sd, num, str); - return 1; - case '$': - return mapreg->setregstr(num, str); - case '#': - return (name[1] == '#') ? - pc_setaccountreg2str(sd, num, str) : - pc_setaccountregstr(sd, num, str); - case '.': - if (ref) - script->set_reg_ref_str(st, ref, num, name, str); - else if (name[1] == '@') - script->set_reg_scope_str(st, &st->stack->scope, num, name, str); - else - script->set_reg_npc_str(st, &st->script->local, num, name, str); - return 1; - case '\'': - set_reg_instance_str(st, num, name, str); - return 1; - default: - return pc_setglobalreg_str(sd, num, str); + } + return 1; + case '$': + mapreg->setregstr(num, str); + return 1; + case '#': + if (ref) { + script->set_reg_ref_str(st, ref, num, name, str); + } else if (name[1] == '#') { + pc_setaccountreg2str(sd, num, str); + } else { + pc_setaccountregstr(sd, num, str); + } + return 1; + case '.': + if (ref) { + script->set_reg_ref_str(st, ref, num, name, str); + } else if (name[1] == '@') { + script->set_reg_scope_str(st, &st->stack->scope, num, name, str); + } else { + script->set_reg_npc_str(st, &st->script->local, num, name, str); + } + return 1; + case '\'': + set_reg_instance_str(st, num, name, str); + return 1; + default: + if (ref) { + script->set_reg_ref_str(st, ref, num, name, str); + } else { + pc_setglobalreg_str(sd, num, str); + } + return 1; } } else {// integer variable // FIXME: This isn't safe, in 32bits systems we're converting a 64bit pointer // to a 32bit int, this will lead to overflows! [Panikon] int val = (int)h64BPTRSIZE(value); - if(script->str_data[script_getvarid(num)].type == C_PARAM) { - if( pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0 ) { - if( st != NULL ) { + if (script->str_data[script_getvarid(num)].type == C_PARAM) { + if (pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0) { + if (st != NULL) { ShowError("script:set_reg: failed to set param '%s' to %d.\n", name, val); script->reportsrc(st); // Instead of just stop the script execution we let the character close // the window if it was open. st->state = (sd->state.dialog) ? CLOSE : END; - if( st->state == CLOSE ) + if(st->state == CLOSE) { clif->scriptclose(sd, st->oid); + } } return 0; } @@ -3341,28 +3387,44 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con } switch (prefix) { - case '@': + case '@': + if (ref) { + script->set_reg_ref_num(st, ref, num, name, val); + } else { pc->setreg(sd, num, val); - return 1; - case '$': - return mapreg->setreg(num, val); - case '#': - return (name[1] == '#') ? - pc_setaccountreg2(sd, num, val) : - pc_setaccountreg(sd, num, val); - case '.': - if (ref) - script->set_reg_ref_num(st, ref, num, name, val); - else if (name[1] == '@') - script->set_reg_scope_num(st, &st->stack->scope, num, name, val); - else - script->set_reg_npc_num(st, &st->script->local, num, name, val); - return 1; - case '\'': - set_reg_instance_num(st, num, name, val); - return 1; - default: - return pc_setglobalreg(sd, num, val); + } + return 1; + case '$': + mapreg->setreg(num, val); + return 1; + case '#': + if (ref) { + script->set_reg_ref_num(st, ref, num, name, val); + } else if (name[1] == '#') { + pc_setaccountreg2(sd, num, val); + } else { + pc_setaccountreg(sd, num, val); + } + return 1; + case '.': + if (ref) { + script->set_reg_ref_num(st, ref, num, name, val); + } else if (name[1] == '@') { + script->set_reg_scope_num(st, &st->stack->scope, num, name, val); + } else { + script->set_reg_npc_num(st, &st->script->local, num, name, val); + } + return 1; + case '\'': + set_reg_instance_num(st, num, name, val); + return 1; + default: + if (ref) { + script->set_reg_ref_num(st, ref, num, name, val); + } else { + pc_setglobalreg(sd, num, val); + } + return 1; } } } @@ -5197,7 +5259,7 @@ int script_load_translation(const char *file, uint8 lang_id) VECTOR_TRUNCATE(msgstr); continue; } - + if (strncasecmp(line, "msgid \"", 7) == 0) { VECTOR_TRUNCATE(msgid); for (i = 7; i < len - 2; i++) { @@ -6610,61 +6672,67 @@ BUILDIN(warpparty) } /*========================================== * Warpguild - [Fredzilla] - * Syntax: warpguild "mapname",x,y,Guild_ID; + * Syntax: warpguild "mapname",x,y,Guild_ID,{"from_mapname"}; *------------------------------------------*/ BUILDIN(warpguild) { struct map_session_data *sd = NULL; - struct map_session_data *pl_sd; struct guild* g; - struct s_mapiterator* iter; int type; + int i; + int16 map_id = -1; - const char* str = script_getstr(st,2); - int x = script_getnum(st,3); - int y = script_getnum(st,4); - int gid = script_getnum(st,5); + const char *str = script_getstr(st, 2); + int x = script_getnum(st, 3); + int y = script_getnum(st, 4); + int gid = script_getnum(st, 5); + + if (script_hasdata(st, 6)) { + map_id = map->mapname2mapid(script_getstr(st, 6)); + } g = guild->search(gid); - if( g == NULL ) + if (g == NULL) return true; - type = ( strcmp(str,"Random")==0 ) ? 0 - : ( strcmp(str,"SavePointAll")==0 ) ? 1 - : ( strcmp(str,"SavePoint")==0 ) ? 2 + type = (strcmp(str, "Random") == 0) ? 0 + : (strcmp(str, "SavePointAll") == 0) ? 1 + : (strcmp(str, "SavePoint") == 0) ? 2 : 3; - if( type == 2 && ( sd = script->rid2sd(st) ) == NULL ) + if (type == 2 && (sd = script->rid2sd(st)) == NULL) {// "SavePoint" uses save point of the currently attached player return true; } - iter = mapit_getallusers(); - for (pl_sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); pl_sd = BL_UCAST(BL_PC, mapit->next(iter))) { - if( pl_sd->status.guild_id != gid ) - continue; + for (i = 0; i < MAX_GUILD; i++) { + if (g->member[i].online && g->member[i].sd != NULL) { + struct map_session_data *pl_sd = g->member[i].sd; - switch( type ) - { + if (map_id >= 0 && map_id != pl_sd->bl.m) + continue; + + switch (type) + { case 0: // Random - if(!map->list[pl_sd->bl.m].flag.nowarp) - pc->randomwarp(pl_sd,CLR_TELEPORT); + if (!map->list[pl_sd->bl.m].flag.nowarp) + pc->randomwarp(pl_sd, CLR_TELEPORT); break; case 1: // SavePointAll - if(!map->list[pl_sd->bl.m].flag.noreturn) - pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT); + if (!map->list[pl_sd->bl.m].flag.noreturn) + pc->setpos(pl_sd, pl_sd->status.save_point.map, pl_sd->status.save_point.x, pl_sd->status.save_point.y, CLR_TELEPORT); break; case 2: // SavePoint - if(!map->list[pl_sd->bl.m].flag.noreturn) - pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT); + if (!map->list[pl_sd->bl.m].flag.noreturn) + pc->setpos(pl_sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT); break; case 3: // m,x,y - if(!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp) - pc->setpos(pl_sd,script->mapindexname2id(st,str),x,y,CLR_TELEPORT); + if (!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp) + pc->setpos(pl_sd, script->mapindexname2id(st, str), x, y, CLR_TELEPORT); break; + } } } - mapit->free(iter); return true; } @@ -8685,39 +8753,48 @@ BUILDIN(getguildmember) *------------------------------------------*/ BUILDIN(strcharinfo) { - int num; struct guild* g; struct party_data* p; - struct map_session_data *sd = script->rid2sd(st); - if (sd == NULL) //Avoid crashing.... + struct map_session_data *sd; + + if (script_hasdata(st, 4)) + sd = map->id2sd(script_getnum(st, 4)); + else + sd = script->rid2sd(st); + + if (sd == NULL) { + if(script_hasdata(st, 3)) { + script_pushcopy(st, 3); + } else { + script_pushconststr(st, ""); + } return true; + } - num=script_getnum(st,2); - switch(num) { - case 0: - script_pushstrcopy(st,sd->status.name); - break; - case 1: - if( ( p = party->search(sd->status.party_id) ) != NULL ) { - script_pushstrcopy(st,p->party.name); - } else { - script_pushconststr(st,""); - } - break; - case 2: - if( ( g = sd->guild ) != NULL ) { - script_pushstrcopy(st,g->name); - } else { - script_pushconststr(st,""); - } - break; - case 3: - script_pushconststr(st,map->list[sd->bl.m].name); - break; - default: - ShowWarning("buildin_strcharinfo: unknown parameter.\n"); - script_pushconststr(st,""); - break; + switch (script_getnum(st, 2)) { + case 0: + script_pushstrcopy(st, sd->status.name); + break; + case 1: + if ((p = party->search(sd->status.party_id)) != NULL) { + script_pushstrcopy(st, p->party.name); + } else { + script_pushconststr(st, ""); + } + break; + case 2: + if ((g = sd->guild) != NULL) { + script_pushstrcopy(st, g->name); + } else { + script_pushconststr(st, ""); + } + break; + case 3: + script_pushconststr(st, map->list[sd->bl.m].name); + break; + default: + ShowWarning("script:strcharinfo: unknown parameter.\n"); + script_pushconststr(st, ""); } return true; @@ -8734,41 +8811,51 @@ BUILDIN(strcharinfo) *------------------------------------------*/ BUILDIN(strnpcinfo) { - int num; char *buf,*name=NULL; - struct npc_data *nd = map->id2nd(st->oid); + struct npc_data *nd; + + if (script_hasdata(st, 4)) + nd = map->id2nd(script_getnum(st, 4)); + else + nd = map->id2nd(st->oid); + if (nd == NULL) { - script_pushconststr(st, ""); + if (script_hasdata(st, 3)) { + script_pushcopy(st, 3); + } else { + script_pushconststr(st, ""); + } return true; } - num = script_getnum(st,2); - switch(num) { - case 0: // display name + switch (script_getnum(st,2)) { + case 0: // display name + name = aStrdup(nd->name); + break; + case 1: // visible part of display name + if ((buf = strchr(nd->name,'#')) != NULL) { name = aStrdup(nd->name); - break; - case 1: // visible part of display name - if((buf = strchr(nd->name,'#')) != NULL) - { - name = aStrdup(nd->name); - name[buf - nd->name] = 0; - } else // Return the name, there is no '#' present - name = aStrdup(nd->name); - break; - case 2: // # fragment - if((buf = strchr(nd->name,'#')) != NULL) - name = aStrdup(buf+1); - break; - case 3: // unique name - name = aStrdup(nd->exname); - break; - case 4: // map name - if( nd->bl.m >= 0 ) // Only valid map indexes allowed (issue:8034) - name = aStrdup(map->list[nd->bl.m].name); - break; + name[buf - nd->name] = 0; + } else { // Return the name, there is no '#' present + name = aStrdup(nd->name); + } + break; + case 2: // # fragment + if ((buf = strchr(nd->name,'#')) != NULL) { + name = aStrdup(buf+1); + } + break; + case 3: // unique name + name = aStrdup(nd->exname); + break; + case 4: // map name + if (nd->bl.m >= 0) { // Only valid map indexes allowed (issue:8034) + name = aStrdup(map->list[nd->bl.m].name); + } + break; } - if(name) + if (name) script_pushstr(st, name); else script_pushconststr(st, ""); @@ -10704,19 +10791,29 @@ BUILDIN(donpcevent) *------------------------------------------*/ BUILDIN(addtimer) { - int tick = script_getnum(st,2); + int tick = script_getnum(st, 2); const char* event = script_getstr(st, 3); struct map_session_data *sd; script->check_event(st, event); - sd = script->rid2sd(st); - if( sd == NULL ) - return true; - if (!pc->addeventtimer(sd,tick,event)) { - ShowWarning("buildin_addtimer: Event timer is full, can't add new event timer. (cid:%d timer:%s)\n",sd->status.char_id,event); + if (script_hasdata(st, 4)) + sd = map->id2sd(script_getnum(st, 4)); + else + sd = script->rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return false; + } + + if (!pc->addeventtimer(sd, tick, event)) { + ShowWarning("script:addtimer: Event timer is full, can't add new event timer. (cid:%d timer:%s)\n", sd->status.char_id, event); + script_pushint(st, 0); return false; } + + script_pushint(st, 1); return true; } /*========================================== @@ -10727,12 +10824,17 @@ BUILDIN(deltimer) struct map_session_data *sd; event=script_getstr(st, 2); - sd = script->rid2sd(st); - if( sd == NULL ) + + if (script_hasdata(st, 3)) + sd = map->id2sd(script_getnum(st, 3)); + else + sd = script->rid2sd(st); + + if (sd == NULL) return true; script->check_event(st, event); - pc->deleventtimer(sd,event); + pc->deleventtimer(sd, event); return true; } /*========================================== @@ -10743,14 +10845,113 @@ BUILDIN(addtimercount) int tick; struct map_session_data *sd; - event=script_getstr(st, 2); - tick=script_getnum(st,3); - sd = script->rid2sd(st); - if( sd == NULL ) + event = script_getstr(st, 2); + tick = script_getnum(st, 3); + + if (script_hasdata(st, 4)) + sd = map->id2sd(script_getnum(st, 4)); + else + sd = script->rid2sd(st); + + if (sd == NULL) return true; script->check_event(st, event); - pc->addeventtimercount(sd,event,tick); + pc->addeventtimercount(sd, event, tick); + return true; +} + +enum gettimer_mode { + GETTIMER_COUNT = 0, + GETTIMER_TICK_NEXT = 1, + GETTIMER_TICK_LAST = 2, +}; + +BUILDIN(gettimer) +{ + struct map_session_data *sd; + const struct TimerData *td; + int i; + int tick; + const char *event = NULL; + int val = 0; + bool first = true; + short mode = script_getnum(st, 2); + + if (script_hasdata(st, 3)) + sd = map->id2sd(script_getnum(st, 3)); + else + sd = script->rid2sd(st); + + if (script_hasdata(st, 4)) { + event = script_getstr(st, 4); + script->check_event(st, event); + } + + if (sd == NULL) { + script_pushint(st, -1); + return true; + } + + switch (mode) { + case GETTIMER_COUNT: + // get number of timers + for (i = 0; i < MAX_EVENTTIMER; i++) { + if (sd->eventtimer[i] != INVALID_TIMER) { + if (event != NULL) { + td = timer->get(sd->eventtimer[i]); + Assert_retr(false, td != NULL); + + if (strcmp((char *)(td->data), event) == 0) { + val++; + } + } else { + val++; + } + } + } + break; + case GETTIMER_TICK_NEXT: + // get the number of tick before the next timer runs + for (i = 0; i < MAX_EVENTTIMER; i++) { + if (sd->eventtimer[i] != INVALID_TIMER) { + td = timer->get(sd->eventtimer[i]); + Assert_retr(false, td != NULL); + tick = max(0, DIFF_TICK32(td->tick, timer->gettick())); + + if (event != NULL) { + if ((first == true || tick < val) && strcmp((char *)(td->data), event) == 0) { + val = tick; + first = false; + } + } else if (first == true || tick < val) { + val = tick; + first = false; + } + } + } + break; + case GETTIMER_TICK_LAST: + // get the number of ticks before the last timer runs + for (i = MAX_EVENTTIMER - 1; i >= 0; i--) { + if (sd->eventtimer[i] != INVALID_TIMER) { + td = timer->get(sd->eventtimer[i]); + Assert_retr(false, td != NULL); + tick = max(0, DIFF_TICK32(td->tick, timer->gettick())); + + if (event != NULL) { + if (strcmp((char *)(td->data), event) == 0) { + val = max(val, tick); + } + } else { + val = max(val, tick); + } + } + } + break; + } + + script_pushint(st, val); return true; } @@ -13842,15 +14043,26 @@ BUILDIN(undisguise) * Transform a bl to another class, * @type unused *------------------------------------------*/ -BUILDIN(classchange) { - int class, type; - struct block_list *bl=map->id2bl(st->oid); +BUILDIN(classchange) +{ + int class, type, target; + struct block_list *bl = map->id2bl(st->oid); + + if (bl == NULL) + return true; - if(bl==NULL) return true; + class = script_getnum(st, 2); + type = script_getnum(st, 3); + target = script_hasdata(st, 4) ? script_getnum(st, 4) : 0; - class = script_getnum(st,2); - type=script_getnum(st,3); - clif->class_change(bl, class, type); + if (target > 0) { + struct map_session_data *sd = script->charid2sd(st, target); + if (sd != NULL) { + clif->class_change(bl, class, type, sd); + } + } else { + clif->class_change(bl, class, type, NULL); + } return true; } @@ -15457,6 +15669,29 @@ BUILDIN(charat) { } //======================================================= +// chr <int> +//------------------------------------------------------- +BUILDIN(chr) +{ + char output[2]; + output[0] = script_getnum(st, 2); + output[1] = '\0'; + + script_pushstrcopy(st, output); + return true; +} + +//======================================================= +// ord <chr> +//------------------------------------------------------- +BUILDIN(ord) +{ + const char *chr = script_getstr(st, 2); + script_pushint(st, *chr); + return true; +} + +//======================================================= // setchar <string>, <char>, <index> //------------------------------------------------------- BUILDIN(setchar) @@ -17500,6 +17735,55 @@ BUILDIN(getvariableofnpc) return true; } +BUILDIN(getvariableofpc) +{ + const char* name; + struct script_data* data = script_getdata(st, 2); + struct map_session_data *sd = map->id2sd(script_getnum(st, 3)); + + if (!data_isreference(data)) { + ShowError("script:getvariableofpc: not a variable\n"); + script->reportdata(data); + script_pushnil(st); + st->state = END; + return false; + } + + name = reference_getname(data); + + switch (*name) + { + case '#': + case '$': + case '.': + case '\'': + ShowError("script:getvariableofpc: illegal scope (not pc variable)\n"); + script->reportdata(data); + script_pushnil(st); + st->state = END; + return false; + } + + if (sd == NULL) + { + // player not found, return default value + if (script_hasdata(st, 4)) { + script_pushcopy(st, 4); + } else if (is_string_variable(name)) { + script_pushconststr(st, ""); + } else { + script_pushint(st, 0); + } + return true; + } + + if (!sd->regs.vars) + sd->regs.vars = i64db_alloc(DB_OPT_RELEASE_DATA); + + script->push_val(st->stack, C_NAME, reference_getuid(data), &sd->regs); + return true; +} + /// Opens a warp portal. /// Has no "portal opening" effect/sound, it opens the portal immediately. /// @@ -20819,7 +21103,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(areawarp,"siiiisii??"), BUILDIN_DEF(warpchar,"siii"), // [LuzZza] BUILDIN_DEF(warpparty,"siii?"), // [Fredzilla] [Paradox924X] - BUILDIN_DEF(warpguild,"siii"), // [Fredzilla] + BUILDIN_DEF(warpguild,"siii?"), // [Fredzilla] BUILDIN_DEF(setlook,"ii"), BUILDIN_DEF(changelook,"ii"), // Simulates but don't Store it BUILDIN_DEF2(__setr,"set","rv"), @@ -20860,8 +21144,8 @@ void script_parse_builtin(void) { BUILDIN_DEF(getguildmaster,"i"), BUILDIN_DEF(getguildmasterid,"i"), BUILDIN_DEF(getguildmember,"i?"), - BUILDIN_DEF(strcharinfo,"i"), - BUILDIN_DEF(strnpcinfo,"i"), + BUILDIN_DEF(strcharinfo,"i??"), + BUILDIN_DEF(strnpcinfo,"i??"), BUILDIN_DEF(charid2rid,"i"), BUILDIN_DEF(getequipid,"i"), BUILDIN_DEF(getequipname,"i"), @@ -20924,9 +21208,10 @@ void script_parse_builtin(void) { BUILDIN_DEF(clone,"siisi????"), BUILDIN_DEF(doevent,"s"), BUILDIN_DEF(donpcevent,"s"), - BUILDIN_DEF(addtimer,"is"), - BUILDIN_DEF(deltimer,"s"), - BUILDIN_DEF(addtimercount,"si"), + BUILDIN_DEF(addtimer,"is?"), + BUILDIN_DEF(deltimer,"s?"), + BUILDIN_DEF(addtimercount,"si?"), + BUILDIN_DEF(gettimer,"i??"), BUILDIN_DEF(initnpctimer,"??"), BUILDIN_DEF(stopnpctimer,"??"), BUILDIN_DEF(startnpctimer,"??"), @@ -21011,7 +21296,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(getcartinventorylist,""), BUILDIN_DEF(getskilllist,""), BUILDIN_DEF(clearitem,""), - BUILDIN_DEF(classchange,"ii"), + BUILDIN_DEF(classchange,"ii?"), BUILDIN_DEF(misceffect,"i"), BUILDIN_DEF(playbgm,"s"), BUILDIN_DEF(playbgmall,"s?????"), @@ -21077,6 +21362,8 @@ void script_parse_builtin(void) { BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris] BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris] BUILDIN_DEF(charat,"si"), + BUILDIN_DEF(chr,"i"), + BUILDIN_DEF(ord,"s"), BUILDIN_DEF(setchar,"ssi"), BUILDIN_DEF(insertchar,"ssi"), BUILDIN_DEF(delchar,"si"), @@ -21157,6 +21444,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(sleep2,"i"), BUILDIN_DEF(awake,"s"), BUILDIN_DEF(getvariableofnpc,"rs"), + BUILDIN_DEF(getvariableofpc,"ri?"), BUILDIN_DEF(warpportal,"iisii"), BUILDIN_DEF2(homunculus_evolution,"homevolution",""), //[orn] BUILDIN_DEF2(homunculus_mutate,"hommutate","?"), diff --git a/src/map/skill.c b/src/map/skill.c index 51a8a28e7..70db5b341 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2016 Hercules Dev Team + * Copyright (C) 2012-2017 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -7470,8 +7470,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case NPC_LICK: status_zap(bl, 0, 100); - clif->skill_nodamage(src,bl,skill_id,skill_lv, - sc_start(src,bl,type,(skill_lv*5),skill_lv,skill->get_time2(skill_id,skill_lv))); + clif->skill_nodamage(src, bl, skill_id, skill_lv, + sc_start(src, bl, type, (skill_lv * 20), skill_lv, skill->get_time2(skill_id, skill_lv))); break; case NPC_SUICIDE: @@ -8181,8 +8181,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int x,y; x = src->x; y = src->y; - if (hd) - skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id,skill_lv)); + if (hd) { +#ifdef RENEWAL + skill->blockhomun_start(hd, skill_id, skill->get_cooldown(skill_id, skill_lv)); +#else + skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id, skill_lv)); +#endif + } + if (unit->movepos(src,bl->x,bl->y,0,0)) { clif->skill_nodamage(src,src,skill_id,skill_lv,1); // Homun diff --git a/src/map/unit.c b/src/map/unit.c index 739a369a6..7d68bef66 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -668,11 +668,12 @@ void unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_se ud->state.running = 0; status_change_end(bl, type, INVALID_TIMER); - if( type == SC_RUN ) { - skill->blown(bl,bl,skill->get_blewcount(TK_RUN,lv),unit->getdir(bl),0); + if (type == SC_RUN) { + if (lv > 0) + skill->blown(bl, bl, skill->get_blewcount(TK_RUN, lv), unit->getdir(bl), 0); clif->fixpos(bl); //Why is a clif->slide (skill->blown) AND a fixpos needed? Ask Aegis. - clif->sc_end(bl,bl->id,AREA,SI_TING); - } else if( sd ) { + clif->sc_end(bl, bl->id, AREA, SI_TING); + } else if (sd) { clif->fixpos(bl); skill->castend_damage_id(bl, &sd->bl, RA_WUGDASH, lv, timer->gettick(), SD_LEVEL); } @@ -1461,7 +1462,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui } else if( src->type == BL_MER && skill_id == MA_REMOVETRAP ) { if( !battle->check_range(battle->get_master(src), target, range + 1) ) return 0; // Aegis calc remove trap based on Master position, ignoring mercenary O.O - } else if( !battle->check_range(src, target, range + (skill_id == RG_CLOSECONFINE?0:2)) ) { + } else if (!battle->check_range(src, target, range)) { return 0; // Arrow-path check failed. } } diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 15da10bde..02af6e231 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -396,8 +396,8 @@ typedef int (*HPMHOOK_pre_chr_rename_char_sql) (struct char_session_data **sd, i typedef int (*HPMHOOK_post_chr_rename_char_sql) (int retVal___, struct char_session_data *sd, int char_id); typedef int (*HPMHOOK_pre_chr_check_char_name) (char **name, char **esc_name); typedef int (*HPMHOOK_post_chr_check_char_name) (int retVal___, char *name, char *esc_name); -typedef int (*HPMHOOK_pre_chr_make_new_char_sql) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job); -typedef int (*HPMHOOK_post_chr_make_new_char_sql) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job); +typedef int (*HPMHOOK_pre_chr_make_new_char_sql) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job, uint8 *sex); +typedef int (*HPMHOOK_post_chr_make_new_char_sql) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex); typedef int (*HPMHOOK_pre_chr_divorce_char_sql) (int *partner_id1, int *partner_id2); typedef int (*HPMHOOK_post_chr_divorce_char_sql) (int retVal___, int partner_id1, int partner_id2); typedef int (*HPMHOOK_pre_chr_count_users) (void); @@ -974,8 +974,8 @@ typedef void (*HPMHOOK_pre_clif_refreshlook) (struct block_list **bl, int *id, i typedef void (*HPMHOOK_post_clif_refreshlook) (struct block_list *bl, int id, int type, int val, enum send_target target); typedef void (*HPMHOOK_pre_clif_sendlook) (struct block_list **bl, int *id, int *type, int *val, int *val2, enum send_target *target); typedef void (*HPMHOOK_post_clif_sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target); -typedef void (*HPMHOOK_pre_clif_class_change) (struct block_list **bl, int *class_, int *type); -typedef void (*HPMHOOK_post_clif_class_change) (struct block_list *bl, int class_, int type); +typedef void (*HPMHOOK_pre_clif_class_change) (struct block_list **bl, int *class_, int *type, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_class_change) (struct block_list *bl, int class_, int type, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_skill_delunit) (struct skill_unit **su); typedef void (*HPMHOOK_post_clif_skill_delunit) (struct skill_unit *su); typedef void (*HPMHOOK_pre_clif_skillunit_update) (struct block_list **bl); @@ -4462,8 +4462,8 @@ typedef bool (*HPMHOOK_post_mapreg_config_read) (bool retVal___, const char *fil #ifdef COMMON_MD5CALC_H /* md5 */ typedef void (*HPMHOOK_pre_md5_string) (const char **string, char **output); typedef void (*HPMHOOK_post_md5_string) (const char *string, char *output); -typedef void (*HPMHOOK_pre_md5_binary) (const char **string, unsigned char **output); -typedef void (*HPMHOOK_post_md5_binary) (const char *string, unsigned char *output); +typedef void (*HPMHOOK_pre_md5_binary) (const uint8 **buf, const int *buf_size, uint8 **output); +typedef void (*HPMHOOK_post_md5_binary) (const uint8 *buf, const int buf_size, uint8 *output); typedef void (*HPMHOOK_pre_md5_salt) (int *len, char **output); typedef void (*HPMHOOK_post_md5_salt) (int len, char *output); #endif // COMMON_MD5CALC_H diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index f7b43ad50..3942693da 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -744,15 +744,15 @@ int HP_chr_check_char_name(char *name, char *esc_name) { } return retVal___; } -int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job) { +int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_chr_make_new_char_sql_pre ) { - int (*preHookFunc) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job); + int (*preHookFunc) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job, uint8 *sex); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chr_make_new_char_sql_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style, &starting_job); + retVal___ = preHookFunc(&sd, &name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style, &starting_job, &sex); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -760,13 +760,13 @@ int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, in } } { - retVal___ = HPMHooks.source.chr.make_new_char_sql(sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job); + retVal___ = HPMHooks.source.chr.make_new_char_sql(sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job, sex); } if( HPMHooks.count.HP_chr_make_new_char_sql_post ) { - int (*postHookFunc) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job); + int (*postHookFunc) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex); for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chr_make_new_char_sql_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job); + retVal___ = postHookFunc(retVal___, sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job, sex); } } return retVal___; @@ -15207,14 +15207,14 @@ void HP_md5_string(const char *string, char *output) { } return; } -void HP_md5_binary(const char *string, unsigned char *output) { +void HP_md5_binary(const uint8 *buf, const int buf_size, uint8 *output) { int hIndex = 0; if( HPMHooks.count.HP_md5_binary_pre ) { - void (*preHookFunc) (const char **string, unsigned char **output); + void (*preHookFunc) (const uint8 **buf, const int *buf_size, uint8 **output); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; - preHookFunc(&string, &output); + preHookFunc(&buf, &buf_size, &output); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -15222,13 +15222,13 @@ void HP_md5_binary(const char *string, unsigned char *output) { } } { - HPMHooks.source.md5.binary(string, output); + HPMHooks.source.md5.binary(buf, buf_size, output); } if( HPMHooks.count.HP_md5_binary_post ) { - void (*postHookFunc) (const char *string, unsigned char *output); + void (*postHookFunc) (const uint8 *buf, const int buf_size, uint8 *output); for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; - postHookFunc(string, output); + postHookFunc(buf, buf_size, output); } } return; diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index ffdfd15a8..a7e7afa4e 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -4743,14 +4743,14 @@ void HP_md5_string(const char *string, char *output) { } return; } -void HP_md5_binary(const char *string, unsigned char *output) { +void HP_md5_binary(const uint8 *buf, const int buf_size, uint8 *output) { int hIndex = 0; if( HPMHooks.count.HP_md5_binary_pre ) { - void (*preHookFunc) (const char **string, unsigned char **output); + void (*preHookFunc) (const uint8 **buf, const int *buf_size, uint8 **output); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; - preHookFunc(&string, &output); + preHookFunc(&buf, &buf_size, &output); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -4758,13 +4758,13 @@ void HP_md5_binary(const char *string, unsigned char *output) { } } { - HPMHooks.source.md5.binary(string, output); + HPMHooks.source.md5.binary(buf, buf_size, output); } if( HPMHooks.count.HP_md5_binary_post ) { - void (*postHookFunc) (const char *string, unsigned char *output); + void (*postHookFunc) (const uint8 *buf, const int buf_size, uint8 *output); for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; - postHookFunc(string, output); + postHookFunc(buf, buf_size, output); } } return; diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index e514b50fd..800fb8c76 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -7917,14 +7917,14 @@ void HP_clif_sendlook(struct block_list *bl, int id, int type, int val, int val2 } return; } -void HP_clif_class_change(struct block_list *bl, int class_, int type) { +void HP_clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd) { int hIndex = 0; if( HPMHooks.count.HP_clif_class_change_pre ) { - void (*preHookFunc) (struct block_list **bl, int *class_, int *type); + void (*preHookFunc) (struct block_list **bl, int *class_, int *type, struct map_session_data **sd); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_class_change_pre[hIndex].func; - preHookFunc(&bl, &class_, &type); + preHookFunc(&bl, &class_, &type, &sd); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -7932,13 +7932,13 @@ void HP_clif_class_change(struct block_list *bl, int class_, int type) { } } { - HPMHooks.source.clif.class_change(bl, class_, type); + HPMHooks.source.clif.class_change(bl, class_, type, sd); } if( HPMHooks.count.HP_clif_class_change_post ) { - void (*postHookFunc) (struct block_list *bl, int class_, int type); + void (*postHookFunc) (struct block_list *bl, int class_, int type, struct map_session_data *sd); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_class_change_post[hIndex].func; - postHookFunc(bl, class_, type); + postHookFunc(bl, class_, type, sd); } } return; @@ -43812,14 +43812,14 @@ void HP_md5_string(const char *string, char *output) { } return; } -void HP_md5_binary(const char *string, unsigned char *output) { +void HP_md5_binary(const uint8 *buf, const int buf_size, uint8 *output) { int hIndex = 0; if( HPMHooks.count.HP_md5_binary_pre ) { - void (*preHookFunc) (const char **string, unsigned char **output); + void (*preHookFunc) (const uint8 **buf, const int *buf_size, uint8 **output); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; - preHookFunc(&string, &output); + preHookFunc(&buf, &buf_size, &output); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -43827,13 +43827,13 @@ void HP_md5_binary(const char *string, unsigned char *output) { } } { - HPMHooks.source.md5.binary(string, output); + HPMHooks.source.md5.binary(buf, buf_size, output); } if( HPMHooks.count.HP_md5_binary_post ) { - void (*postHookFunc) (const char *string, unsigned char *output); + void (*postHookFunc) (const uint8 *buf, const int buf_size, uint8 *output); for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; - postHookFunc(string, output); + postHookFunc(buf, buf_size, output); } } return; |