Jump to content

Tokei

Members
  • Posts

    696
  • Joined

  • Last visited

  • Days Won

    102

Everything posted by Tokei

  1. Copy and paste this file to Scripts > Open scripts folder (name it "SetColor.cs"): using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Media; using System.Windows.Media.Imaging; using ErrorManager; using GRF.FileFormats.ActFormat; using GRF.FileFormats.SprFormat; using GRF.FileFormats.PalFormat; using GRF.Image; using GRF.Image.Decoders; using GRF.Graphics; using GrfToWpfBridge; using TokeiLibrary; using TokeiLibrary.WPF; using Action = GRF.FileFormats.ActFormat.Action; using Frame = GRF.FileFormats.ActFormat.Frame; using Point = System.Windows.Point; namespace Scripts { public class Script : IActScript { public object DisplayName { get { return "Change all layer color"; } } public string Group { get { return "Scripts"; } } public string InputGesture { get { return null; } } public string Image { get { return null; } } public void Execute(Act act, int selectedActionIndex, int selectedFrameIndex, int[] selectedLayerIndexes) { if (act == null) return; var frame = act[selectedActionIndex, selectedFrameIndex]; GrfColor startColor; if (frame.Layers.Count == 0) { startColor = GrfColor.White; } else { startColor = act[selectedActionIndex, selectedFrameIndex, 0].Color; } ColorPicker.PickerDialog picker = new ColorPicker.PickerDialog(startColor.ToColor(), ColorPicker.Core.ColorMode.Hue); picker.Owner = WpfUtilities.TopWindow; picker.ShowDialog(); if (picker.DialogResult) { try { act.Commands.Begin(); GrfColor newColor = picker.PickerControl.SelectedColor.ToGrfColor(); act.Commands.SetColor(newColor); } catch (Exception err) { act.Commands.CancelEdit(); ErrorHandler.HandleException(err, ErrorLevel.Warning); } finally { act.Commands.End(); act.InvalidateVisual(); } } } public bool CanExecute(Act act, int selectedActionIndex, int selectedFrameIndex, int[] selectedLayerIndexes) { return act != null; } } } Then you can use Scripts > Change all layer color. I really should update Act Editor @@...
  2. You can check out the script commands over here: https://github.com/rathena/rathena/blob/master/doc/script_commands.txt Search for *implode.
  3. The drag and drop feature has issues when two processes have different access privileges. Since explorer.exe is not started with admin rights (even if you're an administrator), GRF Editor won't be able to receive messages from explorer. I've seen many posts regarding this issue (it applies well beyong GRF Editor) but there are no apparent solutions to resolve this other than fully disabling UAC from the registry. So if you want to drag and drop, you should not start GRFE as an admin, simply open it normally and it should work fine. The file extension feature will require access to the registry and therefore will need admin privileges, which, as you can guess, is a problem. I do not have a copy of Windows 10 yet, so I'm not sure if the file extension even works. I presume it doesn't since Windows always changes how shortcuts work in every update. (Updated the mediafire link to fix the "Add..." box with thor files.)
  4. The "Add..." feature is deprecated and should have been removed a while ago. I left it there if people were having trouble with drag & drop, but drag and dropping is still preferred. I'll go see what's wrong with the thor format and the "Add..." feature though, thanks ~!
  5. Counter type achievements work a bit differently; the target counter that you set (in achievement_db.yml) is your actual goal/condition. So first thing first, you want to add it to your achievement definition: - ID: 500001 Group: "AG_BATTLE" Name: "Name" Target: Count: 500 Score: 10 What you want to do isn't compatible with counter type achievements (you'd have to create a new group, pass it to AG_CHAT, and set the start value manually, etc). However you can do this easily via scripting instead: OnPCKillNPC: if (CONQ_KILLNPC < 500) { CONQ_KILLNPC++; achievementupdate 500001, ACHIEVEINFO_COUNT1, CONQ_KILLNPC; if (CONQ_KILLNPC == 500) { achievementcomplete 500001; } } end; Hmmm, it appears achievementupdate isn't included...! You can add this script function in your source: //BUILDIN_DEF(achievementupdate,"iii?"), BUILDIN_FUNC(achievementupdate) { struct map_session_data *sd; int i, achievement_id, type, value; achievement_id = script_getnum(st, 2); type = script_getnum(st, 3); value = script_getnum(st, 4); if (!script_charid2sd(5, sd)) { return SCRIPT_CMD_FAILURE; } if (achievement_search(achievement_id) == NULL) { ShowWarning("buildin_achievementupdate: Achievement '%d' doesn't exist.\n", achievement_id); return SCRIPT_CMD_FAILURE; } ARR_FIND(0, sd->achievement_data.count, i, sd->achievement_data.achievements[i].achievement_id == achievement_id); if (i == sd->achievement_data.count) achievement_add(sd, achievement_id); ARR_FIND(0, sd->achievement_data.count, i, sd->achievement_data.achievements[i].achievement_id == achievement_id); if (i == sd->achievement_data.count) { return SCRIPT_CMD_FAILURE; } if (type >= ACHIEVEINFO_COUNT1 && type <= ACHIEVEINFO_COUNT10) sd->achievement_data.achievements[i].count[type - 1] = value; else if (type == ACHIEVEINFO_COMPLETE) sd->achievement_data.achievements[i].complete = value ? true : false; else if (type == ACHIEVEINFO_COMPLETEDATE) sd->achievement_data.achievements[i].completeDate = value; else if (type == ACHIEVEINFO_GOTREWARD) sd->achievement_data.achievements[i].gotReward = value ? true : false; else { ShowWarning("buildin_achievementupdate: Unknown type '%d'.\n", type); return SCRIPT_CMD_FAILURE; } achievement_update_achievement(sd, achievement_id, false); return SCRIPT_CMD_SUCCESS; } Best of luck ~!
  6. I remember Emistry answering me with this trick when I asked the same question xD. Getmapusers returns -1 if the map doesn't exist (and you can't have negative players on a map).
  7. You'll have to give more information or provide a way to reproduce your issue. I tried running your script and I didn't get any warnings...!
  8. I'd go with if (checkoption(0x2|0x4|0x4000|0x40)) { mes "Please unhide yourself."; close; } Where 0x2 = OPTION_HIDE 0x4 = OPTION_CLOAK 0x40 = OPTION_INVISIBLE (GM hide and feint bomb) 0x4000 = OPTION_CHASEWALK
  9. I doubt mono will work, you can give it a try but the application is meant for Windows.
  10. Well, the input is wrong: input .@e; if (.@e < 5 || .@e > countitem(757)) { mes "[Leon]"; mes "That's an invalid amount of Elunium"; mes "The Exchange rate is 5 rough elu to 1 Elunium"; close; } .@e = .@e / 5 * 5; mes "Are you sure you want to exchange ^0055FF" + .@e + " Rough Eluniums?^000000?"; if (select("Yes:No") == 2) close; mes "[Leon]"; mes "Okay come to me again if you want to exchange"; delitem 757, .@e; getitem 985, .@e/5; end; And so was the delitem line.
  11. Should be working fine now, using 1.8.2.2.
  12. Annnnd fixed! The TGA files were using the image type 10; they should be showing up fine now: 1.8.2.2 Also, I fixed GrfCL's issues. Thanks for the sample GRF @Anacondaqq!
  13. @Anacondaqq I'd need the image you're using for tarot (it seems to be custom and not made by Gravity). The TGA image type 2 flips the image horizontally and that is intended. I wasn't aware Gravity supported other TGA formats (all their TGA files use the same image type). As for the settings issue, I'm guessing Windows 10 changed the way they associate files. I'll simply move the exception for now. Updated: 1.8.2.1
  14. As others have pointed out, this is caused by the packet obfuscation not being set properly. You have to either enable it on both the client and the emulator, using the same exact packet keys, or disable it on both end (not recommended in the long run, but it's easier to do when starting). To disable packet obfuscation: Client side: Open NEMO and load the client. You'll find the "Disable packet obfuscation" patch that you must appl Server side: Open src\config\core.h and uncomment "#define PACKET_OBFUSCATION" so that you get //#define PACKET_OBFUSCATION Then recompile your server. Make sure you've set the correct client date in src\common\mmo.h > #define PACKETVER 20151104 (or whatever client version you're using, but 55 should be around that area). If you're using a client past 2015-11-04 and that you still can't connect, then it would mean you need a higher packet version (56 and above). Unfortunately, rAthena doesn't have those packets in their repo yet so you're out of luck! You'll have to use PEEK and figure those out.
  15. You should avoid resellers and instead go with hostings such as OVH/Limestone/etc. It's a harder learning curve but it's much more rewarding in the end as you'll have full control over your server. As for RagnaHosting, I hope you haven't invested too much in it =/.
  16. The OnTouch event triggers if you walk into the NPC's zone (not when clicking the NPC). You're describing exactly what OnTouch is meant and used for.
  17. Well, these look regular ontouch areas. lasa_fild01,132,374,3 script Sloth#doram 10167,5,5,{ end; OnTouch: npctalk "Hey, there! Get over here for a minute!"; end; }
  18. Can you describe what you're trying to do? It's almost impossible to help you based on that alone. What's special about the NPC?
  19. As it says in the instructions, you cannot rename the executable file name once you encrypt it.
  20. His GRF is being used by another software or he doesn't have write access to the directory (which is what the error says ;x).
  21. Well, as the error says: access to the file path is denied.
  22. Heya, this error can only happen when you try to extract a file. This is very common for encrypted files (they cannot be extracted) but it can also happen if the file inside the GRF is broken. The thread will keep extracting the rest of the files (if you're trying to extract more than one) and only the last error will be shown. You'd have to give us more details on what you're doing here.
  23. Yep, it's normal xD. It's from this line: if (map_mapname2mapid(map_name_new) >= 0) { // This will always show a warning in the console, but removing it is not worth the trouble. sprintf(atcmd_output, "Destination map already exists: %s", map_name_new); clif_displaymessage(fd, atcmd_output); return -1; } It simply checks if the map already exists and prevents you from copying on top of an already existing one. Since the map currently doesn't exist, it gives you a warning but it's what we're looking for. It's like when you use... "@warp unkonwnmap", which also gives you that warning. (Not something worth fixing ;P)
  24. Updated the diff, I'm surprised Visual Studio didn't have any issue with this line whatsoever.
×
×
  • Create New...