Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 General
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 14.02.2006, 05:50   #1
Firedaemon
Архивный участник
 
Join Date: Oct 2005
Posts: 267
Default [SHARE] Create Strider/Pet from PHP

The script is rather simple. It is configured to work with creation of a Stryder but really you can use it for any pet type.

[php:1:140b734d0a]
<?php

$char_name = '';
$itemid = 4423;
$enchant = 71;
$npcid = 1012527;
$exp = 70853089;
$hp = 14303;
$mp = 1714;
$meal = 6670;

$con = mssql_connect(, , );

if ($con)
{
$db = mssql_select_db ('');

$query = "
SELECT
char_id
FROM
user_data
WHERE
char_name='".$char_name."'
";

$result = mssql_query($query);
$char = mssql_fetch_assoc($result);
$char_id = $char['char_id'];

$query = "INSERT INTO
[user_item](char_id,item_type,amount,enchant,eroded,bless,ide nt,warehouse)
VALUES(".$char_id.",".$itemid.",1,".$enchant.",0,0 ,0,0)
SELECT
@@IDENTITY
AS
insert_id";

$result = mssql_query($query);

$pet_item = mssql_fetch_assoc($result);

if ($pet_item['insert_id'])
{
$query = "INSERT INTO
[pet_data](pet_id,npc_class_id,expoint,nick_name,hp,mp,sp,me al,slot1,slot2)
VALUES(".$pet_item['insert_id'].",".$npcid.",".$exp.",'',".$hp.",".$mp.",0,".$mea l.",'','')";

$result = mssql_query($query);

echo "Strider Insert Completed for CHAR_ID ".$char_id;
}
else
{
echo "Fatal Error: Did not retrieve the insert ID for item.";
}

sleep(60);
}



?>
[/php:1:140b734d0a]
Firedaemon is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 23:37.