Guest User

Untitled

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