Welcome to the RaGEZONE - MMORPG development forums.

Adding 3 sod crowns

This is a discussion on Adding 3 sod crowns within the Priston Tale Tutorials forums, part of the Priston Tale category; I already searched, but if turns out that it was already posted, please notify me. Open isClanMember.asp in your Clan ...

Results 1 to 8 of 8
  1. #1
    Fuck.
    Rank
    Moderator
    Join Date
    Feb 2008
    Location
    Jaú, Brazil
    Posts
    2,195
    Liked
    610
    Gamertag: Borgo01

    Adding 3 sod crowns

    Click
    I already searched, but if turns out that it was already posted, please notify me.

    Open isClanMember.asp in your Clan files and replace it's content with this paste:

    PHP Code:
    <!-- #include file ="settings.asp" -->
    <%
    'Written By Sandurr COPYRIGHT Sandurr 2006
    '
    Written By Sandurr COPYRIGHT Sandurr 2006
    'Written By Sandurr COPYRIGHT Sandurr 2006
    '
    Written By Sandurr COPYRIGHT Sandurr 2006
    'Written By Sandurr COPYRIGHT Sandurr 2006
    '
    Version 2.0 NOVEMBER 2006

    ' Assign Global Variables
    Dim dbhost, dbuser, dbpass, dbname, userid, gserver, chname

    Dim tTime
    tTime = " ¿ÀÈÄ "

    FillSettings()

    Dim strSplit
    strSplit = Chr("&H" & "0D")

    Parameter Variables
    ' isClanMember (userid, gserver, chname)
    userid = Trim(Request("userid"))
    gserver = Trim(Request("gserver"))
    chname = Trim(Request("chname"))

    if userid = "" Or gserver = "" Or chname = "" Then
       Response.Write("Code=100" & strSplit)
       Response.End
    End if

    Dim QUERY, RS, objConn

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=SQLOLEDB; Data Source=" & dbhost & "; Initial Catalog=" & dbname & "; User ID=" & dbuser & "; Password=" & dbpass

    QUERY = "SELECT ClanName FROM UL WHERE ChName='" & chname & "'"

    Set RS = Server.CreateObject("ADODB.Recordset")
    RS.Open QUERY, objConn, 3, 1

    if RS.RecordCount = 0 Then
       RS.Close
       Set RS = Nothing
       objConn.Close
       Set objConn = Nothing
       Response.Write("Code=0" & strSplit & "CMoney=500000" & strSplit & "CNFlag=0" & strSplit)
       Response.End
    End if

    Dim clname
    clname = RS("ClanName").Value
    if clname = "" Then
       RS.Close
       QUERY = "DELETE FROM UL WHERE ChName='" & chname & "'"
       RS.Open QUERY, objConn, 3, 1
       Set RS = Nothing
       objConn.Close
       Set objConn = Nothing
       Response.Write("Code=0" & strSplit & "CMoney=500000" & strSplit & "CNFlag=0" & strSplit)
       Response.End
    End if

    RS.Close
    QUERY = "SELECT ClanZang,MemCnt,Note,MIconCnt,RegiDate,LimitDate,PFlag,KFlag,ClanMoney,MIconCnt FROM CL WHERE ClanName='" & clname & "'"
    RS.Open QUERY, objConn, 3, 1

    if RS.RecordCount = 0 Then
       RS.Close
       QUERY = "DELETE FROM UL WHERE ChName='" & chname & "'"
       RS.Open QUERY, objConn, 3, 1
       Set RS = Nothing
       objConn.Close
       Set objConn = Nothing
       Response.Write("Code=0" & strSplit & "CMoney=500000" & strSplit & "CNFlag=0" & strSplit)
       Response.End
    End if

    Dim ClanLeader, ClanMembers, ClanNote, ClanIMG, CreateDate, ClanSubChief, EndDate, PFlag, KFlag, ClanMoney, iIMG
    ClanLeader = RS("ClanZang").Value
    ClanMembers = RS("MemCnt").Value
    ClanNote = RS("Note").Value
    ClanIMG = RS("MIconCnt").Value
    CreateDate = RS("RegiDate").Value
    EndDate = RS("LimitDate").Value
    PFlag = RS("PFlag").Value
    KFlag = RS("KFlag").Value
    ClanMoney = RS("ClanMoney").Value
    iIMG = RS("MIconCnt").Value

    Dim strReturn

    RS.Close

    QUERY = "SELECT TOP 3 ClanName,Cpoint FROM CL ORDER BY Cpoint DESC"
    RS.Open QUERY, objConn, 3, 3

    Dim tclName, CNFlag

    If RS.RecordCount > 0 Then
       tclName = RS("ClanName").Value
       If(tclName = clname) And (RS("Cpoint").Value > 0) Then
          CNFlag = 1
       Else
          CNFlag = 0
       RS.MoveNext
       tclName = RS("ClanName").Value
       If(tclName = clname) And (RS("Cpoint").Value > 0) Then
          CNFlag = 2
       Else
          CNFlag = 0
       RS.MoveNext
       tclName = RS("ClanName").Value
       If(tclName = clname) And (RS("Cpoint").Value > 0) Then
          CNFlag = 3
       
       Else
          CNFlag = 0
    end if
    end if

       End If
       RS.Close
    End If


    Dim tSubDate, tSubTime, y, tSub, tSub2
    For y = 1 To Len(CreateDate)
       tSub = Mid(CreateDate,y,1)
       If tSub2 = 0 Then
          If Not tSub = " " Then
             tSubDate = tSubDate & tSub
          Else
             tSub2 = 1
          End If
       Else
          If tSub2 = 1 Then
             If Not tSub = " " Then
                tSubTime = tSubTime & tSub
             Else
                tSub2 = 2
             End If
          End If
       End If
    Next

    CreateDate = tSubDate & tTime & tSubTime
    y = 1
    tSub = ""
    tSub2 = 0
    tSubDate = ""
    tSubTime = ""

    For y = 1 To Len(EndDate)
       tSub = Mid(EndDate,y,1)
       If tSub2 = 0 Then
          If Not tSub = " " Then
             tSubDate = tSubDate & tSub
          Else
             tSub2 = 1
          End If
       Else
          If tSub2 = 1 Then
             If Not tSub = " " Then
                tSubTime = tSubTime & tSub
             Else
                tSub2 = 2
             End If
          End If
       End If
    Next

    EndDate = tSubDate & tTime & tSubTime

    QUERY = "SELECT ChName FROM UL WHERE ClanName='" & clname & "' AND Permi=2"
    RS.Open QUERY, objConn, 3, 1

    If RS.RecordCount = 0 Then
       ClanSubChief = ""
    Else
       ClanSubChief = RS("ChName").Value
    End If

    If ClanLeader = chname Then
       if ClanSubChief = "" Then
          strReturn = "Code=2" & strSplit & "CName=" & clname & strSplit & "CNote=" & ClanNote & strSplit & "CZang=" & ClanLeader & strSplit & "CStats=1" & strSplit & "CMCnt=" & ClanMembers & strSplit & "CIMG=" & ClanIMG & strSplit & "CSec=60" & strSplit & "CRegiD=" & CreateDate & strSplit & "CLimitD=" & EndDate & strSplit & "CDelActive=0" & strSplit & "CPFlag=" & PFlag & strSplit & "CKFlag=" & KFlag & strSplit & "CMoney=" & ClanMoney & strSplit & "CNFlag=" & CNFlag & strSplit
       Else
          strReturn = "Code=2" & strSplit & "CName=" & clname & strSplit & "CNote=" & ClanNote & strSplit & "CZang=" & ClanLeader & strSplit & "CSubChip=" & ClanSubChief & strSplit & "CStats=1" & strSplit & "CMCnt=" & ClanMembers & strSplit & "CIMG=" & ClanIMG & strSplit & "CSec=60" & strSplit & "CRegiD=" & CreateDate & strSplit & "CLimitD=" & EndDate & strSplit & "CDelActive=0" & strSplit & "CPFlag=" & PFlag & strSplit & "CKFlag=" & KFlag & strSplit & "CMoney=" & ClanMoney & strSplit & "CNFlag=" & CNFlag & strSplit
       End if
    Else
       if ClanSubChief = "" Then
          strReturn = "Code=1" & strSplit & "CName=" & clname & strSplit & "CNote=" & ClanNote & strSplit & "CZang=" & ClanLeader & strSplit & "CStats=1" & strSplit & "CMCnt=" & ClanMembers & strSplit & "CIMG=" & ClanIMG & strSplit & "CSec=60" & strSplit & "CRegiD=" & CreateDate & strSplit & "CLimitD=" & EndDate & strSplit & "CDelActive=0" & strSplit & "CPFlag=0" & strSplit & "CKFlag=0" & strSplit & "CMoney=" & ClanMoney & strSplit & "CNFlag=" & CNFlag & strSplit
       Else
          strReturn = "Code=1" & strSplit & "CName=" & clname & strSplit & "CNote=" & ClanNote & strSplit & "CZang=" & ClanLeader & strSplit & "CSubChip=" & ClanSubChief & strSplit & "CStats=1" & strSplit & "CMCnt=" & ClanMembers & strSplit & "CIMG=" & ClanIMG & strSplit & "CSec=60" & strSplit & "CRegiD=" & CreateDate & strSplit & "CLimitD=" & EndDate & strSplit & "CDelActive=0" & strSplit & "CPFlag=0" & strSplit & "CKFlag=0" & strSplit & "CMoney=" & ClanMoney & strSplit & "CNFlag=" & CNFlag & strSplit
       End if
    End if

    RS.Close

    If ClanSubChief = chname Then
       If Not ClanLeader = chname Then
          strReturn = "Code=5" & strSplit & "CName=" & clname & strSplit & "CNote=" & ClanNote & strSplit & "CZang=" & ClanLeader & strSplit & "CSubChip=" & ClanSubChief & strSplit & "CStats=1" & strSplit & "CMCnt=" & ClanMembers & strSplit & "CIMG=" & ClanIMG & strSplit & "CSec=60" & strSplit & "CRegiD=" & CreateDate & strSplit & "CLimitD=" & EndDate & strSplit & "CDelActive=0" & strSplit & "CPFlag=" & PFlag & strSplit & "CKFlag=" & KFlag & strSplit & "CMoney=" & ClanMoney & strSplit & "CNFlag=" & CNFlag & strSplit
       End If
    End if

    QUERY = "UPDATE UL SET MIconCnt='" & iIMG & "' WHERE ChName='" & chname & "'"
    RS.Open QUERY, objConn, 3, 1

    Set RS = Nothing
    objConn.Close
    Set objConn = Nothing

    Response.Write(strReturn)
    %> 
    Explanation:

    The paste below is responsible for managing the clan position.
    PHP Code:

    QUERY 
    "SELECT TOP 3 ClanName,Cpoint FROM CL ORDER BY Cpoint DESC" // select the 1st 3 clans
    RS.Open QUERYobjConn33

    Dim tclName
    CNFlag

    If RS.RecordCount 0 Then // has records?
       
    tclName RS("ClanName").Value  //name of the first clan returned in the query
       
    If(tclName clname) And (RS("Cpoint").Value 0Then // the clan that requested this page is the first clan and does it have enough points?
          
    CNFlag // first crown
       
    Else
          
    CNFlag // no crown
       
    RS.MoveNext // move to record two
       
    tclName RS("ClanName").Value 
       
    If(tclName clname) And (RS("Cpoint").Value 0Then
          CNFlag 
    // second crown
       
    Else
          
    CNFlag 0
       RS
    .MoveNext
       tclName 
    RS("ClanName").Value
       
    If(tclName clname) And (RS("Cpoint").Value 0Then
          CNFlag 
    // third crown
       
    Else
          
    CNFlag 0
    end 
    if
    end if

       
    End If
       
    RS.Close
    End 
    If 
    Clear as mud? ^_ ^

  2. #2
    ●•٠·˙
    Rank
    Member +
    Join Date
    Jan 2009
    Posts
    1,280
    Liked
    550

    Re: Adding 3 sod crowns

    So basically this is changing only one thing in SQL DB, "CNFlag". I don't like it ;)

    All 3 clans will have same crown? That's a little confusing.
    Its like having 3 BC winners <_< Come to our server, nobody lose here XD

    However I see some potential in this. You can use it as SoD 1 and SoD 2 crown. If anyone ever restore SoD 1.
    ░▄▄▄░░▄▄░▄▄░░▄▄░░▄▄▄░
    ░░█░░███████░█░█░░█░░
    ░░█░░▀█████▀░█▀░░░█░░
    ░▄█▄░░░▀█▀░░░█░░░░█░░‪

  3. #3
    Fuck.
    Rank
    Moderator
    Join Date
    Feb 2008
    Location
    Jaú, Brazil
    Posts
    2,195
    Liked
    610
    Gamertag: Borgo01

    Re: Adding 3 sod crowns

    This doesnt change anything in the database, I guess you misunderstood it

  4. #4
    ●•٠·˙
    Rank
    Member +
    Join Date
    Jan 2009
    Posts
    1,280
    Liked
    550

    Re: Adding 3 sod crowns

    O sorry I mistaken it for same name in ClanDB.CL that most likely was used instead in official files, too much DB lately =P.

    I think I got it now. So it is compared in client and if bigger than 0 it will give you crown? Do you know exactly where?
    ░▄▄▄░░▄▄░▄▄░░▄▄░░▄▄▄░
    ░░█░░███████░█░█░░█░░
    ░░█░░▀█████▀░█▀░░░█░░
    ░▄█▄░░░▀█▀░░░█░░░░█░░‪

  5. #5
    Fuck.
    Rank
    Moderator
    Join Date
    Feb 2008
    Location
    Jaú, Brazil
    Posts
    2,195
    Liked
    610
    Gamertag: Borgo01

    Re: Adding 3 sod crowns

    Yes, in the CNFlag value. as I showed in the code

  6. #6
    Registered
    Rank
    Member
    Join Date
    Jun 2012
    Posts
    6
    Liked
    0

    Re: Adding 3 sod crowns

    Quote Originally Posted by SheenBR View Post
    Yes, in the CNFlag value. as I showed in the code
    would be charge the code aspx to three Bless Castle Winners or need add asm codes ?

  7. #7
    Fuck.
    Rank
    Moderator
    Join Date
    Feb 2008
    Location
    Jaú, Brazil
    Posts
    2,195
    Liked
    610
    Gamertag: Borgo01

    Re: Adding 3 sod crowns

    just change the asp script. you need to add asm codes to add +1 Speed for the winner clan, but I dont know how to do that.

  8. #8
    Programmer
    Rank
    Member +
    Join Date
    Aug 2006
    Location
    scotland, uk
    Posts
    421
    Liked
    111
    Gamertag: o0Gzuz0o

    Re: Adding 3 sod crowns

    that script is wrong. if you use that then users with less than 1 Cpoint wont be able to exist. You need to refine the script or add into claninsert.aspx to add 1 cpoint at register and edit sod2info add where cpoint > 1 on the select query.

    or even in this script make the select like
    Code:
    QUERY = "SELECT TOP 3 ClanName,Cpoint FROM CL WHERE Cpoint > 0 ORDER BY Cpoint DESC" // select the 1st 3 clans
    Actually i messed up there, the issue is when server has < 3 clans, they will not work with this. You need to further expand the func and offer it alternate values in a case or with if statements.

    ie.

    QUERY = "SELECT COUNT(*) AS NumberClans FROM CL"
    RS.Open QUERY, objConn, 3, 1
    dim numclans as integer
    numclans = rs.numberclans
    rs.close

    if numclans >= 3 then
    #STATEMENT#
    Else If numclans = 2 then
    #STATEMENT#
    Else If numclans = 1 then
    #STATEMENT#
    end if
    Last edited by gzuz; 22-09-12 at 03:05 AM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •