Jump to content

Tokei

Members
  • Posts

    699
  • Joined

  • Last visited

  • Days Won

    106

Posts posted by Tokei

  1. On 10/30/2022 at 2:02 PM, ez2on said:

    If you save it as ezv,A single frame has been changed.

    Hmm, I'm not able to reproduce your issue. Saving as ezv works fine on my end. I have uploaded a newer version (1.0.6) to save ezv as 0.95 instead of 0.94 to support tga images. But that doesn't appear to be related to your issue at all, so you'd have to give me a way to reproduce the problem.

    • Like 1
  2. Updated to 1.8.4.5:

    • Fixed a bunch of issues with the dark theme.
    • Fixed focussing in the tree view.
    • Added Str preview support.
    • Added support for RSW version 0x206.
    • Fixed another packed DLL issue regarding GRF encryption.
    • Extracting resources will now export all files.
    • Added more checks when saving GRFs beyond 4 GB.
    On 10/29/2022 at 9:25 PM, Pokye said:

    Thanks, working now. A doubt, this new version, was also fixed the problem of GRF above 4GB? I've seen some comments here reporting about this.

    I've added a "fix" for this issue, but like I said last time, it isn't an issue. GRF Editor will now prevent you from saving files past 4 GB of size. If your GRFs are reaching that size, you will need to use another GRF alongside for your client. There are no other solutions.

    5 hours ago, KeiKun said:

    Generating cps.dll gives this error.

    --------------          Message          --------------
    Field not found: 'Utilities.Services.EncodingService.ANSI'.
    --------------        Stack trace        --------------
       at GrfToWpfBridge.Application.DefaultErrorHandler._reportAnyManagedExceptions(String message, Exception exception, ErrorLevel errorLevel)
       at GrfToWpfBridge.Application.DefaultErrorHandler.Handle(Exception exception, ErrorLevel errorLevel)
       at GRFEditor.WPF.EncryptorDialog._buttonGenerateClientConf_Click(Object sender, RoutedEventArgs e)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Window.ShowHelper(Object booleanBox)
       at System.Windows.Window.Show()
       at System.Windows.Window.ShowDialog()
       at GRFEditor.EditorMainWindow._menuItemEncryptor_Click(Object sender, RoutedEventArgs e)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at GRFEditor.GRFEditorMain.Main(String[] args)
    
    --------------         Exception         --------------
    System.MissingFieldException: Field not found: 'Utilities.Services.EncodingService.ANSI'.
       at ..(Byte[] , String , Byte[]& , Byte[] , Byte[] , String , )
       at Encryption.Ee322.b3c0cf5bc709dff2229e99124d1968b7(String c5c85cccb9b0fd3067387800c587f028, String outputClientPath, Byte[] f70c5dbd6c0e10ca9e06d246bbb58501c928f6a25037efd3ae810a02f3aa16ec, Byte[] cps, Byte[] client, Byte[]& newClient)
       at GRFEditor.WPF.EncryptorDialog._buttonGenerateClientConf_Click(Object sender, RoutedEventArgs e)

     

    EDIT:
    I went and use GRF Editor v1.8.4.1.zip, which doesn't have the problem.

    Should be fixed now.

    • Love 1
    • MVP 2
  3. 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.
    • Upvote 1
  4. On 10/26/2022 at 8:06 AM, paaaaatch said:

    Can someone help me with this? I can't generate map because of this.

    image.png

    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.

  5. 49 minutes ago, 15peaces said:

    But the RO client doesn't support grfs > 2GB at all (or did I miss something?), so why should the grf editor do? ^^

    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.

    • Like 1
  6. 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
  7. 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?)

    • Love 1
  8. 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;

     

  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. 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.
  11. 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);
    }
    • Love 1
  12. 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).

    • Upvote 1
  13. 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.
      image.png.26a1e804f17f32f5ca4eb03ad059cbd1.png
    • 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.
      image.png.1d81d7bd9935fec625f892c8b8385b2c.png
    • Added a gif saving option from File > Save as Gif. The feature is far from perfect, but it can help some.
      image.png.5aca032e602463675867c207142f5d77.png
    • Added specific paste options. After copying a keyframe with Ctrl-C, you'll be able to paste which property you are looking for:
      image.png.e19fff65f323acc4316c10b3b7a921ac.png
      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.

     

    On 4/8/2022 at 12:31 AM, ez2ac said:

    //------------------------------------------------------------
    This file cannot be loaded normally.
    Files are loaded, but only a portion is loaded.

    loaded and saving files will compromise capacity.

    And if i apply it in a game, it makes the behavior weird.

    test1: (original)
    https://www.mediafire.com/file/rfkt5yxlc0lh6q7

    test2: (original)

    https://www.mediafire.com/file/iugt3ywub77tpw7

    Not entirely sure what you mean there. If the issue isn't fixed in this version, please explain it again.

    • Upvote 1
    • Love 1
  14. On 6/17/2022 at 2:01 PM, Emistry said:
    *useatcmd "<command>";
    
    This command will execute a script-bound atcommand for the attached RID. If the
    supplied command is not bound to any script, this command will act like 'atcommand'
    and attempt to execute a source-defined command.
    
    The three .@atcmd_***** variables will NOT be set when invoking script-bound atcommands
    in this way.

     

    Never knew this one existed, thank you Emistry! This is much simpler.

  15. 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.

  16. 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.

    • Upvote 1
    • Love 1
  17. 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.)

    • Upvote 1
  18. 11 hours ago, DEsMOn said:

    DM PVP Warper is 1 script only.

    players are using Duplicate NPC from different town to join in PVP.

    Yes, you... repeated what I said. Therefore, move the events to a NPC that is not duplicated.

  19. 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.

  20. 7 hours ago, DEsMOn said:

    Okay,

    But i noticed twice. when i did @reloadmobdb server crashes with same error in  cmd.

    But the problem is this happened before also when i didn't event use @reloadmobdb. So confused why its happening...

    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!

    • Upvote 1
×
×
  • Create New...