Jump to content
  • 0

question EXE lin...


Question

Posted

Hi to all! I found an article here in the explained forum as add adena in char. I tried to make with another one procedure that I found. more it is generating an error….  could speak to me where is the error? I go to post scripts to facilitate.

 

precedure: lin_BetaAddItem

 

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

GO

 

/****** Object:  Stored Procedure dbo.lin_BetaAddItem    Script Date: 2003-09-20 ?? 11:51:56 ******/

ALTER PROCEDURE [dbo].[lin_BetaAddItem] 

(

@char_id int,

@Item_type int,

@amount int

)

AS

 

SET NOCOUNT ON

 

DECLARE @tempRowCount INT

DECLARE @bIsStackable TINYINT

SELECT @bIsStackable = IsStackable FROM ITEMNAME WHERE id = @Item_type

 

If @bIsStackable Is NULL

Begin

RAISERROR ('Not exist Item Type', 16, 1)

End

Else

Begin

If @bIsStackable = 1

Begin

Update user_item set amount = amount + @amount  where item_type = @Item_type and char_id = @char_id

Set @tempRowCount = @@ROWCOUNT

If @tempRowCount = 0

INSERT INTO user_item (char_id, item_type, amount, enchant, eroded, bless, ident, wished, warehouse) VALUES (@char_id, @Item_type, @amount, 0,0,0,0,0,0)

End

Else If @amount = 1

Begin

INSERT INTO user_item (char_id, item_type, amount, enchant, eroded, bless, ident, wished, warehouse) VALUES (@char_id, @Item_type, @amount, 0,0,0,0,0,0)

Set @tempRowCount = @@ROWCOUNT

End

Else

Begin

RAISERROR ('Amount is invalid', 16, 1)

End

End

 

If @tempRowCount Is NOT NULL

Select @tempRowCount

 

 

 

==================

script PHP

 

<?
session_start();
$mssql_host = '127.0.0.1';
$mssql_user = 'sa';
$mssql_pass = '';
$store_cashier = array('local'=>"127.0.0.1", 'pc2'=>"192.168.0.1");

$store = "";

foreach ($store_cashier as $key=>$value) {
$rip = $_SERVER['REMOTE_ADDR'];
if ($rip == $value) { $store = $key; } 
}

if ($store != "") {
$_SESSION['store'] = $store;
} else {
die("You are not permitted to view this page, actually who gave you this url?");
}

function antiinjection($str) {
$banwords = array ("'", ",", ";", "--");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
	$str = str_replace ( $banwords, '', strtolower ( $str ) );
} else {
	$str = NULL;
}
return $str;
}
?>
<html>
<head>
<title>Lineage II Adena Managment</title>
<style>
.style1 {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:14px;
}
.formPaneGeneral {
font: normal 12pt/10px Verdana, sans-serif;
background:#F2FDFF;
border: 1px groove #6600FF;
vertical-align: middle;
}
.formButtonGeneral {

font: 9pt/10pt Verdana, sans-serif;
color:#333333;
background:#F2FDFF;
border: 1px solid #666666;
}

.border {
border: 1px groove #000000;
}
</style>
</head>
<body topmargin="150" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="#CCCCCC">
<div align="center">
<table cellpadding="0" cellspacing="0" border="1" bgcolor="#FFCC33">
<tr>
	<td align="center" bgcolor="#000000">
	<font face="Geneva, Arial, Helvetica, sans-serif" size="+1" color="#FFFFFF">ADENA MANAGMENT</font>		
	</td>
</tr>
<tr>
	<td>
<form name="addadena" method="post" action="addadena.php">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
	<td align="center" colspan="2" bgcolor="#FFCC99" class="border">
<?
$error = 0;
$noname = FALSE;
$noamount = FALSE;

if ($_POST['action']) {

if ($_POST['charname']) { $character_name = antiinjection($_POST['charname']); }
else { echo "<font face=\"Times New Roman, Times, serif\" color=\"#FF0000\">- Please insert a character name</font>
"; $error=1; $noname = TRUE; }

if ($_POST['item_type']) { $item_type = antiinjection($_POST['item_type']); }
else { echo "<font face=\"Times New Roman, Times, serif\" color=\"#FF0000\">- Please insert a item id</font>
"; $error=1; $noitem = TRUE; }


if ($_POST['amount']) { $amount = antiinjection($_POST['amount']); }
else { echo "<font face=\"Times New Roman, Times, serif\" color=\"#FF0000\">- Please insert adena amount</font>
"; $error=2; $noamount = TRUE; }
}

if (($error == 0) && $_POST['action']) {

$connection = mssql_connect($mssql_host,$mssql_user,$mssql_pass);
if ($connection) {
	mssql_select_db('lin2world',$connection); 
	$query = mssql_query("EXEC lin_BetaAddItem '$character_name', $item_type, $amount");
	$arr = mssql_fetch_array($query);
	$last_msg = mssql_get_last_message();
	if (empty($last_msg) && empty($arr['amount'])) {
		echo "<font face=\"Times New Roman, Times, serif\" color=\"#FF0000\">Account does not exists</font>";
		mssql_close($connection);
	} else if(empty($arr['amount'])) {
		echo "<font face=\"Times New Roman, Times, serif\" color=\"#FF0000\">-$last_msg</font>";
		mssql_close($connection);
	} else {
	echo "<font face=\"Times New Roman, Times, serif\" color=\"#0000FF\">{$amount} adena added to $character_name
Total: {$arr['amount']} adena</font>"; }
	mssql_close($connection);
} else { 
	echo "Can't connect to the database"; }
}

?>
	</td>
</tr>
<tr>
	<td align="right" height="30">
	<span class="style1"> <? echo ($noname?"<font color=\"#FF0000\">Character Name</font>" : "Character Name"); ?></span>
	</td>
	<td align="left" width="150">
	<input type="text" name="charname" size="15" maxlength="15" class="formPaneGeneral" value=<? echo ($_POST['charname'] ? $_POST['charname'] : "" ); ?> >
	</td>
</tr>
<tr>
	<td height="5">
	</td>
</tr>

<tr>
	<td align="right" height="30">
	<span class="style1"> <? echo ($noitem?"<font color=\"#FF0000\">Id Item</font>" : "Item Type"); ?></span>
	</td>

<td align="left" width="150">
	<input type="text" name="item_type" size="15" maxlength="15" class="formPaneGeneral" value=<? echo ($_POST['item_type'] ? $_POST['item_type'] : "" ); ?> >
	</td>
</tr>
<tr>
	<td height="5">
	</td>
</tr>

<tr>
	<td align="right">
	<span class="style1"><? echo ($noamount?"<font color=\"#FF0000\">Adena amount</font>" : "Adena amount"); ?></span>
	</td>
	<td align="left">
	<input type="text" name="amount" size="15" maxlength="15" class="formPaneGeneral" value=<? echo ($_POST['amount'] ? $_POST['amount'] : "" ); ?>>
	</td>
</tr>
<tr>
	<td>

	</td>
	<td align="left" height="30">
	<input type="submit" name="submit" value="Add Item" class="formButtonGeneral">
	<input type="hidden" name="action" value="action">
	</td>
</tr>
</table>
	</td>
</tr>
<tr>
	<td height="15" bgcolor="#000000">
	</td>
</tr>
</table>
</form>
</div>
</body>
</html>

 

thanks a lot to all

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • I wouldn't expect something less, since you work with Psadek (or I maybe mistake you with NightW0lf from itopz, in that case soz) Let's throw rocks at Java Golds and elevate "original L2OFF Golds", no?
    • We are delighted to announce our partnership with the leading resource, Active Anticheat, specializing in protection against bot programs, clickers, and additional modules for the game client that enhance the experience for both you and the players!   When you purchase Active Anticheat for our product, you will also receive a $50 discount.   Here's a brief overview of the features of Active Anticheat: Best protection against bots, including private and premium versions. Window limitation. HWID spoofing protection. Virtual machine protection. File hash protection for client files, preventing players from modifying them (e.g., interface files). Encryption of any game files. Integration with Discord to attract new players! Additional plugins: - Window with saved player logins/passwords. Players no longer need to enter them every time! - HWID sending to the game server. - Game window optimizer for quick switching. - Background FPS adjustment. - Window name customization in the format "%character_name% - %server_name%". - Ctrl+C/V permission. - Login and password saving (for Interlude -> High Five). - Launching the browser via server packets. - Launching interface events via server packets. - Interlude: fixing a known game bug (History: UpdateAnimation <- AActor::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- UGameEngine::Tick <- UpdateWorld <- MainLoop). - Interlude: debuff feature. 9) All of this is available without modifying the game server code (some plugins may require minor changes). Take note of newest plugin, which is highly useful: Guides section
    • The Lucera2 Multiprotocol is an advanced server branch for Lineage 2 that enables seamless support for multiple client versions on a single server instance. This allows players to connect and play using either the legacy (old) client or the newer Classic client simultaneously, without any compatibility issues or loss of functionality. Key Benefits Dual Client Support: Both the old Interlude client and Classic: Secret of Empire 2.6 client can run concurrently on the same server. All features from the Classic client (e.g., enhanced UI, new mechanics) remain fully available, while the old client retains its alternative features (e.g., simplified interfaces for lower-end hardware). Expanded Player Base: Ideal for regions with limited access to modern gaming setups, as it accommodates a wider range of devices and preferences, merging Legacy and Classic communities into one forum section for unified discussions. No Functionality Gaps: Extensive testing ensures zero disruptions—players on either client experience complete game integrity, including quests, PvP, raids, and custom Lucera2 subsystems. You can fully test and explore all aspects of Multiprotocol on the dedicated Test Server. Supported Protocols C6 (Old Client): Protocol versions 740–770. Classic Client (Secret of Empire 2.6): Protocol versions 166–192.
    • Connect to the server you need to >>>download<<< game client launch from /system_en/. Login server setup on auto registration, admin rights in game by default . Or you can use a patch specifying the l2.ini Connect to address classic.lucera2.com if you already have a game client Download updated patch All major/minor subsystems operate in a proper view. Absolutely ready to combat the server.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock