1. root uitarget.py açılır ve aratılır
  2. self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.demirwsgame))
  3. altındaki iki kod değiştirilir..
  4. self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.demirwsgame))
  5. self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.demirwsgame))
  6. tekrar aratırlır
  7. def demirwsgame(self):
  8. ve kod bloğu tamamen değiştirilir..
  9. def demirwsgame(self):
  10. if player.IsChallengeInstance(self.vid):
  11. questionDialog = uiCommon.QuestionDialog()
  12. if constInfo.DUELLODAIZINVARMI == "":
  13. questionDialog.SetText("Rakibin HP ve SP gorebilsin mi ? " + " " + chr.GetNameByVID(self.vid)+": Rakip kabul etmedi.")
  14. else:
  15. questionDialog.SetText("Rakibin HP ve SP gorebilsin mi ? " + " " + chr.GetNameByVID(self.vid)+":" + constInfo.DUELLODAIZINVARMI)
  16. questionDialog.SetAcceptEvent(ui.__mem_func__(self.Yes2))
  17. questionDialog.SetCancelEvent(ui.__mem_func__(self.No2))
  18. questionDialog.Open()
  19. self.questionDialog = questionDialog
  20. elif not player.IsCantFightInstance(self.vid) or player.IsRevengeInstance(self.vid) or player.IsChallengeInstance(self.vid):
  21. questionDialog = uiCommon.QuestionDialog()
  22. questionDialog.SetText("Rakibinin HP ve SP gormesine izin veriyor musun? ")
  23. questionDialog.SetAcceptEvent(ui.__mem_func__(self.Yes))
  24. questionDialog.SetCancelEvent(ui.__mem_func__(self.No))
  25. questionDialog.Open()
  26. self.questionDialog = questionDialog
  27. def Yes(self):
  28. self.questionDialog.Close()
  29. net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"HP kabul ettimaq.")
  30. net.SendChatPacket("/pvp %d" % (self.vid))
  31. constInfo.demirstartgame = self.vid
  32. event.QuestButtonClick(constInfo.demirvidgame)
  33. def No(self):
  34. self.questionDialog.Close()
  35. net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"HP kabul etmedi.Hpstanceingilizcebitti")
  36. net.SendChatPacket("/pvp %d" % (self.vid))
  37. constInfo.demirstartgame = self.vid
  38. event.QuestButtonClick(constInfo.demirvidgame)
  39. def Yes2(self):
  40. if constInfo.DUELLODAIZINVARMI == "Kabul etmedi." or constInfo.DUELLODAIZINVARMI == "":
  41. constInfo.DUELLODAIZINVARMI = ""
  42. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.RAKIPKABULETMEDISENDEETMEDIN)
  43. net.SendChatPacket("/pvp %d" % (self.vid))
  44. net.SendWhisperPacket(chr.GetNameByVID(self.vid), '||zacqooleavenhpsp||')
  45. else:
  46. net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"C kabul ettimaq.")
  47. net.SendChatPacket("/pvp %d" % (self.vid))
  48. self.questionDialog.Close()
  49. def No2(self):
  50. self.questionDialog.Close()
  51. if constInfo.DUELLODAIZINVARMI == "Kabul etti.":
  52. constInfo.DUELLODAIZINVARMI = ""
  53. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.RAKIPKABULETMEDISENDEETMEDIN2)
  54. net.SendWhisperPacket(chr.GetNameByVID(self.vid), '||zacqooleavenhpspq||')
  55. net.SendChatPacket("/pvp %d" % (self.vid))
  56. else:
  57. net.SendWhisperPacket(chr.GetNameByVID(self.vid), "||"+"C kabul etmedi.Hpstanceingilizcebitti")
  58. net.SendChatPacket("/pvp %d" % (self.vid))
  59. def demirgogame(self):
  60. constInfo.demirstartgame = self.vid
  61. event.QuestButtonClick(constInfo.demirvid)