Jump to content

Tokei

Members
  • Posts

    696
  • Joined

  • Last visited

  • Days Won

    102

Everything posted by Tokei

  1. Heya, Sorry about this! I have re-uploaded with the same link as above. It appears one of the library didn't compress properly when packing the executable.
  2. Updated to 1.8.4.3 : Added support for json and bson file formats (you can save as a bson file after editing). Only common types are supported. Fixed a bug with the lub decompiler regarding non-latin strings not being enclosed properly.
  3. It's failing to save the file because you have the file opened in GRF Editor already. You can't write/modify a file that's being used by another program. So as the error says, the file is locked.
  4. The client can read up to uint32, so ~4GB. But you are indeed correct, GRF Editor shouldn't allow more than that either for obvious reasons. Though the check put in place for size limit is obviously not working, so I'd have to fix that.
  5. Heya, A few comments first: I assume that this script is going to be duplicated since you have multiple copies of it in your replay. I made it into a floating script instead. There are no handy methods to use for making a character walk towards a target with 1 cell distance (it will try to go on top of the target). If you want something more convenient, you'll have to use unitwalk with x/y coordinates, or make your own function. Though for a starting script, unitwalkto will do. Since you can break the script by simply walking away, while unitwalkto is running, it will trigger the OnOpenChest event label for some unknown reason. So you need to check the distance again. Plus, by doing so, you also prevent other type of exploits like using close confine. I added an ID next to the NPC name (World Boss Treasure#ID), which is used to prevent another exploit: If two players talk to the treasure at the same time, they'll both be able to get the items from the treasure box, whether or not you disabled the NPC. NPC variables (those starting with a .) are shared among all the duplicated NPCs. That's why I use an unique ID to track whether the box was already looted or not. - script World Boss Treasure#wb 1324,{ getmapxy(.@map$, .@npc_x, .@npc_y, 0); getmapxy(.@map$, .@player_x, .@player_y, 1); .@distance = distance(.@npc_x, .@npc_y, .@player_x, .@player_y); if (.@distance > 1) { unitwalkto getcharid(3), getnpcid(0), strnpcinfo(0) + "::OnOpenChest"; end; } goto OnOpenChest; end; OnOpenChest: getmapxy(.@map$, .@npc_x, .@npc_y, 0); getmapxy(.@map$, .@player_x, .@player_y, 1); .@distance = distance(.@npc_x, .@npc_y, .@player_x, .@player_y); if (.@distance > 1) { end; } progressbar "ffff00", 10; .@id = atoi(strnpcinfo(2)); // I presume you don't want multiple people to loot the same chest...? if (.npc_disabled[.@id]) { //dispbottom "This chest has been looted by someone else!"; end; } specialeffect EF_COIN; .wb_treasure[.wb_treasure_size++] = getcharid(3); setarray .@catch, 30203, 30202, 607, 504; // List of Junk/Other getitem .@catch[rand(getarraysize(.@catch))], 1; disablenpc strnpcinfo(0); .npc_disabled[.@id] = true; initnpctimer; end; OnReward: .@id = atoi(strnpcinfo(2)); .npc_disabled[.@id] = false; deletearray .wb_treasure; enablenpc strnpcinfo(0); initnpctimer; end; OnTimer7200000: disablenpc strnpcinfo(0); stopnpctimer; end; } prontera,150,180,3 duplicate(World Boss Treasure#wb) World Boss Treasure#1 1324 prontera,152,180,3 duplicate(World Boss Treasure#wb) World Boss Treasure#2 1324
  6. The simplest way to do that is via a status effect. You give the status when the player uses @pk, and when the status runs out, it removes the pk mode. int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) { nullpo_retr(-1, sd); if (!sd->state.pk_mode) { sd->state.pk_mode = 1; sc_start(&sd->bl, &sd->bl, SC_PK_DISABLE, 100, 0, 60 * 60 * 10000); clif_displaymessage(sd->fd, "You are now no longer in PK mode."); } else { sd->state.pk_mode = 0; status_change_end(&sd->bl, SC_PK_DISABLE); clif_displaymessage(sd->fd, "Returned to normal state."); } return 0; } And define the SC_PK_DISABLE status: diff --git a/db/re/status.yml b/db/re/status.yml index 96693fdce..40693394c 100644 --- a/db/re/status.yml +++ b/db/re/status.yml @@ -8166,3 +8166,9 @@ Body: NoClearbuff: true End: Sub_Weaponproperty: true + - Status: Pk_Disable + #Icon: EFST_PK_DISABLE + Flags: + NoDispell: true + NoBanishingBuster: true + NoClearance: true diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 25ce19a67..ddbd1c466 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -1844,6 +1844,7 @@ export_constant(SC_M_LIFEPOTION); export_constant(SC_S_MANAPOTION); export_constant(SC_SUB_WEAPONPROPERTY); + export_constant(SC_PK_DISABLE); #ifdef RENEWAL export_constant(SC_EXTREMITYFIST2); diff --git a/src/map/status.cpp b/src/map/status.cpp index 42005bdae..4b6f462fb 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -13351,6 +13351,11 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) pc_delabyssball( *sd, sd->abyssball ); } break; + case SC_PK_DISABLE: + if (sd) { + sd->state.pk_mode = 0; + } + break; } // Reset the options as needed diff --git a/src/map/status.hpp b/src/map/status.hpp index f103cd018..f2b79e058 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -1230,7 +1230,7 @@ enum sc_type : int16 { SC_S_MANAPOTION, SC_SUB_WEAPONPROPERTY, - + SC_PK_DISABLE, #ifdef RENEWAL SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled #endif (Also... shouldn't this message "You are now no longer in PK mode." be "You are now in PK mode." instead?)
  7. Change the query to do just that, and reverse the output displayed to the player. .@count = query_sql("SELECT `time`,`name`,`nameid`,`amount` FROM `guild_storage_log` WHERE `guild_id` = '" + getcharid(2) + "' ORDER BY `id` DESC LIMIT 30", .@time$ ,.@name$,.@item_id,.@amount); if(!.@item_id){ mes "there is no log yet"; close; } dispbottom "=========================================================",0xFFD64F; dispbottom "===================== Guild Storage Log =======================",0xFFD64F; dispbottom "=========================================================",0xFFD64F; for(.@i=.@count-1;.@i>=0;.@i--) dispbottom .@time$[.@i] + " Player[" + .@name$[.@i] + "] Item Name[" + getitemname(.@item_id[.@i]) + "] Item Amount[" + .@amount[.@i] + "]",((.@amount[.@i] > 0)?0x03c6fc:0xFF0000); dispbottom "=========================================================",0xFFD64F; Though...! At this point, why not simply use the script command guildopenstorage_log ? It sounds like it does exactly what you want to do with an UI in-game as well. You'd have to change the constant MAX_GUILD_STORAGE_LOG_PACKET to const int16 MAX_GUILD_STORAGE_LOG_PACKET = 30;
  8. It seems like the client is able to connect to the login-server, but is not able to connect to the char-server. Assuming you have no errors showing up in any of your console, have you... tested if the port 5800 is open on VM#2, on 10.1.1.2? That would be my guess. https://www.yougetsignal.com/tools/open-ports/
  9. Ah, I misunderstood your issue, my bad. The resurrection skill is blocked if your PVP points are below zero, which happens everytime you die too often in PVP. Change the condition in skill.cpp for the "case ALL_RESURRECTION:" diff --git a/src/map/skill.cpp b/src/map/skill.cpp index b48373392..f19c80142 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -7170,7 +7170,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui break; } - if (map_getmapflag(bl->m, MF_PVP) && dstsd && dstsd->pvp_point < 0) + if (map_getmapflag(bl->m, MF_PVP) && dstsd && dstsd->pvp_point < 0 && !map_getmapflag(bl->m, MF_MAPMVP)) break; switch(skill_lv){
  10. Hmm, can you show the flags of the map with "@mapflag"? There aren't many possible issues left beyond the ones posted above, so you'll probably need to set a breakpoint to see what is going on directly.
  11. Did you correctly apply the diff file? - if( sd->pvp_point < 0 ) { + if( sd->pvp_point < 0 && !mapdata->flag[MF_MAPMVP] ) { sd->respawn_tid = add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0); return 1|8; } This is the part that respawns a character when they die on a PVP map. So a few possible options here: Your map doesn't have the mapmvp flag (MF_MAPMVP). You do need to add those manually. You can see if the map has the mapflag with @mapflag while in-game. The code "!mapdata->flag[MF_MAPMVP]" wasn't added to the pc_dead function from the diff file. You didn't recompile your server.
  12. Heya, The original script can be opened with Scripts > Open scripts folder > script5_remove_unused_sprites.cs. In your case, you'd want something like this: foreach (var actPath in Directory.GetFiles(@"C:\Test\", "*.act")) { var sprPath = actPath.ReplaceExtension(".spr"); if (!File.Exists(sprPath)) continue; var actFile = new Act(actPath, sprPath); for (int i = actFile.Sprite.Images.Count - 1; i >= 0; i--) { if (actFile.FindUsageOf(i).Count == 0) { actFile.Sprite.Remove(i, actFile, EditOption.AdjustIndexes); } } actFile.SaveWithSprite(actPath, sprPath); }
  13. Heya, Well, the first step would be converting your SQL database to CSV/text format. You can do that by querying the following: // for db/re/item_db.txt select `id`, `name_english`, `name_japanese`, `type`, `price_buy`, `price_sell`, `weight`, `atk:matk`, `defence`, `range`, `slots`, `equip_jobs`, `equip_upper`, `equip_genders`, `equip_locations`, `weapon_level`, `equip_level`, `refineable`, `view`, CONCAT('{', IFNULL(`script`, ''), '}'), CONCAT('{', IFNULL(`equip_script`, ''), '}'), CONCAT('{', IFNULL(`unequip_script`, ''), '}') from `item_db_re` I'm using HeidiSQL, but from there... right-click a row > Export grid rows > - Output format: Delimited text - Row selection: Complete - Options: - Uncheck "Include column names" - Field separator: "," - NULL value: "" (leave empty) Then you should have a normal item_db.txt output. Paste the output to your item_db.txt file in the db folder, do the same for the import folder using the other SQL table. From there, you can run the csv2yaml tool (just make sure there is no item_db.yml files, otherwise it won't actually attempt to do the conversion).
  14. Finally got around to do some upgrades: Fixed a bunch of missing shortcuts. Fixed issues with the bias values not being saved. Added bezier curves (Edit > Add/Delete bezier curve). Added detection for bezier curves for str files. This feature also impact the time a file takes to load as there are many calculations required for this. If you're having issues, you can always disable this option via File > Settings > Attempt to recover lost str information. To move a single control point of the bezier curve, hold the Ctrl key down. It will now draw the entire path of the layer instead of only the current interpolation path. You can now navigate through the nodes in the path by clicking on the red-ish dot. You can now change the origin of the layer by moving the cyan dot in the image above. You can reset the origin from Edit > Center origin. Added a scaling option for ease of use, via Edit > Scale. For scaling down by 80%, use 0.2; likewise, for scaling up by 250%, use 2.5. Fixed a bug with the zoom selection when using the mouse wheel and not being able to select a predefined value. Added a visibility option to the layers. There are more options when right-clicking the layer. Added a gif saving option from File > Save as Gif. The feature is far from perfect, but it can help some. Added specific paste options. After copying a keyframe with Ctrl-C, you'll be able to paste which property you are looking for: As with any shortcut, these can be changed from File > Settings > Shortcuts. The texture paste currently only copies the index, not the actual texture. Will fix some other day... Fixed a bug where closing a popup window wouldn't focus the main window afterwards. Fixed a bug when saving a file with texture animations mixed with bias/bezier. Not entirely sure what you mean there. If the issue isn't fixed in this version, please explain it again.
  15. Well, you're mixing up || and &&. You must have all items, so you need: if (countitem(7830) > 0 && countitem(7831) > 0 && countitem(6151) > 0 && countitem(969) > 999 && countitem(60003) > 199) { (Also the "next;" below that line shouldn't be there.)
  16. Never knew this one existed, thank you Emistry! This is much simpler.
  17. Heya, You should use a function instead for items calling script code. So your script would become: function script F_AtBonus { mes "Kitsune Fox Blessings"; mes "..."; next; switch(select("...")) { } end; } - script atcmd_bonus -1,{ end; OnInit: bindatcmd "bonus", strnpcinfo(0) + "::OnCommand"; end; OnCommand: callfunc("F_AtBonus"); end; } And your item script would be: { specialeffect2 549; soundeffectall "moonlight_move.wav",0; callfunc("F_AtBonus"); } Alternatively, you can use doevent directly. So your code would be: { specialeffect2 549; soundeffectall "moonlight_move.wav",0; doevent "bonus_atcmd::OnCommand";} Though... doevent is a tricky script command and usually isn't something I'd recommend using if you can avoid it. But, it will work in your case.
  18. Long story short, you need to restart your server. As for why... that is due to how SQL data is used on the map-server. When the map-server starts, it reads all the variables in the mapreg table and loads them into memory. This way, when you want to access the variable in-game (when you use @set $variable), the value is easily accessible without having to look it up with your SQL server. This is done for various other features, like your character inventory, quests, achievements, player stats, etc. In either case, when you edit or delete the entry in SQL while it is still being loaded in memory, it will not have any impact in-game because that is not where the data is being read from. Doing so can actually cause issues as well if you're not careful. So you need to close your server, truncate the table, and then restart your server.
  19. Hmm, it's hard to phrase it differently. Your events, OnPCDieEvent and OnPCKillEvent, are on a NPC (Deathmatch PvP Warper) which is duplicated. As a result of duplicating your NPCs, the events trigger for each one of those NPCs as well. You've probably figured this out already if you've looked at the error messages. Your duplicated NPCs in your case are: moscovia,213,182,6 duplicate(Deathmatch PvP Warper) DM PvP Warper#mos 823 morocc,170,87,3 duplicate(Deathmatch PvP Warper) DM PvP Warper#moc 823 comodo,180,150,6 duplicate(Deathmatch PvP Warper) DM PvP Warper#com 823 mid_camp,216,280,3 duplicate(Deathmatch PvP Warper) DM PvP Warper#mid 823 prontera,43,210,3 duplicate(Deathmatch PvP Warper) DM PvP Warper#prt2 823 lighthalzen,166,93,3 duplicate(Deathmatch PvP Warper) DM PvP Warper#lhz 823 prontera,263,209,6 duplicate(Deathmatch PvP Warper) DM PvP Warper#prt02 823 rachel,121,112,6 duplicate(Deathmatch PvP Warper) DM PvP Warper#rac3 823 dicastes01,188,188,6 duplicate(Deathmatch PvP Warper) DM PvP Warper#dic 823 mora,44,147,6 duplicate(Deathmatch PvP Warper) DM PvP Warper#mora 823 malangdo,146,119,3 duplicate(Deathmatch PvP Warper) DM PvP Warper#mal 823 ayothaya,157,111,3 duplicate(Deathmatch PvP Warper) DM PvP Warper#ayo 823 So when someone dies, the first event is queued: Deathmatch PvP Warper::OnPCDieEvent But since the NPC is duplicated, these events are also queued and will trigger: DM PvP Warper#mos::OnPCDieEvent DM PvP Warper#moc::OnPCDieEvent DM PvP Warper#com::OnPCDieEvent etc... Now obviously that's not what you wanted and that's causing you issues. You can easily fix the problem by moving the events to another NPC that is not duplicated. So simply create a new NPC, add your events to this one instead, and that's it. So something like this: - script do_not_duplicate -1,{ end; OnPCDieEvent: // ... end; OnPCKillEvent: // ... end; } (And remove the event labels from Deathmatch PvP Warper as well, of course.)
  20. Yes, you... repeated what I said. Therefore, move the events to a NPC that is not duplicated.
  21. Heya, You should only have a single copy of OnPCKillEvent and OnPCDieEvent in all your scripts, in a single NPC that is not duplicated. Right now, you placed the event on your warper NPC, which is duplicated numerous times and that is your problem. The event is being triggered as many times as you have copies of said NPC.
  22. The error you received, "Server received crash signal! Attempting to save all online characters!", is a generic error that means absolutely nothing besides "your server crashed". You will always get this same error. You most likely have two unrelated crashes there. As cook1e said above, you want to run your server with gdb (there is a link provided in his post that explains how to use it). Gdb is a debugging tool that will give you a stack trace. You will get the crash reason, followed by the line in your source code that crashed the server, followed by the functions that called your code step by step. To print the stack trace, you will want to use "bt full" after the crash. You should also always run your server with gdb as you can't predict when a crash will happen. Once you have the stack trace, you can share it here and people can tell you how to fix your code. Or they'll ask you to provide the code surrouding the crash. Or, if the error is obvious, you might be able to fix it yourself. But either way, we can't help you without a gdb stack trace. Goodluck!
  23. Well, JT_MD_Airboat_Poring JT_MD_AIRBOAT_PORING are not the same. If anything, you can also just set it directly: [jobtbl.JT_MD_AIRBOAT_PORING] = 1.2, or [20887] = 1.2,
  24. Heya, Don't use SDE to connect to your server via SFTP. I'll be removing the feature as it's bad practice to do that in the first place. Use a git service like github or gitlab and then use SDE locally if you want.
×
×
  • Create New...