small sql fixes

Results 1 to 18 of 18
  1. #1
    Member R3apingSaint is offline
    MemberRank
    Feb 2009 Join Date
    60Posts

    small sql fixes

    =========================================
    =Editing New Character
    =========================================
    open up SQL Server Manager
    login, expand the GunzDB database.
    Expand Programmability, expand Stored Procedures, right click on dbo.spInstertChar, click Modify.


    ---------1------------
    Change starting level
    search for this line;
    Code:
     VALUES(@nAID,@szName,@cnt,1,@nSex,@nCostume,@nFace,@nHair,NULL,0,500000,0,0,0,0,0,0,0,0,0,0,0,0,@cnt,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,getdate(),getdate(),0)
    look at this part; @cnt,1,....
    The 1 is the characters level, so change it to whatever.








    -----------2------------
    changing starting bounty
    credits to xzeenon;
    Code:
    INSERT INTO Character (AID, Name, CharNum, Level, Sex, Hair, Face, XP, BP, FR, CR, ER, WR, 
             		           GameCount, KillCount, DeathCount, RegDate, PlayTime, DeleteFlag)
    Values (@AID, @Name, @CharNum, 1, @Sex, @Hair, @Face, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETDATE(), 0, 0)
    IF 0 <> @@ERROR BEGIN
    	ROLLBACK TRAN
    	RETURN (-1)
    END
    
    See after @Face, the following: " 0, 0, 0, 0, 0, 0, 0, 0, 0,"? Well let's say you want people to start with 60000 bounty you would change it to look like this... " 0, 60000, 0, 0, 0, 0, 0, 0, 0," never change it to 99999 because i have done it before on an old database and it messed it up.. you can try if you want.
    
    but anyway here is the finished product.
    
    
    
    INSERT INTO Character (AID, Name, CharNum, Level, Sex, Hair, Face, XP, BP, FR, CR, ER, WR, 
             		           GameCount, KillCount, DeathCount, RegDate, PlayTime, DeleteFlag)
    Values (@AID, @Name, @CharNum, 1, @Sex, @Hair, @Face, 0, 60000, 0, 0, 0, 0, 0, 0, 0, GETDATE(), 0, 0)
    IF 0 <> @@ERROR BEGIN
    	ROLLBACK TRAN
    	RETURN (-1)
    END
    
    Anyway when you modify that hit execute and done! Characters when created will have 60000 bounty!
    
    Anyways hope you appreciate this.






    -------------3---------------
    changing your startup items

    there are so many different spots, you will have to update them all. *the spots are in the same .dbo)

    look at the first one;
    Code:
     UPDATE Character
        SET
        chest_itemid = 21501,
        legs_itemid = 23501,
        chest_slot = @ciid3,
        legs_slot = @ciid4
        WHERE CID = @charid
    chest_itemid = whatever you want, as long as its in your zitem.xml ;)
    same goes with them all, except don't edit chest_slot = @ciid3, etc..



    ==================================================
    =Misc stuff
    ==================================================


    ----------4-----------------
    small fix for plevelers
    credits; makintosh

    Code:
     Difficulty: Intermediate SQL Knowledge
    
    The kill/death interval can be changed so if you wanted to you could autoban a player that happens to kill 10 players in under 2 seconds or whatever values you wish. Basically whatever you deem impossible for the average player. Script can also be modified to ban swappers too ;)
    
    Not recommended for small servers. Not really a fix, just autobans powerlevelers.
    
    Please backup your database first before putting in code.
    
    First modify your Character table and add in these two columns (Don't save it!)
    
    Name: LevelTime Datatype: datetime 
    Name: PlvlCount Datatype: INT (Uncheck Allow Null)
    
    When your in MSSQL Manager click on the arrow beside LevelTime column.
    Below youll see properties. In properties set "Default or binding value" to zero.
    Then Save the table.
    
    Secondly you must modify your spInsertChar proc, 
    In SQL Manager drop down "Programmability" -> "Procedures" and right-click then modify spInsertChar.
    
    Once in spInsertChar proc, find the line 
    
    
    Code:
    VALUES(@nAID,@szName,@cnt,1,@nSex,@nCostume,...........
    at the end of this line you should see:
    
    Code:
    NULL)
    change it too: 
    
    Code:
    NULL, getdate(),0)
    Then run the following query below:
    
    spUpdateCharInfoData
    
    Code:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[spUpdateCharInfoData]
    	@nAddedXP BIGINT,
    	@nAddedBP BIGINT,
    	@nAddedKillCount INT,
    	@nAddedDeathCount INT,
    	@nCID INT
    AS
    
    DECLARE @CurrTime datetime
    DECLARE @DATEDIFF INT
    DECLARE @OldTime datetime
    DECLARE @AID INT
    DECLARE @Count INT
    
    SET NOCOUNT ON;
    
    -- //BEGIN POWERLEVEL AUTOBAN//
    
    SELECT @OldTime = (SELECT LevelTime FROM Character WHERE CID = @nCID)
    SELECT @CurrTime = getdate()
    SELECT @DATEDIFF = DATEDIFF(second, @CurrTime, @OldTime)
    
    -- =============================================
    -- Author:  Mackintosh www.daemonsring.net
    -- Description: This piece of code will autoban powerlevelers 
    -- depending on how fast they kill/die by creating timestamps
    -- between deaths.
    -- =============================================
    
    -- If player, kills someone within under 2 seconds enter if statement.
    IF((abs(@DATEDIFF)) < 2)
    BEGIN
    	UPDATE Character
    	SET @Count = PlvlCount = PlvlCount+1,
    	LevelTime = @CurrTime
    	WHERE CID = @nCID
    
            -- If player has killed 5 people in under 2 seconds, autoban.
    	IF(@Count > 5)
    	BEGIN
    		SELECT @AID=AID FROM Character
    		WHERE CID = @nCID		
    
    		UPDATE Accounts
    		SET UGradeID = 253 -- 253 (Ban User)
    		WHERE AID = @AID
    	END
    END
    -- //END POWERLEVL AUTOBAN//
    
    ELSE
    BEGIN
    	UPDATE Character
    	SET XP = XP+@nAddedXP,
    	BP = BP+@nAddedBP,
    	KillCount = KillCount+@nAddedKillCount,
    	DeathCount = DeathCount+@nAddedDeathCount,
    	PlvlCount = 0,
    	LevelTime = @CurrTime
    	
    	WHERE CID = @nCID
    
    END
    The above method may seem very inefficient but with the buety of timestamps we can now display, Whos Online and much more other useful information about the server.
    
    I'll probably write a whos online script tommorow. As for clan war procs having troubles with the Emblem will probably release an incomplete version tommorow.




    --------------5---------------
    hacking a server

    click this link;
    http://www.trust-me-its-a-real-website.burninhell;D






    thats it, cant think of no more.
    credits;

    xzeenon - change starting bounty
    mackintosh - fix plevelers


  2. #2
    Aristrum Mark is offline
    MemberRank
    Aug 2007 Join Date
    United KingdomLocation
    474Posts

    Re: small sql fixes

    Good of you to collect them up into one place.

  3. #3
    WowIwasSuperCringeB4 XZeenon is offline
    MemberRank
    Jun 2008 Join Date
    CanadaLocation
    1,405Posts

    Re: small sql fixes

    Nice. Thanks for giving credits.

  4. #4
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: small sql fixes

    something called comman sense

  5. #5
    (。◕‿‿◕。) Nobody666 is online now
    MemberRank
    Oct 2008 Join Date
    1,773Posts

    Re: small sql fixes

    Quote Originally Posted by ownprox View Post
    something called comman sense
    sadly theirs a lack of that here.

  6. #6
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: small sql fixes

    ye lol thats true

  7. #7
    Member R3apingSaint is offline
    MemberRank
    Feb 2009 Join Date
    60Posts

    Re: small sql fixes

    Quote Originally Posted by ownprox View Post
    something called comman sense
    there is also somthing called being a dick, sadly there is alot of that here.

  8. #8
    Member SphSplash is offline
    MemberRank
    Feb 2008 Join Date
    64Posts

    Re: small sql fixes

    Yes since most of us are guys yes?, And what you guys call common sense isnt what I would call common.

  9. #9
    Account Upgraded | Title Enabled! Creativity is offline
    MemberRank
    Feb 2009 Join Date
    127.0.0.1Location
    492Posts

    Re: small sql fixes

    lol wow, just proving the point by arguing though, back to the topic, how about the friendlist?, i can make that work and wondered whether its a database error, would be useful to add on here i guess

  10. #10
    Account Upgraded | Title Enabled! Creativity is offline
    MemberRank
    Feb 2009 Join Date
    127.0.0.1Location
    492Posts

    Re: small sql fixes

    bumb, yeah i know its simple, but useful all the same :p
    anyone ?

  11. #11
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: small sql fixes

    Quote Originally Posted by R3apingSaint View Post
    there is also somthing called being a dick, sadly there is alot of that here.
    1) "Somthing"?
    2) @ Your siggy: Using the WebClient service, or the "WebBrowser" module don't qualify as "writing a browser" - you're still using the Trident rendering engine that's used in IE.
    3) Mostly, if not entirely, useless.

  12. #12
    Account Upgraded | Title Enabled! Creativity is offline
    MemberRank
    Feb 2009 Join Date
    127.0.0.1Location
    492Posts

    Re: small sql fixes

    so im guessing that nobody knows how to fix the friend list...yeah right :p
    anyone ?

  13. #13
    Infraction Banned MicroManiacs is offline
    MemberRank
    Apr 2009 Join Date
    326Posts

    Re: small sql fixes

    Thank you ! man !!

  14. #14
    Account Upgraded | Title Enabled! Creativity is offline
    MemberRank
    Feb 2009 Join Date
    127.0.0.1Location
    492Posts

    Re: small sql fixes

    thanks for ignoring...

  15. #15
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: small sql fixes

    Quote Originally Posted by Creativity View Post
    so im guessing that nobody knows how to fix the friend list...yeah right :p
    anyone ?
    That has to do with a client edit, not a server edit.

  16. #16
    Account Upgraded | Title Enabled! Creativity is offline
    MemberRank
    Feb 2009 Join Date
    127.0.0.1Location
    492Posts

    Re: small sql fixes

    ooh so i was looking at entirely the wrong thing lmao.

  17. #17
    Apprentice NoypiMonkey is offline
    MemberRank
    Jun 2009 Join Date
    Canada/PhilipinesLocation
    16Posts

    Re: small sql fixes

    thanks man

  18. #18
    Account Upgraded | Title Enabled! Creativity is offline
    MemberRank
    Feb 2009 Join Date
    127.0.0.1Location
    492Posts

    Re: small sql fixes

    Thanks man, now implemented myself and works well :p



Advertisement