Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 12.10.2005, 02:27   #1
Firedaemon
Архивный участник
 
Join Date: Oct 2005
Posts: 267
Default Auto Loot Possible?

Hello,

This is my first question here on Post Pacific and I am a newbie here; but not a newbie when it comes to L2 servers. I will probably be making many contributions here and sharing some of my other contributions I have made at RZ and etc.

I cannot seem to find any information though on implimenting an automatic loot system, or at least getting unowned items to be removed out of the game after a certain amount of time.

Since I assume nobody has done this yet, I will ask two questions.

First, am I wrong in assuming nobody has done it?

Second, I have tried deleting unowned items from the mssql db but cached seems to never update with whats in the database until restart. Have any of you tried to clear drops off the server while the game server is still running? Any known solutions?

I did try search on multiple resource sites and couldnt find anything.

Thanks in advance
Firedaemon is offline  
Old 12.10.2005, 02:43   #2
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

yes u could add the drop inside ai and give it to the last one who hit the mob. but u will be all ur life doing that
Sauron is offline  
Old 12.10.2005, 03:13   #3
Enishi
Архивный участник
 
Join Date: Apr 2005
Posts: 354
Default

lol thats funny.
How would you do that? :P
Enishi is offline  
Old 12.10.2005, 03:54   #4
tigra
Архивный участник
 
Join Date: Jul 2005
Posts: 41
Default

Quote:
Originally Posted by Enishi
lol thats funny.
How would you do that? :P
moving corpse_make_list and additional_make_multi_list to ai GREAT work will be

памятник при жизни надо будет ставить, и премию дарвина подарить.
tigra is offline  
Old 12.10.2005, 04:54   #5
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default

this adds more lags to npc server ))
RmzVoid is offline  
Old 12.10.2005, 06:08   #6
Firedaemon
Архивный участник
 
Join Date: Oct 2005
Posts: 267
Default

well thanks for the spam in my post. Dont bother posting a reply if you dont have anything useful to say.

Thanks
Firedaemon is offline  
Old 13.10.2005, 03:00   #7
Ugmak
Архивный участник
 
Join Date: Sep 2005
Posts: 72
Default

might be a dumb question but im a noob at mssql, or any sql for that matter. I noticed when cached starts up that it clears unkown items. Is there a way to make a sql script that deletes all unowned items every 2 hours? tough luck for drop traders learn to use the freight, and if someone died doh shit happens, maybe next time they will learn to loot there drops lol.

anyways is there anyway to write a script liek this for cached d?
Ugmak is offline  
Old 13.10.2005, 21:54   #8
BiGBoY
Архивный участник
 
Join Date: May 2005
Posts: 216
Default

This was my attempt for clear unowned items trough cached but without good success :/

[php:1:af43487e00]<?php
require "config.php";

$str = "EXEC lin_DeleteNotOwnedItem";

$fp = fsockopen($CONFIG['dbaddress'], 2009, $errno, $errstr);
if(!$fp)
{
echo("Error: $errstr ($errno)");
return(0);
}
fwrite($fp, $str);
stream_set_timeout($fp, 2);
$ret = fgets($fp,8);
fclose($fp);

echo("Cleared, check the CacheD
RET: ($ret)");
?>[/php:1:af43487e00]
BiGBoY is offline  
Old 26.10.2005, 06:03   #9
Firedaemon
Архивный участник
 
Join Date: Oct 2005
Posts: 267
Default

There is actually a stored procedure in MSSQL that cached runs to clear all the unowned items. However, cached does not update itself until next restart so even if you clear the unowned items, those items are still cached in cached until cached is restarted again.
Firedaemon is offline  
Old 26.10.2005, 08:28   #10
TheOrder
Архивный участник
 
Join Date: Sep 2005
Posts: 731
Default

Isogames can have autoloot but don't know how they do it !!! There has got to be a solution for this !!!
TheOrder is offline  
Old 26.10.2005, 16:02   #11
montejo1974
Архивный участник
 
Join Date: Aug 2005
Posts: 42
Default

Yes, here I can contribute....hehe
Well maybe something like this do what you want.

Note that I write that on the reply directly....so it has syntax errors for sure, and need some more work....its only an idea....If more people think is useful I'll write one correctly and test it for sharing




[php:1:739b74f1fb]<meta http-equiv="refresh" content="36000">
<?php

$ip = "localhost";
$port = "2009";
$conn = mssql_connect ("127.0.0.1", "user", "passwrod");
$db = mssql_select_db ("lin2world");
$sql = "select item_id from user_item where char_id=0 and ...";
$result=mssql_query($sql);
while($row=mssql_fetch_array($result)){
$com="54;".mssql_result($row, 0,0);
$mess = "Command: <font color=yellow> deleting not owned item ".mssql_result($result, 0,0)."</font>
";
$fp = fsockopen($ip, $port, $errno, $errstr);
if (!$fp)
{
$mess .= "Error: <font color=red>$errstr ($errno)</font>";
}
else
{
$out = str_replace(";", "\t", $com)."\r\n";
fwrite($fp, $out);
stream_set_timeout($fp, 2);
$answ = fgets($fp, 8);
if ($answ == 1 and strlen($answ) == 1)
{
//Do a list of the items to eliminate from the DB later
}
else
{
$mess .= "<font color=red>Error deleteing item_id".mssql_result($result, 0,0)."</font>";
}
fclose($fp);
}
}
}
echo $mess;
//Eliminate from the DB the items listed above
?>[/php:1:739b74f1fb]
montejo1974 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 18:04.