Форум Властелин Колец Онлайн™  

Вернуться   Форум Властелин Колец Онлайн™ > База знаний > Плагины (LUA скрипты)


Ответ
 
Опции темы Опции просмотра
  #21  
Старый 28.08.2013, 22:42
Аватар для bobbisson
bobbisson bobbisson вне форума
Гроза Ангмара
Переживший конец света 
 
Регистрация: 09.10.2008
Сообщений: 702
Post Как линковать скалируемые предметы в чат?

Цитата:
Сообщение от PulseDiver Посмотреть сообщение
сейчас лут в новых инстах получается автоматом каждому, без ролла, как только открываешь сундук или убиваешь моба\босса
т.е содержимое сундука не видно
Так в момент получения можно его из общего чата забирать, или из листа ожидания – если сумки переполнить.
Ответить с цитированием
  #22  
Старый 29.08.2013, 02:53
Аватар для Equendil
Equendil Equendil вне форума
Путник
Переживший конец света 
 
Регистрация: 23.05.2013
Сообщений: 7
Post Как линковать скалируемые предметы в чат?

I've uploaded all the encoding/compression code, see the thread on lotro.com:

[Ссылки могут видеть только зарегистрированные пользователи. ]

Do note that I have not tested the stripped code (codec.lua) and may have made mistakes. That's all I can do right now without spending time in game (time that I don't have right now). Hopefully someone will find it useful.

Sorry again for the English.

Edit/PS: I have been sniffing all chats on my server for relatively long times while I was working on the next version of LIP, both for legendary and regular items, and I'm actually very confident it's impossible(*) to extract stats directly from item links. I have only ever seen (two handed) LIs with stats attached to them in links, and that's only in the form of IDs (as in ' 60 strength' and ' 63 strength' have different IDs). On all other items, stats of any sort seem to be inferred from the generic item ID. I believe the only reason stats are found in 2h LIs is because those stats vary randomly from one LI to another.

(*) 'Impossible' : An engineer's lie to management meaning "extremely difficult but you'll just say: 'do it' if I say that". Ultimately, one could extract data from the game files.
Ответить с цитированием
  #23  
Старый 29.08.2013, 12:30
Аватар для bopozhej
bopozhej bopozhej вне форума
Щит Миробеля
За помощь локализаторам За отличную работу в преддверии Хельмовой Пади Переживший конец света 
 
Регистрация: 23.01.2009
Адрес: Гдетотамское царство
Сообщений: 1,882
Post Как линковать скалируемые предметы в чат?

Thank you very much! Link formed properly and correctly. However ... In the space provided in the function Encode module provides information about the master object "Fake". It removed the

Код:

...
-- additional data
out:Put(0);
out:Put(3); -- 3 extra structures
-- extra extra info
out:PutLongLE( 0x100012C5 ); -- header
out:PutLongLE( 0x100012C5 ); -- header repeated
-- number of extra extra structures
local extras = 3;
out:PutLongLE( extras );
out:PutLongLE( 0x10000884 );
out:Put( 1 );
out:Put( 4 );
out:PutLongLE( 0x00610046 );
out:PutLongLE( 0x0065006B );
out:PutLongLE( 0x00000001 );
out:PutWordLE( 0x0000 );
-- item level
out:PutLongLE( 0x100000C4 ); -- header
out:PutLongLE( x );
...

replacement of this

Код:

-- additional data
out:Put(0);
out:Put(2); -- 3 extra structures
-- extra extra info
out:PutLongLE( 0x100012C5 ); -- header
out:PutLongLE( 0x100012C5 ); -- header repeated
-- number of extra extra structures
local extras = 2;
out:PutLongLE( extras );
-- item level
out:PutLongLE( 0x100000C4 ); -- header
out:PutLongLE( 0x00000043 );

(I'm sorry for my bad English, translated by translate.google.com )

Спасибо большое! Линк формируется правильно и корректно. Однако... в предоставленном модуле в функции Encode содержится информация о мастере предмета "Fake".
Убирается она заменой этого:

Код:

...
-- additional data
out:Put(0);
out:Put(3); -- 3 extra structures
-- extra extra info
out:PutLongLE( 0x100012C5 ); -- header
out:PutLongLE( 0x100012C5 ); -- header repeated
-- number of extra extra structures
local extras = 3;
out:PutLongLE( extras );
out:PutLongLE( 0x10000884 );
out:Put( 1 );
out:Put( 4 );
out:PutLongLE( 0x00610046 );
out:PutLongLE( 0x0065006B );
out:PutLongLE( 0x00000001 );
out:PutWordLE( 0x0000 );
-- item level
out:PutLongLE( 0x100000C4 ); -- header
out:PutLongLE( x );
...

на это:

Код:

-- additional data
out:Put(0);
out:Put(2); -- 3 extra structures
-- extra extra info
out:PutLongLE( 0x100012C5 ); -- header
out:PutLongLE( 0x100012C5 ); -- header repeated
-- number of extra extra structures
local extras = 2;
out:PutLongLE( extras );
-- item level
out:PutLongLE( 0x100000C4 ); -- header
out:PutLongLE( 0x00000043 );
Ответить с цитированием
  #24  
Старый 29.08.2013, 17:56
Аватар для Equendil
Equendil Equendil вне форума
Путник
Переживший конец света 
 
Регистрация: 23.05.2013
Сообщений: 7
Post Как линковать скалируемые предметы в чат?

Цитата:
Сообщение от bopozhej Посмотреть сообщение
на это:

Код:

-- additional data
out:Put(0);
out:Put(2); -- 3 extra structures
-- extra extra info
out:PutLongLE( 0x100012C5 ); -- header
out:PutLongLE( 0x100012C5 ); -- header repeated
-- number of extra extra structures
local extras = 2;
out:PutLongLE( extras );
-- item level
out:PutLongLE( 0x100000C4 ); -- header
out:PutLongLE( 0x00000043 );
The first 'extra structures' count should always be 3, as it encapsulates three sub arrays: the 'extra extra structures' one, the repeated generic ID and the repeated instance ID. While those repeated generic and instance IDs are probably ignored, that's how all item links are generated by Turbine, so I would leave it that way.

Also please keep an indication that item links are fake for anything potentially going to global channels, I would hate for Turbine to decide that fake item links are to be dealt with and remove the possibility.
Ответить с цитированием
  #25  
Старый 29.08.2013, 18:33
Аватар для PulseDiver
PulseDiver PulseDiver вне форума
Рыцарь Гондора
За отличную работу в преддверии Рохана За отличную работу в преддверии Хельмовой Пади Переживший конец света 
 
Регистрация: 15.06.2009
Адрес: Калининград
Сообщений: 10,445
Post Как линковать скалируемые предметы в чат?

bopozhej did it!
Thanks to him and Equendil, of course!

Ворожей сделал это!
Спасибо ему большое и, конечно, Equendil-у!

__________________
Мирквуд - Эсельсиор | Brandywine - Vinya Mar, Evos | Arkenstone - Expendables (creeps)
[Ссылки могут видеть только зарегистрированные пользователи. ]
Ответить с цитированием
  #26  
Старый 29.08.2013, 19:21
Аватар для Equendil
Equendil Equendil вне форума
Путник
Переживший конец света 
 
Регистрация: 23.05.2013
Сообщений: 7
Post Как линковать скалируемые предметы в чат?

Мило. Я рад, что это работает ! (Sweet, I'm glad it works)
Ответить с цитированием
  #27  
Старый 29.08.2013, 19:35
Аватар для bopozhej
bopozhej bopozhej вне форума
Щит Миробеля
За помощь локализаторам За отличную работу в преддверии Хельмовой Пади Переживший конец света 
 
Регистрация: 23.01.2009
Адрес: Гдетотамское царство
Сообщений: 1,882
Post Как линковать скалируемые предметы в чат?

Увы, нужен ещё 1 код заголовка! Код Брони - она не скалируется с уровнем предмета.
(Alas, need another one header code! Armor code - it are unchanged with the level of the item)
Ответить с цитированием
  #28  
Старый 29.08.2013, 21:23
Аватар для chirick86
chirick86 chirick86 вне форума
Щит Миробеля
За создание журнала Переживший конец света 
 
Регистрация: 17.08.2011
Адрес: Санкт-Петербург
Сообщений: 1,694
Post Как линковать скалируемые предметы в чат?

Так что? Почти победа? Можно пить шампанское? =)
__________________
Raert - ON, Ruert - ON
Anor
Ответить с цитированием
  #29  
Старый 29.08.2013, 23:19
Аватар для bopozhej
bopozhej bopozhej вне форума
Щит Миробеля
За помощь локализаторам За отличную работу в преддверии Хельмовой Пади Переживший конец света 
 
Регистрация: 23.01.2009
Адрес: Гдетотамское царство
Сообщений: 1,882
Post Как линковать скалируемые предметы в чат?

Угу, почти. Статы скалируется в зависимости от уровня предмета, а вот броню, максимальный и минимальный демаг и ДПС надо писать ручками. С демагом я вроде раобрался как и с ДПС, единственное в ДПС может быть небольшая погрешьность на -0,1. А вот с бронёй пока никак .
Ответить с цитированием
  #30  
Старый 30.08.2013, 00:13
Аватар для Equendil
Equendil Equendil вне форума
Путник
Переживший конец света 
 
Регистрация: 23.05.2013
Сообщений: 7
Post Как линковать скалируемые предметы в чат?

For LIs the field prefixed with 0x10001042 sets the max hit values for tactical weapons, that /might/ do the same for scalable weapons, and possibly armour as well.

The value has to be encoded as a 32 bits float though. I wrote a function that does just that for LIP:

Код:

local numberToBinary32Float = function( n )
if n == 0 then return 0 end;
local precision = 24;
local sign;
if n > 0 then
sign = 0;
else
sign = 1;
end
n = math.abs( n );
local maxn = 2^(precision - 1)
local exponent = math.ceil(log2(math.floor(n)));
if n > (2*maxn) then
while n > maxn do
n = n / 2;
end
else
while n < maxn do
n = n * 2;
if n < 0 then
exponent = exponent - 1;
end
end
end
-- bias the exponent
exponent = exponent 127
local result = sign;
result = Equendil.Utils.bit32.lshift( result, 8 ); -- exponent is encoded on 8bits
result = result exponent;
result = Equendil.Utils.bit32.lshift( result, 23 ); -- and significand on 23 bits
result = result math.floor( n - 2^precision ); -- we don't store the most significant bit (always 1, as number is normalized)
return result;
end

So

Код:

out:PutLongLE( 0x10001042 );
local f = numberToBinary32Float( <insert value> );
out:PutLongLE( f );

and make sure you set the 'extras' variable accordingly.

For weapons, the value is the max hit of the weapon range, the game client computes the other values from that (min = 3/5 * value; dps = 4/5 * value / weapon speed). For armour, well I suppose if that worked, it would just be the armour value.

Of course that's not really helping as even if that works you would have to know what those values are :/
Ответить с цитированием
Ответ

Закладки


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


Текущее время: 08:42. Часовой пояс GMT +3.