Jump to content

Tokei

Members
  • Posts

    665
  • Joined

  • Last visited

  • Days Won

    91

Everything posted by Tokei

  1. 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?)
  2. 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;
  3. 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/
  4. 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){
  5. 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.
  6. 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.
  7. 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); }
  8. 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).
  9. 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.
  10. 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.)
  11. Never knew this one existed, thank you Emistry! This is much simpler.
  12. 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.
  13. 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.
  14. 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.)
  15. Yes, you... repeated what I said. Therefore, move the events to a NPC that is not duplicated.
  16. 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.
  17. 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!
  18. 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,
  19. 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.
  20. No on all questions. Full disclosure, I forgot this feature even existed and I'm really tempted to simply nuke it. I'd say it's not a good practice to generate patches using this tool.
  21. Heya, If you are following the recommended setup, then the only required files are main.sql and logs.sql. The item_cash SQL file is the alternative to db/(pre-)re/item_cash_db.txt. Seeing are you're using the text/yaml version of the databases, you don't need it. As for roulette_default_data.sql, that's optional. If you plan on setting your own values in it, then you don't need the default values from the file. If you want pre-made values for it, then yes, use the file. The roulette system has not been converted to a text/yaml version for some reason. That seems like a forgotten feature. The other SQL files are not meant for performance. You will most likely be using them for your website though, since it will want to know your item/mob data from somewhere.
  22. Heya, That's intended, surprisingly. When you are editing the hat sprite, you are viewing the world from the perspective of the hat. So if you set all the XY offsets the same, from... the perspective of the hat, nothing seems to be moving. That makes sense. But that doesn't work in-game because the body sprite has anchors points, which decides where the hat will be drawn. This position moves depending of the body's orientation. To "recreate" this, you'd have to use Anchors > Use body as base (this essentially attaches the current sprite to the body instead). In other words, this will set the perspective from the body. Though, in the end, that's not really that helpful to you because you'd have to set the offsets one by one. Plus, that's not possible to fully match those offsets, it will never work. Instead, do the following: Align all the hat's anchors points with the base body. Set all the offsets to a fixed value. This is not really possible by hand, so the following should do the trick (it uses the default body as reference, but it should be good enough): // Change to ref_body_f.act for the female anchor points var body = new Act(ApplicationManager.GetResource("ref_body_m.act")); for (int aid = 0; aid < act.Actions.Count; aid++) { var action = act[aid]; for (int fid = 0; fid < action.Frames.Count; fid++) { var frame = action[fid]; var frameReference = body.TryGetFrame(aid, fid); if (frameReference != null) { frame.Anchors[0].OffsetX = frameReference.Anchors[0].OffsetX; frame.Anchors[0].OffsetY = frameReference.Anchors[0].OffsetY; } } } // Uncomment below if you want to set the same offsets for all your layers //foreach(var action in act.Actions) { // foreach(var frame in action.Frames) { // foreach(var layer in frame.Layers) { // layer.OffsetY = -38; // layer.OffsetX = 0; // } // } //} This will achieve what you're looking for. And yes, anchors points are quite confusing. Without using a script, this could also be done via Anchors > Set anchors > Set from file... > Select a base body sprite for reference.
  23. Heya, The last line is correct and should work as you want. Did you perhaps keep both lines? If so, when the mob goes through its skills it will execute them in order and since the first line has a 100% chance, it will always spawn the 1149 mobs. You have to comment it out or remove it. Otherwise, it could be a matter of not having reloaded your mob skills properly via @reloadmobdb (or a server restart I guess). Besides that, I do not see what could be the problem.
  24. Alright, there's been some updates...! Texture names will be displayed over the keyframes. Re-organized the UI to clear up the right-sided panel. The Play button has been moved on the menu bar itself, with the Space shortcut. Adding a Snap option which is set to 1 pixel by default. Added an experiemental feature to retrieve the bias values from str files (does not recognize bezier nor uvbias). Can load and save with some EZV files (currently only tested with version 0.94 and 0.95). I haven't seen newer versions (not in RO anyway). It currently saves as version 0.94. Added background selection via Edit > Select background. (There are some unused buttons added, will clean up later.) I do plan on supporting bezier curves, but there aren't for now.
  25. It zooms at your cursor position, that is intended.
×
×
  • Create New...