Guest User

Untitled

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