Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Everything posted by meko

  1. Nope. You need to ditch the "pow" part entirely, so pow(10, .@i + 1) simply becomes (10 ** (.@i + 1))
  2. winscp? then I guess your pc is running windows and your server is running linux? If so, login through ssh (using putty) and navigate to the hercules folder (using cd), then use the command
  3. Some commands are identical, some have different parameters, and some exist in one and not the other. See each project's script_commands.txt for details
  4. if by Athena you mean eAthena then you can find the scripts here: https://sourceforge.net/p/eathena/svn/HEAD/tree/trunk/npc/
  5. You can find some in the Downloads section Hercules also provides its own basic set of scripts in the /npc/ folder
  6. You could add to the mob database a new pacific monster (one that does not attack if not provoked) and give it Assist mode. Then you would spawn a few of those in the map with the monster() command (to get the GID) and use unitattack() to force them to attack non-guild members. And since they would have Assist, every nearby mob would join the fray and attack too.
  7. A less complicated approach would be to create a new mob in the mob db with half of its normal HP and on the death event you would respawn it and move it to the new location
  8. Hercules currently doesn't trigger events when a mob is hit by an attack, only on-death events. Although I think there's a plugin that has OnNPCAttacked or something like that, but triggering an event on every hit would badly affect performance... A workaround could be to spawn a mob with the monster() command, retrieve its ID and then setting a npc timer that checks every second the UDT_HP of the monster and if (HP <= (MaxHP / 2)) you use unitwalk on it. The NPC should also check the death event in case an attack is powerful enough to kill it
  9. To configure max hairstyle & color: https://github.com/HerculesWS/Hercules/blob/master/conf/map/battle/client.conf#L45
  10. Hercules should automatically generate constants based on the AegisName of items in your database. If Apple evaluates to 0 it means you are either using a very old version of Hercules, or you don't have an item named Apple in your item db Simply add a mes("your message here") before the close; that is above the OnInit
  11. src/map/atcommand.c but I would recommend doing it through a plugin rather than modifying vanilla source, else it makes updating harder because you have a bunch of git conflicts to fix
  12. That's just two missing next() statements... Here you go: einbroch,55,200,4 script Herald 123,{ if (#onetimeitem) { mes("I hope you like your reward."); close; } mes("Hello youngster."); mex("Want to know a secret?"); next(); if (select("Yes", "No") == 1) { mes("[Herald]"); mes("You made the right choice."); mes("Do you know that the toughest material in Rune Midgard is called Mithril?"); mes("The best part is, I know how to get it."); next(); mes("If you're willing to prove me you can handle a tough excursion, I'll direct you to my friend, and from that moment on, you're his problem."); mes("Will you do it?"); next(); do { if (select("Yes I will do it!", "Wait, what's the material for?") == 1) { mes("[Herald]"); mes("Outstanding!"); mesf("I will need you to collect %i pieces of %s, an excellent mineral from Bradium Golems in Manuk Fields.", .request_amount, getitemname(.request_item)); mes("Bring me these, and I will give you something so that my friend grants you passage to the mines."); next(); mes("So, do you have the items?"); next(); switch(select("Yes, Here They are", "No")) { case 1: if (countitem(.request_item) < .request_amount) { mes("[Herald]"); mes("Don't make me regret this."); mesf("Bring me the damn %s!", getitemname(.request_item)); close; } mes("[Herald]"); mes("Well done, I wasn't thinking you could do it."); mes("But be careful, the place where you'll be headed is very tough."); delitem(.request_item, .request_amount); getitembound(.reward_item, .reward_amount, 1); #onetimeitem = 1; break; case 2: mes("[Herald]"); mes("Let me know when you're done. I will reward you for your efforts."); break; } close; } else { mes("[Herald]"); mes("I can't properly answer that."); mes("You will have to find someone willing to use it on anything."); mes("But hey, it's the toughest material in Rune-Midgard, it's gotta be useful, right?"); next(); } } while (true); } close; OnInit: // << YOUR CONFIGURATION GOES HERE >> .request_item = Apple; .request_amount = 20; .reward_item = Holy_Dagger; .reward_amount = 1; // << END OF CONFIGURATION >> } Make sure to change the items and amounts in OnInit to the items you want
  13. that's because you do not have in your inventory 20 of item id 512 to not show the two messages at the same time just add a next(); before the mes() that says don't make me regret
  14. that's because your #onetimeitem variable is already set for this account to reset, type in chat: @set #onetimeitem 0
  15. I tried to re-construct your script as best as I could, but it's one of the messiest I have ever seen. Here goes: einbroch,55,200,4 script Herald 123,{ if (#onetimeitem) { mes("I hope you like your reward."); close; } mes("Hello youngster. Want to know a secret?"); next(); if (select("Yes:No") == 1) { mes("[Herald]"); mes("You made the right choice. Do you know that the toughest material in Rune Midgard is called Mithril? The best part is, I know how to get it."); next(); mes("If you're willing to prove me you can handle a tough excursion, I'll direct you to my friend, and from that moment on, you're his problem. Will you do it?"); next(); do { if (select("Yes I will do it!:Wait, what's the material for?") == 1) { mes("[Herald]"); mes("Outstanding! I will need you to collect two pieces of Pure Bradium, an excellent mineral from Bradium Golems in Manuk Fields. Bring me these two, and I will give you something so that my friend grants you passage to the mines."); next(); mes("So ,do you have the items?"); next(); switch(select("Yes, Here They are:No")) { case 1: mes("[Herald]"); mes("Well done, I wasn't thinking you could do it. But be careful, the place where you'll be headed is very tough."); if (countitem(512) < 20) { mes("[Herald]"); mes("Don't make me regret this. Bring me the damn Bradium!"); close; } delitem(512, 20); getitembound(1244, 1, 1); #onetimeitem = 1; break; case 2: mes("[Herald]"); mes("Let me know when you're done. I will reward you for your efforts."); break; } close; } else { mes("[Herald]"); mes("I can't properly answer that. You will have to find someone willing to use it on anything. But hey, it's the toughest material in Rune-Midgard, it's gotta be useful, right?"); } } while (true); } }
  16. missing argument with delitem and missing semicolon for getbounditem you are missing a comma, an argument and a semicolon, and it should be "getitembound"
  17. meko

    7v7npc

    you mean 7 NPCs fighting each other? o_o
  18. meko

    ZENY * #Kill

    // this assumes the target player is online and those variables are filled: // .@char_name$ // .@account_id // .Rates .@kill_counter = getvariableofpc(KILL_COUNTER, .@account_id); .@cost = .Rates * .@kill_counter; mesf("Are you sure you want to bail %s out of jail for %d zeny?", .@char_name$, .@cost); next(); if (select("Confirm", "Cancel") == 1) { if (Zeny < .@cost) { mes("You didn't have enough Zeny."); } else { Zeny -= .@cost; // remove zeny set(getvariableofpc(KILL_COUNTER, .@account_id), 0); // reset counter to zero // {{ ADD YOUR UNJAILING LOGIC HERE }} mes("Kabooom!"); } } close; OnPCKillEvent: if (readparam(BaseLevel, killedrid) < 50) { ++KILL_COUNTER; // increase the kill counter // {{ ADD YOUR JAILING LOGIC HERE }} } end;
  19. meko

    ZENY * #Kill

    That's exactly what my script does, it assumes .@char_name$ and .@account_id are of the player in jail, not the player paying the bail. It checks the kill counter of the other player by using getvariableofpc(). You just need to add your release logic where it says Kaboom, and to add your dialog before the "Are you sure ..."
  20. If you want both punching bags to respawn when one of them is killed, you would add this in OnDummyKill right before you use monster() killmonster("rebel_mt", "Punching Bag::OnDummyKill"); If you want only one to respawn you will have to split OnDummyKill into two separate events
  21. meko

    ZENY * #Kill

    You don't need to use SQL at all for this; it can all be done in the script engine: // this assumes the target player is online and those variables are filled: // .@char_name$ // .@account_id // .Rates mesf("Are you sure you want to bail %s out of jail?", .@char_name$); next(); if (select("Confirm", "Cancel") == 1) { .@kill_counter = getvariableofpc(KILL_COUNTER, .@account_id); .@cost = .Rates * .@kill_counter; if (Zeny < .@cost) { mes("You didn't have enough Zeny."); } else { Zeny -= .@cost; mes("Kabooom!"); } } close; OnPCKillEvent: if (readparam(BaseLevel, killedrid) < 50) { ++KILL_COUNTER; } end;
  22. Yeah that much I know, I meant when using the CP, not checking if it is online. Ie if you need the CP to login to an admin account and send a KICK or BAN packet to map server or use an atcommand
  23. @Relman il semble que CeresCP n'a pas été mis à jour depuis 2012 donc c'est possible qu'il soit incompatible avec le protocole actuel
  24. Le CP se connecte à login/char/map comme un joueur normal pour vérifier si le serveur répond, puis se déconnecte aussitot, donc tu vois "Closed connection" même si ce n'est pas un vrai joueur
×
×
  • Create New...

Important Information

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