Register for your free account! | Forgot your password?

You last visited: Today at 09:25

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Item Name Insert

Discussion on Item Name Insert within the Rappelz Private Server forum part of the Rappelz category.

Reply
 
Old   #1
 
Sandro1029's Avatar
 
elite*gold: 0
Join Date: Dec 2016
Posts: 182
Received Thanks: 82
Post Item Name Insert

Hello there. I want to ask some ppl here which has more knowledge than me and as well share my idea&knowledge to another ppls. So. Some days ago I've got an idea. You know that there are some GMs which can't even install SQL, nor get the correct item by the name from database. So I thought like "Why not?"

The main idea is: Create a lua function which gonna insert you an item equals to your request. For example. I wanna get Abhuva boss card. I will just type in chat next text:

/run correct_item("abh")
OR

/run correct_item("Dragon") to get White Dragon card.

So, how it works:
First of all, there is about running SQL queries from LUA.

We gonna use this as a base.
Mine smps got updated with next stuff:
Code:
IF @IN_KEY LIKE '%_correct_item'
BEGIN
	EXEC dbo.[smp_correct_item] @IN_VALUE
END
So after inserting new global variable ending on _correct_item, it gonna execute my own procedure named smp_correct_item

Obiviously, you should create a new procedure (No matter where, but I made it in Telecaster). Here it is:

Code:
ALTER PROCEDURE [dbo].[smp_correct_item]

   @ QUERY_TEXT NVARCHAR(1024)

AS
SET NOCOUNT ON

DECLARE  @ QUERY_TEXT NVARCHAR(1024)
SET   @ QUERY_TEXT = ( SELECT TOP 1 [id] FROM Arcadia.dbo.view_item WHERE [EN Name] LIKE CONCAT('%'   @ EXECUTE_TEXT,'%' ) )



IF   @ QUERY_TEXT IS NULL OR @ QUERY_TEXT = 0
BEGIN
UPDATE Telecaster.dbo.Character SET [flag_list] = CONCAT( ( SELECT [flag_list] FROM Telecaster.dbo.Character ),'\r\ncorrect_item:'   @ QUERY_TEXT,'\r\n') WHERE [name] = ( SELECT [value] FROM Telecaster.dbo.GlobalVariable WHERE [name] = 'item_correct_char' )
END
IF @ QUERY_TEXT IS NOT NULL 
BEGIN
UPDATE Telecaster.dbo.Character SET [flag_list] = CONCAT( ( SELECT [flag_list] FROM Telecaster.dbo.Character ),'\r\ncorrect_item:'  @ QUERY_TEXT,'\r\n') WHERE [name] = ( SELECT [value] FROM Telecaster.dbo.GlobalVariable WHERE [name] = 'item_correct_char' )
END

I think you already read my mind. You should create next view in Arcadia to get the id/name list for the procedures. Like this one:

Code:
SELECT id,
enname.value as "EN Name"
FROM dbo.ItemResource itemres LEFT JOIN dbo.StringResource_EN enname ON itemres.id = enname.code
ORDER BY [id] ASC
OFFSET 0 ROWS;
So, in the end, here is the lua script file:

Code:
function correct_item(name)
	del_flag("correct_item")
	save()
	local query = tostring(name)
	set_global_variable("test_item_correct_item",query)
	set_global_variable("item_correct_char",gv("name"))
	sleep()
	correct_insert_item()
	save()
end

function sleep()
  local ntime = ( get_os_time() + 0.0001 )
  
  while get_os_time() < ntime do
  end
  
end

function correct_insert_item()
save()
local flag_items = get_flag("correct_item")
	
	if flag_items == "EmptyQuery" then
		private_notice("The ID is empty")
	else
		insert_item(flag_items,1)
		private_notice("You got "..tostring(get_item_name(get_item_handle(flag_items))).." ")
	end
end
Everything should work perfect. But there are some problems:
1) I have no idea how to force the game read/write/remove flags correct way. It always requires logout, which completely isn't good.
2) I have no idea how to add new lines transfer in the table. I'll be very grateful to the guy which can show me how2do that. I'm getting flaglist like:

Code:
 correct_item:101302
\r\ncorrect_item:112501\r\ncorrect_item:250021\r\n
Instead of proper one, lol

I hope it gonna be useful for someone. As well I hope someone can help me to improve that.
Sandro1029 is offline  
Old 01/15/2022, 15:04   #2
 
Sandro1029's Avatar
 
elite*gold: 0
Join Date: Dec 2016
Posts: 182
Received Thanks: 82
Edited a bit. For some reasons it mentions a guy which has QueRy nickname while I'm trying to write @ QUERY without spacebar between @ and Q
Sandro1029 is offline  
Reply


Similar Threads Similar Threads
insert item list from sql to item.sdata
04/23/2014 - Shaiya Private Server - 2 Replies
i know all should know this right? i actually forgot how to do it. let's say i wanted to make a new set. copy past in shtool isnt much fun as it takes ages but sql have a good copy past thing:-) would make it so much easyer but i totaly forgot how to make that scv or what ever it's called that i can "make" me a new item.sdata. can someone please share how again? i'm sure it's in here but item .sdata and sql is so common names here it's close to impossible to search for it.
INSERT INTO Item Query?
01/07/2012 - Flyff Private Server - 4 Replies
Gibts ne query um items direkt per query ins inventory / als mail zu senden? Insanityflyff hat dieses ja zB,wenn man ein item auf der homepage auswählt,wirds sofort ins inventory gepackt.. kennt wer den oder einen ähnlichen query :/?
Insert item query
07/31/2011 - Rappelz - 7 Replies
HI all, My commands game001 didnt working, what is the way to inser this : USE GO DECLARE @return_value int EXEC @return_value = .
Any Way to Insert Item And Dont Relogg or Logout?
07/10/2011 - Rappelz - 3 Replies
Hey , is there anyway to insert Items (not #insert_item that wont work for me) with no relog ?. when i use queue than i must relog that the items are in the inventory. is there any other way to do this? thanks for answers :)



All times are GMT +1. The time now is 09:26.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.