Advertisement
Guest User

Untitled

a guest
Aug 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 113.84 KB | None | 0 0
  1. import dbg
  2. import player
  3. import item
  4. import grp
  5. import wndMgr
  6. import skill
  7. import shop
  8. import exchange
  9. import grpText
  10. import safebox
  11. import localeInfo
  12. import app
  13. import background
  14. import nonplayer
  15. import chr
  16. import logging
  17.  
  18. import ui
  19. import mouseModule
  20. import constInfo
  21.  
  22. if app.ENABLE_SASH_SYSTEM:
  23. import sash
  24.  
  25. #define player
  26.  
  27. WARP_SCROLLS = [22011, 22000, 22010]
  28.  
  29. DESC_DEFAULT_MAX_COLS = 26
  30. DESC_WESTERN_MAX_COLS = 35
  31. DESC_WESTERN_MAX_WIDTH = 220
  32.  
  33. def chop(n):
  34. return round(n - 0.5, 1)
  35.  
  36. def SplitDescription(desc, limit):
  37. total_tokens = desc.split()
  38. line_tokens = []
  39. line_len = 0
  40. lines = []
  41. for token in total_tokens:
  42. if "|" in token:
  43. sep_pos = token.find("|")
  44. line_tokens.append(token[:sep_pos])
  45.  
  46. lines.append(" ".join(line_tokens))
  47. line_len = len(token) - (sep_pos + 1)
  48. line_tokens = [token[sep_pos+1:]]
  49. else:
  50. line_len += len(token)
  51. if len(line_tokens) + line_len > limit:
  52. lines.append(" ".join(line_tokens))
  53. line_len = len(token)
  54. line_tokens = [token]
  55. else:
  56. line_tokens.append(token)
  57.  
  58. if line_tokens:
  59. lines.append(" ".join(line_tokens))
  60.  
  61. return lines
  62.  
  63. ###################################################################################################
  64. ## ToolTip
  65. ##
  66. ## NOTE : ÇöÀç´Â Item°ú SkillÀ» »ó¼ÓÀ¸·Î Ưȭ ½ÃÄѵξúÀ½
  67. ## ÇÏÁö¸¸ ±×´ÙÁö Àǹ̰¡ ¾ø¾î º¸ÀÓ
  68. ##
  69. class ToolTip(ui.ThinBoard):
  70.  
  71. TOOL_TIP_WIDTH = 190
  72. TOOL_TIP_HEIGHT = 10
  73.  
  74. TEXT_LINE_HEIGHT = 17
  75.  
  76. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  77. SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)
  78. NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  79. SAITO_TITLE_COLOR_YELLOW = grp.GenerateColor(1.0, 1.0, 0.0, 1.0)
  80. SAITO_TITLE_COLOR_GOLD = grp.GenerateColor(1.0, 1.3, 0.0, 1.0)
  81. SAITO_TITLE_COLOR_VIOLETT = 0xffff00ff
  82. SAITO_TITLE_COLOR_CYAN = 0xff00ffff
  83. SAITO_TITLE_COLOR_BLUE_VIOLET = 0xFF8A2BE2
  84. SAITO_TITLE_COLOR_GREEN_YELLOW = 0xFFADFF2F
  85. ITEM_BUFF_LEVEL_COLOR = 0xffffd300
  86. ITEM_BUFF_TYPE_COLOR = 0xfffc9c3a
  87. ITEM_BUFF_RATE_COLOR = 0xff40e0d0
  88. ITEM_BUFF_DURATION_COLOR = 0xffadff00
  89. ITEM_BUFF_USAGE_COLOR = 0xffffffff
  90. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  91. PRICE_COLOR = 0xffFFB96D
  92.  
  93. HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR
  94. MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0)
  95. LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0)
  96.  
  97. ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  98. DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  99.  
  100. NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  101. POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)
  102. SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)
  103. SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0)
  104. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  105. CHANGELOOK_TITLE_COLOR = 0xff8BBDFF
  106. CHANGELOOK_ITEMNAME_COLOR = 0xffBCE55C
  107.  
  108.  
  109. CONDITION_COLOR = 0xffBEB47D
  110. CAN_LEVEL_UP_COLOR = 0xff8EC292
  111. CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
  112. NEED_SKILL_POINT_COLOR = 0xff9A9CDB
  113.  
  114. def __init__(self, width = TOOL_TIP_WIDTH, isPickable=FALSE):
  115. ui.ThinBoard.__init__(self, "TOP_MOST")
  116.  
  117. if isPickable:
  118. pass
  119. else:
  120. self.AddFlag("not_pick")
  121.  
  122. self.AddFlag("float")
  123.  
  124. self.followFlag = TRUE
  125. self.toolTipWidth = width
  126.  
  127. self.xPos = -1
  128. self.yPos = -1
  129.  
  130. self.defFontName = localeInfo.UI_DEF_FONT
  131. self.ClearToolTip()
  132.  
  133. def __del__(self):
  134. ui.ThinBoard.__del__(self)
  135.  
  136. def ClearToolTip(self):
  137. self.toolTipHeight = 12
  138. self.childrenList = []
  139.  
  140. def SetFollow(self, flag):
  141. self.followFlag = flag
  142.  
  143. def SetDefaultFontName(self, fontName):
  144. self.defFontName = fontName
  145.  
  146. def AppendSpace(self, size):
  147. self.toolTipHeight += size
  148. self.ResizeToolTip()
  149.  
  150. def AppendHorizontalLine(self):
  151.  
  152. for i in xrange(2):
  153. horizontalLine = ui.Line()
  154. horizontalLine.SetParent(self)
  155. horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i)
  156. horizontalLine.SetWindowHorizontalAlignCenter()
  157. horizontalLine.SetSize(150, 0)
  158. horizontalLine.Show()
  159.  
  160. if 0 == i:
  161. horizontalLine.SetColor(0xff555555)
  162. else:
  163. horizontalLine.SetColor(0xff000000)
  164.  
  165. self.childrenList.append(horizontalLine)
  166.  
  167. self.toolTipHeight += 11
  168. self.ResizeToolTip()
  169.  
  170. def AlignHorizonalCenter(self):
  171. for child in self.childrenList:
  172. (x, y)=child.GetLocalPosition()
  173. child.SetPosition(self.toolTipWidth/2, y)
  174.  
  175. self.ResizeToolTip()
  176.  
  177. def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  178. textLine = ui.TextLine()
  179. textLine.SetParent(self)
  180. textLine.SetFontName(self.defFontName)
  181. textLine.SetPackedFontColor(color)
  182. textLine.SetText(text)
  183. textLine.SetOutline()
  184. textLine.SetFeather(FALSE)
  185. textLine.Show()
  186.  
  187. if centerAlign:
  188. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  189. textLine.SetHorizontalAlignCenter()
  190.  
  191. else:
  192. textLine.SetPosition(10, self.toolTipHeight)
  193.  
  194. self.childrenList.append(textLine)
  195.  
  196. (textWidth, textHeight)=textLine.GetTextSize()
  197.  
  198. textWidth += 40
  199. textHeight += 5
  200.  
  201. if self.toolTipWidth < textWidth:
  202. self.toolTipWidth = textWidth
  203.  
  204. self.toolTipHeight += textHeight
  205.  
  206. return textLine
  207.  
  208. def AutoAppendNewTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  209. textLine = ui.TextLine()
  210. textLine.SetParent(self)
  211. textLine.SetFontName(self.defFontName)
  212. textLine.SetPackedFontColor(color)
  213. textLine.SetText(text)
  214. textLine.SetOutline()
  215. textLine.SetFeather(FALSE)
  216. textLine.Show()
  217. textLine.SetPosition(15, self.toolTipHeight)
  218.  
  219. self.childrenList.append(textLine)
  220. (textWidth, textHeight) = textLine.GetTextSize()
  221. textWidth += 30
  222. textHeight += 10
  223. if self.toolTipWidth < textWidth:
  224. self.toolTipWidth = textWidth
  225.  
  226. self.toolTipHeight += textHeight
  227. self.ResizeToolTipText(textWidth, self.toolTipHeight)
  228. return textLine
  229.  
  230. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  231. textLine = ui.TextLine()
  232. textLine.SetParent(self)
  233. textLine.SetFontName(self.defFontName)
  234. textLine.SetPackedFontColor(color)
  235. textLine.SetText(text)
  236. textLine.SetOutline()
  237. textLine.SetFeather(FALSE)
  238. textLine.Show()
  239.  
  240. if centerAlign:
  241. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  242. textLine.SetHorizontalAlignCenter()
  243.  
  244. else:
  245. textLine.SetPosition(10, self.toolTipHeight)
  246.  
  247. self.childrenList.append(textLine)
  248.  
  249. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  250. self.ResizeToolTip()
  251.  
  252. return textLine
  253.  
  254. def AppendDescription(self, desc, limit, color = FONT_COLOR):
  255. if localeInfo.IsEUROPE():
  256. self.__AppendDescription_WesternLanguage(desc, color)
  257. else:
  258. self.__AppendDescription_EasternLanguage(desc, limit, color)
  259.  
  260. def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR):
  261. length = len(description)
  262. if 0 == length:
  263. return
  264.  
  265. lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation)
  266. for i in xrange(lineCount):
  267. if 0 == i:
  268. self.AppendSpace(5)
  269. self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color)
  270.  
  271. def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR):
  272. lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS)
  273. if not lines:
  274. return
  275.  
  276. self.AppendSpace(5)
  277. for line in lines:
  278. self.AppendTextLine(line, color)
  279.  
  280.  
  281. def ResizeToolTip(self):
  282. self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight)
  283. def ResizeToolTipText(self, x, y):
  284. self.SetSize(x, y)
  285.  
  286. def SetTitle(self, name):
  287. self.AppendTextLine(name, self.TITLE_COLOR)
  288.  
  289. def GetLimitTextLineColor(self, curValue, limitValue):
  290. if curValue < limitValue:
  291. return self.DISABLE_COLOR
  292.  
  293. return self.ENABLE_COLOR
  294.  
  295. def GetChangeTextLineColor(self, value, isSpecial=FALSE):
  296. if value > 0:
  297. if isSpecial:
  298. return self.SPECIAL_POSITIVE_COLOR
  299. else:
  300. return self.POSITIVE_COLOR
  301.  
  302. if 0 == value:
  303. return self.NORMAL_COLOR
  304.  
  305. return self.NEGATIVE_COLOR
  306.  
  307. def SetToolTipPosition(self, x = -1, y = -1):
  308. self.xPos = x
  309. self.yPos = y
  310.  
  311. def ShowToolTip(self):
  312. self.SetTop()
  313. self.Show()
  314.  
  315. self.OnUpdate()
  316.  
  317. def HideToolTip(self):
  318. self.Hide()
  319.  
  320. def OnUpdate(self):
  321.  
  322. if not self.followFlag:
  323. return
  324.  
  325. x = 0
  326. y = 0
  327. width = self.GetWidth()
  328. height = self.toolTipHeight
  329.  
  330. if -1 == self.xPos and -1 == self.yPos:
  331.  
  332. (mouseX, mouseY) = wndMgr.GetMousePosition()
  333.  
  334. if mouseY < wndMgr.GetScreenHeight() - 300:
  335. y = mouseY + 40
  336. else:
  337. y = mouseY - height - 30
  338.  
  339. x = mouseX - width/2
  340.  
  341. else:
  342.  
  343. x = self.xPos - width/2
  344. y = self.yPos - height
  345.  
  346. x = max(x, 0)
  347. y = max(y, 0)
  348. x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2
  349. y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight()
  350.  
  351. parentWindow = self.GetParentProxy()
  352. if parentWindow:
  353. (gx, gy) = parentWindow.GetGlobalPosition()
  354. x -= gx
  355. y -= gy
  356.  
  357. self.SetPosition(x, y)
  358.  
  359. class ItemToolTip(ToolTip):
  360.  
  361. if app.ENABLE_SEND_TARGET_INFO:
  362. isStone = False
  363. isBook = False
  364. isBook2 = False
  365.  
  366. # Valence-System
  367. #VALENCE_ITEM_TITLES = [
  368. #[0.0, "TEST", grp.GenerateColor(1.000, 1.000, 1.000, 1.0)],
  369. # [0.0, "TEST", grp.GenerateColor(1.000, 1.000, 1.000, 1.0)],
  370. #[25.0, "TEST", grp.GenerateColor(0.517, 0.851, 0.408, 1.0)],
  371. # [25.0, "TEST", grp.GenerateColor(1.000, 1.000, 1.000, 1.0)],
  372. ## [75.0, "Selten", grp.GenerateColor(0.851, 0.686, 0.408, 1.0)],
  373. # [85.0, "Episch", grp.GenerateColor(0.851, 0.408, 0.408, 1.0)],
  374. # [100.0, "Legendär", grp.GenerateColor(0.851, 0.408, 0.800, 1.0)],
  375. #]
  376.  
  377. #VALENCE_BONUS_LIST = {
  378. # item.APPLY_MAX_HP : [1500, 2000, 2500],
  379. # item.APPLY_MAX_SP : [1500, 2000],
  380. # item.APPLY_CON : [8, 12],
  381. # item.APPLY_INT : [8, 12],
  382. # item.APPLY_STR : [8, 12],
  383. # item.APPLY_DEX : [8, 12],
  384. # item.APPLY_ATT_SPEED : [8, 12],
  385. # item.APPLY_MOV_SPEED : [10, 15],
  386. # item.APPLY_CAST_SPEED : [10, 15],
  387. # item.APPLY_HP_REGEN : [30],
  388. # item.APPLY_SP_REGEN : [30],
  389. # item.APPLY_POISON_PCT : [5, 8],
  390. # item.APPLY_STUN_PCT : [5, 8],
  391. # item.APPLY_CRITICAL_PCT : [5, 10],
  392. # item.APPLY_PENETRATE_PCT : [5, 10],
  393. # item.APPLY_ATTBONUS_HUMAN : [5, 10],
  394. # item.APPLY_ATTBONUS_UNDEAD : [15, 20],
  395. # item.APPLY_ATTBONUS_MILGYO : [20],
  396. # item.APPLY_ATTBONUS_DEVIL : [15, 20],
  397. # item.APPLY_STEAL_HP : [5, 10],
  398. # item.APPLY_STEAL_SP : [5, 10],
  399. # item.APPLY_MANA_BURN_PCT : [5, 10],
  400. # item.APPLY_BLOCK : [10, 12],
  401. # item.APPLY_DODGE : [10, 12],
  402. # item.APPLY_RESIST_SWORD : [10, 15],
  403. # item.APPLY_RESIST_TWOHAND : [10, 15],
  404. # item.APPLY_RESIST_DAGGER : [10, 15],
  405. # item.APPLY_RESIST_BELL : [10, 15],
  406. # item.APPLY_RESIST_FAN : [10, 15],
  407. # item.APPLY_RESIST_BOW : [10, 15],
  408. # item.APPLY_RESIST_FIRE : [10, 15],
  409. # item.APPLY_RESIST_ELEC : [10, 15],
  410. # item.APPLY_RESIST_MAGIC : [10, 12],
  411. # item.APPLY_RESIST_WIND : [10, 15],
  412. # item.APPLY_REFLECT_MELEE : [6, 10],
  413. # item.APPLY_POISON_REDUCE : [5, 8],
  414. # item.APPLY_IMMUNE_STUN : [1],
  415. # item.APPLY_IMMUNE_SLOW : [1],
  416. # item.APPLY_ATT_GRADE_BONUS : [30, 50],
  417. # }
  418.  
  419. # VALENCE_BONUS_LIST_SPECIAL = {
  420. # item.APPLY_MAX_HP : [500],
  421. # item.APPLY_CON : [5],
  422. # item.APPLY_INT : [5],
  423. # item.APPLY_STR : [5],
  424. # item.APPLY_DEX : [5],
  425. # item.APPLY_CRITICAL_PCT : [5],
  426. # item.APPLY_PENETRATE_PCT : [5],
  427. # item.APPLY_ATTBONUS_MONSTER : [5],
  428. # }
  429.  
  430. CHARACTER_NAMES = (
  431. localeInfo.TOOLTIP_WARRIOR,
  432. localeInfo.TOOLTIP_ASSASSIN,
  433. localeInfo.TOOLTIP_SURA,
  434. localeInfo.TOOLTIP_SHAMAN
  435. )
  436.  
  437. CHARACTER_COUNT = len(CHARACTER_NAMES)
  438. WEAR_NAMES = (
  439. localeInfo.TOOLTIP_ARMOR,
  440. localeInfo.TOOLTIP_HELMET,
  441. localeInfo.TOOLTIP_SHOES,
  442. localeInfo.TOOLTIP_WRISTLET,
  443. localeInfo.TOOLTIP_WEAPON,
  444. localeInfo.TOOLTIP_NECK,
  445. localeInfo.TOOLTIP_EAR,
  446. localeInfo.TOOLTIP_UNIQUE,
  447. localeInfo.TOOLTIP_SHIELD,
  448. localeInfo.TOOLTIP_ARROW,
  449. )
  450. WEAR_COUNT = len(WEAR_NAMES)
  451.  
  452. AFFECT_DICT = {
  453. item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP,
  454. item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP,
  455. item.APPLY_CON : localeInfo.TOOLTIP_CON,
  456. item.APPLY_INT : localeInfo.TOOLTIP_INT,
  457. item.APPLY_STR : localeInfo.TOOLTIP_STR,
  458. item.APPLY_DEX : localeInfo.TOOLTIP_DEX,
  459. item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED,
  460. item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED,
  461. item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED,
  462. item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN,
  463. item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN,
  464. item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT,
  465. item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT,
  466. item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT,
  467. item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,
  468. item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT,
  469.  
  470. item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  471. item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  472. item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA,
  473. item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  474. item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  475.  
  476. item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  477. item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL,
  478. item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC,
  479. item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO,
  480. item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  481. item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  482. item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP,
  483. item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP,
  484. item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT,
  485. item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER,
  486. item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK,
  487. item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE,
  488. item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD,
  489. item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND,
  490. item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER,
  491. item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL,
  492. item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN,
  493. item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW,
  494. item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE,
  495. item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC,
  496. item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC,
  497. item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND,
  498. item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE,
  499. item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE,
  500. item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE,
  501. item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER,
  502. item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS,
  503. item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS,
  504. item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS,
  505. item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS,
  506. item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER,
  507. item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN,
  508. item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW,
  509. item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL,
  510. item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE,
  511. item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE,
  512. item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE,
  513. item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE,
  514. item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE,
  515. item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA,
  516. item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS,
  517. item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS,
  518. item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS,
  519. item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS,
  520. item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS,
  521. item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS,
  522. item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS,
  523. item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS,
  524. item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS,
  525. item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC,
  526. item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC,
  527. item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR,
  528. item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN,
  529. item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA,
  530. item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN,
  531. item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT,
  532. item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT,
  533. item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY,
  534. item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS,
  535.  
  536. item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER,
  537. item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER,
  538. item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE,
  539. item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH,
  540. item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK,
  541. item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT,
  542. item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT,
  543. #item.APPLY_ATTBONUS_METIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_METIN,
  544. }
  545.  
  546. ATTRIBUTE_NEED_WIDTH = {
  547. 23 : 230,
  548. 24 : 230,
  549. 25 : 230,
  550. 26 : 220,
  551. 27 : 210,
  552.  
  553. 35 : 210,
  554. 36 : 210,
  555. 37 : 210,
  556. 38 : 210,
  557. 39 : 210,
  558. 40 : 210,
  559. 41 : 210,
  560.  
  561. 42 : 220,
  562. 43 : 230,
  563. 45 : 230,
  564. }
  565.  
  566. ANTI_FLAG_DICT = {
  567. 0 : item.ITEM_ANTIFLAG_WARRIOR,
  568. 1 : item.ITEM_ANTIFLAG_ASSASSIN,
  569. 2 : item.ITEM_ANTIFLAG_SURA,
  570. 3 : item.ITEM_ANTIFLAG_SHAMAN,
  571. }
  572.  
  573. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  574.  
  575. def __init__(self, *args, **kwargs):
  576. ToolTip.__init__(self, *args, **kwargs)
  577. self.itemVnum = 0
  578. self.isShopItem = FALSE
  579.  
  580. # ¾ÆÀÌÅÛ ÅøÆÁÀ» Ç¥½ÃÇÒ ¶§ ÇöÀç ij¸¯ÅÍ°¡ Âø¿ëÇÒ ¼ö ¾ø´Â ¾ÆÀÌÅÛÀ̶ó¸é °­Á¦·Î Disable Color·Î ¼³Á¤ (ÀÌ¹Ì ±×·¸°Ô ÀÛµ¿ÇÏ°í ÀÖÀ¸³ª ²¨¾ß ÇÒ ÇÊ¿ä°¡ À־)
  581. self.bCannotUseItemForceSetDisableColor = TRUE
  582.  
  583. def __del__(self):
  584. ToolTip.__del__(self)
  585.  
  586. def SetCannotUseItemForceSetDisableColor(self, enable):
  587. self.bCannotUseItemForceSetDisableColor = enable
  588.  
  589. def CanEquip(self):
  590. if not item.IsEquipmentVID(self.itemVnum):
  591. return TRUE
  592.  
  593. race = player.GetRace()
  594. job = chr.RaceToJob(race)
  595. if not self.ANTI_FLAG_DICT.has_key(job):
  596. return FALSE
  597.  
  598. if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  599. return FALSE
  600.  
  601. sex = chr.RaceToSex(race)
  602.  
  603. MALE = 1
  604. FEMALE = 0
  605.  
  606. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  607. return FALSE
  608.  
  609. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  610. return FALSE
  611.  
  612. for i in xrange(item.LIMIT_MAX_NUM):
  613. (limitType, limitValue) = item.GetLimit(i)
  614.  
  615. if item.LIMIT_LEVEL == limitType:
  616. if player.GetStatus(player.LEVEL) < limitValue:
  617. return FALSE
  618. """
  619. elif item.LIMIT_STR == limitType:
  620. if player.GetStatus(player.ST) < limitValue:
  621. return FALSE
  622. elif item.LIMIT_DEX == limitType:
  623. if player.GetStatus(player.DX) < limitValue:
  624. return FALSE
  625. elif item.LIMIT_INT == limitType:
  626. if player.GetStatus(player.IQ) < limitValue:
  627. return FALSE
  628. elif item.LIMIT_CON == limitType:
  629. if player.GetStatus(player.HT) < limitValue:
  630. return FALSE
  631. """
  632.  
  633. return TRUE
  634.  
  635. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  636. if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
  637. color = self.DISABLE_COLOR
  638.  
  639. return ToolTip.AppendTextLine(self, text, color, centerAlign)
  640.  
  641. def ClearToolTip(self):
  642. self.isShopItem = FALSE
  643. self.toolTipWidth = self.TOOL_TIP_WIDTH
  644. ToolTip.ClearToolTip(self)
  645.  
  646. def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY):
  647. itemVnum = player.GetItemIndex(window_type, slotIndex)
  648. if 0 == itemVnum:
  649. return
  650.  
  651. self.ClearToolTip()
  652. if shop.IsOpen():
  653. if not shop.IsPrivateShop():
  654. item.SelectItem(itemVnum)
  655. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex))
  656.  
  657. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  658. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  659.  
  660. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  661. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.INVENTORY, slotIndex)
  662. else:
  663. self.AddItemData(itemVnum, metinSlot, attrSlot)
  664.  
  665. if app.ENABLE_SOULBIND_SYSTEM:
  666. self.__AppendSealInformation(player.INVENTORY, slotIndex)
  667.  
  668. #if str(player.GetName())[0] == "[":
  669. # self.AppendTextLine("Vnum:" % (int(itemVnum)), self.SAITO_TITLE_COLOR_CYAN)
  670.  
  671. if app.ENABLE_SEND_TARGET_INFO:
  672. def SetItemToolTipStone(self, itemVnum):
  673. self.itemVnum = itemVnum
  674. item.SelectItem(itemVnum)
  675. itemType = item.GetItemType()
  676.  
  677. itemDesc = item.GetItemDescription()
  678. itemSummary = item.GetItemSummary()
  679. attrSlot = 0
  680. self.__AdjustMaxWidth(attrSlot, itemDesc)
  681. itemName = item.GetItemName()
  682. realName = itemName[:itemName.find("+")]
  683. self.SetTitle(realName + " +0 - +4")
  684.  
  685. ## Description ###
  686. self.AppendDescription(itemDesc, 26)
  687. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  688.  
  689. if item.ITEM_TYPE_METIN == itemType:
  690. self.AppendMetinInformation()
  691. self.AppendMetinWearInformation()
  692.  
  693. for i in xrange(item.LIMIT_MAX_NUM):
  694. (limitType, limitValue) = item.GetLimit(i)
  695.  
  696. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  697. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  698.  
  699. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  700. self.AppendTimerBasedOnWearLastTime(metinSlot)
  701.  
  702. self.ShowToolTip()
  703.  
  704. def SetShopItem(self, slotIndex):
  705. itemVnum = shop.GetItemID(slotIndex)
  706. if 0 == itemVnum:
  707. return
  708.  
  709. price = shop.GetItemPrice(slotIndex)
  710. self.ClearToolTip()
  711. self.isShopItem = TRUE
  712.  
  713. metinSlot = []
  714. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  715. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  716. attrSlot = []
  717. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  718. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  719.  
  720. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  721. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.SHOP, slotIndex)
  722. else:
  723. self.AddItemData(itemVnum, metinSlot, attrSlot)
  724. self.AppendPrice(price)
  725.  
  726. def SetExchangeOwnerItem(self, slotIndex):
  727. itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
  728. if 0 == itemVnum:
  729. return
  730.  
  731. self.ClearToolTip()
  732.  
  733. metinSlot = []
  734. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  735. metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i))
  736. attrSlot = []
  737. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  738. attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i))
  739.  
  740. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  741. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.TRADE_OWNER, slotIndex)
  742. else:
  743. #self.AddItemData(itemVnum, metinSlot, attrSlot)
  744. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.TRADE_OWNER, slotIndex)
  745.  
  746. def SetExchangeTargetItem(self, slotIndex):
  747. itemVnum = exchange.GetItemVnumFromTarget(slotIndex)
  748. if 0 == itemVnum:
  749. return
  750.  
  751. self.ClearToolTip()
  752.  
  753. metinSlot = []
  754. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  755. metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i))
  756. attrSlot = []
  757. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  758. attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i))
  759.  
  760. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  761. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.TRADE_TARGET, slotIndex)
  762. else:
  763. #self.AddItemData(itemVnum, metinSlot, attrSlot)
  764. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.TRADE_OWNER, slotIndex)
  765.  
  766. def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex):
  767. itemVnum = player.GetItemIndex(invenType, invenPos)
  768. if 0 == itemVnum:
  769. return
  770.  
  771. item.SelectItem(itemVnum)
  772. self.ClearToolTip()
  773. self.AppendSellingPrice(shop.GetPrivateShopItemPrice(invenType, invenPos))
  774.  
  775. metinSlot = []
  776. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  777. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  778. attrSlot = []
  779. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  780. attrSlot.append(player.GetItemAttribute(invenPos, i))
  781.  
  782. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  783. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, invenType, invenPos)
  784. else:
  785. self.AddItemData(itemVnum, metinSlot, attrSlot)
  786.  
  787. def SetSafeBoxItem(self, slotIndex):
  788. itemVnum = safebox.GetItemID(slotIndex)
  789. if 0 == itemVnum:
  790. return
  791.  
  792. self.ClearToolTip()
  793. metinSlot = []
  794. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  795. metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i))
  796. attrSlot = []
  797. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  798. attrSlot.append(safebox.GetItemAttribute(slotIndex, i))
  799.  
  800. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  801. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemFlags(slotIndex), 0, player.SAFEBOX, slotIndex)
  802. else:
  803. self.AddItemData(itemVnum, metinSlot, attrSlot)
  804.  
  805. if app.ENABLE_SOULBIND_SYSTEM:
  806. self.__AppendSealInformation(player.SAFEBOX, slotIndex)
  807.  
  808. def SetMallItem(self, slotIndex):
  809. itemVnum = safebox.GetMallItemID(slotIndex)
  810. if 0 == itemVnum:
  811. return
  812.  
  813. self.ClearToolTip()
  814. metinSlot = []
  815. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  816. metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i))
  817. attrSlot = []
  818. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  819. attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i))
  820.  
  821. self.AddItemData(itemVnum, metinSlot, attrSlot)
  822.  
  823. if app.ENABLE_SOULBIND_SYSTEM:
  824. self.__AppendSealInformation(player.MALL, slotIndex)
  825.  
  826. def SetItemToolTip(self, itemVnum):
  827. self.ClearToolTip()
  828. metinSlot = []
  829. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  830. metinSlot.append(0)
  831. attrSlot = []
  832. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  833. attrSlot.append((0, 0))
  834.  
  835. self.AddItemData(itemVnum, metinSlot, attrSlot)
  836.  
  837. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  838. def SetChangeLookWindowItem(self, slotIndex):
  839. itemVnum = player.GetItemIndex(slotIndex)
  840. if 0 == itemVnum:
  841. return
  842.  
  843. self.ClearToolTip()
  844.  
  845. metinSlot = []
  846. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  847. metinSlot.append(player.GetItemMetinSocket(slotIndex, i))
  848.  
  849. attrSlot = []
  850. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  851. attrSlot.append(player.GetItemAttribute(slotIndex, i))
  852.  
  853. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.INVENTORY, slotIndex)
  854.  
  855. def AppendChangeLookInformation(self, window_type, slotIndex):
  856. table = {
  857. player.SAFEBOX : safebox.GetItemLook,
  858. # player.MALL : safebox.GetMallItemLook,
  859. player.INVENTORY : player.GetItemLook,
  860. player.TRADE_OWNER : exchange.GetItemLookVnumFromSelf,
  861. player.TRADE_TARGET : exchange.GetItemLookVnumFromTarget,
  862. player.SHOP : shop.GetItemLookVnum,
  863. player.GLASS : slotIndex,
  864. }
  865.  
  866. if window_type in table:
  867. if window_type == player.GLASS:
  868. GetItemChangeLookVnum = table[window_type]
  869. else:
  870. GetItemChangeLookVnum = table[window_type](slotIndex)
  871.  
  872. if GetItemChangeLookVnum > 0:
  873. self.AppendSpace(5)
  874. self.AppendTextLine("[ %s ]" % localeInfo.CHANGE_LOOK_TITLE , self.CHANGELOOK_TITLE_COLOR)
  875.  
  876. item.SelectItem(GetItemChangeLookVnum)
  877. self.AppendTextLine("%s" % str(item.GetItemName()), self.CHANGELOOK_ITEMNAME_COLOR)
  878.  
  879. def __AppendAttackSpeedInfo(self, item):
  880. atkSpd = item.GetValue(0)
  881.  
  882. if atkSpd < 80:
  883. stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST
  884. elif atkSpd <= 95:
  885. stSpd = localeInfo.TOOLTIP_ITEM_FAST
  886. elif atkSpd <= 105:
  887. stSpd = localeInfo.TOOLTIP_ITEM_NORMAL
  888. elif atkSpd <= 120:
  889. stSpd = localeInfo.TOOLTIP_ITEM_SLOW
  890. else:
  891. stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW
  892.  
  893. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR)
  894.  
  895. def __AppendAttackGradeInfo(self):
  896. atkGrade = item.GetValue(1)
  897. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade))
  898.  
  899. if app.ENABLE_SASH_SYSTEM:
  900. def CalcSashValue(self, value, abs):
  901. if not value:
  902. return 0
  903.  
  904. valueCalc = int((round(value * abs) / 100) - .5) + int(int((round(value * abs) / 100) - .5) > 0)
  905. if valueCalc <= 0 and value > 0:
  906. value = 1
  907. else:
  908. value = valueCalc
  909.  
  910. return value
  911.  
  912. def __AppendAttackPowerInfo(self, itemAbsChance = 0):
  913. minPower = item.GetValue(3)
  914. maxPower = item.GetValue(4)
  915. addPower = item.GetValue(5)
  916.  
  917. if app.ENABLE_SASH_SYSTEM:
  918. if itemAbsChance:
  919. minPower = self.CalcSashValue(minPower, itemAbsChance)
  920. maxPower = self.CalcSashValue(maxPower, itemAbsChance)
  921. addPower = self.CalcSashValue(addPower, itemAbsChance)
  922.  
  923. if maxPower > minPower:
  924. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower + addPower, maxPower + addPower), self.POSITIVE_COLOR)
  925. else:
  926. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower + addPower), self.POSITIVE_COLOR)
  927.  
  928. def __AppendMagicAttackInfo(self, itemAbsChance = 0):
  929. minMagicAttackPower = item.GetValue(1)
  930. maxMagicAttackPower = item.GetValue(2)
  931. addPower = item.GetValue(5)
  932.  
  933. if app.ENABLE_SASH_SYSTEM:
  934. if itemAbsChance:
  935. minMagicAttackPower = self.CalcSashValue(minMagicAttackPower, itemAbsChance)
  936. maxMagicAttackPower = self.CalcSashValue(maxMagicAttackPower, itemAbsChance)
  937. addPower = self.CalcSashValue(addPower, itemAbsChance)
  938.  
  939. if minMagicAttackPower > 0 or maxMagicAttackPower > 0:
  940. if maxMagicAttackPower > minMagicAttackPower:
  941. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower + addPower, maxMagicAttackPower + addPower), self.POSITIVE_COLOR)
  942. else:
  943. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower + addPower), self.POSITIVE_COLOR)
  944.  
  945. def __AppendMagicDefenceInfo(self, itemAbsChance = 0):
  946. magicDefencePower = item.GetValue(0)
  947.  
  948. if app.ENABLE_SASH_SYSTEM:
  949. if itemAbsChance:
  950. magicDefencePower = self.CalcSashValue(magicDefencePower, itemAbsChance)
  951.  
  952. if magicDefencePower > 0:
  953. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))
  954.  
  955. # def __AppendAttributeInformation(self, attrSlot):
  956. # if 0 != attrSlot:
  957. # self.AppendSpace(5)
  958. # self.AppendTextLine("[Zusätzliche Boni]", self.TITLE_COLOR)
  959. # self.AppendSpace(2)
  960. #
  961. # for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  962. # type = attrSlot[i][0]
  963. # value = attrSlot[i][1]
  964. #
  965. # if 0 == value:
  966. # continue
  967. #
  968. # affectString = self.__GetAffectString(type, value)
  969. # if affectString:
  970. # affectColor = self.__GetAttributeColor(i, value)
  971. # self.AppendTextLine(affectString, affectColor)
  972.  
  973. def __AppendAttributeInformation(self, attrSlot, itemAbsChance = 0):
  974. if 0 != attrSlot:
  975. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  976. type = attrSlot[i][0]
  977. value = attrSlot[i][1]
  978. if 0 == value:
  979. continue
  980.  
  981. affectString = self.__GetAffectString(type, value)
  982. if app.ENABLE_SASH_SYSTEM:
  983. if item.GetItemType() == 28 and item.GetItemSubType() == 3 and itemAbsChance:
  984. value = self.CalcSashValue(value, itemAbsChance)
  985. affectString = self.__GetAffectString(type, value)
  986.  
  987. if affectString:
  988. affectColor = self.__GetAttributeColor(i, value)
  989. self.AppendTextLine(affectString, affectColor)
  990.  
  991. def __GetAttributeColor(self, index, value):
  992. if value > 0:
  993. if index >= 5:
  994. return self.SPECIAL_POSITIVE_COLOR2
  995. #return self.SAITO_TITLE_COLOR_YELLOW
  996. else:
  997. return self.SPECIAL_POSITIVE_COLOR
  998. elif value == 0:
  999. return self.NORMAL_COLOR
  1000. else:
  1001. return self.NEGATIVE_COLOR
  1002.  
  1003. def __IsPolymorphItem(self, itemVnum):
  1004. if itemVnum >= 70103 and itemVnum <= 70106:
  1005. return 1
  1006. return 0
  1007.  
  1008. def __SetPolymorphItemTitle(self, monsterVnum):
  1009. if localeInfo.IsVIETNAM():
  1010. itemName =item.GetItemName()
  1011. itemName+=" "
  1012. itemName+=nonplayer.GetMonsterName(monsterVnum)
  1013. else:
  1014. itemName =nonplayer.GetMonsterName(monsterVnum)
  1015. itemName+=" "
  1016. itemName+=item.GetItemName()
  1017. self.SetTitle(itemName)
  1018.  
  1019. def __SetNormalItemTitle(self):
  1020. if app.ENABLE_SEND_TARGET_INFO:
  1021. if self.isStone:
  1022. itemName = item.GetItemName()
  1023. realName = itemName[:itemName.find("+")]
  1024. self.SetTitle(realName + " +0 - +4")
  1025. else:
  1026. self.SetTitle(item.GetItemName())
  1027. else:
  1028. self.SetTitle(item.GetItemName())
  1029.  
  1030. def __SetSpecialItemTitle(self):
  1031. self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)
  1032.  
  1033. def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
  1034. #self.SetItemTitle(item.GetItemName())
  1035. if localeInfo.IsCANADA():
  1036. if 72726 == itemVnum or 72730 == itemVnum:
  1037. self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  1038. return
  1039.  
  1040. if self.__IsPolymorphItem(itemVnum):
  1041. self.__SetPolymorphItemTitle(metinSlot[0])
  1042. else:
  1043. if self.__IsAttr(attrSlot):
  1044. self.__SetSpecialItemTitle()
  1045. return
  1046.  
  1047. self.__SetNormalItemTitle()
  1048.  
  1049. def __IsAttr(self, attrSlot):
  1050. if not attrSlot:
  1051. return FALSE
  1052.  
  1053. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1054. type = attrSlot[i][0]
  1055. if 0 != type:
  1056. return TRUE
  1057.  
  1058. return FALSE
  1059.  
  1060. def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0):
  1061. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1062. metinSlotData=metinSlot[i]
  1063. if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE:
  1064. metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER
  1065.  
  1066. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1067.  
  1068. def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot):
  1069. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1070. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1071.  
  1072. if self.__IsHair(itemVnum):
  1073. self.__AppendHairIcon(itemVnum)
  1074.  
  1075. ### Description ###
  1076. self.AppendDescription(itemDesc, 26)
  1077. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1078.  
  1079. #def AddItemData(self, itemVnum, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0):
  1080. def AddItemData(self, itemVnum, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0, window_type = player.INVENTORY, slotIndex = -1): ## ENABLE_CHANGE_LOOK_SYSTEM
  1081. self.itemVnum = itemVnum
  1082. item.SelectItem(itemVnum)
  1083. itemType = item.GetItemType()
  1084. itemSubType = item.GetItemSubType()
  1085.  
  1086. if chr.IsGameMaster(player.GetMainCharacterIndex()):
  1087. self.AppendDescription(str("(GM-Info)Item Vnum: %s") %(int(itemVnum)), self.COSTUME_WEAPON_TIP_COLOR)
  1088.  
  1089. if 50026 == itemVnum:
  1090. if 0 != metinSlot:
  1091. name = item.GetItemName()
  1092. if metinSlot[0] > 0:
  1093. name += " "
  1094. name += localeInfo.NumberToMoneyString(metinSlot[0])
  1095. self.SetTitle(name)
  1096. self.ShowToolTip()
  1097. return
  1098.  
  1099. ### Skill Book ###
  1100. if app.ENABLE_SEND_TARGET_INFO:
  1101. if 50300 == itemVnum and not self.isBook:
  1102. if 0 != metinSlot and not self.isBook:
  1103. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1104. self.ShowToolTip()
  1105. elif self.isBook:
  1106. self.SetTitle(item.GetItemName())
  1107. self.AppendDescription(item.GetItemDescription(), 26)
  1108. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1109. self.ShowToolTip()
  1110. return
  1111. elif 70037 == itemVnum :
  1112. if 0 != metinSlot and not self.isBook2:
  1113. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1114. self.AppendDescription(item.GetItemDescription(), 26)
  1115. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1116. self.ShowToolTip()
  1117. elif self.isBook2:
  1118. self.SetTitle(item.GetItemName())
  1119. self.AppendDescription(item.GetItemDescription(), 26)
  1120. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1121. self.ShowToolTip()
  1122. return
  1123. myPetVnum = [53006,53002,53003,53004,53005,53010,53011,53012,53013,53014,53015,53018,53019,53020,53021,55708,55703,55704,34106,55702,34110,55701,55707,53024,53025,53218,53221,53016]
  1124. if itemVnum in myPetVnum:
  1125. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_GREEN_YELLOW)
  1126. self.AppendDescription(item.GetItemDescription(), 26)
  1127. self.__AppendAffectInformation()
  1128. self.AppendMallItemLastTime(metinSlot[0])
  1129. self.ShowToolTip()
  1130. return
  1131. PermaReittier = [71142,71139,71137,71138]
  1132. if itemVnum in PermaReittier:
  1133. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_VIOLETT)
  1134. self.AppendDescription(item.GetItemDescription(), 26)
  1135. self.AppendSpace(5)
  1136. self.__AppendAffectInformation()
  1137. self.AppendWearableInformation()
  1138. self.ShowToolTip()
  1139. return
  1140. BerniePermaReittier = [71242,71243]
  1141. if itemVnum in BerniePermaReittier:
  1142. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_VIOLETT)
  1143. self.AppendSpace(5)
  1144. self.AppendTextLine("[Dev x02XY v0.1]", grp.GenerateColor(0.9333, 0.7882, 0.0, 1.0))
  1145. self.AppendDescription(item.GetItemDescription(), 26)
  1146. self.AppendSpace(5)
  1147. self.__AppendAffectInformation()
  1148. self.AppendWearableInformation()
  1149. self.ShowToolTip()
  1150. return
  1151. # LimitiertPermaReittier = []
  1152. # if itemVnum in LimitiertPermaReittier:
  1153. # self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_VIOLETT)
  1154. # self.AppendSpace(5)
  1155. # self.AppendTextLine("[Limitiert]", grp.GenerateColor(0.9333, 0.7882, 0.0, 1.0))
  1156. # self.AppendDescription(item.GetItemDescription(), 26)
  1157. # self.AppendSpace(5)
  1158. # self.__AppendAffectInformation()
  1159. # self.AppendWearableInformation()
  1160. # self.ShowToolTip()
  1161. # return
  1162. LimitiertAblaufendeReittiere = [71241,71244]
  1163. if itemVnum in LimitiertAblaufendeReittiere:
  1164. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_GREEN_YELLOW)
  1165. self.AppendSpace(5)
  1166. self.AppendTextLine("[Dev x02XY v0.1/2]", grp.GenerateColor(0.9333, 0.7882, 0.0, 1.0))
  1167. self.AppendDescription(item.GetItemDescription(), 26)
  1168. self.AppendSpace(5)
  1169. self.__AppendAffectInformation()
  1170. self.AppendMallItemLastTime(metinSlot[0])
  1171. self.AppendWearableInformation()
  1172. self.ShowToolTip()
  1173. return
  1174. AblaufendeReittiere = [71241]
  1175. if itemVnum in AblaufendeReittiere:
  1176. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_GREEN_YELLOW)
  1177. self.AppendDescription(item.GetItemDescription(), 26)
  1178. self.AppendSpace(5)
  1179. self.__AppendAffectInformation()
  1180. self.AppendMallItemLastTime(metinSlot[0])
  1181. self.AppendWearableInformation()
  1182. self.ShowToolTip()
  1183. return
  1184. SpecialRinge = [71136,71143,71148,71149,71145,71202,71135,71158]
  1185. if itemVnum in SpecialRinge:
  1186. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_CYAN)
  1187. self.AppendDescription(item.GetItemDescription(), 26)
  1188. self.AppendSpace(5)
  1189. self.__AppendAffectInformation()
  1190. self.AppendMallItemLastTime(metinSlot[0])
  1191. self.AppendWearableInformation()
  1192. self.ShowToolTip()
  1193. return
  1194. #SpecialWeapons = [21880,21881,21882,21883,21884,21885,21886,21887,21888,21889,21980,21981,21982,21983,21984,21985,21986,21987,21988,21989,22880,22881,22882,22883,22884,22885,22886,22887,22888,22889,25880,25881,25882,25883,25884,25885,25886,25887,25888,25889,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,23880,23881,23882,23883,23884,23885,23886,23887,23888,23889,21770,21771,21772,21773,21774,21775,21776,21777,21778,21779,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279]
  1195. SpecialWeapons = [4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469]
  1196. if itemVnum in SpecialWeapons:
  1197. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_GOLD)
  1198. self.AppendSpace(5)
  1199. self.AppendTextLine("[Legendär]", grp.GenerateColor(0.9333, 0.7882, 0.0, 1.0))
  1200. self.__AppendLimitInformation()
  1201. self.AppendSpace(5)
  1202. self.__AppendAttackPowerInfo()
  1203. self.__AppendMagicAttackInfo()
  1204. self.__AppendAffectInformation()
  1205. self.__AppendAttributeInformation(attrSlot)
  1206. self.__AppendMetinSlotInfo(metinSlot)
  1207. # if app.ENABLE_CHANGE_LOOK_SYSTEM:
  1208. self.AppendChangeLookInformation(window_type, slotIndex)
  1209. self.AppendWearableInformation()
  1210. self.ShowToolTip()
  1211. return
  1212. RuneVnum = [24259,24260,24261,24262,24263,24359,24360,24361,24362,24363,24264,24565,24566]
  1213. if itemVnum in RuneVnum:
  1214. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_CYAN)
  1215. self.AppendDescription(item.GetItemDescription(), 26)
  1216. self.__AppendAffectInformation()
  1217. self.AppendMallItemLastTime(metinSlot[0])
  1218. self.AppendWearableInformation()
  1219. self.ShowToolTip()
  1220. return
  1221. PermaPetVnum = [53026,53027,53007,53008,53009,53219,53220]
  1222. if itemVnum in PermaPetVnum:
  1223. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_BLUE_VIOLET)
  1224. self.AppendDescription(item.GetItemDescription(), 26)
  1225. self.__AppendAffectInformation()
  1226. #self.AppendMallItemLastTime(metinSlot[0])
  1227. self.ShowToolTip()
  1228. return
  1229. elif 70055 == itemVnum:
  1230. if 0 != metinSlot:
  1231. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1232. self.AppendDescription(item.GetItemDescription(), 26)
  1233. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1234. self.ShowToolTip()
  1235. return
  1236. else:
  1237. if 50300 == itemVnum:
  1238. if 0 != metinSlot:
  1239. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1240. self.ShowToolTip()
  1241. return
  1242. elif 70037 == itemVnum:
  1243. if 0 != metinSlot:
  1244. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1245. self.AppendDescription(item.GetItemDescription(), 26)
  1246. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1247. self.ShowToolTip()
  1248. return
  1249. elif 70055 == itemVnum:
  1250. if 0 != metinSlot:
  1251. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1252. self.AppendDescription(item.GetItemDescription(), 26)
  1253. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1254. self.ShowToolTip()
  1255. return
  1256. myPetVnum = [53006,53002,53003,53004,53005,53010,53011,53012,53013,53014,53015,53018,53019,53020,53021,53026,53027,55708,55703,55704,34106,55702,34110,55701,55707,53024,53025,53218,53221,53016]
  1257. if itemVnum in myPetVnum:
  1258. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_GOLD)
  1259. self.AppendDescription(item.GetItemDescription(), 26)
  1260. self.__AppendAffectInformation()
  1261. self.AppendMallItemLastTime(metinSlot[0])
  1262. self.ShowToolTip()
  1263. return
  1264. RingVnum = [71142,71139]
  1265. if itemVnum in RingVnum:
  1266. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_YELLOW)
  1267. self.AppendDescription(item.GetItemDescription(), 26)
  1268. self.__AppendAffectInformation()
  1269. #self.AppendMallItemLastTime(metinSlot[0])
  1270. self.ShowToolTip()
  1271. return
  1272. SpecialWeapons = [9189,9180,91889]
  1273. if itemVnum in SpecialWeapons:
  1274. self.AppendTextLine(item.GetItemName(), self.SAITO_TITLE_COLOR_GOLD)
  1275. self.AppendTextLine("Legendär", grp.GenerateColor(0.9333, 0.7882, 0.0, 1.0))
  1276. self.__AppendLimitInformation()
  1277. self.AppendSpace(5)
  1278. self.__AppendAttackPowerInfo()
  1279. self.__AppendMagicAttackInfo()
  1280. self.__AppendAffectInformation()
  1281. self.__AppendAttributeInformation(attrSlot)
  1282. self.AppendWearableInformation()
  1283. self.ShowToolTip()
  1284. return
  1285. RuneVnum = [24259,24260,24261,24262,24263,24359,24360,24361,24362,24363,24264,24565,24566]
  1286. if itemVnum in RuneVnum:
  1287. self.AppendTextLine(item.GetItemName(), self.NEGATIVE_COLOR)
  1288. self.AppendDescription(item.GetItemDescription(), 26)
  1289. self.__AppendAffectInformation()
  1290. self.AppendMallItemLastTime(metinSlot[0])
  1291. self.ShowToolTip()
  1292. return
  1293. ###########################################################################################
  1294.  
  1295. itemDesc = item.GetItemDescription()
  1296. itemSummary = item.GetItemSummary()
  1297.  
  1298. isCostumeItem = 0
  1299. isCostumeHair = 0
  1300. isCostumeBody = 0
  1301. if app.ENABLE_SASH_SYSTEM:
  1302. isCostumeSash = 0
  1303. isCostumeMount = 0
  1304.  
  1305. if app.ENABLE_COSTUME_SYSTEM:
  1306. if item.ITEM_TYPE_COSTUME == itemType:
  1307. isCostumeItem = 1
  1308. isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
  1309. isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
  1310. if app.ENABLE_SASH_SYSTEM:
  1311. isCostumeSash = itemSubType == 3
  1312. isCostumeMount = item.COSTUME_TYPE_MOUNT == itemSubType
  1313.  
  1314. #dbg.TraceError("IS_COSTUME_ITEM! body(%d) hair(%d)" % (isCostumeBody, isCostumeHair))
  1315.  
  1316. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1317. # Valence-System
  1318. # if itemType in [item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR]:
  1319. # points = 0.0
  1320. # if attrSlot != 0:
  1321. # for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1322. # BONUS_LIST = self.VALENCE_BONUS_LIST
  1323. # if i >= 5:
  1324. # BONUS_LIST = self.VALENCE_BONUS_LIST_SPECIAL
  1325. # if attrSlot[i][0] in BONUS_LIST:
  1326. # bonusList = BONUS_LIST[attrSlot[i][0]]
  1327. # if attrSlot[i][1] > 0:
  1328. # idx = 0
  1329. # while idx < len(bonusList) and bonusList[idx] < attrSlot[i][1]:
  1330. # idx = idx + 1
  1331. # points = points + ((100.0 / len(bonusList)) * (idx + 1))
  1332. # points = points / player.ATTRIBUTE_SLOT_MAX_NUM
  1333.  
  1334. # i = 0
  1335. # while (i+1) < len(self.VALENCE_ITEM_TITLES) and points >= self.VALENCE_ITEM_TITLES[i+1][0]:
  1336. # i = i + 1
  1337. # self.AppendTextLine(self.VALENCE_ITEM_TITLES[i][1], self.VALENCE_ITEM_TITLES[i][2])
  1338. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1339.  
  1340. ### Hair Preview Image ###
  1341. if self.__IsHair(itemVnum):
  1342. self.__AppendHairIcon(itemVnum)
  1343.  
  1344. ### Description ###
  1345. self.AppendDescription(itemDesc, 26)
  1346. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1347.  
  1348. if app.ENABLE_TITLE_SYSTEM:
  1349. if itemVnum in (constInfo.TITLE_SYSTEM_ITEM_1, constInfo.TITLE_SYSTEM_ITEM_2, constInfo.TITLE_SYSTEM_ITEM_3):
  1350. potion_list = {
  1351. constInfo.TITLE_SYSTEM_ITEM_1 : ["Dieses Item kann im Itemshop erworben werden.", "Dieses Item schaltet folgenden Titel frei: %s" % localeInfo.TITLE_17],
  1352. constInfo.TITLE_SYSTEM_ITEM_2 : ["Dieses Item kann im Itemshop erworben werden.", "Dieses Item schaltet folgenden Titel frei: %s" % localeInfo.TITLE_18],
  1353. constInfo.TITLE_SYSTEM_ITEM_3 : ["Dieses Item kann im Itemshop erworben werden.", "Dieses Item schaltet folgenden Titel frei: %s" % localeInfo.TITLE_19]}
  1354.  
  1355. self.AppendSpace(5)
  1356. for i in xrange(len(potion_list[itemVnum])):
  1357. self.AppendTextLine(potion_list[itemVnum][i], self.SPECIAL_POSITIVE_COLOR)
  1358.  
  1359. ### Weapon ###
  1360. if item.ITEM_TYPE_WEAPON == itemType:
  1361. if itemVnum >= 79501 and itemVnum <= 79504:
  1362. self.__AppendLimitInformation()
  1363. self.AppendSpace(5)
  1364. self.__AppendAffectInformation()
  1365. self.__AppendAttackPowerInfo()
  1366. self.__AppendMagicAttackInfo()
  1367. self.AppendWearableInformation()
  1368.  
  1369. bHasRealtimeFlag = 0
  1370.  
  1371. for i in xrange(item.LIMIT_MAX_NUM):
  1372. (limitType, limitValue) = item.GetLimit(i)
  1373.  
  1374. if item.LIMIT_REAL_TIME == limitType:
  1375. bHasRealtimeFlag = 1
  1376.  
  1377. if 1 == bHasRealtimeFlag:
  1378. self.AppendMallItemLastTime(metinSlot[0])
  1379.  
  1380. else:
  1381. self.__AppendLimitInformation()
  1382.  
  1383. self.AppendSpace(5)
  1384.  
  1385. if item.WEAPON_FAN == itemSubType:
  1386. self.__AppendMagicAttackInfo()
  1387. self.__AppendAttackPowerInfo()
  1388. else:
  1389. self.__AppendAttackPowerInfo()
  1390. self.__AppendMagicAttackInfo()
  1391.  
  1392. self.__AppendAffectInformation()
  1393. self.__AppendAttributeInformation(attrSlot)
  1394.  
  1395. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  1396. self.AppendChangeLookInformation(window_type, slotIndex)
  1397.  
  1398. self.AppendWearableInformation()
  1399. self.__AppendMetinSlotInfo(metinSlot)
  1400.  
  1401. ### Armor ###
  1402. elif item.ITEM_TYPE_ARMOR == itemType:
  1403. self.__AppendLimitInformation()
  1404.  
  1405. ## ¹æ¾î·Â
  1406. defGrade = item.GetValue(1)
  1407. defBonus = item.GetValue(5)*2 ## ¹æ¾î·Â Ç¥½Ã À߸ø µÇ´Â ¹®Á¦¸¦ ¼öÁ¤
  1408. if defGrade > 0:
  1409. self.AppendSpace(5)
  1410. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  1411.  
  1412. self.__AppendMagicDefenceInfo()
  1413. self.__AppendAffectInformation()
  1414. self.__AppendAttributeInformation(attrSlot)
  1415.  
  1416. if app.ENABLE_CHANGE_LOOK_SYSTEM and itemSubType == item.ARMOR_BODY:
  1417. self.AppendChangeLookInformation(window_type, slotIndex)
  1418.  
  1419. self.AppendWearableInformation()
  1420.  
  1421. if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  1422. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  1423. else:
  1424. self.__AppendMetinSlotInfo(metinSlot)
  1425.  
  1426. ### Belt Item ###
  1427. elif item.ITEM_TYPE_BELT == itemType:
  1428. self.__AppendLimitInformation()
  1429. self.__AppendAffectInformation()
  1430. self.__AppendAttributeInformation(attrSlot)
  1431.  
  1432. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  1433.  
  1434.  
  1435. ## ÄÚ½ºÃõ ¾ÆÀÌÅÛ ##
  1436. elif 0 != isCostumeItem:
  1437. self.__AppendLimitInformation()
  1438.  
  1439. if app.ENABLE_SASH_SYSTEM:
  1440. if itemVnum >= 85001 and itemVnum <= 86059:
  1441. ## ABSORPTION RATE
  1442. absChance = int(metinSlot[sash.ABSORPTION_SOCKET])
  1443. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (absChance), self.CONDITION_COLOR)
  1444. ## END ABSOPRTION RATE
  1445.  
  1446. itemAbsorbedVnum = int(metinSlot[sash.ABSORBED_SOCKET])
  1447. if itemAbsorbedVnum:
  1448. ## ATTACK / DEFENCE
  1449. item.SelectItem(itemAbsorbedVnum)
  1450. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  1451. if item.GetItemSubType() == item.WEAPON_FAN:
  1452. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1453. item.SelectItem(itemAbsorbedVnum)
  1454. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1455. else:
  1456. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1457. item.SelectItem(itemAbsorbedVnum)
  1458. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1459. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1460. defGrade = item.GetValue(1)
  1461. defBonus = item.GetValue(5) * 2
  1462. defGrade = self.CalcSashValue(defGrade, metinSlot[sash.ABSORPTION_SOCKET])
  1463. defBonus = self.CalcSashValue(defBonus, metinSlot[sash.ABSORPTION_SOCKET])
  1464.  
  1465. if defGrade > 0:
  1466. self.AppendSpace(5)
  1467. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  1468.  
  1469. item.SelectItem(itemAbsorbedVnum)
  1470. self.__AppendMagicDefenceInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1471. ## END ATTACK / DEFENCE
  1472.  
  1473. ## EFFECT
  1474. item.SelectItem(itemAbsorbedVnum)
  1475. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1476. (affectType, affectValue) = item.GetAffect(i)
  1477. affectValue = self.CalcSashValue(affectValue, metinSlot[sash.ABSORPTION_SOCKET])
  1478. affectString = self.__GetAffectString(affectType, affectValue)
  1479. if affectString and affectValue > 0:
  1480. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1481.  
  1482. item.SelectItem(itemAbsorbedVnum)
  1483. # END EFFECT
  1484.  
  1485. item.SelectItem(itemVnum)
  1486. ## ATTR
  1487. self.__AppendAttributeInformation(attrSlot, metinSlot[sash.ABSORPTION_SOCKET])
  1488. # END ATTR
  1489. else:
  1490. # ATTR
  1491. self.__AppendAttributeInformation(attrSlot)
  1492. # END ATTR
  1493. else:
  1494. self.__AppendAffectInformation()
  1495. self.__AppendAttributeInformation(attrSlot)
  1496. else:
  1497. self.__AppendAffectInformation()
  1498. self.__AppendAttributeInformation(attrSlot)
  1499.  
  1500. self.AppendWearableInformation()
  1501. bHasRealtimeFlag = 0
  1502. for i in xrange(item.LIMIT_MAX_NUM):
  1503. (limitType, limitValue) = item.GetLimit(i)
  1504. if item.LIMIT_REAL_TIME == limitType:
  1505. bHasRealtimeFlag = 1
  1506.  
  1507. if bHasRealtimeFlag == 1:
  1508. self.AppendMallItemLastTime(metinSlot[0])
  1509. #dbg.TraceError("1) REAL_TIME flag On ")
  1510.  
  1511. ## Rod ##
  1512. elif item.ITEM_TYPE_ROD == itemType:
  1513.  
  1514. if 0 != metinSlot:
  1515. curLevel = item.GetValue(0) / 10
  1516. curEXP = metinSlot[0]
  1517. maxEXP = item.GetValue(2)
  1518. self.__AppendLimitInformation()
  1519. self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  1520.  
  1521. ## Pick ##
  1522. elif item.ITEM_TYPE_PICK == itemType:
  1523.  
  1524. if 0 != metinSlot:
  1525. curLevel = item.GetValue(0) / 10
  1526. curEXP = metinSlot[0]
  1527. maxEXP = item.GetValue(2)
  1528. self.__AppendLimitInformation()
  1529. self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  1530.  
  1531. ## Lottery ##
  1532. elif item.ITEM_TYPE_LOTTERY == itemType:
  1533. if 0 != metinSlot:
  1534.  
  1535. ticketNumber = int(metinSlot[0])
  1536. stepNumber = int(metinSlot[1])
  1537.  
  1538. self.AppendSpace(5)
  1539. self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  1540. self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  1541.  
  1542. ### Metin ###
  1543. elif item.ITEM_TYPE_METIN == itemType:
  1544. self.AppendMetinInformation()
  1545. self.AppendMetinWearInformation()
  1546.  
  1547. ### Fish ###
  1548. elif item.ITEM_TYPE_FISH == itemType:
  1549. if 0 != metinSlot:
  1550. self.__AppendFishInfo(metinSlot[0])
  1551.  
  1552. ## item.ITEM_TYPE_BLEND
  1553. elif item.ITEM_TYPE_BLEND == itemType:
  1554. self.__AppendLimitInformation()
  1555.  
  1556. if metinSlot:
  1557. affectType = metinSlot[0]
  1558. affectValue = metinSlot[1]
  1559. time = metinSlot[2]
  1560. self.AppendSpace(5)
  1561. affectText = self.__GetAffectString(affectType, affectValue)
  1562.  
  1563. self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1564.  
  1565. if time > 0:
  1566. minute = (time / 60)
  1567. second = (time % 60)
  1568. timeString = localeInfo.TOOLTIP_POTION_TIME
  1569.  
  1570. if minute > 0:
  1571. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1572. if second > 0:
  1573. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1574.  
  1575. self.AppendTextLine(timeString)
  1576. else:
  1577. self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME)
  1578. else:
  1579. self.AppendTextLine("BLEND_POTION_NO_INFO")
  1580.  
  1581. elif item.ITEM_TYPE_UNIQUE == itemType:
  1582. if 0 != metinSlot:
  1583. bHasRealtimeFlag = 0
  1584.  
  1585. for i in xrange(item.LIMIT_MAX_NUM):
  1586. (limitType, limitValue) = item.GetLimit(i)
  1587.  
  1588. if item.LIMIT_REAL_TIME == limitType:
  1589. bHasRealtimeFlag = 1
  1590.  
  1591. if 1 == bHasRealtimeFlag:
  1592. self.AppendMallItemLastTime(metinSlot[0])
  1593. else:
  1594. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1595.  
  1596. if 1 == item.GetValue(2): ## ½Ç½Ã°£ ÀÌ¿ë Flag / ÀåÂø ¾ÈÇصµ ÁØ´Ù
  1597. self.AppendMallItemLastTime(time)
  1598. else:
  1599. self.AppendUniqueItemLastTime(time)
  1600.  
  1601. elif item.ITEM_TYPE_RING == itemType:
  1602. if 0 != metinSlot:
  1603. bHasRealtimeFlag = 0
  1604.  
  1605. for i in xrange(item.LIMIT_MAX_NUM):
  1606. (limitType, limitValue) = item.GetLimit(i)
  1607.  
  1608. if item.LIMIT_REAL_TIME == limitType:
  1609. bHasRealtimeFlag = 1
  1610.  
  1611. if 1 == bHasRealtimeFlag:
  1612. self.AppendMallItemLastTime(metinSlot[0])
  1613. else:
  1614. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1615.  
  1616. if 1 == item.GetValue(2): ## ??? ?? Flag / ?? ??? ??
  1617. self.AppendMallItemLastTime(time)
  1618. else:
  1619. self.AppendUniqueItemLastTime(time)
  1620.  
  1621. ### Use ###
  1622. elif item.ITEM_TYPE_USE == itemType:
  1623. self.__AppendLimitInformation()
  1624.  
  1625. if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1626. self.__AppendPotionInformation()
  1627.  
  1628. elif item.USE_ABILITY_UP == itemSubType:
  1629. self.__AppendAbilityPotionInformation()
  1630.  
  1631.  
  1632. ## ¿µ¼® °¨Áö±â
  1633. if 27989 == itemVnum or 76006 == itemVnum:
  1634. if 0 != metinSlot:
  1635. useCount = int(metinSlot[0])
  1636.  
  1637. self.AppendSpace(5)
  1638. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR)
  1639.  
  1640. ## À̺¥Æ® °¨Áö±â
  1641. elif 50004 == itemVnum:
  1642. if 0 != metinSlot:
  1643. useCount = int(metinSlot[0])
  1644.  
  1645. self.AppendSpace(5)
  1646. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1647.  
  1648. ## ÀÚµ¿¹°¾à
  1649. elif constInfo.IS_AUTO_POTION(itemVnum):
  1650. if 0 != metinSlot:
  1651. ## 0: È°¼ºÈ­, 1: »ç¿ë·®, 2: ÃÑ·®
  1652. isActivated = int(metinSlot[0])
  1653. usedAmount = float(metinSlot[1])
  1654. totalAmount = float(metinSlot[2])
  1655.  
  1656. if 0 == totalAmount:
  1657. totalAmount = 1
  1658.  
  1659. self.AppendSpace(5)
  1660.  
  1661. if 0 != isActivated:
  1662. self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1663. self.AppendSpace(5)
  1664.  
  1665. self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1666.  
  1667. ## ±Íȯ ±â¾ïºÎ
  1668. elif itemVnum in WARP_SCROLLS:
  1669. if 0 != metinSlot:
  1670. xPos = int(metinSlot[0])
  1671. yPos = int(metinSlot[1])
  1672.  
  1673. if xPos != 0 and yPos != 0:
  1674. (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1675.  
  1676. localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1677.  
  1678. self.AppendSpace(5)
  1679.  
  1680. if localeMapName!="":
  1681. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1682. else:
  1683. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1684. dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1685.  
  1686.  
  1687. if 79000 == itemVnum:
  1688. if 0 != metinSlot:
  1689. useCount = int(metinSlot[0])
  1690.  
  1691. self.AppendSpace(5)
  1692. self.AppendTextLine("Bufflevel: [Meister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1693. self.AppendTextLine("Bufftyp: Damagewiederstand (Nahkampf)" , self.ITEM_BUFF_TYPE_COLOR)
  1694. self.AppendTextLine("Buffrate: 24%" , self.ITEM_BUFF_RATE_COLOR)
  1695. self.AppendTextLine("Buffdauer: 164" , self.ITEM_BUFF_DURATION_COLOR)
  1696. self.AppendTextLine("Übrige buffs: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1697.  
  1698.  
  1699. if 79001 == itemVnum:
  1700. if 0 != metinSlot:
  1701. useCount = int(metinSlot[0])
  1702.  
  1703. self.AppendSpace(5)
  1704. self.AppendTextLine("Bufflevel: [Großmeister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1705. self.AppendTextLine("Bufftyp: Damagewiederstand (Nahkampf)" , self.ITEM_BUFF_TYPE_COLOR)
  1706. self.AppendTextLine("Buffrate: 29%" , self.ITEM_BUFF_RATE_COLOR)
  1707. self.AppendTextLine("Buffdauer: 224 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1708. self.AppendTextLine("Übrige buffs: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1709.  
  1710. if 79002 == itemVnum:
  1711. if 0 != metinSlot:
  1712. useCount = int(metinSlot[0])
  1713.  
  1714. self.AppendSpace(5)
  1715. self.AppendTextLine("Bufflevel: [Perfektmeister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1716. self.AppendTextLine("Bufftyp: Damagewiederstand (Nahkampf)" , self.ITEM_BUFF_TYPE_COLOR)
  1717. self.AppendTextLine("Buffrate: 35%" , self.ITEM_BUFF_RATE_COLOR)
  1718. self.AppendTextLine("Buffdauer: 310 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1719. self.AppendTextLine("Übrige buffs: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1720.  
  1721. if 79003 == itemVnum:
  1722. if 0 != metinSlot:
  1723. useCount = int(metinSlot[0])
  1724.  
  1725. self.AppendSpace(5)
  1726. self.AppendTextLine("Bufflevel: [Meister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1727. self.AppendTextLine("Bufftyp: Chance auf Krit. Treffer" , self.ITEM_BUFF_TYPE_COLOR)
  1728. self.AppendTextLine("Buffrate: 24%" , self.ITEM_BUFF_RATE_COLOR)
  1729. self.AppendTextLine("Buffdauer: 110 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1730. self.AppendTextLine("Übrige buffs: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1731.  
  1732.  
  1733. if 79004 == itemVnum:
  1734. if 0 != metinSlot:
  1735. useCount = int(metinSlot[0])
  1736.  
  1737. self.AppendSpace(5)
  1738. self.AppendTextLine("Bufflevel: [Großmeister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1739. self.AppendTextLine("Bufftyp: Chance auf Krit. Treffer" , self.ITEM_BUFF_TYPE_COLOR)
  1740. self.AppendTextLine("Buffrate: 29%" , self.ITEM_BUFF_RATE_COLOR)
  1741. self.AppendTextLine("Buffdauer: 142 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1742. self.AppendTextLine("Übrige buffs: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1743.  
  1744. if 79005 == itemVnum:
  1745. if 0 != metinSlot:
  1746. useCount = int(metinSlot[0])
  1747.  
  1748. self.AppendSpace(5)
  1749. self.AppendTextLine("Bufflevel: [Perfektmeister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1750. self.AppendTextLine("Bufftyp: Chance auf Krit. Treffer" , self.ITEM_BUFF_TYPE_COLOR)
  1751. self.AppendTextLine("Buffrate: 35%" , self.ITEM_BUFF_RATE_COLOR)
  1752. self.AppendTextLine("Buffdauer: 185 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1753. self.AppendTextLine("Übrige buffs: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1754.  
  1755. if 79006 == itemVnum:
  1756. if 0 != metinSlot:
  1757. useCount = int(metinSlot[0])
  1758.  
  1759. self.AppendSpace(5)
  1760. self.AppendTextLine("Bufflevel: [Meister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1761. self.AppendTextLine("Bufftyp: Nahkampfschaden reflektieren" , self.ITEM_BUFF_TYPE_COLOR)
  1762. self.AppendTextLine("Buffrate: 21%" , self.ITEM_BUFF_RATE_COLOR)
  1763. self.AppendTextLine("Buffdauer: 160 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1764. self.AppendTextLine("Übrige buffs: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1765.  
  1766.  
  1767. if 79007 == itemVnum:
  1768. if 0 != metinSlot:
  1769. useCount = int(metinSlot[0])
  1770.  
  1771. self.AppendSpace(5)
  1772. self.AppendTextLine("Bufflevel: [Großmeister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1773. self.AppendTextLine("Bufftyp: Nahkampfschaden reflektieren" , self.ITEM_BUFF_TYPE_COLOR)
  1774. self.AppendTextLine("Buffrate: 31%" , self.ITEM_BUFF_RATE_COLOR)
  1775. self.AppendTextLine("Buffdauer: 224 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1776. self.AppendTextLine("Übrige buffs: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1777.  
  1778. if 79008 == itemVnum:
  1779. if 0 != metinSlot:
  1780. useCount = int(metinSlot[0])
  1781.  
  1782. self.AppendSpace(5)
  1783. self.AppendTextLine("Bufflevel: [Perfektmeister]" , self.ITEM_BUFF_LEVEL_COLOR)
  1784. self.AppendTextLine("Bufftyp: Nahkampfschaden reflektieren" , self.ITEM_BUFF_TYPE_COLOR)
  1785. self.AppendTextLine("Buffrate: 45%" , self.ITEM_BUFF_RATE_COLOR)
  1786. self.AppendTextLine("Buffdauer: 310 Sekunden" , self.ITEM_BUFF_DURATION_COLOR)
  1787. self.AppendTextLine("Übrige buffs: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  1788.  
  1789. #####
  1790. if item.USE_SPECIAL == itemSubType:
  1791. bHasRealtimeFlag = 0
  1792. for i in xrange(item.LIMIT_MAX_NUM):
  1793. (limitType, limitValue) = item.GetLimit(i)
  1794.  
  1795. if item.LIMIT_REAL_TIME == limitType:
  1796. bHasRealtimeFlag = 1
  1797.  
  1798. ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ
  1799. if 1 == bHasRealtimeFlag:
  1800. self.AppendMallItemLastTime(metinSlot[0])
  1801. else:
  1802. # ... ÀÌ°Å... ¼­¹ö¿¡´Â ÀÌ·± ½Ã°£ üũ ¾ÈµÇ¾î Àִµ¥...
  1803. # ¿Ö ÀÌ·±°Ô ÀÖ´ÂÁö ¾ËÁö´Â ¸øÇϳª ±×³É µÎÀÚ...
  1804. if 0 != metinSlot:
  1805. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1806.  
  1807. ## ½Ç½Ã°£ ÀÌ¿ë Flag
  1808. if 1 == item.GetValue(2):
  1809. self.AppendMallItemLastTime(time)
  1810.  
  1811. elif item.USE_TIME_CHARGE_PER == itemSubType:
  1812. bHasRealtimeFlag = 0
  1813. for i in xrange(item.LIMIT_MAX_NUM):
  1814. (limitType, limitValue) = item.GetLimit(i)
  1815.  
  1816. if item.LIMIT_REAL_TIME == limitType:
  1817. bHasRealtimeFlag = 1
  1818. if metinSlot[2]:
  1819. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  1820. else:
  1821. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  1822.  
  1823. ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ
  1824. if 1 == bHasRealtimeFlag:
  1825. self.AppendMallItemLastTime(metinSlot[0])
  1826.  
  1827. elif item.USE_TIME_CHARGE_FIX == itemSubType:
  1828. bHasRealtimeFlag = 0
  1829. for i in xrange(item.LIMIT_MAX_NUM):
  1830. (limitType, limitValue) = item.GetLimit(i)
  1831.  
  1832. if item.LIMIT_REAL_TIME == limitType:
  1833. bHasRealtimeFlag = 1
  1834. if metinSlot[2]:
  1835. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  1836. else:
  1837. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  1838.  
  1839. ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ
  1840. if 1 == bHasRealtimeFlag:
  1841. self.AppendMallItemLastTime(metinSlot[0])
  1842.  
  1843. elif item.ITEM_TYPE_QUEST == itemType:
  1844. for i in xrange(item.LIMIT_MAX_NUM):
  1845. (limitType, limitValue) = item.GetLimit(i)
  1846.  
  1847. if item.LIMIT_REAL_TIME == limitType:
  1848. self.AppendMallItemLastTime(metinSlot[0])
  1849. elif item.ITEM_TYPE_DS == itemType:
  1850. self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1851. self.__AppendAttributeInformation(attrSlot)
  1852. else:
  1853. self.__AppendLimitInformation()
  1854.  
  1855. for i in xrange(item.LIMIT_MAX_NUM):
  1856. (limitType, limitValue) = item.GetLimit(i)
  1857. #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue))
  1858.  
  1859. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1860. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1861. #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ")
  1862.  
  1863. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1864. self.AppendTimerBasedOnWearLastTime(metinSlot)
  1865. #dbg.TraceError("1) REAL_TIME flag On ")
  1866.  
  1867. self.ShowToolTip()
  1868.  
  1869. def __DragonSoulInfoString (self, dwVnum):
  1870. step = (dwVnum / 100) % 10
  1871. refine = (dwVnum / 10) % 10
  1872. if 0 == step:
  1873. return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1874. elif 1 == step:
  1875. return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1876. elif 2 == step:
  1877. return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1878. elif 3 == step:
  1879. return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1880. elif 4 == step:
  1881. return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1882. else:
  1883. return ""
  1884.  
  1885.  
  1886. ## Çì¾îÀΰ¡?
  1887. def __IsHair(self, itemVnum):
  1888. return (self.__IsOldHair(itemVnum) or
  1889. self.__IsNewHair(itemVnum) or
  1890. self.__IsNewHair2(itemVnum) or
  1891. self.__IsNewHair3(itemVnum) or
  1892. self.__IsCostumeHair(itemVnum)
  1893. )
  1894.  
  1895. def __IsOldHair(self, itemVnum):
  1896. return itemVnum > 73000 and itemVnum < 74000
  1897.  
  1898. def __IsNewHair(self, itemVnum):
  1899. return itemVnum > 74000 and itemVnum < 75000
  1900.  
  1901. def __IsNewHair2(self, itemVnum):
  1902. return itemVnum > 75000 and itemVnum < 76000
  1903.  
  1904. def __IsNewHair3(self, itemVnum):
  1905. return ((74012 < itemVnum and itemVnum < 74022) or
  1906. (74262 < itemVnum and itemVnum < 74272) or
  1907. (74512 < itemVnum and itemVnum < 74522) or
  1908. (74762 < itemVnum and itemVnum < 74772) or
  1909. (45000 < itemVnum and itemVnum < 47000))
  1910.  
  1911. def __IsCostumeHair(self, itemVnum):
  1912. return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1913.  
  1914. def __AppendHairIcon(self, itemVnum):
  1915. itemImage = ui.ImageBox()
  1916. itemImage.SetParent(self)
  1917. itemImage.Show()
  1918.  
  1919. if self.__IsOldHair(itemVnum):
  1920. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1921. elif self.__IsNewHair3(itemVnum):
  1922. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1923. elif self.__IsNewHair(itemVnum): # ±âÁ¸ Çì¾î ¹øÈ£¸¦ ¿¬°á½ÃÄѼ­ »ç¿ëÇÑ´Ù. »õ·Î¿î ¾ÆÀÌÅÛÀº 1000¸¸Å­ ¹øÈ£°¡ ´Ã¾ú´Ù.
  1924. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1925. elif self.__IsNewHair2(itemVnum):
  1926. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1927. elif self.__IsCostumeHair(itemVnum):
  1928. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1929.  
  1930. itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1931. self.toolTipHeight += itemImage.GetHeight()
  1932. #self.toolTipWidth += itemImage.GetWidth()/2
  1933. self.childrenList.append(itemImage)
  1934. self.ResizeToolTip()
  1935.  
  1936. ## »çÀÌÁî°¡ Å« Description ÀÏ °æ¿ì ÅøÆÁ »çÀÌÁ Á¶Á¤ÇÑ´Ù
  1937. def __AdjustMaxWidth(self, attrSlot, desc):
  1938. newToolTipWidth = self.toolTipWidth
  1939. newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1940. newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1941. if newToolTipWidth > self.toolTipWidth:
  1942. self.toolTipWidth = newToolTipWidth
  1943. self.ResizeToolTip()
  1944.  
  1945. def __AdjustAttrMaxWidth(self, attrSlot):
  1946. if 0 == attrSlot:
  1947. return self.toolTipWidth
  1948.  
  1949. maxWidth = self.toolTipWidth
  1950. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1951. type = attrSlot[i][0]
  1952. value = attrSlot[i][1]
  1953. if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1954. if value > 0:
  1955. maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1956.  
  1957. # ATTR_CHANGE_TOOLTIP_WIDTH
  1958. #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth)
  1959. #self.ResizeToolTip()
  1960. # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH
  1961.  
  1962. return maxWidth
  1963.  
  1964. def __AdjustDescMaxWidth(self, desc):
  1965. if len(desc) < DESC_DEFAULT_MAX_COLS:
  1966. return self.toolTipWidth
  1967.  
  1968. return DESC_WESTERN_MAX_WIDTH
  1969.  
  1970. def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1971. skillName = skill.GetSkillName(skillIndex)
  1972.  
  1973. if not skillName:
  1974. return
  1975.  
  1976. if localeInfo.IsVIETNAM():
  1977. itemName = bookName + " " + skillName
  1978. else:
  1979. itemName = skillName + " " + bookName
  1980. self.SetTitle(itemName)
  1981.  
  1982. def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1983. self.AppendSpace(5)
  1984. self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1985. self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1986.  
  1987. if curEXP == maxEXP:
  1988. self.AppendSpace(5)
  1989. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1990. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1991. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1992.  
  1993.  
  1994. def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1995. self.AppendSpace(5)
  1996. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1997. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1998.  
  1999. if curEXP == maxEXP:
  2000. self.AppendSpace(5)
  2001. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  2002. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  2003. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  2004.  
  2005. def __AppendLimitInformation(self):
  2006.  
  2007. appendSpace = FALSE
  2008.  
  2009. for i in xrange(item.LIMIT_MAX_NUM):
  2010.  
  2011. (limitType, limitValue) = item.GetLimit(i)
  2012.  
  2013. if limitValue > 0:
  2014. if FALSE == appendSpace:
  2015. self.AppendSpace(5)
  2016. appendSpace = TRUE
  2017.  
  2018. else:
  2019. continue
  2020.  
  2021. if item.LIMIT_LEVEL == limitType:
  2022. color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  2023. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  2024. """
  2025. elif item.LIMIT_STR == limitType:
  2026. color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  2027. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  2028. elif item.LIMIT_DEX == limitType:
  2029. color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  2030. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  2031. elif item.LIMIT_INT == limitType:
  2032. color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  2033. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  2034. elif item.LIMIT_CON == limitType:
  2035. color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  2036. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  2037. """
  2038.  
  2039. if app.ENABLE_SOULBIND_SYSTEM:
  2040. def __AppendSealInformation(self, window_type, slotIndex):
  2041. if window_type == player.SAFEBOX:
  2042. itemSoulTime = safebox.GetItemBind(slotIndex)
  2043. elif window_type == player.MALL:
  2044. itemSoulTime = safebox.GetMallItemBind(slotIndex)
  2045. elif window_type == player.INVENTORY:
  2046. itemSoulTime = player.GetItemBind(window_type, slotIndex)
  2047. else:
  2048. return
  2049.  
  2050. if itemSoulTime == 0:
  2051. return
  2052. elif itemSoulTime == 1:
  2053. self.AppendSpace(5)
  2054. self.AppendTextLine(localeInfo.TOOLTIP_SEALED, self.NEGATIVE_COLOR)
  2055. elif itemSoulTime > 1:
  2056. self.AppendSpace(5)
  2057. hrs = itemSoulTime / 3600
  2058. itemSoulTime -= 3600 * hrs
  2059. mins = itemSoulTime / 60
  2060. itemSoulTime -= 60 * mins
  2061. self.AppendTextLine(localeInfo.TOOLTIP_UNSEAL_LEFT_TIME % (hrs, mins), self.NEGATIVE_COLOR)
  2062.  
  2063. def __GetAffectString(self, affectType, affectValue):
  2064. if 0 == affectType:
  2065. return None
  2066.  
  2067. if 0 == affectValue:
  2068. return None
  2069.  
  2070. try:
  2071. return self.AFFECT_DICT[affectType](affectValue)
  2072. except TypeError:
  2073. return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  2074. except KeyError:
  2075. return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  2076.  
  2077. def __AppendAffectInformation(self):
  2078. #self.AppendSpace(5)
  2079. #self.AppendTextLine("[Standard Boni]", self.TITLE_COLOR)
  2080. #self.AppendSpace(2)
  2081. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2082.  
  2083. (affectType, affectValue) = item.GetAffect(i)
  2084.  
  2085. affectString = self.__GetAffectString(affectType, affectValue)
  2086. if affectString:
  2087. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2088.  
  2089. def AppendWearableInformation(self):
  2090.  
  2091. self.AppendSpace(5)
  2092. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  2093.  
  2094. flagList = (
  2095. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  2096. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  2097. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  2098. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
  2099.  
  2100. characterNames = ""
  2101. for i in xrange(self.CHARACTER_COUNT):
  2102.  
  2103. name = self.CHARACTER_NAMES[i]
  2104. flag = flagList[i]
  2105.  
  2106. if flag:
  2107. characterNames += " "
  2108. characterNames += name
  2109.  
  2110. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, TRUE)
  2111. textLine.SetFeather()
  2112.  
  2113. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  2114. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, TRUE)
  2115. textLine.SetFeather()
  2116.  
  2117. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  2118. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, TRUE)
  2119. textLine.SetFeather()
  2120.  
  2121. def __AppendPotionInformation(self):
  2122. self.AppendSpace(5)
  2123.  
  2124. healHP = item.GetValue(0)
  2125. healSP = item.GetValue(1)
  2126. healStatus = item.GetValue(2)
  2127. healPercentageHP = item.GetValue(3)
  2128. healPercentageSP = item.GetValue(4)
  2129.  
  2130. if healHP > 0:
  2131. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  2132. if healSP > 0:
  2133. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  2134. if healStatus != 0:
  2135. self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  2136. if healPercentageHP > 0:
  2137. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  2138. if healPercentageSP > 0:
  2139. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  2140.  
  2141. def __AppendAbilityPotionInformation(self):
  2142.  
  2143. self.AppendSpace(5)
  2144.  
  2145. abilityType = item.GetValue(0)
  2146. time = item.GetValue(1)
  2147. point = item.GetValue(2)
  2148.  
  2149. if abilityType == item.APPLY_ATT_SPEED:
  2150. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  2151. elif abilityType == item.APPLY_MOV_SPEED:
  2152. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  2153.  
  2154. if time > 0:
  2155. minute = (time / 60)
  2156. second = (time % 60)
  2157. timeString = localeInfo.TOOLTIP_POTION_TIME
  2158.  
  2159. if minute > 0:
  2160. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  2161. if second > 0:
  2162. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  2163.  
  2164. self.AppendTextLine(timeString)
  2165.  
  2166. def GetPriceColor(self, price):
  2167. if price>=constInfo.HIGH_PRICE:
  2168. return self.HIGH_PRICE_COLOR
  2169. if price>=constInfo.MIDDLE_PRICE:
  2170. return self.MIDDLE_PRICE_COLOR
  2171. else:
  2172. return self.LOW_PRICE_COLOR
  2173.  
  2174. def AppendPrice(self, price):
  2175. self.AppendSpace(5)
  2176. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  2177.  
  2178. def AppendSellingPrice(self, price):
  2179. if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
  2180. self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  2181. self.AppendSpace(5)
  2182. else:
  2183. self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  2184. self.AppendSpace(5)
  2185.  
  2186. def AppendMetinInformation(self):
  2187. affectType, affectValue = item.GetAffect(0)
  2188. #affectType = item.GetValue(0)
  2189. #affectValue = item.GetValue(1)
  2190.  
  2191. affectString = self.__GetAffectString(affectType, affectValue)
  2192.  
  2193. if affectString:
  2194. self.AppendSpace(5)
  2195. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2196.  
  2197. def AppendMetinWearInformation(self):
  2198.  
  2199. self.AppendSpace(5)
  2200. self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  2201.  
  2202. flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  2203. item.IsWearableFlag(item.WEARABLE_HEAD),
  2204. item.IsWearableFlag(item.WEARABLE_FOOTS),
  2205. item.IsWearableFlag(item.WEARABLE_WRIST),
  2206. item.IsWearableFlag(item.WEARABLE_WEAPON),
  2207. item.IsWearableFlag(item.WEARABLE_NECK),
  2208. item.IsWearableFlag(item.WEARABLE_EAR),
  2209. item.IsWearableFlag(item.WEARABLE_UNIQUE),
  2210. item.IsWearableFlag(item.WEARABLE_SHIELD),
  2211. item.IsWearableFlag(item.WEARABLE_ARROW))
  2212.  
  2213. wearNames = ""
  2214. for i in xrange(self.WEAR_COUNT):
  2215.  
  2216. name = self.WEAR_NAMES[i]
  2217. flag = flagList[i]
  2218.  
  2219. if flag:
  2220. wearNames += " "
  2221. wearNames += name
  2222.  
  2223. textLine = ui.TextLine()
  2224. textLine.SetParent(self)
  2225. textLine.SetFontName(self.defFontName)
  2226. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  2227. textLine.SetHorizontalAlignCenter()
  2228. textLine.SetPackedFontColor(self.NORMAL_COLOR)
  2229. textLine.SetText(wearNames)
  2230. textLine.Show()
  2231. self.childrenList.append(textLine)
  2232.  
  2233. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  2234. self.ResizeToolTip()
  2235.  
  2236. def GetMetinSocketType(self, number):
  2237. if player.METIN_SOCKET_TYPE_NONE == number:
  2238. return player.METIN_SOCKET_TYPE_NONE
  2239. elif player.METIN_SOCKET_TYPE_SILVER == number:
  2240. return player.METIN_SOCKET_TYPE_SILVER
  2241. elif player.METIN_SOCKET_TYPE_GOLD == number:
  2242. return player.METIN_SOCKET_TYPE_GOLD
  2243. else:
  2244. item.SelectItem(number)
  2245. if item.METIN_NORMAL == item.GetItemSubType():
  2246. return player.METIN_SOCKET_TYPE_SILVER
  2247. elif item.METIN_GOLD == item.GetItemSubType():
  2248. return player.METIN_SOCKET_TYPE_GOLD
  2249. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  2250. return player.METIN_SOCKET_TYPE_SILVER
  2251. elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  2252. return player.METIN_SOCKET_TYPE_SILVER
  2253.  
  2254. return player.METIN_SOCKET_TYPE_NONE
  2255.  
  2256. def GetMetinItemIndex(self, number):
  2257. if player.METIN_SOCKET_TYPE_SILVER == number:
  2258. return 0
  2259. if player.METIN_SOCKET_TYPE_GOLD == number:
  2260. return 0
  2261.  
  2262. return number
  2263.  
  2264. def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
  2265. ACCESSORY_SOCKET_MAX_SIZE = 3
  2266.  
  2267. cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  2268. end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  2269.  
  2270. affectType1, affectValue1 = item.GetAffect(0)
  2271. affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  2272.  
  2273. affectType2, affectValue2 = item.GetAffect(1)
  2274. affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  2275.  
  2276. mtrlPos=0
  2277. mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  2278. for mtrl in mtrlList:
  2279. affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
  2280. affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  2281.  
  2282. leftTime = 0
  2283. if cur == mtrlPos+1:
  2284. leftTime=metinSlot[2]
  2285.  
  2286. self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  2287. mtrlPos+=1
  2288.  
  2289. def __AppendMetinSlotInfo(self, metinSlot):
  2290. if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  2291. return
  2292.  
  2293. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2294. self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  2295.  
  2296. def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  2297. if 0 == metinSlot:
  2298. return 1
  2299.  
  2300. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2301. metinSlotData=metinSlot[i]
  2302. if 0 != self.GetMetinSocketType(metinSlotData):
  2303. if 0 != self.GetMetinItemIndex(metinSlotData):
  2304. return 0
  2305.  
  2306. return 1
  2307.  
  2308. def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  2309.  
  2310. slotType = self.GetMetinSocketType(metinSlotData)
  2311. itemIndex = self.GetMetinItemIndex(metinSlotData)
  2312.  
  2313. if 0 == slotType:
  2314. return
  2315.  
  2316. self.AppendSpace(5)
  2317.  
  2318. slotImage = ui.ImageBox()
  2319. slotImage.SetParent(self)
  2320. slotImage.Show()
  2321.  
  2322. ## Name
  2323. nameTextLine = ui.TextLine()
  2324. nameTextLine.SetParent(self)
  2325. nameTextLine.SetFontName(self.defFontName)
  2326. nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  2327. nameTextLine.SetOutline()
  2328. nameTextLine.SetFeather()
  2329. nameTextLine.Show()
  2330.  
  2331. self.childrenList.append(nameTextLine)
  2332.  
  2333. if player.METIN_SOCKET_TYPE_SILVER == slotType:
  2334. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  2335. elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  2336. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  2337.  
  2338. self.childrenList.append(slotImage)
  2339.  
  2340. if localeInfo.IsARABIC():
  2341. slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  2342. nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  2343. else:
  2344. slotImage.SetPosition(9, self.toolTipHeight-1)
  2345. nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  2346.  
  2347. metinImage = ui.ImageBox()
  2348. metinImage.SetParent(self)
  2349. metinImage.Show()
  2350. self.childrenList.append(metinImage)
  2351.  
  2352. if itemIndex:
  2353.  
  2354. item.SelectItem(itemIndex)
  2355.  
  2356. ## Image
  2357. try:
  2358. metinImage.LoadImage(item.GetIconImageFileName())
  2359. except:
  2360. dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  2361. (itemIndex, item.GetIconImageFileName())
  2362. )
  2363.  
  2364. nameTextLine.SetText(item.GetItemName())
  2365.  
  2366. ## Affect
  2367. affectTextLine = ui.TextLine()
  2368. affectTextLine.SetParent(self)
  2369. affectTextLine.SetFontName(self.defFontName)
  2370. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2371. affectTextLine.SetOutline()
  2372. affectTextLine.SetFeather()
  2373. affectTextLine.Show()
  2374.  
  2375. if localeInfo.IsARABIC():
  2376. metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  2377. affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  2378. else:
  2379. metinImage.SetPosition(10, self.toolTipHeight)
  2380. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  2381.  
  2382. if custumAffectString:
  2383. affectTextLine.SetText(custumAffectString)
  2384. elif itemIndex!=constInfo.ERROR_METIN_STONE:
  2385. affectType, affectValue = item.GetAffect(0)
  2386. affectString = self.__GetAffectString(affectType, affectValue)
  2387. if affectString:
  2388. affectTextLine.SetText(affectString)
  2389. else:
  2390. affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  2391.  
  2392. self.childrenList.append(affectTextLine)
  2393.  
  2394. if custumAffectString2:
  2395. affectTextLine = ui.TextLine()
  2396. affectTextLine.SetParent(self)
  2397. affectTextLine.SetFontName(self.defFontName)
  2398. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2399. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2400. affectTextLine.SetOutline()
  2401. affectTextLine.SetFeather()
  2402. affectTextLine.Show()
  2403. affectTextLine.SetText(custumAffectString2)
  2404. self.childrenList.append(affectTextLine)
  2405. self.toolTipHeight += 16 + 2
  2406.  
  2407. if 0 != leftTime:
  2408. timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  2409.  
  2410. timeTextLine = ui.TextLine()
  2411. timeTextLine.SetParent(self)
  2412. timeTextLine.SetFontName(self.defFontName)
  2413. timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2414. timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2415. timeTextLine.SetOutline()
  2416. timeTextLine.SetFeather()
  2417. timeTextLine.Show()
  2418. timeTextLine.SetText(timeText)
  2419. self.childrenList.append(timeTextLine)
  2420. self.toolTipHeight += 16 + 2
  2421.  
  2422. else:
  2423. nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  2424.  
  2425. self.toolTipHeight += 35
  2426. self.ResizeToolTip()
  2427.  
  2428. def __AppendFishInfo(self, size):
  2429. if size > 0:
  2430. self.AppendSpace(5)
  2431. self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  2432.  
  2433. def AppendUniqueItemLastTime(self, restMin):
  2434. restSecond = restMin*60
  2435. self.AppendSpace(5)
  2436. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  2437.  
  2438. def AppendMallItemLastTime(self, endTime):
  2439. leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  2440. self.AppendSpace(5)
  2441. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  2442.  
  2443. def AppendTimerBasedOnWearLastTime(self, metinSlot):
  2444. if 0 == metinSlot[0]:
  2445. self.AppendSpace(5)
  2446. self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  2447. else:
  2448. endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  2449. self.AppendMallItemLastTime(endTime)
  2450.  
  2451. def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):
  2452. useCount = metinSlot[1]
  2453. endTime = metinSlot[0]
  2454.  
  2455. # ÇÑ ¹øÀÌ¶óµµ »ç¿ëÇß´Ù¸é Socket0¿¡ Á¾·á ½Ã°£(2012³â 3¿ù 1ÀÏ 13½Ã 01ºÐ °°Àº..) ÀÌ ¹ÚÇôÀÖÀ½.
  2456. # »ç¿ëÇÏÁö ¾Ê¾Ò´Ù¸é Socket0¿¡ ÀÌ¿ë°¡´É½Ã°£(À̸¦Å׸é 600 °°Àº °ª. ÃÊ´ÜÀ§)ÀÌ µé¾îÀÖÀ» ¼ö ÀÖ°í, 0À̶ó¸é Limit Value¿¡ ÀÖ´Â ÀÌ¿ë°¡´É½Ã°£À» »ç¿ëÇÑ´Ù.
  2457. if 0 == useCount:
  2458. if 0 == endTime:
  2459. (limitType, limitValue) = item.GetLimit(limitIndex)
  2460. endTime = limitValue
  2461.  
  2462. endTime += app.GetGlobalTimeStamp()
  2463.  
  2464. self.AppendMallItemLastTime(endTime)
  2465.  
  2466. if app.ENABLE_SASH_SYSTEM:
  2467. def SetSashResultItem(self, slotIndex, window_type = player.INVENTORY):
  2468. (itemVnum, MinAbs, MaxAbs) = sash.GetResultItem()
  2469. if not itemVnum:
  2470. return
  2471.  
  2472. self.ClearToolTip()
  2473.  
  2474. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2475. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2476.  
  2477. item.SelectItem(itemVnum)
  2478. itemType = item.GetItemType()
  2479. itemSubType = item.GetItemSubType()
  2480. if itemType != 28 and itemSubType != 3:
  2481. return
  2482.  
  2483. absChance = MaxAbs
  2484. itemDesc = item.GetItemDescription()
  2485. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2486. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  2487. self.AppendDescription(itemDesc, 26)
  2488. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  2489. self.__AppendLimitInformation()
  2490.  
  2491. ## ABSORPTION RATE
  2492. if MinAbs == MaxAbs:
  2493. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (MinAbs), self.CONDITION_COLOR)
  2494. else:
  2495. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE2 % (MinAbs, MaxAbs), self.CONDITION_COLOR)
  2496. ## END ABSOPRTION RATE
  2497.  
  2498. itemAbsorbedVnum = int(metinSlot[sash.ABSORBED_SOCKET])
  2499. if itemAbsorbedVnum:
  2500. ## ATTACK / DEFENCE
  2501. item.SelectItem(itemAbsorbedVnum)
  2502. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  2503. if item.GetItemSubType() == item.WEAPON_FAN:
  2504. self.__AppendMagicAttackInfo(absChance)
  2505. item.SelectItem(itemAbsorbedVnum)
  2506. self.__AppendAttackPowerInfo(absChance)
  2507. else:
  2508. self.__AppendAttackPowerInfo(absChance)
  2509. item.SelectItem(itemAbsorbedVnum)
  2510. self.__AppendMagicAttackInfo(absChance)
  2511. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2512. defGrade = item.GetValue(1)
  2513. defBonus = item.GetValue(5) * 2
  2514. defGrade = self.CalcSashValue(defGrade, absChance)
  2515. defBonus = self.CalcSashValue(defBonus, absChance)
  2516.  
  2517. if defGrade > 0:
  2518. self.AppendSpace(5)
  2519. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  2520.  
  2521. item.SelectItem(itemAbsorbedVnum)
  2522. self.__AppendMagicDefenceInfo(absChance)
  2523. ## END ATTACK / DEFENCE
  2524.  
  2525. ## EFFECT
  2526. item.SelectItem(itemAbsorbedVnum)
  2527. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2528. (affectType, affectValue) = item.GetAffect(i)
  2529. affectValue = self.CalcSashValue(affectValue, absChance)
  2530. affectString = self.__GetAffectString(affectType, affectValue)
  2531. if affectString and affectValue > 0:
  2532. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2533.  
  2534. item.SelectItem(itemAbsorbedVnum)
  2535. # END EFFECT
  2536.  
  2537. item.SelectItem(itemVnum)
  2538. ## ATTR
  2539. self.__AppendAttributeInformation(attrSlot, MaxAbs)
  2540. # END ATTR
  2541.  
  2542. self.AppendWearableInformation()
  2543. self.ShowToolTip()
  2544.  
  2545. def SetSashResultAbsItem(self, slotIndex1, slotIndex2, window_type = player.INVENTORY):
  2546. itemVnumSash = player.GetItemIndex(window_type, slotIndex1)
  2547. itemVnumTarget = player.GetItemIndex(window_type, slotIndex2)
  2548. if not itemVnumSash or not itemVnumTarget:
  2549. return
  2550.  
  2551. self.ClearToolTip()
  2552.  
  2553. item.SelectItem(itemVnumSash)
  2554. itemType = item.GetItemType()
  2555. itemSubType = item.GetItemSubType()
  2556. if itemType != 28 and itemSubType != 3:
  2557. return
  2558.  
  2559. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex1, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2560. attrSlot = [player.GetItemAttribute(window_type, slotIndex2, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2561.  
  2562. itemDesc = item.GetItemDescription()
  2563. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2564. self.__SetItemTitle(itemVnumSash, metinSlot, attrSlot)
  2565. self.AppendDescription(itemDesc, 26)
  2566. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  2567. item.SelectItem(itemVnumSash)
  2568. self.__AppendLimitInformation()
  2569.  
  2570. ## ABSORPTION RATE
  2571. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (metinSlot[sash.ABSORPTION_SOCKET]), self.CONDITION_COLOR)
  2572. ## END ABSOPRTION RATE
  2573.  
  2574. ## ATTACK / DEFENCE
  2575. itemAbsorbedVnum = itemVnumTarget
  2576. item.SelectItem(itemAbsorbedVnum)
  2577. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  2578. if item.GetItemSubType() == item.WEAPON_FAN:
  2579. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2580. item.SelectItem(itemAbsorbedVnum)
  2581. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2582. else:
  2583. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2584. item.SelectItem(itemAbsorbedVnum)
  2585. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2586. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2587. defGrade = item.GetValue(1)
  2588. defBonus = item.GetValue(5) * 2
  2589. defGrade = self.CalcSashValue(defGrade, metinSlot[sash.ABSORPTION_SOCKET])
  2590. defBonus = self.CalcSashValue(defBonus, metinSlot[sash.ABSORPTION_SOCKET])
  2591.  
  2592. if defGrade > 0:
  2593. self.AppendSpace(5)
  2594. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  2595.  
  2596. item.SelectItem(itemAbsorbedVnum)
  2597. self.__AppendMagicDefenceInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2598. ## END ATTACK / DEFENCE
  2599.  
  2600. ## EFFECT
  2601. item.SelectItem(itemAbsorbedVnum)
  2602. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2603. (affectType, affectValue) = item.GetAffect(i)
  2604. affectValue = self.CalcSashValue(affectValue, metinSlot[sash.ABSORPTION_SOCKET])
  2605. affectString = self.__GetAffectString(affectType, affectValue)
  2606. if affectString and affectValue > 0:
  2607. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2608.  
  2609. item.SelectItem(itemAbsorbedVnum)
  2610. ## END EFFECT
  2611.  
  2612. ## ATTR
  2613. item.SelectItem(itemAbsorbedVnum)
  2614. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  2615. type = attrSlot[i][0]
  2616. value = attrSlot[i][1]
  2617. if not value:
  2618. continue
  2619.  
  2620. value = self.CalcSashValue(value, metinSlot[sash.ABSORPTION_SOCKET])
  2621. affectString = self.__GetAffectString(type, value)
  2622. if affectString and value > 0:
  2623. affectColor = self.__GetAttributeColor(i, value)
  2624. self.AppendTextLine(affectString, affectColor)
  2625.  
  2626. item.SelectItem(itemAbsorbedVnum)
  2627. ## END ATTR
  2628.  
  2629. ## WEARABLE
  2630. item.SelectItem(itemVnumSash)
  2631. self.AppendSpace(5)
  2632. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  2633.  
  2634. item.SelectItem(itemVnumSash)
  2635. flagList = (
  2636. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  2637. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  2638. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  2639. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN)
  2640. )
  2641.  
  2642. characterNames = ""
  2643. for i in xrange(self.CHARACTER_COUNT):
  2644. name = self.CHARACTER_NAMES[i]
  2645. flag = flagList[i]
  2646. if flag:
  2647. characterNames += " "
  2648. characterNames += name
  2649.  
  2650. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  2651. textLine.SetFeather()
  2652.  
  2653. item.SelectItem(itemVnumSash)
  2654. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  2655. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  2656. textLine.SetFeather()
  2657.  
  2658. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  2659. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  2660. textLine.SetFeather()
  2661. ## END WEARABLE
  2662.  
  2663. self.ShowToolTip()
  2664.  
  2665. class HyperlinkItemToolTip(ItemToolTip):
  2666. def __init__(self):
  2667. ItemToolTip.__init__(self, isPickable=TRUE)
  2668. def SetHyperlinkItem(self, tokens):
  2669.  
  2670. #logging.basicConfig(filename='log_filename.txt',
  2671. #level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
  2672. #logging.debug(', '.join(tokens))
  2673.  
  2674. minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
  2675. #if app.ENABLE_CHANGE_LOOK_SYSTEM:
  2676. # minTokenCount += 1
  2677. maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  2678. if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  2679. head, vnum, flag = tokens[:3]
  2680. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  2681. itemVnum = str(vnum)
  2682. else:
  2683. itemVnum = int(vnum, 16)
  2684. metinSlot = [int(metin, 16) for metin in tokens[3:6]]
  2685. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  2686. abc = itemVnum.split("|")
  2687. itemVnum = int(abc[0], 16)
  2688. lookvnum = int(abc[1]) #hier ist die genannte stelle "2483"
  2689. rests = tokens[6:]
  2690. if rests:
  2691. attrSlot = []
  2692. rests.reverse()
  2693. while rests:
  2694. key = int(rests.pop(), 16)
  2695. if rests:
  2696. val = int(rests.pop())
  2697. attrSlot.append((key, val))
  2698. attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  2699. else:
  2700. attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  2701. self.ClearToolTip()
  2702. #unten alles gut
  2703. if app.ENABLE_CHANGE_LOOK_SYSTEM:
  2704. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, 0, player.GLASS, lookvnum)
  2705. else:
  2706. self.AddItemData(itemVnum, metinSlot, attrSlot)
  2707. ItemToolTip.OnUpdate(self)
  2708.  
  2709.  
  2710. def OnUpdate(self):
  2711. pass
  2712.  
  2713. def OnMouseLeftButtonDown(self):
  2714. self.Hide()
  2715.  
  2716. class SkillToolTip(ToolTip):
  2717.  
  2718. POINT_NAME_DICT = {
  2719. player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  2720. player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  2721. }
  2722.  
  2723. SKILL_TOOL_TIP_WIDTH = 200
  2724. PARTY_SKILL_TOOL_TIP_WIDTH = 340
  2725.  
  2726. PARTY_SKILL_EXPERIENCE_AFFECT_LIST = ( ( 2, 2, 10,),
  2727. ( 8, 3, 20,),
  2728. (14, 4, 30,),
  2729. (22, 5, 45,),
  2730. (28, 6, 60,),
  2731. (34, 7, 80,),
  2732. (38, 8, 100,), )
  2733.  
  2734. PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = ( ( 4, 2, 1, 0,),
  2735. (10, 3, 2, 0,),
  2736. (16, 4, 2, 1,),
  2737. (24, 5, 2, 2,), )
  2738.  
  2739. PARTY_SKILL_ATTACKER_AFFECT_LIST = ( ( 36, 3, ),
  2740. ( 26, 1, ),
  2741. ( 32, 2, ), )
  2742.  
  2743. SKILL_GRADE_NAME = { player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  2744. player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  2745. player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  2746.  
  2747. AFFECT_NAME_DICT = {
  2748. "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  2749. "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  2750. "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  2751. "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  2752. "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  2753. "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  2754. "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  2755. "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  2756. }
  2757. AFFECT_APPEND_TEXT_DICT = {
  2758. "DODGE" : "%",
  2759. "RESIST_NORMAL" : "%",
  2760. "REFLECT_MELEE" : "%",
  2761. }
  2762.  
  2763. def __init__(self):
  2764. ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  2765. def __del__(self):
  2766. ToolTip.__del__(self)
  2767.  
  2768. def SetSkill(self, skillIndex, skillLevel = -1):
  2769.  
  2770. if 0 == skillIndex:
  2771. return
  2772.  
  2773. if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2774.  
  2775. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2776. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2777. self.ResizeToolTip()
  2778.  
  2779. self.AppendDefaultData(skillIndex)
  2780. self.AppendSkillConditionData(skillIndex)
  2781. self.AppendGuildSkillData(skillIndex, skillLevel)
  2782.  
  2783. else:
  2784.  
  2785. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2786. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2787. self.ResizeToolTip()
  2788.  
  2789. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2790. skillGrade = player.GetSkillGrade(slotIndex)
  2791. skillLevel = player.GetSkillLevel(slotIndex)
  2792. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2793. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2794.  
  2795. self.AppendDefaultData(skillIndex)
  2796. self.AppendSkillConditionData(skillIndex)
  2797. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2798. self.AppendSkillRequirement(skillIndex, skillLevel)
  2799.  
  2800. self.ShowToolTip()
  2801.  
  2802. def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  2803.  
  2804. if 0 == skillIndex:
  2805. return
  2806.  
  2807. if player.SKILL_INDEX_TONGSOL == skillIndex:
  2808.  
  2809. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2810. skillLevel = player.GetSkillLevel(slotIndex)
  2811.  
  2812. self.AppendDefaultData(skillIndex)
  2813. self.AppendPartySkillData(skillGrade, skillLevel)
  2814.  
  2815. elif player.SKILL_INDEX_RIDING == skillIndex:
  2816.  
  2817. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2818. self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  2819.  
  2820. elif player.SKILL_INDEX_SUMMON == skillIndex:
  2821.  
  2822. maxLevel = 10
  2823.  
  2824. self.ClearToolTip()
  2825. self.__SetSkillTitle(skillIndex, skillGrade)
  2826.  
  2827. ## Description
  2828. description = skill.GetSkillDescription(skillIndex)
  2829. self.AppendDescription(description, 25)
  2830.  
  2831. if skillLevel == 10:
  2832. self.AppendSpace(5)
  2833. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2834. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  2835.  
  2836. else:
  2837. self.AppendSpace(5)
  2838. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2839. self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  2840.  
  2841. self.AppendSpace(5)
  2842. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  2843. self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  2844.  
  2845. elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2846.  
  2847. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2848. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2849. self.ResizeToolTip()
  2850.  
  2851. self.AppendDefaultData(skillIndex)
  2852. self.AppendSkillConditionData(skillIndex)
  2853. self.AppendGuildSkillData(skillIndex, skillLevel)
  2854.  
  2855. else:
  2856.  
  2857. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2858. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2859. self.ResizeToolTip()
  2860.  
  2861. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2862.  
  2863. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2864. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2865.  
  2866. self.AppendDefaultData(skillIndex, skillGrade)
  2867. self.AppendSkillConditionData(skillIndex)
  2868. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2869. self.AppendSkillRequirement(skillIndex, skillLevel)
  2870.  
  2871. self.ShowToolTip()
  2872.  
  2873. def __SetSkillTitle(self, skillIndex, skillGrade):
  2874. self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  2875. self.__AppendSkillGradeName(skillIndex, skillGrade)
  2876.  
  2877. def __AppendSkillGradeName(self, skillIndex, skillGrade):
  2878. if self.SKILL_GRADE_NAME.has_key(skillGrade):
  2879. self.AppendSpace(5)
  2880. self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  2881.  
  2882. def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  2883. if 0 == skillIndex:
  2884. return
  2885.  
  2886. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2887.  
  2888. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2889. self.ResizeToolTip()
  2890.  
  2891. self.ClearToolTip()
  2892. self.__SetSkillTitle(skillIndex, skillGrade)
  2893. self.AppendDefaultData(skillIndex, skillGrade)
  2894. self.AppendSkillConditionData(skillIndex)
  2895. self.ShowToolTip()
  2896.  
  2897. def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2898. self.ClearToolTip()
  2899. self.__SetSkillTitle(skillIndex, skillGrade)
  2900.  
  2901. ## Level Limit
  2902. levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2903. if levelLimit > 0:
  2904.  
  2905. color = self.NORMAL_COLOR
  2906. if player.GetStatus(player.LEVEL) < levelLimit:
  2907. color = self.NEGATIVE_COLOR
  2908.  
  2909. self.AppendSpace(5)
  2910. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2911.  
  2912. ## Description
  2913. description = skill.GetSkillDescription(skillIndex)
  2914. self.AppendDescription(description, 25)
  2915.  
  2916. def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2917. self.ClearToolTip()
  2918. self.__SetSkillTitle(skillIndex, skillGrade)
  2919.  
  2920. ## Description
  2921. description = skill.GetSkillDescription(skillIndex)
  2922. self.AppendDescription(description, 25)
  2923.  
  2924. if 1 == skillGrade:
  2925. skillLevel += 19
  2926. elif 2 == skillGrade:
  2927. skillLevel += 29
  2928. elif 3 == skillGrade:
  2929. skillLevel = 40
  2930.  
  2931. self.AppendSpace(5)
  2932. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2933.  
  2934. def AppendSkillConditionData(self, skillIndex):
  2935. conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2936. if conditionDataCount > 0:
  2937. self.AppendSpace(5)
  2938. for i in xrange(conditionDataCount):
  2939. self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2940.  
  2941. def AppendGuildSkillData(self, skillIndex, skillLevel):
  2942. skillMaxLevel = 7
  2943. skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2944. skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2945. ## Current Level
  2946. if skillLevel > 0:
  2947. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2948. self.AppendSpace(5)
  2949. if skillLevel == skillMaxLevel:
  2950. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2951. else:
  2952. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2953.  
  2954. #####
  2955.  
  2956. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2957. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2958.  
  2959. ## Cooltime
  2960. coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2961. if coolTime > 0:
  2962. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2963.  
  2964. ## SP
  2965. needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2966. if needGSP > 0:
  2967. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2968.  
  2969. ## Next Level
  2970. if skillLevel < skillMaxLevel:
  2971. if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2972. self.AppendSpace(5)
  2973. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2974.  
  2975. #####
  2976.  
  2977. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2978. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2979.  
  2980. ## Cooltime
  2981. coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2982. if coolTime > 0:
  2983. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2984.  
  2985. ## SP
  2986. needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2987. if needGSP > 0:
  2988. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2989.  
  2990. def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  2991.  
  2992. self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  2993. self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  2994.  
  2995. skillLevelUpPoint = 1
  2996. realSkillGrade = player.GetSkillGrade(slotIndex)
  2997. skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  2998. skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  2999.  
  3000. ## Current Level
  3001. if skillLevel > 0:
  3002. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  3003. self.AppendSpace(5)
  3004. if skillGrade == skill.SKILL_GRADE_COUNT:
  3005. pass
  3006. elif skillLevel == skillMaxLevelEnd:
  3007. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  3008. else:
  3009. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  3010. self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  3011.  
  3012. ## Next Level
  3013. if skillGrade != skill.SKILL_GRADE_COUNT:
  3014. if skillLevel < skillMaxLevelEnd:
  3015. if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  3016. self.AppendSpace(5)
  3017. ## HPº¸°­, °üÅëȸÇÇ º¸Á¶½ºÅ³ÀÇ °æ¿ì
  3018. if skillIndex == 141 or skillIndex == 142:
  3019. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  3020. else:
  3021. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  3022. self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  3023.  
  3024. def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  3025.  
  3026. affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  3027. if affectDataCount > 0:
  3028. for i in xrange(affectDataCount):
  3029. type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  3030.  
  3031. if not self.AFFECT_NAME_DICT.has_key(type):
  3032. continue
  3033.  
  3034. minValue = int(minValue)
  3035. maxValue = int(maxValue)
  3036. affectText = self.AFFECT_NAME_DICT[type]
  3037.  
  3038. if "HP" == type:
  3039. if minValue < 0 and maxValue < 0:
  3040. minValue *= -1
  3041. maxValue *= -1
  3042.  
  3043. else:
  3044. affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  3045.  
  3046. affectText += str(minValue)
  3047. if minValue != maxValue:
  3048. affectText += " - " + str(maxValue)
  3049. affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  3050.  
  3051. #import debugInfo
  3052. #if debugInfo.IsDebugMode():
  3053. # affectText = "!!" + affectText
  3054.  
  3055. self.AppendTextLine(affectText, color)
  3056.  
  3057. else:
  3058. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  3059. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  3060.  
  3061.  
  3062. ## Duration
  3063. duration = skill.GetDuration(skillIndex, skillPercentage)
  3064. if duration > 0:
  3065. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  3066.  
  3067. ## Cooltime
  3068. coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  3069. if coolTime > 0:
  3070. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  3071.  
  3072. ## SP
  3073. needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  3074. if needSP != 0:
  3075. continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  3076.  
  3077. if skill.IsUseHPSkill(skillIndex):
  3078. self.AppendNeedHP(needSP, continuationSP, color)
  3079. else:
  3080. self.AppendNeedSP(needSP, continuationSP, color)
  3081.  
  3082. def AppendSkillRequirement(self, skillIndex, skillLevel):
  3083.  
  3084. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  3085.  
  3086. if skillLevel >= skillMaxLevel:
  3087. return
  3088.  
  3089. isAppendHorizontalLine = FALSE
  3090.  
  3091. ## Requirement
  3092. if skill.IsSkillRequirement(skillIndex):
  3093.  
  3094. if not isAppendHorizontalLine:
  3095. isAppendHorizontalLine = TRUE
  3096. self.AppendHorizontalLine()
  3097.  
  3098. requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  3099.  
  3100. color = self.CANNOT_LEVEL_UP_COLOR
  3101. if skill.CheckRequirementSueccess(skillIndex):
  3102. color = self.CAN_LEVEL_UP_COLOR
  3103. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  3104.  
  3105. ## Require Stat
  3106. requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  3107. if requireStatCount > 0:
  3108.  
  3109. for i in xrange(requireStatCount):
  3110. type, level = skill.GetSkillRequireStatData(skillIndex, i)
  3111. if self.POINT_NAME_DICT.has_key(type):
  3112.  
  3113. if not isAppendHorizontalLine:
  3114. isAppendHorizontalLine = TRUE
  3115. self.AppendHorizontalLine()
  3116.  
  3117. name = self.POINT_NAME_DICT[type]
  3118. color = self.CANNOT_LEVEL_UP_COLOR
  3119. if player.GetStatus(type) >= level:
  3120. color = self.CAN_LEVEL_UP_COLOR
  3121. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  3122.  
  3123. def HasSkillLevelDescription(self, skillIndex, skillLevel):
  3124. if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  3125. return TRUE
  3126. if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  3127. return TRUE
  3128. if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  3129. return TRUE
  3130.  
  3131. return FALSE
  3132.  
  3133. def AppendMasterAffectDescription(self, index, desc, color):
  3134. self.AppendTextLine(desc, color)
  3135.  
  3136. def AppendNextAffectDescription(self, index, desc):
  3137. self.AppendTextLine(desc, self.DISABLE_COLOR)
  3138.  
  3139. def AppendNeedHP(self, needSP, continuationSP, color):
  3140.  
  3141. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  3142.  
  3143. if continuationSP > 0:
  3144. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  3145.  
  3146. def AppendNeedSP(self, needSP, continuationSP, color):
  3147.  
  3148. if -1 == needSP:
  3149. self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  3150.  
  3151. else:
  3152. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  3153.  
  3154. if continuationSP > 0:
  3155. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  3156.  
  3157. def AppendPartySkillData(self, skillGrade, skillLevel):
  3158.  
  3159. if 1 == skillGrade:
  3160. skillLevel += 19
  3161. elif 2 == skillGrade:
  3162. skillLevel += 29
  3163. elif 3 == skillGrade:
  3164. skillLevel = 40
  3165.  
  3166. if skillLevel <= 0:
  3167. return
  3168.  
  3169. skillIndex = player.SKILL_INDEX_TONGSOL
  3170. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3171. skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  3172. if localeInfo.IsBRAZIL():
  3173. k = skillPower
  3174. else:
  3175. k = player.GetSkillLevel(skillIndex) / 100.0
  3176. self.AppendSpace(5)
  3177. self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  3178.  
  3179. if skillLevel>=10:
  3180. #self.AutoAppendTextLine(Basis-Angriffswert Angreifer +%,0f % chop( 10 + 60 * k ))
  3181. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  3182.  
  3183. if skillLevel>=20:
  3184. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER % chop(1 + 5 * k))
  3185. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER % chop(50 + 1450 * k))
  3186.  
  3187. if skillLevel>=25:
  3188. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  3189.  
  3190. if skillLevel>=35:
  3191. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  3192.  
  3193. if skillLevel>=40:
  3194. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  3195.  
  3196. self.AlignHorizonalCenter()
  3197.  
  3198. def __AppendSummonDescription(self, skillLevel, color):
  3199. if skillLevel > 1:
  3200. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  3201. elif 1 == skillLevel:
  3202. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  3203. elif 0 == skillLevel:
  3204. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  3205.  
  3206.  
  3207. if __name__ == "__main__":
  3208. import app
  3209. import wndMgr
  3210. import systemSetting
  3211. import mouseModule
  3212. import grp
  3213. import ui
  3214.  
  3215. #wndMgr.SetOutlineFlag(TRUE)
  3216.  
  3217. app.SetMouseHandler(mouseModule.mouseController)
  3218. app.SetHairColorEnable(TRUE)
  3219. wndMgr.SetMouseHandler(mouseModule.mouseController)
  3220. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  3221. app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  3222. mouseModule.mouseController.Create()
  3223.  
  3224. toolTip = ItemToolTip()
  3225. toolTip.ClearToolTip()
  3226. #toolTip.AppendTextLine("Test")
  3227. 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."
  3228. summ = ""
  3229.  
  3230. toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  3231. toolTip.Show()
  3232.  
  3233. app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement