Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 94.18 KB | None | 0 0
  1. import dbg
  2. import player
  3. import item
  4. import grp
  5. import wndMgr
  6. import skill
  7. import shop
  8. import exchange
  9. import grpText
  10. import safebox
  11. import localeInfo
  12. import app
  13. import background
  14. import nonplayer
  15. import chr
  16.  
  17. import ui
  18. import mouseModule
  19. import constInfo
  20.  
  21. WARP_SCROLLS = [22011, 22000, 22010]
  22.  
  23. WSPOMAGACZE = [71044, 71045, 71030, 71029, 71028, 50107, 71027, 50827, 50802, 50801, 50813, 50817, 50818, 50820, 50826, 27870, 27873, 27875, 27876, 27874, 71031, 50821, 50822, 50823, 50824, 50825, 79030, 50814, 70008, 71004, 71018, 71019, 71020, 72725, 72724, 72728, 72729, 50828, 27102, 27105, 79047, 79048, 79049, 79050, 79051]
  24. WSPOMAGACZE_KOLOR = "00ea95"
  25.  
  26. ULEPSZACZE = [27991, 27992, 27993, 27994, 18030, 18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 70031, 18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 18051, 18052, 18053, 18054, 18055, 18056, 18057, 18059, 18060, 18061, 18062, 18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 18071, 18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080, 18081, 18082, 18083, 18084, 18085, 18087, 18091, 18092, 18093, 18094, 18095, 18096, 18097, 18098, 18099, 18100, 18101, 18102, 18103, 18104, 18105, 18106, 18107, 18108, 18014, 18015, 18016, 18001, 18008, 18002, 18009, 18017, 18018, 18019, 18003, 18010, 18020, 18021, 18022, 18006, 18013, 18023, 18024, 18025, 18026, 18027, 18028]
  27. ULEPSZACZE_KOLOR = "2495dc"
  28.  
  29. CRAFTING = [27799, 50604, 50605, 50606, 50607, 50608, 50610, 50611, 50612, 50613, 18058, 79022, 79023, 79024, 79025, 79026]
  30. CRAFTING_KOLOR = "e30808"
  31.  
  32. SPECJALNE = [79029, 7901, 7902, 7903, 7904, 79033, 79021, 79019, 79018, 79017, 79016, 79015, 79014, 79012, 50002, 71099, 80009, 79020, 79035, 79011, 79036, 79037, 27989, 70005, 70003, 70043, 70048, 70049, 71012, 71015, 71016, 71017, 71036, 71037, 71038, 71039, 71040, 71041, 71042, 71043, 71055, 71107, 71120, 72002, 72005, 72015, 72023, 72044, 72703, 72704, 72705, 72711, 79027, 50513, 79042, 79043, 79044, 79045, 79046, 79052, 79053]
  33. SPECJALNE_KOLOR = "f8a015"
  34.  
  35. PRZETOPY = [50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, 50632, 50633, 79007, 79008, 79009, 79010]
  36. PRZETOPY_KOLOR = "53d0db"
  37.  
  38. PRZEPUSTKA = [18086, 98981, 98982]
  39. PRZEPUSTKA_KOLOR = "ac1291"
  40.  
  41. PIECZEC = [52001, 52002, 52003, 52004, 52005, 52006, 52007, 52008, 52009, 52010, 52011, 52012, 52013, 52014, 52015, 52016, 52017, 52018, 71110, 71111, 71112, 71121, 71114, 71115, 71116, 71117, 71118]
  42. PIECZEC_KOLOR = "f8970c"
  43.  
  44. SKRZYNIA = [50070, 50071, 50072, 50073, 50074, 50075, 50076, 50077, 50078, 50079, 50080, 50081, 50082, 50122, 50125, 50126, 50115, 79013, 79028, 79032, 50011, 79038, 79039, 50096, 50097, 79040, 79041]
  45. SKRZYNIA_KOLOR = "f4144e"
  46.  
  47. UNIKAT = [7927, 7928, 7929, 7930, 7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 58709, 58719, 58729, 58739, 58749, 58759, 58769, 58809, 58819, 58829, 58839, 58849, 58859, 58869, 58909, 58919, 58929, 58939, 58949, 58959, 58969, 59309, 59319, 59329, 59339, 59349, 59359, 59369, 59409, 59419, 59429, 59439, 59449, 59459, 59469, 65109, 65119, 65129, 65139, 65209, 65219, 65229, 65239, 65309, 65319, 65329, 65339, 65509, 65519, 65529, 7984, 7923, 7924, 7925, 7926]
  48. UNIKAT_KOLOR = "a108bf"
  49.  
  50. DROP_INFO = {
  51. 27992 : ["Wojownik Setaou", "Łowca Setaou", "Mistyk Setaou", "Lider Setaou", "Zin.Żołnierz Setaou", "Zin.Łucznik Setaou", "Zin.Magistrat Setaou", "Zin.Komendant Setaou", "Pro.Zin.Żołnierz Setaou", "Pro.Zin.Łucznik Setaou", "Pro.Zin.Magistrat Setou", "Pro.Zin.Komendant Setaou"],
  52. 27993 : ["Wojownik Setaou", "Łowca Setaou", "Mistyk Setaou", "Lider Setaou", "Zin.Żołnierz Setaou", "Zin.Łucznik Setaou", "Zin.Magistrat Setaou", "Zin.Komendant Setaou", "Pro.Zin.Żołnierz Setaou", "Pro.Zin.Łucznik Setaou", "Pro.Zin.Magistrat Setou", "Pro.Zin.Komendant Setaou"],
  53. 27994 : ["Wojownik Setaou", "Łowca Setaou", "Mistyk Setaou", "Lider Setaou", "Zin.Żołnierz Setaou", "Zin.Łucznik Setaou", "Zin.Magistrat Setaou", "Zin.Komendant Setaou", "Pro.Zin.Żołnierz Setaou", "Pro.Zin.Łucznik Setaou", "Pro.Zin.Magistrat Setou", "Pro.Zin.Komendant Setaou"],
  54. 27991 : ["Silna Lodowa Wiedźma", "Dowódca Yonghan", "Generał Yonghan", "Beran-Setaou", "Gnom Wojownik", "Gnom Szaman", "Gnom Łowca", "Troll Egzekutor", "Gnom Pies", "Obrzydliwa Wróżka", "Troll Zabójca", "Troll Mściciel", "Wężowy Strażnik", "Wężowy Zabójca", "Wężowy Kapitan", "Naginii"],
  55. 18001 : ["Silna Lodowa Wiedźma"],
  56. 18002 : ["Czerwony Smok", "Dowódca Yonghan"],
  57. 18003 : ["Generał Yonghan"],
  58. 18006 : ["Beran-Setaou"],
  59. 70031 : ["Wojownik Setaou", "Łowca Setaou", "Mistyk Setaou", "Lider Setaou", "Zin.Żołnierz Setaou", "Zin.Łucznik Setaou", "Zin.Magistrat Setaou", "Zin.Komendant Setaou", "Pro.Zin.Żołnierz Setaou", "Pro.Zin.Łucznik Setaou", "Pro.Zin.Magistrat Setou", "Pro.Zin.Komendant Setaou", "Nieb.Zin.Żołnierz Setaou", "Nieb.Zin.Łucznik Setaou", "Nieb.Zin.Magistrat Setao", "Nieb.Zin.Komendant Setao", "Niebiański Barbarzyńca", "Niebiański Dowódca", "Przeklęty.Zin.Żoł.Setaou", "Przeklęty.Zin.Łu.Setaou", "Przeklęty.Zin.Mag.Setaou", "Przeklęty.Zin.Kom.Setaou", "Przeklęty Dowódca", "Przeklęty Barbarzyńca", "Nieumarły Dowódca", "Nieumarły Barbarzyńca", "Nieumarły.Zin.Żoł.Setaou", "Nieumarły.Zin.Łu.Setaou", "Nieumarły.Zin.Mag.Setaou", "Nieumarły.Zin.Kom.Setaou", "Kapitan Rebeliantów Pustyni", "Specjalista Dziczy", "Łucznik Wolności", "Maniak Wolności", "Żołnierz Wyzwolenia", "Generał Pustyni", "Łucznik Pustyni", "Sługa Dziczy", "Rebeliant Pustyni"],
  60. 18008 : ["Gnom Wojownik", "Gnom Szaman", "Gnom Łowca", "Troll Egzekutor", "Gnom Pies", "Obrzydliwa Wróżka", "Troll Zabójca", "Troll Mściciel", "Wężowy Strażnik", "Wężowy Zabójca", "Wężowy Kapitan", "Naginii"],
  61. 18009 : ["Gnom Wojownik", "Gnom Szaman", "Gnom Łowca", "Troll Egzekutor", "Gnom Pies", "Obrzydliwa Wróżka", "Troll Zabójca", "Troll Mściciel", "Wężowy Strażnik", "Wężowy Zabójca", "Wężowy Kapitan", "Naginii"],
  62. 18010 : ["Gnom Wojownik", "Gnom Szaman", "Gnom Łowca", "Troll Egzekutor", "Gnom Pies", "Obrzydliwa Wróżka", "Troll Zabójca", "Troll Mściciel", "Wężowy Strażnik", "Wężowy Zabójca", "Wężowy Kapitan", "Naginii"],
  63. 18013 : ["Gnom Wojownik", "Gnom Szaman", "Gnom Łowca", "Troll Egzekutor", "Gnom Pies", "Obrzydliwa Wróżka", "Troll Zabójca", "Troll Mściciel", "Wężowy Strażnik", "Wężowy Zabójca", "Wężowy Kapitan", "Naginii"],
  64. 18014 : ["Metin Upadku"],
  65. 18015 : ["Metin Upadku"],
  66. 18016 : ["Metin Upadku"],
  67. 18017 : ["Metin Pochlebstwa"],
  68. 18018 : ["Metin Pochlebstwa"],
  69. 18019 : ["Metin Pochlebstwa"],
  70. 18020 : ["Metin Zagłady"],
  71. 18021 : ["Metin Zagłady"],
  72. 18022 : ["Metin Zagłady"],
  73. 18023 : ["Metin Piekieł"],
  74. 18024 : ["Metin Piekieł"],
  75. 18025 : ["Metin Piekieł"],
  76. 18026 : ["Metin Niebios"],
  77. 18027 : ["Metin Niebios"],
  78. 18028 : ["Metin Niebios"],
  79. 18030 : ["Niebiański Dowódca"],
  80. 18031 : ["Niebiański Barbarzyńca"],
  81. 18032 : ["Niebiański Metin", "Nieb.Zin.Żołnierz Setaou", "Nieb.Zin.Łucznik Setaou", "Nieb.Zin.Magistrat Setao", "Nieb.Zin.Komendant Setao"],
  82. 18033 : ["Przeklęty Dowódca"],
  83. 18034 : ["Przeklęty Barbarzyńca"],
  84. 18035 : ["Przeklęty Metin", "Przeklęty.Zin.Żoł.Setaou", "Przeklęty.Zin.Łu.Setaou", "Przeklęty.Zin.Mag.Setaou", "Przeklęty.Zin.Kom.Setaou"],
  85. 18036 : ["Nieumarły Dowódca"],
  86. 18037 : ["Nieumarły Barbarzyńca", "Metin Nieumarłych", "Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata", ],
  87. 18038 : ["Metin Nieumarłych", "Nieumarły.Zin.Żoł.Setaou", "Nieumarły.Zin.Łu.Setaou", "Nieumarły.Zin.Mag.Setaou", "Nieumarły.Zin.Kom.Setaou"],
  88. 18041 : ["Specjalista Dziczy", "Łucznik Wolności", "Maniak Wolności", "Żołnierz Wyzwolenia", "Generał Pustyni", "Łucznik Pustyni", "Sługa Dziczy", "Rebeliant Pustyni", "Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata"],
  89. 18042 : ["Specjalista Dziczy", "Łucznik Wolności", "Maniak Wolności", "Żołnierz Wyzwolenia", "Generał Pustyni", "Łucznik Pustyni", "Sługa Dziczy", "Rebeliant Pustyni", "Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata"],
  90. 18043 : ["Król Mrocznych Pająków", "Mroczny Truciciel", "Mroczny Ptasznik", "Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata"],
  91. 18044 : ["Król Mrocznych Pająków", "Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata", "Dowódca Podziemnego Świata"],
  92. 18045 : ["Olbrzymi Pająk"],
  93. 18046 : ["Nieumarła Wierzba", "Mroczne Złe Drzewo", "Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata"],
  94. 18047 : ["Strażnik Pustynnego Lasu", "Władca Pustynnego Lasu", "Dowódca Podziemnego Świata"],
  95. 18048 : ["Władca Pustynnego Lasu", "Dowódca Podziemnego Świata", "Władca Pustynnego Lasu"],
  96. 18049 : ["Pustynny.Nieumarły Oprawca", "Dowódca Podziemnego Świata"],
  97. 18050 : ["Dowódca Powstańców"],
  98. 18051 : ["Powstańczy Smok"],
  99. 18052 : ["Zin.Dowódca Powstańców"],
  100. 18054 : ["Zin.Dowódca Powstańców", "Powstańczy Smok"],
  101. 18053 : ["Dowódca Powstańców", "Żołnierz Powstańców", "Łucznik Powstańców", "Magik Powstańców", "Oficer Powstańców"],
  102. 18055 : ["Duch Wojownika"],
  103. 18056 : ["Duch Wojownika", "Duch Sury"],
  104. 18057 : ["Duch Sury"],
  105. 18058 : ["Małż"],
  106. 18059 : ["Vergil"],
  107. 18060 : ["Kowal"],
  108. 18061 : ["Żoł.klanu podziemnego Świata", "Łucznik.klanu Podziemnego Świata", "Czarownik.klanu Podziemnego Świata", "Oficer.klanu Podziemnego Świata", "Dowódca Podziemnego Świata", "Smok z Podziemi"],
  109. 18062 : ["Dowódca Podziemnego Świata"],
  110. 18063 : ["Smok z Podziemi"],
  111. 18064 : ["Vergil"],
  112. 18066 : ["Duch Sury"],
  113. 18067 : ["Duch Sury"],
  114. 18068 : ["Duch Sury"],
  115. 18069 : ["Duch Wojownika"],
  116. 18070 : ["Duch Sury"],
  117. 18071 : ["Duch Sury"],
  118. 18072 : ["Duch Wojownika"],
  119. 18073 : ["Duch Sury"],
  120. 18074 : ["Ostateczny Dowódca"],
  121. 18075 : ["Smok Wymiaru Ostatecznego"],
  122. 18076 : ["Zin Ostateczny Dowódca"],
  123. 18077 : ["Ostateczny Żołnierz Setaou", "Ostateczny Łucznik Setaou", "Ostateczny Mag Setaou", "Ostateczny Oficer Setaou", "Zin.Ostateczny Żołnierz Setaou", "Zin.Ostateczny Łucznik Setaou", "Zin.Ostateczny Mag Setaou", "Zin.Ostateczny Oficer Setaou", "Ostateczny Dowódca"],
  124. 18078 : ["Zin.Ostateczny Żołnierz Setaou", "Zin.Ostateczny Łucznik Setaou", "Zin.Ostateczny Mag Setaou", "Zin.Ostateczny Oficer Setaou", "Zin. Ostateczny Dowódca", "Smok Wymiaru Ostatecznego"],
  125. 18079 : ["Vergil"],
  126. 18080 : ["Gnoll Komandor", "Gnoli Pies", "Gnoli Szaman", "Gnoll Minotaur", "Gnoll Wojownik", "Wróżka Gnolli", "Gnolli Żołnierz", "Gnolli Wojownik", "Troll Mag", "Miotacz Lodu", "Lodowy Łamacz Kości", "Duży Lodowy Robak", "Lodowy Pies", "Człowiek Lodowej Pieśni", "Lodowe Yeti", "Lodowy Golem Pieśni", "Lodowe Jajo", "Lodowe Kolce"],
  127. 18081 : ["Mistyczny Minotaur"],
  128. 18082 : ["Zły.Nieumarły Rzeźnik"],
  129. 18083 : ["Plugawy Ożywieniec", "Pies Ożywieńców", "Ożywieniec-Siorbacz", "Ożywieniec-Miecznik", "Ożywieniec-Włócznik", "Ożywieniec-Łucznik", "Ożywieniec-Rozpruwacz", "Ożywieniec-Zamiatacz", "Nieumarły Łucznik", "Nieumarły Włócznik", "Nieumarły Szaman", "Nieumarły Nożownik", "Nieumarły Oprawca", "Nieumarły Łowca", "Zin.Plugawy Ożywieniec", "Zin.Pies Ożywieńców", "Zin.Ożywieniec-Siorbacz", "Zin.Ożywieniec-Miecznik", "Zin.Ożywieniec-Włócznik", "Zin.Ożywieniec-Łucznik", "Zin.Ożywieniec-Rozpruwacz", "Zin.Ożywieniec-Zamiatacz", "Zin.Nieumarły Łucznik", "Zin.Nieumarły Włócznik", "Zin.Nieumarły Szaman", "Zin.Nieumarły Nożownik", "Zin.Nieumarły Oprawca", "Zin.Nieumarły Łowca", "Tancerz Miecza", "Kowal Dusz", "Ciężkozbrojny Siekacz", "Tkacz Zagłady", "Bestia Śmierci", "Tancerz Ostrza", "Metin Ożywionych", "Metin Nicości"],
  130. 18084 : ["Ponury Żniwiarz-Charon"],
  131. 18085 : ["Król Umarłych - Azrael"],
  132. 18087 : ["Dowódczyni Gnolli", "Troll Zamiatacz"],
  133. 18091 : ["Vergil"],
  134. 18092 : ["Vergil"],
  135. 18093 : ["Metin Rozbicia"],
  136. 18094 : ["Metin Ofiary"],
  137. 18095 : ["Metin Żalu"],
  138. 18096 : ["Gnoll Komandor", "Gnoli Pies", "Gnoli Szaman", "Gnoll Minotaur", "Gnoll Wojownik", "Wróżka Gnolli", "Gnolli Żołnierz", "Gnolli Wojownik", "Troll Mag", "Miotacz Lodu", "Lodowy Łamacz Kości", "Duży Lodowy Robak", "Lodowy Pies", "Człowiek Lodowej Pieśni", "Lodowe Yeti", "Lodowy Golem Pieśni"],
  139. 18097 : ["Lodowe Jajo"],
  140. 18098 : ["Lodowe Kolce"],
  141. 18099 : ["Ognisty Posąg"],
  142. 18100 : ["Metin Ożywionych"],
  143. 18101 : ["Metin Nicości"],
  144. 18102 : ["Śmiercionośne Plącze"],
  145. 18103 : ["Burzowy Metin"],
  146. 18104 : ["Zdeformowany Wilkołak", "Zdeformowany Krokodyl"],
  147. 18105 : ["Leśny Stwór", "Człowiek z Lawy", "Ogrowy Władca"],
  148. 18106 : ["Mordercza Dżdżownica"],
  149. 18107 : ["Nieumarły Pięściarz", "Szkielet Wojownika", "Zamaskowany Skrytobójca", "Hiena Cmentarna", "Cyklop", "Kamienny Olbrzym"],
  150. 18108 : ["Splamiony Nosorożec"],
  151. 18040 : ["Kapitan Rebeliantów Pustyni", "Dowódca Podziemnego Świata"],
  152. }
  153.  
  154. DESC_DEFAULT_MAX_COLS = 26
  155. DESC_WESTERN_MAX_COLS = 35
  156. DESC_WESTERN_MAX_WIDTH = 220
  157.  
  158. def chop(n):
  159. return round(n - 0.5, 1)
  160.  
  161. def SplitDescription(desc, limit):
  162. total_tokens = desc.split()
  163. line_tokens = []
  164. line_len = 0
  165. lines = []
  166. for token in total_tokens:
  167. if "|" in token:
  168. sep_pos = token.find("|")
  169. line_tokens.append(token[:sep_pos])
  170.  
  171. lines.append(" ".join(line_tokens))
  172. line_len = len(token) - (sep_pos + 1)
  173. line_tokens = [token[sep_pos+1:]]
  174. else:
  175. line_len += len(token)
  176. if len(line_tokens) + line_len > limit:
  177. lines.append(" ".join(line_tokens))
  178. line_len = len(token)
  179. line_tokens = [token]
  180. else:
  181. line_tokens.append(token)
  182.  
  183. if line_tokens:
  184. lines.append(" ".join(line_tokens))
  185.  
  186. return lines
  187.  
  188. ###################################################################################################
  189. ## ToolTip
  190. ##
  191. ## NOTE : Co?c˘ĄA ItemˇĆu Skill?ˇí ˇío?O?˘¬ˇ¤I ???ˇ© ˘©?A?ĄěI?u?˘©
  192. ## C?Ao˘¬˘¬ ˇľˇż˘Ą?Ao ?C??ˇĆ˘§ ???i ?˘¬?O
  193. ##
  194. class ToolTip(ui.ThinBoard):
  195.  
  196. TOOL_TIP_WIDTH = 190
  197. TOOL_TIP_HEIGHT = 10
  198.  
  199. TEXT_LINE_HEIGHT = 17
  200.  
  201. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  202. SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)
  203. NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  204. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  205. PRICE_COLOR = 0xffFFB96D
  206.  
  207. HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR
  208. MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0)
  209. LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0)
  210.  
  211. ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  212. DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  213.  
  214. NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  215. POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)
  216. #SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)
  217. #SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0)
  218. SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.27, 0.64, 0.92, 1.0)
  219. SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.03, 0.96, 0.09, 1.0)
  220.  
  221. CONDITION_COLOR = 0xffBEB47D
  222. CAN_LEVEL_UP_COLOR = 0xff8EC292
  223. CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
  224. NEED_SKILL_POINT_COLOR = 0xff9A9CDB
  225.  
  226. def __init__(self, width = TOOL_TIP_WIDTH, isPickable=False):
  227. ui.ThinBoard.__init__(self, "TOP_MOST")
  228.  
  229. if isPickable:
  230. pass
  231. else:
  232. self.AddFlag("not_pick")
  233.  
  234. self.AddFlag("float")
  235.  
  236. self.followFlag = True
  237. self.toolTipWidth = width
  238.  
  239. self.xPos = -1
  240. self.yPos = -1
  241.  
  242. self.defFontName = localeInfo.UI_DEF_FONT
  243. self.ClearToolTip()
  244.  
  245. def __del__(self):
  246. ui.ThinBoard.__del__(self)
  247.  
  248. def ClearToolTip(self):
  249. self.toolTipHeight = 12
  250. self.childrenList = []
  251.  
  252. def SetFollow(self, flag):
  253. self.followFlag = flag
  254.  
  255. def SetDefaultFontName(self, fontName):
  256. self.defFontName = fontName
  257.  
  258. def AppendSpace(self, size):
  259. self.toolTipHeight += size
  260. self.ResizeToolTip()
  261.  
  262. def AppendHorizontalLine(self):
  263.  
  264. for i in xrange(2):
  265. horizontalLine = ui.Line()
  266. horizontalLine.SetParent(self)
  267. horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i)
  268. horizontalLine.SetWindowHorizontalAlignCenter()
  269. horizontalLine.SetSize(150, 0)
  270. horizontalLine.Show()
  271.  
  272. if 0 == i:
  273. horizontalLine.SetColor(0xff555555)
  274. else:
  275. horizontalLine.SetColor(0xff000000)
  276.  
  277. self.childrenList.append(horizontalLine)
  278.  
  279. self.toolTipHeight += 11
  280. self.ResizeToolTip()
  281.  
  282. def AlignHorizonalCenter(self):
  283. for child in self.childrenList:
  284. (x, y)=child.GetLocalPosition()
  285. child.SetPosition(self.toolTipWidth/2, y)
  286.  
  287. self.ResizeToolTip()
  288.  
  289. def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  290. textLine = ui.TextLine()
  291. textLine.SetParent(self)
  292. textLine.SetFontName(self.defFontName)
  293. textLine.SetPackedFontColor(color)
  294. textLine.SetText(text)
  295. textLine.SetOutline()
  296. textLine.SetFeather(False)
  297. textLine.Show()
  298.  
  299. if centerAlign:
  300. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  301. textLine.SetHorizontalAlignCenter()
  302.  
  303. else:
  304. textLine.SetPosition(10, self.toolTipHeight)
  305.  
  306. self.childrenList.append(textLine)
  307.  
  308. (textWidth, textHeight)=textLine.GetTextSize()
  309.  
  310. textWidth += 40
  311. textHeight += 5
  312.  
  313. if self.toolTipWidth < textWidth:
  314. self.toolTipWidth = textWidth
  315.  
  316. self.toolTipHeight += textHeight
  317.  
  318. return textLine
  319.  
  320. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  321. textLine = ui.TextLine()
  322. textLine.SetParent(self)
  323. textLine.SetFontName(self.defFontName)
  324. textLine.SetPackedFontColor(color)
  325. textLine.SetText(text)
  326. textLine.SetOutline()
  327. textLine.SetFeather(False)
  328. textLine.Show()
  329.  
  330. if centerAlign:
  331. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  332. textLine.SetHorizontalAlignCenter()
  333.  
  334. else:
  335. textLine.SetPosition(10, self.toolTipHeight)
  336.  
  337. self.childrenList.append(textLine)
  338.  
  339. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  340. self.ResizeToolTip()
  341.  
  342. return textLine
  343.  
  344. def AppendLineSeparator(self, color = FONT_COLOR):
  345. length = ""
  346. for x in xrange(self.GetWidth()/6):
  347. length += "_"
  348.  
  349. separatorLine = ui.TextLine()
  350. separatorLine.SetParent(self)
  351. separatorLine.SetPosition(0, self.GetHeight()-18)
  352. separatorLine.SetPackedFontColor(color)
  353. separatorLine.SetText(length)
  354. separatorLine.SetHorizontalAlignCenter()
  355. separatorLine.SetWindowHorizontalAlignCenter()
  356. separatorLine.Show()
  357.  
  358. self.toolTipHeight += 8
  359.  
  360. self.childrenList.append(separatorLine)
  361. self.ResizeToolTip()
  362.  
  363. return separatorLine
  364.  
  365. def AppendDescription(self, desc, limit, color = FONT_COLOR):
  366. if localeInfo.IsEUROPE():
  367. self.__AppendDescription_WesternLanguage(desc, color)
  368. else:
  369. self.__AppendDescription_EasternLanguage(desc, limit, color)
  370.  
  371. def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR):
  372. length = len(description)
  373. if 0 == length:
  374. return
  375.  
  376. lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation)
  377. for i in xrange(lineCount):
  378. if 0 == i:
  379. self.AppendSpace(5)
  380. self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color)
  381.  
  382. def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR):
  383. lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS)
  384. if not lines:
  385. return
  386.  
  387. self.AppendSpace(5)
  388. for line in lines:
  389. self.AppendTextLine(line, color)
  390.  
  391.  
  392. def ResizeToolTip(self):
  393. self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight)
  394.  
  395. def SetTitle(self, name):
  396. self.AppendTextLine(name, self.TITLE_COLOR)
  397.  
  398. def GetLimitTextLineColor(self, curValue, limitValue):
  399. if curValue < limitValue:
  400. return self.DISABLE_COLOR
  401.  
  402. return self.ENABLE_COLOR
  403.  
  404. def GetChangeTextLineColor(self, value, isSpecial=False):
  405. if value > 0:
  406. if isSpecial:
  407. return self.SPECIAL_POSITIVE_COLOR
  408. else:
  409. return self.POSITIVE_COLOR
  410.  
  411. if 0 == value:
  412. return self.NORMAL_COLOR
  413.  
  414. return self.NEGATIVE_COLOR
  415.  
  416. def SetToolTipPosition(self, x = -1, y = -1):
  417. self.xPos = x
  418. self.yPos = y
  419.  
  420. def ShowToolTip(self):
  421. self.SetTop()
  422. self.Show()
  423.  
  424. self.OnUpdate()
  425.  
  426. def HideToolTip(self):
  427. self.Hide()
  428.  
  429. def OnUpdate(self):
  430.  
  431. if not self.followFlag:
  432. return
  433.  
  434. x = 0
  435. y = 0
  436. width = self.GetWidth()
  437. height = self.toolTipHeight
  438.  
  439. if -1 == self.xPos and -1 == self.yPos:
  440.  
  441. (mouseX, mouseY) = wndMgr.GetMousePosition()
  442.  
  443. if mouseY < wndMgr.GetScreenHeight() - 300:
  444. y = mouseY + 40
  445. else:
  446. y = mouseY - height - 30
  447.  
  448. x = mouseX - width/2
  449.  
  450. else:
  451.  
  452. x = self.xPos - width/2
  453. y = self.yPos - height
  454.  
  455. x = max(x, 0)
  456. y = max(y, 0)
  457. x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2
  458. y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight()
  459.  
  460. parentWindow = self.GetParentProxy()
  461. if parentWindow:
  462. (gx, gy) = parentWindow.GetGlobalPosition()
  463. x -= gx
  464. y -= gy
  465.  
  466. self.SetPosition(x, y)
  467.  
  468. class ItemToolTip(ToolTip):
  469.  
  470. CHARACTER_NAMES = (
  471. localeInfo.TOOLTIP_WARRIOR,
  472. localeInfo.TOOLTIP_ASSASSIN,
  473. localeInfo.TOOLTIP_SURA,
  474. localeInfo.TOOLTIP_SHAMAN
  475. )
  476.  
  477. CHARACTER_COUNT = len(CHARACTER_NAMES)
  478. WEAR_NAMES = (
  479. localeInfo.TOOLTIP_ARMOR,
  480. localeInfo.TOOLTIP_HELMET,
  481. localeInfo.TOOLTIP_SHOES,
  482. localeInfo.TOOLTIP_WRISTLET,
  483. localeInfo.TOOLTIP_WEAPON,
  484. localeInfo.TOOLTIP_NECK,
  485. localeInfo.TOOLTIP_EAR,
  486. localeInfo.TOOLTIP_UNIQUE,
  487. localeInfo.TOOLTIP_SHIELD,
  488. localeInfo.TOOLTIP_ARROW,
  489. )
  490. WEAR_COUNT = len(WEAR_NAMES)
  491.  
  492. AFFECT_DICT = {
  493. item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP,
  494. item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP,
  495. item.APPLY_CON : localeInfo.TOOLTIP_CON,
  496. item.APPLY_INT : localeInfo.TOOLTIP_INT,
  497. item.APPLY_STR : localeInfo.TOOLTIP_STR,
  498. item.APPLY_DEX : localeInfo.TOOLTIP_DEX,
  499. item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED,
  500. item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED,
  501. item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED,
  502. item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN,
  503. item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN,
  504. item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT,
  505. item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT,
  506. item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT,
  507. item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,
  508. item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT,
  509.  
  510. item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  511. item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  512. item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA,
  513. item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  514. item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  515.  
  516. item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  517. item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL,
  518. item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC,
  519. item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO,
  520. item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  521. item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  522. item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP,
  523. item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP,
  524. item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT,
  525. item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER,
  526. item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK,
  527. item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE,
  528. item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD,
  529. item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND,
  530. item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER,
  531. item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL,
  532. item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN,
  533. item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW,
  534. item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE,
  535. item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC,
  536. item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC,
  537. item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND,
  538. item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE,
  539. item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE,
  540. item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE,
  541. item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER,
  542. item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS,
  543. item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS,
  544. item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS,
  545. item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS,
  546. item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER,
  547. item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN,
  548. item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW,
  549. item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL,
  550. item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE,
  551. item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE,
  552. item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE,
  553. item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE,
  554. item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE,
  555. item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA,
  556. item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS,
  557. item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS,
  558. item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS,
  559. item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS,
  560. item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS,
  561. item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS,
  562. item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS,
  563. item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS,
  564. item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS,
  565. item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC,
  566. item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC,
  567. item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR,
  568. item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN,
  569. item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA,
  570. item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN,
  571. item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT,
  572. item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT,
  573. item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY,
  574. item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS,
  575.  
  576. item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER,
  577. item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER,
  578. item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE,
  579. item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH,
  580. item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK,
  581. item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT,
  582. item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT,
  583. }
  584.  
  585. ATTRIBUTE_NEED_WIDTH = {
  586. 23 : 230,
  587. 24 : 230,
  588. 25 : 230,
  589. 26 : 220,
  590. 27 : 210,
  591.  
  592. 35 : 210,
  593. 36 : 210,
  594. 37 : 210,
  595. 38 : 210,
  596. 39 : 210,
  597. 40 : 210,
  598. 41 : 210,
  599.  
  600. 42 : 220,
  601. 43 : 230,
  602. 45 : 230,
  603. }
  604.  
  605. ANTI_FLAG_DICT = {
  606. 0 : item.ITEM_ANTIFLAG_WARRIOR,
  607. 1 : item.ITEM_ANTIFLAG_ASSASSIN,
  608. 2 : item.ITEM_ANTIFLAG_SURA,
  609. 3 : item.ITEM_ANTIFLAG_SHAMAN,
  610. }
  611.  
  612. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  613.  
  614. def __init__(self, *args, **kwargs):
  615. ToolTip.__init__(self, *args, **kwargs)
  616. self.itemVnum = 0
  617. self.isShopItem = False
  618.  
  619. # ?????? ???A?ˇí C?˘©?C? ˘Ňˇ× Co?c A©©˘¬??IˇĆ˘§ A??eC? ?o ??˘ĄA ????????˘Ňo˘¬e ˇĆˇ©A|ˇ¤I Disable Colorˇ¤I ?©©A˘´ (???? ˇľˇżˇ¤˘¬ˇĆO ??Ąě?C?ˇĆi ?O?˘¬©©? ˘­ˇ§?©¬ C? C??aˇĆ˘§ ?O?i?ˇ©)
  620. self.bCannotUseItemForceSetDisableColor = True
  621.  
  622. def __del__(self):
  623. ToolTip.__del__(self)
  624.  
  625. def SetCannotUseItemForceSetDisableColor(self, enable):
  626. self.bCannotUseItemForceSetDisableColor = enable
  627.  
  628. def CanEquip(self):
  629. if not item.IsEquipmentVID(self.itemVnum):
  630. return True
  631.  
  632. race = player.GetRace()
  633. job = chr.RaceToJob(race)
  634. if not self.ANTI_FLAG_DICT.has_key(job):
  635. return False
  636.  
  637. if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  638. return False
  639.  
  640. sex = chr.RaceToSex(race)
  641.  
  642. MALE = 1
  643. FEMALE = 0
  644.  
  645. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  646. return False
  647.  
  648. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  649. return False
  650.  
  651. for i in xrange(item.LIMIT_MAX_NUM):
  652. (limitType, limitValue) = item.GetLimit(i)
  653.  
  654. if item.LIMIT_LEVEL == limitType:
  655. if player.GetStatus(player.LEVEL) < limitValue:
  656. return False
  657. """
  658. elif item.LIMIT_STR == limitType:
  659. if player.GetStatus(player.ST) < limitValue:
  660. return False
  661. elif item.LIMIT_DEX == limitType:
  662. if player.GetStatus(player.DX) < limitValue:
  663. return False
  664. elif item.LIMIT_INT == limitType:
  665. if player.GetStatus(player.IQ) < limitValue:
  666. return False
  667. elif item.LIMIT_CON == limitType:
  668. if player.GetStatus(player.HT) < limitValue:
  669. return False
  670. """
  671.  
  672. return True
  673.  
  674. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  675. if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
  676. color = self.DISABLE_COLOR
  677.  
  678. return ToolTip.AppendTextLine(self, text, color, centerAlign)
  679.  
  680. def ClearToolTip(self):
  681. self.isShopItem = False
  682. self.toolTipWidth = self.TOOL_TIP_WIDTH
  683. ToolTip.ClearToolTip(self)
  684.  
  685. def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY):
  686. itemVnum = player.GetItemIndex(window_type, slotIndex)
  687. if 0 == itemVnum:
  688. return
  689.  
  690. self.ClearToolTip()
  691. if shop.IsOpen():
  692. if not shop.IsPrivateShop():
  693. item.SelectItem(itemVnum)
  694. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex))
  695.  
  696. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  697. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  698.  
  699. self.AddItemData(itemVnum, metinSlot, attrSlot)
  700.  
  701. def SetShopItem(self, slotIndex):
  702. itemVnum = shop.GetItemID(slotIndex)
  703. if 0 == itemVnum:
  704. return
  705.  
  706. price = shop.GetItemPrice(slotIndex)
  707. self.ClearToolTip()
  708. self.isShopItem = True
  709.  
  710. metinSlot = []
  711. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  712. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  713. attrSlot = []
  714. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  715. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  716.  
  717. self.AddItemData(itemVnum, metinSlot, attrSlot)
  718. self.AppendPrice(price)
  719.  
  720. def SetShopItemBySecondaryCoin(self, slotIndex):
  721. itemVnum = shop.GetItemID(slotIndex)
  722. if 0 == itemVnum:
  723. return
  724.  
  725. price = shop.GetItemPrice(slotIndex)
  726. self.ClearToolTip()
  727. self.isShopItem = True
  728.  
  729. metinSlot = []
  730. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  731. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  732. attrSlot = []
  733. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  734. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  735.  
  736. self.AddItemData(itemVnum, metinSlot, attrSlot)
  737. self.AppendPriceBySecondaryCoin(price)
  738.  
  739. def SetExchangeOwnerItem(self, slotIndex):
  740. itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
  741. if 0 == itemVnum:
  742. return
  743.  
  744. self.ClearToolTip()
  745.  
  746. metinSlot = []
  747. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  748. metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i))
  749. attrSlot = []
  750. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  751. attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i))
  752. self.AddItemData(itemVnum, metinSlot, attrSlot)
  753.  
  754. def SetExchangeTargetItem(self, slotIndex):
  755. itemVnum = exchange.GetItemVnumFromTarget(slotIndex)
  756. if 0 == itemVnum:
  757. return
  758.  
  759. self.ClearToolTip()
  760.  
  761. metinSlot = []
  762. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  763. metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i))
  764. attrSlot = []
  765. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  766. attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i))
  767. self.AddItemData(itemVnum, metinSlot, attrSlot)
  768.  
  769. def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex):
  770. itemVnum = player.GetItemIndex(invenType, invenPos)
  771. if 0 == itemVnum:
  772. return
  773.  
  774. item.SelectItem(itemVnum)
  775. self.ClearToolTip()
  776. self.AppendSellingPrice(shop.GetPrivateShopItemPrice(invenType, invenPos))
  777.  
  778. metinSlot = []
  779. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  780. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  781. attrSlot = []
  782. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  783. attrSlot.append(player.GetItemAttribute(invenPos, i))
  784.  
  785. self.AddItemData(itemVnum, metinSlot, attrSlot)
  786.  
  787. def SetSafeBoxItem(self, slotIndex):
  788. itemVnum = safebox.GetItemID(slotIndex)
  789. if 0 == itemVnum:
  790. return
  791.  
  792. self.ClearToolTip()
  793. metinSlot = []
  794. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  795. metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i))
  796. attrSlot = []
  797. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  798. attrSlot.append(safebox.GetItemAttribute(slotIndex, i))
  799.  
  800. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemFlags(slotIndex))
  801.  
  802. def SetMallItem(self, slotIndex):
  803. itemVnum = safebox.GetMallItemID(slotIndex)
  804. if 0 == itemVnum:
  805. return
  806.  
  807. self.ClearToolTip()
  808. metinSlot = []
  809. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  810. metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i))
  811. attrSlot = []
  812. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  813. attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i))
  814.  
  815. self.AddItemData(itemVnum, metinSlot, attrSlot)
  816.  
  817. def SetItemToolTip(self, itemVnum):
  818. self.ClearToolTip()
  819. metinSlot = []
  820. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  821. metinSlot.append(0)
  822. attrSlot = []
  823. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  824. attrSlot.append((0, 0))
  825.  
  826. self.AddItemData(itemVnum, metinSlot, attrSlot)
  827.  
  828. def __AppendAttackSpeedInfo(self, item):
  829. atkSpd = item.GetValue(0)
  830.  
  831. if atkSpd < 80:
  832. stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST
  833. elif atkSpd <= 95:
  834. stSpd = localeInfo.TOOLTIP_ITEM_FAST
  835. elif atkSpd <= 105:
  836. stSpd = localeInfo.TOOLTIP_ITEM_NORMAL
  837. elif atkSpd <= 120:
  838. stSpd = localeInfo.TOOLTIP_ITEM_SLOW
  839. else:
  840. stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW
  841.  
  842. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR)
  843.  
  844. def __AppendAttackGradeInfo(self):
  845. atkGrade = item.GetValue(1)
  846. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade))
  847.  
  848. def __AppendAttackPowerInfo(self):
  849. minPower = item.GetValue(3)
  850. maxPower = item.GetValue(4)
  851. addPower = item.GetValue(5)
  852. if maxPower > minPower:
  853. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower+addPower, maxPower+addPower), self.POSITIVE_COLOR)
  854. else:
  855. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower+addPower), self.POSITIVE_COLOR)
  856.  
  857. def __AppendMagicAttackInfo(self):
  858. minMagicAttackPower = item.GetValue(1)
  859. maxMagicAttackPower = item.GetValue(2)
  860. addPower = item.GetValue(5)
  861.  
  862. if minMagicAttackPower > 0 or maxMagicAttackPower > 0:
  863. if maxMagicAttackPower > minMagicAttackPower:
  864. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower+addPower, maxMagicAttackPower+addPower), self.POSITIVE_COLOR)
  865. else:
  866. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower+addPower), self.POSITIVE_COLOR)
  867.  
  868. def __AppendMagicDefenceInfo(self):
  869. magicDefencePower = item.GetValue(0)
  870.  
  871. if magicDefencePower > 0:
  872. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))
  873.  
  874. def __AppendAttributeInformation(self, attrSlot):
  875. if 0 != attrSlot:
  876.  
  877. if attrSlot[0][0]:
  878. self.AppendLineSeparator(0xffffa200)
  879. self.AppendTextLine("Atrybuty:", 0xffffa200)
  880.  
  881. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  882. type = attrSlot[i][0]
  883. value = attrSlot[i][1]
  884.  
  885. if 0 == value:
  886. continue
  887.  
  888. affectString = self.__GetAffectString(type, value)
  889. if affectString:
  890. affectColor = self.__GetAttributeColor(i, value)
  891. self.AppendTextLine(affectString, affectColor)
  892.  
  893. if attrSlot[0][0]:
  894. self.AppendLineSeparator(0xffffa200)
  895.  
  896. def __GetAttributeColor(self, index, value):
  897. if value > 0:
  898. if index >= 5:
  899. return self.SPECIAL_POSITIVE_COLOR2
  900. else:
  901. return self.SPECIAL_POSITIVE_COLOR
  902. elif value == 0:
  903. return self.NORMAL_COLOR
  904. else:
  905. return self.NEGATIVE_COLOR
  906.  
  907. def __IsPolymorphItem(self, itemVnum):
  908. if itemVnum >= 70103 and itemVnum <= 70106:
  909. return 1
  910. return 0
  911.  
  912. def __SetPolymorphItemTitle(self, monsterVnum):
  913. if localeInfo.IsVIETNAM():
  914. itemName =item.GetItemName()
  915. itemName+=" "
  916. itemName+=nonplayer.GetMonsterName(monsterVnum)
  917. else:
  918. itemName =nonplayer.GetMonsterName(monsterVnum)
  919. itemName+=" "
  920. itemName+=item.GetItemName()
  921. self.SetTitle(itemName)
  922.  
  923. def __SetNormalItemTitle(self):
  924. self.SetTitle(item.GetItemName())
  925.  
  926. def __SetSpecialItemTitle(self):
  927. self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)
  928.  
  929. def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
  930. if localeInfo.IsCANADA():
  931. if 72726 == itemVnum or 72730 == itemVnum:
  932. self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  933. return
  934.  
  935. if self.__IsPolymorphItem(itemVnum):
  936. self.__SetPolymorphItemTitle(metinSlot[0])
  937. elif itemVnum in ULEPSZACZE:
  938. self.AppendTextLine(item.GetItemName(), 0xff2495dc)
  939. elif itemVnum in WSPOMAGACZE:
  940. self.AppendTextLine(item.GetItemName(), 0xff00ea95)
  941. elif itemVnum in CRAFTING:
  942. self.AppendTextLine(item.GetItemName(), 0xffe30808)
  943. elif itemVnum in SPECJALNE:
  944. self.AppendTextLine(item.GetItemName(), 0xfff6c604)
  945. elif itemVnum in PRZETOPY:
  946. self.AppendTextLine(item.GetItemName(), 0xff53d0db)
  947. elif itemVnum in PRZEPUSTKA:
  948. self.AppendTextLine(item.GetItemName(), 0xffac1291)
  949. elif itemVnum in PIECZEC:
  950. self.AppendTextLine(item.GetItemName(), 0xfff8970c)
  951. elif itemVnum in SKRZYNIA:
  952. self.AppendTextLine(item.GetItemName(), 0xfff4144e)
  953. elif itemVnum in UNIKAT:
  954. self.AppendTextLine(item.GetItemName(), 0xffa108bf)
  955. else:
  956. if self.__IsAttr(attrSlot):
  957. self.__SetSpecialItemTitle()
  958. return
  959.  
  960. self.__SetNormalItemTitle()
  961.  
  962. def __IsAttr(self, attrSlot):
  963. if not attrSlot:
  964. return False
  965.  
  966. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  967. type = attrSlot[i][0]
  968. if 0 != type:
  969. return True
  970.  
  971. return False
  972.  
  973. def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0):
  974. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  975. metinSlotData=metinSlot[i]
  976. if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE:
  977. metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER
  978.  
  979. self.AddItemData(itemVnum, metinSlot, attrSlot)
  980.  
  981. def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot):
  982. self.__AdjustMaxWidth(attrSlot, itemDesc)
  983. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  984.  
  985. if self.__IsHair(itemVnum):
  986. self.__AppendHairIcon(itemVnum)
  987.  
  988. ### Description ###
  989. self.AppendDescription(itemDesc, 26)
  990. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  991.  
  992. def AddItemData(self, itemVnum, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0):
  993. self.itemVnum = itemVnum
  994. item.SelectItem(itemVnum)
  995. itemType = item.GetItemType()
  996. itemSubType = item.GetItemSubType()
  997.  
  998. if 50026 == itemVnum:
  999. if 0 != metinSlot:
  1000. name = item.GetItemName()
  1001. if metinSlot[0] > 0:
  1002. name += " "
  1003. name += localeInfo.NumberToMoneyString(metinSlot[0])
  1004. self.SetTitle(name)
  1005.  
  1006. self.ShowToolTip()
  1007. return
  1008.  
  1009. ### Skill Book ###
  1010. elif 50300 == itemVnum:
  1011. if 0 != metinSlot:
  1012. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1013.  
  1014. self.ShowToolTip()
  1015. return
  1016. elif 70037 == itemVnum:
  1017. if 0 != metinSlot:
  1018. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1019. self.AppendDescription(item.GetItemDescription(), 26)
  1020. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1021.  
  1022. self.ShowToolTip()
  1023. return
  1024. elif 70055 == itemVnum:
  1025. if 0 != metinSlot:
  1026. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1027. self.AppendDescription(item.GetItemDescription(), 26)
  1028. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1029.  
  1030. self.ShowToolTip()
  1031. return
  1032. ###########################################################################################
  1033.  
  1034.  
  1035. itemDesc = item.GetItemDescription()
  1036. itemSummary = item.GetItemSummary()
  1037.  
  1038. isCostumeItem = 0
  1039. isCostumeHair = 0
  1040. isCostumeBody = 0
  1041.  
  1042. if app.ENABLE_COSTUME_SYSTEM:
  1043. if item.ITEM_TYPE_COSTUME == itemType:
  1044. isCostumeItem = 1
  1045. isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
  1046. isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
  1047.  
  1048. #dbg.TraceError("IS_COSTUME_ITEM! body(%d) hair(%d)" % (isCostumeBody, isCostumeHair))
  1049.  
  1050. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1051. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1052.  
  1053. ### Hair Preview Image ###
  1054. if self.__IsHair(itemVnum):
  1055. self.__AppendHairIcon(itemVnum)
  1056.  
  1057. ### Description ###
  1058. self.AppendDescription(itemDesc, 26)
  1059. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1060.  
  1061. if itemVnum in ULEPSZACZE:
  1062. self.AppendSpace(5)
  1063. self.AutoAppendTextLine("|cff" + ULEPSZACZE_KOLOR + "[Ulepszacz]")
  1064. self.AppendSpace(1)
  1065.  
  1066. if itemVnum in CRAFTING:
  1067. self.AppendSpace(5)
  1068. self.AutoAppendTextLine("|cff" + CRAFTING_KOLOR + "[Crafting]")
  1069. self.AppendSpace(5)
  1070.  
  1071. if itemVnum in SPECJALNE:
  1072. self.AppendSpace(5)
  1073. self.AutoAppendTextLine("|cff" + SPECJALNE_KOLOR + "[Przedmiot Specjalny]")
  1074. self.AppendSpace(5)
  1075.  
  1076. if itemVnum in PRZETOPY:
  1077. self.AppendSpace(5)
  1078. self.AutoAppendTextLine("|cff" + PRZETOPY_KOLOR + "[Przetop]")
  1079. self.AppendSpace(5)
  1080.  
  1081. if itemVnum in PRZEPUSTKA:
  1082. self.AppendSpace(5)
  1083. self.AutoAppendTextLine("|cff" + PRZEPUSTKA_KOLOR + "[Przepustka]")
  1084. self.AppendSpace(5)
  1085.  
  1086. if itemVnum in PIECZEC:
  1087. self.AppendSpace(5)
  1088. self.AutoAppendTextLine("|cff" + PIECZEC_KOLOR + "[Pieczęć]")
  1089. self.AppendSpace(5)
  1090.  
  1091. if itemVnum in SKRZYNIA:
  1092. self.AppendSpace(5)
  1093. self.AutoAppendTextLine("|cff" + SKRZYNIA_KOLOR + "[Skrzynia]")
  1094. self.AppendSpace(5)
  1095.  
  1096. if itemVnum in UNIKAT:
  1097. self.AppendSpace(5)
  1098. self.AutoAppendTextLine("|cff" + UNIKAT_KOLOR + "[Unikat]")
  1099. self.AppendSpace(5)
  1100.  
  1101. if itemVnum in ULEPSZACZE:
  1102. for i in xrange(len(DROP_INFO[itemVnum])):
  1103. # self.AutoAppendTextLine("|cffffa100" + DROP_INFO[itemVnum][i])
  1104. self.AppendTextLine("|cffffa100" + DROP_INFO[itemVnum][i])
  1105. self.AppendSpace(1)
  1106.  
  1107. ### Weapon ###
  1108. if item.ITEM_TYPE_WEAPON == itemType:
  1109.  
  1110. self.__AppendLimitInformation()
  1111.  
  1112. self.AppendSpace(5)
  1113.  
  1114. ## ?I?˘´?? ˇĆ??? ˘¬˘ŇˇĆ??ˇí ˘¬??u C?˘©?C?˘Ą?.
  1115. if item.WEAPON_FAN == itemSubType:
  1116. self.__AppendMagicAttackInfo()
  1117. self.__AppendAttackPowerInfo()
  1118.  
  1119. else:
  1120. self.__AppendAttackPowerInfo()
  1121. self.__AppendMagicAttackInfo()
  1122.  
  1123. self.__AppendAffectInformation()
  1124. self.__AppendAttributeInformation(attrSlot)
  1125.  
  1126. self.AppendWearableInformation()
  1127. self.__AppendMetinSlotInfo(metinSlot)
  1128.  
  1129. ### Armor ###
  1130. elif item.ITEM_TYPE_ARMOR == itemType:
  1131. self.__AppendLimitInformation()
  1132.  
  1133. ## ???iˇ¤A
  1134. defGrade = item.GetValue(1)
  1135. defBonus = item.GetValue(5)*2 ## ???iˇ¤A C?˘©? ?©¬˘¬? ĄěC˘ĄA ?˘çA|˘¬| ?oA˘´
  1136. if defGrade > 0:
  1137. self.AppendSpace(5)
  1138. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  1139.  
  1140. self.__AppendMagicDefenceInfo()
  1141. self.__AppendAffectInformation()
  1142. self.__AppendAttributeInformation(attrSlot)
  1143.  
  1144. self.AppendWearableInformation()
  1145.  
  1146. if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  1147. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  1148. else:
  1149. self.__AppendMetinSlotInfo(metinSlot)
  1150.  
  1151. ### Ring Slot Item (Not UNIQUE) ###
  1152. elif item.ITEM_TYPE_RING == itemType:
  1153. self.__AppendLimitInformation()
  1154. self.__AppendAffectInformation()
  1155. self.__AppendAttributeInformation(attrSlot)
  1156.  
  1157. #?YAo ??A? ˘©?˘©??? ˇĆuˇ¤?C??ˇľ ??AˇŔ ˇľa?? ??A˘´
  1158. #self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001)
  1159.  
  1160.  
  1161. ### Belt Item ###
  1162. elif item.ITEM_TYPE_BELT == itemType:
  1163. self.__AppendLimitInformation()
  1164. self.__AppendAffectInformation()
  1165. self.__AppendAttributeInformation(attrSlot)
  1166.  
  1167. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  1168.  
  1169. ## AU˘©??? ?????? ##
  1170. elif 0 != isCostumeItem:
  1171. self.__AppendLimitInformation()
  1172. self.__AppendAffectInformation()
  1173. self.__AppendAttributeInformation(attrSlot)
  1174.  
  1175. self.AppendWearableInformation()
  1176.  
  1177. bHasRealtimeFlag = 0
  1178.  
  1179. ## ˇíc?eˇĆ˘§˘ĄE ˘©?ˇĆ¨© A|C??? ?O˘ĄAAo ?¨©???˘¬ˇĆi
  1180. for i in xrange(item.LIMIT_MAX_NUM):
  1181. (limitType, limitValue) = item.GetLimit(i)
  1182.  
  1183. if item.LIMIT_REAL_TIME == limitType:
  1184. bHasRealtimeFlag = 1
  1185.  
  1186. ## ?O˘Ą?˘¬e ˇĆuˇ¤? A˘´?˘¬˘¬| C?˘©?CO. ex) ©©˘­?? ˘©?ˇĆ¨© : 6?? 6˘©?ˇĆ¨© 58?©˘
  1187. if 1 == bHasRealtimeFlag:
  1188. self.AppendMallItemLastTime(metinSlot[0])
  1189. #dbg.TraceError("1) REAL_TIME flag On ")
  1190.  
  1191. ## Rod ##
  1192. elif item.ITEM_TYPE_ROD == itemType:
  1193.  
  1194. if 0 != metinSlot:
  1195. curLevel = item.GetValue(0) / 10
  1196. curEXP = metinSlot[0]
  1197. maxEXP = item.GetValue(2)
  1198. self.__AppendLimitInformation()
  1199. self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  1200.  
  1201. ## Pick ##
  1202. elif item.ITEM_TYPE_PICK == itemType:
  1203.  
  1204. if 0 != metinSlot:
  1205. curLevel = item.GetValue(0) / 10
  1206. curEXP = metinSlot[0]
  1207. maxEXP = item.GetValue(2)
  1208. self.__AppendLimitInformation()
  1209. self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  1210.  
  1211. ## Lottery ##
  1212. elif item.ITEM_TYPE_LOTTERY == itemType:
  1213. if 0 != metinSlot:
  1214.  
  1215. ticketNumber = int(metinSlot[0])
  1216. stepNumber = int(metinSlot[1])
  1217.  
  1218. self.AppendSpace(5)
  1219. self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  1220. self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  1221.  
  1222. ### Metin ###
  1223. elif item.ITEM_TYPE_METIN == itemType:
  1224. self.AppendMetinInformation()
  1225. self.AppendMetinWearInformation()
  1226.  
  1227. ### Fish ###
  1228. elif item.ITEM_TYPE_FISH == itemType:
  1229. if 0 != metinSlot:
  1230. self.__AppendFishInfo(metinSlot[0])
  1231.  
  1232. ## item.ITEM_TYPE_BLEND
  1233. elif item.ITEM_TYPE_BLEND == itemType:
  1234. self.__AppendLimitInformation()
  1235.  
  1236. if metinSlot:
  1237. affectType = metinSlot[0]
  1238. affectValue = metinSlot[1]
  1239. time = metinSlot[2]
  1240. self.AppendSpace(5)
  1241. affectText = self.__GetAffectString(affectType, affectValue)
  1242.  
  1243. self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1244.  
  1245. if time > 0:
  1246. minute = (time / 60)
  1247. second = (time % 60)
  1248. timeString = localeInfo.TOOLTIP_POTION_TIME
  1249.  
  1250. if minute > 0:
  1251. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1252. if second > 0:
  1253. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1254.  
  1255. self.AppendTextLine(timeString)
  1256. else:
  1257. self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME)
  1258. else:
  1259. self.AppendTextLine("BLEND_POTION_NO_INFO")
  1260.  
  1261. elif item.ITEM_TYPE_UNIQUE == itemType:
  1262. if 0 != metinSlot:
  1263. bHasRealtimeFlag = 0
  1264.  
  1265. for i in xrange(item.LIMIT_MAX_NUM):
  1266. (limitType, limitValue) = item.GetLimit(i)
  1267.  
  1268. if item.LIMIT_REAL_TIME == limitType:
  1269. bHasRealtimeFlag = 1
  1270.  
  1271. if 1 == bHasRealtimeFlag:
  1272. self.AppendMallItemLastTime(metinSlot[0])
  1273. else:
  1274. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1275.  
  1276. if 1 == item.GetValue(2): ## ˘©C˘©?ˇĆ¨© ???e Flag / ??A? ??C?ĄěĄě A?˘Ą?
  1277. self.AppendMallItemLastTime(time)
  1278. else:
  1279. self.AppendUniqueItemLastTime(time)
  1280.  
  1281. ### Use ###
  1282. elif item.ITEM_TYPE_USE == itemType:
  1283. self.__AppendLimitInformation()
  1284.  
  1285. if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1286. self.__AppendPotionInformation()
  1287.  
  1288. elif item.USE_ABILITY_UP == itemSubType:
  1289. self.__AppendAbilityPotionInformation()
  1290.  
  1291.  
  1292. ## ?Ąě?˘ç ˇĆˇ§Aoˇľa
  1293. if 27989 == itemVnum or 76006 == itemVnum:
  1294. if 0 != metinSlot:
  1295. useCount = int(metinSlot[0])
  1296.  
  1297. self.AppendSpace(5)
  1298. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR)
  1299.  
  1300. if 79006 >= itemVnum and 79012 <= itemVnum:
  1301. if 0 != metinSlot:
  1302. useCount = int(metinSlot[0])
  1303.  
  1304. self.AppendSpace(5)
  1305. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (5 - useCount), self.NORMAL_COLOR)
  1306.  
  1307. ## ?????˘ç ˇĆˇ§Aoˇľa
  1308. elif 50004 == itemVnum:
  1309. if 0 != metinSlot:
  1310. useCount = int(metinSlot[0])
  1311.  
  1312. self.AppendSpace(5)
  1313. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1314.  
  1315. ## ?UĄě??ˇĆ??
  1316. elif constInfo.IS_AUTO_POTION(itemVnum):
  1317. if 0 != metinSlot:
  1318. ## 0: ?ˇĆ???ˇ©, 1: ˇíc?eˇ¤˘ç, 2: ??ˇ¤˘ç
  1319. isActivated = int(metinSlot[0])
  1320. usedAmount = float(metinSlot[1])
  1321. totalAmount = float(metinSlot[2])
  1322.  
  1323. if 0 == totalAmount:
  1324. totalAmount = 1
  1325.  
  1326. self.AppendSpace(5)
  1327.  
  1328. if 0 != isActivated:
  1329. self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1330. self.AppendSpace(5)
  1331.  
  1332. self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1333.  
  1334. ## ˇľI?? ˇľa???I
  1335. elif itemVnum in WARP_SCROLLS:
  1336. if 0 != metinSlot:
  1337. xPos = int(metinSlot[0])
  1338. yPos = int(metinSlot[1])
  1339.  
  1340. if xPos != 0 and yPos != 0:
  1341. (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1342.  
  1343. localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1344.  
  1345. self.AppendSpace(5)
  1346.  
  1347. if localeMapName!="":
  1348. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1349. else:
  1350. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1351. dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1352.  
  1353. #####
  1354. if item.USE_SPECIAL == itemSubType:
  1355. bHasRealtimeFlag = 0
  1356. for i in xrange(item.LIMIT_MAX_NUM):
  1357. (limitType, limitValue) = item.GetLimit(i)
  1358.  
  1359. if item.LIMIT_REAL_TIME == limitType:
  1360. bHasRealtimeFlag = 1
  1361.  
  1362. ## ?O˘Ą?˘¬e ˇĆuˇ¤? A˘´?˘¬˘¬| C?˘©?CO. ex) ©©˘­?? ˘©?ˇĆ¨© : 6?? 6˘©?ˇĆ¨© 58?©˘
  1363. if 1 == bHasRealtimeFlag:
  1364. self.AppendMallItemLastTime(metinSlot[0])
  1365. else:
  1366. # ... ??ˇĆ?... ?ˇ©?o?˘§˘ĄA ??ˇ¤ˇľ ˘©?ˇĆ¨© ???¨Ď ??ĄěC?i ?O˘ĄAĄě?...
  1367. # ?O ??ˇ¤ˇľˇĆO ?O˘ĄAAo ?EAo˘ĄA ˘¬?C?©©? ˇľˇż©©E ĄěI?U...
  1368. if 0 != metinSlot:
  1369. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1370.  
  1371. ## ˘©C˘©?ˇĆ¨© ???e Flag
  1372. if 1 == item.GetValue(2):
  1373. self.AppendMallItemLastTime(time)
  1374.  
  1375. elif item.USE_TIME_CHARGE_PER == itemSubType:
  1376. bHasRealtimeFlag = 0
  1377. for i in xrange(item.LIMIT_MAX_NUM):
  1378. (limitType, limitValue) = item.GetLimit(i)
  1379.  
  1380. if item.LIMIT_REAL_TIME == limitType:
  1381. bHasRealtimeFlag = 1
  1382. if metinSlot[2]:
  1383. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  1384. else:
  1385. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  1386.  
  1387. ## ?O˘Ą?˘¬e ˇĆuˇ¤? A˘´?˘¬˘¬| C?˘©?CO. ex) ©©˘­?? ˘©?ˇĆ¨© : 6?? 6˘©?ˇĆ¨© 58?©˘
  1388. if 1 == bHasRealtimeFlag:
  1389. self.AppendMallItemLastTime(metinSlot[0])
  1390.  
  1391. elif item.USE_TIME_CHARGE_FIX == itemSubType:
  1392. bHasRealtimeFlag = 0
  1393. for i in xrange(item.LIMIT_MAX_NUM):
  1394. (limitType, limitValue) = item.GetLimit(i)
  1395.  
  1396. if item.LIMIT_REAL_TIME == limitType:
  1397. bHasRealtimeFlag = 1
  1398. if metinSlot[2]:
  1399. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  1400. else:
  1401. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  1402.  
  1403. ## ?O˘Ą?˘¬e ˇĆuˇ¤? A˘´?˘¬˘¬| C?˘©?CO. ex) ©©˘­?? ˘©?ˇĆ¨© : 6?? 6˘©?ˇĆ¨© 58?©˘
  1404. if 1 == bHasRealtimeFlag:
  1405. self.AppendMallItemLastTime(metinSlot[0])
  1406.  
  1407. elif item.ITEM_TYPE_QUEST == itemType:
  1408. for i in xrange(item.LIMIT_MAX_NUM):
  1409. (limitType, limitValue) = item.GetLimit(i)
  1410.  
  1411. if item.LIMIT_REAL_TIME == limitType:
  1412. self.AppendMallItemLastTime(metinSlot[0])
  1413. elif item.ITEM_TYPE_DS == itemType:
  1414. self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1415. self.__AppendAttributeInformation(attrSlot)
  1416. else:
  1417. self.__AppendLimitInformation()
  1418.  
  1419. if itemVnum in WSPOMAGACZE:
  1420. self.AppendSpace(5)
  1421. self.AutoAppendTextLine("|cff" + WSPOMAGACZE_KOLOR + "[Wspomagacz]")
  1422. self.AppendSpace(5)
  1423.  
  1424. for i in xrange(item.LIMIT_MAX_NUM):
  1425. (limitType, limitValue) = item.GetLimit(i)
  1426. #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue))
  1427.  
  1428. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1429. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1430. #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ")
  1431.  
  1432. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1433. self.AppendTimerBasedOnWearLastTime(metinSlot)
  1434. #dbg.TraceError("1) REAL_TIME flag On ")
  1435.  
  1436. if chr.IsGameMaster(player.GetMainCharacterIndex()):
  1437. self.AppendTextLine("ID Przedmiotu: "+str(itemVnum), self.SPECIAL_POSITIVE_COLOR)
  1438.  
  1439.  
  1440.  
  1441. self.ShowToolTip()
  1442.  
  1443. def __DragonSoulInfoString (self, dwVnum):
  1444. step = (dwVnum / 100) % 10
  1445. refine = (dwVnum / 10) % 10
  1446. if 0 == step:
  1447. return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1448. elif 1 == step:
  1449. return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1450. elif 2 == step:
  1451. return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1452. elif 3 == step:
  1453. return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1454. elif 4 == step:
  1455. return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1456. else:
  1457. return ""
  1458.  
  1459.  
  1460. ## C??i?IˇĆ˘§?
  1461. def __IsHair(self, itemVnum):
  1462. return (self.__IsOldHair(itemVnum) or
  1463. self.__IsNewHair(itemVnum) or
  1464. self.__IsNewHair2(itemVnum) or
  1465. self.__IsNewHair3(itemVnum) or
  1466. self.__IsCostumeHair(itemVnum)
  1467. )
  1468.  
  1469. def __IsOldHair(self, itemVnum):
  1470. return itemVnum > 73000 and itemVnum < 74000
  1471.  
  1472. def __IsNewHair(self, itemVnum):
  1473. return itemVnum > 74000 and itemVnum < 75000
  1474.  
  1475. def __IsNewHair2(self, itemVnum):
  1476. return itemVnum > 75000 and itemVnum < 76000
  1477.  
  1478. def __IsNewHair3(self, itemVnum):
  1479. return ((74012 < itemVnum and itemVnum < 74022) or
  1480. (74262 < itemVnum and itemVnum < 74272) or
  1481. (74512 < itemVnum and itemVnum < 74522) or
  1482. (74762 < itemVnum and itemVnum < 74772) or
  1483. (85004 < itemVnum and itemVnum < 85011))
  1484.  
  1485. def __IsCostumeHair(self, itemVnum):
  1486. return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1487.  
  1488. def __AppendHairIcon(self, itemVnum):
  1489. itemImage = ui.ImageBox()
  1490. itemImage.SetParent(self)
  1491. itemImage.Show()
  1492.  
  1493. if self.__IsOldHair(itemVnum):
  1494. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1495. elif self.__IsNewHair3(itemVnum):
  1496. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1497. elif self.__IsNewHair(itemVnum): # ˇľaA˘¬ C??i ???¨©˘¬| ?ˇţˇĆa˘©?A??ˇ© ˇíc?eC?˘Ą?. ˇí?ˇ¤I?i ???????? 1000˘¬˘¬?ˇ© ???¨©ˇĆ˘§ ˘Ą??u˘Ą?.
  1498. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1499. elif self.__IsNewHair2(itemVnum):
  1500. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1501. elif self.__IsCostumeHair(itemVnum):
  1502. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1503.  
  1504. itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1505. self.toolTipHeight += itemImage.GetHeight()
  1506. #self.toolTipWidth += itemImage.GetWidth()/2
  1507. self.childrenList.append(itemImage)
  1508. self.ResizeToolTip()
  1509.  
  1510. ## ˇíc??AiˇĆ˘§ ?ˇě Description ?? ˇĆ??? ???A ˇíc??Ai˘¬| A˘ŇA˘´C?˘Ą?
  1511. def __AdjustMaxWidth(self, attrSlot, desc):
  1512. newToolTipWidth = self.toolTipWidth
  1513. newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1514. newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1515. if newToolTipWidth > self.toolTipWidth:
  1516. self.toolTipWidth = newToolTipWidth
  1517. self.ResizeToolTip()
  1518.  
  1519. def __AdjustAttrMaxWidth(self, attrSlot):
  1520. if 0 == attrSlot:
  1521. return self.toolTipWidth
  1522.  
  1523. maxWidth = self.toolTipWidth
  1524. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1525. type = attrSlot[i][0]
  1526. value = attrSlot[i][1]
  1527. if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1528. if value > 0:
  1529. maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1530.  
  1531. # ATTR_CHANGE_TOOLTIP_WIDTH
  1532. #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth)
  1533. #self.ResizeToolTip()
  1534. # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH
  1535.  
  1536. return maxWidth
  1537.  
  1538. def __AdjustDescMaxWidth(self, desc):
  1539. if len(desc) < DESC_DEFAULT_MAX_COLS:
  1540. return self.toolTipWidth
  1541.  
  1542. return DESC_WESTERN_MAX_WIDTH
  1543.  
  1544. def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1545. skillName = skill.GetSkillName(skillIndex)
  1546.  
  1547. if not skillName:
  1548. return
  1549.  
  1550. if localeInfo.IsVIETNAM():
  1551. itemName = bookName + " " + skillName
  1552. else:
  1553. itemName = skillName + " " + bookName
  1554. self.SetTitle(itemName)
  1555.  
  1556. def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1557. self.AppendSpace(5)
  1558. self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1559. self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1560.  
  1561. if curEXP == maxEXP:
  1562. self.AppendSpace(5)
  1563. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1564. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1565. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1566.  
  1567.  
  1568. def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1569. self.AppendSpace(5)
  1570. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1571. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1572.  
  1573. if curEXP == maxEXP:
  1574. self.AppendSpace(5)
  1575. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  1576. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  1577. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  1578.  
  1579. def __AppendLimitInformation(self):
  1580.  
  1581. appendSpace = False
  1582.  
  1583. for i in xrange(item.LIMIT_MAX_NUM):
  1584.  
  1585. (limitType, limitValue) = item.GetLimit(i)
  1586.  
  1587. if limitValue > 0:
  1588. if False == appendSpace:
  1589. self.AppendSpace(5)
  1590. appendSpace = True
  1591.  
  1592. else:
  1593. continue
  1594.  
  1595. if item.LIMIT_LEVEL == limitType:
  1596. color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  1597. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  1598. """
  1599. elif item.LIMIT_STR == limitType:
  1600. color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  1601. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  1602. elif item.LIMIT_DEX == limitType:
  1603. color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  1604. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  1605. elif item.LIMIT_INT == limitType:
  1606. color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  1607. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  1608. elif item.LIMIT_CON == limitType:
  1609. color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  1610. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  1611. """
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624. def __GetAffectString(self, affectType, affectValue):
  1625. if 0 == affectType:
  1626. return None
  1627.  
  1628. if 0 == affectValue:
  1629. return None
  1630.  
  1631. try:
  1632. return self.AFFECT_DICT[affectType](affectValue)
  1633. except TypeError:
  1634. return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  1635. except KeyError:
  1636. return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  1637.  
  1638. def __AppendAffectInformation(self):
  1639. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1640.  
  1641. (affectType, affectValue) = item.GetAffect(i)
  1642.  
  1643. affectString = self.__GetAffectString(affectType, affectValue)
  1644. if affectString:
  1645. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1646.  
  1647. def AppendWearableInformation(self):
  1648.  
  1649. self.AppendSpace(5)
  1650. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  1651.  
  1652. flagList = (
  1653. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  1654. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  1655. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  1656. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
  1657.  
  1658. characterNames = ""
  1659. for i in xrange(self.CHARACTER_COUNT):
  1660.  
  1661. name = self.CHARACTER_NAMES[i]
  1662. flag = flagList[i]
  1663.  
  1664. if flag:
  1665. characterNames += " "
  1666. characterNames += name
  1667.  
  1668. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  1669. textLine.SetFeather()
  1670.  
  1671. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  1672. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  1673. textLine.SetFeather()
  1674.  
  1675. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  1676. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  1677. textLine.SetFeather()
  1678.  
  1679. def __AppendPotionInformation(self):
  1680. self.AppendSpace(5)
  1681.  
  1682. healHP = item.GetValue(0)
  1683. healSP = item.GetValue(1)
  1684. healStatus = item.GetValue(2)
  1685. healPercentageHP = item.GetValue(3)
  1686. healPercentageSP = item.GetValue(4)
  1687.  
  1688. if healHP > 0:
  1689. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  1690. if healSP > 0:
  1691. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  1692. if healStatus != 0:
  1693. self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  1694. if healPercentageHP > 0:
  1695. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  1696. if healPercentageSP > 0:
  1697. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  1698.  
  1699. def __AppendAbilityPotionInformation(self):
  1700.  
  1701. self.AppendSpace(5)
  1702.  
  1703. abilityType = item.GetValue(0)
  1704. time = item.GetValue(1)
  1705. point = item.GetValue(2)
  1706.  
  1707. if abilityType == item.APPLY_ATT_SPEED:
  1708. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  1709. elif abilityType == item.APPLY_MOV_SPEED:
  1710. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  1711.  
  1712. if time > 0:
  1713. minute = (time / 60)
  1714. second = (time % 60)
  1715. timeString = localeInfo.TOOLTIP_POTION_TIME
  1716.  
  1717. if minute > 0:
  1718. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1719. if second > 0:
  1720. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1721.  
  1722. self.AppendTextLine(timeString)
  1723.  
  1724. def GetPriceColor(self, price):
  1725. if price>=constInfo.HIGH_PRICE:
  1726. return self.HIGH_PRICE_COLOR
  1727. if price>=constInfo.MIDDLE_PRICE:
  1728. return self.MIDDLE_PRICE_COLOR
  1729. else:
  1730. return self.LOW_PRICE_COLOR
  1731.  
  1732. def AppendPrice(self, price):
  1733. self.AppendSpace(5)
  1734. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1735.  
  1736. def AppendPriceBySecondaryCoin(self, price):
  1737. self.AppendSpace(5)
  1738. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  1739.  
  1740. def AppendSellingPrice(self, price):
  1741. if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
  1742. self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  1743. self.AppendSpace(5)
  1744. else:
  1745. self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1746. self.AppendSpace(5)
  1747.  
  1748. def AppendMetinInformation(self):
  1749. affectType, affectValue = item.GetAffect(0)
  1750. #affectType = item.GetValue(0)
  1751. #affectValue = item.GetValue(1)
  1752.  
  1753. affectString = self.__GetAffectString(affectType, affectValue)
  1754.  
  1755. if affectString:
  1756. self.AppendSpace(5)
  1757. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1758.  
  1759. def AppendMetinWearInformation(self):
  1760.  
  1761. self.AppendSpace(5)
  1762. self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  1763.  
  1764. flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  1765. item.IsWearableFlag(item.WEARABLE_HEAD),
  1766. item.IsWearableFlag(item.WEARABLE_FOOTS),
  1767. item.IsWearableFlag(item.WEARABLE_WRIST),
  1768. item.IsWearableFlag(item.WEARABLE_WEAPON),
  1769. item.IsWearableFlag(item.WEARABLE_NECK),
  1770. item.IsWearableFlag(item.WEARABLE_EAR),
  1771. item.IsWearableFlag(item.WEARABLE_UNIQUE),
  1772. item.IsWearableFlag(item.WEARABLE_SHIELD),
  1773. item.IsWearableFlag(item.WEARABLE_ARROW))
  1774.  
  1775. wearNames = ""
  1776. for i in xrange(self.WEAR_COUNT):
  1777.  
  1778. name = self.WEAR_NAMES[i]
  1779. flag = flagList[i]
  1780.  
  1781. if flag:
  1782. wearNames += " "
  1783. wearNames += name
  1784.  
  1785. textLine = ui.TextLine()
  1786. textLine.SetParent(self)
  1787. textLine.SetFontName(self.defFontName)
  1788. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  1789. textLine.SetHorizontalAlignCenter()
  1790. textLine.SetPackedFontColor(self.NORMAL_COLOR)
  1791. textLine.SetText(wearNames)
  1792. textLine.Show()
  1793. self.childrenList.append(textLine)
  1794.  
  1795. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  1796. self.ResizeToolTip()
  1797.  
  1798. def GetMetinSocketType(self, number):
  1799. if player.METIN_SOCKET_TYPE_NONE == number:
  1800. return player.METIN_SOCKET_TYPE_NONE
  1801. elif player.METIN_SOCKET_TYPE_SILVER == number:
  1802. return player.METIN_SOCKET_TYPE_SILVER
  1803. elif player.METIN_SOCKET_TYPE_GOLD == number:
  1804. return player.METIN_SOCKET_TYPE_GOLD
  1805. else:
  1806. item.SelectItem(number)
  1807. if item.METIN_NORMAL == item.GetItemSubType():
  1808. return player.METIN_SOCKET_TYPE_SILVER
  1809. elif item.METIN_GOLD == item.GetItemSubType():
  1810. return player.METIN_SOCKET_TYPE_GOLD
  1811. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  1812. return player.METIN_SOCKET_TYPE_SILVER
  1813. elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  1814. return player.METIN_SOCKET_TYPE_SILVER
  1815. elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  1816. return player.METIN_SOCKET_TYPE_SILVER
  1817.  
  1818. return player.METIN_SOCKET_TYPE_NONE
  1819.  
  1820. def GetMetinItemIndex(self, number):
  1821. if player.METIN_SOCKET_TYPE_SILVER == number:
  1822. return 0
  1823. if player.METIN_SOCKET_TYPE_GOLD == number:
  1824. return 0
  1825.  
  1826. return number
  1827.  
  1828. def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
  1829. ACCESSORY_SOCKET_MAX_SIZE = 3
  1830.  
  1831. cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  1832. end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  1833.  
  1834. affectType1, affectValue1 = item.GetAffect(0)
  1835. affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  1836.  
  1837. affectType2, affectValue2 = item.GetAffect(1)
  1838. affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  1839.  
  1840. mtrlPos=0
  1841. mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  1842. for mtrl in mtrlList:
  1843. affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
  1844. affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  1845.  
  1846. leftTime = 0
  1847. if cur == mtrlPos+1:
  1848. leftTime=metinSlot[2]
  1849.  
  1850. self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  1851. mtrlPos+=1
  1852.  
  1853. def __AppendMetinSlotInfo(self, metinSlot):
  1854. if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  1855. return
  1856.  
  1857. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1858. self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  1859.  
  1860. def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  1861. if 0 == metinSlot:
  1862. return 1
  1863.  
  1864. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1865. metinSlotData=metinSlot[i]
  1866. if 0 != self.GetMetinSocketType(metinSlotData):
  1867. if 0 != self.GetMetinItemIndex(metinSlotData):
  1868. return 0
  1869.  
  1870. return 1
  1871.  
  1872. def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  1873.  
  1874. slotType = self.GetMetinSocketType(metinSlotData)
  1875. itemIndex = self.GetMetinItemIndex(metinSlotData)
  1876.  
  1877. if 0 == slotType:
  1878. return
  1879.  
  1880. self.AppendSpace(5)
  1881.  
  1882. slotImage = ui.ImageBox()
  1883. slotImage.SetParent(self)
  1884. slotImage.Show()
  1885.  
  1886. ## Name
  1887. nameTextLine = ui.TextLine()
  1888. nameTextLine.SetParent(self)
  1889. nameTextLine.SetFontName(self.defFontName)
  1890. nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  1891. nameTextLine.SetOutline()
  1892. nameTextLine.SetFeather()
  1893. nameTextLine.Show()
  1894.  
  1895. self.childrenList.append(nameTextLine)
  1896.  
  1897. if player.METIN_SOCKET_TYPE_SILVER == slotType:
  1898. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  1899. elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  1900. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  1901.  
  1902. self.childrenList.append(slotImage)
  1903.  
  1904. if localeInfo.IsARABIC():
  1905. slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  1906. nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  1907. else:
  1908. slotImage.SetPosition(9, self.toolTipHeight-1)
  1909. nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  1910.  
  1911. metinImage = ui.ImageBox()
  1912. metinImage.SetParent(self)
  1913. metinImage.Show()
  1914. self.childrenList.append(metinImage)
  1915.  
  1916. if itemIndex:
  1917.  
  1918. item.SelectItem(itemIndex)
  1919.  
  1920. ## Image
  1921. try:
  1922. metinImage.LoadImage(item.GetIconImageFileName())
  1923. except:
  1924. dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  1925. (itemIndex, item.GetIconImageFileName())
  1926. )
  1927.  
  1928. nameTextLine.SetText(item.GetItemName())
  1929.  
  1930. ## Affect
  1931. affectTextLine = ui.TextLine()
  1932. affectTextLine.SetParent(self)
  1933. affectTextLine.SetFontName(self.defFontName)
  1934. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1935. affectTextLine.SetOutline()
  1936. affectTextLine.SetFeather()
  1937. affectTextLine.Show()
  1938.  
  1939. if localeInfo.IsARABIC():
  1940. metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  1941. affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  1942. else:
  1943. metinImage.SetPosition(10, self.toolTipHeight)
  1944. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  1945.  
  1946. if custumAffectString:
  1947. affectTextLine.SetText(custumAffectString)
  1948. elif itemIndex!=constInfo.ERROR_METIN_STONE:
  1949. affectType, affectValue = item.GetAffect(0)
  1950. affectString = self.__GetAffectString(affectType, affectValue)
  1951. if affectString:
  1952. affectTextLine.SetText(affectString)
  1953. else:
  1954. affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  1955.  
  1956. self.childrenList.append(affectTextLine)
  1957.  
  1958. if custumAffectString2:
  1959. affectTextLine = ui.TextLine()
  1960. affectTextLine.SetParent(self)
  1961. affectTextLine.SetFontName(self.defFontName)
  1962. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1963. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1964. affectTextLine.SetOutline()
  1965. affectTextLine.SetFeather()
  1966. affectTextLine.Show()
  1967. affectTextLine.SetText(custumAffectString2)
  1968. self.childrenList.append(affectTextLine)
  1969. self.toolTipHeight += 16 + 2
  1970.  
  1971. if 0 != leftTime:
  1972. timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  1973.  
  1974. timeTextLine = ui.TextLine()
  1975. timeTextLine.SetParent(self)
  1976. timeTextLine.SetFontName(self.defFontName)
  1977. timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1978. timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1979. timeTextLine.SetOutline()
  1980. timeTextLine.SetFeather()
  1981. timeTextLine.Show()
  1982. timeTextLine.SetText(timeText)
  1983. self.childrenList.append(timeTextLine)
  1984. self.toolTipHeight += 16 + 2
  1985.  
  1986. else:
  1987. nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  1988.  
  1989. self.toolTipHeight += 35
  1990. self.ResizeToolTip()
  1991.  
  1992. def __AppendFishInfo(self, size):
  1993. if size > 0:
  1994. self.AppendSpace(5)
  1995. self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  1996.  
  1997. def AppendUniqueItemLastTime(self, restMin):
  1998. restSecond = restMin*60
  1999. self.AppendSpace(5)
  2000. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  2001.  
  2002. def AppendMallItemLastTime(self, endTime):
  2003. leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  2004. self.AppendSpace(5)
  2005. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  2006.  
  2007. def AppendTimerBasedOnWearLastTime(self, metinSlot):
  2008. if 0 == metinSlot[0]:
  2009. self.AppendSpace(5)
  2010. self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  2011. else:
  2012. endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  2013. self.AppendMallItemLastTime(endTime)
  2014.  
  2015. def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):
  2016. useCount = metinSlot[1]
  2017. endTime = metinSlot[0]
  2018.  
  2019. # C? ????˘ŇoĄěĄě ˇíc?eC©¬˘Ą?˘¬e Socket0?˘§ A?ˇ¤a ˘©?ˇĆ¨©(2012©©a 3?? 1?? 13˘©? 01?©˘ ˇĆˇĆ??..) ?? ?UCo?O?˘©.
  2020. # ˇíc?eC?Ao ????˘Ą?˘¬e Socket0?˘§ ???eˇĆ˘§˘ĄE˘©?ˇĆ¨©(??˘¬|?ˇż˘¬e 600 ˇĆˇĆ?? ˇĆ?. ??˘ĄU?ˇ×)?? Ąěe?i?O?ˇí ?o ?OˇĆi, 0??˘Ňo˘¬e Limit Value?˘§ ?O˘ĄA ???eˇĆ˘§˘ĄE˘©?ˇĆ¨©?ˇí ˇíc?eC?˘Ą?.
  2021. if 0 == useCount:
  2022. if 0 == endTime:
  2023. (limitType, limitValue) = item.GetLimit(limitIndex)
  2024. endTime = limitValue
  2025.  
  2026. endTime += app.GetGlobalTimeStamp()
  2027.  
  2028. self.AppendMallItemLastTime(endTime)
  2029.  
  2030. class HyperlinkItemToolTip(ItemToolTip):
  2031. def __init__(self):
  2032. ItemToolTip.__init__(self, isPickable=True)
  2033.  
  2034. def SetHyperlinkItem(self, tokens):
  2035. minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
  2036. maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  2037. if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  2038. head, vnum, flag = tokens[:3]
  2039. itemVnum = int(vnum, 16)
  2040. metinSlot = [int(metin, 16) for metin in tokens[3:6]]
  2041.  
  2042. rests = tokens[6:]
  2043. if rests:
  2044. attrSlot = []
  2045.  
  2046. rests.reverse()
  2047. while rests:
  2048. key = int(rests.pop(), 16)
  2049. if rests:
  2050. val = int(rests.pop())
  2051. attrSlot.append((key, val))
  2052.  
  2053. attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  2054. else:
  2055. attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  2056.  
  2057. self.ClearToolTip()
  2058. self.AddItemData(itemVnum, metinSlot, attrSlot)
  2059.  
  2060. ItemToolTip.OnUpdate(self)
  2061.  
  2062. def OnUpdate(self):
  2063. pass
  2064.  
  2065. def OnMouseLeftButtonDown(self):
  2066. self.Hide()
  2067.  
  2068. class SkillToolTip(ToolTip):
  2069.  
  2070. POINT_NAME_DICT = {
  2071. player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  2072. player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  2073. }
  2074.  
  2075. SKILL_TOOL_TIP_WIDTH = 200
  2076. PARTY_SKILL_TOOL_TIP_WIDTH = 340
  2077.  
  2078. PARTY_SKILL_EXPERIENCE_AFFECT_LIST = ( ( 2, 2, 10,),
  2079. ( 8, 3, 20,),
  2080. (14, 4, 30,),
  2081. (22, 5, 45,),
  2082. (28, 6, 60,),
  2083. (34, 7, 80,),
  2084. (38, 8, 100,), )
  2085.  
  2086. PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = ( ( 4, 2, 1, 0,),
  2087. (10, 3, 2, 0,),
  2088. (16, 4, 2, 1,),
  2089. (24, 5, 2, 2,), )
  2090.  
  2091. PARTY_SKILL_ATTACKER_AFFECT_LIST = ( ( 36, 3, ),
  2092. ( 26, 1, ),
  2093. ( 32, 2, ), )
  2094.  
  2095. SKILL_GRADE_NAME = { player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  2096. player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  2097. player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  2098.  
  2099. AFFECT_NAME_DICT = {
  2100. "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  2101. "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  2102. "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  2103. "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  2104. "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  2105. "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  2106. "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  2107. "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  2108. }
  2109. AFFECT_APPEND_TEXT_DICT = {
  2110. "DODGE" : "%",
  2111. "RESIST_NORMAL" : "%",
  2112. "REFLECT_MELEE" : "%",
  2113. }
  2114.  
  2115. def __init__(self):
  2116. ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  2117. def __del__(self):
  2118. ToolTip.__del__(self)
  2119.  
  2120. def SetSkill(self, skillIndex, skillLevel = -1):
  2121.  
  2122. if 0 == skillIndex:
  2123. return
  2124.  
  2125. if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2126.  
  2127. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2128. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2129. self.ResizeToolTip()
  2130.  
  2131. self.AppendDefaultData(skillIndex)
  2132. self.AppendSkillConditionData(skillIndex)
  2133. self.AppendGuildSkillData(skillIndex, skillLevel)
  2134.  
  2135. else:
  2136.  
  2137. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2138. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2139. self.ResizeToolTip()
  2140.  
  2141. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2142. skillGrade = player.GetSkillGrade(slotIndex)
  2143. skillLevel = player.GetSkillLevel(slotIndex)
  2144. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2145. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2146.  
  2147. self.AppendDefaultData(skillIndex)
  2148. self.AppendSkillConditionData(skillIndex)
  2149. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2150. self.AppendSkillRequirement(skillIndex, skillLevel)
  2151.  
  2152. self.ShowToolTip()
  2153.  
  2154. def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  2155.  
  2156. if 0 == skillIndex:
  2157. return
  2158.  
  2159. if player.SKILL_INDEX_TONGSOL == skillIndex:
  2160.  
  2161. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2162. skillLevel = player.GetSkillLevel(slotIndex)
  2163.  
  2164. self.AppendDefaultData(skillIndex)
  2165. self.AppendPartySkillData(skillGrade, skillLevel)
  2166.  
  2167. elif player.SKILL_INDEX_RIDING == skillIndex:
  2168.  
  2169. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2170. self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  2171.  
  2172. elif player.SKILL_INDEX_SUMMON == skillIndex:
  2173.  
  2174. maxLevel = 10
  2175.  
  2176. self.ClearToolTip()
  2177. self.__SetSkillTitle(skillIndex, skillGrade)
  2178.  
  2179. ## Description
  2180. description = skill.GetSkillDescription(skillIndex)
  2181. self.AppendDescription(description, 25)
  2182.  
  2183. if skillLevel == 10:
  2184. self.AppendSpace(5)
  2185. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2186. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  2187.  
  2188. else:
  2189. self.AppendSpace(5)
  2190. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2191. self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  2192.  
  2193. self.AppendSpace(5)
  2194. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  2195. self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  2196.  
  2197. elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2198.  
  2199. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2200. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2201. self.ResizeToolTip()
  2202.  
  2203. self.AppendDefaultData(skillIndex)
  2204. self.AppendSkillConditionData(skillIndex)
  2205. self.AppendGuildSkillData(skillIndex, skillLevel)
  2206.  
  2207. else:
  2208.  
  2209. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2210. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2211. self.ResizeToolTip()
  2212.  
  2213. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2214.  
  2215. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2216. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2217.  
  2218. self.AppendDefaultData(skillIndex, skillGrade)
  2219. self.AppendSkillConditionData(skillIndex)
  2220. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2221. self.AppendSkillRequirement(skillIndex, skillLevel)
  2222.  
  2223. self.ShowToolTip()
  2224.  
  2225. def __SetSkillTitle(self, skillIndex, skillGrade):
  2226. self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  2227. self.__AppendSkillGradeName(skillIndex, skillGrade)
  2228.  
  2229. def __AppendSkillGradeName(self, skillIndex, skillGrade):
  2230. if self.SKILL_GRADE_NAME.has_key(skillGrade):
  2231. self.AppendSpace(5)
  2232. self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  2233.  
  2234. def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  2235. if 0 == skillIndex:
  2236. return
  2237.  
  2238. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2239.  
  2240. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2241. self.ResizeToolTip()
  2242.  
  2243. self.ClearToolTip()
  2244. self.__SetSkillTitle(skillIndex, skillGrade)
  2245. self.AppendDefaultData(skillIndex, skillGrade)
  2246. self.AppendSkillConditionData(skillIndex)
  2247. self.ShowToolTip()
  2248.  
  2249. def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2250. self.ClearToolTip()
  2251. self.__SetSkillTitle(skillIndex, skillGrade)
  2252.  
  2253. ## Level Limit
  2254. levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2255. if levelLimit > 0:
  2256.  
  2257. color = self.NORMAL_COLOR
  2258. if player.GetStatus(player.LEVEL) < levelLimit:
  2259. color = self.NEGATIVE_COLOR
  2260.  
  2261. self.AppendSpace(5)
  2262. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2263.  
  2264. ## Description
  2265. description = skill.GetSkillDescription(skillIndex)
  2266. self.AppendDescription(description, 25)
  2267.  
  2268. def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2269. self.ClearToolTip()
  2270. self.__SetSkillTitle(skillIndex, skillGrade)
  2271.  
  2272. ## Description
  2273. description = skill.GetSkillDescription(skillIndex)
  2274. self.AppendDescription(description, 25)
  2275.  
  2276. if 1 == skillGrade:
  2277. skillLevel += 19
  2278. elif 2 == skillGrade:
  2279. skillLevel += 29
  2280. elif 3 == skillGrade:
  2281. skillLevel = 40
  2282.  
  2283. self.AppendSpace(5)
  2284. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2285.  
  2286. def AppendSkillConditionData(self, skillIndex):
  2287. conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2288. if conditionDataCount > 0:
  2289. self.AppendSpace(5)
  2290. for i in xrange(conditionDataCount):
  2291. self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2292.  
  2293. def AppendGuildSkillData(self, skillIndex, skillLevel):
  2294. skillMaxLevel = 7
  2295. skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2296. skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2297. ## Current Level
  2298. if skillLevel > 0:
  2299. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2300. self.AppendSpace(5)
  2301. if skillLevel == skillMaxLevel:
  2302. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2303. else:
  2304. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2305.  
  2306. #####
  2307.  
  2308. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2309. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2310.  
  2311. ## Cooltime
  2312. coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2313. if coolTime > 0:
  2314. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2315.  
  2316. ## SP
  2317. needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2318. if needGSP > 0:
  2319. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2320.  
  2321. ## Next Level
  2322. if skillLevel < skillMaxLevel:
  2323. if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2324. self.AppendSpace(5)
  2325. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2326.  
  2327. #####
  2328.  
  2329. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2330. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2331.  
  2332. ## Cooltime
  2333. coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2334. if coolTime > 0:
  2335. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2336.  
  2337. ## SP
  2338. needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2339. if needGSP > 0:
  2340. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2341.  
  2342. def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  2343.  
  2344. self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  2345. self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  2346.  
  2347. skillLevelUpPoint = 1
  2348. realSkillGrade = player.GetSkillGrade(slotIndex)
  2349. skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  2350. skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  2351.  
  2352. ## Current Level
  2353. if skillLevel > 0:
  2354. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2355. self.AppendSpace(5)
  2356. if skillGrade == skill.SKILL_GRADE_COUNT:
  2357. pass
  2358. elif skillLevel == skillMaxLevelEnd:
  2359. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2360. else:
  2361. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2362. self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  2363.  
  2364. ## Next Level
  2365. if skillGrade != skill.SKILL_GRADE_COUNT:
  2366. if skillLevel < skillMaxLevelEnd:
  2367. if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  2368. self.AppendSpace(5)
  2369. ## HP?˘¬ˇĆˇ©, ˇĆu?e?˘¬CC ?˘¬A˘Ň˘©??©©?C ˇĆ???
  2370. if skillIndex == 141 or skillIndex == 142:
  2371. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  2372. else:
  2373. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  2374. self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  2375.  
  2376. def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  2377.  
  2378. affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  2379. if affectDataCount > 0:
  2380. for i in xrange(affectDataCount):
  2381. type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  2382.  
  2383. if not self.AFFECT_NAME_DICT.has_key(type):
  2384. continue
  2385.  
  2386. minValue = int(minValue)
  2387. maxValue = int(maxValue)
  2388. affectText = self.AFFECT_NAME_DICT[type]
  2389.  
  2390. if "HP" == type:
  2391. if minValue < 0 and maxValue < 0:
  2392. minValue *= -1
  2393. maxValue *= -1
  2394.  
  2395. else:
  2396. affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  2397.  
  2398. affectText += str(minValue)
  2399. if minValue != maxValue:
  2400. affectText += " - " + str(maxValue)
  2401. affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  2402.  
  2403. #import debugInfo
  2404. #if debugInfo.IsDebugMode():
  2405. # affectText = "!!" + affectText
  2406.  
  2407. self.AppendTextLine(affectText, color)
  2408.  
  2409. else:
  2410. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2411. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  2412.  
  2413.  
  2414. ## Duration
  2415. duration = skill.GetDuration(skillIndex, skillPercentage)
  2416. if duration > 0:
  2417. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  2418.  
  2419. ## Cooltime
  2420. coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  2421. if coolTime > 0:
  2422. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  2423.  
  2424. ## SP
  2425. needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  2426. if needSP != 0:
  2427. continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  2428.  
  2429. if skill.IsUseHPSkill(skillIndex):
  2430. self.AppendNeedHP(needSP, continuationSP, color)
  2431. else:
  2432. self.AppendNeedSP(needSP, continuationSP, color)
  2433.  
  2434. def AppendSkillRequirement(self, skillIndex, skillLevel):
  2435.  
  2436. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  2437.  
  2438. if skillLevel >= skillMaxLevel:
  2439. return
  2440.  
  2441. isAppendHorizontalLine = False
  2442.  
  2443. ## Requirement
  2444. if skill.IsSkillRequirement(skillIndex):
  2445.  
  2446. if not isAppendHorizontalLine:
  2447. isAppendHorizontalLine = True
  2448. self.AppendHorizontalLine()
  2449.  
  2450. requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  2451.  
  2452. color = self.CANNOT_LEVEL_UP_COLOR
  2453. if skill.CheckRequirementSueccess(skillIndex):
  2454. color = self.CAN_LEVEL_UP_COLOR
  2455. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  2456.  
  2457. ## Require Stat
  2458. requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  2459. if requireStatCount > 0:
  2460.  
  2461. for i in xrange(requireStatCount):
  2462. type, level = skill.GetSkillRequireStatData(skillIndex, i)
  2463. if self.POINT_NAME_DICT.has_key(type):
  2464.  
  2465. if not isAppendHorizontalLine:
  2466. isAppendHorizontalLine = True
  2467. self.AppendHorizontalLine()
  2468.  
  2469. name = self.POINT_NAME_DICT[type]
  2470. color = self.CANNOT_LEVEL_UP_COLOR
  2471. if player.GetStatus(type) >= level:
  2472. color = self.CAN_LEVEL_UP_COLOR
  2473. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  2474.  
  2475. def HasSkillLevelDescription(self, skillIndex, skillLevel):
  2476. if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  2477. return True
  2478. if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  2479. return True
  2480. if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  2481. return True
  2482.  
  2483. return False
  2484.  
  2485. def AppendMasterAffectDescription(self, index, desc, color):
  2486. self.AppendTextLine(desc, color)
  2487.  
  2488. def AppendNextAffectDescription(self, index, desc):
  2489. self.AppendTextLine(desc, self.DISABLE_COLOR)
  2490.  
  2491. def AppendNeedHP(self, needSP, continuationSP, color):
  2492.  
  2493. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  2494.  
  2495. if continuationSP > 0:
  2496. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  2497.  
  2498. def AppendNeedSP(self, needSP, continuationSP, color):
  2499.  
  2500. if -1 == needSP:
  2501. self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  2502.  
  2503. else:
  2504. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  2505.  
  2506. if continuationSP > 0:
  2507. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  2508.  
  2509. def AppendPartySkillData(self, skillGrade, skillLevel):
  2510.  
  2511. if 1 == skillGrade:
  2512. skillLevel += 19
  2513. elif 2 == skillGrade:
  2514. skillLevel += 29
  2515. elif 3 == skillGrade:
  2516. skillLevel = 40
  2517.  
  2518. if skillLevel <= 0:
  2519. return
  2520.  
  2521. skillIndex = player.SKILL_INDEX_TONGSOL
  2522. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2523. skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2524. if localeInfo.IsBRAZIL():
  2525. k = skillPower
  2526. else:
  2527. k = player.GetSkillLevel(skillIndex) / 100.0
  2528. self.AppendSpace(5)
  2529. self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  2530.  
  2531. if skillLevel>=10:
  2532. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  2533.  
  2534. if skillLevel>=20:
  2535. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER % chop(1 + 5 * k))
  2536. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER % chop(50 + 1450 * k))
  2537.  
  2538. if skillLevel>=25:
  2539. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  2540.  
  2541. if skillLevel>=35:
  2542. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  2543.  
  2544. if skillLevel>=40:
  2545. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  2546.  
  2547. self.AlignHorizonalCenter()
  2548.  
  2549. def __AppendSummonDescription(self, skillLevel, color):
  2550. if skillLevel > 1:
  2551. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  2552. elif 1 == skillLevel:
  2553. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  2554. elif 0 == skillLevel:
  2555. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  2556.  
  2557.  
  2558. if __name__ == "__main__":
  2559. import app
  2560. import wndMgr
  2561. import systemSetting
  2562. import mouseModule
  2563. import grp
  2564. import ui
  2565.  
  2566. #wndMgr.SetOutlineFlag(True)
  2567.  
  2568. app.SetMouseHandler(mouseModule.mouseController)
  2569. app.SetHairColorEnable(True)
  2570. wndMgr.SetMouseHandler(mouseModule.mouseController)
  2571. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2572. app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2573. mouseModule.mouseController.Create()
  2574.  
  2575. toolTip = ItemToolTip()
  2576. toolTip.ClearToolTip()
  2577. #toolTip.AppendTextLine("Test")
  2578. desc = "Item descriptions:|increase of width of display to 35 digits per row AND installation of function that the displayed words are not broken up in two parts, but instead if one word is too long to be displayed in this row, this word will start in the next row."
  2579. summ = ""
  2580.  
  2581. toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  2582. toolTip.Show()
  2583.  
  2584. app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement