Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [SHARE] L2J -> OFF converters pack (https://postpacific.loc-online.com/showthread.php?t=4765)

hel 09.06.2006 19:44

[SHARE] L2J -> OFF converters pack
 
Converters pack 1.1 released.
--------
Version 1.1:
added droplist converter (create off-like droplist for each mob, you need install a db 'itemname' to database (setted up to $dbname), you may download db 'itemname' from https://postpacific.loc-online.com/f...pic.php?t=4992 (Thanks for Firedaemon).
fixed $step bug on all scripts (thanks for Bruenor).
fixed set_time_limit(30) to set_time_limit(0) and small mistakes on all scripts (thanks for RipperX)
--------
Version 1.0:
fixed npcpos converter (Gets npc names from npc table l2jdb, autogenerate territory for each mob, autodeletion empty territorries).
added petdata converter.
added skillacquire converter (Gets class_ids from class_list table l2jdb, smart placing learn spellbooks by using skill_spellbooks table checking, also create itemdata for spellbooks).

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
l2j_to_off_converters_pack_1.1_217.zip — 9314 байт
drops_112.zip — 95727 байт

SImon 09.06.2006 20:28

Пасиб.Глянем

hel 09.06.2006 20:35

Oh, my mistake:
In skillacquire.php change it:
$sbname="[sb_".$skillname."];1";
To:
$sbname="{[sb_".$skillname."];1}";

NN4e 09.06.2006 23:00

Nice tools
check PM ;)

nick0179 10.06.2006 05:11

hmm.....how can i use this tool?
anyway thanx for sharing......hel~

Validator 10.06.2006 05:47

share last j server for this

RipperX 10.06.2006 05:54

tip to hel:

[php:1:3db66e0707]<? set_time_limit(0); ?>[/php:1:3db66e0707] =)

Edit: Add RaidBoss Spawn =)

NN4e 10.06.2006 06:03

Quote:

Originally Posted by Validator
share last j server for this

Why your cant download last datapack yourself?
h..p://l2jdp.com/nightly/

hel 10.06.2006 06:27

RipperX:
Thanks for tip, I was searched this string by hour in the php manual (www.superbest.ru) and finded nothing. :)
I'll add it in the next version of my pack.
---
Why peoples isn't report, works it, or not? :(
It's just not interesting. :P

RipperX 10.06.2006 06:50

Quote:

Originally Posted by hel
RipperX:
Thanks for tip, I was searched this string by hour in the php manual (www.superbest.ru) and finded nothing. :)
I'll add it in the next version of my pack.
---
Why peoples isn't report, works it, or not? :(
It's just not interesting. :P

In respawn section add "sec".

For example:

[php:1:bb0c09070c]
.$row["respawn_delay"]."sec npc_end\r\nnpcmaker_end\r\n");} [/php:1:bb0c09070c]

and This not work, I get an error.

Code:

06/10/2006 03:47:xx.xx1, -_- goblin  (2621952)
i don't know what is it.

hel 10.06.2006 07:28

Sec mistake solved. Thanks.
I don't have any idea about "goblin error". :(
You have switched txt to unicode?

RipperX 10.06.2006 07:32

Quote:

Originally Posted by hel
Sec mistake solved. Thanks.
I don't have any idea about "goblin error". :(
You have switched txt to unicode?

yeah, i think maybe it's a ram problem. but this load 120 npcs and crash.

katso 10.06.2006 17:59

I have a problem with this pack, with previous run without problems, but to this when I press “next” so that it makes the conversion, nothing happens. From already thanks, Hel.

<spanish>Tengo un problema con este pack, con el anterior lo corria sin problemas, pero con este cuando presiono "next" para que realice la conversion, no sucede nada. Desde ya gracias Hel.</spa>

hel 10.06.2006 18:07

katso:
As Bruenor says:
Quote:

Originally Posted by Bruenor
You need to insert the following text after "include('config.php');" in npcpos.php (skillacquire.php and petdata.php):
Code:

if(isset($HTTP_GET_VARS['step']))
  $step = intval($HTTP_GET_VARS['step']);
else
  $step = 0;

if(isset($HTTP_GET_VARS['page']))
  $page = intval($HTTP_GET_VARS['page']);
else
  $page = 1;

Also, you should make sure your permissions are set such that the directory is writable by your web server.


katso 11.06.2006 00:45

very thx, hel.

javas 11.06.2006 06:01

Nice share !

hel 11.06.2006 22:42

First post updated, new pack released.
Added new converter, fixed older.
Let's test it and report here. ;)
Also C4 drops.txt, converted by droplist converter 1.0 added to first post.

hel 12.06.2006 07:49

Half day with no comments and only 3 downloads?
I may stop the project, if no one is interested. -_-

mcrabben7 12.06.2006 09:59

I think the project is a good idea. I personally don't feel I want to convert L2J data at the moment, but it doesn't mean it's a bad project.

Bruenor 12.06.2006 21:42

I found another bug. Where the website says "you need install a db 'itemname' to database (setted up to $dbname)", I'm not sure whether you meant to display '$dbname' or the name of the database.
In the first case, insert a \ before the $ to prevent it from being treated as a variable name.
In the second case, insert include("config.php"); before the echo statement. (Although it is already included in the PAGE_DEFAULT function, it isn't visible elsewhere. I tried moving the include statement to the top of the file, but then it wasn't visible inside PAGE_DEFAULT, so apparently you have to put it in both places.)

I also found some more problems related to the fix I posted earlier:
1) Variables do not get assigned a default value when they are first referenced. If you have not previously assigned a value to a variable, trying to get its value results in an error.
2) Sending parameters in the URL does not assign the specified values to your variables. For example, the URL "http://mysite.com/index.php?MyVar=4" does NOT set $MyVar to 4. To get the parameter, use $HTTP_GET_VARS['MyVar'], as demonstrated in my previous post.

You moved the code for setting the variables into PAGE_DEFAULT but then called the function after the value of $page is checked. I think the best way to resolve this is to just move
Code:

if(isset($HTTP_GET_VARS['step'])) $step=intval($HTTP_GET_VARS['step']); else $step=0;
if(isset($HTTP_GET_VARS['page'])) $page=intval($HTTP_GET_VARS['page']); else $page=0;

out of PAGE_DEFAULT and put it before "if($page==0)". (This applies to petdata.php, droplist.php, npcpos.php, and skillacquire.php.)

Here are some more fixes:
skillacquire.php line 72
Code:

if(isset($skill_book_id[$sid]) and $skill_book_id[$sid]==$sid) {
skillacquire.php before line 54
Code:

$num=0; $cid2=0; $classname_end="";
droplist.php line 65
Code:

$spoil_chance=$drops_row["chance"]/10000;
npcpos.php line 44
Code:

if($step=="2") $query="SELECT * FROM spawnlist ORDER BY npc_templateid LIMIT 20001,1000000000";

RipperX 12.06.2006 22:21

Tip: Add a multiplier to make drops with rates :]

madar 13.06.2006 10:20

tyvm hel for this tools

hel 16.06.2006 17:55

Bruenor:
1. "$dbname" not interpretted as variable. (only if I set it like " ".$dbname." ")
2. I don't understand, what you mean about moving include('config.php');. :(

1. You mean, I must set default values for variables?
2. Thanks, I see. :P

1.
Quote:

if(isset($skill_book_id[$sid]) and $skill_book_id[$sid]==$sid)
For what? Is this a checking for empty results?
2.
Quote:

$num=0; $cid2=0; $classname_end="";
Understand, thanks. :)
3.
Quote:

$spoil_chance=$drops_row["chance"]/10000;
Oops, my mistake.
4.
Quote:

if($step=="2") $query="SELECT * FROM spawnlist ORDER BY npc_templateid LIMIT 20001,1000000000";
I think better is setting up 2001,-1. For infinite. ;)

Very big thanks in advance. You're help me a lot.
Waiting for your reply. :P

2All
I'm noob in php. So don't wait bigger, than I know. :P
Pack1.1 reuploaded!

Bruenor 16.06.2006 20:01

All of the corrections that I posted were fixes to error messages that I got.


Quote:

Originally Posted by hel
"$dbname" not interpretted as variable. (only if I set it like " ".$dbname." ")

This confuses me. The dollar sign forces php to treat the word following it as a variable, so I don't understand how it's being interpreted as text for you.


Quote:

Originally Posted by hel
I don't understand, what you mean about moving include('config.php');.

I was just talking about things I tried doing so that only one "include ('config.php');" would have to appear in the file. The text within the parentheses there wasn't very important.


Quote:

Originally Posted by hel
You mean, I must set default values for variables?

That is correct. It's the reason for most of the corrections that I posted. I'm not sure if the php interpreter you use automatically initializes variables to 0 or "", but mine doesn't, and I'm sure it's the same for other people.


Quote:

Originally Posted by hel
For what? Is this a checking for empty results?

I was getting an error message each time php came across a $skill_book_id[$sid] that wasn't initialized. Checking to see if has been initialized prevents the error message. (Operators in php use short-circuit evaluation. If isset($skill_book_id[$sid]) is false, then $skill_book_id[$sid]==$sid never gets evaluated.)


Quote:

Originally Posted by hel
I think better is setting up 2001,-1. For infinite.

That doesn't work for me. The php interpreter I use does not treat -1 as infinite, so it gives an error message because the second number is smaller than the first.


Maybe the problem is just that I'm using an old version of php, but it's better to program things for the greatest compatibility. :wink:

hel 16.06.2006 20:34

I use PHP 4.3.8 + Zend Engine v1.3.0.

I see...
Thanks for replies. I'll fix this things, when I can do it.

andrei1516 16.06.2006 21:17

Мла, ошибки вообше не вылезает, но и не делается ни фига... не подскажешь что это такое а ??? HEL

Bruenor 16.06.2006 21:38

I have PHP version 5.1.1, which uses Zend Engine version 2.1.0. I guess the newer version is stricter than the older version. At least the new version caught a mistake that yours missed. :)

hel 16.06.2006 21:41

andrei1516:
Хз.
А какой скрипт косячит?
/to eng. public
Quote:

~~~quote from andrei1516:
I don't have any errors, but it's not working for me.
Not know, tell me name of not working script.

hel 16.06.2006 21:50

RipperX:
Working... :)

Bruenor:
I've question for you...
I need a code for getting result, entered in textbox, and setting it to $variable. For rate multiplier of course. :P
I completely not understand how to do it.

Bruenor 16.06.2006 22:14

I don't know much about it, either, but here's the result of my research:

HTML for the input box:
Code:

<input type="text" style="width: 300px" class="post" name="inputValue" size="30" />
To retrieve the value in PHP:
Code:

$inputValue = $HTTP_POST_VARS['inputValue'];
I hope this will work for you. :)

hel 16.06.2006 22:22

Thanks! Of course it help me a lot.

jtomasrl 17.06.2006 16:05

omg i cant make this work :S
in "For begin converting click next"
i click in NEXT and nothing happends :S

Bruenor 17.06.2006 17:32

If you apply the fixes that I posted, it should work. :wink:

Phantom2005 19.06.2006 19:05

perfect script, couldn't have done it better myself.. but i think you should add one more thing to npcpos:

[php:1:c0c8350926]
fputs($npcpos,"territory_begin [".$row["location"]."] {"
[/php:1:c0c8350926]
to
[php:1:c0c8350926]
fputs($npcpos,"territory_begin [".$row["location"]."".$row["id"]."] {"
[/php:1:c0c8350926]
and
[php:1:c0c8350926]
.$row["location"]."]\r\nnpc_begin ["
[/php:1:c0c8350926]
to
[php:1:c0c8350926]
.$row["location"]."".$row["id"]."]\r\nnpc_begin ["
[/php:1:c0c8350926]

(else errors will appear when you load l2npc.. because every territory has to be identical)

hel 19.06.2006 19:09

Thanks, Phantom2005.
In the next release. Will soon... ;)

Shraier 20.06.2006 21:01

hmm, weird error in npcpos...

when I click "next", this appears

Converted positions count: 20000.
Failed to get info from DB.

any ideas?

hel 20.06.2006 21:52

I think, second query ("SELECT name FROM npc where npc.id=$npc_t") not completed by script, because it table, or some rows corrupted. (tables needed for npcpos - 'spawnlist' and 'npc')
Check table 'npc' manually.

Phantom2005 26.06.2006 13:26

It's a kind of a good idea so i thought about adding another one:
Castle Siege Guards generator :)

You'll need castle+castle_siege_guard+npc table from l2j for this one.

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
castle_siege_guards_959.rar — 1547 байт

JimiHendrix 27.06.2006 01:47

I appreciate your work
 
I can't help being grateful for not having to start from scratch. THX!

hel 27.06.2006 09:53

Phantom2005:
Thanks for tip. ;)
I paused a project, because I simply busy at this moment.
I think, I'll be free in 2 weeks.
And, I think, my converters needed by someones. :)


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