Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Share] Amend Stat Adder/Reset [UPDATED CODE]

Newbie Spellweaver
Joined
May 19, 2007
Messages
92
Reaction score
1
I do it to kill time. Maybe some wants:

Code:
UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADPOW',''),
[ChaInfo].ChaPow=[ChaInfo].ChaPow+REPLACE([ChaInfo].ChaGuName,'ADPOW',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADPOW','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADPOW'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADPOW','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADPOW','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADDEX',''),
[ChaInfo].ChaDex=[ChaInfo].ChaDex+REPLACE([ChaInfo].ChaGuName,'ADDEX',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADDEX','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADDEX'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADDEX','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADDEX','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADINT',''),
[ChaInfo].ChaSpirit=[ChaInfo].ChaSpirit+REPLACE([ChaInfo].ChaGuName,'ADINT',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADINT','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADINT'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADINT','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADINT','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADVIT',''),
[ChaInfo].ChaStrong=[ChaInfo].ChaStrong+REPLACE([ChaInfo].ChaGuName,'ADVIT',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADVIT','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADVIT'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADVIT','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADVIT','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADSTM',''),
[ChaInfo].ChaStrength=[ChaInfo].ChaStrength+REPLACE([ChaInfo].ChaGuName,'ADSTM',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADSTM','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADSTM'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADSTM','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADSTM','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='RESETFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain+([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength),
[ChaInfo].ChaPower=0,
[ChaInfo].ChaDex=0,
[ChaInfo].ChaInt=0,
[ChaInfo].ChaStrong=0,
[ChaInfo].ChaStrength=0,
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength)*1000)
From Inserted
WHERE Inserted.ChaGuName='RESETSTAT'
and [ChaInfo].ChaMoney>=(([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength)*1000)
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

Instructions? Just paste it below your trigger BEFORE THE WORD "END"
Your ChaInfo trigger is located at RanGame1>dbo.ChaInfo>Triggers
To use ::
TO ADD POW:
ADPOW+amount to add to power
example+ ADPOW500
that will add 500 to your power. make sure you have enough stat points
TO ADD OTHER STATS: HERE IS THE COMMAND
ADPOW
ADDEX
ADINT
ADVIT
ADSTM
to reset stat:
RESETSTAT
reconnect to activate

credits?
me for the code
iwarez for structure
tondofear for idea (even if he requests stat adder for control panel he give me this idea)

Reply if effective.
 
Last edited:
Newbie Spellweaver
Joined
Jan 9, 2008
Messages
80
Reaction score
1
Re: [TEST SHARE]Amend Stat Adder

nice share very useful thnx po..^_^
 
Newbie Spellweaver
Joined
Aug 28, 2006
Messages
87
Reaction score
0
Re: [TEST SHARE]Amend Stat Adder

how to solve this....
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
May 19, 2007
Messages
92
Reaction score
1
Re: [TEST SHARE]Amend Stat Adder

how to solve this....

do you have your existing trigger?
If not, include this in the top of the code ::
Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [dbo].[Amend_AdStat] ON [dbo].[ChaInfo]
after update
as
BEGIN

 <put the code above here>

END
 
StoP Callin me MentaL
Loyal Member
Joined
Dec 26, 2008
Messages
3,228
Reaction score
1,017
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

can this use on SQL2000?
cause i put on SQL2000 cause error said ChaPow ChaVit ChaInt error
 
Experienced Elementalist
Joined
Dec 16, 2007
Messages
227
Reaction score
0
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

@TS

not effective for me. no error comes up but no luck.
 
Newbie Spellweaver
Joined
Mar 7, 2009
Messages
21
Reaction score
0
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

I do it to kill time. Maybe some wants:

Code:
UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADPOW',''),
[ChaInfo].ChaPow=[ChaInfo].ChaPow+REPLACE([ChaInfo].ChaGuName,'ADPOW',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADPOW','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADPOW'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADPOW','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADPOW','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADDEX',''),
[ChaInfo].ChaDex=[ChaInfo].ChaDex+REPLACE([ChaInfo].ChaGuName,'ADDEX',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADDEX','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADDEX'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADDEX','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADDEX','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADINT',''),
[ChaInfo].ChaSpirit=[ChaInfo].ChaSpirit+REPLACE([ChaInfo].ChaGuName,'ADINT',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADINT','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADINT'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADINT','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADINT','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADVIT',''),
[ChaInfo].ChaStrong=[ChaInfo].ChaStrong+REPLACE([ChaInfo].ChaGuName,'ADVIT',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADVIT','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADVIT'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADVIT','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADVIT','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADSTM',''),
[ChaInfo].ChaStrength=[ChaInfo].ChaStrength+REPLACE([ChaInfo].ChaGuName,'ADSTM',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADSTM','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADSTM'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADSTM','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADSTM','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='RESETFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain+([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength),
[ChaInfo].ChaPower=0,
[ChaInfo].ChaDex=0,
[ChaInfo].ChaInt=0,
[ChaInfo].ChaStrong=0,
[ChaInfo].ChaStrength=0,
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength)*1000)
From Inserted
WHERE Inserted.ChaGuName='RESETSTAT'
and [ChaInfo].ChaMoney>=(([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength)*1000)
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

Instructions? Just paste it below your trigger BEFORE THE WORD "END"
Your ChaInfo trigger is located at RanGame1>dbo.ChaInfo>Triggers
To use ::


credits?
me for the code
iwarez for structure
tondofear for idea (even if he requests stat adder for control panel he give me this idea)

Reply if effective.

that updated XD
 
Experienced Elementalist
Joined
Dec 16, 2007
Messages
227
Reaction score
0
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

@zomer143

how would you manage to run that?

mine, when i use that nothing happens nothing error.

and this is applicable only for the newly created character?
 
Experienced Elementalist
Joined
Dec 16, 2007
Messages
227
Reaction score
0
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

Update Pls.
 
Newbie Spellweaver
Joined
Sep 4, 2009
Messages
10
Reaction score
1
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

Here`s The New And Updated Add Stats

Just Paste It And Execute This !

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [dbo].[Amend_AddStats] ON [dbo].[ChaInfo]
after update
as
BEGIN

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADPOW',''),
[ChaInfo].ChaPower=[ChaInfo].ChaPower+REPLACE([ChaInfo].ChaGuName,'ADPOW',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADPOW','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADPOW'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADPOW','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADPOW','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADDEX',''),
[ChaInfo].ChaDex=[ChaInfo].ChaDex+REPLACE([ChaInfo].ChaGuName,'ADDEX',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADDEX','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADDEX'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADDEX','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADDEX','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADINT',''),
[ChaInfo].ChaSpirit=[ChaInfo].ChaSpirit+REPLACE([ChaInfo].ChaGuName,'ADINT',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADINT','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADINT'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADINT','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADINT','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADVIT',''),
[ChaInfo].ChaStrong=[ChaInfo].ChaStrong+REPLACE([ChaInfo].ChaGuName,'ADVIT',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADVIT','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADVIT'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADVIT','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADVIT','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='ADDFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain-REPLACE([ChaInfo].ChaGuName,'ADSTM',''),
[ChaInfo].ChaStrength=[ChaInfo].ChaStrength+REPLACE([ChaInfo].ChaGuName,'ADSTM',''),
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(REPLACE([ChaInfo].ChaGuName,'ADSTM','')*1000)
From Inserted
WHERE LEFT(Inserted.ChaGuName,5)='ADSTM'
and [ChaInfo].ChaStRemain>=REPLACE([ChaInfo].ChaGuName,'ADSTM','')
and [ChaInfo].ChaMoney>=REPLACE([ChaInfo].ChaGuName,'ADSTM','')*1000
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum

UPDATE ChaInfo SET [ChaInfo].ChaGuName='RESETFINISH',
[ChaInfo].ChaStRemain=[ChaInfo].ChaStRemain+([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength),
[ChaInfo].ChaPower=0,
[ChaInfo].ChaDex=0,
[ChaInfo].ChaSpirit=0,
[ChaInfo].ChaStrong=0,
[ChaInfo].ChaStrength=0,
[ChaInfo].ChaMoney=[ChaInfo].ChaMoney-(([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength)*1000)
From Inserted
WHERE Inserted.ChaGuName='RESETSTAT'
and [ChaInfo].ChaMoney>=(([ChaInfo].ChaPower+[ChaInfo].ChaDex+[ChaInfo].ChaSpirit+[ChaInfo].ChaStrong+[ChaInfo].ChaStrength)*1000)
and Inserted.ChaName=[ChaInfo].ChaName
and Inserted.UserNum=[ChaInfo].UserNum


END
 
Junior Spellweaver
Joined
Jan 6, 2009
Messages
158
Reaction score
17
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

thnx it really help....
 
Joined
Sep 16, 2007
Messages
1,206
Reaction score
541
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

@earl
yes. and you really must. because if you have 2 triggers in one database, you might experience some rollback issues..

---------- Post added at 10:54 PM ---------- Previous post was at 10:54 PM ----------

@earl
yes. and you really must. because if you have 2 triggers in one database, you might experience some rollback issues..
 
Newbie Spellweaver
Joined
Dec 21, 2008
Messages
51
Reaction score
12
Re: [SHARE]Amend Stat Adder/Reset [UPDATED CODE]

how do i make the command like /addpow+ ?
 
Back
Top