Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Everything posted by meko

  1. meko

    [HELP] Item Script

    bonus2(bHPRegenRate, ((MaxHP/100)*5), 1000); bonus2(bHPDrainRate, 10, 2);
  2. meko

    Items script

    use bonus instead of bonus2
  3. If you are unsure about the resources you need, choose a scalable VPS, such as DigitalOcean Droplets or AWS Lightsail, which allows you to scale the resources up or down to meet demand
  4. you might want to trigger the command in OnPCLogoutEvent
  5. The ID sent by the server is hardcoded: https://github.com/HerculesWS/Hercules/blob/stable/src/map/pc.c#L6752
  6. - script AutoVIP FAKE_NPC,{ OnPCLoginEvent: // save the original group @ACTUAL_GROUP = getgroupid(); // check if the player was never a VIP if (##VIP_UNTIL < 1) { // give the free VIP status ##VIP_UNTIL = gettimetick(2) + .free_vip_length; } // check if the player is currently a VIP if (##VIP_UNTIL > gettimetick(2)) { // move the player to the VIP group until logout setgroupid(.vip_group); // notify the player dispbottom("You are a VIP player."); // schedule a timer to revert the group on expiration addtimer((##VIP_UNTIL - gettimetick(2)) * 1000, strnpcinfo(0) + "::OnExpire"); } // check if the player was a VIP but it expired while away else if (##VIP_UNTIL > 1) { goto OnExpire; } end; OnExpire: if (##VIP_UNTIL <= gettimetick(2)) { // revert to the original group setgroupid(@ACTUAL_GROUP); // notify the player dispbottom("Your VIP status expired. You are now a normal player."); // update the variable ##VIP_UNTIL = 1; } end; /////////// Configuration below OnInit: .vip_group = 1; // the ID of your VIP group .free_vip_length = (((60 * 60) * 24) * 5); // the length of the free VIP period (5 days) }
  7. To check on which map a player is: .@map$ = strcharinfo(PC_MAP, "%", .@account_id); if (.@map$ == "%") { // player is not on a map } else { // player is on a map // << add further checks here >> }
  8. in the Script<> section, you could do something like: if (gettimetick(2) <= @ITEM_LOCK[0]) end; @ITEM_LOCK[0] = gettimetick(2) + 1; percentheal(100, 100);
  9. you can find the documentation in the /doc folder, and some more on the wiki: https://github.com/HerculesWS/Hercules/wiki
  10. well, it's quite easy, you are supposed to replace <tab> by an actual tab, and you should also change the location/name boilerplate with the actual info
  11. By default, all servers use the same SQL configuration. To have a different SQL configuration for login/char/map, you can make more sql_connection.conf files and change the file paths in the @import directives. To configure the log system, you need to edit conf/map/logs.conf
  12. The SQL configuration is now in conf/global/sql_connection.conf
  13. However you can have 1 login server with many char+map pairs https://github.com/HerculesWS/Hercules/wiki/Multi-Realm
  14. multi-zone support was deprecated in 2016 and will be completely removed very soon
  15. Hercules now has a proper changelog, so I am locking this. You can always find the latest release here: https://github.com/HerculesWS/Hercules/releases/latest The full changelog is in CHANGELOG.md
  16. Sorry, Hercules does not offer pre-built binaries. However, surely someone can hook you up if you ask nicely: https://discord.gg/ZUzbRSp
  17. Offline as in only available on the computer you are currently using? Hercules, by default, already binds to localhost (127.0.0.1) so there's no extra configuration required: no need to open ports anywhere, no need to register a domain name, no need to get a VPS. Just follow the official instructions: README.md BTW, since you are on Windows 10, you don't have to install that oh-so-bulky Visual Studio, you can just enable the Windows Subsystem for Linux (WSL) and follow the Linux installation instructions instead of the Windows ones.
  18. The rAthena documentation does NOT apply to Hercules. Please refer to the Hercules documentation when using Hercules. If you seek support for rAthena instead, please use the rAthena forums. Hercules currently does not support this script command, and there is no Pull Request implementing it. Also, your syntax in Script<> is wrong
  19. @nuna see also item_packages.conf
  20. Try this: function script loot_crate { .@index = getarrayindex(getarg(0)); .@size = getarraysize(getarg(0)); for (.@i = .@index; .@i < .@size - .@index; .@i += 3) { for (.@e = 0; .@e < getelementofarray(getarg(0), .@i + 2); ++.@e) { .@loot[.@count++] = .@i; } } .@rand = .@loot[rand(.@count)]; getitem(getelementofarray(getarg(0), .@rand), getelementofarray(getarg(0), .@rand + 1)); announce(sprintf("Player %s obtained %ix %s from a loot crate!" strcharinfo(PC_NAME), getelementofarray(getarg(0), .@rand + 1), getitemname(getelementofarray(getarg(0), .@rand))), getarg(1, bc_all)); return true; } And in your NPC do something like this: MAP,X,Y,DIR script NAME SPRITE,{ mes("Hello"); next(); loot_crate(.rewards, bc_all); mes("Goodbye!"); close; OnInit: setarray(.rewards, // Item, Amount, Chance Yggdrasilberry, 1, 60, Portable_Furnace, 1, 10, Spectacles, 1, 10, Seed_Of_Yggdrasil, 1, 10, Poison_Bottle, 1, 5, Silver_Coin, 1, 5); }
  21. the macro I posted WILL remain the same, but I added a ternary operator (if ? then : else) to it so it will check with is_boss() and have different behaviour accordingly, just like what you wanted if you want the check outside of macros, then make a 2nd one and when invoked do something like is_boss(src) ? macro1 : macro2
  22. #define NORMALIZE_RDAMAGE(d) ( trdamage += rdamage = max(1, is_boss(src) ? min(max_reflect_damage, (d)) : (d)) )
  23. This is unrelated to Hercules, please contact the phpMyAdmin team instead: https://www.phpmyadmin.net/support/ BTW, this is just an encoding error: make sure you set the charset in your Content-type HTTP header and use a matching charset client-side in a <meta> tag. If that's too complicated, just use a desktop SQL client: https://www.heidisql.com/ (free, open source) https://www.mysql.com/products/workbench/ (free, open source) https://dbeaver.jkiss.org/ (free, open source) https://navicat.com/en/products/navicat-for-mariadb (commercial, proprietary) https://navicat.com/en/products/navicat-for-mysql (commercial, proprietary)
×
×
  • Create New...

Important Information

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