Você não está conectado. Conecte-se ou registre-se

[GUIA] Implementar Cabelos

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1[GUIA] Implementar Cabelos Empty[GUIA] Implementar Cabelos Sex Mar 08, 2013 9:41 am

Blair

Blair
Admin
Admin

https://gfxgamers.forumeiros.com
Depois de muita procura, modificar, foda-se o servidor de teste, etc. Eu finalmente consegui terminá-lo.

Antes de começar, DO ARQUIVO COPY

Começamos o lado do servidor: A consulta:

Nós tentamos isso, por exemplo

INSERT INTO item_proto VALUES (75001, "", "Peinado de moda", 18, 0, 0, 1, 58, 8192, 0, "", 1500000, 1500000, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0);


Após a Query, ficamos com o cliente.

Deve descompilar locale_x.epk-.eix (Você tem) e o icon.epk-.eix. No local, adicione a linha do objeto no
item_proto

Código:
<Item vnum="75001" hashName="'Peinado de moda (Rojo)'" name="'Peinado de moda'" type="18" subtype="0 weight=0 size="1" antiflag="58" flag="8192" wearflag=0 immuneflag=0 gold="1500000 buy_price="1500000 limittype0=0 limitvalue0="15" limittype1=0 limitvalue1=0 applytype0=0 applyvalue0=0 applytype1=0 applyvalue1=0 applytype2=0 applyvalue2=0 value0=0 value1=0 value2=0 value3=0 value4=0 value5=0 socket0=0 socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum=0 refine_set=0 magic_pct=0 specular=0 socket_pct=0 />

Adicionar também o item_list e item_desc
No ícon, adicione a imagem que irá visualizar (128x128 Tamanho total, a imagem do cabelo será 96x96) com o número do item e formato. dds no capeta ou augo com esse nome que não estou lembrado hair

75001.dds

Também tem que adicionar um Sub. Ligados ao mesmo número do objeto. No deve conter as seguintes informações.
75001.sub

title subImage
version 2.0
image "75001.dds"
left 0
top 0
right 96
bottom 96

Depois disso, dependendo do cliente e pode visualizar as imagens de visualização para ser colocado sobre o artigo.

Para quem não pode ver os arquivos de imagem visualizar em 2010:

1 - Descompila root.epk-.eix.
2- Buscar o Arquivo uitooltip.py
3 - Procure o texto (linha mais ou menos 1000)

## Çì¾îÀΰ¡?
def __IsHair(self, itemVnum):
return (self.__IsOldHair(itemVnum) or
self.__IsNewHair(itemVnum) or
self.__IsNewHair2(itemVnum))

def __IsOldHair(self, itemVnum):
return itemVnum > 73000 and itemVnum < 74000

def __IsNewHair(self, itemVnum):
return itemVnum > 74000 and itemVnum < 75000

def __IsNewHair2(self, itemVnum):
return itemVnum > 75000 and itemVnum < 77000

def __AppendHairIcon(self, itemVnum):
itemImage = ui.ImageBox()
itemImage.SetParent(self)
itemImage.Show()

if self.__IsOldHair(itemVnum):
itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
elif self.__IsNewHair(itemVnum): # ±âÁ¸ Çì¾î ¹øÈ£¸¦ ¿¬°á½ÃÄѼ­ »ç¿ëÇÑ´Ù. »õ·Î¿î ¾ÆÀÌÅÛÀº 1000¸¸Å­ ¹øÈ£°¡ ´Ã¾ú´Ù.
itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
elif self.__IsNewHair2(itemVnum): # ±âÁ¸ Çì¾î ¹øÈ£¸¦ ¿¬°á½ÃÄѼ­ »ç¿ëÇÑ´Ù. »õ·Î¿î ¾ÆÀÌÅÛÀº 1000¸¸Å­ ¹øÈ£°¡ ´Ã¾ú´Ù.
itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))


itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
self.toolTipHeight += itemImage.GetHeight()
#self.toolTipWidth += itemImage.GetWidth()/2
self.childrenList.append(itemImage)
self.ResizeToolTip()

4 - Substitua por Outra
## Çì¾îÀΰ¡?
def __IsHair(self, itemVnum):
return (self.__IsOldHair(itemVnum) or
self.__IsNewHair(itemVnum) or
self.__IsNewHair2(itemVnum) or
self.__IsNewHair3(itemVnum))

def __IsOldHair(self, itemVnum):
return itemVnum > 73000 and itemVnum < 74000

def __IsNewHair(self, itemVnum):
return itemVnum > 74000 and itemVnum < 75000

def __IsNewHair2(self, itemVnum):
return itemVnum > 75000 and itemVnum < 77000

def __IsNewHair3(self, itemVnum):
return ((75000 < itemVnum and itemVnum < 75002))

def __AppendHairIcon(self, itemVnum):
itemImage = ui.ImageBox()
itemImage.SetParent(self)
itemImage.Show()

if self.__IsOldHair(itemVnum):
itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
elif self.__IsNewHair3(itemVnum):
itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
elif self.__IsNewHair(itemVnum): # ±âÁ¸ Çì¾î ¹øÈ£¸¦ ¿¬°á½ÃÄѼ* »ç¿ëÇÑ´Ù. »õ·Î¿î ¾ÆÀÌÅÛÀº 1000¸¸Å* ¹øÈ£°¡ ´Ã¾ú´Ù.
itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
elif self.__IsNewHair2(itemVnum):
itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))

itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
self.toolTipHeight += itemImage.GetHeight()
#self.toolTipWidth += itemImage.GetWidth()/2
self.childrenList.append(itemImage)
self.ResizeToolTip()


Nota:

def __IsNewHair3(self, itemVnum):
return ((xxx-1 < itemVnum and itemVnum < xxx+1))

xxx-1 = é o numero do item -1
xxx+1 = é o numero dol item +1

Editar, editar os arquivos ausentes do MSM (root.)

Em (root.epk-.eix) descompacte, procuramos. Msm dos 8 caracteres disponíveis. Eles devem adicionar a função para ser visto.

Na primeira parte do Arquivo, Group HairData No final, são as linhas do nosso novo Cabelos:
Group HairData19
{
HairIndex 6001
Model "hair/pelo.gr2"
SourceSkin "hair/pelo.dds"
TargetSkin "hair/pelo.dds"
}

Explicar a função:


Grupo HairData19: Em 19 de deve adicionar um para cada Cabelo no lugar, se o seu MSN, os 16, o novo cabelo vai ter 17 ...
HairIndex 6001, esse número importante, o número com o qual nos identificamos cabelo. Não pode ser repetido, eu recomendo a partir de 6000 Como neste caso para novos estilos.
Modelo:. O Gr2 penteado para usar
Origem ou de destino: a textura dds Cabelos.

Lembre-se que de acordo com o que acrescentar, deberas adicionar " HairDataCount" quase no arquivo de cabeçalho para o trabalho.

Não se isso vai funcionar agora. I, também em meus arquivos, eu adicionei a função na busca. Deixo aqui também se a aplicação não funciona.

hair.quest

Código:
quest hair begin
state start begin
function My_hair_item(vnum,index)
hair_list={}
-- vnum /hair/ option / howmuch / duration
hair_list [74001] = {1001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74002] = {1002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74003] = {1003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74004] = {1004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74005] = {1005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74006] = {1006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74007] = {1007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74008] = {1008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74009] = {1009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74010] = {1010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74011] = {1011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74012] = {1012, apply.ATTBONUS_SHAMAN, 10, 2592000}

hair_list [74251] = {2001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74252] = {2002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74253] = {2003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74254] = {2004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74255] = {2005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74256] = {2006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74257] = {2007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74258] = {2008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74259] = {2009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74260] = {2010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74261] = {2011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74262] = {2012, apply.ATTBONUS_SHAMAN, 10, 2592000}

hair_list [74501] = {3001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74502] = {3002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74503] = {3003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74504] = {3004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74505] = {3005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74506] = {3006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74507] = {3007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74508] = {3008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74509] = {3009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74510] = {3010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74511] = {3011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74512] = {3012, apply.ATTBONUS_SHAMAN, 10, 2592000}

hair_list [74751] = {4001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74752] = {4002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74753] = {4003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74754] = {4004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74755] = {4005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74756] = {4006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74757] = {4007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74758] = {4008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [74759] = {4009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [74760] = {4010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [74761] = {4011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [74762] = {4012, apply.ATTBONUS_SHAMAN, 10, 2592000}


hair_list [75001] = {1001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75002] = {1002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75003] = {1003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75004] = {1004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75005] = {1005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75006] = {1006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75007] = {1007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75008] = {1008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75009] = {1009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75010] = {1010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75011] = {1011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75012] = {1012, apply.ATTBONUS_SHAMAN, 10, 2592000}

hair_list [75201] = {2001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75202] = {2002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75203] = {2003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75204] = {2004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75205] = {2005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75206] = {2006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75207] = {2007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75208] = {2008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75209] = {2009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75210] = {2010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75211] = {2011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75212] = {2012, apply.ATTBONUS_SHAMAN, 10, 2592000}

hair_list [75401] = {3001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75402] = {3002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75403] = {3003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75404] = {3004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75405] = {3005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75406] = {3006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75407] = {3007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75408] = {3008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75409] = {3009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75410] = {3010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75411] = {3011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75412] = {3012, apply.ATTBONUS_SHAMAN, 10, 2592000}

hair_list [75601] = {4001, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75602] = {4002, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75603] = {4003, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75604] = {4004, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75605] = {4005, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75606] = {4006, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75607] = {4007, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75608] = {4008, apply.ATTBONUS_SHAMAN, 10, 2592000}
hair_list [75609] = {4009, apply.ATTBONUS_WARRIOR, 10, 2592000}
hair_list [75610] = {4010, apply.ATTBONUS_ASSASSIN, 10, 2592000}
hair_list [75611] = {4011, apply.ATTBONUS_SURA, 10, 2592000}
hair_list [75612] = {4012, apply.ATTBONUS_SHAMAN, 10, 2592000}
return hair_list[vnum][index]
end

function leave_log(item_vnum)

char_log(0, "CHANGE_HAIR", string.format("USE_ITEM(%d)",item_vnum)) -- ¾ÆÀÌÅÛ ·Î±× ¼³Á¤

--char_log(0, "CHANGE_HAIR", string.format("SET_HAIR(%d)",item_vnum)) -- ¾ÆÀÌÅÛ ·Î±× ¼³Á¤

char_log(0, "CHANGE_HAIR", string.format("END_SEC(%d)",get_time()+ hair.My_hair_item(item_vnum,4)) ) -- »ç¿ë±â°£ ·Î±×

--char_log(0, "CHANGE_HAIR", string.format("AFFECT(%s), DURATION:%d)",hair.My_hair_item(item_vnum,2),get_time()+ hair.My_hair_item(item_vnum,4))) -- È¿°ú ¼³Á¤ ·Î±×

char_log(0, "CHANGE_HAIR", "CHANGE_HAIR_END") -- Á¾·á ·Î±×

end


when 74001.use or
74002.use or
74003.use or
74004.use or
74005.use or
74006.use or
74007.use or
74008.use or
74009.use or
74010.use or
74011.use or
74012.use or
75001.use or
75002.use or
75003.use or
75004.use or
75005.use or
75006.use or
75007.use or
75008.use or
75009.use or
75010.use or
75011.use or
75012.use with pc.get_job()==0 begin

pc.set_part(PART_HAIR, hair.My_hair_item(item.vnum,1))
affect.remove_hair()
affect.add_hair(hair.My_hair_item(item.vnum,2),hair.My_hair_item(item.vnum,3) , hair.My_hair_item(item.vnum,4))

pc.setqf("limit_time",get_time()+ hair.My_hair_item(item.vnum,4))
hair.leave_log(item.vnum)
item.remove()
end

when 74251.use or
74252.use or
74253.use or
74254.use or
74255.use or
74256.use or
74257.use or
74258.use or
74259.use or
74260.use or
74261.use or
74262.use or
75201.use or
75202.use or
75203.use or
75204.use or
75205.use or
75206.use or
75207.use or
75208.use or
75209.use or
75210.use or
75211.use or
75212.use with pc.get_job()==1 begin

pc.set_part(PART_HAIR, hair.My_hair_item(item.vnum,1))
affect.remove_hair()
affect.add_hair(hair.My_hair_item(item.vnum,2),hair.My_hair_item(item.vnum,3) , hair.My_hair_item(item.vnum,4))

pc.setqf("limit_time",get_time()+hair.My_hair_item(item.vnum,4))

hair.leave_log(item.vnum)
item.remove()
end

when 74501.use or
74502.use or
74503.use or
74504.use or
74505.use or
74506.use or
74507.use or
74508.use or
74509.use or
74510.use or
74511.use or
74512.use or
75401.use or
75402.use or
75403.use or
75404.use or
75405.use or
75406.use or
75407.use or
75408.use or
75409.use or
75410.use or
75411.use or
75412.use with pc.get_job()==2 begin


pc.set_part(PART_HAIR, hair.My_hair_item(item.vnum,1))
affect.remove_hair()
affect.add_hair(hair.My_hair_item(item.vnum,2),hair.My_hair_item(item.vnum,3) , hair.My_hair_item(item.vnum,4))

pc.setqf("limit_time",get_time()+hair.My_hair_item(item.vnum,4))

hair.leave_log(item.vnum)
item.remove()
end

when 74751.use or
74752.use or
74753.use or
74754.use or
74755.use or
74756.use or
74757.use or
74758.use or
74759.use or
74760.use or
74761.use or
74762.use or
75601.use or
75602.use or
75603.use or
75604.use or
75605.use or
75606.use or
75607.use or
75608.use or
75609.use or
75610.use or
75611.use or
75612.use with pc.get_job()==3 begin


pc.set_part(PART_HAIR, hair.My_hair_item(item.vnum,1))
affect.remove_hair()
affect.add_hair(hair.My_hair_item(item.vnum,2),hair.My_hair_item(item.vnum,3) , hair.My_hair_item(item.vnum,4))

pc.setqf("limit_time",get_time()+ hair.My_hair_item(item.vnum,4))

hair.leave_log(item.vnum)
item.remove()
end

end
end

Em parte, o arquivo vinculado ao código msm HairIndex eu disse acima.

exemplo:

Exemplo:
hair_list [75001] = {6001, apply.ATTBONUS_WARRIOR, 50, 2592000}


Explicar as funções;
75001: A primeira é o código de estilo item_proto.
6001: O hairindex código associado no msm.
apply.ATTBONUS_WARRIOR: função que você deseja. Neste caso, atacar guerreiro bônus.
50: A% de bônus que eles querem, no exemplo 50%
2592000: A última vez que eles querem que o penteado em segundos.

Depois de fazer isso, apenas se mantém para adicionar o número do item na parte inferior do arquivo. Lembre-se que de acordo com que o cabelo, deve estar em uma coluna ou de outra, se não, não vai olhar corretamente.

75012.use or
75001.use with ...

with pc.get_job()==0 begin : Guerrero
with pc.get_job()==1 begin : Ninja
with pc.get_job()==2 begin : Sura
with pc.get_job()==3 begin : Chaman

Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos