Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Development
You last visited: Today at 03:35

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

Advertisement



[RELEASE] Guild Leader change - SQL version

Discussion on [RELEASE] Guild Leader change - SQL version within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old 01/18/2011, 14:48   #16
 
elite*gold: 0
Join Date: Aug 2010
Posts: 241
Received Thanks: 255
If you want to reset a lot of items better just to restart the server. Yes these commands only work for 1 mob/item. I haven't been able to find commands for Guilds etc.
zargon05 is offline  
Old 01/19/2011, 16:15   #17
 
Danco1990's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 348
Received Thanks: 260
All commands lie in the programs, use HxD to discover the hidden values that might be able to help you. Good luck.
Danco1990 is offline  
Old 02/02/2011, 19:53   #18
 
TumbsUp's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 526
Received Thanks: 175
where can i change

How much peoples i need for guild create?
TumbsUp is offline  
Old 08/21/2011, 22:14   #19
 
Svinseladden's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 675
Received Thanks: 240
Quote:
Originally Posted by ProfNerwosol View Post
Here's a Guild Leader change script wrote in SQL. It is a stored procedure so you can call it from php or whatever you are using.

There are many comments so you shouldn't be lost when reading through it. I haven't tested it. What I did was rewrite old procedure I had lying around. If you get any errors, post them here.

Code:
USE PS_GAMEDATA
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Tomasz Wiacek
-- Create date: 10.IV.2010
-- Description:	Change guild leader
/* 
Provide the procedure with character name of new
and old guild leader - @OldGuildLeader is old GL
and @NewGuildLeader is new GL respectively.
The rest will be done by the procedure.
*/
-- =============================================
CREATE PROCEDURE dbo.ausp_ChangeGuildLeader 
	
	@OldGuildLeader varchar(30),
	@NewGuildLeader varchar(30)

AS
BEGIN	
	SET NOCOUNT ON;
	
	DECLARE @GuildID int				-- GuildID where change of leadership will take place	
	DECLARE @MasterCharID int			-- stores new GL CharID
	DECLARE @MasterUserID varchar(30)	-- stores new GL UserID
	DECLARE @OldGLCharID int			-- used to store CharID of current GL
	DECLARE @MasterName varchar(40)		-- stores new GL CharName

	-- select GuildID and old GuildLeader CharID
	SELECT @GuildID = GuildID, @OldGLCharID = MasterCharID
	FROM PS_GameData.dbo.Guilds
	WHERE MasterName = @OldGuildLeader;
	
	-- check if any results were returned
	IF @@ROWCOUNT = 0
	begin
		PRINT 'Guild leader - ' + @OldGuildLeader + ' does not exist.';
	end
	ELSE
	begin
		-- get CharID, UserID and CharName of new GuildLeader
		SELECT @MasterCharID = CharID, @MasterUserID = UserID, @MasterName = CharName
		FROM PS_GameData.dbo.Chars
		WHERE CharName = @NewGuildLeader;
		
		-- if new GuildLeader CharName is correct and it exists (result was returned by above statement)
		-- and new GuildLeader is part of the guild execute leadership change
		IF @@ROWCOUNT <> 0 AND @MasterCharID IN (SELECT CharID FROM PS_GameData.dbo.GuildChars WHERE GuildID=@GuildID AND Del=0 AND (LeaveDate IS NULL OR LeaveDate=0))
		begin
			-- update information about who's the current GuildLeader
			UPDATE PS_GameData.dbo.Guilds 
			SET MasterCharID = @MasterCharID, MasterUserID = @MasterUserID, MasterName = @MasterName
			WHERE GuildID = @GuildID;
			
			-- make new GL leader of the guild
			UPDATE PS_GameData.dbo.GuildChars
			SET GuildLevel = 1 WHERE CharID = @MasterCharID AND GuildID = @GuildID;
			
			-- give old GL GuildLevel=3 to be on the safe side if there are too many Lv2's in guild
			UPDATE PS_GameData.dbo.GuildChars
			SET GuildLevel = 3 WHERE CharID = @OldGLCharID AND GuildID = @GuildID;
			
			PRINT 'Guild leadership between - ' + @OldGuildLeader + ' - and - ' + @NewGuildLeader + ' was changed.'
			
		end
		ELSE
		begin
			PRINT 'No such character: ' + @NewGuildLeader + ' or character is not part of the guild.';
		end
	end



END
To those new to SQL, paste the above code as new query in Server Management Studio and execute it. To run it do this:

Code:
EXEC PS_GameData..ausp_ChangeGuildLeader 'OldGLName','NewGLName'
replacing the words in-between quotes with real character names.

NOTE:
The changes won't take effect until server restart.
heya was trying this insted of doing it manualy. but when i did this. i got:

Msg 8144, Level 16, State 2, Procedure ausp_ChangeGuildLeader, Line 0
Procedure or function ausp_ChangeGuildLeader has too many arguments specified.
and yes i used the new better sql query but the old
Code:
EXEC PS_GameData..ausp_ChangeGuildLeader 'OldGLName','NewGLName'
Svinseladden is offline  
Reply


Similar Threads Similar Threads
Guild leader help me please
05/18/2010 - Dekaron Private Server - 8 Replies
hi all, for create guild. bug create guild no guild leader:rtfm:. who can help me. thanks. for help.
How to change 'Guild Leader'
08/01/2009 - CO2 Private Server - 3 Replies
Alright, i'm making the 'clan' system. I kind of have it made, because i mostly made it from the guild, but it can't find out how to change 'guild leader' to 'clan leader'. i searched 'guild leader' in my source in entire source, there is nothing. any help?
Guild Deputy Leader Glitch
01/20/2009 - Conquer Online 2 - 4 Replies
I've heard of a glitch to have more than 5 deputy leaders for a guild, I'm just unsure of how to do it. Does anyone know how? Will be greatly appreciated if someone knew how.
how to change guild leader after ban ?
05/29/2007 - Silkroad Online - 3 Replies
hey guys i have a question ... im banned on olympus at lvl 72 -.-* but dosnt metter can some1 tell me how i can change the guild leader now ? and how long i have to wait till i can vote for one ?
Guild Leader Question
03/08/2006 - Conquer Online 2 - 12 Replies
hey everyone. ive got a really wierd question. i remember reading/hearing from somewhere that if a GL isnt active for a month or something, a guild member could donate 100k to the guild to become GL? does anyone know the details of this (how long, how much) and where and how to do it? thanks a lot guys! shadowHacker



All times are GMT +1. The time now is 03:38.


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.