Advertisement
deadx2

Untitled

Oct 10th, 2017
206
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.         if itemVnum >= 35501 and itemVnum <= 35999:
  1257.             self.__AppendAttributeInformation(attrSlot)
  1258.            
  1259.         if itemVnum >= 26501 and itemVnum <= 26999:
  1260.             self.__AppendAttributeInformation(attrSlot)
  1261.        
  1262.         if itemVnum >= 21401 and itemVnum <= 21699:
  1263.             self.__AppendLimitInformation()
  1264.            
  1265.         ### Weapon ###
  1266.         if item.ITEM_TYPE_WEAPON == itemType:
  1267.  
  1268.             self.__AppendLimitInformation()
  1269.  
  1270.             self.AppendSpace(5)
  1271.  
  1272.             ## ??? ?? ??? ?? ????.
  1273.             if item.WEAPON_FAN == itemSubType:
  1274.                 self.__AppendMagicAttackInfo()
  1275.                 self.__AppendAttackPowerInfo()
  1276.  
  1277.             else:
  1278.                 self.__AppendAttackPowerInfo()
  1279.                 self.__AppendMagicAttackInfo()
  1280.  
  1281.             self.__AppendAffectInformation()
  1282.             self.__AppendAttributeInformation(attrSlot)
  1283.  
  1284.             self.AppendWearableInformation()
  1285.             self.__AppendMetinSlotInfo(metinSlot)
  1286.  
  1287.         ### Armor ###
  1288.         elif item.ITEM_TYPE_ARMOR == itemType:
  1289.             self.__AppendLimitInformation()
  1290.  
  1291.             ## ???
  1292.             defGrade = item.GetValue(1)
  1293.             defBonus = item.GetValue(5)*2 ## ??? ?? ?? ?? ??? ??
  1294.             if defGrade > 0:
  1295.                 self.AppendSpace(5)
  1296.                 self.AppendTextLine(localemg.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  1297.  
  1298.             self.__AppendMagicDefenceInfo()
  1299.             self.__AppendAffectInformation()
  1300.             self.__AppendAttributeInformation(attrSlot)
  1301.  
  1302.             self.AppendWearableInformation()
  1303.  
  1304.             if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):             
  1305.                 self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  1306.             else:
  1307.                 self.__AppendMetinSlotInfo(metinSlot)
  1308.  
  1309.         ### Ring Slot Item (Not UNIQUE) ###
  1310.         elif item.ITEM_TYPE_RING == itemType:
  1311.             self.__AppendLimitInformation()
  1312.             self.__AppendAffectInformation()
  1313.             self.__AppendAttributeInformation(attrSlot)
  1314.  
  1315.             #?? ?? ??? ???? ?? ?? ??
  1316.             #self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001)
  1317.            
  1318.  
  1319.         ### Belt Item ###
  1320.         elif item.ITEM_TYPE_BELT == itemType:
  1321.             self.__AppendLimitInformation()
  1322.             self.__AppendAffectInformation()
  1323.             self.__AppendAttributeInformation(attrSlot)
  1324.  
  1325.             self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  1326.  
  1327.         elif item.ITEM_TYPE_GLOVES == itemType:
  1328.             self.__AppendLimitInformation()
  1329.             self.__AppendAffectInformation()
  1330.             self.__AppendAttributeInformation(attrSlot)
  1331.  
  1332.         elif item.ITEM_TYPE_TROUSERS == itemType:
  1333.             self.__AppendLimitInformation()
  1334.             self.__AppendAffectInformation()
  1335.             self.__AppendAttributeInformation(attrSlot)
  1336.  
  1337.         elif item.ITEM_TYPE_LOLLIPOP == itemType:
  1338.             self.__AppendLimitInformation()
  1339.             self.__AppendAffectInformation()
  1340.             self.__AppendAttributeInformation(attrSlot)
  1341.  
  1342.         ## ??? ??? ##
  1343.         elif 0 != isCostumeItem:
  1344.             self.__AppendLimitInformation()
  1345.             self.__AppendAffectInformation()
  1346.             if isCostumeAcce != 0:
  1347.                 self.__AppendAcceAttributeInformation(attrSlot)
  1348.             else:
  1349.                 self.__AppendAttributeInformation(attrSlot)
  1350.            
  1351.             self.AppendWearableInformation()
  1352.             bHasRealtimeFlag = 0
  1353.             for i in xrange(item.LIMIT_MAX_NUM):
  1354.                 (limitType, limitValue) = item.GetLimit(i)
  1355.                 if item.LIMIT_REAL_TIME == limitType:
  1356.                     bHasRealtimeFlag = 1
  1357.            
  1358.             if 1 == bHasRealtimeFlag:
  1359.                 self.AppendMallItemLastTime(metinSlot[0])
  1360.            
  1361.             if isCostumeAcce != 0:
  1362.                 if metinSlot != 0:
  1363.                     absChance = int(metinSlot[1])
  1364.                     if absChance > 0:
  1365.                         self.AppendSpace(5)
  1366.                         self.AppendTextLine(locale.ACCE_ABSORB_CHANCE % (absChance), self.CONDITION_COLOR)
  1367.                
  1368.         ## Rod ##
  1369.         elif item.ITEM_TYPE_ROD == itemType:
  1370.  
  1371.             if 0 != metinSlot:
  1372.                 curLevel = item.GetValue(0) / 10
  1373.                 curEXP = metinSlot[0]
  1374.                 maxEXP = item.GetValue(2)
  1375.                 self.__AppendLimitInformation()
  1376.                 self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  1377.  
  1378.         ## Pick ##
  1379.         elif item.ITEM_TYPE_PICK == itemType:
  1380.  
  1381.             if 0 != metinSlot:
  1382.                 curLevel = item.GetValue(0) / 10
  1383.                 curEXP = metinSlot[0]
  1384.                 maxEXP = item.GetValue(2)
  1385.                 self.__AppendLimitInformation()
  1386.                 self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  1387.  
  1388.         ## Lottery ##
  1389.         elif item.ITEM_TYPE_LOTTERY == itemType:
  1390.             if 0 != metinSlot:
  1391.  
  1392.                 ticketNumber = int(metinSlot[0])
  1393.                 stepNumber = int(metinSlot[1])
  1394.  
  1395.                 self.AppendSpace(5)
  1396.                 self.AppendTextLine(localemg.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  1397.                 self.AppendTextLine(localemg.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  1398.  
  1399.         ### Metin ###
  1400.         elif item.ITEM_TYPE_METIN == itemType:
  1401.             self.AppendMetinInformation()
  1402.             self.AppendMetinWearInformation()
  1403.  
  1404.         ### Fish ###
  1405.         elif item.ITEM_TYPE_FISH == itemType:
  1406.             if 0 != metinSlot:
  1407.                 self.__AppendFishInfo(metinSlot[0])
  1408.        
  1409.         ## item.ITEM_TYPE_BLEND
  1410.         elif item.ITEM_TYPE_BLEND == itemType:
  1411.             self.__AppendLimitInformation()
  1412.  
  1413.             if metinSlot:
  1414.                 affectType = metinSlot[0]
  1415.                 affectValue = metinSlot[1]
  1416.                 time = metinSlot[2]
  1417.                 self.AppendSpace(5)
  1418.                 affectText = self.__GetAffectString(affectType, affectValue)
  1419.  
  1420.                 self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1421.  
  1422.                 if time > 0:
  1423.                     minute = (time / 60)
  1424.                     second = (time % 60)
  1425.                     timeString = localemg.TOOLTIP_POTION_TIME
  1426.  
  1427.                     if minute > 0:
  1428.                         timeString += str(minute) + localemg.TOOLTIP_POTION_MIN
  1429.                     if second > 0:
  1430.                         timeString += " " + str(second) + localemg.TOOLTIP_POTION_SEC
  1431.  
  1432.                     self.AppendTextLine(timeString)
  1433.                 else:
  1434.                     self.AppendTextLine(localemg.BLEND_POTION_NO_TIME)
  1435.             else:
  1436.                 self.AppendTextLine("BLEND_POTION_NO_INFO")
  1437.  
  1438.         elif item.ITEM_TYPE_UNIQUE == itemType:
  1439.             if 0 != metinSlot:
  1440.                 bHasRealtimeFlag = 0
  1441.                
  1442.                 for i in xrange(item.LIMIT_MAX_NUM):
  1443.                     (limitType, limitValue) = item.GetLimit(i)
  1444.  
  1445.                     if item.LIMIT_REAL_TIME == limitType:
  1446.                         bHasRealtimeFlag = 1
  1447.                
  1448.                 if 1 == bHasRealtimeFlag:
  1449.                     self.AppendMallItemLastTime(metinSlot[0])      
  1450.                 else:
  1451.                     time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1452.  
  1453.                     if 1 == item.GetValue(2): ## ??? ?? Flag / ?? ??? ??
  1454.                         self.AppendMallItemLastTime(time)
  1455.                     else:
  1456.                         self.AppendUniqueItemLastTime(time)
  1457.  
  1458.         ### Use ###
  1459.         elif item.ITEM_TYPE_USE == itemType:
  1460.             self.__AppendLimitInformation()
  1461.  
  1462.             if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1463.                 self.__AppendPotionInformation()
  1464.  
  1465.             elif item.USE_ABILITY_UP == itemSubType:
  1466.                 self.__AppendAbilityPotionInformation()
  1467.  
  1468.  
  1469.             ## ?? ???
  1470.             if 27989 == itemVnum or 76006 == itemVnum:
  1471.                 if 0 != metinSlot:
  1472.                     useCount = int(metinSlot[0])
  1473.  
  1474.                     self.AppendSpace(5)
  1475.                     self.AppendTextLine(localemg.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR)
  1476.  
  1477.             ## ??? ???
  1478.             elif 50004 == itemVnum:
  1479.                 if 0 != metinSlot:
  1480.                     useCount = int(metinSlot[0])
  1481.  
  1482.                     self.AppendSpace(5)
  1483.                     self.AppendTextLine(localemg.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1484.  
  1485.             ## ????
  1486.             elif constInfo.IS_AUTO_POTION(itemVnum):
  1487.                 if 0 != metinSlot:
  1488.                     ## 0: ???, 1: ???, 2: ??
  1489.                     isActivated = int(metinSlot[0])
  1490.                     usedAmount = float(metinSlot[1])
  1491.                     totalAmount = float(metinSlot[2])
  1492.                    
  1493.                     if 0 == totalAmount:
  1494.                         totalAmount = 1
  1495.                    
  1496.                     self.AppendSpace(5)
  1497.  
  1498.                     if 0 != isActivated:
  1499.                         self.AppendTextLine("(%s)" % (localemg.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1500.                         self.AppendSpace(5)
  1501.                        
  1502.                     self.AppendTextLine(localemg.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1503.                                
  1504.             ## ?? ???
  1505.             elif itemVnum in WARP_SCROLLS:
  1506.                 if 0 != metinSlot:
  1507.                     xPos = int(metinSlot[0])
  1508.                     yPos = int(metinSlot[1])
  1509.  
  1510.                     if xPos != 0 and yPos != 0:
  1511.                         (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1512.                        
  1513.                         localeMapName=localemg.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1514.  
  1515.                         self.AppendSpace(5)
  1516.  
  1517.                         if localeMapName!="":                      
  1518.                             self.AppendTextLine(localemg.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1519.                         else:
  1520.                             self.AppendTextLine(localemg.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1521.                             dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1522.  
  1523.             #####
  1524.             if item.USE_SPECIAL == itemSubType:
  1525.                 bHasRealtimeFlag = 0
  1526.                 for i in xrange(item.LIMIT_MAX_NUM):
  1527.                     (limitType, limitValue) = item.GetLimit(i)
  1528.  
  1529.                     if item.LIMIT_REAL_TIME == limitType:
  1530.                         bHasRealtimeFlag = 1
  1531.        
  1532.                 ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  1533.                 if 1 == bHasRealtimeFlag:
  1534.                     self.AppendMallItemLastTime(metinSlot[0])
  1535.                 else:
  1536.                     # ... ??... ???? ?? ?? ?? ??? ???...
  1537.                     # ? ??? ??? ??? ??? ?? ??...
  1538.                     if 0 != metinSlot:
  1539.                         time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1540.  
  1541.                         ## ??? ?? Flag
  1542.                         if 1 == item.GetValue(2):
  1543.                             self.AppendMallItemLastTime(time)
  1544.            
  1545.             elif item.USE_TIME_CHARGE_PER == itemSubType:
  1546.                 bHasRealtimeFlag = 0
  1547.                 for i in xrange(item.LIMIT_MAX_NUM):
  1548.                     (limitType, limitValue) = item.GetLimit(i)
  1549.  
  1550.                     if item.LIMIT_REAL_TIME == limitType:
  1551.                         bHasRealtimeFlag = 1
  1552.                 if metinSlot[2]:
  1553.                     self.AppendTextLine(localemg.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  1554.                 else:
  1555.                     self.AppendTextLine(localemg.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  1556.        
  1557.                 ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  1558.                 if 1 == bHasRealtimeFlag:
  1559.                     self.AppendMallItemLastTime(metinSlot[0])
  1560.  
  1561.             elif item.USE_TIME_CHARGE_FIX == itemSubType:
  1562.                 bHasRealtimeFlag = 0
  1563.                 for i in xrange(item.LIMIT_MAX_NUM):
  1564.                     (limitType, limitValue) = item.GetLimit(i)
  1565.  
  1566.                     if item.LIMIT_REAL_TIME == limitType:
  1567.                         bHasRealtimeFlag = 1
  1568.                 if metinSlot[2]:
  1569.                     self.AppendTextLine(localemg.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  1570.                 else:
  1571.                     self.AppendTextLine(localemg.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  1572.        
  1573.                 ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  1574.                 if 1 == bHasRealtimeFlag:
  1575.                     self.AppendMallItemLastTime(metinSlot[0])
  1576.  
  1577.         elif item.ITEM_TYPE_QUEST == itemType:
  1578.             for i in xrange(item.LIMIT_MAX_NUM):
  1579.                 (limitType, limitValue) = item.GetLimit(i)
  1580.  
  1581.                 if item.LIMIT_REAL_TIME == limitType:
  1582.                     self.AppendMallItemLastTime(metinSlot[0])
  1583.         elif item.ITEM_TYPE_DS == itemType:
  1584.             self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1585.             self.__AppendAttributeInformation(attrSlot)
  1586.         else:
  1587.             self.__AppendLimitInformation()
  1588.  
  1589.         for i in xrange(item.LIMIT_MAX_NUM):
  1590.             (limitType, limitValue) = item.GetLimit(i)
  1591.             #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue))
  1592.            
  1593.             if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1594.                 self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1595.                 #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ")
  1596.                
  1597.             elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1598.                 self.AppendTimerBasedOnWearLastTime(metinSlot)
  1599.                 #dbg.TraceError("1) REAL_TIME flag On ")
  1600.  
  1601.         self.__SetItemTitleDown(itemVnum, metinSlot, attrSlot)
  1602.                
  1603.         self.ShowToolTip()
  1604.  
  1605.     def __DragonSoulInfoString (self, dwVnum):
  1606.         step = (dwVnum / 100) % 10
  1607.         refine = (dwVnum / 10) % 10
  1608.         if 0 == step:
  1609.             return localemg.DRAGON_SOUL_STEP_LEVEL1 + " " + localemg.DRAGON_SOUL_STRENGTH(refine)
  1610.         elif 1 == step:
  1611.             return localemg.DRAGON_SOUL_STEP_LEVEL2 + " " + localemg.DRAGON_SOUL_STRENGTH(refine)
  1612.         elif 2 == step:
  1613.             return localemg.DRAGON_SOUL_STEP_LEVEL3 + " " + localemg.DRAGON_SOUL_STRENGTH(refine)
  1614.         elif 3 == step:
  1615.             return localemg.DRAGON_SOUL_STEP_LEVEL4 + " " + localemg.DRAGON_SOUL_STRENGTH(refine)
  1616.         elif 4 == step:
  1617.             return localemg.DRAGON_SOUL_STEP_LEVEL5 + " " + localemg.DRAGON_SOUL_STRENGTH(refine)
  1618.         else:
  1619.             return ""
  1620.  
  1621.  
  1622.     ## ?????
  1623.     def __IsHair(self, itemVnum):
  1624.         return (self.__IsOldHair(itemVnum) or
  1625.             self.__IsNewHair(itemVnum) or
  1626.             self.__IsNewHair2(itemVnum) or
  1627.             self.__IsNewHair3(itemVnum) or
  1628.             self.__IsCostumeHair(itemVnum)
  1629.             )
  1630.  
  1631.     def __IsOldHair(self, itemVnum):
  1632.         return itemVnum > 73000 and itemVnum < 74000   
  1633.  
  1634.     def __IsNewHair(self, itemVnum):
  1635.         return itemVnum > 74000 and itemVnum < 75000   
  1636.  
  1637.     def __IsNewHair2(self, itemVnum):
  1638.         return itemVnum > 75000 and itemVnum < 76000   
  1639.  
  1640.     def __IsNewHair3(self, itemVnum):
  1641.         return ((74012 < itemVnum and itemVnum < 74022) or
  1642.             (74262 < itemVnum and itemVnum < 74272) or
  1643.             (74512 < itemVnum and itemVnum < 74522) or
  1644.             (74762 < itemVnum and itemVnum < 74772) or
  1645.             (45000 < itemVnum and itemVnum < 47000))
  1646.  
  1647.     def __IsCostumeHair(self, itemVnum):
  1648.         return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1649.        
  1650.     def __AppendHairIcon(self, itemVnum):
  1651.         itemImage = uimg.ImageBox()
  1652.         itemImage.SetParent(self)
  1653.         itemImage.Show()           
  1654.  
  1655.         if self.__IsOldHair(itemVnum):
  1656.             itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1657.         elif self.__IsNewHair3(itemVnum):
  1658.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1659.         elif self.__IsNewHair(itemVnum): # ?? ?? ??? ????? ????. ??? ???? 1000?? ??? ???.
  1660.             itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1661.         elif self.__IsNewHair2(itemVnum):
  1662.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1663.         elif self.__IsCostumeHair(itemVnum):
  1664.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1665.  
  1666.         itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1667.         self.toolTipHeight += itemImage.GetHeight()
  1668.         #self.toolTipWidth += itemImage.GetWidth()/2
  1669.         self.childrenList.append(itemImage)
  1670.         self.ResizeToolTip()
  1671.  
  1672.     ## ???? ? Description ? ?? ?? ???? ????
  1673.     def __AdjustMaxWidth(self, attrSlot, desc):
  1674.         newToolTipWidth = self.toolTipWidth
  1675.         newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1676.         newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1677.         if newToolTipWidth > self.toolTipWidth:
  1678.             self.toolTipWidth = newToolTipWidth
  1679.             self.ResizeToolTip()
  1680.  
  1681.     def __AdjustAttrMaxWidth(self, attrSlot):
  1682.         if 0 == attrSlot:
  1683.             return self.toolTipWidth
  1684.  
  1685.         maxWidth = self.toolTipWidth
  1686.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1687.             type = attrSlot[i][0]
  1688.             value = attrSlot[i][1]
  1689.             if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1690.                 if value > 0:
  1691.                     maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1692.  
  1693.                     # ATTR_CHANGE_TOOLTIP_WIDTH
  1694.                     #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth)
  1695.                     #self.ResizeToolTip()
  1696.                     # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH
  1697.  
  1698.         return maxWidth
  1699.  
  1700.     def __AdjustDescMaxWidth(self, desc):
  1701.         if len(desc) < DESC_DEFAULT_MAX_COLS:
  1702.             return self.toolTipWidth
  1703.    
  1704.         return DESC_WESTERN_MAX_WIDTH
  1705.  
  1706.     def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1707.         skillName = skill.GetSkillName(skillIndex)
  1708.  
  1709.         if not skillName:
  1710.             return
  1711.  
  1712.         if localemg.IsVIETNAM():
  1713.             itemName = bookName + " " + skillName
  1714.         else:
  1715.             itemName = skillName + " " + bookName
  1716.         self.SetTitle(itemName)
  1717.  
  1718.     def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1719.         self.AppendSpace(5)
  1720.         self.AppendTextLine(localemg.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1721.         self.AppendTextLine(localemg.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1722.  
  1723.         if curEXP == maxEXP:
  1724.             self.AppendSpace(5)
  1725.             self.AppendTextLine(localemg.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1726.             self.AppendTextLine(localemg.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1727.             self.AppendTextLine(localemg.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1728.  
  1729.  
  1730.     def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1731.         self.AppendSpace(5)
  1732.         self.AppendTextLine(localemg.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1733.         self.AppendTextLine(localemg.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1734.  
  1735.         if curEXP == maxEXP:
  1736.             self.AppendSpace(5)
  1737.             self.AppendTextLine(localemg.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  1738.             self.AppendTextLine(localemg.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  1739.             self.AppendTextLine(localemg.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  1740.  
  1741.     def __AppendLimitInformation(self):
  1742.  
  1743.         appendSpace = False
  1744.  
  1745.         for i in xrange(item.LIMIT_MAX_NUM):
  1746.  
  1747.             (limitType, limitValue) = item.GetLimit(i)
  1748.  
  1749.             if limitValue > 0:
  1750.                 if False == appendSpace:
  1751.                     self.AppendSpace(5)
  1752.                     appendSpace = True
  1753.  
  1754.             else:
  1755.                 continue
  1756.  
  1757.             if item.LIMIT_LEVEL == limitType:
  1758.                 color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  1759.                 self.AppendTextLine(localemg.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  1760.             """
  1761.             elif item.LIMIT_STR == limitType:
  1762.                 color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  1763.                 self.AppendTextLine(localemg.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  1764.             elif item.LIMIT_DEX == limitType:
  1765.                 color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  1766.                 self.AppendTextLine(localemg.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  1767.             elif item.LIMIT_INT == limitType:
  1768.                 color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  1769.                 self.AppendTextLine(localemg.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  1770.             elif item.LIMIT_CON == limitType:
  1771.                 color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  1772.                 self.AppendTextLine(localemg.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  1773.             """
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.     def __GetAffectString(self, affectType, affectValue):
  1787.         if 0 == affectType:
  1788.             return None
  1789.  
  1790.         if 0 == affectValue:
  1791.             return None
  1792.  
  1793.         try:
  1794.             return self.AFFECT_DICT[affectType](affectValue)
  1795.         except TypeError:
  1796.             return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  1797.         except KeyError:
  1798.             return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  1799.  
  1800.     def __AppendAffectInformation(self):
  1801.         for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1802.  
  1803.             (affectType, affectValue) = item.GetAffect(i)
  1804.  
  1805.             affectString = self.__GetAffectString(affectType, affectValue)
  1806.             if affectString:
  1807.                 self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1808.  
  1809.     def AppendWearableInformation(self):
  1810.  
  1811.         self.AppendSpace(5)
  1812.         self.AppendTextLine(localemg.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  1813.  
  1814.         flagList = (
  1815.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  1816.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  1817.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  1818.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
  1819.  
  1820.         characterNames = ""
  1821.         for i in xrange(self.CHARACTER_COUNT):
  1822.  
  1823.             name = self.CHARACTER_NAMES[i]
  1824.             flag = flagList[i]
  1825.  
  1826.             if flag:
  1827.                 characterNames += " "
  1828.                 characterNames += name
  1829.  
  1830.         textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  1831.         textLine.SetFeather()
  1832.  
  1833.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  1834.             textLine = self.AppendTextLine(localemg.FOR_FEMALE, self.NORMAL_COLOR, True)
  1835.             textLine.SetFeather()
  1836.  
  1837.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  1838.             textLine = self.AppendTextLine(localemg.FOR_MALE, self.NORMAL_COLOR, True)
  1839.             textLine.SetFeather()
  1840.  
  1841.     def __AppendPotionInformation(self):
  1842.         self.AppendSpace(5)
  1843.  
  1844.         healHP = item.GetValue(0)
  1845.         healSP = item.GetValue(1)
  1846.         healStatus = item.GetValue(2)
  1847.         healPercentageHP = item.GetValue(3)
  1848.         healPercentageSP = item.GetValue(4)
  1849.  
  1850.         if healHP > 0:
  1851.             self.AppendTextLine(localemg.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  1852.         if healSP > 0:
  1853.             self.AppendTextLine(localemg.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  1854.         if healStatus != 0:
  1855.             self.AppendTextLine(localemg.TOOLTIP_POTION_CURE)
  1856.         if healPercentageHP > 0:
  1857.             self.AppendTextLine(localemg.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  1858.         if healPercentageSP > 0:
  1859.             self.AppendTextLine(localemg.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  1860.  
  1861.     def __AppendAbilityPotionInformation(self):
  1862.  
  1863.         self.AppendSpace(5)
  1864.  
  1865.         abilityType = item.GetValue(0)
  1866.         time = item.GetValue(1)
  1867.         point = item.GetValue(2)
  1868.  
  1869.         if abilityType == item.APPLY_ATT_SPEED:
  1870.             self.AppendTextLine(localemg.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  1871.         elif abilityType == item.APPLY_MOV_SPEED:
  1872.             self.AppendTextLine(localemg.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  1873.  
  1874.         if time > 0:
  1875.             minute = (time / 60)
  1876.             second = (time % 60)
  1877.             timeString = localemg.TOOLTIP_POTION_TIME
  1878.  
  1879.             if minute > 0:
  1880.                 timeString += str(minute) + localemg.TOOLTIP_POTION_MIN
  1881.             if second > 0:
  1882.                 timeString += " " + str(second) + localemg.TOOLTIP_POTION_SEC
  1883.  
  1884.             self.AppendTextLine(timeString)
  1885.  
  1886.     def GetPriceColor(self, price):
  1887.         if price>=constInfo.HIGH_PRICE:
  1888.             return self.HIGH_PRICE_COLOR
  1889.         if price>=constInfo.MIDDLE_PRICE:
  1890.             return self.MIDDLE_PRICE_COLOR
  1891.         else:
  1892.             return self.LOW_PRICE_COLOR
  1893.                        
  1894.     def AppendPrice(self, price):  
  1895.         self.AppendSpace(5)
  1896.         self.AppendTextLine(localemg.TOOLTIP_BUYPRICE  % (localemg.NumberToMoneyString(price)), self.GetPriceColor(price))
  1897.        
  1898.     def AppendPriceBySecondaryCoin(self, price):
  1899.         self.AppendSpace(5)
  1900.         self.AppendTextLine(localemg.TOOLTIP_BUYPRICE  % (localemg.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  1901.  
  1902.     def AppendSellingPrice(self, price):
  1903.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):           
  1904.             self.AppendTextLine(localemg.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  1905.             self.AppendSpace(5)
  1906.         else:
  1907.             self.AppendTextLine(localemg.TOOLTIP_SELLPRICE % (localemg.NumberToMoneyString(price)), self.GetPriceColor(price))
  1908.             self.AppendSpace(5)
  1909.  
  1910.     def AppendMetinInformation(self):
  1911.         affectType, affectValue = item.GetAffect(0)
  1912.         #affectType = item.GetValue(0)
  1913.         #affectValue = item.GetValue(1)
  1914.  
  1915.         affectString = self.__GetAffectString(affectType, affectValue)
  1916.  
  1917.         if affectString:
  1918.             self.AppendSpace(5)
  1919.             self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1920.  
  1921.     def AppendMetinWearInformation(self):
  1922.  
  1923.         self.AppendSpace(5)
  1924.         self.AppendTextLine(localemg.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  1925.  
  1926.         flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  1927.                     item.IsWearableFlag(item.WEARABLE_HEAD),
  1928.                     item.IsWearableFlag(item.WEARABLE_FOOTS),
  1929.                     item.IsWearableFlag(item.WEARABLE_WRIST),
  1930.                     item.IsWearableFlag(item.WEARABLE_WEAPON),
  1931.                     item.IsWearableFlag(item.WEARABLE_NECK),
  1932.                     item.IsWearableFlag(item.WEARABLE_EAR),
  1933.                     item.IsWearableFlag(item.WEARABLE_UNIQUE),
  1934.                     item.IsWearableFlag(item.WEARABLE_SHIELD),
  1935.                     item.IsWearableFlag(item.WEARABLE_ARROW))
  1936.  
  1937.         wearNames = ""
  1938.         for i in xrange(self.WEAR_COUNT):
  1939.  
  1940.             name = self.WEAR_NAMES[i]
  1941.             flag = flagList[i]
  1942.  
  1943.             if flag:
  1944.                 wearNames += "  "
  1945.                 wearNames += name
  1946.  
  1947.         textLine = uimg.TextLine()
  1948.         textLine.SetParent(self)
  1949.         textLine.SetFontName(self.defFontName)
  1950.         textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  1951.         textLine.SetHorizontalAlignCenter()
  1952.         textLine.SetPackedFontColor(self.NORMAL_COLOR)
  1953.         textLine.SetText(wearNames)
  1954.         textLine.Show()
  1955.         self.childrenList.append(textLine)
  1956.  
  1957.         self.toolTipHeight += self.TEXT_LINE_HEIGHT
  1958.         self.ResizeToolTip()
  1959.  
  1960.     def GetMetinSocketType(self, number):
  1961.         if player.METIN_SOCKET_TYPE_NONE == number:
  1962.             return player.METIN_SOCKET_TYPE_NONE
  1963.         elif player.METIN_SOCKET_TYPE_SILVER == number:
  1964.             return player.METIN_SOCKET_TYPE_SILVER
  1965.         elif player.METIN_SOCKET_TYPE_GOLD == number:
  1966.             return player.METIN_SOCKET_TYPE_GOLD
  1967.         else:
  1968.             item.SelectItem(number)
  1969.             if item.METIN_NORMAL == item.GetItemSubType():
  1970.                 return player.METIN_SOCKET_TYPE_SILVER
  1971.             elif item.METIN_GOLD == item.GetItemSubType():
  1972.                 return player.METIN_SOCKET_TYPE_GOLD
  1973.             elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  1974.                 return player.METIN_SOCKET_TYPE_SILVER
  1975.             elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  1976.                 return player.METIN_SOCKET_TYPE_SILVER
  1977.             elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  1978.                 return player.METIN_SOCKET_TYPE_SILVER
  1979.  
  1980.         return player.METIN_SOCKET_TYPE_NONE
  1981.  
  1982.     def GetMetinItemIndex(self, number):
  1983.         if player.METIN_SOCKET_TYPE_SILVER == number:
  1984.             return 0
  1985.         if player.METIN_SOCKET_TYPE_GOLD == number:
  1986.             return 0
  1987.  
  1988.         return number
  1989.  
  1990.     def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):     
  1991.         ACCESSORY_SOCKET_MAX_SIZE = 3      
  1992.  
  1993.         cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  1994.         end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  1995.  
  1996.         affectType1, affectValue1 = item.GetAffect(0)
  1997.         affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  1998.  
  1999.         affectType2, affectValue2 = item.GetAffect(1)
  2000.         affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  2001.  
  2002.         mtrlPos=0
  2003.         mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  2004.         for mtrl in mtrlList:
  2005.             affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])           
  2006.             affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  2007.  
  2008.             leftTime = 0
  2009.             if cur == mtrlPos+1:
  2010.                 leftTime=metinSlot[2]
  2011.  
  2012.             self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  2013.             mtrlPos+=1
  2014.  
  2015.     def __AppendMetinSlotInfo(self, metinSlot):
  2016.         if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  2017.             return
  2018.  
  2019.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2020.             self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  2021.  
  2022.     def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  2023.         if 0 == metinSlot:
  2024.             return 1
  2025.  
  2026.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2027.             metinSlotData=metinSlot[i]
  2028.             if 0 != self.GetMetinSocketType(metinSlotData):
  2029.                 if 0 != self.GetMetinItemIndex(metinSlotData):
  2030.                     return 0
  2031.  
  2032.         return 1
  2033.  
  2034.     def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  2035.  
  2036.         slotType = self.GetMetinSocketType(metinSlotData)
  2037.         itemIndex = self.GetMetinItemIndex(metinSlotData)
  2038.  
  2039.         if 0 == slotType:
  2040.             return
  2041.  
  2042.         self.AppendSpace(5)
  2043.  
  2044.         slotImage = uimg.ImageBox()
  2045.         slotImage.SetParent(self)
  2046.         slotImage.Show()
  2047.  
  2048.         ## Name
  2049.         nameTextLine = uimg.TextLine()
  2050.         nameTextLine.SetParent(self)
  2051.         nameTextLine.SetFontName(self.defFontName)
  2052.         nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  2053.         nameTextLine.SetOutline()
  2054.         nameTextLine.SetFeather()
  2055.         nameTextLine.Show()        
  2056.  
  2057.         self.childrenList.append(nameTextLine)
  2058.  
  2059.         if player.METIN_SOCKET_TYPE_SILVER == slotType:
  2060.             slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  2061.         elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  2062.             slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  2063.  
  2064.         self.childrenList.append(slotImage)
  2065.        
  2066.         if localemg.IsARABIC():
  2067.             slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  2068.             nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  2069.         else:
  2070.             slotImage.SetPosition(9, self.toolTipHeight-1)
  2071.             nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  2072.  
  2073.         metinImage = uimg.ImageBox()
  2074.         metinImage.SetParent(self)
  2075.         metinImage.Show()
  2076.         self.childrenList.append(metinImage)
  2077.  
  2078.         if itemIndex:
  2079.  
  2080.             item.SelectItem(itemIndex)
  2081.  
  2082.             ## Image
  2083.             try:
  2084.                 metinImage.LoadImage(item.GetIconImageFileName())
  2085.             except:
  2086.                 dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  2087.                     (itemIndex, item.GetIconImageFileName())
  2088.                 )
  2089.  
  2090.             nameTextLine.SetText(item.GetItemName())
  2091.            
  2092.             ## Affect      
  2093.             affectTextLine = uimg.TextLine()
  2094.             affectTextLine.SetParent(self)
  2095.             affectTextLine.SetFontName(self.defFontName)
  2096.             affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2097.             affectTextLine.SetOutline()
  2098.             affectTextLine.SetFeather()
  2099.             affectTextLine.Show()          
  2100.                
  2101.             if localemg.IsARABIC():
  2102.                 metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  2103.                 affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  2104.             else:
  2105.                 metinImage.SetPosition(10, self.toolTipHeight)
  2106.                 affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  2107.                            
  2108.             if custumAffectString:
  2109.                 affectTextLine.SetText(custumAffectString)
  2110.             elif itemIndex!=constInfo.ERROR_METIN_STONE:
  2111.                 affectType, affectValue = item.GetAffect(0)
  2112.                 affectString = self.__GetAffectString(affectType, affectValue)
  2113.                 if affectString:
  2114.                     affectTextLine.SetText(affectString)
  2115.             else:
  2116.                 affectTextLine.SetText(localemg.TOOLTIP_APPLY_NOAFFECT)
  2117.            
  2118.             self.childrenList.append(affectTextLine)           
  2119.  
  2120.             if custumAffectString2:
  2121.                 affectTextLine = uimg.TextLine()
  2122.                 affectTextLine.SetParent(self)
  2123.                 affectTextLine.SetFontName(self.defFontName)
  2124.                 affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2125.                 affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2126.                 affectTextLine.SetOutline()
  2127.                 affectTextLine.SetFeather()
  2128.                 affectTextLine.Show()
  2129.                 affectTextLine.SetText(custumAffectString2)
  2130.                 self.childrenList.append(affectTextLine)
  2131.                 self.toolTipHeight += 16 + 2
  2132.  
  2133.             if 0 != leftTime:
  2134.                 timeText = (localemg.LEFT_TIME + " : " + localemg.SecondToDHM(leftTime))
  2135.  
  2136.                 timeTextLine = uimg.TextLine()
  2137.                 timeTextLine.SetParent(self)
  2138.                 timeTextLine.SetFontName(self.defFontName)
  2139.                 timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2140.                 timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2141.                 timeTextLine.SetOutline()
  2142.                 timeTextLine.SetFeather()
  2143.                 timeTextLine.Show()
  2144.                 timeTextLine.SetText(timeText)
  2145.                 self.childrenList.append(timeTextLine)
  2146.                 self.toolTipHeight += 16 + 2
  2147.  
  2148.         else:
  2149.             nameTextLine.SetText(localemg.TOOLTIP_SOCKET_EMPTY)
  2150.  
  2151.         self.toolTipHeight += 35
  2152.         self.ResizeToolTip()
  2153.  
  2154.     def __AppendFishInfo(self, size):
  2155.         if size > 0:
  2156.             self.AppendSpace(5)
  2157.             self.AppendTextLine(localemg.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  2158.  
  2159.     def AppendUniqueItemLastTime(self, restMin):
  2160.         restSecond = restMin*60
  2161.         self.AppendSpace(5)
  2162.         self.AppendTextLine(localemg.LEFT_TIME + " : " + localemg.SecondToDHM(restSecond), self.NORMAL_COLOR)
  2163.  
  2164.     def AppendMallItemLastTime(self, endTime):
  2165.         leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  2166.         self.AppendSpace(5)
  2167.         self.AppendTextLine(localemg.LEFT_TIME + " : " + localemg.SecondToDHM(leftSec), self.NORMAL_COLOR)
  2168.        
  2169.     def AppendTimerBasedOnWearLastTime(self, metinSlot):
  2170.         if 0 == metinSlot[0]:
  2171.             self.AppendSpace(5)
  2172.             self.AppendTextLine(localemg.CANNOT_USE, self.DISABLE_COLOR)
  2173.         else:
  2174.             endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  2175.             self.AppendMallItemLastTime(endTime)       
  2176.    
  2177.     def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):    
  2178.         useCount = metinSlot[1]
  2179.         endTime = metinSlot[0]
  2180.        
  2181.         # ? ???? ????? Socket0? ?? ??(2012? 3? 1? 13? 01? ??..) ? ????.
  2182.         # ???? ???? Socket0? ??????(???? 600 ?? ?. ???)? ???? ? ??, 0??? Limit Value? ?? ??????? ????.
  2183.         if 0 == useCount:
  2184.             if 0 == endTime:
  2185.                 (limitType, limitValue) = item.GetLimit(limitIndex)
  2186.                 endTime = limitValue
  2187.  
  2188.             endTime += app.GetGlobalTimeStamp()
  2189.    
  2190.         self.AppendMallItemLastTime(endTime)
  2191.    
  2192. class HyperlinkItemToolTip(ItemToolTip):
  2193.     def __init__(self):
  2194.         ItemToolTip.__init__(self, isPickable=True)
  2195.  
  2196.     def SetHyperlinkItem(self, tokens):
  2197.         minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
  2198.         maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  2199.         if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  2200.             head, vnum, flag = tokens[:3]
  2201.             itemVnum = int(vnum, 16)
  2202.             metinSlot = [int(metin, 16) for metin in tokens[3:6]]
  2203.  
  2204.             rests = tokens[6:]
  2205.             if rests:
  2206.                 attrSlot = []
  2207.  
  2208.                 rests.reverse()
  2209.                 while rests:
  2210.                     key = int(rests.pop(), 16)
  2211.                     if rests:
  2212.                         val = int(rests.pop())
  2213.                         attrSlot.append((key, val))
  2214.  
  2215.                 attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  2216.             else:
  2217.                 attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  2218.  
  2219.             self.ClearToolTip()
  2220.             self.AddItemData(itemVnum, metinSlot, attrSlot)
  2221.  
  2222.             ItemToolTip.OnUpdate(self)
  2223.  
  2224.     def OnUpdate(self):
  2225.         pass
  2226.  
  2227.     def OnMouseLeftButtonDown(self):
  2228.         self.Hide()
  2229.  
  2230. class SkillToolTip(ToolTip):
  2231.  
  2232.     POINT_NAME_DICT = {
  2233.         player.LEVEL : localemg.SKILL_TOOLTIP_LEVEL,
  2234.         player.IQ : localemg.SKILL_TOOLTIP_INT,
  2235.     }
  2236.  
  2237.     SKILL_TOOL_TIP_WIDTH = 200
  2238.     PARTY_SKILL_TOOL_TIP_WIDTH = 340
  2239.  
  2240.     PARTY_SKILL_EXPERIENCE_AFFECT_LIST = (  ( 2, 2,  10,),
  2241.                                             ( 8, 3,  20,),
  2242.                                             (14, 4,  30,),
  2243.                                             (22, 5,  45,),
  2244.                                             (28, 6,  60,),
  2245.                                             (34, 7,  80,),
  2246.                                             (38, 8, 100,), )
  2247.  
  2248.     PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = (  ( 4, 2, 1, 0,),
  2249.                                             (10, 3, 2, 0,),
  2250.                                             (16, 4, 2, 1,),
  2251.                                             (24, 5, 2, 2,), )
  2252.  
  2253.     PARTY_SKILL_ATTACKER_AFFECT_LIST = (    ( 36, 3, ),
  2254.                                             ( 26, 1, ),
  2255.                                             ( 32, 2, ), )
  2256.  
  2257.     SKILL_GRADE_NAME = {    player.SKILL_GRADE_MASTER : localemg.SKILL_GRADE_NAME_MASTER,
  2258.                             player.SKILL_GRADE_GRAND_MASTER : localemg.SKILL_GRADE_NAME_GRAND_MASTER,
  2259.                             player.SKILL_GRADE_PERFECT_MASTER : localemg.SKILL_GRADE_NAME_PERFECT_MASTER, }
  2260.  
  2261.     AFFECT_NAME_DICT =  {
  2262.                             "HP" : localemg.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  2263.                             "ATT_GRADE" : localemg.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  2264.                             "DEF_GRADE" : localemg.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  2265.                             "ATT_SPEED" : localemg.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  2266.                             "MOV_SPEED" : localemg.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  2267.                             "DODGE" : localemg.TOOLTIP_SKILL_AFFECT_DODGE,
  2268.                             "RESIST_NORMAL" : localemg.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  2269.                             "REFLECT_MELEE" : localemg.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  2270.                         }
  2271.     AFFECT_APPEND_TEXT_DICT =   {
  2272.                                     "DODGE" : "%",
  2273.                                     "RESIST_NORMAL" : "%",
  2274.                                     "REFLECT_MELEE" : "%",
  2275.                                 }
  2276.  
  2277.     def __init__(self):
  2278.         ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  2279.     def __del__(self):
  2280.         ToolTip.__del__(self)
  2281.  
  2282.     def SetSkill(self, skillIndex, skillLevel = -1):
  2283.  
  2284.         if 0 == skillIndex:
  2285.             return
  2286.  
  2287.         if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2288.  
  2289.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2290.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2291.                 self.ResizeToolTip()
  2292.  
  2293.             self.AppendDefaultData(skillIndex)
  2294.             self.AppendSkillConditionData(skillIndex)
  2295.             self.AppendGuildSkillData(skillIndex, skillLevel)
  2296.  
  2297.         else:
  2298.  
  2299.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2300.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2301.                 self.ResizeToolTip()
  2302.  
  2303.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  2304.             skillGrade = player.GetSkillGrade(slotIndex)
  2305.             skillLevel = player.GetSkillLevel(slotIndex)
  2306.             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2307.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2308.  
  2309.             self.AppendDefaultData(skillIndex)
  2310.             self.AppendSkillConditionData(skillIndex)
  2311.             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2312.             self.AppendSkillRequirement(skillIndex, skillLevel)
  2313.  
  2314.         self.ShowToolTip()
  2315.  
  2316.     def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  2317.  
  2318.         if 0 == skillIndex:
  2319.             return
  2320.  
  2321.         if player.SKILL_INDEX_TONGSOL == skillIndex:
  2322.  
  2323.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  2324.             skillLevel = player.GetSkillLevel(slotIndex)
  2325.  
  2326.             self.AppendDefaultData(skillIndex)
  2327.             self.AppendPartySkillData(skillGrade, skillLevel)
  2328.  
  2329.         elif player.SKILL_INDEX_RIDING == skillIndex:
  2330.  
  2331.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  2332.             self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  2333.  
  2334.         elif player.SKILL_INDEX_SUMMON == skillIndex:
  2335.  
  2336.             maxLevel = 10
  2337.  
  2338.             self.ClearToolTip()
  2339.             self.__SetSkillTitle(skillIndex, skillGrade)
  2340.  
  2341.             ## Description
  2342.             description = skill.GetSkillDescription(skillIndex)
  2343.             self.AppendDescription(description, 25)
  2344.  
  2345.             if skillLevel == 10:
  2346.                 self.AppendSpace(5)
  2347.                 self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2348.                 self.AppendTextLine(localemg.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  2349.  
  2350.             else:
  2351.                 self.AppendSpace(5)
  2352.                 self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2353.                 self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  2354.  
  2355.                 self.AppendSpace(5)
  2356.                 self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  2357.                 self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  2358.  
  2359.         elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2360.  
  2361.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2362.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2363.                 self.ResizeToolTip()
  2364.  
  2365.             self.AppendDefaultData(skillIndex)
  2366.             self.AppendSkillConditionData(skillIndex)
  2367.             self.AppendGuildSkillData(skillIndex, skillLevel)
  2368.  
  2369.         elif skillIndex == 172 or skillIndex == 173 or skillIndex == 174:
  2370.  
  2371.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2372.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2373.                 self.ResizeToolTip()
  2374.  
  2375.             self.AppendDefaultData(skillIndex)
  2376.             self.AppendDrogaSkillData(skillIndex, skillLevel)
  2377.  
  2378.         else:
  2379.  
  2380.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2381.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2382.                 self.ResizeToolTip()
  2383.  
  2384.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  2385.  
  2386.             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2387.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2388.  
  2389.             self.AppendDefaultData(skillIndex, skillGrade)
  2390.             self.AppendSkillConditionData(skillIndex)
  2391.             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2392.             self.AppendSkillRequirement(skillIndex, skillLevel)
  2393.  
  2394.         self.ShowToolTip()
  2395.  
  2396.     def __SetSkillTitle(self, skillIndex, skillGrade):
  2397.         self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  2398.         self.__AppendSkillGradeName(skillIndex, skillGrade)
  2399.  
  2400.     def __AppendSkillGradeName(self, skillIndex, skillGrade):      
  2401.         if self.SKILL_GRADE_NAME.has_key(skillGrade):
  2402.             self.AppendSpace(5)
  2403.             self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  2404.  
  2405.     def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  2406.         if 0 == skillIndex:
  2407.             return
  2408.  
  2409.         slotIndex = player.GetSkillSlotIndex(skillIndex)
  2410.  
  2411.         self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2412.         self.ResizeToolTip()
  2413.  
  2414.         self.ClearToolTip()
  2415.         self.__SetSkillTitle(skillIndex, skillGrade)       
  2416.         self.AppendDefaultData(skillIndex, skillGrade)
  2417.         self.AppendSkillConditionData(skillIndex)      
  2418.         self.ShowToolTip()
  2419.  
  2420.     def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2421.         self.ClearToolTip()
  2422.         self.__SetSkillTitle(skillIndex, skillGrade)
  2423.  
  2424.         ## Level Limit
  2425.         levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2426.         if levelLimit > 0:
  2427.  
  2428.             color = self.NORMAL_COLOR
  2429.             if player.GetStatus(player.LEVEL) < levelLimit:
  2430.                 color = self.NEGATIVE_COLOR
  2431.  
  2432.             self.AppendSpace(5)
  2433.             self.AppendTextLine(localemg.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2434.  
  2435.         ## Description
  2436.         description = skill.GetSkillDescription(skillIndex)
  2437.         self.AppendDescription(description, 25)
  2438.  
  2439.     def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2440.         self.ClearToolTip()
  2441.         self.__SetSkillTitle(skillIndex, skillGrade)
  2442.  
  2443.         ## Description
  2444.         description = skill.GetSkillDescription(skillIndex)
  2445.         self.AppendDescription(description, 25)
  2446.  
  2447.         if 1 == skillGrade:
  2448.             skillLevel += 19
  2449.         elif 2 == skillGrade:
  2450.             skillLevel += 29
  2451.         elif 3 == skillGrade:
  2452.             skillLevel = 50
  2453.  
  2454.         self.AppendSpace(5)
  2455.         self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2456.  
  2457.     def AppendSkillConditionData(self, skillIndex):
  2458.         conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2459.         if conditionDataCount > 0:
  2460.             self.AppendSpace(5)
  2461.             for i in xrange(conditionDataCount):
  2462.                 self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2463.  
  2464.     def AppendGuildSkillData(self, skillIndex, skillLevel):
  2465.         if skillIndex >=163 and skillIndex <= 171:
  2466.             if skillIndex == 167:
  2467.                 skillMaxLevel = 3
  2468.             elif skillIndex == 168:
  2469.                 skillMaxLevel = 8
  2470.             else:
  2471.                 skillMaxLevel = 1
  2472.         else:
  2473.             skillMaxLevel = 7
  2474.        
  2475.         skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2476.         skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2477.         ## Current Level
  2478.         if skillLevel > 0:
  2479.             if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2480.                 self.AppendSpace(5)
  2481.                 if skillLevel == skillMaxLevel:
  2482.                     self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2483.                 else:
  2484.                     self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2485.  
  2486.                 #####
  2487.  
  2488.                 for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2489.                     self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2490.                     #chat.AppendChat(chat.CHAT_TYPE_INFO, "wyglad opisu to: " + str(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage)))
  2491.  
  2492.                 ## Cooltime
  2493.                 coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2494.                 if coolTime > 0:
  2495.                     self.AppendTextLine(localemg.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2496.  
  2497.                 ## SP
  2498.                 needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2499.                 if needGSP > 0:
  2500.                     self.AppendTextLine(localemg.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2501.  
  2502.         ## Next Level
  2503.         if skillLevel < skillMaxLevel:
  2504.             if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2505.                 self.AppendSpace(5)
  2506.                 self.AppendTextLine(localemg.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2507.  
  2508.                 #####
  2509.  
  2510.                 for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2511.                     self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2512.  
  2513.                 ## Cooltime
  2514.                 coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2515.                 if coolTime > 0:
  2516.                     self.AppendTextLine(localemg.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2517.  
  2518.                 ## SP
  2519.                 needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2520.                 if needGSP > 0:
  2521.                     self.AppendTextLine(localemg.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2522.  
  2523.     def AppendDrogaSkillData(self, skillIndex, skillLevel):
  2524.         skillMaxLevel = 14
  2525.        
  2526.         ## Current Level
  2527.         if skillLevel > 0:
  2528.             self.AppendSpace(5)
  2529.             if skillLevel == skillMaxLevel:
  2530.                 self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2531.             else:
  2532.                 self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2533.  
  2534.             #####
  2535.             if skillIndex == 172:
  2536.                 if skillLevel == 1:
  2537.                     self.AppendTextLine("Sila +2", self.POSITIVE_COLOR)
  2538.                 elif skillLevel == 2:
  2539.                     self.AppendTextLine("Sila +3", self.POSITIVE_COLOR)
  2540.                     self.AppendTextLine("Max HP +1500", self.POSITIVE_COLOR)
  2541.                 elif skillLevel == 3:
  2542.                     self.AppendTextLine("Sila +3", self.POSITIVE_COLOR)
  2543.                     self.AppendTextLine("Max HP +2300", self.POSITIVE_COLOR)
  2544.                 elif skillLevel == 4:
  2545.                     self.AppendTextLine("Sila +4", self.POSITIVE_COLOR)
  2546.                     self.AppendTextLine("Max HP +3000", self.POSITIVE_COLOR)
  2547.                     self.AppendTextLine("Odporność na Potwory +2%", self.POSITIVE_COLOR)
  2548.                 elif skillLevel == 5:
  2549.                     self.AppendTextLine("Sila +6", self.POSITIVE_COLOR)
  2550.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2551.                     self.AppendTextLine("Odporność na Potwory +4%", self.POSITIVE_COLOR)
  2552.                 elif skillLevel == 6:
  2553.                     self.AppendTextLine("Sila +6", self.POSITIVE_COLOR)
  2554.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2555.                     self.AppendTextLine("Odporność na Potwory +5%", self.POSITIVE_COLOR)
  2556.                     self.AppendTextLine("Silny przeciwko Potworom +3%", self.POSITIVE_COLOR)
  2557.                 elif skillLevel == 7:
  2558.                     self.AppendTextLine("Sila +7", self.POSITIVE_COLOR)
  2559.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2560.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2561.                     self.AppendTextLine("Silny przeciwko Potworom +5%", self.POSITIVE_COLOR)
  2562.                 elif skillLevel == 8:
  2563.                     self.AppendTextLine("Sila +7", self.POSITIVE_COLOR)
  2564.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2565.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2566.                     self.AppendTextLine("Silny przeciwko Potworom +6%", self.POSITIVE_COLOR)
  2567.                     self.AppendTextLine("Odporność na Ludzi +2%", self.POSITIVE_COLOR)
  2568.                 elif skillLevel == 9:
  2569.                     self.AppendTextLine("Sila +8", self.POSITIVE_COLOR)
  2570.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2571.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2572.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2573.                     self.AppendTextLine("Odporność na Ludzi +4%", self.POSITIVE_COLOR)
  2574.                 elif skillLevel == 10:
  2575.                     self.AppendTextLine("Sila +8", self.POSITIVE_COLOR)
  2576.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2577.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2578.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2579.                     self.AppendTextLine("Odporność na Ludzi +5%", self.POSITIVE_COLOR)
  2580.                     self.AppendTextLine("Silny przeciwko Ludziom +2%", self.POSITIVE_COLOR)
  2581.                 elif skillLevel == 11:
  2582.                     self.AppendTextLine("Sila +9", self.POSITIVE_COLOR)
  2583.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2584.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2585.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2586.                     self.AppendTextLine("Odporność na Ludzi +6%", self.POSITIVE_COLOR)
  2587.                     self.AppendTextLine("Silny przeciwko Ludziom +4%", self.POSITIVE_COLOR)
  2588.                 elif skillLevel == 12:
  2589.                     self.AppendTextLine("Sila +9", self.POSITIVE_COLOR)
  2590.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2591.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2592.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2593.                     self.AppendTextLine("Odporność na Ludzi +7%", self.POSITIVE_COLOR)
  2594.                     self.AppendTextLine("Silny przeciwko Ludziom +5%", self.POSITIVE_COLOR)
  2595.                 elif skillLevel == 13:
  2596.                     self.AppendTextLine("Sila +9", self.POSITIVE_COLOR)
  2597.                     self.AppendTextLine("Max HP +5500", self.POSITIVE_COLOR)
  2598.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2599.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2600.                     self.AppendTextLine("Odporność na Ludzi +8%", self.POSITIVE_COLOR)
  2601.                     self.AppendTextLine("Silny przeciwko Ludziom +7%", self.POSITIVE_COLOR)
  2602.                     self.AppendTextLine("Obrażenia Umiejętności +2%", self.POSITIVE_COLOR)
  2603.                 elif skillLevel == 14:
  2604.                     self.AppendTextLine("Sila +10", self.POSITIVE_COLOR)
  2605.                     self.AppendTextLine("Max HP +6500", self.POSITIVE_COLOR)
  2606.                     self.AppendTextLine("Odporność na Potwory +10%", self.POSITIVE_COLOR)
  2607.                     self.AppendTextLine("Silny przeciwko Potworom +10%", self.POSITIVE_COLOR)
  2608.                     self.AppendTextLine("Odporność na Ludzi +10%", self.POSITIVE_COLOR)
  2609.                     self.AppendTextLine("Silny przeciwko Ludziom +10%", self.POSITIVE_COLOR)
  2610.                     self.AppendTextLine("Obrażenia Umiejętności +5%", self.POSITIVE_COLOR)
  2611.             elif skillIndex == 173:
  2612.                 if skillLevel == 1:
  2613.                     self.AppendTextLine("Inteligencja +2", self.POSITIVE_COLOR)
  2614.                 elif skillLevel == 2:
  2615.                     self.AppendTextLine("Inteligencja +3", self.POSITIVE_COLOR)
  2616.                     self.AppendTextLine("Max HP +1500", self.POSITIVE_COLOR)
  2617.                 elif skillLevel == 3:
  2618.                     self.AppendTextLine("Inteligencja +3", self.POSITIVE_COLOR)
  2619.                     self.AppendTextLine("Max HP +2300", self.POSITIVE_COLOR)
  2620.                 elif skillLevel == 4:
  2621.                     self.AppendTextLine("Inteligencja +4", self.POSITIVE_COLOR)
  2622.                     self.AppendTextLine("Max HP +3000", self.POSITIVE_COLOR)
  2623.                     self.AppendTextLine("Odporność na Potwory +2%", self.POSITIVE_COLOR)
  2624.                 elif skillLevel == 5:
  2625.                     self.AppendTextLine("Inteligencja +6", self.POSITIVE_COLOR)
  2626.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2627.                     self.AppendTextLine("Odporność na Potwory +4%", self.POSITIVE_COLOR)
  2628.                 elif skillLevel == 6:
  2629.                     self.AppendTextLine("Inteligencja +6", self.POSITIVE_COLOR)
  2630.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2631.                     self.AppendTextLine("Odporność na Potwory +5%", self.POSITIVE_COLOR)
  2632.                     self.AppendTextLine("Silny przeciwko Potworom +3%", self.POSITIVE_COLOR)
  2633.                 elif skillLevel == 7:
  2634.                     self.AppendTextLine("Inteligencja +7", self.POSITIVE_COLOR)
  2635.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2636.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2637.                     self.AppendTextLine("Silny przeciwko Potworom +5%", self.POSITIVE_COLOR)
  2638.                 elif skillLevel == 8:
  2639.                     self.AppendTextLine("Inteligencja +7", self.POSITIVE_COLOR)
  2640.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2641.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2642.                     self.AppendTextLine("Silny przeciwko Potworom +6%", self.POSITIVE_COLOR)
  2643.                     self.AppendTextLine("Odporność na Ludzi +2%", self.POSITIVE_COLOR)
  2644.                 elif skillLevel == 9:
  2645.                     self.AppendTextLine("Inteligencja +8", self.POSITIVE_COLOR)
  2646.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2647.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2648.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2649.                     self.AppendTextLine("Odporność na Ludzi +4%", self.POSITIVE_COLOR)
  2650.                 elif skillLevel == 10:
  2651.                     self.AppendTextLine("Inteligencja +8", self.POSITIVE_COLOR)
  2652.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2653.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2654.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2655.                     self.AppendTextLine("Odporność na Ludzi +5%", self.POSITIVE_COLOR)
  2656.                     self.AppendTextLine("Silny przeciwko Ludziom +2%", self.POSITIVE_COLOR)
  2657.                 elif skillLevel == 11:
  2658.                     self.AppendTextLine("Inteligencja +9", self.POSITIVE_COLOR)
  2659.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2660.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2661.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2662.                     self.AppendTextLine("Odporność na Ludzi +6%", self.POSITIVE_COLOR)
  2663.                     self.AppendTextLine("Silny przeciwko Ludziom +4%", self.POSITIVE_COLOR)
  2664.                 elif skillLevel == 12:
  2665.                     self.AppendTextLine("Inteligencja +9", self.POSITIVE_COLOR)
  2666.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2667.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2668.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2669.                     self.AppendTextLine("Odporność na Ludzi +7%", self.POSITIVE_COLOR)
  2670.                     self.AppendTextLine("Silny przeciwko Ludziom +5%", self.POSITIVE_COLOR)
  2671.                 elif skillLevel == 13:
  2672.                     self.AppendTextLine("Inteligencja +9", self.POSITIVE_COLOR)
  2673.                     self.AppendTextLine("Max HP +5500", self.POSITIVE_COLOR)
  2674.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2675.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2676.                     self.AppendTextLine("Odporność na Ludzi +8%", self.POSITIVE_COLOR)
  2677.                     self.AppendTextLine("Silny przeciwko Ludziom +7%", self.POSITIVE_COLOR)
  2678.                     self.AppendTextLine("Obrażenia Umiejętności +2%", self.POSITIVE_COLOR)
  2679.                 elif skillLevel == 14:
  2680.                     self.AppendTextLine("Inteligencja +10", self.POSITIVE_COLOR)
  2681.                     self.AppendTextLine("Max HP +6500", self.POSITIVE_COLOR)
  2682.                     self.AppendTextLine("Odporność na Potwory +10%", self.POSITIVE_COLOR)
  2683.                     self.AppendTextLine("Silny przeciwko Potworom +10%", self.POSITIVE_COLOR)
  2684.                     self.AppendTextLine("Odporność na Ludzi +10%", self.POSITIVE_COLOR)
  2685.                     self.AppendTextLine("Silny przeciwko Ludziom +10%", self.POSITIVE_COLOR)
  2686.                     self.AppendTextLine("Obrażenia Umiejętności +5%", self.POSITIVE_COLOR)
  2687.             elif skillIndex == 174:
  2688.                 if skillLevel == 1:
  2689.                     self.AppendTextLine("Zręczność +2", self.POSITIVE_COLOR)
  2690.                 elif skillLevel == 2:
  2691.                     self.AppendTextLine("Zręczność +3", self.POSITIVE_COLOR)
  2692.                     self.AppendTextLine("Max HP +1500", self.POSITIVE_COLOR)
  2693.                 elif skillLevel == 3:
  2694.                     self.AppendTextLine("Zręczność +3", self.POSITIVE_COLOR)
  2695.                     self.AppendTextLine("Max HP +2300", self.POSITIVE_COLOR)
  2696.                 elif skillLevel == 4:
  2697.                     self.AppendTextLine("Zręczność +4", self.POSITIVE_COLOR)
  2698.                     self.AppendTextLine("Max HP +3000", self.POSITIVE_COLOR)
  2699.                     self.AppendTextLine("Odporność na Potwory +2%", self.POSITIVE_COLOR)
  2700.                 elif skillLevel == 5:
  2701.                     self.AppendTextLine("Zręczność +6", self.POSITIVE_COLOR)
  2702.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2703.                     self.AppendTextLine("Odporność na Potwory +4%", self.POSITIVE_COLOR)
  2704.                 elif skillLevel == 6:
  2705.                     self.AppendTextLine("Zręczność +6", self.POSITIVE_COLOR)
  2706.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2707.                     self.AppendTextLine("Odporność na Potwory +5%", self.POSITIVE_COLOR)
  2708.                     self.AppendTextLine("Silny przeciwko Potworom +3%", self.POSITIVE_COLOR)
  2709.                 elif skillLevel == 7:
  2710.                     self.AppendTextLine("Zręczność +7", self.POSITIVE_COLOR)
  2711.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2712.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2713.                     self.AppendTextLine("Silny przeciwko Potworom +5%", self.POSITIVE_COLOR)
  2714.                 elif skillLevel == 8:
  2715.                     self.AppendTextLine("Zręczność +7", self.POSITIVE_COLOR)
  2716.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2717.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2718.                     self.AppendTextLine("Silny przeciwko Potworom +6%", self.POSITIVE_COLOR)
  2719.                     self.AppendTextLine("Odporność na Ludzi +2%", self.POSITIVE_COLOR)
  2720.                 elif skillLevel == 9:
  2721.                     self.AppendTextLine("Zręczność +8", self.POSITIVE_COLOR)
  2722.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2723.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2724.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2725.                     self.AppendTextLine("Odporność na Ludzi +4%", self.POSITIVE_COLOR)
  2726.                 elif skillLevel == 10:
  2727.                     self.AppendTextLine("Zręczność +8", self.POSITIVE_COLOR)
  2728.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2729.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2730.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2731.                     self.AppendTextLine("Odporność na Ludzi +5%", self.POSITIVE_COLOR)
  2732.                     self.AppendTextLine("Silny przeciwko Ludziom +2%", self.POSITIVE_COLOR)
  2733.                 elif skillLevel == 11:
  2734.                     self.AppendTextLine("Zręczność +9", self.POSITIVE_COLOR)
  2735.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2736.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2737.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2738.                     self.AppendTextLine("Odporność na Ludzi +6%", self.POSITIVE_COLOR)
  2739.                     self.AppendTextLine("Silny przeciwko Ludziom +4%", self.POSITIVE_COLOR)
  2740.                 elif skillLevel == 12:
  2741.                     self.AppendTextLine("Zręczność +9", self.POSITIVE_COLOR)
  2742.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2743.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2744.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2745.                     self.AppendTextLine("Odporność na Ludzi +7%", self.POSITIVE_COLOR)
  2746.                     self.AppendTextLine("Silny przeciwko Ludziom +5%", self.POSITIVE_COLOR)
  2747.                 elif skillLevel == 13:
  2748.                     self.AppendTextLine("Zręczność +9", self.POSITIVE_COLOR)
  2749.                     self.AppendTextLine("Max HP +5500", self.POSITIVE_COLOR)
  2750.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2751.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2752.                     self.AppendTextLine("Odporność na Ludzi +8%", self.POSITIVE_COLOR)
  2753.                     self.AppendTextLine("Silny przeciwko Ludziom +7%", self.POSITIVE_COLOR)
  2754.                     self.AppendTextLine("Obrażenia Umiejętności +2%", self.POSITIVE_COLOR)
  2755.                 elif skillLevel == 14:
  2756.                     self.AppendTextLine("Zręczność +10", self.POSITIVE_COLOR)
  2757.                     self.AppendTextLine("Max HP +6500", self.POSITIVE_COLOR)
  2758.                     self.AppendTextLine("Odporność na Potwory +10%", self.POSITIVE_COLOR)
  2759.                     self.AppendTextLine("Silny przeciwko Potworom +10%", self.POSITIVE_COLOR)
  2760.                     self.AppendTextLine("Odporność na Ludzi +10%", self.POSITIVE_COLOR)
  2761.                     self.AppendTextLine("Silny przeciwko Ludziom +10%", self.POSITIVE_COLOR)
  2762.                     self.AppendTextLine("Obrażenia Umiejętności +5%", self.POSITIVE_COLOR)
  2763.  
  2764.         ## Next Level
  2765.         if skillLevel < skillMaxLevel:
  2766.             self.AppendSpace(5)
  2767.             self.AppendTextLine(localemg.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2768.             #####
  2769.             skillLevelNext = skillLevel + 1
  2770.             if skillIndex == 172:
  2771.                 if skillLevelNext == 1:
  2772.                     self.AppendTextLine("Sila +2", self.POSITIVE_COLOR)
  2773.                 elif skillLevelNext == 2:
  2774.                     self.AppendTextLine("Sila +3", self.POSITIVE_COLOR)
  2775.                     self.AppendTextLine("Max HP +1500", self.POSITIVE_COLOR)
  2776.                 elif skillLevelNext == 3:
  2777.                     self.AppendTextLine("Sila +3", self.POSITIVE_COLOR)
  2778.                     self.AppendTextLine("Max HP +2300", self.POSITIVE_COLOR)
  2779.                 elif skillLevelNext == 4:
  2780.                     self.AppendTextLine("Sila +4", self.POSITIVE_COLOR)
  2781.                     self.AppendTextLine("Max HP +3000", self.POSITIVE_COLOR)
  2782.                     self.AppendTextLine("Odporność na Potwory +2%", self.POSITIVE_COLOR)
  2783.                 elif skillLevelNext == 5:
  2784.                     self.AppendTextLine("Sila +6", self.POSITIVE_COLOR)
  2785.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2786.                     self.AppendTextLine("Odporność na Potwory +4%", self.POSITIVE_COLOR)
  2787.                 elif skillLevelNext == 6:
  2788.                     self.AppendTextLine("Sila +6", self.POSITIVE_COLOR)
  2789.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2790.                     self.AppendTextLine("Odporność na Potwory +5%", self.POSITIVE_COLOR)
  2791.                     self.AppendTextLine("Silny przeciwko Potworom +3%", self.POSITIVE_COLOR)
  2792.                 elif skillLevelNext == 7:
  2793.                     self.AppendTextLine("Sila +7", self.POSITIVE_COLOR)
  2794.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2795.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2796.                     self.AppendTextLine("Silny przeciwko Potworom +5%", self.POSITIVE_COLOR)
  2797.                 elif skillLevelNext == 8:
  2798.                     self.AppendTextLine("Sila +7", self.POSITIVE_COLOR)
  2799.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2800.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2801.                     self.AppendTextLine("Silny przeciwko Potworom +6%", self.POSITIVE_COLOR)
  2802.                     self.AppendTextLine("Odporność na Ludzi +2%", self.POSITIVE_COLOR)
  2803.                 elif skillLevelNext == 9:
  2804.                     self.AppendTextLine("Sila +8", self.POSITIVE_COLOR)
  2805.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2806.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2807.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2808.                     self.AppendTextLine("Odporność na Ludzi +4%", self.POSITIVE_COLOR)
  2809.                 elif skillLevelNext == 10:
  2810.                     self.AppendTextLine("Sila +8", self.POSITIVE_COLOR)
  2811.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2812.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2813.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2814.                     self.AppendTextLine("Odporność na Ludzi +5%", self.POSITIVE_COLOR)
  2815.                     self.AppendTextLine("Silny przeciwko Ludziom +2%", self.POSITIVE_COLOR)
  2816.                 elif skillLevelNext == 11:
  2817.                     self.AppendTextLine("Sila +9", self.POSITIVE_COLOR)
  2818.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2819.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2820.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2821.                     self.AppendTextLine("Odporność na Ludzi +6%", self.POSITIVE_COLOR)
  2822.                     self.AppendTextLine("Silny przeciwko Ludziom +4%", self.POSITIVE_COLOR)
  2823.                 elif skillLevelNext == 12:
  2824.                     self.AppendTextLine("Sila +9", self.POSITIVE_COLOR)
  2825.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2826.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2827.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2828.                     self.AppendTextLine("Odporność na Ludzi +7%", self.POSITIVE_COLOR)
  2829.                     self.AppendTextLine("Silny przeciwko Ludziom +5%", self.POSITIVE_COLOR)
  2830.                 elif skillLevelNext == 13:
  2831.                     self.AppendTextLine("Sila +9", self.POSITIVE_COLOR)
  2832.                     self.AppendTextLine("Max HP +5500", self.POSITIVE_COLOR)
  2833.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2834.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2835.                     self.AppendTextLine("Odporność na Ludzi +8%", self.POSITIVE_COLOR)
  2836.                     self.AppendTextLine("Silny przeciwko Ludziom +7%", self.POSITIVE_COLOR)
  2837.                     self.AppendTextLine("Obrażenia Umiejętności +2%", self.POSITIVE_COLOR)
  2838.                 elif skillLevelNext == 14:
  2839.                     self.AppendTextLine("Sila +10", self.POSITIVE_COLOR)
  2840.                     self.AppendTextLine("Max HP +6500", self.POSITIVE_COLOR)
  2841.                     self.AppendTextLine("Odporność na Potwory +10%", self.POSITIVE_COLOR)
  2842.                     self.AppendTextLine("Silny przeciwko Potworom +10%", self.POSITIVE_COLOR)
  2843.                     self.AppendTextLine("Odporność na Ludzi +10%", self.POSITIVE_COLOR)
  2844.                     self.AppendTextLine("Silny przeciwko Ludziom +10%", self.POSITIVE_COLOR)
  2845.                     self.AppendTextLine("Obrażenia Umiejętności +5%", self.POSITIVE_COLOR)
  2846.             elif skillIndex == 173:
  2847.                 if skillLevelNext == 1:
  2848.                     self.AppendTextLine("Inteligencja +2", self.POSITIVE_COLOR)
  2849.                 elif skillLevelNext == 2:
  2850.                     self.AppendTextLine("Inteligencja +3", self.POSITIVE_COLOR)
  2851.                     self.AppendTextLine("Max HP +1500", self.POSITIVE_COLOR)
  2852.                 elif skillLevelNext == 3:
  2853.                     self.AppendTextLine("Inteligencja +3", self.POSITIVE_COLOR)
  2854.                     self.AppendTextLine("Max HP +2300", self.POSITIVE_COLOR)
  2855.                 elif skillLevelNext == 4:
  2856.                     self.AppendTextLine("Inteligencja +4", self.POSITIVE_COLOR)
  2857.                     self.AppendTextLine("Max HP +3000", self.POSITIVE_COLOR)
  2858.                     self.AppendTextLine("Odporność na Potwory +2%", self.POSITIVE_COLOR)
  2859.                 elif skillLevelNext == 5:
  2860.                     self.AppendTextLine("Inteligencja +6", self.POSITIVE_COLOR)
  2861.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2862.                     self.AppendTextLine("Odporność na Potwory +4%", self.POSITIVE_COLOR)
  2863.                 elif skillLevelNext == 6:
  2864.                     self.AppendTextLine("Inteligencja +6", self.POSITIVE_COLOR)
  2865.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2866.                     self.AppendTextLine("Odporność na Potwory +5%", self.POSITIVE_COLOR)
  2867.                     self.AppendTextLine("Silny przeciwko Potworom +3%", self.POSITIVE_COLOR)
  2868.                 elif skillLevelNext == 7:
  2869.                     self.AppendTextLine("Inteligencja +7", self.POSITIVE_COLOR)
  2870.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2871.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2872.                     self.AppendTextLine("Silny przeciwko Potworom +5%", self.POSITIVE_COLOR)
  2873.                 elif skillLevelNext == 8:
  2874.                     self.AppendTextLine("Inteligencja +7", self.POSITIVE_COLOR)
  2875.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2876.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2877.                     self.AppendTextLine("Silny przeciwko Potworom +6%", self.POSITIVE_COLOR)
  2878.                     self.AppendTextLine("Odporność na Ludzi +2%", self.POSITIVE_COLOR)
  2879.                 elif skillLevelNext == 9:
  2880.                     self.AppendTextLine("Inteligencja +8", self.POSITIVE_COLOR)
  2881.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2882.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2883.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2884.                     self.AppendTextLine("Odporność na Ludzi +4%", self.POSITIVE_COLOR)
  2885.                 elif skillLevelNext == 10:
  2886.                     self.AppendTextLine("Inteligencja +8", self.POSITIVE_COLOR)
  2887.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2888.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2889.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2890.                     self.AppendTextLine("Odporność na Ludzi +5%", self.POSITIVE_COLOR)
  2891.                     self.AppendTextLine("Silny przeciwko Ludziom +2%", self.POSITIVE_COLOR)
  2892.                 elif skillLevelNext == 11:
  2893.                     self.AppendTextLine("Inteligencja +9", self.POSITIVE_COLOR)
  2894.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2895.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2896.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2897.                     self.AppendTextLine("Odporność na Ludzi +6%", self.POSITIVE_COLOR)
  2898.                     self.AppendTextLine("Silny przeciwko Ludziom +4%", self.POSITIVE_COLOR)
  2899.                 elif skillLevelNext == 12:
  2900.                     self.AppendTextLine("Inteligencja +9", self.POSITIVE_COLOR)
  2901.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2902.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2903.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2904.                     self.AppendTextLine("Odporność na Ludzi +7%", self.POSITIVE_COLOR)
  2905.                     self.AppendTextLine("Silny przeciwko Ludziom +5%", self.POSITIVE_COLOR)
  2906.                 elif skillLevelNext == 13:
  2907.                     self.AppendTextLine("Inteligencja +9", self.POSITIVE_COLOR)
  2908.                     self.AppendTextLine("Max HP +5500", self.POSITIVE_COLOR)
  2909.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2910.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2911.                     self.AppendTextLine("Odporność na Ludzi +8%", self.POSITIVE_COLOR)
  2912.                     self.AppendTextLine("Silny przeciwko Ludziom +7%", self.POSITIVE_COLOR)
  2913.                     self.AppendTextLine("Obrażenia Umiejętności +2%", self.POSITIVE_COLOR)
  2914.                 elif skillLevelNext == 14:
  2915.                     self.AppendTextLine("Inteligencja +10", self.POSITIVE_COLOR)
  2916.                     self.AppendTextLine("Max HP +6500", self.POSITIVE_COLOR)
  2917.                     self.AppendTextLine("Odporność na Potwory +10%", self.POSITIVE_COLOR)
  2918.                     self.AppendTextLine("Silny przeciwko Potworom +10%", self.POSITIVE_COLOR)
  2919.                     self.AppendTextLine("Odporność na Ludzi +10%", self.POSITIVE_COLOR)
  2920.                     self.AppendTextLine("Silny przeciwko Ludziom +10%", self.POSITIVE_COLOR)
  2921.                     self.AppendTextLine("Obrażenia Umiejętności +5%", self.POSITIVE_COLOR)
  2922.             elif skillIndex == 174:
  2923.                 if skillLevelNext == 1:
  2924.                     self.AppendTextLine("Zręczność +2", self.POSITIVE_COLOR)
  2925.                 elif skillLevelNext == 2:
  2926.                     self.AppendTextLine("Zręczność +3", self.POSITIVE_COLOR)
  2927.                     self.AppendTextLine("Max HP +1500", self.POSITIVE_COLOR)
  2928.                 elif skillLevelNext == 3:
  2929.                     self.AppendTextLine("Zręczność +3", self.POSITIVE_COLOR)
  2930.                     self.AppendTextLine("Max HP +2300", self.POSITIVE_COLOR)
  2931.                 elif skillLevelNext == 4:
  2932.                     self.AppendTextLine("Zręczność +4", self.POSITIVE_COLOR)
  2933.                     self.AppendTextLine("Max HP +3000", self.POSITIVE_COLOR)
  2934.                     self.AppendTextLine("Odporność na Potwory +2%", self.POSITIVE_COLOR)
  2935.                 elif skillLevelNext == 5:
  2936.                     self.AppendTextLine("Zręczność +6", self.POSITIVE_COLOR)
  2937.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2938.                     self.AppendTextLine("Odporność na Potwory +4%", self.POSITIVE_COLOR)
  2939.                 elif skillLevelNext == 6:
  2940.                     self.AppendTextLine("Zręczność +6", self.POSITIVE_COLOR)
  2941.                     self.AppendTextLine("Max HP +3500", self.POSITIVE_COLOR)
  2942.                     self.AppendTextLine("Odporność na Potwory +5%", self.POSITIVE_COLOR)
  2943.                     self.AppendTextLine("Silny przeciwko Potworom +3%", self.POSITIVE_COLOR)
  2944.                 elif skillLevelNext == 7:
  2945.                     self.AppendTextLine("Zręczność +7", self.POSITIVE_COLOR)
  2946.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2947.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2948.                     self.AppendTextLine("Silny przeciwko Potworom +5%", self.POSITIVE_COLOR)
  2949.                 elif skillLevelNext == 8:
  2950.                     self.AppendTextLine("Zręczność +7", self.POSITIVE_COLOR)
  2951.                     self.AppendTextLine("Max HP +4000", self.POSITIVE_COLOR)
  2952.                     self.AppendTextLine("Odporność na Potwory +6%", self.POSITIVE_COLOR)
  2953.                     self.AppendTextLine("Silny przeciwko Potworom +6%", self.POSITIVE_COLOR)
  2954.                     self.AppendTextLine("Odporność na Ludzi +2%", self.POSITIVE_COLOR)
  2955.                 elif skillLevelNext == 9:
  2956.                     self.AppendTextLine("Zręczność +8", self.POSITIVE_COLOR)
  2957.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2958.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2959.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2960.                     self.AppendTextLine("Odporność na Ludzi +4%", self.POSITIVE_COLOR)
  2961.                 elif skillLevelNext == 10:
  2962.                     self.AppendTextLine("Zręczność +8", self.POSITIVE_COLOR)
  2963.                     self.AppendTextLine("Max HP +4500", self.POSITIVE_COLOR)
  2964.                     self.AppendTextLine("Odporność na Potwory +7%", self.POSITIVE_COLOR)
  2965.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2966.                     self.AppendTextLine("Odporność na Ludzi +5%", self.POSITIVE_COLOR)
  2967.                     self.AppendTextLine("Silny przeciwko Ludziom +2%", self.POSITIVE_COLOR)
  2968.                 elif skillLevelNext == 11:
  2969.                     self.AppendTextLine("Zręczność +9", self.POSITIVE_COLOR)
  2970.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2971.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2972.                     self.AppendTextLine("Silny przeciwko Potworom +7%", self.POSITIVE_COLOR)
  2973.                     self.AppendTextLine("Odporność na Ludzi +6%", self.POSITIVE_COLOR)
  2974.                     self.AppendTextLine("Silny przeciwko Ludziom +4%", self.POSITIVE_COLOR)
  2975.                 elif skillLevelNext == 12:
  2976.                     self.AppendTextLine("Zręczność +9", self.POSITIVE_COLOR)
  2977.                     self.AppendTextLine("Max HP +5000", self.POSITIVE_COLOR)
  2978.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2979.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2980.                     self.AppendTextLine("Odporność na Ludzi +7%", self.POSITIVE_COLOR)
  2981.                     self.AppendTextLine("Silny przeciwko Ludziom +5%", self.POSITIVE_COLOR)
  2982.                 elif skillLevelNext == 13:
  2983.                     self.AppendTextLine("Zręczność +9", self.POSITIVE_COLOR)
  2984.                     self.AppendTextLine("Max HP +5500", self.POSITIVE_COLOR)
  2985.                     self.AppendTextLine("Odporność na Potwory +8%", self.POSITIVE_COLOR)
  2986.                     self.AppendTextLine("Silny przeciwko Potworom +8%", self.POSITIVE_COLOR)
  2987.                     self.AppendTextLine("Odporność na Ludzi +8%", self.POSITIVE_COLOR)
  2988.                     self.AppendTextLine("Silny przeciwko Ludziom +7%", self.POSITIVE_COLOR)
  2989.                     self.AppendTextLine("Obrażenia Umiejętności +2%", self.POSITIVE_COLOR)
  2990.                 elif skillLevelNext == 14:
  2991.                     self.AppendTextLine("Zręczność +10", self.POSITIVE_COLOR)
  2992.                     self.AppendTextLine("Max HP +6500", self.POSITIVE_COLOR)
  2993.                     self.AppendTextLine("Odporność na Potwory +10%", self.POSITIVE_COLOR)
  2994.                     self.AppendTextLine("Silny przeciwko Potworom +10%", self.POSITIVE_COLOR)
  2995.                     self.AppendTextLine("Odporność na Ludzi +10%", self.POSITIVE_COLOR)
  2996.                     self.AppendTextLine("Silny przeciwko Ludziom +10%", self.POSITIVE_COLOR)
  2997.                     self.AppendTextLine("Obrażenia Umiejętności +5%", self.POSITIVE_COLOR)
  2998.  
  2999.  
  3000.     def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  3001.  
  3002.         self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  3003.         self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  3004.  
  3005.         skillLevelUpPoint = 1
  3006.         realSkillGrade = player.GetSkillGrade(slotIndex)
  3007.         skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  3008.         skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  3009.  
  3010.         ## Current Level
  3011.         if skillLevel > 0:
  3012.             if self.HasSkillLevelDescription(skillIndex, skillLevel):
  3013.                 self.AppendSpace(5)
  3014.                 if skillGrade == skill.SKILL_GRADE_COUNT:
  3015.                     pass
  3016.                 elif skillLevel == skillMaxLevelEnd:
  3017.                     self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  3018.                 else:
  3019.                     self.AppendTextLine(localemg.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  3020.                 self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  3021.  
  3022.         ## Next Level
  3023.         if skillGrade != skill.SKILL_GRADE_COUNT:
  3024.             if skillLevel < skillMaxLevelEnd:
  3025.                 if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  3026.                     self.AppendSpace(5)
  3027.                     ## HP??, ???? ????? ??
  3028.                     if skillIndex == 141 or skillIndex == 142:
  3029.                         self.AppendTextLine(localemg.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  3030.                     else:
  3031.                         self.AppendTextLine(localemg.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  3032.                     self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  3033.  
  3034.     def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  3035.  
  3036.         affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  3037.         if affectDataCount > 0:
  3038.             for i in xrange(affectDataCount):
  3039.                 type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  3040.  
  3041.                 if not self.AFFECT_NAME_DICT.has_key(type):
  3042.                     continue
  3043.  
  3044.                 minValue = int(minValue)
  3045.                 maxValue = int(maxValue)
  3046.                 affectText = self.AFFECT_NAME_DICT[type]
  3047.  
  3048.                 if "HP" == type:
  3049.                     if minValue < 0 and maxValue < 0:
  3050.                         minValue *= -1
  3051.                         maxValue *= -1
  3052.  
  3053.                     else:
  3054.                         affectText = localemg.TOOLTIP_SKILL_AFFECT_HEAL
  3055.  
  3056.                 affectText += str(minValue)
  3057.                 if minValue != maxValue:
  3058.                     affectText += " - " + str(maxValue)
  3059.                 affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  3060.  
  3061.                 #import debugInfo
  3062.                 #if debugInfo.IsDebugMode():
  3063.                 #   affectText = "!!" + affectText
  3064.  
  3065.                 self.AppendTextLine(affectText, color)
  3066.            
  3067.         else:
  3068.             for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  3069.                 self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  3070.        
  3071.  
  3072.         ## Duration
  3073.         duration = skill.GetDuration(skillIndex, skillPercentage)
  3074.         if duration > 0:
  3075.             self.AppendTextLine(localemg.TOOLTIP_SKILL_DURATION % (duration), color)
  3076.  
  3077.         ## Cooltime
  3078.         coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  3079.         if coolTime > 0:
  3080.             self.AppendTextLine(localemg.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  3081.  
  3082.         ## SP
  3083.         needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  3084.         if needSP != 0:
  3085.             continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  3086.  
  3087.             if skill.IsUseHPSkill(skillIndex):
  3088.                 self.AppendNeedHP(needSP, continuationSP, color)
  3089.             else:
  3090.                 self.AppendNeedSP(needSP, continuationSP, color)
  3091.  
  3092.     def AppendSkillRequirement(self, skillIndex, skillLevel):
  3093.  
  3094.         skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  3095.  
  3096.         if skillLevel >= skillMaxLevel:
  3097.             return
  3098.  
  3099.         isAppendHorizontalLine = False
  3100.  
  3101.         ## Requirement
  3102.         if skill.IsSkillRequirement(skillIndex):
  3103.  
  3104.             if not isAppendHorizontalLine:
  3105.                 isAppendHorizontalLine = True
  3106.                 self.AppendHorizontalLine()
  3107.  
  3108.             requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  3109.  
  3110.             color = self.CANNOT_LEVEL_UP_COLOR
  3111.             if skill.CheckRequirementSueccess(skillIndex):
  3112.                 color = self.CAN_LEVEL_UP_COLOR
  3113.             self.AppendTextLine(localemg.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  3114.  
  3115.         ## Require Stat
  3116.         requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  3117.         if requireStatCount > 0:
  3118.  
  3119.             for i in xrange(requireStatCount):
  3120.                 type, level = skill.GetSkillRequireStatData(skillIndex, i)
  3121.                 if self.POINT_NAME_DICT.has_key(type):
  3122.  
  3123.                     if not isAppendHorizontalLine:
  3124.                         isAppendHorizontalLine = True
  3125.                         self.AppendHorizontalLine()
  3126.  
  3127.                     name = self.POINT_NAME_DICT[type]
  3128.                     color = self.CANNOT_LEVEL_UP_COLOR
  3129.                     if player.GetStatus(type) >= level:
  3130.                         color = self.CAN_LEVEL_UP_COLOR
  3131.                     self.AppendTextLine(localemg.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  3132.  
  3133.     def HasSkillLevelDescription(self, skillIndex, skillLevel):
  3134.         if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  3135.             return True
  3136.         if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  3137.             return True
  3138.         if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  3139.             return True
  3140.  
  3141.         return False
  3142.  
  3143.     def AppendMasterAffectDescription(self, index, desc, color):
  3144.         self.AppendTextLine(desc, color)
  3145.  
  3146.     def AppendNextAffectDescription(self, index, desc):
  3147.         self.AppendTextLine(desc, self.DISABLE_COLOR)
  3148.  
  3149.     def AppendNeedHP(self, needSP, continuationSP, color):
  3150.  
  3151.         self.AppendTextLine(localemg.TOOLTIP_NEED_HP % (needSP), color)
  3152.  
  3153.         if continuationSP > 0:
  3154.             self.AppendTextLine(localemg.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  3155.  
  3156.     def AppendNeedSP(self, needSP, continuationSP, color):
  3157.  
  3158.         if -1 == needSP:
  3159.             self.AppendTextLine(localemg.TOOLTIP_NEED_ALL_SP, color)
  3160.  
  3161.         else:
  3162.             self.AppendTextLine(localemg.TOOLTIP_NEED_SP % (needSP), color)
  3163.  
  3164.         if continuationSP > 0:
  3165.             self.AppendTextLine(localemg.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  3166.  
  3167.     def AppendPartySkillData(self, skillGrade, skillLevel):
  3168.  
  3169.         if 1 == skillGrade:
  3170.             skillLevel += 19
  3171.         elif 2 == skillGrade:
  3172.             skillLevel += 29
  3173.         elif 3 == skillGrade:
  3174.             skillLevel =  40
  3175.  
  3176.         if skillLevel <= 0:
  3177.             return
  3178.  
  3179.         skillIndex = player.SKILL_INDEX_TONGSOL
  3180.         slotIndex = player.GetSkillSlotIndex(skillIndex)
  3181.         skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  3182.         if localemg.IsBRAZIL():
  3183.             k = skillPower
  3184.         else:
  3185.             k = player.GetSkillLevel(skillIndex) / 100.0
  3186.         self.AppendSpace(5)
  3187.         self.AutoAppendTextLine(localemg.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  3188.  
  3189.         if skillLevel>=10:
  3190.             self.AutoAppendTextLine(localemg.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  3191.  
  3192.         if skillLevel>=20:
  3193.             self.AutoAppendTextLine(localemg.PARTY_SKILL_BERSERKER  % chop(1 + 5 * k))
  3194.             self.AutoAppendTextLine(localemg.PARTY_SKILL_TANKER     % chop(50 + 1450 * k))
  3195.  
  3196.         if skillLevel>=25:
  3197.             self.AutoAppendTextLine(localemg.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  3198.  
  3199.         if skillLevel>=35:
  3200.             self.AutoAppendTextLine(localemg.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  3201.  
  3202.         if skillLevel>=40:
  3203.             self.AutoAppendTextLine(localemg.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  3204.  
  3205.         self.AlignHorizonalCenter()
  3206.  
  3207.     def __AppendSummonDescription(self, skillLevel, color):
  3208.         if skillLevel > 1:
  3209.             self.AppendTextLine(localemg.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  3210.         elif 1 == skillLevel:
  3211.             self.AppendTextLine(localemg.SKILL_SUMMON_DESCRIPTION % (15), color)
  3212.         elif 0 == skillLevel:
  3213.             self.AppendTextLine(localemg.SKILL_SUMMON_DESCRIPTION % (10), color)
  3214.  
  3215.  
  3216. if __name__ == "__main__"
  3217.     import app
  3218.     import wndMgr
  3219.     import systemSetting
  3220.     import mouseModule
  3221.     import grp
  3222.     import uimg
  3223.    
  3224.     #wndMgr.SetOutlineFlag(True)
  3225.  
  3226.     app.SetMouseHandler(mouseModule.mouseController)
  3227.     app.SetHairColorEnable(True)
  3228.     wndMgr.SetMouseHandler(mouseModule.mouseController)
  3229.     wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  3230.     app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  3231.     mouseModule.mouseController.Create()
  3232.  
  3233.     toolTip = ItemToolTip()
  3234.     toolTip.ClearToolTip()
  3235.     #toolTip.AppendTextLine("Test")
  3236.     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."
  3237.     summ = ""
  3238.  
  3239.     toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  3240.     toolTip.Show()
  3241.    
  3242.     app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement