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. import privateShopSearch
  17. import ui
  18. import mouseModule
  19. import constInfo
  20. import chat
  21. import translate
  22. import renderTarget
  23. if app.ENABLE_SASH_SYSTEM:
  24. import sash
  25. if app.ENABLE_CHANGELOOK_SYSTEM:
  26. import changelook
  27. WARP_SCROLLS = [22011, 22000, 22010]
  28. EXTRA_SLOT = [0,1,2,4,6,9,12,16]
  29. DESC_DEFAULT_MAX_COLS = 26
  30. DESC_WESTERN_MAX_COLS = 35
  31. DESC_WESTERN_MAX_WIDTH = 220
  32. def chop(n):
  33. return round(n - 0.5, 1)
  34. def pointop(n):
  35. t = int(n)
  36. if t / 10 < 1:
  37. return "0."+n
  38. else:
  39. return n[0:len(n)-1]+"."+n[len(n)-1:]
  40. def SplitDescription(desc, limit):
  41. total_tokens = desc.split()
  42. line_tokens = []
  43. line_len = 0
  44. lines = []
  45. for token in total_tokens:
  46. if "|" in token:
  47. sep_pos = token.find("|")
  48. line_tokens.append(token[:sep_pos])
  49. lines.append(" ".join(line_tokens))
  50. line_len = len(token) - (sep_pos + 1)
  51. line_tokens = [token[sep_pos+1:]]
  52. else:
  53. line_len += len(token)
  54. if len(line_tokens) + line_len > limit:
  55. lines.append(" ".join(line_tokens))
  56. line_len = len(token)
  57. line_tokens = [token]
  58. else:
  59. line_tokens.append(token)
  60. if line_tokens:
  61. lines.append(" ".join(line_tokens))
  62. return lines
  63. class ToolTip(ui.ThinBoard):
  64. TOOL_TIP_WIDTH = 190
  65. TOOL_TIP_HEIGHT = 10
  66. TEXT_LINE_HEIGHT = 17
  67. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  68. SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)
  69. NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  70. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  71. PRICE_COLOR = 0xffFFB96D
  72. HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR
  73. MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0)
  74. LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0)
  75. ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  76. DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  77. NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  78. POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)
  79. SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)
  80. SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0)
  81. SILAH_EVRIM_VALUE = {
  82. 0 : '',
  83. 1 : ' |cff00ff00|HVectors:|h(+120)|h|r',
  84. 2 : ' |cff00ff00|HVectors:|h(+240)|h|r',
  85. 3 : ' |cff00ff00|HVectors:|h(+360)|h|r',
  86. 4 : ' |cff00ff00|HVectors:|h(+480)|h|r',
  87. 5 : ' |cff00ff00|HVectors:|h(+600)|h|r',
  88. }
  89. SILAH_EVRIM_TITLE = {
  90. 0 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_0,
  91. 1 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_1,
  92. 2 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_2,
  93. 3 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_3,
  94. 4 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_4,
  95. 5 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_5
  96. }
  97. itemEvolution = 0
  98. PRICE_INFO_COLOR = grp.GenerateColor(1.0, 0.88, 0.0, 1.0)
  99. ITEM_BUFF_LEVEL_COLOR = 0xffffd300
  100. ITEM_BUFF_TYPE_COLOR = 0xfffc9c3a
  101. ITEM_BUFF_RATE_COLOR = 0xff40e0d0
  102. ITEM_BUFF_DURATION_COLOR = 0xffadff00
  103. ITEM_BUFF_USAGE_COLOR = 0xffffffff
  104. SHOP_ITEM_COLOR = 0xfffff64e
  105. CONDITION_COLOR = 0xffBEB47D
  106. UNDER_LOOK_COLOR = 0xfffff64e
  107. BEFORE_LOOK_COLOR = 0xff9A9CDB
  108. CAN_LEVEL_UP_COLOR = 0xff8EC292
  109. CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
  110. NEED_SKILL_POINT_COLOR = 0xff9A9CDB
  111. SINIRSIZ_COLOR = 0xffFFFF00
  112. def __init__(self, width = TOOL_TIP_WIDTH, isPickable=FALSE):
  113. ui.ThinBoard.__init__(self, "TOP_MOST")
  114. if isPickable:
  115. pass
  116. else:
  117. self.AddFlag("not_pick")
  118. self.AddFlag("float")
  119. self.OnlyDownTooltip = 0
  120. self.followFlag = TRUE
  121. self.toolTipWidth = width
  122. if app.ENABLE_ATTENDANCE_EVENT:
  123. self.isAttendanceRewardItem = False
  124. self.xPos = -1
  125. self.yPos = -1
  126. self.defFontName = localeInfo.UI_DEF_FONT
  127. self.ClearToolTip()
  128. def __del__(self):
  129. ui.ThinBoard.__del__(self)
  130. def ClearToolTip(self):
  131. self.toolTipHeight = 12
  132. self.childrenList = []
  133. def SetFollow(self, flag):
  134. self.followFlag = flag
  135. def SetDefaultFontName(self, fontName):
  136. self.defFontName = fontName
  137. def AppendSpace(self, size):
  138. self.toolTipHeight += size
  139. self.ResizeToolTip()
  140. def AppendHorizontalLine(self):
  141. for i in xrange(2):
  142. horizontalLine = ui.Line()
  143. horizontalLine.SetParent(self)
  144. horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i)
  145. horizontalLine.SetWindowHorizontalAlignCenter()
  146. horizontalLine.SetSize(150, 0)
  147. horizontalLine.Show()
  148. if 0 == i:
  149. horizontalLine.SetColor(0xff555555)
  150. else:
  151. horizontalLine.SetColor(0xff000000)
  152. self.childrenList.append(horizontalLine)
  153. self.toolTipHeight += 11
  154. self.ResizeToolTip()
  155. def AlignHorizonalCenter(self):
  156. for child in self.childrenList:
  157. (x, y)=child.GetLocalPosition()
  158. child.SetPosition(self.toolTipWidth/2, y)
  159. self.ResizeToolTip()
  160. def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  161. textLine = ui.TextLine()
  162. textLine.SetParent(self)
  163. textLine.SetFontName(self.defFontName)
  164. textLine.SetPackedFontColor(color)
  165. textLine.SetText(text)
  166. textLine.SetOutline()
  167. textLine.SetFeather(FALSE)
  168. textLine.Show()
  169. if centerAlign:
  170. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  171. textLine.SetHorizontalAlignCenter()
  172. else:
  173. textLine.SetPosition(10, self.toolTipHeight)
  174. self.childrenList.append(textLine)
  175. (textWidth, textHeight)=textLine.GetTextSize()
  176. textWidth += 40
  177. textHeight += 5
  178. if self.toolTipWidth < textWidth:
  179. self.toolTipWidth = textWidth
  180. self.toolTipHeight += textHeight
  181. return textLine
  182. def AutoAppendNewTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  183. textLine = ui.TextLine()
  184. textLine.SetParent(self)
  185. textLine.SetFontName(self.defFontName)
  186. textLine.SetPackedFontColor(color)
  187. textLine.SetText(text)
  188. textLine.SetOutline()
  189. textLine.SetFeather(FALSE)
  190. textLine.Show()
  191. textLine.SetPosition(15, self.toolTipHeight)
  192. self.childrenList.append(textLine)
  193. (textWidth, textHeight) = textLine.GetTextSize()
  194. textWidth += 30
  195. textHeight += 10
  196. if self.toolTipWidth < textWidth:
  197. self.toolTipWidth = textWidth
  198. self.toolTipHeight += textHeight
  199. self.ResizeToolTipText(textWidth, self.toolTipHeight)
  200. return textLine
  201. def SetThinBoardSize(self, width, height = 12) :
  202. self.toolTipWidth = width
  203. self.toolTipHeight = height
  204. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  205. textLine = ui.TextLine()
  206. textLine.SetParent(self)
  207. textLine.SetFontName(self.defFontName)
  208. textLine.SetPackedFontColor(color)
  209. textLine.SetText(text)
  210. textLine.SetOutline()
  211. textLine.SetFeather(FALSE)
  212. textLine.Show()
  213. if centerAlign:
  214. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  215. textLine.SetHorizontalAlignCenter()
  216. else:
  217. textLine.SetPosition(10, self.toolTipHeight)
  218. self.childrenList.append(textLine)
  219. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  220. self.ResizeToolTip()
  221. return textLine
  222. def AppendDescription(self, desc, limit, color = FONT_COLOR):
  223. if localeInfo.IsEUROPE():
  224. self.__AppendDescription_WesternLanguage(desc, color)
  225. else:
  226. self.__AppendDescription_EasternLanguage(desc, limit, color)
  227. def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR):
  228. length = len(description)
  229. if 0 == length:
  230. return
  231. lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation)
  232. for i in xrange(lineCount):
  233. if 0 == i:
  234. self.AppendSpace(5)
  235. self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color)
  236. def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR):
  237. lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS)
  238. if not lines:
  239. return
  240. self.AppendSpace(5)
  241. for line in lines:
  242. self.AppendTextLine(line, color)
  243. def ResizeToolTip(self):
  244. self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight)
  245. def ResizeToolTipText(self, x, y):
  246. self.SetSize(x, y)
  247. def SetTitle(self, name):
  248. self.AppendTextLine(name, self.TITLE_COLOR)
  249. def GetLimitTextLineColor(self, curValue, limitValue):
  250. if curValue < limitValue:
  251. return self.DISABLE_COLOR
  252. return self.ENABLE_COLOR
  253. def GetChangeTextLineColor(self, value, isSpecial=FALSE):
  254. if value > 0:
  255. if isSpecial:
  256. return self.SPECIAL_POSITIVE_COLOR
  257. else:
  258. return self.POSITIVE_COLOR
  259. if 0 == value:
  260. return self.NORMAL_COLOR
  261. return self.NEGATIVE_COLOR
  262. def SetToolTipPosition(self, x = -1, y = -1):
  263. self.xPos = x
  264. self.yPos = y
  265. def ShowToolTip(self):
  266. self.SetTop()
  267. self.Show()
  268. self.OnUpdate()
  269. def HideToolTip(self):
  270. self.Hide()
  271. def OnlyDown(self):
  272. self.OnlyDownTooltip = 1
  273. def OnUpdate(self):
  274. if not self.followFlag:
  275. return
  276. x = 0
  277. y = 0
  278. width = self.GetWidth()
  279. height = self.toolTipHeight
  280. if -1 == self.xPos and -1 == self.yPos:
  281. (mouseX, mouseY) = wndMgr.GetMousePosition()
  282. if not self.OnlyDownTooltip:
  283. if mouseY < wndMgr.GetScreenHeight() - 300:
  284. y = mouseY + 40
  285. else:
  286. y = mouseY - height - 30
  287. else:
  288. y = mouseY + 40
  289. x = mouseX - width/2
  290. else:
  291. x = self.xPos - width/2
  292. y = self.yPos - height
  293. x = max(x, 0)
  294. y = max(y, 0)
  295. x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2
  296. y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight()
  297. parentWindow = self.GetParentProxy()
  298. if parentWindow:
  299. (gx, gy) = parentWindow.GetGlobalPosition()
  300. x -= gx
  301. y -= gy
  302. self.SetPosition(x, y)
  303. class ItemToolTip(ToolTip):
  304. if app.ENABLE_SEND_TARGET_INFO:
  305. isStone = False
  306. isBook = False
  307. isBook2 = False
  308. ModelPreviewBoard = None
  309. ModelPreview = None
  310. ModelPreviewText = None
  311. CHARACTER_NAMES = (
  312. localeInfo.TOOLTIP_WARRIOR,
  313. localeInfo.TOOLTIP_ASSASSIN,
  314. localeInfo.TOOLTIP_SURA,
  315. localeInfo.TOOLTIP_SHAMAN,
  316. localeInfo.TOOLTIP_WOLFMAN
  317. )
  318. CHARACTER_COUNT = len(CHARACTER_NAMES)
  319. WEAR_NAMES = (
  320. localeInfo.TOOLTIP_ARMOR,
  321. localeInfo.TOOLTIP_HELMET,
  322. localeInfo.TOOLTIP_SHOES,
  323. localeInfo.TOOLTIP_WRISTLET,
  324. localeInfo.TOOLTIP_WEAPON,
  325. localeInfo.TOOLTIP_NECK,
  326. localeInfo.TOOLTIP_EAR,
  327. localeInfo.TOOLTIP_UNIQUE,
  328. localeInfo.TOOLTIP_SHIELD,
  329. localeInfo.TOOLTIP_ARROW,
  330. )
  331. WEAR_COUNT = len(WEAR_NAMES)
  332. AFFECT_DICT = {
  333. item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP,
  334. item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP,
  335. item.APPLY_CON : localeInfo.TOOLTIP_CON,
  336. item.APPLY_INT : localeInfo.TOOLTIP_INT,
  337. item.APPLY_STR : localeInfo.TOOLTIP_STR,
  338. item.APPLY_DEX : localeInfo.TOOLTIP_DEX,
  339. item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED,
  340. item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED,
  341. item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED,
  342. item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN,
  343. item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN,
  344. item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT,
  345. item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT,
  346. item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT,
  347. item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,
  348. item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT,
  349. item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  350. item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  351. item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA,
  352. item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  353. item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  354. item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  355. item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL,
  356. item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC,
  357. item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO,
  358. item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  359. item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  360. item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP,
  361. item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP,
  362. item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT,
  363. item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER,
  364. item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK,
  365. item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE,
  366. item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD,
  367. item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND,
  368. item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER,
  369. item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL,
  370. item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN,
  371. item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW,
  372. item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE,
  373. item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC,
  374. item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC,
  375. item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND,
  376. item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE,
  377. item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE,
  378. item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE,
  379. item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER,
  380. item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS,
  381. item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS,
  382. item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS,
  383. item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS,
  384. item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER,
  385. item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN,
  386. item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW,
  387. item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL,
  388. item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE,
  389. item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE,
  390. item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE,
  391. item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE,
  392. item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE,
  393. item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA,
  394. item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS,
  395. item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS,
  396. item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS,
  397. item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS,
  398. item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS,
  399. item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS,
  400. item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS,
  401. item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS,
  402. item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS,
  403. item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC,
  404. item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC,
  405. item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR,
  406. item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN,
  407. item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA,
  408. item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN,
  409. item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT,
  410. item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT,
  411. item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY,
  412. item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS,
  413. item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER,
  414. item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER,
  415. item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE,
  416. item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH,
  417. item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK,
  418. item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT,
  419. item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT,
  420. item.APPLY_BLEEDING_PCT : localeInfo.TOOLTIP_APPLY_BLEEDING_PCT,
  421. item.APPLY_BLEEDING_REDUCE : localeInfo.TOOLTIP_APPLY_BLEEDING_REDUCE,
  422. item.APPLY_ATTBONUS_WOLFMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_WOLFMAN,
  423. item.APPLY_RESIST_WOLFMAN : localeInfo.TOOLTIP_APPLY_RESIST_WOLFMAN,
  424. item.APPLY_RESIST_CLAW : localeInfo.TOOLTIP_APPLY_RESIST_CLAW,
  425. }
  426. if app.ELEMENT_NEW_BONUSES:
  427. AFFECT_DICT[item.APPLY_ENCHANT_DARK] = localeInfo.TOOLTIP_APPLY_ENCHANT_DARK
  428. AFFECT_DICT[item.APPLY_ENCHANT_EARTH] = localeInfo.TOOLTIP_APPLY_ENCHANT_EARTH
  429. AFFECT_DICT[item.APPLY_ENCHANT_ELECT] = localeInfo.TOOLTIP_APPLY_ENCHANT_ELECT
  430. AFFECT_DICT[item.APPLY_ENCHANT_FIRE] = localeInfo.TOOLTIP_APPLY_ENCHANT_FIRE
  431. AFFECT_DICT[item.APPLY_ENCHANT_ICE] = localeInfo.TOOLTIP_APPLY_ENCHANT_ICE
  432. AFFECT_DICT[item.APPLY_ENCHANT_WIND] = localeInfo.TOOLTIP_APPLY_ENCHANT_WIND
  433. if app.ENABLE_ANTI_RESIST_MAGIC_BONUS_SYSTEM:
  434. AFFECT_DICT.update({
  435. item.APPLY_ANTI_RESIST_MAGIC : localeInfo.APPLY_ANTI_RESIST_MAGIC,
  436. })
  437. if app.ENABLE_PENDANT:
  438. AFFECT_DICT[item.APPLY_ATTBONUS_SWORD] = localeInfo.TOOLTIP_APPLY_ATTBONUS_SWORD
  439. AFFECT_DICT[item.APPLY_ATTBONUS_TWOHAND]= localeInfo.TOOLTIP_APPLY_ATTBONUS_TWOHAND
  440. AFFECT_DICT[item.APPLY_ATTBONUS_DAGGER] = localeInfo.TOOLTIP_APPLY_ATTBONUS_DAGGER
  441. AFFECT_DICT[item.APPLY_ATTBONUS_BELL] = localeInfo.TOOLTIP_APPLY_ATTBONUS_BELL
  442. AFFECT_DICT[item.APPLY_ATTBONUS_FAN] = localeInfo.TOOLTIP_APPLY_ATTBONUS_FAN
  443. AFFECT_DICT[item.APPLY_ATTBONUS_BOW] = localeInfo.TOOLTIP_APPLY_ATTBONUS_BOW
  444. AFFECT_DICT[item.APPLY_ATTBONUS_CLAW] = localeInfo.TOOLTIP_APPLY_ATTBONUS_CLAW
  445. AFFECT_DICT[item.APPLY_RESIST_HUMAN] = localeInfo.TOOLTIP_APPLY_RESIST_HUMAN
  446. AFFECT_DICT[item.APPLY_ATTBONUS_BOCEK] = localeInfo.TOOLTIP_APPLY_ATTBONUS_BOCEK
  447. AFFECT_DICT[item.APPLY_ATTBONUS_COL] = localeInfo.TOOLTIP_APPLY_ATTBONUS_COL
  448. AFFECT_DICT[item.APPLY_ATTBONUS_CZ] = localeInfo.TOOLTIP_APPLY_ATTBONUS_CZ
  449. AFFECT_DICT[item.APPLY_RESIST_DUSUS] = localeInfo.TOOLTIP_APPLY_RESIST_DUSUS
  450. AFFECT_DICT[item.APPLY_ATTBONUS_HIDRA] = localeInfo.TOOLTIP_APPLY_ATTBONUS_HIDRA
  451. AFFECT_DICT[item.APPLY_ATTBONUS_METIN] = localeInfo.TOOLTIP_APPLY_ATTBONUS_METIN
  452. ATTRIBUTE_NEED_WIDTH = {
  453. 23 : 230,
  454. 24 : 230,
  455. 25 : 230,
  456. 26 : 220,
  457. 27 : 210,
  458. 35 : 210,
  459. 36 : 210,
  460. 37 : 210,
  461. 38 : 210,
  462. 39 : 210,
  463. 40 : 210,
  464. 41 : 210,
  465. 42 : 220,
  466. 43 : 230,
  467. 45 : 230,
  468. }
  469. ANTI_FLAG_DICT = {
  470. 0 : item.ITEM_ANTIFLAG_WARRIOR,
  471. 1 : item.ITEM_ANTIFLAG_ASSASSIN,
  472. 2 : item.ITEM_ANTIFLAG_SURA,
  473. 3 : item.ITEM_ANTIFLAG_SHAMAN,
  474. 4 : item.ITEM_ANTIFLAG_WOLFMAN,
  475. }
  476. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  477. def __init__(self, *args, **kwargs):
  478. ToolTip.__init__(self, *args, **kwargs)
  479. self.itemVnum = 0
  480. self.isShopItem = FALSE
  481. self.isOfflineShopItem = FALSE
  482. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  483. self.isPrivateSearchItem = False
  484. self.bCannotUseItemForceSetDisableColor = TRUE
  485. def __del__(self):
  486. ToolTip.__del__(self)
  487. def SetCannotUseItemForceSetDisableColor(self, enable):
  488. self.bCannotUseItemForceSetDisableColor = enable
  489. def CanEquip(self):
  490. if not item.IsEquipmentVID(self.itemVnum):
  491. return TRUE
  492. race = player.GetRace()
  493. job = chr.RaceToJob(race)
  494. if not self.ANTI_FLAG_DICT.has_key(job):
  495. return FALSE
  496. if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  497. return FALSE
  498. sex = chr.RaceToSex(race)
  499. MALE = 1
  500. FEMALE = 0
  501. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  502. return FALSE
  503. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  504. return FALSE
  505. for i in xrange(item.LIMIT_MAX_NUM):
  506. (limitType, limitValue) = item.GetLimit(i)
  507. if item.LIMIT_LEVEL == limitType:
  508. if player.GetStatus(player.LEVEL) < limitValue:
  509. return FALSE
  510. """
  511. elif item.LIMIT_STR == limitType:
  512. if player.GetStatus(player.ST) < limitValue:
  513. return FALSE
  514. elif item.LIMIT_DEX == limitType:
  515. if player.GetStatus(player.DX) < limitValue:
  516. return FALSE
  517. elif item.LIMIT_INT == limitType:
  518. if player.GetStatus(player.IQ) < limitValue:
  519. return FALSE
  520. elif item.LIMIT_CON == limitType:
  521. if player.GetStatus(player.HT) < limitValue:
  522. return FALSE
  523. """
  524. return TRUE
  525. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  526. if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
  527. color = self.DISABLE_COLOR
  528. return ToolTip.AppendTextLine(self, text, color, centerAlign)
  529. def ClearToolTip(self):
  530. self.isShopItem = FALSE
  531. if app.ENABLE_ATTENDANCE_EVENT:
  532. self.isAttendanceRewardItem = False
  533. self.isOfflineShopItem = FALSE
  534. self.toolTipWidth = self.TOOL_TIP_WIDTH
  535. ToolTip.ClearToolTip(self)
  536. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  537. self.isPrivateSearchItem = False
  538. def OnlyDown(self):
  539. ToolTip.OnlyDown(self)
  540. def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY):
  541. itemVnum = player.GetItemIndex(window_type, slotIndex)
  542. if 0 == itemVnum:
  543. return
  544. self.ClearToolTip()
  545. if shop.IsOpen():
  546. if not shop.IsPrivateShop() or not shop.IsOfflineShop():
  547. item.SelectItem(itemVnum)
  548. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex)*5)
  549. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  550. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  551. if app.ENABLE_CHANGELOOK_SYSTEM:
  552. self.AddItemData(itemVnum, metinSlot, attrSlot,player.GetItemEvolution(window_type, slotIndex), 0, player.INVENTORY, slotIndex)
  553. else:
  554. self.AddItemData(itemVnum, metinSlot, attrSlot,player.GetItemEvolution(window_type, slotIndex))
  555. # self.AddItemData(itemVnum, metinSlot, attrSlot, 0, player.INVENTORY, slotIndex)
  556. # else:
  557. # self.AddItemData(itemVnum, metinSlot, attrSlot)
  558. self.__AppendSealInformation(player.INVENTORY, slotIndex)
  559. def SetOfflineShopBuilderItem(self, invenType, invenPos, offlineShopIndex):
  560. itemVnum = player.GetItemIndex(invenType, invenPos)
  561. if (itemVnum == 0):
  562. return
  563. self.ClearToolTip()
  564. item.SelectItem(itemVnum)
  565. #self.AppendSellingPrice(shop.GetOfflineShopItemPrice2(invenType, invenPos))
  566. metinSlot = []
  567. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  568. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  569. attrSlot = []
  570. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  571. attrSlot.append(player.GetItemAttribute(invenPos, i))
  572. if app.ENABLE_CHANGELOOK_SYSTEM:
  573. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, invenType, invenPos)
  574. else:
  575. self.AddItemData(itemVnum, metinSlot, attrSlot, 0)
  576. price = shop.GetOfflineShopItemPrice2(invenType, invenPos)
  577. if app.ENABLE_CHEQUE_SYSTEM:
  578. price_cheque = shop.GetOfflineShopItemPriceCheque2(invenType, invenPos)
  579. price_yang = shop.GetOfflineShopItemPrice2(invenType, invenPos)
  580. self.AppendSpace(5)
  581. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  582. if price_cheque > 0:
  583. self.AppendSpace(5)
  584. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  585. if price_yang > 0:
  586. self.AppendSpace(5)
  587. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  588. else:
  589. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  590. def SetOfflineShopItem(self, slotIndex, addprice = 0, waltype = 0):
  591. itemVnum = shop.GetOfflineShopItemID(slotIndex)
  592. if (itemVnum == 0):
  593. return
  594. price = shop.GetOfflineShopItemPrice(slotIndex)
  595. if app.ENABLE_CHEQUE_SYSTEM:
  596. price_cheque = shop.GetOfflineShopItemPriceCheque(slotIndex)
  597. price_yang = shop.GetOfflineShopItemPrice(slotIndex)
  598. self.ClearToolTip()
  599. self.isOfflineShopItem = TRUE
  600. metinSlot = []
  601. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  602. metinSlot.append(shop.GetOfflineShopItemMetinSocket(slotIndex, i))
  603. attrSlot = []
  604. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  605. attrSlot.append(shop.GetOfflineShopItemAttribute(slotIndex, i))
  606. if app.ENABLE_CHANGELOOK_SYSTEM:
  607. transmutation = shop.GetOfflineShopItemTransmutation(slotIndex)
  608. if not transmutation:
  609. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetOfflineShoItemEvolution(slotIndex))
  610. else:
  611. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetOfflineShoItemEvolution(slotIndex), 0, player.INVENTORY, -1, transmutation)
  612. else:
  613. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetOfflineShoItemEvolution(slotIndex))
  614. if waltype == 0:
  615. if app.ENABLE_CHEQUE_SYSTEM:
  616. if shop.IsOfflineShop():
  617. self.AppendSpace(5)
  618. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  619. if price_cheque > 0:
  620. self.AppendSpace(5)
  621. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  622. if price_yang > 0:
  623. self.AppendSpace(5)
  624. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  625. else:
  626. self.AppendSpace(5)
  627. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  628. if price_cheque > 0:
  629. self.AppendSpace(5)
  630. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  631. if price_yang > 0:
  632. self.AppendSpace(5)
  633. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  634. else:
  635. self.AppendPrice(price)
  636. else:
  637. self.AppendSpace(5)
  638. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(addprice)[:-5]), self.SPECIAL_TITLE_COLOR)
  639. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  640. def SetPrivateSearchItem(self, slotIndex):
  641. itemVnum = privateShopSearch.GetSearchItemVnum(slotIndex)
  642. if 0 == itemVnum:
  643. return
  644. self.ClearToolTip()
  645. self.isPrivateSearchItem = True
  646. metinSlot = []
  647. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  648. metinSlot.append(privateShopSearch.GetSearchItemMetinSocket(slotIndex, i))
  649. attrSlot = []
  650. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  651. attrSlot.append(privateShopSearch.GetSearchItemAttribute(slotIndex, i))
  652. self.AddItemData(itemVnum, metinSlot, attrSlot,privateShopSearch.GetSearchItemEvolution(slotIndex, i))
  653. if app.ENABLE_CHANGELOOK_SYSTEM:
  654. self.AppendChangeLookInfoPrivateShopWIndow(slotIndex)
  655. def SetInventoryItemAttrTransfer(self, slotIndex_1, slotIndex_2, window_type = player.INVENTORY):
  656. itemVnum = player.GetItemIndex(window_type, slotIndex_1)
  657. itemVnum_2 = player.GetItemIndex(window_type, slotIndex_2)
  658. if itemVnum == 0 or itemVnum_2 == 0:
  659. return
  660. self.ClearToolTip()
  661. if shop.IsOpen():
  662. if not shop.IsPrivateShop() or not shop.IsOfflineShop():
  663. item.SelectItem(itemVnum)
  664. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex_2))
  665. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex_2, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  666. attrSlot = [player.GetItemAttribute(window_type, slotIndex_2, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  667. self.AddItemDataAttrTransfer(itemVnum, itemVnum_2, metinSlot, attrSlot, 0, 0, window_type, slotIndex_2)
  668. def AddItemDataAttrTransfer(self, itemVnum, itemVnum_2, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0, window_type = player.INVENTORY, slotIndex = -1):
  669. self.itemVnum = itemVnum
  670. item.SelectItem(itemVnum)
  671. itemType = item.GetItemType()
  672. itemSubType = item.GetItemSubType()
  673. itemDesc = item.GetItemDescription()
  674. itemSummary = item.GetItemSummary()
  675. self.__AdjustMaxWidth(attrSlot, itemDesc)
  676. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  677. self.AppendDescription(itemDesc, 26)
  678. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  679. self.__AppendLimitInformation()
  680. self.__AppendAffectInformation()
  681. item.SelectItem(itemVnum_2)
  682. self.__AppendAttributeInformation(attrSlot)
  683. item.SelectItem(itemVnum)
  684. self.AppendWearableInformation()
  685. bHasRealtimeFlag = 0
  686. for i in xrange(item.LIMIT_MAX_NUM):
  687. (limitType, limitValue) = item.GetLimit(i)
  688. if item.LIMIT_REAL_TIME == limitType:
  689. bHasRealtimeFlag = 1
  690. if 1 == bHasRealtimeFlag:
  691. self.AppendMallItemLastTime(metinSlot[0])
  692. self.ShowToolTip()
  693. def SetShopItem(self, slotIndex, addprice = 0, waltype = 0):
  694. import localeInfo
  695. itemVnum = shop.GetItemID(slotIndex)
  696. if 0 == itemVnum:
  697. return
  698. price = shop.GetItemPrice(slotIndex)
  699. if app.ENABLE_CHEQUE_SYSTEM:
  700. price_cheque = shop.GetItemPriceCheque(slotIndex)
  701. price_yang = shop.GetItemPrice(slotIndex)
  702. self.ClearToolTip()
  703. self.isShopItem = True
  704. item.SelectItem(itemVnum)
  705. metinSlot = []
  706. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  707. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  708. attrSlot = []
  709. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  710. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  711. if app.ENABLE_CHANGELOOK_SYSTEM:
  712. transmutation = shop.GetItemTransmutation(slotIndex)
  713. if not transmutation:
  714. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetItemEvolution(slotIndex))
  715. else:
  716. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetItemEvolution(slotIndex), 0, player.INVENTORY, -1, transmutation)
  717. else:
  718. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetItemEvolution(slotIndex))
  719. if waltype == 0:
  720. if app.ENABLE_SHOP_SISTEM:
  721. if item.IsAntiFlag(item.ANTIFLAG_SHOP_SECONDARY):
  722. self.miktar(price)
  723. elif item.IsAntiFlag(item.ANTIFLAG_SHOP_TRIPLE):
  724. self.miktar2(price)
  725. elif app.ENABLE_BUY_WITH_ITEM:
  726. buyItemVnum = shop.GetBuyWithItem(slotIndex)
  727. if buyItemVnum != 0:
  728. item.SelectItem(buyItemVnum)
  729. istenenItemAd = item.GetItemName()
  730. istenenItemVnum = item.GetVnum()
  731. self.AppendPrice_WithItem(price, istenenItemVnum, istenenItemAd)
  732. else:
  733. self.AppendPrice(price)
  734. elif app.ENABLE_CHEQUE_SYSTEM:
  735. if shop.IsPrivateShop():
  736. self.AppendSpace(5)
  737. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  738. if price_cheque > 0:
  739. self.AppendSpace(5)
  740. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  741. if price_yang > 0:
  742. self.AppendSpace(5)
  743. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  744. else:
  745. self.AppendSpace(5)
  746. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(addprice)[:-5]), self.SPECIAL_TITLE_COLOR)
  747. if (app.WJ_COMBAT_ZONE):
  748. def SetShopItemByCombatZoneCoin(self, slotIndex):
  749. itemVnum = shop.GetItemID(slotIndex)
  750. if 0 == itemVnum:
  751. return
  752. price = shop.GetItemPrice(slotIndex)
  753. self.ClearToolTip()
  754. self.isShopItem = TRUE
  755. metinSlot = []
  756. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  757. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  758. attrSlot = []
  759. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  760. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  761. self.AddItemData(itemVnum, metinSlot, attrSlot)
  762. self.AppendSpace(5)
  763. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToCombatZoneCoinString(price)), self.HIGH_PRICE_COLOR)
  764. def SetShopItemBySecondaryCoin(self, slotIndex):
  765. itemVnum = shop.GetItemID(slotIndex)
  766. if 0 == itemVnum:
  767. return
  768. price = shop.GetItemPrice(slotIndex)
  769. self.ClearToolTip()
  770. self.isShopItem = TRUE
  771. metinSlot = []
  772. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  773. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  774. attrSlot = []
  775. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  776. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  777. if app.ENABLE_CHANGELOOK_SYSTEM:
  778. transmutation = shop.GetItemTransmutation(slotIndex)
  779. if not transmutation:
  780. self.AddItemData(itemVnum, metinSlot, attrSlot)
  781. else:
  782. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, player.INVENTORY, -1, transmutation)
  783. else:
  784. self.AddItemData(itemVnum, metinSlot, attrSlot)
  785. self.AppendPriceBySecondaryCoin(price)
  786. def SetExchangeOwnerItem(self, slotIndex):
  787. itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
  788. if 0 == itemVnum:
  789. return
  790. self.ClearToolTip()
  791. metinSlot = []
  792. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  793. metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i))
  794. attrSlot = []
  795. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  796. attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i))
  797. if app.ENABLE_CHANGELOOK_SYSTEM:
  798. transmutation = exchange.GetItemTransmutation(slotIndex, True)
  799. if not transmutation:
  800. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromSelf(slotIndex))
  801. else:
  802. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromSelf(slotIndex), 0, player.INVENTORY, -1, transmutation)
  803. else:
  804. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromSelf(slotIndex))
  805. def SetExchangeTargetItem(self, slotIndex):
  806. itemVnum = exchange.GetItemVnumFromTarget(slotIndex)
  807. if 0 == itemVnum:
  808. return
  809. self.ClearToolTip()
  810. metinSlot = []
  811. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  812. metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i))
  813. attrSlot = []
  814. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  815. attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i))
  816. if app.ENABLE_CHANGELOOK_SYSTEM:
  817. transmutation = exchange.GetItemTransmutation(slotIndex, True)
  818. if not transmutation:
  819. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromTarget(slotIndex))
  820. else:
  821. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromTarget(slotIndex), 0, player.INVENTORY, -1, transmutation)
  822. else:
  823. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromTarget(slotIndex))
  824. def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex):
  825. itemVnum = player.GetItemIndex(invenType, invenPos)
  826. if 0 == itemVnum:
  827. return
  828. item.SelectItem(itemVnum)
  829. self.ClearToolTip()
  830. metinSlot = []
  831. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  832. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  833. attrSlot = []
  834. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  835. attrSlot.append(player.GetItemAttribute(invenPos, i))
  836. if app.ENABLE_CHANGELOOK_SYSTEM:
  837. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, invenType, invenPos)
  838. else:
  839. self.AddItemData(itemVnum, metinSlot, attrSlot, 0)
  840. price = shop.GetPrivateShopItemPrice(invenType, invenPos)
  841. if app.ENABLE_CHEQUE_SYSTEM:
  842. price_cheque = shop.GetPrivateShopItemPriceCheque(invenType, invenPos)
  843. price_yang = shop.GetPrivateShopItemPrice(invenType, invenPos)
  844. self.AppendSpace(5)
  845. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  846. if price_cheque > 0:
  847. self.AppendSpace(5)
  848. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  849. if price_yang > 0:
  850. self.AppendSpace(5)
  851. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  852. else:
  853. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  854. def SetSafeBoxItem(self, slotIndex):
  855. itemVnum = safebox.GetItemID(slotIndex)
  856. if 0 == itemVnum:
  857. return
  858. self.ClearToolTip()
  859. metinSlot = []
  860. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  861. metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i))
  862. attrSlot = []
  863. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  864. attrSlot.append(safebox.GetItemAttribute(slotIndex, i))
  865. if app.ENABLE_CHANGELOOK_SYSTEM:
  866. self.AddItemData(itemVnum, metinSlot, attrSlot,safebox.GetItemEvolution(slotIndex), safebox.GetItemFlags(slotIndex), player.SAFEBOX, slotIndex)
  867. else:
  868. self.AddItemData(itemVnum, metinSlot, attrSlot,safebox.GetItemEvolution(slotIndex), safebox.GetItemFlags(slotIndex))
  869. self.__AppendSealInformation(player.SAFEBOX, slotIndex)
  870. def SetMallItem(self, slotIndex):
  871. itemVnum = safebox.GetMallItemID(slotIndex)
  872. if 0 == itemVnum:
  873. return
  874. self.ClearToolTip()
  875. metinSlot = []
  876. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  877. metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i))
  878. attrSlot = []
  879. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  880. attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i))
  881. if app.ENABLE_CHANGELOOK_SYSTEM:
  882. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetMallItemEvolution(slotIndex), 0, player.MALL, slotIndex)
  883. else:
  884. self.AddItemData(itemVnum, metinSlot, attrSlot)
  885. self.__AppendSealInformation(player.MALL, slotIndex)
  886. def SetItemToolTip(self, itemVnum):
  887. self.ClearToolTip()
  888. metinSlot = []
  889. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  890. metinSlot.append(0)
  891. attrSlot = []
  892. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  893. attrSlot.append((0, 0))
  894. self.AddItemData(itemVnum, metinSlot, attrSlot)
  895. if app.ENABLE_ATTENDANCE_EVENT:
  896. def SetAttendanceRewardItem(self, itemVnum, itemCount):
  897. if 0 == itemVnum:
  898. return
  899. self.ClearToolTip()
  900. self.isAttendanceRewardItem = True
  901. metinSlot = []
  902. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  903. metinSlot.append(0)
  904. attrSlot = []
  905. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  906. attrSlot.append((0, 0))
  907. metinSlot[0] = itemCount
  908. self.AddItemData(itemVnum, metinSlot, attrSlot)
  909. if app.ENABLE_SEND_TARGET_INFO:
  910. def SetItemToolTipStone(self, itemVnum):
  911. self.itemVnum = itemVnum
  912. item.SelectItem(itemVnum)
  913. itemType = item.GetItemType()
  914. itemDesc = item.GetItemDescription()
  915. itemSummary = item.GetItemSummary()
  916. attrSlot = 0
  917. self.__AdjustMaxWidth(attrSlot, itemDesc)
  918. itemName = item.GetItemName()
  919. realName = itemName[:itemName.find("+")]
  920. self.SetTitle(realName + " +0 - +4")
  921. ## Description ###
  922. self.AppendDescription(itemDesc, 26)
  923. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  924. if item.ITEM_TYPE_METIN == itemType:
  925. self.AppendMetinInformation()
  926. self.AppendMetinWearInformation()
  927. for i in xrange(item.LIMIT_MAX_NUM):
  928. (limitType, limitValue) = item.GetLimit(i)
  929. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  930. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  931. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  932. self.AppendTimerBasedOnWearLastTime(metinSlot)
  933. self.ShowToolTip()
  934. def __AppendAttackSpeedInfo(self, item):
  935. atkSpd = item.GetValue(0)
  936. if atkSpd < 80:
  937. stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST
  938. elif atkSpd <= 95:
  939. stSpd = localeInfo.TOOLTIP_ITEM_FAST
  940. elif atkSpd <= 105:
  941. stSpd = localeInfo.TOOLTIP_ITEM_NORMAL
  942. elif atkSpd <= 120:
  943. stSpd = localeInfo.TOOLTIP_ITEM_SLOW
  944. else:
  945. stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW
  946. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR)
  947. def __AppendAttackGradeInfo(self):
  948. atkGrade = item.GetValue(1)
  949. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade))
  950. if app.ENABLE_SASH_SYSTEM:
  951. def CalcSashValue(self, value, abs):
  952. if not value:
  953. return 0
  954. valueCalc = int((round(value * abs) / 100) - .5) + int(int((round(value * abs) / 100) - .5) > 0)
  955. if valueCalc <= 0 and value > 0:
  956. value = 1
  957. else:
  958. value = valueCalc
  959. return value
  960. def __AppendAttackPowerInfo(self, itemAbsChance = 0):
  961. minPower = item.GetValue(3)
  962. maxPower = item.GetValue(4)
  963. addPower = item.GetValue(5)
  964. if app.ENABLE_SASH_SYSTEM:
  965. if itemAbsChance:
  966. minPower = self.CalcSashValue(minPower, itemAbsChance)
  967. maxPower = self.CalcSashValue(maxPower, itemAbsChance)
  968. addPower = self.CalcSashValue(addPower, itemAbsChance)
  969. if maxPower > minPower:
  970. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower+addPower, maxPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  971. else:
  972. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  973. def __AppendMagicAttackInfo(self, itemAbsChance = 0):
  974. minMagicAttackPower = item.GetValue(1)
  975. maxMagicAttackPower = item.GetValue(2)
  976. addPower = item.GetValue(5)
  977. if app.ENABLE_SASH_SYSTEM:
  978. if itemAbsChance:
  979. minMagicAttackPower = self.CalcSashValue(minMagicAttackPower, itemAbsChance)
  980. maxMagicAttackPower = self.CalcSashValue(maxMagicAttackPower, itemAbsChance)
  981. addPower = self.CalcSashValue(addPower, itemAbsChance)
  982. if minMagicAttackPower > 0 or maxMagicAttackPower > 0:
  983. if maxMagicAttackPower > minMagicAttackPower:
  984. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower+addPower, maxMagicAttackPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  985. else:
  986. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  987. def __AppendMagicDefenceInfo(self, itemAbsChance = 0):
  988. magicDefencePower = item.GetValue(0)
  989. if app.ENABLE_SASH_SYSTEM:
  990. if itemAbsChance:
  991. magicDefencePower = self.CalcSashValue(magicDefencePower, itemAbsChance)
  992. if magicDefencePower > 0:
  993. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))
  994. def __AppendAttributeInformation(self, attrSlot, itemAbsChance = 0):
  995. if 0 != attrSlot:
  996. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  997. type = attrSlot[i][0]
  998. value = attrSlot[i][1]
  999. if 0 == value:
  1000. continue
  1001. affectString = self.__GetAffectString(type, value)
  1002. if app.ENABLE_SASH_SYSTEM:
  1003. if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_SASH and itemAbsChance:
  1004. value = self.CalcSashValue(value, itemAbsChance)
  1005. affectString = self.__GetAffectString(type, value)
  1006. if affectString:
  1007. affectColor = self.__GetAttributeColor(i, value)
  1008. self.AppendTextLine(affectString, affectColor)
  1009. def __GetAttributeColor(self, index, value):
  1010. if value > 0:
  1011. if index >= 5:
  1012. return self.SPECIAL_POSITIVE_COLOR2
  1013. else:
  1014. return self.SPECIAL_POSITIVE_COLOR
  1015. elif value == 0:
  1016. return self.NORMAL_COLOR
  1017. else:
  1018. return self.NEGATIVE_COLOR
  1019. def __IsPolymorphItem(self, itemVnum):
  1020. if itemVnum >= 70103 and itemVnum <= 70106:
  1021. return 1
  1022. return 0
  1023. def __SetPolymorphItemTitle(self, monsterVnum):
  1024. if localeInfo.IsVIETNAM():
  1025. itemName =item.GetItemName()
  1026. itemName+=" "
  1027. itemName+=nonplayer.GetMonsterName(monsterVnum)
  1028. else:
  1029. itemName =nonplayer.GetMonsterName(monsterVnum)
  1030. itemName+=" "
  1031. itemName+=item.GetItemName()
  1032. self.SetTitle(itemName)
  1033. def __SetNormalItemTitle(self):
  1034. if app.ENABLE_SEND_TARGET_INFO:
  1035. if self.isStone:
  1036. itemName = item.GetItemName()
  1037. realName = itemName[:itemName.find("+")]
  1038. self.SetTitle(realName + " +0 - +4")
  1039. else:
  1040. self.SetTitle(self.SILAH_EVRIM_TITLE[self.itemEvolution] % (localeInfo.SILAH_EVRIM_TEXT.get(self.itemEvolution,"") + item.GetItemName()))
  1041. else:
  1042. self.SetTitle(item.GetItemName())
  1043. def __SetSpecialItemTitle(self):
  1044. self.AppendTextLine(self.SILAH_EVRIM_TITLE[self.itemEvolution] % (localeInfo.SILAH_EVRIM_TEXT.get(self.itemEvolution,"") + item.GetItemName()), self.SPECIAL_TITLE_COLOR)
  1045. def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
  1046. if app.ENABLE_ATTENDANCE_EVENT:
  1047. if self.isAttendanceRewardItem:
  1048. self.SetTitle(item.GetItemName()+" - |cffffc800|H|h"+str(metinSlot[0])+" adet|h|r")
  1049. return
  1050. if localeInfo.IsCANADA():
  1051. if 72726 == itemVnum or 72730 == itemVnum:
  1052. self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  1053. return
  1054. if self.__IsPolymorphItem(itemVnum):
  1055. self.__SetPolymorphItemTitle(metinSlot[0])
  1056. else:
  1057. if self.__IsAttr(attrSlot):
  1058. self.__SetSpecialItemTitle()
  1059. return
  1060. self.__SetNormalItemTitle()
  1061. def __IsAttr(self, attrSlot):
  1062. if not attrSlot:
  1063. return FALSE
  1064. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1065. type = attrSlot[i][0]
  1066. if 0 != type:
  1067. return TRUE
  1068. return FALSE
  1069. def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0, targetItemPos = -1):
  1070. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1071. metinSlotData=metinSlot[i]
  1072. if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE:
  1073. metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER
  1074. if targetItemPos != -1:
  1075. self.AddItemData(itemVnum, metinSlot, attrSlot, player.GetItemEvolution(targetItemPos))
  1076. else:
  1077. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1078. def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot):
  1079. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1080. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1081. if self.__IsHair(itemVnum):
  1082. self.__AppendHairIcon(itemVnum)
  1083. ### Description ###
  1084. self.AppendDescription(itemDesc, 26)
  1085. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1086. def check_sigillo(self, item_vnum):
  1087. for x in range(55701,55711):
  1088. if x == item_vnum:
  1089. return TRUE
  1090. if item_vnum == 55801:
  1091. return TRUE
  1092. return FALSE
  1093. def __TumunuAc(self, file):
  1094. iconFile = str(file)
  1095. itemImage = ui.ImageBox()
  1096. itemImage.SetParent(self)
  1097. itemImage.Show()
  1098. itemImage.LoadImage(iconFile)
  1099. itemImage.SetPosition(itemImage.GetWidth()/ 2 - 50+82, self.toolTipHeight)
  1100. self.toolTipHeight += itemImage.GetHeight()
  1101. self.childrenList.append(itemImage)
  1102. self.ResizeToolTip()
  1103. def __SandikIngoru(self, file):
  1104. iconFile = str(file)
  1105. itemImage = ui.ImageBox()
  1106. itemImage.SetParent(self)
  1107. itemImage.Show()
  1108. itemImage.LoadImage(iconFile)
  1109. itemImage.SetPosition(itemImage.GetWidth()/ 2 - 50+82, self.toolTipHeight)
  1110. self.toolTipHeight += itemImage.GetHeight()
  1111. self.childrenList.append(itemImage)
  1112. self.ResizeToolTip()
  1113. def AddItemData(self, itemVnum, metinSlot, attrSlot = 0,evolution = 0,flags = 0,window_type = player.INVENTORY, slotIndex = -1, transmutation = -1):
  1114. self.itemVnum = itemVnum
  1115. item.SelectItem(itemVnum)
  1116. itemType = item.GetItemType()
  1117. itemSubType = item.GetItemSubType()
  1118. self.itemEvolution = evolution
  1119. if 50026 == itemVnum:
  1120. if 0 != metinSlot:
  1121. name = item.GetItemName()
  1122. if metinSlot[0] > 0:
  1123. name += " "
  1124. name += localeInfo.NumberToMoneyString(metinSlot[0])
  1125. self.SetTitle(name)
  1126. self.ShowToolTip()
  1127. return
  1128. ### Skill Book ###
  1129. if app.ENABLE_SEND_TARGET_INFO:
  1130. if 50300 == itemVnum and not self.isBook:
  1131. if 0 != metinSlot and not self.isBook:
  1132. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1133. self.ShowToolTip()
  1134. elif self.isBook:
  1135. self.SetTitle(item.GetItemName())
  1136. self.AppendDescription(item.GetItemDescription(), 26)
  1137. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1138. self.ShowToolTip()
  1139. return
  1140. elif 70037 == itemVnum :
  1141. if 0 != metinSlot and not self.isBook2:
  1142. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1143. self.AppendDescription(item.GetItemDescription(), 26)
  1144. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1145. self.ShowToolTip()
  1146. elif self.isBook2:
  1147. self.SetTitle(item.GetItemName())
  1148. self.AppendDescription(item.GetItemDescription(), 26)
  1149. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1150. self.ShowToolTip()
  1151. return
  1152. elif 70055 == itemVnum:
  1153. if 0 != metinSlot:
  1154. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1155. self.AppendDescription(item.GetItemDescription(), 26)
  1156. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1157. self.ShowToolTip()
  1158. return
  1159. else:
  1160. if 50300 == itemVnum:
  1161. if 0 != metinSlot:
  1162. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1163. self.ShowToolTip()
  1164. return
  1165. elif 70037 == itemVnum:
  1166. if 0 != metinSlot:
  1167. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1168. self.AppendDescription(item.GetItemDescription(), 26)
  1169. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1170. self.ShowToolTip()
  1171. return
  1172. elif 70055 == itemVnum:
  1173. if 0 != metinSlot:
  1174. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1175. self.AppendDescription(item.GetItemDescription(), 26)
  1176. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1177. self.ShowToolTip()
  1178. return
  1179. ###########################################################################################
  1180. itemDesc = item.GetItemDescription()
  1181. itemSummary = item.GetItemSummary()
  1182. isCostumeItem = 0
  1183. isCostumeHair = 0
  1184. isCostumeBody = 0
  1185. isCostumeMount = 0
  1186. if app.ENABLE_SASH_SYSTEM:
  1187. isCostumeSash = 0
  1188. if app.ENABLE_COSTUME_WEAPON_SYSTEM:
  1189. isCostumeWeapon = 0
  1190. if app.ENABLE_COSTUME_SYSTEM:
  1191. if item.ITEM_TYPE_COSTUME == itemType:
  1192. isCostumeItem = 1
  1193. isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
  1194. isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
  1195. isCostumeMount = item.COSTUME_SLOT_MOUNT == itemSubType
  1196. if app.ENABLE_SASH_SYSTEM:
  1197. isCostumeSash = itemSubType == item.COSTUME_TYPE_SASH
  1198. if app.ENABLE_COSTUME_WEAPON_SYSTEM:
  1199. isCostumeWeapon = item.COSTUME_TYPE_WEAPON == itemSubType
  1200. #dbg.TraceError("IS_COSTUME_ITEM! body(%d) hair(%d)" % (isCostumeBody, isCostumeHair))
  1201. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1202. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1203. self.__ModelPreviewClose()
  1204. ### Hair Preview Image ###
  1205. if self.__IsHair(itemVnum):
  1206. self.__AppendHairIcon(itemVnum)
  1207. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  1208. if self.isPrivateSearchItem:
  1209. if not self.__IsHair(itemVnum):
  1210. self.__AppendPrivateSearchItemicon(itemVnum)
  1211. if app.ENABLE_ATTENDANCE_EVENT:
  1212. if self.isAttendanceRewardItem:
  1213. if not self.__IsHair(itemVnum):
  1214. self.__AppendAttendanceRewardItemIcon(itemVnum)
  1215. ### Description ###
  1216. self.AppendDescription(itemDesc, 26)
  1217. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1218. if self.check_sigillo(itemVnum) or itemVnum == 55002:
  1219. if attrSlot[0][1] != 0:
  1220. self.AppendSpace(2)
  1221. blackyas = (int(attrSlot[5][1])/60)/24
  1222. getskillslot = (int(attrSlot[6][1]))
  1223. #petevobl = (int(attrSlot[6][1]))
  1224. self.AppendTextLine("|cffffffffSeviye:"+str(metinSlot[1]) + " (" + str(getskillslot) +")", self.NORMAL_COLOR)
  1225. #if (str(petevobl)) == "0":
  1226. #self.AppendTextLine(localeInfo.PET_TEXTT_7, grp.GenerateColor(0, 78, 0, 1))
  1227. #elif (str(petevobl)) == "1":
  1228. #self.AppendTextLine(localeInfo.PET_SYSTEM_EVO2, grp.GenerateColor(0, 78, 0, 1))
  1229. #elif (str(petevobl)) == "2":
  1230. #self.AppendTextLine(localeInfo.PET_SYSTEM_EVO3, grp.GenerateColor(0, 78, 0, 1))
  1231. #elif (str(petevobl)) == "3":
  1232. #self.AppendTextLine(localeInfo.PET_SYSTEM_EVO4, grp.GenerateColor(0, 78, 0, 1))
  1233. self.AppendSpace(2)
  1234. self.AppendTextLine("Hp: +"+pointop(str(attrSlot[0][1]))+"%", self.SPECIAL_POSITIVE_COLOR)
  1235. self.AppendTextLine("Savunma: +"+pointop(str(attrSlot[1][1]))+"%", self.SPECIAL_POSITIVE_COLOR)
  1236. self.AppendTextLine("Str: +"+pointop(str(attrSlot[2][1]))+"%", self.SPECIAL_POSITIVE_COLOR)
  1237. self.AppendSpace(5)
  1238. if itemVnum != 55002:
  1239. days = (int(attrSlot[3][1])/60)/24
  1240. hours = (int(attrSlot[3][1]) - (days*60*24)) / 60
  1241. mins = int(attrSlot[3][1]) - (days*60*24) - (hours*60)
  1242. self.AppendTextLine(localeInfo.PET_TEXTT_1 % (days, hours, mins), self.SPECIAL_POSITIVE_COLOR)
  1243. ##Support Shaman
  1244. if itemVnum == 8383 or itemVnum == 8384:
  1245. if 0 != metinSlot:
  1246. useCount = int(metinSlot[0])
  1247. self.AppendSpace(5)
  1248. self.AppendTextLine("Kritik Oranı: +41" , self.ITEM_BUFF_RATE_COLOR)
  1249. self.AppendTextLine("Yansıtma Oranı: +41" , self.ITEM_BUFF_RATE_COLOR)
  1250. self.AppendTextLine("Bloklama Oranı: +41" , self.ITEM_BUFF_RATE_COLOR)
  1251. if metinSlot[1] == 1:
  1252. self.AppendTextLine("Åžaman Destek Aktif", grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  1253. if itemVnum >= 50255 and itemVnum <= 50260:
  1254. self.__TumunuAc("d:/ymir work/ui/ctrl+sag.tga")
  1255. self.AppendTextLine("(Tümünü açmak için tıklayın.)", self.SPECIAL_POSITIVE_COLOR)
  1256. if item.ITEM_TYPE_GACHA == itemType or\
  1257. item.ITEM_TYPE_GIFTBOX == itemType and\
  1258. itemVnum != 31374 and itemVnum != 50255 and itemVnum != 50187 and\
  1259. itemVnum != 50197 and itemVnum != 50188 and itemVnum != 50189 and\
  1260. itemVnum != 50190 and itemVnum != 50191 and itemVnum != 50192 and\
  1261. itemVnum != 50193 and itemVnum != 50194 and itemVnum != 50195 and\
  1262. itemVnum != 50196 and itemVnum != 50286 and itemVnum != 50285 and\
  1263. itemVnum != 26030 and itemVnum != 26031 and itemVnum != 26032 and\
  1264. itemVnum != 26033 and itemVnum != 26034 and itemVnum != 26035 and\
  1265. itemVnum != 26036 and itemVnum != 26037 and itemVnum != 26038 and\
  1266. itemVnum != 26039 and itemVnum != 26040 and itemVnum != 26041 and\
  1267. itemVnum != 26042 and itemVnum != 26043 and itemVnum != 26044 and\
  1268. itemVnum != 26045 and itemVnum != 26046 and itemVnum != 26047 and\
  1269. itemVnum != 26048 and itemVnum != 26049 and itemVnum != 26050 and\
  1270. itemVnum != 26051:
  1271. self.__SandikIngoru("d:/ymir work/ui/shift+sag.tga")
  1272. self.AppendTextLine("(Sandık içgörü için tıklayın.)", self.SPECIAL_POSITIVE_COLOR)
  1273. if 18 == itemType:
  1274. if itemSubType == 0 and itemVnum != 8383 and itemVnum != 8384:
  1275. PetVnum = item.GetValue(1)
  1276. if PetVnum != 0:
  1277. self.__ModelPreview(PetVnum)
  1278. ### Weapon ###
  1279. if item.ITEM_TYPE_WEAPON == itemType:
  1280. self.__AppendLimitInformation()
  1281. self.AppendSpace(5)
  1282. if item.WEAPON_FAN == itemSubType:
  1283. self.__AppendMagicAttackInfo()
  1284. self.__AppendAttackPowerInfo()
  1285. else:
  1286. self.__AppendAttackPowerInfo()
  1287. self.__AppendMagicAttackInfo()
  1288. self.__AppendAffectInformation()
  1289. self.__AppendAttributeInformation(attrSlot)
  1290. if app.ENABLE_CHANGELOOK_SYSTEM:
  1291. self.AppendTransmutation(window_type, slotIndex, transmutation)
  1292. self.AppendWearableInformation()
  1293. bHasRealtimeFlag = 0
  1294. for i in xrange(item.LIMIT_MAX_NUM):
  1295. (limitType, limitValue) = item.GetLimit(i)
  1296. if item.LIMIT_REAL_TIME == limitType:
  1297. bHasRealtimeFlag = 1
  1298. if bHasRealtimeFlag == 1:
  1299. self.AppendMallItemLastTime(metinSlot[0])
  1300. else:
  1301. self.__AppendMetinSlotInfo(metinSlot)
  1302. ### Armor ###
  1303. elif item.ITEM_TYPE_ARMOR == itemType:
  1304. self.__AppendLimitInformation()
  1305. ## ¹æ¾î·Â
  1306. defGrade = item.GetValue(1)
  1307. defBonus = item.GetValue(5)*2
  1308. if defGrade > 0:
  1309. self.AppendSpace(5)
  1310. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  1311. self.__AppendMagicDefenceInfo()
  1312. self.__AppendAffectInformation()
  1313. self.__AppendAttributeInformation(attrSlot)
  1314. if app.ENABLE_CHANGELOOK_SYSTEM:
  1315. self.AppendTransmutation(window_type, slotIndex, transmutation)
  1316. self.AppendWearableInformation()
  1317. if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR, item.ARMOR_PENDANT):
  1318. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  1319. else:
  1320. self.__AppendMetinSlotInfo(metinSlot)
  1321. ### Ring Slot Item (Not UNIQUE) ###
  1322. elif item.ITEM_TYPE_RING == itemType:
  1323. self.__AppendLimitInformation()
  1324. self.__AppendAffectInformation()
  1325. self.__AppendAttributeInformation(attrSlot)
  1326. bHasRealtimeFlag = 0
  1327. for i in xrange(item.LIMIT_MAX_NUM):
  1328. (limitType, limitValue) = item.GetLimit(i)
  1329. if item.LIMIT_REAL_TIME == limitType:
  1330. bHasRealtimeFlag = 1
  1331. if bHasRealtimeFlag == 1:
  1332. if metinSlot != 0:
  1333. self.AppendMallItemLastTime(metinSlot[0])
  1334. ### Belt Item ###
  1335. elif item.ITEM_TYPE_BELT == itemType:
  1336. self.__AppendLimitInformation()
  1337. self.__AppendAffectInformation()
  1338. self.__AppendAttributeInformation(attrSlot)
  1339. self.AppendTextLine("Kullanılabilir Slot : %s " % EXTRA_SLOT[item.GetValue(0)], self.SPECIAL_POSITIVE_COLOR)
  1340. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  1341. elif itemVnum >= 52701 and itemVnum <= 52707:
  1342. ItemVnumhaha = item.GetValue(1)
  1343. self.__ModelPreview(ItemVnumhaha)
  1344. elif 0 != isCostumeItem:
  1345. self.__AppendLimitInformation()
  1346. if app.ENABLE_SASH_SYSTEM:
  1347. if 28 == itemType:
  1348. if itemSubType == 4:
  1349. MountVnum = item.GetValue(1)
  1350. if MountVnum != 0:
  1351. self.__ModelPreview(MountVnum)
  1352. ##Render Target
  1353. if isCostumeSash:
  1354. ## ABSORPTION RATE
  1355. absChance = int(metinSlot[sash.ABSORPTION_SOCKET])
  1356. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (absChance), self.CONDITION_COLOR)
  1357. ## END ABSOPRTION RATE
  1358. itemAbsorbedVnum = int(metinSlot[sash.ABSORBED_SOCKET])
  1359. if itemAbsorbedVnum:
  1360. ## ATTACK / DEFENCE
  1361. item.SelectItem(itemAbsorbedVnum)
  1362. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  1363. if item.GetItemSubType() == item.WEAPON_FAN:
  1364. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1365. item.SelectItem(itemAbsorbedVnum)
  1366. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1367. else:
  1368. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1369. item.SelectItem(itemAbsorbedVnum)
  1370. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1371. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1372. defGrade = item.GetValue(1)
  1373. defBonus = item.GetValue(5) * 2
  1374. defGrade = self.CalcSashValue(defGrade, metinSlot[sash.ABSORPTION_SOCKET])
  1375. defBonus = self.CalcSashValue(defBonus, metinSlot[sash.ABSORPTION_SOCKET])
  1376. if defGrade > 0:
  1377. self.AppendSpace(5)
  1378. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  1379. item.SelectItem(itemAbsorbedVnum)
  1380. self.__AppendMagicDefenceInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1381. ## END ATTACK / DEFENCE
  1382. ## EFFECT
  1383. item.SelectItem(itemAbsorbedVnum)
  1384. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1385. (affectType, affectValue) = item.GetAffect(i)
  1386. affectValue = self.CalcSashValue(affectValue, metinSlot[sash.ABSORPTION_SOCKET])
  1387. affectString = self.__GetAffectString(affectType, affectValue)
  1388. if affectString and affectValue > 0:
  1389. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1390. item.SelectItem(itemAbsorbedVnum)
  1391. # END EFFECT
  1392. item.SelectItem(itemVnum)
  1393. ## ATTR
  1394. self.__AppendAttributeInformation(attrSlot, metinSlot[sash.ABSORPTION_SOCKET])
  1395. # END ATTR
  1396. else:
  1397. # ATTR
  1398. self.__AppendAttributeInformation(attrSlot)
  1399. # END ATTR
  1400. else:
  1401. self.__AppendAffectInformation()
  1402. self.__AppendAttributeInformation(attrSlot)
  1403. else:
  1404. self.__AppendAffectInformation()
  1405. self.__AppendAttributeInformation(attrSlot)
  1406. if app.ENABLE_CHANGELOOK_SYSTEM:
  1407. self.AppendTransmutation(window_type, slotIndex, transmutation)
  1408. self.AppendWearableInformation()
  1409. bHasRealtimeFlag = 0
  1410. for i in xrange(item.LIMIT_MAX_NUM):
  1411. (limitType, limitValue) = item.GetLimit(i)
  1412. if item.LIMIT_REAL_TIME == limitType:
  1413. bHasRealtimeFlag = 1
  1414. if bHasRealtimeFlag == 1:
  1415. self.AppendMallItemLastTime(metinSlot[0])
  1416. ## Rod ##
  1417. elif item.ITEM_TYPE_ROD == itemType:
  1418. if 0 != metinSlot:
  1419. curLevel = item.GetValue(0) / 10
  1420. curEXP = metinSlot[0]
  1421. maxEXP = item.GetValue(2)
  1422. self.__AppendLimitInformation()
  1423. self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  1424. ## Pick ##
  1425. elif item.ITEM_TYPE_PICK == itemType:
  1426. if 0 != metinSlot:
  1427. curLevel = item.GetValue(0) / 10
  1428. curEXP = metinSlot[0]
  1429. maxEXP = item.GetValue(2)
  1430. self.__AppendLimitInformation()
  1431. self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  1432. ## Lottery ##
  1433. elif item.ITEM_TYPE_LOTTERY == itemType:
  1434. if 0 != metinSlot:
  1435. ticketNumber = int(metinSlot[0])
  1436. stepNumber = int(metinSlot[1])
  1437. self.AppendSpace(5)
  1438. self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  1439. self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  1440. ### Metin ###
  1441. elif item.ITEM_TYPE_METIN == itemType:
  1442. self.AppendMetinInformation()
  1443. self.AppendMetinWearInformation()
  1444. ### Fish ###
  1445. elif item.ITEM_TYPE_FISH == itemType:
  1446. if 0 != metinSlot:
  1447. self.__AppendFishInfo(metinSlot[0])
  1448. ### Gacha = Battle Shop Chest ###
  1449. elif item.ITEM_TYPE_GACHA == itemType:
  1450. if 0 != metinSlot:
  1451. if self.isShopItem and int(metinSlot[0]) == 0:
  1452. restUsableCount = int(item.GetLimit(1)[1])
  1453. else:
  1454. restUsableCount = int(metinSlot[0])
  1455. self.AppendSpace(5)
  1456. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (restUsableCount), grp.GenerateColor(0.5, 1.0, 0.3, 1.0))
  1457. ## item.ITEM_TYPE_BLEND
  1458. elif item.ITEM_TYPE_BLEND == itemType:
  1459. self.__AppendLimitInformation()
  1460. if metinSlot:
  1461. affectType = metinSlot[0]
  1462. affectValue = metinSlot[1]
  1463. time = metinSlot[2]
  1464. self.AppendSpace(5)
  1465. affectText = self.__GetAffectString(affectType, affectValue)
  1466. self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1467. if time >= 0:
  1468. minute = (time / 60)
  1469. second = (time % 60)
  1470. timeString = localeInfo.TOOLTIP_POTION_TIME
  1471. if minute >= 0:
  1472. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1473. if second >= 0:
  1474. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1475. self.AppendTextLine(timeString)
  1476. else:
  1477. self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME)
  1478. else:
  1479. self.AppendTextLine("BLEND_POTION_NO_INFO")
  1480. elif item.ITEM_TYPE_UNIQUE == itemType:
  1481. if 0 != metinSlot:
  1482. bHasRealtimeFlag = 0
  1483. for i in xrange(item.LIMIT_MAX_NUM):
  1484. (limitType, limitValue) = item.GetLimit(i)
  1485. if item.LIMIT_REAL_TIME == limitType:
  1486. bHasRealtimeFlag = 1
  1487. if 1 == bHasRealtimeFlag:
  1488. self.AppendMallItemLastTime(metinSlot[0])
  1489. else:
  1490. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1491. if 1 == item.GetValue(2):
  1492. self.AppendMallItemLastTime(time)
  1493. else:
  1494. self.AppendUniqueItemLastTime(time)
  1495. ### Use ###
  1496. elif item.ITEM_TYPE_USE == itemType:
  1497. self.__AppendLimitInformation()
  1498. if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1499. self.__AppendPotionInformation()
  1500. elif item.USE_ABILITY_UP == itemSubType:
  1501. self.__AppendAbilityPotionInformation()
  1502. if 27989 == itemVnum or 76006 == itemVnum:
  1503. if 0 != metinSlot:
  1504. useCount = int(metinSlot[0])
  1505. if (app.WJ_COMBAT_ZONE):
  1506. if itemVnum in [50287, 50288, 50290]:
  1507. if 0 != metinSlot:
  1508. useCount = int(metinSlot[0])
  1509. self.AppendSpace(5)
  1510. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % ((3 - useCount)), self.CONDITION_COLOR)
  1511. elif 50004 == itemVnum:
  1512. if 0 != metinSlot:
  1513. useCount = int(metinSlot[0])
  1514. self.AppendSpace(5)
  1515. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1516. elif constInfo.IS_AUTO_POTION(itemVnum):
  1517. if 0 != metinSlot:
  1518. isActivated = int(metinSlot[0])
  1519. usedAmount = float(metinSlot[1])
  1520. totalAmount = float(metinSlot[2])
  1521. if 0 == totalAmount:
  1522. totalAmount = 1
  1523. self.AppendSpace(5)
  1524. if 0 != isActivated:
  1525. self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1526. self.AppendSpace(5)
  1527. self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1528. elif itemVnum in WARP_SCROLLS:
  1529. if 0 != metinSlot:
  1530. xPos = int(metinSlot[0])
  1531. yPos = int(metinSlot[1])
  1532. if xPos != 0 and yPos != 0:
  1533. (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1534. localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1535. self.AppendSpace(5)
  1536. if localeMapName!="":
  1537. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1538. else:
  1539. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1540. dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1541. if itemVnum >= 70500 and itemVnum <= 70504:
  1542. if 0 != metinSlot:
  1543. useCount = int(metinSlot[0])
  1544. self.AppendSpace(7)
  1545. self.AppendTextLine("Oyun süresi: 60/60 dak. Oyun" , self.ITEM_BUFF_RATE_COLOR)
  1546. self.AppendTextLine("süresine ulaştığında saldırı" , self.ITEM_BUFF_RATE_COLOR)
  1547. self.AppendTextLine("hasarı x1.5 artar." , self.ITEM_BUFF_RATE_COLOR)
  1548. self.AppendTextLine("Şunlarda geçerli değildir. Pvp" , self.ITEM_BUFF_TYPE_COLOR)
  1549. self.AppendTextLine("dönüşüm, binek sürmek." , self.ITEM_BUFF_TYPE_COLOR)
  1550. if 0 != useCount:
  1551. self.AppendTextLine("Efekt etkinleÅŸtirildi." , self.POSITIVE_COLOR)
  1552. elif 0 == useCount:
  1553. self.AppendTextLine("Efekt etkinleÅŸtirilmedi.", self.NEGATIVE_COLOR)
  1554. self.AppendTextLine("Kalan sınırlar : Sınırsız")
  1555. if itemVnum >= 70505 and itemVnum <= 70509:
  1556. if 0 != metinSlot:
  1557. useCount = int(metinSlot[0])
  1558. self.AppendSpace(7)
  1559. self.AppendTextLine("Oyun süresi: 60/60 dak. Oyun" , self.ITEM_BUFF_RATE_COLOR)
  1560. self.AppendTextLine("süresine ulaştığında beceri" , self.ITEM_BUFF_RATE_COLOR)
  1561. self.AppendTextLine("hasarı x1.5 artar." , self.ITEM_BUFF_RATE_COLOR)
  1562. self.AppendTextLine("Şunlarda geçerli değildir. Pvp" , self.ITEM_BUFF_TYPE_COLOR)
  1563. self.AppendTextLine("dönüşüm, binek sürmek." , self.ITEM_BUFF_TYPE_COLOR)
  1564. if 0 != useCount:
  1565. self.AppendTextLine("Efekt etkinleÅŸtirildi." , self.POSITIVE_COLOR)
  1566. elif 0 == useCount:
  1567. self.AppendTextLine("Efekt etkinleÅŸtirilmedi.", self.NEGATIVE_COLOR)
  1568. self.AppendTextLine("Kalan sınırlar : Sınırsız")
  1569. if 79000 == itemVnum:
  1570. if 0 != metinSlot:
  1571. useCount = int(metinSlot[0])
  1572. self.AppendSpace(5)
  1573. self.AppendTextLine("Kutsama Seviyesi: [MASTER]" , self.ITEM_BUFF_LEVEL_COLOR)
  1574. self.AppendTextLine("Verilen Kutsama: Bloklama" , self.ITEM_BUFF_TYPE_COLOR)
  1575. self.AppendTextLine("Kutsama Oranı: %24" , self.ITEM_BUFF_RATE_COLOR)
  1576. self.AppendTextLine("Kutsama Süresi: 164" , self.ITEM_BUFF_DURATION_COLOR)
  1577. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1578. if 79001 == itemVnum:
  1579. if 0 != metinSlot:
  1580. useCount = int(metinSlot[0])
  1581. self.AppendSpace(5)
  1582. self.AppendTextLine("Kutsama Seviyesi: [GRAND]" , self.ITEM_BUFF_LEVEL_COLOR)
  1583. self.AppendTextLine("Verilen Kutsama: Bloklama" , self.ITEM_BUFF_TYPE_COLOR)
  1584. self.AppendTextLine("Kutsama Oranı: %29" , self.ITEM_BUFF_RATE_COLOR)
  1585. self.AppendTextLine("Kutsama Süresi: 224" , self.ITEM_BUFF_DURATION_COLOR)
  1586. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1587. if 79002 == itemVnum:
  1588. if 0 != metinSlot:
  1589. useCount = int(metinSlot[0])
  1590. self.AppendSpace(5)
  1591. self.AppendTextLine("Kutsama Seviyesi: [PERFECT]" , self.ITEM_BUFF_LEVEL_COLOR)
  1592. self.AppendTextLine("Verilen Kutsama: Bloklama" , self.ITEM_BUFF_TYPE_COLOR)
  1593. self.AppendTextLine("Kutsama Oranı: %35" , self.ITEM_BUFF_RATE_COLOR)
  1594. self.AppendTextLine("Kutsama Süresi: 310" , self.ITEM_BUFF_DURATION_COLOR)
  1595. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1596. if 79003 == itemVnum:
  1597. if 0 != metinSlot:
  1598. useCount = int(metinSlot[0])
  1599. self.AppendSpace(5)
  1600. self.AppendTextLine("Kutsama Seviyesi: [MASTER]" , self.ITEM_BUFF_LEVEL_COLOR)
  1601. self.AppendTextLine("Verilen Kutsama: Kritik" , self.ITEM_BUFF_TYPE_COLOR)
  1602. self.AppendTextLine("Kutsama Oranı: %24" , self.ITEM_BUFF_RATE_COLOR)
  1603. self.AppendTextLine("Kutsama Süresi: 110" , self.ITEM_BUFF_DURATION_COLOR)
  1604. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1605. if 79004 == itemVnum:
  1606. if 0 != metinSlot:
  1607. useCount = int(metinSlot[0])
  1608. self.AppendSpace(5)
  1609. self.AppendTextLine("Kutsama Seviyesi: [GRAND]" , self.ITEM_BUFF_LEVEL_COLOR)
  1610. self.AppendTextLine("Verilen Kutsama: Kritik" , self.ITEM_BUFF_TYPE_COLOR)
  1611. self.AppendTextLine("Kutsama Oranı: %29" , self.ITEM_BUFF_RATE_COLOR)
  1612. self.AppendTextLine("Kutsama Süresi: 142" , self.ITEM_BUFF_DURATION_COLOR)
  1613. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1614. if 79005 == itemVnum:
  1615. if 0 != metinSlot:
  1616. useCount = int(metinSlot[0])
  1617. self.AppendSpace(5)
  1618. self.AppendTextLine("Kutsama Seviyesi: [PERFECT]" , self.ITEM_BUFF_LEVEL_COLOR)
  1619. self.AppendTextLine("Verilen Kutsama: Kritik" , self.ITEM_BUFF_TYPE_COLOR)
  1620. self.AppendTextLine("Kutsama Oranı: %35" , self.ITEM_BUFF_RATE_COLOR)
  1621. self.AppendTextLine("Kutsama Süresi: 185" , self.ITEM_BUFF_DURATION_COLOR)
  1622. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1623. if 79006 == itemVnum:
  1624. if 0 != metinSlot:
  1625. useCount = int(metinSlot[0])
  1626. self.AppendSpace(5)
  1627. self.AppendTextLine("Kutsama Seviyesi: [MASTER]" , self.ITEM_BUFF_LEVEL_COLOR)
  1628. self.AppendTextLine("Verilen Kutsama: Yansıtma" , self.ITEM_BUFF_TYPE_COLOR)
  1629. self.AppendTextLine("Kutsama Oranı: %21" , self.ITEM_BUFF_RATE_COLOR)
  1630. self.AppendTextLine("Kutsama Süresi: 160" , self.ITEM_BUFF_DURATION_COLOR)
  1631. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1632. if 79007 == itemVnum:
  1633. if 0 != metinSlot:
  1634. useCount = int(metinSlot[0])
  1635. self.AppendSpace(5)
  1636. self.AppendTextLine("Kutsama Seviyesi: [GRAND]" , self.ITEM_BUFF_LEVEL_COLOR)
  1637. self.AppendTextLine("Verilen Kutsama: Yansıtma" , self.ITEM_BUFF_TYPE_COLOR)
  1638. self.AppendTextLine("Kutsama Oranı: %31" , self.ITEM_BUFF_RATE_COLOR)
  1639. self.AppendTextLine("Kutsama Süresi: 224" , self.ITEM_BUFF_DURATION_COLOR)
  1640. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1641. if 79008 == itemVnum:
  1642. if 0 != metinSlot:
  1643. useCount = int(metinSlot[0])
  1644. self.AppendSpace(5)
  1645. self.AppendTextLine("Kutsama Seviyesi: [PERFECT]" , self.ITEM_BUFF_LEVEL_COLOR)
  1646. self.AppendTextLine("Verilen Kutsama: Yansıtma" , self.ITEM_BUFF_TYPE_COLOR)
  1647. self.AppendTextLine("Kutsama Oranı: %45" , self.ITEM_BUFF_RATE_COLOR)
  1648. self.AppendTextLine("Kutsama Süresi: 310" , self.ITEM_BUFF_DURATION_COLOR)
  1649. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1650. #####
  1651. if item.USE_SPECIAL == itemSubType:
  1652. bHasRealtimeFlag = 0
  1653. for i in xrange(item.LIMIT_MAX_NUM):
  1654. (limitType, limitValue) = item.GetLimit(i)
  1655. if item.LIMIT_REAL_TIME == limitType:
  1656. bHasRealtimeFlag = 1
  1657. if 1 == bHasRealtimeFlag:
  1658. self.AppendMallItemLastTime(metinSlot[0])
  1659. else:
  1660. if 0 != metinSlot:
  1661. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1662. if 1 == item.GetValue(2):
  1663. self.AppendMallItemLastTime(time)
  1664. elif item.USE_TIME_CHARGE_PER == itemSubType:
  1665. bHasRealtimeFlag = 0
  1666. for i in xrange(item.LIMIT_MAX_NUM):
  1667. (limitType, limitValue) = item.GetLimit(i)
  1668. if item.LIMIT_REAL_TIME == limitType:
  1669. bHasRealtimeFlag = 1
  1670. if metinSlot[2]:
  1671. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  1672. else:
  1673. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  1674. if 1 == bHasRealtimeFlag:
  1675. self.AppendMallItemLastTime(metinSlot[0])
  1676. elif item.USE_TIME_CHARGE_FIX == itemSubType:
  1677. bHasRealtimeFlag = 0
  1678. for i in xrange(item.LIMIT_MAX_NUM):
  1679. (limitType, limitValue) = item.GetLimit(i)
  1680. if item.LIMIT_REAL_TIME == limitType:
  1681. bHasRealtimeFlag = 1
  1682. if metinSlot[2]:
  1683. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  1684. else:
  1685. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  1686. if 1 == bHasRealtimeFlag:
  1687. self.AppendMallItemLastTime(metinSlot[0])
  1688. elif item.ITEM_TYPE_QUEST == itemType:
  1689. if app.ENABLE_ATTENDANCE_EVENT:
  1690. if itemVnum == 71150:
  1691. self.AppendMagicEggInformation(metinSlot)
  1692. for i in xrange(item.LIMIT_MAX_NUM):
  1693. (limitType, limitValue) = item.GetLimit(i)
  1694. if item.LIMIT_REAL_TIME == limitType:
  1695. self.AppendMallItemLastTime(metinSlot[0])
  1696. elif item.ITEM_TYPE_DS == itemType:
  1697. self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1698. self.__AppendAttributeInformation(attrSlot)
  1699. else:
  1700. self.__AppendLimitInformation()
  1701. for i in xrange(item.LIMIT_MAX_NUM):
  1702. (limitType, limitValue) = item.GetLimit(i)
  1703. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1704. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1705. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1706. self.AppendTimerBasedOnWearLastTime(metinSlot)
  1707. if chr.IsGameMaster(player.GetMainCharacterIndex()):
  1708. self.AppendTextLine(localeInfo.ITEM_VNUM_TOOLTIP % (int(itemVnum)), self.SINIRSIZ_COLOR)
  1709. if app.ENABLE_MINI_GAME_CATCH_KING:
  1710. if self.itemVnum in [79603, 79604]:
  1711. if 0 != metinSlot[0]:
  1712. self.AppendMallItemLastTime(metinSlot[0])
  1713. self.ShowToolTip()
  1714. def __DragonSoulInfoString (self, dwVnum):
  1715. step = (dwVnum / 100) % 10
  1716. refine = (dwVnum / 10) % 10
  1717. if 0 == step:
  1718. return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1719. elif 1 == step:
  1720. return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1721. elif 2 == step:
  1722. return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1723. elif 3 == step:
  1724. return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1725. elif 4 == step:
  1726. return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1727. else:
  1728. return ""
  1729. if app.ENABLE_ATTENDANCE_EVENT:
  1730. def AppendMagicEggInformation(self, metinSlot):
  1731. self.AppendSpace(5)
  1732. if metinSlot[1] == 0:
  1733. self.AppendTextLine("[ 3 Kalan ]")
  1734. else:
  1735. self.AppendTextLine("[ %d Kalan ]" % metinSlot[0])
  1736. if app.GetGlobalTimeStamp() > metinSlot[1]:
  1737. self.AppendSpace(5)
  1738. self.AppendTextLine("Mevcut")
  1739. else:
  1740. leftSec = max(0, metinSlot[1] - app.GetGlobalTimeStamp())
  1741. self.AppendSpace(5)
  1742. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec))
  1743. def __IsHair(self, itemVnum):
  1744. return (self.__IsOldHair(itemVnum) or
  1745. self.__IsNewHair(itemVnum) or
  1746. self.__IsNewHair2(itemVnum) or
  1747. self.__IsNewHair3(itemVnum) or
  1748. self.__IsCostumeHair(itemVnum)
  1749. )
  1750. def __IsOldHair(self, itemVnum):
  1751. return itemVnum > 73000 and itemVnum < 74000
  1752. def __IsNewHair(self, itemVnum):
  1753. return itemVnum > 74000 and itemVnum < 75000
  1754. def __IsNewHair2(self, itemVnum):
  1755. return itemVnum > 75000 and itemVnum < 76000
  1756. def __IsNewHair3(self, itemVnum):
  1757. return ((74012 < itemVnum and itemVnum < 74022) or
  1758. (74262 < itemVnum and itemVnum < 74272) or
  1759. (74512 < itemVnum and itemVnum < 74522) or
  1760. (74762 < itemVnum and itemVnum < 74772) or
  1761. (45000 < itemVnum and itemVnum < 47000))
  1762. def __IsCostumeHair(self, itemVnum):
  1763. return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1764. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  1765. def __AppendPrivateSearchItemicon(self, itemVnum):
  1766. itemImage = ui.ImageBox()
  1767. itemImage.SetParent(self)
  1768. itemImage.Show()
  1769. item.SelectItem(itemVnum)
  1770. itemImage.LoadImage(item.GetIconImageFileName())
  1771. itemImage.SetPosition((self.toolTipWidth/2)-16, self.toolTipHeight)
  1772. self.toolTipHeight += itemImage.GetHeight()
  1773. self.childrenList.append(itemImage)
  1774. self.ResizeToolTip()
  1775. if app.ENABLE_ATTENDANCE_EVENT:
  1776. def __AppendAttendanceRewardItemIcon(self, itemVnum):
  1777. itemImage = ui.ImageBox()
  1778. itemImage.SetParent(self)
  1779. itemImage.Show()
  1780. item.SelectItem(itemVnum)
  1781. itemImage.LoadImage(item.GetIconImageFileName())
  1782. itemImage.SetPosition((self.toolTipWidth/2)-16, self.toolTipHeight)
  1783. self.toolTipHeight += itemImage.GetHeight()
  1784. self.childrenList.append(itemImage)
  1785. self.ResizeToolTip()
  1786. def __AppendHairIcon(self, itemVnum):
  1787. itemImage = ui.ImageBox()
  1788. itemImage.SetParent(self)
  1789. itemImage.Show()
  1790. if self.__IsOldHair(itemVnum):
  1791. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1792. elif self.__IsNewHair3(itemVnum):
  1793. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1794. elif self.__IsNewHair(itemVnum):
  1795. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1796. elif self.__IsNewHair2(itemVnum):
  1797. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1798. #elif self.__IsCostumeHair(itemVnum):
  1799. #itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1800. #itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1801. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  1802. if self.isPrivateSearchItem:
  1803. itemImage.SetPosition((self.toolTipWidth/2)-48, self.toolTipHeight)
  1804. else:
  1805. itemImage.SetPosition((self.toolTipWidth/2)-48, self.toolTipHeight)
  1806. else:
  1807. itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1808. self.toolTipHeight += itemImage.GetHeight()
  1809. self.childrenList.append(itemImage)
  1810. self.ResizeToolTip()
  1811. def __ModelPreview(self, Vnum):
  1812. if constInfo.RENDER_TARGET == 0:
  1813. return
  1814. RENDER_TARGET_INDEX = 1
  1815. self.ModelPreviewBoard = ui.ThinBoard()
  1816. self.ModelPreviewBoard.SetParent(self)
  1817. self.ModelPreviewBoard.SetSize(190+10, 210+30-12)
  1818. self.ModelPreviewBoard.SetPosition(-202, 0)
  1819. self.ModelPreviewBoard.Show()
  1820. self.ModelPreview = ui.RenderTarget()
  1821. self.ModelPreview.SetParent(self.ModelPreviewBoard)
  1822. self.ModelPreview.SetSize(190, 210)
  1823. self.ModelPreview.SetPosition(5, 22-12)
  1824. self.ModelPreview.SetRenderTarget(RENDER_TARGET_INDEX)
  1825. self.ModelPreview.Show()
  1826. self.ModelPreviewText = ui.TextLine()
  1827. self.ModelPreviewText.SetParent(self.ModelPreviewBoard)
  1828. self.ModelPreviewText.SetFontName(self.defFontName)
  1829. self.ModelPreviewText.SetPackedFontColor(grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0))
  1830. self.ModelPreviewText.SetPosition(0, 5)
  1831. self.ModelPreviewText.SetText("")
  1832. self.ModelPreviewText.SetOutline()
  1833. self.ModelPreviewText.SetFeather(False)
  1834. self.ModelPreviewText.SetWindowHorizontalAlignCenter()
  1835. self.ModelPreviewText.SetHorizontalAlignCenter()
  1836. self.ModelPreviewText.Show()
  1837. renderTarget.SetBackground(RENDER_TARGET_INDEX, "d:/ymir work/ui/game/myshop_deco/model_view_bg.sub")
  1838. renderTarget.SetVisibility(RENDER_TARGET_INDEX, True)
  1839. renderTarget.SelectModel(RENDER_TARGET_INDEX, Vnum)
  1840. def __ModelPreviewClose(self):
  1841. RENDER_TARGET_INDEX = 1
  1842. if self.ModelPreviewBoard:
  1843. self.ModelPreviewBoard.Hide()
  1844. self.ModelPreview.Hide()
  1845. self.ModelPreviewBoard = None
  1846. self.ModelPreview = None
  1847. renderTarget.SetVisibility(RENDER_TARGET_INDEX, False)
  1848. def __AdjustMaxWidth(self, attrSlot, desc):
  1849. newToolTipWidth = self.toolTipWidth
  1850. newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1851. newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1852. if newToolTipWidth > self.toolTipWidth:
  1853. self.toolTipWidth = newToolTipWidth
  1854. self.ResizeToolTip()
  1855. def __AdjustAttrMaxWidth(self, attrSlot):
  1856. if 0 == attrSlot:
  1857. return self.toolTipWidth
  1858. maxWidth = self.toolTipWidth
  1859. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1860. type = attrSlot[i][0]
  1861. value = attrSlot[i][1]
  1862. if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1863. if value > 0:
  1864. maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1865. return maxWidth
  1866. def __AdjustDescMaxWidth(self, desc):
  1867. if len(desc) < DESC_DEFAULT_MAX_COLS:
  1868. return self.toolTipWidth
  1869. return DESC_WESTERN_MAX_WIDTH
  1870. def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1871. skillName = skill.GetSkillName(skillIndex)
  1872. if not skillName:
  1873. return
  1874. if localeInfo.IsVIETNAM():
  1875. itemName = bookName + " " + skillName
  1876. else:
  1877. itemName = skillName + " " + bookName
  1878. self.SetTitle(itemName)
  1879. def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1880. self.AppendSpace(5)
  1881. self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1882. self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1883. if curEXP == maxEXP:
  1884. self.AppendSpace(5)
  1885. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1886. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1887. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1888. def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1889. self.AppendSpace(5)
  1890. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1891. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1892. if curEXP == maxEXP:
  1893. self.AppendSpace(5)
  1894. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  1895. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  1896. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  1897. def __AppendLimitInformation(self):
  1898. if app.ENABLE_ATTENDANCE_EVENT:
  1899. if self.isAttendanceRewardItem:
  1900. return
  1901. appendSpace = False
  1902. for i in xrange(item.LIMIT_MAX_NUM):
  1903. (limitType, limitValue) = item.GetLimit(i)
  1904. if limitValue > 0:
  1905. if FALSE == appendSpace:
  1906. self.AppendSpace(5)
  1907. appendSpace = TRUE
  1908. else:
  1909. continue
  1910. if item.LIMIT_LEVEL == limitType:
  1911. color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  1912. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  1913. """
  1914. elif item.LIMIT_STR == limitType:
  1915. color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  1916. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  1917. elif item.LIMIT_DEX == limitType:
  1918. color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  1919. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  1920. elif item.LIMIT_INT == limitType:
  1921. color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  1922. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  1923. elif item.LIMIT_CON == limitType:
  1924. color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  1925. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  1926. """
  1927. def __AppendSealInformation(self, window_type, slotIndex):
  1928. if window_type == player.SAFEBOX:
  1929. if safebox.GetItemBind(slotIndex) <= 1:
  1930. itemSoulTime = safebox.GetItemBind(slotIndex)
  1931. else:
  1932. itemSoulTime = max(0, safebox.GetItemBind(slotIndex) - app.GetGlobalTimeStamp())
  1933. elif window_type == player.MALL:
  1934. if safebox.GetMallItemBind(slotIndex) <= 1:
  1935. itemSoulTime = safebox.GetMallItemBind(slotIndex)
  1936. else:
  1937. itemSoulTime = max(0, safebox.GetMallItemBind(slotIndex) - app.GetGlobalTimeStamp())
  1938. elif window_type == player.INVENTORY:
  1939. if player.GetItemBind(slotIndex) <= 1:
  1940. itemSoulTime = player.GetItemBind(slotIndex)
  1941. else:
  1942. itemSoulTime = max(0, player.GetItemBind(slotIndex) - app.GetGlobalTimeStamp())
  1943. else:
  1944. return
  1945. if itemSoulTime == 0:
  1946. return
  1947. elif itemSoulTime == 1:
  1948. self.AppendSpace(5)
  1949. self.AppendTextLine(localeInfo.TOOLTIP_SEALED, self.NEGATIVE_COLOR)
  1950. elif itemSoulTime > 1:
  1951. self.AppendSpace(5)
  1952. hrs = itemSoulTime / 3600
  1953. itemSoulTime -= 3600 * hrs
  1954. mins = itemSoulTime / 60
  1955. itemSoulTime -= 60 * mins
  1956. self.AppendTextLine(localeInfo.TOOLTIP_UNSEAL_LEFT_TIME % (hrs, mins), self.NEGATIVE_COLOR)
  1957. def __GetAffectString(self, affectType, affectValue):
  1958. if 0 == affectType:
  1959. return None
  1960. if 0 == affectValue:
  1961. return None
  1962. try:
  1963. return self.AFFECT_DICT[affectType](affectValue)
  1964. except TypeError:
  1965. return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  1966. except KeyError:
  1967. return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  1968. def __AppendAffectInformation(self):
  1969. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1970. (affectType, affectValue) = item.GetAffect(i)
  1971. affectString = self.__GetAffectString(affectType, affectValue)
  1972. if affectString:
  1973. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1974. def AppendWearableInformation(self):
  1975. itemType = item.GetItemType()
  1976. self.AppendSpace(5)
  1977. if item.ITEM_TYPE_WEAPON == itemType or item.ITEM_TYPE_ARMOR == itemType or item.ARMOR_FOOTS == itemType or item.ARMOR_NECK == itemType or item.ARMOR_EAR == itemType:
  1978. self.AppendTextLine("Bir ekstra bonus ekleyebilirsin.",self.SINIRSIZ_COLOR)
  1979. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  1980. flagList = (
  1981. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  1982. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  1983. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  1984. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN),
  1985. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WOLFMAN)
  1986. )
  1987. characterNames = ""
  1988. for i in xrange(self.CHARACTER_COUNT):
  1989. name = self.CHARACTER_NAMES[i]
  1990. flag = flagList[i]
  1991. if flag:
  1992. characterNames += " "
  1993. characterNames += name
  1994. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, TRUE)
  1995. textLine.SetFeather()
  1996. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  1997. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, TRUE)
  1998. textLine.SetFeather()
  1999. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  2000. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, TRUE)
  2001. textLine.SetFeather()
  2002. def __AppendPotionInformation(self):
  2003. self.AppendSpace(5)
  2004. healHP = item.GetValue(0)
  2005. healSP = item.GetValue(1)
  2006. healStatus = item.GetValue(2)
  2007. healPercentageHP = item.GetValue(3)
  2008. healPercentageSP = item.GetValue(4)
  2009. if healHP > 0:
  2010. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  2011. if healSP > 0:
  2012. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  2013. if healStatus != 0:
  2014. self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  2015. if healPercentageHP > 0:
  2016. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  2017. if healPercentageSP > 0:
  2018. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  2019. def __AppendAbilityPotionInformation(self):
  2020. self.AppendSpace(5)
  2021. abilityType = item.GetValue(0)
  2022. time = item.GetValue(1)
  2023. point = item.GetValue(2)
  2024. if abilityType == item.APPLY_ATT_SPEED:
  2025. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  2026. elif abilityType == item.APPLY_MOV_SPEED:
  2027. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  2028. if time > 0:
  2029. minute = (time / 60)
  2030. second = (time % 60)
  2031. timeString = localeInfo.TOOLTIP_POTION_TIME
  2032. if minute > 0:
  2033. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  2034. if second > 0:
  2035. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  2036. self.AppendTextLine(timeString)
  2037. def GetPriceColor(self, price):
  2038. if price>=constInfo.HIGH_PRICE:
  2039. return self.HIGH_PRICE_COLOR
  2040. if price>=constInfo.MIDDLE_PRICE:
  2041. return self.MIDDLE_PRICE_COLOR
  2042. else:
  2043. return self.LOW_PRICE_COLOR
  2044. def AppendPrice(self, price):
  2045. self.AppendSpace(5)
  2046. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2047. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  2048. if app.ENABLE_BUY_WITH_ITEM:
  2049. def AppendPrice_WithItem(self, price, itemVnum, itemName):
  2050. self.AppendSpace(5)
  2051. self.AppendTextLine("[Nesne ile satın alınabilir]" , self.SHOP_ITEM_COLOR)
  2052. item.SelectItem(itemVnum)
  2053. eklenecekIcon = item.GetIconImageFileName()
  2054. self.AppendTextLine_WithItem((localeInfo.NumberToWithItemString(price, itemName)), eklenecekIcon, self.GetPriceColor(price))
  2055. def AppendTextLine_WithItem(self, text, image, color = FONT_COLOR):
  2056. ayraC = text.split("|")
  2057. resimdenOnce, resimdenSonra = (ayraC[0], ayraC[1])
  2058. textLine = ui.TextLine()
  2059. textLine.SetParent(self)
  2060. textLine.SetFontName(self.defFontName)
  2061. textLine.SetPackedFontColor(color)
  2062. textLine.SetText(resimdenOnce)
  2063. textLine.SetOutline()
  2064. textLine.SetFeather(FALSE)
  2065. itemIcon = ui.ImageBox()
  2066. itemIcon.SetParent(self)
  2067. itemIcon.LoadImage(image)
  2068. textLine2 = ui.TextLine()
  2069. textLine2.SetParent(self)
  2070. textLine2.SetFontName(self.defFontName)
  2071. textLine2.SetPackedFontColor(color)
  2072. textLine2.SetText(resimdenSonra)
  2073. textLine2.SetOutline()
  2074. textLine2.SetFeather(FALSE)
  2075. textLine.Show()
  2076. itemIcon.Show()
  2077. textLine2.Show()
  2078. baslangicX_a = self.GetWidth() / 2 - 75
  2079. baslangicX_b = textLine.GetTextSize()[0]
  2080. baslangicX_c = itemIcon.GetWidth()
  2081. textLine.SetPosition(baslangicX_a, self.toolTipHeight+6)
  2082. itemIcon.SetPosition(baslangicX_a + baslangicX_b, self.toolTipHeight)
  2083. textLine2.SetPosition(baslangicX_a + baslangicX_b + baslangicX_c, self.toolTipHeight+6)
  2084. self.childrenList.append(textLine)
  2085. self.childrenList.append(itemIcon)
  2086. self.childrenList.append(textLine2)
  2087. self.toolTipHeight += itemIcon.GetHeight()
  2088. self.ResizeToolTip()
  2089. return textLine
  2090. return itemIcon
  2091. return textLine2
  2092. if app.ENABLE_SHOP_SISTEM:
  2093. def miktar(self, price):
  2094. self.AppendSpace(5)
  2095. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2096. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE_NEW % (localeInfo.NumberToMoneyString2(price)), self.GetPriceColor(price))
  2097. def miktar2(self, price):
  2098. self.AppendSpace(5)
  2099. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE2 , self.SHOP_ITEM_COLOR)
  2100. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE_NEW_2)
  2101. #self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE_NEW_2 % (localeInfo.NumberToMoneyString2(price)), self.GetPriceColor(price))
  2102. def AppendPriceBySecondaryCoin(self, price):
  2103. self.AppendSpace(5)
  2104. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2105. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  2106. def AppendSellingPrice(self, price):
  2107. if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
  2108. self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  2109. self.AppendSpace(5)
  2110. else:
  2111. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2112. self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  2113. self.AppendSpace(5)
  2114. def AppendMetinInformation(self):
  2115. affectType, affectValue = item.GetAffect(0)
  2116. affectString = self.__GetAffectString(affectType, affectValue)
  2117. if affectString:
  2118. self.AppendSpace(5)
  2119. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2120. def AppendMetinWearInformation(self):
  2121. self.AppendSpace(5)
  2122. self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  2123. flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  2124. item.IsWearableFlag(item.WEARABLE_HEAD),
  2125. item.IsWearableFlag(item.WEARABLE_FOOTS),
  2126. item.IsWearableFlag(item.WEARABLE_WRIST),
  2127. item.IsWearableFlag(item.WEARABLE_WEAPON),
  2128. item.IsWearableFlag(item.WEARABLE_NECK),
  2129. item.IsWearableFlag(item.WEARABLE_EAR),
  2130. item.IsWearableFlag(item.WEARABLE_UNIQUE),
  2131. item.IsWearableFlag(item.WEARABLE_SHIELD),
  2132. item.IsWearableFlag(item.WEARABLE_ARROW))
  2133. wearNames = ""
  2134. for i in xrange(self.WEAR_COUNT):
  2135. name = self.WEAR_NAMES[i]
  2136. flag = flagList[i]
  2137. if flag:
  2138. wearNames += " "
  2139. wearNames += name
  2140. textLine = ui.TextLine()
  2141. textLine.SetParent(self)
  2142. textLine.SetFontName(self.defFontName)
  2143. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  2144. textLine.SetHorizontalAlignCenter()
  2145. textLine.SetPackedFontColor(self.NORMAL_COLOR)
  2146. textLine.SetText(wearNames)
  2147. textLine.Show()
  2148. self.childrenList.append(textLine)
  2149. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  2150. self.ResizeToolTip()
  2151. def GetMetinSocketType(self, number):
  2152. if player.METIN_SOCKET_TYPE_NONE == number:
  2153. return player.METIN_SOCKET_TYPE_NONE
  2154. elif player.METIN_SOCKET_TYPE_SILVER == number:
  2155. return player.METIN_SOCKET_TYPE_SILVER
  2156. elif player.METIN_SOCKET_TYPE_GOLD == number:
  2157. return player.METIN_SOCKET_TYPE_GOLD
  2158. else:
  2159. item.SelectItem(number)
  2160. if item.METIN_NORMAL == item.GetItemSubType():
  2161. return player.METIN_SOCKET_TYPE_SILVER
  2162. elif item.METIN_GOLD == item.GetItemSubType():
  2163. return player.METIN_SOCKET_TYPE_GOLD
  2164. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  2165. return player.METIN_SOCKET_TYPE_SILVER
  2166. elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  2167. return player.METIN_SOCKET_TYPE_SILVER
  2168. elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  2169. return player.METIN_SOCKET_TYPE_SILVER
  2170. return player.METIN_SOCKET_TYPE_NONE
  2171. def GetMetinItemIndex(self, number):
  2172. if player.METIN_SOCKET_TYPE_SILVER == number:
  2173. return 0
  2174. if player.METIN_SOCKET_TYPE_GOLD == number:
  2175. return 0
  2176. return number
  2177. def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
  2178. ACCESSORY_SOCKET_MAX_SIZE = 3
  2179. cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  2180. end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  2181. affectType1, affectValue1 = item.GetAffect(0)
  2182. affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  2183. affectType2, affectValue2 = item.GetAffect(1)
  2184. affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  2185. mtrlPos=0
  2186. mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  2187. for mtrl in mtrlList:
  2188. affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
  2189. affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  2190. leftTime = 0
  2191. if cur == mtrlPos+1:
  2192. leftTime=metinSlot[2]
  2193. self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  2194. mtrlPos+=1
  2195. def __AppendMetinSlotInfo(self, metinSlot):
  2196. if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  2197. return
  2198. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2199. self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  2200. def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  2201. if 0 == metinSlot:
  2202. return 1
  2203. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2204. metinSlotData=metinSlot[i]
  2205. if 0 != self.GetMetinSocketType(metinSlotData):
  2206. if 0 != self.GetMetinItemIndex(metinSlotData):
  2207. return 0
  2208. return 1
  2209. def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  2210. slotType = self.GetMetinSocketType(metinSlotData)
  2211. itemIndex = self.GetMetinItemIndex(metinSlotData)
  2212. if 0 == slotType:
  2213. return
  2214. self.AppendSpace(5)
  2215. slotImage = ui.ImageBox()
  2216. slotImage.SetParent(self)
  2217. slotImage.Show()
  2218. nameTextLine = ui.TextLine()
  2219. nameTextLine.SetParent(self)
  2220. nameTextLine.SetFontName(self.defFontName)
  2221. nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  2222. nameTextLine.SetOutline()
  2223. nameTextLine.SetFeather()
  2224. nameTextLine.Show()
  2225. self.childrenList.append(nameTextLine)
  2226. if player.METIN_SOCKET_TYPE_SILVER == slotType:
  2227. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  2228. elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  2229. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  2230. self.childrenList.append(slotImage)
  2231. if localeInfo.IsARABIC():
  2232. slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  2233. nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  2234. else:
  2235. slotImage.SetPosition(9, self.toolTipHeight-1)
  2236. nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  2237. metinImage = ui.ImageBox()
  2238. metinImage.SetParent(self)
  2239. metinImage.Show()
  2240. self.childrenList.append(metinImage)
  2241. if itemIndex:
  2242. item.SelectItem(itemIndex)
  2243. try:
  2244. metinImage.LoadImage(item.GetIconImageFileName())
  2245. except:
  2246. dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  2247. (itemIndex, item.GetIconImageFileName())
  2248. )
  2249. nameTextLine.SetText(item.GetItemName())
  2250. affectTextLine = ui.TextLine()
  2251. affectTextLine.SetParent(self)
  2252. affectTextLine.SetFontName(self.defFontName)
  2253. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2254. affectTextLine.SetOutline()
  2255. affectTextLine.SetFeather()
  2256. affectTextLine.Show()
  2257. if localeInfo.IsARABIC():
  2258. metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  2259. affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  2260. else:
  2261. metinImage.SetPosition(10, self.toolTipHeight)
  2262. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  2263. if custumAffectString:
  2264. affectTextLine.SetText(custumAffectString)
  2265. elif itemIndex!=constInfo.ERROR_METIN_STONE:
  2266. affectType, affectValue = item.GetAffect(0)
  2267. affectString = self.__GetAffectString(affectType, affectValue)
  2268. if affectString:
  2269. affectTextLine.SetText(affectString)
  2270. else:
  2271. affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  2272. self.childrenList.append(affectTextLine)
  2273. if custumAffectString2:
  2274. affectTextLine = ui.TextLine()
  2275. affectTextLine.SetParent(self)
  2276. affectTextLine.SetFontName(self.defFontName)
  2277. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2278. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2279. affectTextLine.SetOutline()
  2280. affectTextLine.SetFeather()
  2281. affectTextLine.Show()
  2282. affectTextLine.SetText(custumAffectString2)
  2283. self.childrenList.append(affectTextLine)
  2284. self.toolTipHeight += 16 + 2
  2285. if 0 != leftTime:
  2286. timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  2287. timeTextLine = ui.TextLine()
  2288. timeTextLine.SetParent(self)
  2289. timeTextLine.SetFontName(self.defFontName)
  2290. timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2291. timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2292. timeTextLine.SetOutline()
  2293. timeTextLine.SetFeather()
  2294. timeTextLine.Show()
  2295. timeTextLine.SetText(timeText)
  2296. self.childrenList.append(timeTextLine)
  2297. self.toolTipHeight += 16 + 2
  2298. else:
  2299. nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  2300. self.toolTipHeight += 35
  2301. self.ResizeToolTip()
  2302. def __AppendFishInfo(self, size):
  2303. if size > 0:
  2304. self.AppendSpace(5)
  2305. self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  2306. def AppendUniqueItemLastTime(self, restMin):
  2307. if app.ENABLE_ATTENDANCE_EVENT:
  2308. if self.isAttendanceRewardItem:
  2309. return
  2310. restSecond = restMin*60
  2311. self.AppendSpace(5)
  2312. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  2313. def AppendMallItemLastTime(self, endTime):
  2314. if app.ENABLE_ATTENDANCE_EVENT:
  2315. if self.isAttendanceRewardItem:
  2316. return
  2317. leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  2318. self.AppendSpace(5)
  2319. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  2320. def AppendTimerBasedOnWearLastTime(self, metinSlot):
  2321. if app.ENABLE_ATTENDANCE_EVENT:
  2322. if self.isAttendanceRewardItem:
  2323. return
  2324. if 0 == metinSlot[0]:
  2325. self.AppendSpace(5)
  2326. self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  2327. else:
  2328. endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  2329. self.AppendMallItemLastTime(endTime)
  2330. def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):
  2331. if app.ENABLE_ATTENDANCE_EVENT:
  2332. if self.isAttendanceRewardItem:
  2333. return
  2334. if metinSlot != 0:
  2335. useCount = metinSlot[1]
  2336. endTime = metinSlot[0]
  2337. if 0 == useCount:
  2338. if 0 == endTime:
  2339. (limitType, limitValue) = item.GetLimit(limitIndex)
  2340. endTime = limitValue
  2341. endTime += app.GetGlobalTimeStamp()
  2342. self.AppendMallItemLastTime(endTime)
  2343. if app.ENABLE_SASH_SYSTEM:
  2344. def SetSashResultItem(self, slotIndex, window_type = player.INVENTORY):
  2345. (itemVnum, MinAbs, MaxAbs) = sash.GetResultItem()
  2346. if not itemVnum:
  2347. return
  2348. self.ClearToolTip()
  2349. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2350. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2351. item.SelectItem(itemVnum)
  2352. itemType = item.GetItemType()
  2353. itemSubType = item.GetItemSubType()
  2354. if itemType != item.ITEM_TYPE_COSTUME and itemSubType != item.COSTUME_TYPE_SASH:
  2355. return
  2356. absChance = MaxAbs
  2357. itemDesc = item.GetItemDescription()
  2358. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2359. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  2360. self.AppendDescription(itemDesc, 26)
  2361. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  2362. self.__AppendLimitInformation()
  2363. if MinAbs == MaxAbs:
  2364. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (MinAbs), self.CONDITION_COLOR)
  2365. else:
  2366. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE2 % (MinAbs, MaxAbs), self.CONDITION_COLOR)
  2367. itemAbsorbedVnum = int(metinSlot[sash.ABSORBED_SOCKET])
  2368. if itemAbsorbedVnum:
  2369. item.SelectItem(itemAbsorbedVnum)
  2370. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  2371. if item.GetItemSubType() == item.WEAPON_FAN:
  2372. self.__AppendMagicAttackInfo(absChance)
  2373. item.SelectItem(itemAbsorbedVnum)
  2374. self.__AppendAttackPowerInfo(absChance)
  2375. else:
  2376. self.__AppendAttackPowerInfo(absChance)
  2377. item.SelectItem(itemAbsorbedVnum)
  2378. self.__AppendMagicAttackInfo(absChance)
  2379. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2380. defGrade = item.GetValue(1)
  2381. defBonus = item.GetValue(5) * 2
  2382. defGrade = self.CalcSashValue(defGrade, absChance)
  2383. defBonus = self.CalcSashValue(defBonus, absChance)
  2384. if defGrade > 0:
  2385. self.AppendSpace(5)
  2386. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  2387. item.SelectItem(itemAbsorbedVnum)
  2388. self.__AppendMagicDefenceInfo(absChance)
  2389. item.SelectItem(itemAbsorbedVnum)
  2390. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2391. (affectType, affectValue) = item.GetAffect(i)
  2392. affectValue = self.CalcSashValue(affectValue, absChance)
  2393. affectString = self.__GetAffectString(affectType, affectValue)
  2394. if affectString and affectValue > 0:
  2395. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2396. item.SelectItem(itemAbsorbedVnum)
  2397. item.SelectItem(itemVnum)
  2398. self.__AppendAttributeInformation(attrSlot, MaxAbs)
  2399. self.AppendWearableInformation()
  2400. self.ShowToolTip()
  2401. def SetSashResultAbsItem(self, slotIndex1, slotIndex2, window_type = player.INVENTORY):
  2402. itemVnumSash = player.GetItemIndex(window_type, slotIndex1)
  2403. itemVnumTarget = player.GetItemIndex(window_type, slotIndex2)
  2404. if not itemVnumSash or not itemVnumTarget:
  2405. return
  2406. self.ClearToolTip()
  2407. item.SelectItem(itemVnumSash)
  2408. itemType = item.GetItemType()
  2409. itemSubType = item.GetItemSubType()
  2410. if itemType != item.ITEM_TYPE_COSTUME and itemSubType != item.COSTUME_TYPE_SASH:
  2411. return
  2412. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex1, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2413. attrSlot = [player.GetItemAttribute(window_type, slotIndex2, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2414. itemDesc = item.GetItemDescription()
  2415. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2416. self.__SetItemTitle(itemVnumSash, metinSlot, attrSlot)
  2417. self.AppendDescription(itemDesc, 26)
  2418. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  2419. item.SelectItem(itemVnumSash)
  2420. self.__AppendLimitInformation()
  2421. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (metinSlot[sash.ABSORPTION_SOCKET]), self.CONDITION_COLOR)
  2422. itemAbsorbedVnum = itemVnumTarget
  2423. item.SelectItem(itemAbsorbedVnum)
  2424. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  2425. if item.GetItemSubType() == item.WEAPON_FAN:
  2426. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2427. item.SelectItem(itemAbsorbedVnum)
  2428. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2429. else:
  2430. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2431. item.SelectItem(itemAbsorbedVnum)
  2432. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2433. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2434. defGrade = item.GetValue(1)
  2435. defBonus = item.GetValue(5) * 2
  2436. defGrade = self.CalcSashValue(defGrade, metinSlot[sash.ABSORPTION_SOCKET])
  2437. defBonus = self.CalcSashValue(defBonus, metinSlot[sash.ABSORPTION_SOCKET])
  2438. if defGrade > 0:
  2439. self.AppendSpace(5)
  2440. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  2441. item.SelectItem(itemAbsorbedVnum)
  2442. self.__AppendMagicDefenceInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2443. item.SelectItem(itemAbsorbedVnum)
  2444. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2445. (affectType, affectValue) = item.GetAffect(i)
  2446. affectValue = self.CalcSashValue(affectValue, metinSlot[sash.ABSORPTION_SOCKET])
  2447. affectString = self.__GetAffectString(affectType, affectValue)
  2448. if affectString and affectValue > 0:
  2449. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2450. item.SelectItem(itemAbsorbedVnum)
  2451. item.SelectItem(itemAbsorbedVnum)
  2452. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  2453. type = attrSlot[i][0]
  2454. value = attrSlot[i][1]
  2455. if not value:
  2456. continue
  2457. value = self.CalcSashValue(value, metinSlot[sash.ABSORPTION_SOCKET])
  2458. affectString = self.__GetAffectString(type, value)
  2459. if affectString and value > 0:
  2460. affectColor = self.__GetAttributeColor(i, value)
  2461. self.AppendTextLine(affectString, affectColor)
  2462. item.SelectItem(itemAbsorbedVnum)
  2463. item.SelectItem(itemVnumSash)
  2464. self.AppendSpace(5)
  2465. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  2466. item.SelectItem(itemVnumSash)
  2467. flagList = (
  2468. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  2469. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  2470. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  2471. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN)
  2472. )
  2473. flagList += (not item.IsAntiFlag(item.ITEM_ANTIFLAG_WOLFMAN),)
  2474. characterNames = ""
  2475. for i in xrange(self.CHARACTER_COUNT):
  2476. name = self.CHARACTER_NAMES[i]
  2477. flag = flagList[i]
  2478. if flag:
  2479. characterNames += " "
  2480. characterNames += name
  2481. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  2482. textLine.SetFeather()
  2483. item.SelectItem(itemVnumSash)
  2484. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  2485. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  2486. textLine.SetFeather()
  2487. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  2488. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  2489. textLine.SetFeather()
  2490. self.ShowToolTip()
  2491. if app.ENABLE_CHANGELOOK_SYSTEM:
  2492. def AppendTransmutation(self, window_type, slotIndex, transmutation):
  2493. itemVnum = 0
  2494. if transmutation == -1:
  2495. if window_type == player.INVENTORY:
  2496. itemVnum = player.GetItemTransmutation(window_type, slotIndex)
  2497. elif window_type == player.SAFEBOX:
  2498. itemVnum = safebox.GetItemTransmutation(slotIndex)
  2499. elif window_type == player.MALL:
  2500. itemVnum = safebox.GetMallItemTransmutation(slotIndex)
  2501. else:
  2502. itemVnum = transmutation
  2503. if not itemVnum:
  2504. return
  2505. item.SelectItem(itemVnum)
  2506. itemName = item.GetItemName()
  2507. if not itemName or itemName == "":
  2508. return
  2509. self.AppendSpace(5)
  2510. title = "[ " + localeInfo.CHANGE_LOOK_TITLE + " ]"
  2511. self.AppendTextLine(title, self.BEFORE_LOOK_COLOR)
  2512. textLine = self.AppendTextLine(itemName, self.UNDER_LOOK_COLOR, True)
  2513. textLine.SetFeather()
  2514. def AppendChangeLookInfoPrivateShopWIndow(self, slotIndex):
  2515. transmutation = privateShopSearch.GetSearchItemTransmutation(slotIndex)
  2516. itemVnum = transmutation
  2517. if not itemVnum:
  2518. return
  2519. item.SelectItem(itemVnum)
  2520. itemName = item.GetItemName()
  2521. if not itemName or itemName == "":
  2522. return
  2523. self.AppendSpace(5)
  2524. title = "[ " + localeInfo.CHANGE_LOOK_TITLE + " ]"
  2525. self.AppendTextLine(title, self.BEFORE_LOOK_COLOR)
  2526. textLine = self.AppendTextLine(itemName, self.UNDER_LOOK_COLOR, True)
  2527. textLine.SetFeather()
  2528. class HyperlinkItemToolTip(ItemToolTip):
  2529. def __init__(self):
  2530. ItemToolTip.__init__(self, isPickable=TRUE)
  2531. def SetHyperlinkItem(self, tokens):
  2532. minTokenCount = 5 + player.METIN_SOCKET_MAX_NUM
  2533. maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  2534. if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  2535. head, vnum, flag = tokens[:3]
  2536. itemVnum = int(vnum, 16)
  2537. metinSlot = [int(metin, 16) for metin in tokens[3:7]]
  2538. evolution = int(tokens[7])
  2539. transmutation = int(tokens[8])
  2540. rests = tokens[9:]
  2541. if rests:
  2542. attrSlot = []
  2543. rests.reverse()
  2544. while rests:
  2545. key = int(rests.pop(), 16)
  2546. if rests:
  2547. val = int(rests.pop())
  2548. attrSlot.append((key, val))
  2549. attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  2550. else:
  2551. attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  2552. self.ClearToolTip()
  2553. self.isHyperLinkItem = True
  2554. if app.ENABLE_CHANGELOOK_SYSTEM:
  2555. if not transmutation:
  2556. self.AddItemData(itemVnum, metinSlot, attrSlot,evolution)
  2557. else:
  2558. self.AddItemData(itemVnum, metinSlot, attrSlot,evolution, 0, player.INVENTORY, -1, transmutation)
  2559. else:
  2560. self.AddItemData(itemVnum, metinSlot, attrSlot)
  2561. ItemToolTip.OnUpdate(self)
  2562. def OnUpdate(self):
  2563. pass
  2564. def OnMouseLeftButtonDown(self):
  2565. self.Hide()
  2566. class SkillToolTip(ToolTip):
  2567. POINT_NAME_DICT = {
  2568. player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  2569. player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  2570. }
  2571. SKILL_TOOL_TIP_WIDTH = 200
  2572. PARTY_SKILL_TOOL_TIP_WIDTH = 340
  2573. PARTY_SKILL_EXPERIENCE_AFFECT_LIST = ( ( 2, 2, 10,),
  2574. ( 8, 3, 20,),
  2575. (14, 4, 30,),
  2576. (22, 5, 45,),
  2577. (28, 6, 60,),
  2578. (34, 7, 80,),
  2579. (38, 8, 100,), )
  2580. PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = ( ( 4, 2, 1, 0,),
  2581. (10, 3, 2, 0,),
  2582. (16, 4, 2, 1,),
  2583. (24, 5, 2, 2,), )
  2584. PARTY_SKILL_ATTACKER_AFFECT_LIST = ( ( 36, 3, ),
  2585. ( 26, 1, ),
  2586. ( 32, 2, ), )
  2587. SKILL_GRADE_NAME = { player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  2588. player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  2589. player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  2590. AFFECT_NAME_DICT = {
  2591. "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  2592. "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  2593. "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  2594. "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  2595. "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  2596. "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  2597. "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  2598. "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  2599. }
  2600. AFFECT_APPEND_TEXT_DICT = {
  2601. "DODGE" : "%",
  2602. "RESIST_NORMAL" : "%",
  2603. "REFLECT_MELEE" : "%",
  2604. }
  2605. def __init__(self):
  2606. ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  2607. def __del__(self):
  2608. ToolTip.__del__(self)
  2609. def SetSkill(self, skillIndex, skillLevel = -1):
  2610. if 0 == skillIndex:
  2611. return
  2612. if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2613. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2614. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2615. self.ResizeToolTip()
  2616. self.AppendDefaultData(skillIndex)
  2617. self.AppendSkillConditionData(skillIndex)
  2618. self.AppendGuildSkillData(skillIndex, skillLevel)
  2619. else:
  2620. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2621. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2622. self.ResizeToolTip()
  2623. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2624. skillGrade = player.GetSkillGrade(slotIndex)
  2625. skillLevel = player.GetSkillLevel(slotIndex)
  2626. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2627. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2628. self.AppendDefaultData(skillIndex)
  2629. self.AppendSkillConditionData(skillIndex)
  2630. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2631. self.AppendSkillRequirement(skillIndex, skillLevel)
  2632. self.ShowToolTip()
  2633. def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  2634. if 0 == skillIndex:
  2635. return
  2636. if player.SKILL_INDEX_TONGSOL == skillIndex:
  2637. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2638. skillLevel = player.GetSkillLevel(slotIndex)
  2639. self.AppendDefaultData(skillIndex)
  2640. self.AppendPartySkillData(skillGrade, skillLevel)
  2641. elif player.SKILL_INDEX_RIDING == skillIndex:
  2642. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2643. self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  2644. elif player.SKILL_INDEX_SUMMON == skillIndex:
  2645. maxLevel = 10
  2646. self.ClearToolTip()
  2647. self.__SetSkillTitle(skillIndex, skillGrade)
  2648. ## Description
  2649. description = skill.GetSkillDescription(skillIndex)
  2650. self.AppendDescription(description, 25)
  2651. if skillLevel == 10:
  2652. self.AppendSpace(5)
  2653. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2654. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  2655. else:
  2656. self.AppendSpace(5)
  2657. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2658. self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  2659. self.AppendSpace(5)
  2660. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  2661. self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  2662. elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2663. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2664. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2665. self.ResizeToolTip()
  2666. self.AppendDefaultData(skillIndex)
  2667. self.AppendSkillConditionData(skillIndex)
  2668. self.AppendGuildSkillData(skillIndex, skillLevel)
  2669. else:
  2670. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2671. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2672. self.ResizeToolTip()
  2673. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2674. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2675. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2676. self.AppendDefaultData(skillIndex, skillGrade)
  2677. self.AppendSkillConditionData(skillIndex)
  2678. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2679. self.AppendSkillRequirement(skillIndex, skillLevel)
  2680. self.ShowToolTip()
  2681. def __SetSkillTitle(self, skillIndex, skillGrade):
  2682. self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  2683. self.__AppendSkillGradeName(skillIndex, skillGrade)
  2684. def __AppendSkillGradeName(self, skillIndex, skillGrade):
  2685. if self.SKILL_GRADE_NAME.has_key(skillGrade):
  2686. self.AppendSpace(5)
  2687. self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  2688. def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  2689. if 0 == skillIndex:
  2690. return
  2691. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2692. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2693. self.ResizeToolTip()
  2694. self.ClearToolTip()
  2695. self.__SetSkillTitle(skillIndex, skillGrade)
  2696. self.AppendDefaultData(skillIndex, skillGrade)
  2697. self.AppendSkillConditionData(skillIndex)
  2698. self.ShowToolTip()
  2699. def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2700. self.ClearToolTip()
  2701. self.__SetSkillTitle(skillIndex, skillGrade)
  2702. ## Level Limit
  2703. levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2704. if levelLimit > 0:
  2705. color = self.NORMAL_COLOR
  2706. if player.GetStatus(player.LEVEL) < levelLimit:
  2707. color = self.NEGATIVE_COLOR
  2708. self.AppendSpace(5)
  2709. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2710. ## Description
  2711. description = skill.GetSkillDescription(skillIndex)
  2712. self.AppendDescription(description, 25)
  2713. def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2714. self.ClearToolTip()
  2715. self.__SetSkillTitle(skillIndex, skillGrade)
  2716. ## Description
  2717. description = skill.GetSkillDescription(skillIndex)
  2718. self.AppendDescription(description, 25)
  2719. if 1 == skillGrade:
  2720. skillLevel += 19
  2721. elif 2 == skillGrade:
  2722. skillLevel += 29
  2723. elif 3 == skillGrade:
  2724. skillLevel = 40
  2725. self.AppendSpace(5)
  2726. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2727. def AppendSkillConditionData(self, skillIndex):
  2728. conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2729. if conditionDataCount > 0:
  2730. self.AppendSpace(5)
  2731. for i in xrange(conditionDataCount):
  2732. self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2733. def AppendGuildSkillData(self, skillIndex, skillLevel):
  2734. skillMaxLevel = 7
  2735. skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2736. skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2737. ## Current Level
  2738. if skillLevel > 0:
  2739. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2740. self.AppendSpace(5)
  2741. if skillLevel == skillMaxLevel:
  2742. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2743. else:
  2744. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2745. #####
  2746. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2747. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2748. ## Cooltime
  2749. coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2750. if coolTime > 0:
  2751. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2752. ## SP
  2753. needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2754. if needGSP > 0:
  2755. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2756. ## Next Level
  2757. if skillLevel < skillMaxLevel:
  2758. if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2759. self.AppendSpace(5)
  2760. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2761. #####
  2762. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2763. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2764. ## Cooltime
  2765. coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2766. if coolTime > 0:
  2767. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2768. ## SP
  2769. needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2770. if needGSP > 0:
  2771. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2772. def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  2773. self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  2774. self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  2775. skillLevelUpPoint = 1
  2776. realSkillGrade = player.GetSkillGrade(slotIndex)
  2777. skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  2778. skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  2779. ## Current Level
  2780. if skillLevel > 0:
  2781. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2782. self.AppendSpace(5)
  2783. if skillGrade == skill.SKILL_GRADE_COUNT:
  2784. pass
  2785. elif skillLevel == skillMaxLevelEnd:
  2786. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2787. else:
  2788. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2789. self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  2790. ## Next Level
  2791. if skillGrade != skill.SKILL_GRADE_COUNT:
  2792. if skillLevel < skillMaxLevelEnd:
  2793. if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  2794. self.AppendSpace(5)
  2795. if skillIndex == 141 or skillIndex == 142:
  2796. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  2797. else:
  2798. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  2799. self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  2800. def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  2801. affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  2802. if affectDataCount > 0:
  2803. for i in xrange(affectDataCount):
  2804. type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  2805. if not self.AFFECT_NAME_DICT.has_key(type):
  2806. continue
  2807. minValue = int(minValue)
  2808. maxValue = int(maxValue)
  2809. affectText = self.AFFECT_NAME_DICT[type]
  2810. if "HP" == type:
  2811. if minValue < 0 and maxValue < 0:
  2812. minValue *= -1
  2813. maxValue *= -1
  2814. else:
  2815. affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  2816. affectText += str(minValue)
  2817. if minValue != maxValue:
  2818. affectText += " - " + str(maxValue)
  2819. affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  2820. self.AppendTextLine(affectText, color)
  2821. else:
  2822. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2823. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  2824. ## Duration
  2825. duration = skill.GetDuration(skillIndex, skillPercentage)
  2826. if duration > 0:
  2827. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  2828. ## Cooltime
  2829. coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  2830. if coolTime > 0:
  2831. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  2832. ## SP
  2833. needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  2834. if needSP != 0:
  2835. continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  2836. if skill.IsUseHPSkill(skillIndex):
  2837. self.AppendNeedHP(needSP, continuationSP, color)
  2838. else:
  2839. self.AppendNeedSP(needSP, continuationSP, color)
  2840. def AppendSkillRequirement(self, skillIndex, skillLevel):
  2841. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  2842. if skillLevel >= skillMaxLevel:
  2843. return
  2844. isAppendHorizontalLine = FALSE
  2845. ## Requirement
  2846. if skill.IsSkillRequirement(skillIndex):
  2847. if not isAppendHorizontalLine:
  2848. isAppendHorizontalLine = TRUE
  2849. self.AppendHorizontalLine()
  2850. requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  2851. color = self.CANNOT_LEVEL_UP_COLOR
  2852. if skill.CheckRequirementSueccess(skillIndex):
  2853. color = self.CAN_LEVEL_UP_COLOR
  2854. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  2855. ## Require Stat
  2856. requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  2857. if requireStatCount > 0:
  2858. for i in xrange(requireStatCount):
  2859. type, level = skill.GetSkillRequireStatData(skillIndex, i)
  2860. if self.POINT_NAME_DICT.has_key(type):
  2861. if not isAppendHorizontalLine:
  2862. isAppendHorizontalLine = TRUE
  2863. self.AppendHorizontalLine()
  2864. name = self.POINT_NAME_DICT[type]
  2865. color = self.CANNOT_LEVEL_UP_COLOR
  2866. if player.GetStatus(type) >= level:
  2867. color = self.CAN_LEVEL_UP_COLOR
  2868. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  2869. def HasSkillLevelDescription(self, skillIndex, skillLevel):
  2870. if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  2871. return TRUE
  2872. if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  2873. return TRUE
  2874. if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  2875. return TRUE
  2876. return FALSE
  2877. def AppendMasterAffectDescription(self, index, desc, color):
  2878. self.AppendTextLine(desc, color)
  2879. def AppendNextAffectDescription(self, index, desc):
  2880. self.AppendTextLine(desc, self.DISABLE_COLOR)
  2881. def AppendNeedHP(self, needSP, continuationSP, color):
  2882. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  2883. if continuationSP > 0:
  2884. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  2885. def AppendNeedSP(self, needSP, continuationSP, color):
  2886. if -1 == needSP:
  2887. self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  2888. else:
  2889. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  2890. if continuationSP > 0:
  2891. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  2892. def AppendPartySkillData(self, skillGrade, skillLevel):
  2893. if 1 == skillGrade:
  2894. skillLevel += 19
  2895. elif 2 == skillGrade:
  2896. skillLevel += 29
  2897. elif 3 == skillGrade:
  2898. skillLevel = 40
  2899. if skillLevel <= 0:
  2900. return
  2901. skillIndex = player.SKILL_INDEX_TONGSOL
  2902. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2903. skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2904. if localeInfo.IsBRAZIL():
  2905. k = skillPower
  2906. else:
  2907. k = player.GetSkillLevel(skillIndex) / 100.0
  2908. self.AppendSpace(5)
  2909. self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  2910. if skillLevel>=10:
  2911. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  2912. if skillLevel>=20:
  2913. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER % chop(1 + 5 * k))
  2914. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER % chop(50 + 1450 * k))
  2915. if skillLevel>=25:
  2916. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  2917. if skillLevel>=35:
  2918. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  2919. if skillLevel>=40:
  2920. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  2921. self.AlignHorizonalCenter()
  2922. def __AppendSummonDescription(self, skillLevel, color):
  2923. if skillLevel > 1:
  2924. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  2925. elif 1 == skillLevel:
  2926. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  2927. elif 0 == skillLevel:
  2928. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  2929. if __name__ == "__main__":
  2930. import app
  2931. import wndMgr
  2932. import systemSetting
  2933. import mouseModule
  2934. import grp
  2935. import ui
  2936. #wndMgr.SetOutlineFlag(TRUE)
  2937. app.SetMouseHandler(mouseModule.mouseController)
  2938. app.SetHairColorEnable(TRUE)
  2939. wndMgr.SetMouseHandler(mouseModule.mouseController)
  2940. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2941. app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2942. mouseModule.mouseController.Create()
  2943. toolTip = ItemToolTip()
  2944. toolTip.ClearToolTip()
  2945. #toolTip.AppendTextLine("Test")
  2946. 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."
  2947. summ = ""
  2948. toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  2949. toolTip.Show()
  2950. app.Loop()

s