- root uitarget.py açılır ve aratılır
- self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.demirwsgame))
- altındaki iki kod değiştirilir..
- self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.demirwsgame))
- self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.demirwsgame))
- tekrar aratırlır
- def demirwsgame(self):
- ve kod bloğu tamamen değiştirilir..
- def demirwsgame(self):
- if player.IsChallengeInstance(self.vid):
- questionDialog = uiCommon.QuestionDialog()
- if constInfo.DUELLODAIZINVARMI == "":
- questionDialog.SetText("Rakibin HP ve SP gorebilsin mi ? " + " " + chr.GetNameByVID(self.vid)+": Rakip kabul etmedi.")
- else:
- questionDialog.SetText("Rakibin HP ve SP gorebilsin mi ? " + " " + chr.GetNameByVID(self.vid)+":" + constInfo.DUELLODAIZINVARMI)
- questionDialog.SetAcceptEvent(ui.__mem_func__(self.Yes2))
- questionDialog.SetCancelEvent(ui.__mem_func__(self.No2))
- questionDialog.Open()
- self.questionDialog = questionDialog
- elif not player.IsCantFightInstance(self.vid) or player.IsRevengeInstance(self.vid) or player.IsChallengeInstance(self.vid):
- questionDialog = uiCommon.QuestionDialog()
- questionDialog.SetText("Rakibinin HP ve SP gormesine izin veriyor musun? ")
- questionDialog.SetAcceptEvent(ui.__mem_func__(self.Yes))
- questionDialog.SetCancelEvent(ui.__mem_func__(self.No))
- questionDialog.Open()
- self.questionDialog = questionDialog
- def Yes(self):
- self.questionDialog.Close()
- net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"HP kabul ettimaq.")
- net.SendChatPacket("/pvp %d" % (self.vid))
- constInfo.demirstartgame = self.vid
- event.QuestButtonClick(constInfo.demirvidgame)
- def No(self):
- self.questionDialog.Close()
- net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"HP kabul etmedi.Hpstanceingilizcebitti")
- net.SendChatPacket("/pvp %d" % (self.vid))
- constInfo.demirstartgame = self.vid
- event.QuestButtonClick(constInfo.demirvidgame)
- def Yes2(self):
- if constInfo.DUELLODAIZINVARMI == "Kabul etmedi." or constInfo.DUELLODAIZINVARMI == "":
- constInfo.DUELLODAIZINVARMI = ""
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.RAKIPKABULETMEDISENDEETMEDIN)
- net.SendChatPacket("/pvp %d" % (self.vid))
- net.SendWhisperPacket(chr.GetNameByVID(self.vid), '||zacqooleavenhpsp||')
- else:
- net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"C kabul ettimaq.")
- net.SendChatPacket("/pvp %d" % (self.vid))
- self.questionDialog.Close()
- def No2(self):
- self.questionDialog.Close()
- if constInfo.DUELLODAIZINVARMI == "Kabul etti.":
- constInfo.DUELLODAIZINVARMI = ""
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.RAKIPKABULETMEDISENDEETMEDIN2)
- net.SendWhisperPacket(chr.GetNameByVID(self.vid), '||zacqooleavenhpspq||')
- net.SendChatPacket("/pvp %d" % (self.vid))
- else:
- net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"C kabul etmedi.Hpstanceingilizcebitti")
- net.SendChatPacket("/pvp %d" % (self.vid))
- def demirgogame(self):
- constInfo.demirstartgame = self.vid
- event.QuestButtonClick(constInfo.demirvid)