Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Everything posted by meko

  1. You are not asking in the right place: you are using rAthena, not Hercules. please fill an issue here: https://github.com/rathena/rathena/issues/new
  2. this is a horrendous way to do it; instead of duplicating the array you should access directly with getelementofarray(getarg(0), index) see this file for more examples:
  3. You could spawn your monster with the monster() command to get its GID, and then periodically (like every 100ms) check for nearby units using the getunits() command. If a unit is found that matches your criteria (ie type being MOB or PC) you kill it using unitkill() and you can make it spawn a new one after a timeout to begin the cycle again. If you want something simpler look for NPC_SELFDESTRUCTION in the mob skill db
  4. - script @request 32767,{ OnCall: if (gettimetick(2) <= @COMMAND_LOCK[getnpcid(0)] && !has_permission(PERM_RECEIVE_REQUESTS)) { dispbottom(sprintf("You must wait at least %i seconds to call this command again.", .delay)); } else { @COMMAND_LOCK[getnpcid(0)] = gettimetick(2) + .delay; // update the lock atcommand("@request " + implode(.@atcmd_parameters$[0], " ")); // call the true command } end; OnInit: .delay = 10; // number of seconds to wait in between calls bindatcmd("request", strnpcinfo(NPC_NAME) + "::OnCall", 99, 99, 0); // bind the custom atcommand add_group_command("request", 0, true, false); // allow group 0 to use the custom atcommand add_group_command("request", 1, true, false); // allow group 1 to use the custom atcommand add_group_command("request", 2, true, false); // allow group 2 to use the custom atcommand add_group_command("request", 3, true, false); // allow group 3 to use the custom atcommand add_group_command("request", 4, true, false); // allow group 4 to use the custom atcommand add_group_command("request", 10, true, false); // allow group 10 to use the custom atcommand // ^ add or remove groups to match your groups.conf } In the OnInit section change .delay to the amount of seconds to wait and add your groups to the add_group_command() lines if any is missing. Any group that has the "receive_requests" permission will bypass the delay entirely. Relevant documentation: bindatcmd add_group_command atcommand has_permission
  5. You could make @request only usable by group id 99 (admin) and create a custom command (with bindatcmd()) in which you put your extra checks and call the real @request with atcommand()
  6. Instead of adding dynamic mob modes I would suggest a more flexible approach: a new script command that allows to change mob data at any given time so you could do - script DayNight FAKE_NPC,{ OnClock0600: day(); // make Poring passive at daytime setmonsterinfo(PORING, MOB_MODE, getmonsterinfo(PORING, MOB_MODE) &~ 0x4); end; OnInit: // setting correct mode upon server start-up if (gettime(GETTIME_HOUR) >= 6 && gettime(GETTIME_HOUR) < 18) { end; } OnClock1800: night(); // make Poring aggressive at night setmonsterinfo(PORING, MOB_MODE, getmonsterinfo(PORING, MOB_MODE) | 0x4); end; } If this is desirable please fill an issue here and I will add it when I get some time: https://github.com/HerculesWS/Hercules/issues/new
  7. please don't instruct them to manually edit the core engine as it makes updating much harder; you should instead make a plugin and yes, I could add a config flag if many people need this
  8. You can build your own wrapper around @job by using bindatcmd() and then you can do some checks and call useatcmd("@job")
  9. The hash 4928dff40de97204aa3d91cc539094e5bc667906 is not found in the git history. This means your engine is modified, and as such I can't provide support. Make sure you upgrade to the latest, unmodified version of the Hercules engine
  10. Can you please confirm the hash of this "latest" revision that you are using? should appear on top when you start map server
  11. Hercules does support packet shuffling and you can use pretty much any client with it; Hercules will automatically rearrange the packets based on the client version. About Hercules vs. rAthena, see the already existing topics: (there's many, many more but I won't list them all) Hercules is focused on performance and stability while rAthena is mostly focused on features and content. The two scripting engines and database formats are similar but incompatible, this means you will need to do some conversion.
  12. Well, first of all, your script has no line breaks. Labels need to be on their own line with nothing else. The script header too needs its own line. Also in the script header you used spaces but it needs tabs
  13. right before using unitskill() you could call getmapxy() with GID of the mob. If the GID is not found the command will return -1 (while it returns 0 on success). If it returns -1 you would then call deletearray() to remove it from the array while shifting; You can also use the array manipulation function, namely array_shift()
  14. It really depends on what you wish to accomplish. Do you want to do it from a plugin or from scripts? Do you want the effect to be centered on the player or on another unit (mob,npc, ...)? Do you want all players in the area to see it or only one player? From a plugin you would simply push to the event queue, while from script you would use addtimer() or npc timers in combination with specialeffect(). @timed_effect = EF_HITDARK; // set a PC variable with the effect to use addtimer(500, strnpcinfo(NPC_NAME) + "::OnTimedEffect"); // set the trigger to 500ms in the future end; // terminate execution OnTimedEffect: specialeffect(@timed_effect, AREA, playerattached()); // show the effect to everyone in the area, centered on the attached player end;
  15. right when you start map server it should tell you the hash
  16. Please confirm the git hash of your map server
  17. t_sd->party_invite = sd->status.party_id; t_sd->party_invite_account = sd->status.account_id; party->reply_invite(t_sd, sd->status.party_id, 1);
  18. UPDATE: This was introduced by bbaf869 (& fixed in 77c4315) in response to Herc#5085
  19. Mobs have a different max skill level than players. Currently it's set to 100 by default EDIT: it seems level 48 is a special case: it gets the rate benefit but has the same duration as level 10 ...and this is only true for this one specific skill. Seems like a dirty hack that was added because someone was too lazy to add a new option to mob skill db
  20. meko

    get cell ID

    I guess you meant (x,y) of a cell but if you really want an ID (of map->cell[]) you would do (x + y * map->list[m].xs). If you just want x,y then you don't need to do anything fancy since skill_castend_pos2 already has access to x,y
  21. @greenieken It seems you didn't read my post at all... specialeffect2 is the easiest to convert because its behaviour is predicable, unlike misceffect, which depends on attached oid/rid. In your case, specialeffect2(EF_BEGINSPELL6) could be converted to specialeffect(EF_BEGINSPELL6, AREA, playerattached()). However, I see you call it from the OnAgitStart event, which does not have an attached rid so even your specialeffect2() shouldn't have worked before... And the vanilla script did not use specialeffect2 either. The correct command to use here is simply specialeffect(EF_BEGINSPELL6);
  22. @greenieken when you start hercules it should show the revision, assuming you cloned with git and not downloaded a .zip
×
×
  • Create New...

Important Information

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