terça-feira, 5 de junho de 2012

Colocando Editor de Mapas

 Tutorial .

1.Abra o MainExecutable da source 1.39 e procure por: def ParseOldPacket(self, data)  
   
2. Após achar esta linha, vá abaixando até achar: self.Room.sendAllUTF("\x19\x04", Values) quando achar 

esta linha, adicione abaixo dela: elif Opcode1 == "\x0E": if Opcode2 == "\x0A": # Testar o Mapa xml = 

Values [0] self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do editor self.worldChangeEditor(xml) code =

 str(random.randint(0, 555555555)) # Gerar o código self.Server.CreateMap(self.Name, code, xml) # 

Criar o mapa self.sendDataUTF("\x0E" + "\x05", [code]) # Mostrar o codigo self.sendDataUTF("\x0E" + 

"\x0E", ["0"]) # Sair do editor self.GotoRoom("br-1") # Ir para a sala 1 elif Opcode2 == "\x1A": # Sair do 

Editor self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do Editor self.GotoRoom("br-1") # Ir para sala 1

3.  Agora procure a linha: def GetPlayer(self, name) você verá a linha return 0 de 2 enter abaixo dela e 

adicione o seguinte código: def CreateMap(self, username, code, xml): self.Database.execute("INSERT 

INTO !VMaps (!MCreator, !MXML, !MID, !MPermanent) VALUES (?,?,?,0);", [username, xml, code]) self.Data

4. 4. Abaixo de return 0 novamente de 2 enters e adicione o código: def changeMapCc (self, map_number): 

if map_number.startswith ("@"): isCustom = True else: isCustom = False for code, client in 

self.Clients.iteritems(): client.ResetPlay() self.SendShamanPerformance() self.World = map_number 

self.RoundCode += 1 self.Mice_Saved = 0 self.Sync_Code = self.GetNewSync() self.Shaman_Code = 

[self.Sync_Code].isSync = True self.Start_Time = time.time() self.WorldChange_Timer = 

reactor.callLater(120, self.ChangeMapRandom) for code, client in self.Clients.iteritems(): 

client.StartPlay(isCustom, False) client.sendRemainingTime(120) self.Start_Time = time.time() 

self.Mice_Saved = 0 5. Para finalizar, procure pela linha def sendNewParty (self, isCustom = False) troque

 essa linha e o conteúdo dela para: def sendNewParty (self, isCustom = False): if isCustom: 

self.Database.execute ("SELECT !PCreator, !PXML, !PPermanent, !PID 

FROM !VMaps WHERE ID =?", [self.Room.World.replace ("@", "")]) infos_map = 

self.Database.commit() self.sendDataUTF ("\x05\x05", ['@' + str (infos_map [3]), 

self.Room.GetPlayerCount (), self.Room.RoundCode, "\x01" + infos_map [1] + "\x02"+ infos_map [0] 

+"\x02"+ str (infos_map [2])]) else: self.sendDataUTF ("\x05\x05", [self.Room.World, 

self.Room.GetPlayerCount(), self.Room.RoundCode]) Pronto, seu editor de mapas foi feito, ao clicar em 

Validar Mapa o mapa será exportado.

By:Mikael Costa'


0 comentários:

Postar um comentário

:a   :b   :c   :d   :e   :f   :g   :h   :i   :j   :k   :l   :m   :n   :o   :p   :q   :r   :s   :t