[SQL] Stored Procedure for TitleUpdating Automatic

04/25/2013 18:02 royalblade#1
heya guys,

this was made a looooooong time ago when we wanted to make title giving automatic on devias. however, it was never used cuz of lazyness.
Just found it again and thought iŽd release it. This is to be executed each time a new uniquelog is added.

It works like this
gets the first charname that killed the MOB "Devias".
If you kill devias for the first time u get the title Devias Slayer #1
for the second time Devias Slayer #2
etc.
Meaning u will have to create multiple titles. however, the system itself is rpetty cool :)

have fun.
For support add me on skype:akasch93
PHP Code:
USE [SRO_VT_ROYAL]
GO
/****** Object:  StoredProcedure [dbo].[_RoyalAutoTitleUpdater]    Script Date: 04/25/2013 17:58:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure 
[dbo].[_RoyalAutoTitleUpdater]
as
declare @
newhwan int
declare @Charname varchar (30)

Update _Char Set HwanLevel '0' where HwanLevel '10'

Set @Charname = ( Select top 1 Charname from SRO_VT_ACCOUNT.dbo.Evangelion_uniques
order by SRO_VT_ACCOUNT
.dbo.Evangelion_uniques.time desc)

set @newhwan = ((select COUNT(Mobnamefrom SRO_VT_ACCOUNT.dbo.Evangelion_uniques
where charname 
= @Charname and Mobname 'MOB_GOD_FLAME_COWKING_B4')+100) -- +100 based on xxx normal title being hwanlvl 10

Update SRO_VT_SHARD
.dbo._Char set SRO_VT_SHARD.dbo._Char.HwanLevel 
@
newhwan where CharName16 
@
Charname AND (select top 1 Mobname from SRO_VT_ACCOUNT.dbo.Evangelion_uniques) = 'MOB_GOD_FLAME_COWKING_B4' 
04/25/2013 23:44 PortalDark#2
#approved
04/26/2013 17:38 pushipu#3
Very interesting, thx for share.
05/01/2013 15:40 spider560#4
thanx
05/02/2013 15:50 ILowe#5
Msg 208, Level 16, State 6, Procedure _RoyalAutoTitleUpdater, Line 14
Invalid object name 'dbo._RoyalAutoTitleUpdater'.
05/02/2013 16:17 FL0wshY#6
Quote:
Originally Posted by ILowe View Post
Msg 208, Level 16, State 6, Procedure _RoyalAutoTitleUpdater, Line 14
Invalid object name 'dbo._RoyalAutoTitleUpdater'.
Try this.

Code:
USE [SRO_VT_ROYAL] 
GO 
/****** Object:  StoredProcedure [dbo].[_RoyalAutoTitleUpdater]    Script Date: 04/25/2013 17:58:40 ******/ 
SET ANSI_NULLS ON 
GO 
SET QUOTED_IDENTIFIER ON 
GO 
CREATE PROCEDURE [dbo].[_RoyalAutoTitleUpdater] 
as 
declare @newhwan int 
declare @Charname varchar (30) 

Update _Char Set HwanLevel = '0' where HwanLevel = '10' 

Set @Charname = ( Select top 1 Charname from SRO_VT_ACCOUNT.dbo.Evangelion_uniques 
order by SRO_VT_ACCOUNT.dbo.Evangelion_uniques.time desc) 

set @newhwan = ((select COUNT(Mobname) from SRO_VT_ACCOUNT.dbo.Evangelion_uniques 
where charname = @Charname and Mobname = 'MOB_GOD_FLAME_COWKING_B4')+100) -- +100 based on xxx normal title being hwanlvl 10 

Update SRO_VT_SHARD.dbo._Char set SRO_VT_SHARD.dbo._Char.HwanLevel =  
@newhwan where CharName16 =  
@Charname AND (select top 1 Mobname from SRO_VT_ACCOUNT.dbo.Evangelion_uniques) = 'MOB_GOD_FLAME_COWKING_B4'
05/02/2013 17:08 A new hope#7
Quote:
Originally Posted by ILowe View Post
Msg 208, Level 16, State 6, Procedure _RoyalAutoTitleUpdater, Line 14
Invalid object name 'dbo._RoyalAutoTitleUpdater'.
you need to create, not alter.
05/02/2013 21:53 egystorm#8
ThX
05/03/2013 01:01 PlayPVP#9
I feel something wrong with this procedure,

"Update _Char Set HwanLevel = '0' where HwanLevel = '10' "

WTF is that? Can someone understand good about sql tell us if this procedure is right or no?
05/03/2013 02:15 ◄:●:►SanToS◄:●:►#10
Quote:
Originally Posted by royalblade View Post
heya guys,

this was made a looooooong time ago when we wanted to make title giving automatic on devias. however, it was never used cuz of lazyness.
Just found it again and thought iŽd release it. This is to be executed each time a new uniquelog is added.

It works like this
gets the first charname that killed the MOB "Devias".
If you kill devias for the first time u get the title Devias Slayer #1
for the second time Devias Slayer #2
etc.
Meaning u will have to create multiple titles. however, the system itself is rpetty cool :)

have fun.
For support add me on skype:akasch93
PHP Code:
USE [SRO_VT_ROYAL]
GO
/****** Object:  StoredProcedure [dbo].[_RoyalAutoTitleUpdater]    Script Date: 04/25/2013 17:58:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure 
[dbo].[_RoyalAutoTitleUpdater]
as
declare @
newhwan int
declare @Charname varchar (30)

Update _Char Set HwanLevel '0' where HwanLevel '10'

Set @Charname = ( Select top 1 Charname from SRO_VT_ACCOUNT.dbo.Evangelion_uniques
order by SRO_VT_ACCOUNT
.[COLOR="SandyBrown"]dbo.Evangelion_uniques.time[/COLORdesc)

set @newhwan = ((select COUNT(Mobnamefrom SRO_VT_ACCOUNT.dbo.Evangelion_uniques
where charname 
= @Charname and Mobname 'MOB_GOD_FLAME_COWKING_B4')+100) -- +100 based on xxx normal title being hwanlvl 10

Update SRO_VT_SHARD
.dbo._Char set SRO_VT_SHARD.dbo._Char.HwanLevel 
@
newhwan where CharName16 
@
Charname AND (select top 1 Mobname from SRO_VT_ACCOUNT[COLOR="Red"].dbo.Evangelion_uniques[/COLOR]) = 'MOB_GOD_FLAME_COWKING_B4' 
.dbo.Evangelion_uniques
is that missing table name ?
05/03/2013 09:24 Ninja_Stylez#11
Code:
USE [SRO_VT_ACCOUNT] 
GO 

/****** Object:  Table [dbo].[Evangelion_uniques]    Script Date: 09/13/2012 23:17:30 ******/ 
SET ANSI_NULLS ON 
GO 

SET QUOTED_IDENTIFIER ON 
GO 

SET ANSI_PADDING ON 
GO 

CREATE TABLE [dbo].[Evangelion_uniques]( 
    [ID] [int] IDENTITY(1,1) NOT NULL, 
    [CharName] [varchar](20) NOT NULL, 
    [MobName] [varchar](50) NOT NULL, 
    [time] [varchar](100) NOT NULL, 
 CONSTRAINT [PK_Evangelion_uniques] PRIMARY KEY CLUSTERED  
( 
    [ID] ASC 
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] 
) ON [PRIMARY] 

GO 

SET ANSI_PADDING OFF 
GO
Trololo... but you need evangelion gameserver in order to make this tabela nd bla bla to work :)
05/08/2013 00:36 Hurricane*#12
Hey, You can edit this query for me ? I need make this query when a player kill like more than 50 unique get a title for example : Unique Hunter
example:
when you kill 50 Unique get Unique Hunter
when you kill 100 unique get Unique King
when you kill 150 unique get Unique Boss
but i need make it for all uniques not only one unique !