Luzes
De Mystical Tales
Atualmente a visão noturna dos elfos é o 'nightsight' padrão do UO, ou seja, tudo na tela fica claro como de dia. Você não sabe se é dia ou noite e o efeito não tem fim.
Isso gera alguns problemas para o RP. O player não sabe que horas são e fala 'bom dia' sempre. Velas,tochas e lanternas são desvalorizadas. As dungeons perdem o fator surpresa e os caminhos ficam fáceis de se ver.
Procurando resolver esta questão, fiz alguns testes equipando lanternas, tochas, velas e até outros light sources, para ver como o client se comporta e o que pode ser feito.
No UO existem alguns tipos pré-definidos de luz. Eles estão no lights.mul como bitmaps de luz aditiva. Cada byte corresponde ao valor a ser somado ao pixel RGB da tela. Os valores permitidos vão de -32 a +31. Com valores negativos podemos ter uma luz negra (sombra).
Para o tipo de luz poder ser mudado, o ítem deve possuir algumas características.
- Seu tiledata deve ter o flag de light source
- O item deve estar no world, e não equiped.
Itens equipados que tenham flag light source usam o tipo de luz especificado no campo unk3 do tiledata, o que não pode ser alterado via script.
Para podermos adicionar uma luz ao player, temos então que equipar um ítem que seja light source e que tenha o tipo de luz desejada.
Os tipos de luz oficiais são todos pequenos, com pouca área de visão.
A solução ótima seria editar o lights.mul e adicionar uma luz especificamente para essa função, e adicionar um tile e gump com flag de light source e com novo tipo de luz criado. Claro que está solução será descartada devido a complexidade de se criar mais tipos de patch.
A solução ideal seria editar o lights.mul e substituir uma luz existente ( a da tocha por exemplo ) para uma maior, que ocupe quase toda tela. Pretendo usar esta opção assim que modificar o patch da myt para suportar esse novo tipo de arquivo.
Se os players aceitarem, podemos fazer a implantação com a luz da tocha, como está nas fotos ao lado.
A implementação no sphere não é difícil mas tem alguns cuidados que devem ser tomados. Não se pode equipar uma luz normalmente, porque assim outros personagens também veriam. A luz tem que ser 'privada'. Para isso deve-se usar um sendpacket equipando uma luz no layer light, fazendo com que só o personagem em questão veja a luz. Após isso, nada mais deve ser usado nesse layer. Se for uma tocha por exemplo for equipada, ao desequipar deve-se enviar o sendpacket novamente, senão o client não se comporta bem e não atualiza a tela corretamente quando o personagem se move.
Usar o layer hand2 também serve, mas dependendo do ítem usado ele aparece na mão, o que é indesejável.
Tipos de luz:
Os índices seguem na lista abaixo:
0 windows approximately, the east with light 1 medium sized light circle 2 small light circle 3 door to the south with light, to the rear up 4 door eastward with light, to the rear up 5 light circle, largely, the north cut off 6 light circle, largely, the north, the east cut off 7 light circle, largely, the east cut off 8 light circle, largely, the west cut off 9 light circle, largely, the south, the west cut off 10 light circle, largely, the south cut off 11 light circle, means, the north cut off 12 light circle, means, the north, the east cut off 13 light circle, means, the east cut off 14 light circle, means, the west cut off 15 light circle, means, the south cut off 16 light circle, small, the north cut off 17 light circle, small, the north, the east cut off 18 light circle, small, the east cut off 19 light circle, small, the west cut off 20 light circle, small, the south, the west cut off 21 light circle, small, the south cut off 22 windows angularly, the south without light 23 windows angularly, the east without light 24 windows angularly, the south with light 25 windows angularly, the east with light 26 windows approximately, the south without light 27 windows approximately, the east without light 28 windows approximately, the south with light 29 large light circle 30 light circle, largely, the north, the west cut off 31 black light, largely, the south, the east cut off 32 black light, largely, the south cut off 33 black light, largely, the north, the west cut off 34 black light, largely, the south, the east cut off 35 black light, largely, the east cut off 36 black light, largely, complete circle 37 door the south, forward up 38 door the east, forward up 39 windows, small, the east with light 40 windows, small, the east without light 41 windows, small, the south with light 42 windows, small, the south without light 43 44 Festner, narrowly, the south without light 45 Festner, narrowly, the east with light 46 Festner, narrowly, the east without light 47 opening, the south 48 opening, the east 49 large light circle with “essay†50 streifenweise light