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!

[PHP][KO Panel] Nation Transfer Script (SNOXDKO)

Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Due to the panel being totally re-written, I've decided to release some of the older scripts from the SnoxdKO Panel. By common request I've began with Nation Transfer and Character Restat(Which will be posted momentarily).
All I ask is that the credits in the title are left intact, or the releases will stop.

There's a few things for example Killing connected users which can't be released as they communicate with another application which currently is private.
Also, you'll need to remove the logging unless you're gonna reproduce the table (I'll post the SQL for it here, later).

We enforced some rules to ensure equality between both nations, these are as follows:


  • The Desired Nation must be Less Than 60% Total Population
  • The Desired Nation must be Less Than 57.5% Total National Points

Of course you can change these as you see fit.

Anyway, enjoy:

PHP:
<?php

include('./anti_inject.php');

parth1tr();
parth1('100%', 2, 'center');
echo 'Nation Transfer - Beta - by BlaDe @ Snoxd.net';
parth2();
parth2tr();

if (isset($_SESSION['sesuser'])) {
    if ($_GET['Confirmed'] == 1) {
        $connect = odbc_connect("$dbname", "$dbuser", "$dbpass");
        $query = "SELECT strCharID1, strCharID2, strCharID3 FROM Account_Char WHERE strAccountID ='" . $_SESSION['sesuser'] . "' ";
        $results = odbc_exec($connect, $query); 
        // Store all char names in var's.....
        while (odbc_fetch_row($results)) {
            $char1 = odbc_result($results, 1);
            $char2 = odbc_result($results, 2);
            $char3 = odbc_result($results, 3);
        } 
        // Confirm they have a character
        if ((empty($char1)) && (empty($char2)) && (empty($char3))) {
            part1('100%', 1, 1, 'center');
            echo '</br>Your not part of a Nation, how do you expect to change it?';
            echo '</br></br><a href="./index.php">Back</a></br>';
            part2();
        } else {
            // Confirm none of the chars are logged in..
            // Updated during the for loop

            $query = "SELECT count(strCharID) FROM CURRENTUSER WHERE strCharID = '" . $char1 . "' OR strCharID = '" . $char2 . "' OR strCharID = '" . $char3 . "'";
            $results = odbc_exec($connect, $query);
            while (odbc_fetch_row($results)) {
                $online = odbc_result($results, 1);
            } 
              if (strlen(trim($online)) > 0) {
                part1('100%', 1, 1, 'center');
                echo '</br>All characters must be logged out of the game first!';
                echo '</br></br><a href="./index.php">Back</a></br>';
                part2();
                die();
            } 
            // Check they aren't in a clan on any of 3 characters.
            
            $query = "SELECT count(Knights) FROM USERDATA WHERE strUserID = '" . $char1 . "' OR strUserID = '" . $char2 . "' OR strUserID = '" . $char3 . "'";
            $results = odbc_exec($connect, $query);
            while (odbc_fetch_row($results)) {
                $knights = odbc_result($results, 1);
            } 
            if ($knights != 0) {
                part1('100%', 1, 1, 'center');
                echo '</br>All characters on account have to be clanless.';
                echo '</br></br><a href="./index.php">Back</a></br>';
                part2();
                die();
            } 
            $query = "SELECT COUNT(*) FROM NT_LOG WHERE DATEDIFF(Hour,[Date],GETDATE()) < 48 AND Account = '" . $_SESSION['sesuser'] . "'";
            $results = odbc_exec($connect, $query);
            while (odbc_fetch_row($results)) {
                $logcheck = odbc_result($results, 1);
            } 
            if ($logcheck > 0) {
                part1('100%', 1, 1, 'center');
                echo '</br>You may only use this feature once every 48hours.';
                echo '</br></br><a href="./index.php">Back</a></br>';
                part2();
                die();
            } else {
                // Get the nation and calculate desired nation
                $query = "SELECT strAccountID, bNation FROM ACCOUNT_CHAR WHERE strAccountID = '" . $_SESSION['sesuser'] . "'";
                $results = odbc_exec($connect, $query);
                while (odbc_fetch_row($results)) {
                    $nation = odbc_result($results, 2);
                } 
                if ($nation == 1) $desiredNation = 2;
                if ($nation == 2) $desiredNation = 1; 
                // Test 1
                $check1 = odbc_exec($connect, "SELECT COUNT(*) FROM USERDATA WHERE Nation='" . $desiredNation . "'");
                $check2 = odbc_exec($connect, "SELECT COUNT(*) FROM USERDATA");

                $tot1 = odbc_result ($check1, 1);
                $tot2 = odbc_result($check2, 1);
                if ($tot1 / $tot2 > 0.6) {
                    part1('100%', 1, 1, 'center');
                    echo '</br>Sorry your desired nation has too many users.';
                    echo '</br>The desired population must be less than 60% Population!';
                    echo '</br></br><a href="./index.php">Back</a></br>';
                    part2();
                    die();
                } 
                // Test 2
                $check3 = odbc_exec($connect, "SELECT SUM(Loyalty) AS nps FROM TB_USER WHERE Nation='" . $desiredNation . "'");
                $check4 = odbc_exec($connect, "SELECT SUM(Loyalty) AS totnps FROM TB_USER");
                $nps = odbc_result_all($check3);
                $totnps = odbc_result_all($check4);
                if ($nps / $totnps > 0.575) {
                    part1('100%', 1, 1, 'center');
                    echo '</br>Sorry your desired nation has too many National Points.';
                    echo '</br>The desired population must be less than 57% total National Points!';
                    echo '</br></br><a href="./index.php">Back</a></br>';
                    part2();
                    die();
                } else {
                    // Calculate the newrace + class of the characters..
                    foreach (array($char1, $char2, $char3) as $char) {
                        if ($char != "") {
                        $getuser = "SELECT strCharID FROM CURRENTUSER where strCharID = '" . $char . "'";
                        $getusere = odbc_exec($connect, $getuser);
                        $characterID = odbc_result($getusere, 1);

                        if (strlen(trim($characterID)) > 0) {
                        $killed = 1;
                        KillUserAndWait(trim($characterID), $connect);
                         } 
                            $query = "SELECT strUserID, Race, Class FROM USERDATA WHERE strUserID = '" . $char . "'";
                            $results = odbc_exec($connect, $query);
                            while (odbc_fetch_row($results)) {
                                $race = odbc_result($results, 2);
                                $class = odbc_result($results, 3);
                            } 

                            if ($race < 12) {
                                $hashmap = array (1 => 11, 2 => 12, 3 => 13, 4 => 13, 11 => 1);
                                $NewRace = $hashmap[$race];
                            } elseif (($race == 12) || ($race == 13) || ($race == 14)) {
                                if ($class == 201) $NewRace = 1;
                                elseif ($class == 202) $NewRace = 2;
                                elseif ($class == 203) $NewRace = 3;
                                elseif ($class == 204) $NewRace = 4;
                                elseif ($class == 205) $NewRace = 1;
                                elseif ($class == 207) $NewRace = 2;
                                elseif ($class == 209) $NewRace = 3;
                                elseif ($class == 211) $NewRace = 4;
                            } 
                            if ($class >= 199) {
                                $NewClass = $class - 100;
                            } else {
                                $NewClass = $class + 100;
                            } 
                            if (($NewRace == '') || ($NewClass == '')) {
                                part1('100%', 1, 1, 'center');
                                echo 'Error: (Char: ' . $char . ')</br> New Class:';
                                echo $NewClass;
                                echo '</br> New Race:';
                                echo $NewRace;
                                echo '</br> Old Class:';
                                echo $class;
                                echo '</br> Old Race:';
                                echo $race;
                                echo '</br></br><a href="./index.php">Back</a></br>';
                                part2();
                                die();
                            } 
                            $query = "UPDATE USERDATA SET Nation = '" . $desiredNation . "', Race = '" . $NewRace . "', Class = '" . $NewClass . "', Zone = 21, PX = 33550, PZ = 38400, PY = 0 WHERE strUserID = '" . $char . "'";
                            $results = odbc_exec($connect, $query);
                        } 
                    } 
                    $query = "INSERT INTO NT_LOG([Date], Account, Char1, Char2, Char3, NationTo) VALUES (GETDATE(), '" . $_SESSION['sesuser'] . "', '" . $char1 . "', '" . $char2 . "', '" . $char3 . "', '" . $desiredNation . "')";
                    $results = odbc_exec($connect, $query);
                    $query = "UPDATE ACCOUNT_CHAR SET bNation = '" . $desiredNation . "' WHERE strAccountID = '" . $_SESSION['sesuser'] . "'";
                    $results = odbc_exec($connect, $query);
                } 
                // Done
                part1tr();
                part1('100%', 1, 1, 'center');
                echo 'Done';
echo '</br></br><a href="./index.php">Back</a>';
                if ($killed == 1) { echo '</br>A character was disconnected during this process'; }
                part2();
                part2tr();
            } 
        } 
    } else {
        part1tr();
        part1('25%', 1, 1, 'center');
        echo 'Please confirm your transfer:</br></br></br>
        <li>You must be <b>logged out</b> of <b>all</b> characters</li>
        <li>You must be <b>Clanless</b> on <b>all</b> characters</li>
        <li>You may only use this feature <b>once</b> every 48hours</li>
        <li>The Desired Nation must be <b>Less Than</b> 60% Total Population </li>
        <li>The Desired Nation must be <b>Less Than</b> 57.5% Total National Points</li></br></br>
        <FORM method=post name=confirm action=index.php?act=NationTransfer&Confirmed=1>
            <input class="input" type="submit" value="Confirm">
            </form>';
        part2();
        part2tr();
    } 
} else {
    part1('100%', 1, 1, 'center');
    echo 'You must login first!';
    part2();
} 

?>

You can find the restat script here

Feel free to post if you have any issues, questions or requests.

Thanks,

BlaDe.
 
Last edited:
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

TY for this
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

You should download that code again, fixed a small bug. Remember you need to remove the KillUserAndWait and log stuff :).
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

Already done :D

I wont remove the logging, as Ill wait for the Required Column definitions to be posted.

Thanks in advance
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

CREATE TABLE [dbo].[NT_LOG] (
[Date] [datetime] NOT NULL ,
[Account] [char] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Char1] [char] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Char2] [char] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Char3] [char] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[NationTo] [tinyint] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[NationTransfers] (
[strAccountID] [varchar] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[strPasswd] [varchar] (13) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[desiredNation] [tinyint] NULL
) ON [PRIMARY]
GO

They're the tables we used for NT related stuff.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

TY again, but it seems I am missing some more stored procs..

I already have stored procedure 'NT'

But It seems I also need 'NT1' and 'NT2' as the script changes my nation but not my chars skin class etc etc.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

NT, NT1 and NT2 procedures.

I took these from my old 1098 DB, but like other scripts from 1098 they dont work 100% the way they should..

I dont have the time to start editing them so I'll post them here for everyone.. Maybe someone can fix them up for 1299.

The problem seems to be with NT1 and NT2 procedures, with the class numbers, They seem to be mixed up etc etc, as when I Nation Transfer my Char has no skin etc etc.

NT

Code:
CREATE PROCEDURE [NT]
@Account varchar(50),
@NTnum varchar(50)
AS DECLARE @clannumber smallint, @length int,@row int,@i int,@dwid int,@pos int,@dur int,@dur1 int,@ext int,@StackSize1 int,@strName varchar(30),@strExtName varchar(30),@Cdwid varbinary(4),@cdur varchar(2),@cstack varchar(2)
begin tran
declare @char1 varchar(21)
set @char1 = (select strcharid1 from account_char where straccountid = @account)
declare @char2 varchar(21)
set @char2 = (select strcharid2 from account_char where straccountid = @account)
declare @char3 varchar(21)
set @char3 = (select strcharid3 from account_char where straccountid = @account)
declare @clannumber1 smallint
set @clannumber1 = (select idnum from knights where chief = @char1)
declare @clannumber2 smallint
set @clannumber2 = (select idnum from knights where chief = @char2)
declare @clannumber3 smallint
set @clannumber3 = (select idnum from knights where chief = @char3)
declare @online1 varchar(50)
set @online1 = (select count(strcharid) from currentuser where strcharid = @char1)
declare @online2 varchar(50)
set @online2 = (select count(strcharid) from currentuser where strcharid = @char2)
declare @online3 varchar(50)
set @online3 = (select count(strcharid) from currentuser where strcharid = @char3)
 
if @online1  > 1 begin select 'One of their characters is currently online, they must be offline to NT.' end
if @online2  > 1 begin select 'One of their characters is currently online, they must be offline to NT.' end
if @online3  > 1 begin select 'One of their characters is currently online, they must be offline to NT.' end
 
if @NTnum = 2 and @online1 = 0 and @online2 = 0 and @online3 = 0
begin
update account_char set bnation = '2' where bnation = '1' and straccountid = @Account
update userdata set nation = '2' where nation = '1' and struserid = @char1
Update userdata set race = '11' where class = '105' and struserid = @char1
update userdata set race = '11' where class = '101' and struserid = @char1
Update userdata set race = '12' where race = '2' and class in ('107','111','102','104') and struserid = @char1
update userdata set race = '13' where race = '3' and class in ('104','111') and struserid = @char1
update userdata set race = '13' where class in ('203','209') and race = '4' and struserid = @char1
update userdata set class = '205' where class = '105' and struserid = @char1
update userdata set class = '207' where class = '107' and struserid = @char1
update userdata set class = '209' where class = '109' and struserid = @char1
update userdata set class = '211' where class = '111' and struserid = @char1
update userdata set class = '201' where class = '101' and struserid = @char1
update userdata set class = '202' where class = '102' and struserid = @char1
update userdata set class = '203' where class = '103' and struserid = @char1
update userdata set class = '204' where class = '104' and struserid = @char1
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char1
delete from knights where chief = @char1
delete from knights_user where sidnum = @clannumber1
delete from knights_rating where shindex = @clannumber1
update userdata set knights = 0, fame = 0 where knights = @clannumber1
update userdata set nation = '2' where nation = '1' and struserid = @char2
Update userdata set race = '11' where class = '105' and struserid = @char2
update userdata set race = '11' where class = '101' and struserid = @char2
Update userdata set race = '12' where race = '2' and class in ('107','111','102','104') and struserid = @char2
update userdata set race = '13' where race = '3' and class in ('104','111') and struserid = @char2
update userdata set race = '13' where class in ('203','209') and race = '4' and struserid = @char2
update userdata set class = '205' where class = '105' and struserid = @char2
update userdata set class = '207' where class = '107' and struserid = @char2
update userdata set class = '209' where class = '109' and struserid = @char2
update userdata set class = '211' where class = '111' and struserid = @char2
update userdata set class = '201' where class = '101' and struserid = @char2
update userdata set class = '202' where class = '102' and struserid = @char2
update userdata set class = '203' where class = '103' and struserid = @char2
update userdata set class = '204' where class = '104' and struserid = @char2
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
delete from knights where chief = @char2
delete from knights_user where sidnum = @clannumber2
delete from knights_rating where shindex = @clannumber2
update userdata set knights = 0, fame = 0 where knights = @clannumber2
update userdata set nation = '2' where nation = '1' and struserid = @char3
Update userdata set race = '11' where class = '105' and struserid = @char3
update userdata set race = '11' where class = '101' and struserid = @char3
Update userdata set race = '12' where race = '2' and class in ('107','111','102','104') and struserid = @char3
update userdata set race = '13' where race = '3' and class in ('104','111') and struserid = @char3
update userdata set race = '13' where class in ('203','209') and race = '4' and struserid = @char3
update userdata set class = '205' where class = '105' and struserid = @char3
update userdata set class = '207' where class = '107' and struserid = @char3
update userdata set class = '209' where class = '109' and struserid = @char3
update userdata set class = '211' where class = '111' and struserid = @char3
update userdata set class = '201' where class = '101' and struserid = @char3
update userdata set class = '202' where class = '102' and struserid = @char3
update userdata set class = '203' where class = '103' and struserid = @char3
update userdata set class = '204' where class = '104' and struserid = @char3
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
delete from knights where chief = @char3
delete from knights_user where sidnum = @clannumber3
delete from knights_rating where shindex = @clannumber3
update userdata set knights = 0, fame = 0 where knights = @clannumber3
update userdata set knights = 0, fame = 0 where struserid = @char1
update userdata set knights = 0, fame = 0 where struserid = @char2
update userdata set knights = 0, fame = 0 where struserid = @char3
Update knights set vicechief_1 = null where vicechief_1 = @char1
Update knights set vicechief_2 = null where vicechief_2 = @char1
Update knights set vicechief_3 = null where vicechief_3 = @char1
Update knights set vicechief_1 = null where vicechief_1 = @char2
Update knights set vicechief_2 = null where vicechief_2 = @char2
Update knights set vicechief_3 = null where vicechief_3 = @char2
Update knights set vicechief_1 = null where vicechief_1 = @char3
Update knights set vicechief_2 = null where vicechief_2 = @char3
Update knights set vicechief_3 = null where vicechief_3 = @char3
delete from knights_user where struserid = @char1
delete from knights_user where struserid = @char2
delete from knights_user where struserid = @char3
end
if @NTnum = 1 and @online1 = 0 and @online2 = 0 and @online3 = 0
begin
update account_char set bnation = '1' where bnation = '2' and straccountid = @Account
update userdata set nation = '1' where nation = '2' and struserid = @char1
Update userdata set race = '1' where class in ('201','205') and struserid = @char1
Update userdata set race = '2' where race = '12' and class in ('207','211','202','204') and struserid = @char1
update userdata set race = '3' where race = '13' and class in ('204','211') and struserid = @char1
update userdata set race = '4' where class in ('203','209') and struserid = @char1
update userdata set class = '105' where class = '205' and struserid = @char1
update userdata set class = '107' where class = '207' and struserid = @char1
update userdata set class = '109' where class = '209' and struserid = @char1
update userdata set class = '111' where class = '211' and struserid = @char1
update userdata set class = '101' where class = '201' and struserid = @char1
update userdata set class = '102' where class = '202' and struserid = @char1
update userdata set class = '103' where class = '203' and struserid = @char1
update userdata set class = '104' where class = '204' and struserid = @char1
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char1
delete from knights where chief = @char1
delete from knights_user where sidnum = @clannumber1
delete from knights_rating where shindex = @clannumber1
update userdata set knights = 0, fame = 0 where knights = @clannumber1
update userdata set nation = '1' where nation = '2' and struserid = @char2
Update userdata set race = '1' where class in ('201','205') and struserid = @char2
Update userdata set race = '2' where race = '12' and class in ('207','211','202','204') and struserid = @char2
update userdata set race = '3' where race = '13' and class in ('204','211') and struserid = @char2
update userdata set race = '4' where class in ('203','209') and struserid = @char2
update userdata set race = '4' where class = '209' and struserid = @char2
update userdata set class = '105' where class = '205' and struserid = @char2
update userdata set class = '107' where class = '207' and struserid = @char2
update userdata set class = '109' where class = '209' and struserid = @char2
update userdata set class = '111' where class = '211' and struserid = @char2
update userdata set class = '101' where class = '201' and struserid = @char2
update userdata set class = '102' where class = '202' and struserid = @char2
update userdata set class = '103' where class = '203' and struserid = @char2
update userdata set class = '104' where class = '204' and struserid = @char2
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
delete from knights where chief = @char2
delete from knights_user where sidnum = @clannumber2
delete from knights_rating where shindex = @clannumber2
update userdata set knights = 0, fame = 0 where knights = @clannumber2
update userdata set nation = '1' where nation = '2' and struserid = @char3
Update userdata set race = '1' where class in ('201','205') and struserid = @char3
Update userdata set race = '2' where race = '12' and class in ('207','211','202','204') and struserid = @char3
update userdata set race = '3' where race = '13' and class in ('204','211') and struserid = @char3
update userdata set race = '4' where class in ('203','209') and struserid = @char3
update userdata set class = '105' where class = '205' and struserid = @char3
update userdata set class = '107' where class = '207' and struserid = @char3
update userdata set class = '109' where class = '209' and struserid = @char3
update userdata set class = '111' where class = '211' and struserid = @char3
update userdata set class = '101' where class = '201' and struserid = @char3
update userdata set class = '102' where class = '202' and struserid = @char3
update userdata set class = '103' where class = '203' and struserid = @char3
update userdata set class = '104' where class = '204' and struserid = @char3
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
delete from knights where chief = @char3
delete from knights_user where sidnum = @clannumber3
delete from knights_rating where shindex = @clannumber3
update userdata set knights = 0, fame = 0 where knights = @clannumber3
update userdata set knights = 0, fame = 0 where struserid = @char1
update userdata set knights = 0, fame = 0 where struserid = @char2
update userdata set knights = 0, fame = 0 where struserid = @char3
Update knights set vicechief_1 = null where vicechief_1 = @char1
Update knights set vicechief_2 = null where vicechief_2 = @char1
Update knights set vicechief_3 = null where vicechief_3 = @char1
Update knights set vicechief_1 = null where vicechief_1 = @char2
Update knights set vicechief_2 = null where vicechief_2 = @char2
Update knights set vicechief_3 = null where vicechief_3 = @char2
Update knights set vicechief_1 = null where vicechief_1 = @char3
Update knights set vicechief_2 = null where vicechief_2 = @char3
Update knights set vicechief_3 = null where vicechief_3 = @char3
delete from knights_user where struserid = @char1
delete from knights_user where struserid = @char2
delete from knights_user where struserid = @char3
end
 
commit tran
GO


NT1

Code:
CREATE procedure [nt1]
@Account char(30)
AS DECLARE @clannumber smallint, @length int,@row int,@i int,@dwid int,@pos int,@dur int,@dur1 int,@ext int,@StackSize1 int,@strName varchar(30),@strExtName varchar(30),@Cdwid varbinary(4),@cdur varchar(2),@cstack varchar(2)
begin tran
declare @char1 varchar(21)
set @char1 = (select strcharid1 from account_char where straccountid = @account)
declare @char2 varchar(21)
set @char2 = (select strcharid2 from account_char where straccountid = @account)
declare @char3 varchar(21)
set @char3 = (select strcharid3 from account_char where straccountid = @account)
declare @clannumber1 smallint
set @clannumber1 = (select idnum from knights where chief = @char1)
declare @clannumber2 smallint
set @clannumber2 = (select idnum from knights where chief = @char2)
declare @clannumber3 smallint
set @clannumber3 = (select idnum from knights where chief = @char3)
update account_char set bnation = '1' where bnation = '2' and straccountid = @Account
update userdata set nation = '1' where nation = '2' and struserid = @char1
Update userdata set race = '1' where class in ('201','205') and struserid = @char1
Update userdata set race = '2' where race = '12' and class in ('207','211','202','204') and struserid = @char1
update userdata set race = '3' where race = '13' and class in ('204','211') and struserid = @char1
update userdata set race = '4' where class in ('203','209') and struserid = @char1
update userdata set class = '105' where class = '205' and struserid = @char1
update userdata set class = '107' where class = '207' and struserid = @char1
update userdata set class = '109' where class = '209' and struserid = @char1
update userdata set class = '111' where class = '211' and struserid = @char1
update userdata set class = '101' where class = '201' and struserid = @char1
update userdata set class = '102' where class = '202' and struserid = @char1
update userdata set class = '103' where class = '203' and struserid = @char1
update userdata set class = '104' where class = '204' and struserid = @char1
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char1
delete from knights where chief = @char1
delete from knights_user where sidnum = @clannumber1
delete from knights_rating where shindex = @clannumber1
update userdata set knights = 0, fame = 0 where knights = @clannumber1
update userdata set nation = '1' where nation = '2' and struserid = @char2
Update userdata set race = '1' where class in ('201','205') and struserid = @char2
Update userdata set race = '2' where race = '12' and class in ('207','211','202','204') and struserid = @char2
update userdata set race = '3' where race = '13' and class in ('204','211') and struserid = @char2
update userdata set race = '4' where class in ('203','209') and struserid = @char2
update userdata set race = '4' where class = '209' and struserid = @char2
update userdata set class = '105' where class = '205' and struserid = @char2
update userdata set class = '107' where class = '207' and struserid = @char2
update userdata set class = '109' where class = '209' and struserid = @char2
update userdata set class = '111' where class = '211' and struserid = @char2
update userdata set class = '101' where class = '201' and struserid = @char2
update userdata set class = '102' where class = '202' and struserid = @char2
update userdata set class = '103' where class = '203' and struserid = @char2
update userdata set class = '104' where class = '204' and struserid = @char2
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
delete from knights where chief = @char2
delete from knights_user where sidnum = @clannumber2
delete from knights_rating where shindex = @clannumber2
update userdata set knights = 0, fame = 0 where knights = @clannumber2
update userdata set nation = '1' where nation = '2' and struserid = @char3
Update userdata set race = '1' where class in ('201','205') and struserid = @char3
Update userdata set race = '2' where race = '12' and class in ('207','211','202','204') and struserid = @char3
update userdata set race = '3' where race = '13' and class in ('204','211') and struserid = @char3
update userdata set race = '4' where class in ('203','209') and struserid = @char3
update userdata set class = '105' where class = '205' and struserid = @char3
update userdata set class = '107' where class = '207' and struserid = @char3
update userdata set class = '109' where class = '209' and struserid = @char3
update userdata set class = '111' where class = '211' and struserid = @char3
update userdata set class = '101' where class = '201' and struserid = @char3
update userdata set class = '102' where class = '202' and struserid = @char3
update userdata set class = '103' where class = '203' and struserid = @char3
update userdata set class = '104' where class = '204' and struserid = @char3
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
delete from knights where chief = @char3
delete from knights_user where sidnum = @clannumber3
delete from knights_rating where shindex = @clannumber3
update userdata set knights = 0, fame = 0 where knights = @clannumber3
update userdata set knights = 0, fame = 0 where struserid = @char1
update userdata set knights = 0, fame = 0 where struserid = @char2
update userdata set knights = 0, fame = 0 where struserid = @char3
Update knights set vicechief_1 = '' where vicechief_1 = @char1
Update knights set vicechief_2 = '' where vicechief_2 = @char1
Update knights set vicechief_3 = '' where vicechief_3 = @char1
Update knights set vicechief_1 = '' where vicechief_1 = @char2
Update knights set vicechief_2 = '' where vicechief_2 = @char2
Update knights set vicechief_3 = '' where vicechief_3 = @char2
Update knights set vicechief_1 = '' where vicechief_1 = @char3
Update knights set vicechief_2 = '' where vicechief_2 = @char3
Update knights set vicechief_3 = '' where vicechief_3 = @char3
delete from knights_user where struserid = @char1
delete from knights_user where struserid = @char2
delete from knights_user where struserid = @char3
commit tran
GO



NT2


Code:
CREATE procedure [nt2]
@Account char(30)
AS DECLARE @clannumber smallint, @length int,@row int,@i int,@dwid int,@pos int,@dur int,@dur1 int,@ext int,@StackSize1 int,@strName varchar(30),@strExtName varchar(30),@Cdwid varbinary(4),@cdur varchar(2),@cstack varchar(2)
begin tran
declare @char1 varchar(21)
set @char1 = (select strcharid1 from account_char where straccountid = @account)
declare @char2 varchar(21)
set @char2 = (select strcharid2 from account_char where straccountid = @account)
declare @char3 varchar(21)
set @char3 = (select strcharid3 from account_char where straccountid = @account)
declare @clannumber1 smallint
set @clannumber1 = (select idnum from knights where chief = @char1)
declare @clannumber2 smallint
set @clannumber2 = (select idnum from knights where chief = @char2)
declare @clannumber3 smallint
set @clannumber3 = (select idnum from knights where chief = @char3)
update account_char set bnation = '2' where bnation = '1' and straccountid = @Account
update userdata set nation = '2' where nation = '1' and struserid = @char1
Update userdata set race = '11' where class = '105' and struserid = @char1
update userdata set race = '11' where class = '101' and struserid = @char1
Update userdata set race = '12' where race = '2' and class in ('107','111','102','104') and struserid = @char1
update userdata set race = '13' where race = '3' and class in ('104','111') and struserid = @char1
update userdata set race = '13' where class in ('203','209') and race = '4' and struserid = @char1
update userdata set class = '205' where class = '105' and struserid = @char1
update userdata set class = '207' where class = '107' and struserid = @char1
update userdata set class = '209' where class = '109' and struserid = @char1
update userdata set class = '211' where class = '111' and struserid = @char1
update userdata set class = '201' where class = '101' and struserid = @char1
update userdata set class = '202' where class = '102' and struserid = @char1
update userdata set class = '203' where class = '103' and struserid = @char1
update userdata set class = '204' where class = '104' and struserid = @char1
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char1
delete from knights where chief = @char1
delete from knights_user where sidnum = @clannumber1
delete from knights_rating where shindex = @clannumber1
update userdata set knights = 0, fame = 0 where knights = @clannumber1
update userdata set nation = '2' where nation = '1' and struserid = @char2
Update userdata set race = '11' where class = '105' and struserid = @char2
update userdata set race = '11' where class = '101' and struserid = @char2
Update userdata set race = '12' where race = '2' and class in ('107','111','102','104') and struserid = @char2
update userdata set race = '13' where race = '3' and class in ('104','111') and struserid = @char2
update userdata set race = '13' where class in ('203','209') and race = '4' and struserid = @char2
update userdata set class = '205' where class = '105' and struserid = @char2
update userdata set class = '207' where class = '107' and struserid = @char2
update userdata set class = '209' where class = '109' and struserid = @char2
update userdata set class = '211' where class = '111' and struserid = @char2
update userdata set class = '201' where class = '101' and struserid = @char2
update userdata set class = '202' where class = '102' and struserid = @char2
update userdata set class = '203' where class = '103' and struserid = @char2
update userdata set class = '204' where class = '104' and struserid = @char2
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
delete from knights where chief = @char2
delete from knights_user where sidnum = @clannumber2
delete from knights_rating where shindex = @clannumber2
update userdata set knights = 0, fame = 0 where knights = @clannumber2
update userdata set nation = '2' where nation = '1' and struserid = @char3
Update userdata set race = '11' where class = '105' and struserid = @char3
update userdata set race = '11' where class = '101' and struserid = @char3
Update userdata set race = '12' where race = '2' and class in ('107','111','102','104') and struserid = @char3
update userdata set race = '13' where race = '3' and class in ('104','111') and struserid = @char3
update userdata set race = '13' where class in ('203','209') and race = '4' and struserid = @char3
update userdata set class = '205' where class = '105' and struserid = @char3
update userdata set class = '207' where class = '107' and struserid = @char3
update userdata set class = '209' where class = '109' and struserid = @char3
update userdata set class = '211' where class = '111' and struserid = @char3
update userdata set class = '201' where class = '101' and struserid = @char3
update userdata set class = '202' where class = '102' and struserid = @char3
update userdata set class = '203' where class = '103' and struserid = @char3
update userdata set class = '204' where class = '104' and struserid = @char3
update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
delete from knights where chief = @char3
delete from knights_user where sidnum = @clannumber3
delete from knights_rating where shindex = @clannumber3
update userdata set knights = 0, fame = 0 where knights = @clannumber3
update userdata set knights = 0, fame = 0 where struserid = @char1
update userdata set knights = 0, fame = 0 where struserid = @char2
update userdata set knights = 0, fame = 0 where struserid = @char3
Update knights set vicechief_1 = '' where vicechief_1 = @char1
Update knights set vicechief_2 = '' where vicechief_2 = @char1
Update knights set vicechief_3 = '' where vicechief_3 = @char1
Update knights set vicechief_1 = '' where vicechief_1 = @char2
Update knights set vicechief_2 = '' where vicechief_2 = @char2
Update knights set vicechief_3 = '' where vicechief_3 = @char2
Update knights set vicechief_1 = '' where vicechief_1 = @char3
Update knights set vicechief_2 = '' where vicechief_2 = @char3
Update knights set vicechief_3 = '' where vicechief_3 = @char3
delete from knights_user where struserid = @char1
delete from knights_user where struserid = @char2
delete from knights_user where struserid = @char3
commit tran
GO


If someone fixes them please post the fix here, for everyone else..

And

Thanks in advance.
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

it's entirely php based you don't need any stored procs..
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

it's entirely php based you don't need any stored procs..

Ahh lol I got my scripts mixed up, Im no php pro btw.

I see this when I click confirm 'All chars must be logged out first' and I am logged out.

Maybe I edited out the kill user wrong?


Thanks again for your no hostile reply bro. :)
 
Last edited:
Experienced Elementalist
Loyal Member
Joined
Jun 11, 2006
Messages
214
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

hey blade this script missing someting when i try to add to my panel get this
index.php?act=NationTransfer&Confirmed=1 and action can't be found can't be found?
 
Retired Old Man
Loyal Member
Joined
Jun 9, 2008
Messages
761
Reaction score
706
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

useful (Y)
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

hey blade this script missing someting when i try to add to my panel get this
index.php?act=NationTransfer&Confirmed=1 and action can't be found can't be found?

Script isn't missing anything, looks like you put it in the functions directory? It's not a sub script run it from the root dir. Should be fine then, check you saved it as NationTransfer.php too lol.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

I still getting

'All characters must be logged out of the game first!'

Im not even logged in
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

Remove that section of code it's not vital. Or var_dump me the result of $online and i'll mod the code. I quickly edited it to remove the killuserandwait code used on the SNOXD panel.
 
Experienced Elementalist
Loyal Member
Joined
Jun 11, 2006
Messages
214
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

okay switched like u said but still get action not found index.php?act=NationTransfer&Confirmed=1
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

Wierd

Why is the script looking in table TB_USER for this information:

$check3 = odbc_exec($connect, "SELECT SUM(Loyalty) AS nps FROM TB_USER WHERE Nation='" . $desiredNation . "'");
$check4 = odbc_exec($connect, "SELECT SUM(Loyalty) AS totnps FROM TB_USER");


Surley that is wrong as the only table that contains any data for Loyalty is USERDATA.

Also, after Fixing the 'All charaters need to be offline error!' Its also now throwing up 'All chars need to be clanless'
 
Initiate Mage
Joined
Jun 24, 2008
Messages
2
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

can u tell how add it to panel and how use? it say Action not founded :S i think should add to functions but i dont know the code?
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

can u tell how add it to panel and how use? it say Action not founded :S i think should add to functions but i dont know the code?

Add the script to your panel base, then edit Users.php and Skins/Default/Main.php.
 
Newbie Spellweaver
Joined
Dec 3, 2006
Messages
42
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

Advocate as lollipop said that's how you fix that one. To fix the users online(I can't believe I didnt notice that before) just put $online != 0
As for clanless that could be due to the columns being different in 1299 ? It's a 1299 script which is also the reason for the issue you posted above.Although in 1098 I don't recall any np data in TB_USER so I can't remember why I did that :p.
If the columns are correct for the clan part try making it trim($knights) but that wasn't modified when I edited it and did used to work so not really much I can say about that.

I don't have a DB setup here atm since I haven't written any of the DB stuff for snoxd panel yet.. only the template engine, skin engine, db wrapper and session engine.. Tweaking those and finishing the theme mod before I begin with the game specific scripts as we're probably gonna use this base on all of our private servers.
 
Experienced Elementalist
Joined
Aug 18, 2007
Messages
204
Reaction score
0
Re: [Share][PHP][KO Panel] Nation Transfer Script (SNOXDKO)

Ok script is working for me, but have bugs with mage class just to let you know..
 
Back
Top