Advertisement
deadx2

Untitled

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