PDA

View Full Version : Auto Loot Possible?


Firedaemon
12.10.2005, 02:27
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

Sauron
12.10.2005, 02:43
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

Enishi
12.10.2005, 03:13
lol thats funny.
How would you do that? :P

tigra
12.10.2005, 03:54
lol thats funny.
How would you do that? :P

moving corpse_make_list and additional_make_multi_list to ai ;) GREAT work will be

памятник при жизни надо будет ставить, и премию дарвина подарить.

RmzVoid
12.10.2005, 04:54
this adds more lags to npc server ))

Firedaemon
12.10.2005, 06:08
well thanks for the spam in my post. Dont bother posting a reply if you dont have anything useful to say.

Thanks

Ugmak
13.10.2005, 03:00
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?

BiGBoY
13.10.2005, 21:54
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]

Firedaemon
26.10.2005, 06:03
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.

TheOrder
26.10.2005, 08:28
Isogames can have autoloot but don't know how they do it !!! There has got to be a solution for this !!!

montejo1974
26.10.2005, 16:02
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]