Relocate NPC's
#5
SET @npc_id = 144; -- Id of the npc you want to update
SET @char_id = 1; -- Id of the char which logged out

UPDATE lc_data.t_npc_regen
SET 
    a_pos_h = (SELECT a_was_x FROM lc_db.t_characters WHERE a_index = @char_id),
    a_pos_r = (SELECT a_was_z FROM lc_db.t_characters WHERE a_index = @char_id),
    a_pos_x = (SELECT a_was_r FROM lc_db.t_characters WHERE a_index = @char_id),
    a_pos_z = (SELECT a_was_h FROM lc_db.t_characters WHERE a_index = @char_id)
        
        
WHERE t_npc_regen.a_npc_idx = @npc_id 
  AND t_npc_regen.a_zone_num = 6 -- 6 is just for example purpose 

You can archive the same result directly via query! (of course adapt to t_shop in case) 

    



Messages In This Thread
[No subject] - by RGT - 02-26-2023, 09:57 PM
[No subject] - by Judgement - 11-16-2023, 06:50 PM
[No subject] - by Judgement - 11-17-2023, 08:10 PM
[No subject] - by RGT - 11-18-2023, 10:01 PM
[No subject] - by Scura - 11-29-2023, 11:19 AM
[No subject] - by Judgement - 11-29-2023, 11:27 AM
[No subject] - by Scura - 01-12-2024, 12:34 PM
[No subject] - by Judgement - 01-12-2024, 01:43 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)