![]() |
|
|
#1 |
|
Архивный участник
Join Date: Oct 2005
Posts: 267
|
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 |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
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
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Apr 2005
Posts: 354
|
lol thats funny.
How would you do that? :P |
|
|
|
|
#4 | |
|
Архивный участник
Join Date: Jul 2005
Posts: 41
|
Quote:
GREAT work will beпамятник при жизни надо будет ставить, и премию дарвина подарить. |
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Apr 2005
Posts: 357
|
this adds more lags to npc server ))
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Oct 2005
Posts: 267
|
well thanks for the spam in my post. Dont bother posting a reply if you dont have anything useful to say.
Thanks |
|
|
|
|
#7 |
|
Архивный участник
Join Date: Sep 2005
Posts: 72
|
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? |
|
|
|
|
#8 |
|
Архивный участник
Join Date: May 2005
Posts: 216
|
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] |
|
|
|
|
#9 |
|
Архивный участник
Join Date: Oct 2005
Posts: 267
|
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.
|
|
|
|
|
#10 |
|
Архивный участник
Join Date: Sep 2005
Posts: 731
|
Isogames can have autoloot but don't know how they do it !!! There has got to be a solution for this !!!
|
|
|
|
|
#11 |
|
Архивный участник
Join Date: Aug 2005
Posts: 42
|
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] |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|