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!

[SQL] A Simple AutoReset in Trigger

Initiate Mage
Joined
Sep 20, 2005
Messages
6
Reaction score
0
Use MuOnline
GO
ALTER TABLE [Character] ADD Relife_count tinyint DEFAULT 0 WITH VALUES
GO
CREATE TRIGGER ReLife ON [Character] AFTER UPDATE AS
UPDATE [Character] SET [Character].Relife_count=[Character].Relife_count+1,cLevel=1,Experience=0,MagicList=null,Inventory=null, PkTime=0,PkLevel=3,LevelUpPoint=[Character].Relife_count*100,[Character].Money=[Character].Money-100000000,Strength=18,Dexterity=18,Vitality=15,Energy=30,Life=60,MaxLife=60,Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1
FROM inserted WHERE inserted.Clevel>=350 and inserted.PkLevel<=3 and inserted.Money>=100000000 and (inserted.class=0 or inserted.class=1) and [Character].name = Inserted.name

UPDATE [Character] SET [Character].Relife_count=[Character].Relife_count+1,cLevel=1,Experience=0,MagicList=null,Inventory=null, PkTime=0,PkLevel=3,LevelUpPoint=[Character].Relife_count*100,Money=[Character].Money-100000000,Strength=28,Dexterity=20,Vitality=25,Energy=10,Life=110,MaxLife=110,Mana=20,MaxMana=20,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1
FROM inserted WHERE inserted.Clevel>=350 and inserted.PkLevel<=3 and inserted.Money>=100000000 and (inserted.class=16 or inserted.class=17) and [Character].name = Inserted.name

UPDATE [Character] SET [Character].Relife_count=[Character].Relife_count+1,cLevel=1,Experience=0,MagicList=null,Inventory=null, PkTime=0,PkLevel=3,LevelUpPoint=[Character].Relife_count*100,[Character].Money=[Character].Money-100000000,Strength=22,Dexterity=25,Vitality=20,Energy=15,Life=80,MaxLife=80,Mana=30,MaxMana=30,MapNumber=3,MapPosX=175,MapPosY=100,MapDir=4
FROM inserted WHERE inserted.Clevel>=350 and inserted.PkLevel<=3 and inserted.Money>=100000000 and (inserted.class=32 or inserted.class=33) and [Character].name = Inserted.name

UPDATE [Character] SET [Character].Relife_count=[Character].Relife_count+1,cLevel=1,Experience=0,MagicList=null,Inventory=null, PkTime=0,PkLevel=3,LevelUpPoint=[Character].Relife_count*100,[Character].Money=[Character].Money-100000000,Strength=26,Dexterity=26,Vitality=26,Energy=26,Life=110,MaxLife=110,Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1
FROM inserted WHERE inserted.Clevel>=350 and inserted.PkLevel<=3 and inserted.Money>=100000000 and inserted.class=48 and [Character].name = Inserted.name

UPDATE [Character] SET [Character].Relife_count=[Character].Relife_count+1,cLevel=1,Experience=0,MagicList=null,Inventory=null, PkTime=0,PkLevel=3,LevelUpPoint=[Character].Relife_count*100,[Character].Money=[Character].Money-100000000,Strength=30,Dexterity=26,Vitality=26,Energy=30,Life=110,MaxLife=110,Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1
FROM inserted WHERE inserted.Clevel>=350 and inserted.PkLevel<=3 and inserted.Money>=100000000 and inserted.class=64 and [Character].name = Inserted.name

This sql script is created by my friend iiibbbmmm, and improved by myself today for everyone here.

*The reset times in the script is Relife_count, pls change it yourself if need.
*Formula:
LevelUpPoint = Relife_count * 100

you can change it if need.
*Conditions:
1. clevel >= 350
2. money>= 100000000
3. PkLevel <=3
you can change the conditions or add any other contition if need.

wish it's a help for you.
 
Last edited:
Initiate Mage
Joined
Sep 14, 2005
Messages
11
Reaction score
0
u keep stats or u reset and ur stats gone but u get xtra points
 
Custom Title Activated
Member
Joined
Dec 31, 2004
Messages
4,091
Reaction score
25
Very nice release :D.
Did u create this yourself? If so, nice job !!
 
Custom Title Activated
Member
Joined
Dec 31, 2004
Messages
4,091
Reaction score
25
nice one man :p
 
Initiate Mage
Joined
Sep 20, 2005
Messages
6
Reaction score
0
Mr.X said:
Very nice release :D.
Did u create this yourself? If so, nice job !!

I can do much more than this. it's easy and not perfect in my view. cuz when the level of character reach to 350, DS will write the info into database, the tigger will be effect, and when the character offline, it's taken place again. the reset times will be added twice.

A good idea is to modify the procedure WZ_CONNECT_MEMB. use your head, and do it yourself.
 
Initiate Mage
Joined
Sep 20, 2005
Messages
6
Reaction score
0
Mr.X said:
Very nice release :D.
Did u create this yourself? If so, nice job !!

I can do much more better than this. it's easy and not perfect in my view. cuz when the level of character reach to 350, DS will record it into database and the tigger will be effect. and when the character leave out, DS will record it again. the reset times will be added twice.

A good idea is to modify the procedure WZ_CONNECT_MEMB... use your head, and do it yourself.
 
Initiate Mage
Joined
Sep 20, 2005
Messages
6
Reaction score
0
Mr.X said:
Very nice release :D.
Did u create this yourself? If so, nice job !!

I can do much more better than this. it's easy and not perfect in my view. cuz when the level of character reach to 350, DS will record it into database, the tigger will be effect. and when the character leave out, DS will record it again. the reset times will be added twice.

and, we can join the memb_stat to slove this problem. such as

update character set ........ from character join memb_stat on character.accountid=memb_stat.memb___id where ..... and memb_stat.ConnectStat=0

Is it perfect? no! who knows ds will write memb_stat(to change connectStat to 0) before write character(to record character's info) or reverse, after the character leaving out?

A good idea is to modify the procedure WZ_CONNECT_MEMB... use your head, and do it yourself.
 
Junior Spellweaver
Joined
Dec 30, 2004
Messages
104
Reaction score
4
& what about Dark Lord's Command field (aka Charisma)? There does this points are stores & how can we reset them? Any ideas?
I think this interesting & not 4 only me. Cos from all known reset solutions for now the DL's Command points are keeping :(
 
Back
Top