• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Adding 3 sod crowns

Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
724
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:
<!-- #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:
QUERY = "SELECT TOP 3 ClanName,Cpoint FROM CL ORDER BY Cpoint DESC" // select the 1st 3 clans
RS.Open QUERY, objConn, 3, 3

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 > 0) Then // the clan that requested this page is the first clan and does it have enough points?
      CNFlag = 1 // first crown
   Else
      CNFlag = 0 // no crown
   RS.MoveNext // move to record two
   tclName = RS("ClanName").Value 
   If(tclName = clname) And (RS("Cpoint").Value > 0) Then
      CNFlag = 2 // second crown
   Else
      CNFlag = 0
   RS.MoveNext
   tclName = RS("ClanName").Value
   If(tclName = clname) And (RS("Cpoint").Value > 0) Then
      CNFlag = 3 // third crown
   Else
      CNFlag = 0
end if
end if

   End If
   RS.Close
End If

Clear as mud? ^_ ^
 
Custom Title Activated
Loyal Member
Joined
Jan 28, 2009
Messages
1,320
Reaction score
616
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.
 
Custom Title Activated
Loyal Member
Joined
Jan 28, 2009
Messages
1,320
Reaction score
616
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?
 
Elite Diviner
Joined
Aug 10, 2006
Messages
429
Reaction score
119
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:
Junior Spellweaver
Joined
Aug 22, 2013
Messages
105
Reaction score
9
Is this Code can make a stats in Silver & Bronze Crown Holder?.. Just Asking! cause only golden crown SoD Holder got Stats (Attck Spd +1)
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
That has always been my experience of normality. Anything other is a custom modification of crowns, no?

Actually, what I know is that changing the standard effect (what ever that is) requires modification of the base executables. Since this isn't code for either client or server exe, it couldn't possibly do that.
 
Initiate Mage
Joined
Nov 9, 2013
Messages
2
Reaction score
0
Good, or can do that directly on server correct?

Code:
005A68BE   68 A4B36000      PUSH server40.0060B3A4                   ; ASCII "CNFlag="
005A68C3   8BCE             MOV ECX,ESI
005A68C5   C705 E0E8B807 00>MOV DWORD PTR DS:[7B8E8E0],0
005A7C11   68 A4B36000      PUSH server40.0060B3A4                   ; ASCII "CNFlag="
005A7C16   C705 E0E8B807 00>MOV DWORD PTR DS:[7B8E8E0],0
005A7E14   68 A4B36000      PUSH server40.0060B3A4                   ; ASCII "CNFlag="
005A7E19   8BCE             MOV ECX,ESI
005A7E1B   C705 E0E8B807 00>MOV DWORD PTR DS:[7B8E8E0],0
 
Back
Top