deadx2

Untitled

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