Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by meko

  1. unittalk(getnpcid(0), "your message", true, SELF, playerattached()); see doc/script_commands.txt for documentation
  2. Cannot find -lcurl means you are missing libcurl: you should install it with your package manager (apt, yum, etc). Usually this package is named libcurl-dev or curl-dev. If it tells you that the package is a virtual/meta package provided by other packages then you must pick a flavour (openssl, libressl, gnutls, etc), This means on Ubuntu you likely want to install libcurl4-openssl-dev
  3. @Origami Put the hashtable.c file in Hercules/src/plugins Build the plugin On Linux: from Hercules/ run "make plugin.hashtable" On Windows you have to do quite a bit more work: you must create a vcproj file by following our official instructions, or you can auto-generate it with this tool: https://herc.ws/board/files/file/408-vs-plugin-creator/ Once the solution file is made, you have to build it in visual studio Add "hashtable" to plugins_list in src/plugins.conf
  4. MF_LOADEVENT should be in uppercase. Also it might be faster to use a hash table than looping through the array (imagine having an array with 2k maps and doing a string comparison for each one of them every time someone enters the map) - script map_name -1,{ OnInit: .maps = htnew(); // create a new hash table // htput(.maps, "<map name>", "<map nick>"); htput(.maps, "prontera", "Prontera City, The Imperial Capital"); htput(.maps, "morocc", "Morroc Town, The Frontier"); htput(.maps, "geffen", "Geffen, The City of Magic"); htput(.maps, "payon", "Payon Town, The Upland Village"); htput(.maps, "alberta", "Alberta, The Port City"); htput(.maps, "izlude", "Izlude Town, The Satellite City of Prontera"); htput(.maps, "aldebaran", "Al De Baran, The Gate to the New World"); htput(.maps, "xmas", "Lutie, The City of Eternal Christmas"); htput(.maps, "comodo", "Comodo, The City of Fun and Celebrations"); htput(.maps, "yuno", "Juno, The Capital of the Commonwealth and Ancient Lore"); htput(.maps, "amatsu", "Amatsu, The New Land Discovered"); htput(.maps, "gonryun", "Gonryun, The Hermit Land"); htput(.maps, "umbala", "Umbala, The Lost Land"); htput(.maps, "niflheim", "Niffleheim, The Cold Land of Death"); htput(.maps, "louyang", "Louyang, The Fortress of Dragon"); htput(.maps, "new_1-1", "Training Ground"); htput(.maps, "sec_pri", "Valhalla Prison"); htput(.maps, "jawaii", "Jawaii, The Island of Love"); htput(.maps, "ayothaya", "Ayothaya, The Land of Majectic Culture"); htput(.maps, "einbroch", "Einbroch, The Steel City"); htput(.maps, "lighthalzen", "Lighthalzen, The City of Scientific Myths"); htput(.maps, "einbech", "Einbech, The Mining Town"); htput(.maps, "hugel", "Hugel, Between the Icy Moutain and Chilly Blue Sea"); htput(.maps, "rachel", "Rachel, The Capital City of Arunafeltz"); htput(.maps, "veins", "Veins, The Canyon Village"); htput(.maps, "mid_camp", "Rune Midgard Allied Forces Post"); .@it = htiterator(.maps); // create an iterator to loop through the table for (.@map$ = htifirstkey(.@it); hticheck(.@it); .@map$ = htinextkey(.@it)) { // we are only interested in the key so no need to htget() here setmapflag(.@map$, MF_LOADEVENT); } htidelete(.@it); // we're done with the iterator: deallocate it end; OnPCLoadMapEvent: // check whether it's in the hash table: if (.@nick$ = htget(.maps, strcharinfo(PC_MAP), "")) { announce(.@nick$, bc_self); } end; }
  5. pointshop is not a valid NPC type in Hercules. You might want to use the trader type with subtype NST_CUSTOM
  6. for inarray() you can use array_find() from Array manipulation functions, which behaves the same way: if (array_find(.blackList[0], .@potion) != -1) { for debugmes you should use consolemes: consolemes(CONSOLEMES_DEBUG, "message");
  7. You must execute the queries from sql-files/logs.sql to create the log tables
  8. the file is located at db/abra_db.txt
  9. the documentation has not been updated yet but you must define the constant CUSTOM_SKILL_RANGES at compile time, with the syntax being: {from, to}, {from, to}, ... In your case since you are only adding one skill you would define it as: {8443, 8443}, this means you would pass a -D compiler option like this: -DCUSTOM_SKILL_RANGES="{8443,8443}," ...which will insert it in skill_idx_ranges[]
  10. this just means mysql is not available in the apt repos so you should install mariadb-server instead of mysql-server and libmariadb-dev (and optionally the compatibility layer libmariadb-dev-compat) instead of libmysqlclient-dev
  11. Follow the installation instructions provided in the README file and make sure to configure your firewall and to open ports with your hosting provider
  12. meko

    auto revive

    OnPCDieEvent: if (!(isequipped(Helm_Of_Sun)) // no helm of sun || agitcheck() // WoE || getmapflag(strcharinfo(PC_MAP), mf_pvp) // map PvP || getunittype(killerrid) == UNITTYPE_PC) // killed by a player end; addtimer(1000, strnpcinfo(NPC_NAME) + "::OnAutoRevive"); end; OnAutoRevive: recovery(getcharid(CHAR_ID_ACCOUNT)); // revive the player end;
  13. Hercules has no LTS versions so the latest revision of the stable branch is always the most stable revision since we do not backport patches to older releases. Keep in mind that new bugs do appear from time to time but if you encounter some please report them so that they may be patched in the next release. If bugs are severe we also do pre-releases (denoted as vXX.XX.XX+Y) to address them in-between 2 releases
  14. MD5 is not encryption, it is only hashing. Ideally Argon2 or PBKDF2 should be used when storing passwords but the engine currently supports neither. There is a PR that implements PBKDF2 for Hercules but it is currently on hold
  15. From the error it appears that FluxCP is trying to connect to your mysql server but fails to reach it and the connection times out. You may have forgotten to update the DbConfig.Hostname when you moved to your new host
  16. Keep in mind that performing SQL queries is slow, especially when there's 200 rows of results so you should be using getunits() when possible. If you do not provide a map to getunits() it will search the whole server, just like the SQL query that is used in Ridleys script.
  17. this is untested but you could do something similar to: - script mapitem FAKE_NPC,{ end; OnCall: // @mapitem <nameid> <amount>{, <map>} .@nameid$ = .@atcmd_parameters$[0]; .@amount = atoi(.@atcmd_parameters$[1]); .@map$ = strcharinfo(PC_MAP); if (.@atcmd_parameters == 3) { .@map$ == .@atcmd_parameters$[2]; } else if (.@atcmd_parameters != 2) { dispbottom("mapitem: illegal number of arguments."); dispbottom("Usage:"); dispbottom("@mapitem <nameid> <amount> for the current map"); dispbottom("@mapitem <nameid> <amount> <map> for another map"); end; } if (getmapinfo(MAPINFO_ID, .@map$) < 0) { dispbottom(sprintf("mapitem: map `%s` not found.", .@map$)); end; } .@itemid = getiteminfo(.@nameid$, ITEMINFO_ID) < 0 ? getiteminfo(atoi(.@nameid$), ITEMINFO_ID) : getiteminfo(.@nameid$, ITEMINFO_ID); if (.@itemid < 0) { dispbottom(sprintf("mapitem: item `%s` does not exist.", .@nameid$)); end; } .@nameid$ = getiteminfo(.@itemid, ITEMINFO_AEGISNAME); if (.@amount < 0 || .@amount > .max) { dispbottom(sprintf("mapitem: trying to give %d `%s`, while the maximum allowed is %d.", .@amount, .@nameid$, .max)); end; } .@count = getunits(BL_PC, .@units, false, .@map$); freeloop(true); for (.@i = 0; .@i < .@count; ++.@i) { if (.bound != false) { getitembound(.@itemid, .@amount, .bound, .@units[.@i]); } else { getitem(.@itemid, .@amount, .@units[.@i]); } } freeloop(false); .@players = ++.@i; .@total = .@amount * .@players; dispbottom(sprintf("mapitem: gave %d `%s` (%d total) to %d players on map `%s`", .@amount, .@nameid$, .@total, .@players, .@map$)); end; OnInit: bindatcmd("itemmap", "mapitem::OnCall", 14, 99); .max = 100; .bound = IBT_ACCOUNT; // set to false to disable }
  18. If you want to do it from a script, you would use getunits(): .@count = getunits(BL_PC, .@units, false, "geffen"); for (.@i = 0; .@i < .@count; ++.@i) { getitem(Bubble_Gum_Box_10, 1, .@units[.@i]); }
  19. Running with root privileges is inherently insecure and so Hercules will complain when trying to start as the root user. You must create a new user and run Hercules under that new user (preferably as a daemon). To run a command with sudo your user must be in the sudoers file (you can edit it with visudo) but keep in mind that Hercules will also warn you when running with sudo (since it runs as root).
  20. Hercules builds just fine on ARMv8 but the macro checking for ARM version has not been updated yet for __ARM_ARCH_8A__ so compilation will fail until a PR is merged that changes cbasetypes.h. Meanwhile you can use this git patch: --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -67,6 +67,9 @@ #define __ARM_ARCH_VERSION__ 6 #elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7S__) // gcc ARMv7 #define __ARM_ARCH_VERSION__ 7 +#elif defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_8R__) || defined(__ARM_ARCH_8M_BASE__) \ + || defined(__ARM_ARCH_8M_MAIN__) // gcc ARMv8 +#define __ARM_ARCH_VERSION__ 8 #elif defined(_M_ARM) // MSVC #define __ARM_ARCH_VERSION__ _M_ARM #else --
  21. It means you are trying to concatenate the elements of an array into a string but the array is empty. You must make sure the array is non-empty before imploding it: if (getarraysize(.@myArray$)) { .@string$ = implode(.@myArray$); }
  22. Whenever you see a deprecation warning you should look at the script documentation for instructions, which in this case instructs you to use specialeffect(). You can find more details on the Deprecation Notice thread: In your case you would simply replace it with: specialeffect(EF_BEGINASURA, AREA, playerattached());
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.