Advertisement
Guest User

Untitled

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