Guest User

Untitled

a guest
Nov 3rd, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 75.73 KB | None | 0 0
  1. import dbg
  2. import player
  3. import item
  4. import grp
  5. import wndMgr
  6. import skill
  7. import shop
  8. import exchange
  9. import grpText
  10. import safebox
  11. import localeInfo
  12. import app
  13. import background
  14. import nonplayer
  15. import chr
  16.  
  17. import ui
  18. import mouseModule
  19. import constInfo
  20.  
  21. 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 SplitDescription(desc, limit):
  31.     total_tokens = desc.split()
  32.     line_tokens = []
  33.     line_len = 0
  34.     lines = []
  35.     for token in total_tokens:
  36.         if "|" in token:
  37.             sep_pos = token.find("|")
  38.             line_tokens.append(token[:sep_pos])
  39.  
  40.             lines.append(" ".join(line_tokens))
  41.             line_len = len(token) - (sep_pos + 1)
  42.             line_tokens = [token[sep_pos+1:]]
  43.         else:
  44.             line_len += len(token)
  45.             if len(line_tokens) + line_len > limit:
  46.                 lines.append(" ".join(line_tokens))
  47.                 line_len = len(token)
  48.                 line_tokens = [token]
  49.             else:
  50.                 line_tokens.append(token)
  51.    
  52.     if line_tokens:
  53.         lines.append(" ".join(line_tokens))
  54.  
  55.     return lines
  56.  
  57. ###################################################################################################
  58. ## ToolTip
  59. ##
  60. ##   NOTE : ??? Item? Skill? ???? ?? ?????
  61. ##          ??? ??? ??? ?? ??
  62. ##
  63. class ToolTip(ui.ThinBoard):
  64.  
  65.     TOOL_TIP_WIDTH = 190
  66.     TOOL_TIP_HEIGHT = 10
  67.  
  68.     TEXT_LINE_HEIGHT = 17
  69.  
  70.     TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  71.     SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)
  72.     NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  73.     FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  74.     PRICE_COLOR = 0xffFFB96D
  75.  
  76.     HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR
  77.     MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0)
  78.     LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0)
  79.  
  80.     ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  81.     DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  82.  
  83.     NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  84.     POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)
  85.     SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)
  86.     SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0)
  87.  
  88.     CONDITION_COLOR = 0xffBEB47D
  89.     CAN_LEVEL_UP_COLOR = 0xff8EC292
  90.     CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
  91.     NEED_SKILL_POINT_COLOR = 0xff9A9CDB
  92.  
  93.     def __init__(self, width = TOOL_TIP_WIDTH, isPickable=False):
  94.         ui.ThinBoard.__init__(self, "TOP_MOST")
  95.  
  96.         if isPickable:
  97.             pass
  98.         else:
  99.             self.AddFlag("not_pick")
  100.  
  101.         self.AddFlag("float")
  102.  
  103.         self.followFlag = True
  104.         self.toolTipWidth = width
  105.  
  106.         self.xPos = -1
  107.         self.yPos = -1
  108.  
  109.         self.defFontName = localeInfo.UI_DEF_FONT
  110.         self.ClearToolTip()
  111.  
  112.     def __del__(self):
  113.         ui.ThinBoard.__del__(self)
  114.  
  115.     def ClearToolTip(self):
  116.         self.toolTipHeight = 12
  117.         self.childrenList = []
  118.  
  119.     def SetFollow(self, flag):
  120.         self.followFlag = flag
  121.  
  122.     def SetDefaultFontName(self, fontName):
  123.         self.defFontName = fontName
  124.  
  125.     def AppendSpace(self, size):
  126.         self.toolTipHeight += size
  127.         self.ResizeToolTip()
  128.  
  129.     def AppendHorizontalLine(self):
  130.  
  131.         for i in xrange(2):
  132.             horizontalLine = ui.Line()
  133.             horizontalLine.SetParent(self)
  134.             horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i)
  135.             horizontalLine.SetWindowHorizontalAlignCenter()
  136.             horizontalLine.SetSize(150, 0)
  137.             horizontalLine.Show()
  138.  
  139.             if 0 == i:
  140.                 horizontalLine.SetColor(0xff555555)
  141.             else:
  142.                 horizontalLine.SetColor(0xff000000)
  143.  
  144.             self.childrenList.append(horizontalLine)
  145.  
  146.         self.toolTipHeight += 11
  147.         self.ResizeToolTip()
  148.  
  149.     def AlignHorizonalCenter(self):
  150.         for child in self.childrenList:
  151.             (x, y)=child.GetLocalPosition()
  152.             child.SetPosition(self.toolTipWidth/2, y)
  153.  
  154.         self.ResizeToolTip()
  155.  
  156.     def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  157.         textLine = ui.TextLine()
  158.         textLine.SetParent(self)
  159.         textLine.SetFontName(self.defFontName)
  160.         textLine.SetPackedFontColor(color)
  161.         textLine.SetText(text)
  162.         textLine.SetOutline()
  163.         textLine.SetFeather(False)
  164.         textLine.Show()
  165.  
  166.         if centerAlign:
  167.             textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  168.             textLine.SetHorizontalAlignCenter()
  169.  
  170.         else:
  171.             textLine.SetPosition(10, self.toolTipHeight)
  172.  
  173.         self.childrenList.append(textLine)
  174.  
  175.         (textWidth, textHeight)=textLine.GetTextSize()
  176.  
  177.         textWidth += 40
  178.         textHeight += 5
  179.  
  180.         if self.toolTipWidth < textWidth:
  181.             self.toolTipWidth = textWidth
  182.  
  183.         self.toolTipHeight += textHeight
  184.  
  185.         return textLine
  186.  
  187.     def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  188.         textLine = ui.TextLine()
  189.         textLine.SetParent(self)
  190.         textLine.SetFontName(self.defFontName)
  191.         textLine.SetPackedFontColor(color)
  192.         textLine.SetText(text)
  193.         textLine.SetOutline()
  194.         textLine.SetFeather(False)
  195.         textLine.Show()
  196.  
  197.         if centerAlign:
  198.             textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  199.             textLine.SetHorizontalAlignCenter()
  200.  
  201.         else:
  202.             textLine.SetPosition(10, self.toolTipHeight)
  203.  
  204.         self.childrenList.append(textLine)
  205.  
  206.         self.toolTipHeight += self.TEXT_LINE_HEIGHT
  207.         self.ResizeToolTip()
  208.  
  209.         return textLine
  210.  
  211.     def AppendDescription(self, desc, limit, color = FONT_COLOR):
  212.         if localeInfo.IsEUROPE():
  213.             self.__AppendDescription_WesternLanguage(desc, color)
  214.         else:
  215.             self.__AppendDescription_EasternLanguage(desc, limit, color)
  216.  
  217.     def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR):
  218.         length = len(description)
  219.         if 0 == length:
  220.             return
  221.  
  222.         lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation)
  223.         for i in xrange(lineCount):
  224.             if 0 == i:
  225.                 self.AppendSpace(5)
  226.             self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color)
  227.  
  228.     def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR):
  229.         lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS)
  230.         if not lines:
  231.             return
  232.  
  233.         self.AppendSpace(5)
  234.         for line in lines:
  235.             self.AppendTextLine(line, color)
  236.            
  237.  
  238.     def ResizeToolTip(self):
  239.         self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight)
  240.  
  241.     def SetTitle(self, name):
  242.         self.AppendTextLine(name, self.TITLE_COLOR)
  243.  
  244.     def GetLimitTextLineColor(self, curValue, limitValue):
  245.         if curValue < limitValue:
  246.             return self.DISABLE_COLOR
  247.  
  248.         return self.ENABLE_COLOR
  249.  
  250.     def GetChangeTextLineColor(self, value, isSpecial=False):
  251.         if value > 0:
  252.             if isSpecial:
  253.                 return self.SPECIAL_POSITIVE_COLOR
  254.             else:
  255.                 return self.POSITIVE_COLOR
  256.  
  257.         if 0 == value:
  258.             return self.NORMAL_COLOR
  259.  
  260.         return self.NEGATIVE_COLOR
  261.  
  262.     def SetToolTipPosition(self, x = -1, y = -1):
  263.         self.xPos = x
  264.         self.yPos = y
  265.  
  266.     def ShowToolTip(self):
  267.         self.SetTop()
  268.         self.Show()
  269.  
  270.         self.OnUpdate()
  271.  
  272.     def HideToolTip(self):
  273.         self.Hide()
  274.  
  275.     def OnUpdate(self):
  276.  
  277.         if not self.followFlag:
  278.             return
  279.  
  280.         x = 0
  281.         y = 0
  282.         width = self.GetWidth()
  283.         height = self.toolTipHeight
  284.  
  285.         if -1 == self.xPos and -1 == self.yPos:
  286.  
  287.             (mouseX, mouseY) = wndMgr.GetMousePosition()
  288.  
  289.             if mouseY < wndMgr.GetScreenHeight() - 300:
  290.                 y = mouseY + 40
  291.             else:
  292.                 y = mouseY - height - 30
  293.  
  294.             x = mouseX - width/2               
  295.  
  296.         else:
  297.  
  298.             x = self.xPos - width/2
  299.             y = self.yPos - height
  300.  
  301.         x = max(x, 0)
  302.         y = max(y, 0)
  303.         x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2
  304.         y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight()
  305.  
  306.         parentWindow = self.GetParentProxy()
  307.         if parentWindow:
  308.             (gx, gy) = parentWindow.GetGlobalPosition()
  309.             x -= gx
  310.             y -= gy
  311.  
  312.         self.SetPosition(x, y)
  313.  
  314. class ItemToolTip(ToolTip):
  315.  
  316.     CHARACTER_NAMES = (
  317.         localeInfo.TOOLTIP_WARRIOR,
  318.         localeInfo.TOOLTIP_ASSASSIN,
  319.         localeInfo.TOOLTIP_SURA,
  320.         localeInfo.TOOLTIP_SHAMAN
  321.     )      
  322.  
  323.     CHARACTER_COUNT = len(CHARACTER_NAMES)
  324.     WEAR_NAMES = (
  325.         localeInfo.TOOLTIP_ARMOR,
  326.         localeInfo.TOOLTIP_HELMET,
  327.         localeInfo.TOOLTIP_SHOES,
  328.         localeInfo.TOOLTIP_WRISTLET,
  329.         localeInfo.TOOLTIP_WEAPON,
  330.         localeInfo.TOOLTIP_NECK,
  331.         localeInfo.TOOLTIP_EAR,
  332.         localeInfo.TOOLTIP_UNIQUE,
  333.         localeInfo.TOOLTIP_SHIELD,
  334.         localeInfo.TOOLTIP_ARROW,
  335.     )
  336.     WEAR_COUNT = len(WEAR_NAMES)
  337.  
  338.     AFFECT_DICT = {
  339.         item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP,
  340.         item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP,
  341.         item.APPLY_CON : localeInfo.TOOLTIP_CON,
  342.         item.APPLY_INT : localeInfo.TOOLTIP_INT,
  343.         item.APPLY_STR : localeInfo.TOOLTIP_STR,
  344.         item.APPLY_DEX : localeInfo.TOOLTIP_DEX,
  345.         item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED,
  346.         item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED,
  347.         item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED,
  348.         item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN,
  349.         item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN,
  350.         item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT,
  351.         item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT,
  352.         item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT,
  353.         item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,
  354.         item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT,
  355.  
  356.         item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  357.         item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  358.         item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA,
  359.         item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  360.         item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  361.  
  362.         item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  363.         item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL,
  364.         item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC,
  365.         item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO,
  366.         item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  367.         item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  368.         item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP,
  369.         item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP,
  370.         item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT,
  371.         item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER,
  372.         item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK,
  373.         item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE,
  374.         item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD,
  375.         item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND,
  376.         item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER,
  377.         item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL,
  378.         item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN,
  379.         item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW,
  380.         item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE,
  381.         item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC,
  382.         item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC,
  383.         item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND,
  384.         item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE,
  385.         item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE,
  386.         item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE,
  387.         item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER,
  388.         item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS,
  389.         item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS,
  390.         item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS,
  391.         item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS,
  392.         item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER,
  393.         item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN,
  394.         item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW,
  395.         item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL,
  396.         item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE,
  397.         item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE,
  398.         item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE,
  399.         item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE,
  400.         item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE,
  401.         item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA,
  402.         item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS,
  403.         item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS,
  404.         item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS,
  405.         item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS,
  406.         item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS,
  407.         item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS,
  408.         item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS,
  409.         item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS,
  410.         item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS,
  411.         item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC,
  412.         item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC,
  413.         item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR,
  414.         item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN,
  415.         item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA,
  416.         item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN,
  417.         item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT,
  418.         item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT,
  419.         item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY,
  420.         item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS,
  421.        
  422.         item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER,
  423.         item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER,
  424.         item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE,
  425.         item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH,
  426.         item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK,
  427.         item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT,
  428.         item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT,
  429.     }
  430.  
  431.     ATTRIBUTE_NEED_WIDTH = {
  432.         23 : 230,
  433.         24 : 230,
  434.         25 : 230,
  435.         26 : 220,
  436.         27 : 210,
  437.  
  438.         35 : 210,
  439.         36 : 210,
  440.         37 : 210,
  441.         38 : 210,
  442.         39 : 210,
  443.         40 : 210,
  444.         41 : 210,
  445.  
  446.         42 : 220,
  447.         43 : 230,
  448.         45 : 230,
  449.     }
  450.  
  451.     ANTI_FLAG_DICT = {
  452.         0 : item.ITEM_ANTIFLAG_WARRIOR,
  453.         1 : item.ITEM_ANTIFLAG_ASSASSIN,
  454.         2 : item.ITEM_ANTIFLAG_SURA,
  455.         3 : item.ITEM_ANTIFLAG_SHAMAN,
  456.     }
  457.  
  458.     FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  459.  
  460.     def __init__(self, *args, **kwargs):
  461.         ToolTip.__init__(self, *args, **kwargs)
  462.         self.itemVnum = 0
  463.         self.isShopItem = False
  464.  
  465.         # ??? ??? ??? ? ?? ???? ??? ? ?? ?????? ??? Disable Color? ?? (?? ??? ???? ??? ?? ? ??? ???)
  466.         self.bCannotUseItemForceSetDisableColor = True
  467.  
  468.     def __del__(self):
  469.         ToolTip.__del__(self)
  470.  
  471.     def SetCannotUseItemForceSetDisableColor(self, enable):
  472.         self.bCannotUseItemForceSetDisableColor = enable
  473.  
  474.     def CanEquip(self):
  475.         if not item.IsEquipmentVID(self.itemVnum):
  476.             return True
  477.  
  478.         race = player.GetRace()
  479.         job = chr.RaceToJob(race)
  480.         if not self.ANTI_FLAG_DICT.has_key(job):
  481.             return False
  482.  
  483.         if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  484.             return False
  485.  
  486.         sex = chr.RaceToSex(race)
  487.        
  488.         MALE = 1
  489.         FEMALE = 0
  490.  
  491.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  492.             return False
  493.  
  494.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  495.             return False
  496.  
  497.         for i in xrange(item.LIMIT_MAX_NUM):
  498.             (limitType, limitValue) = item.GetLimit(i)
  499.  
  500.             if item.LIMIT_LEVEL == limitType:
  501.                 if player.GetStatus(player.LEVEL) < limitValue:
  502.                     return False
  503.             """
  504.             elif item.LIMIT_STR == limitType:
  505.                 if player.GetStatus(player.ST) < limitValue:
  506.                     return False
  507.             elif item.LIMIT_DEX == limitType:
  508.                 if player.GetStatus(player.DX) < limitValue:
  509.                     return False
  510.             elif item.LIMIT_INT == limitType:
  511.                 if player.GetStatus(player.IQ) < limitValue:
  512.                     return False
  513.             elif item.LIMIT_CON == limitType:
  514.                 if player.GetStatus(player.HT) < limitValue:
  515.                     return False
  516.             """
  517.  
  518.         return True
  519.  
  520.     def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  521.         if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
  522.             color = self.DISABLE_COLOR
  523.  
  524.         return ToolTip.AppendTextLine(self, text, color, centerAlign)
  525.  
  526.     def ClearToolTip(self):
  527.         self.isShopItem = False
  528.         self.toolTipWidth = self.TOOL_TIP_WIDTH
  529.         ToolTip.ClearToolTip(self)
  530.  
  531.     def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY):
  532.         itemVnum = player.GetItemIndex(window_type, slotIndex)
  533.         if 0 == itemVnum:
  534.             return
  535.  
  536.         self.ClearToolTip()
  537.         if shop.IsOpen():
  538.             if not shop.IsPrivateShop():
  539.                 item.SelectItem(itemVnum)
  540.                 self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex))
  541.  
  542.         metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  543.         attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  544.  
  545.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  546.  
  547.     def SetShopItem(self, slotIndex):
  548.         itemVnum = shop.GetItemID(slotIndex)
  549.         if 0 == itemVnum:
  550.             return
  551.  
  552.         price = shop.GetItemPrice(slotIndex)
  553.         self.ClearToolTip()
  554.         self.isShopItem = True
  555.  
  556.         metinSlot = []
  557.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  558.             metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  559.         attrSlot = []
  560.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  561.             attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  562.  
  563.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  564.         self.AppendPrice(price)
  565.  
  566.     def SetShopItemBySecondaryCoin(self, slotIndex):
  567.         itemVnum = shop.GetItemID(slotIndex)
  568.         if 0 == itemVnum:
  569.             return
  570.  
  571.         price = shop.GetItemPrice(slotIndex)
  572.         self.ClearToolTip()
  573.         self.isShopItem = True
  574.  
  575.         metinSlot = []
  576.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  577.             metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  578.         attrSlot = []
  579.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  580.             attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  581.  
  582.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  583.         self.AppendPriceBySecondaryCoin(price)
  584.  
  585.     def SetExchangeOwnerItem(self, slotIndex):
  586.         itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
  587.         if 0 == itemVnum:
  588.             return
  589.  
  590.         self.ClearToolTip()
  591.  
  592.         metinSlot = []
  593.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  594.             metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i))
  595.         attrSlot = []
  596.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  597.             attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i))
  598.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  599.  
  600.     def SetExchangeTargetItem(self, slotIndex):
  601.         itemVnum = exchange.GetItemVnumFromTarget(slotIndex)
  602.         if 0 == itemVnum:
  603.             return
  604.  
  605.         self.ClearToolTip()
  606.  
  607.         metinSlot = []
  608.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  609.             metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i))
  610.         attrSlot = []
  611.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  612.             attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i))
  613.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  614.  
  615.     def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex):
  616.         itemVnum = player.GetItemIndex(invenType, invenPos)
  617.         if 0 == itemVnum:
  618.             return
  619.  
  620.         item.SelectItem(itemVnum)
  621.         self.ClearToolTip()
  622.         self.AppendSellingPrice(shop.GetPrivateShopItemPrice(invenType, invenPos))
  623.  
  624.         metinSlot = []
  625.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  626.             metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  627.         attrSlot = []
  628.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  629.             attrSlot.append(player.GetItemAttribute(invenPos, i))
  630.  
  631.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  632.  
  633.     def SetSafeBoxItem(self, slotIndex):
  634.         itemVnum = safebox.GetItemID(slotIndex)
  635.         if 0 == itemVnum:
  636.             return
  637.  
  638.         self.ClearToolTip()
  639.         metinSlot = []
  640.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  641.             metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i))
  642.         attrSlot = []
  643.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  644.             attrSlot.append(safebox.GetItemAttribute(slotIndex, i))
  645.        
  646.         self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemFlags(slotIndex))
  647.  
  648.     def SetMallItem(self, slotIndex):
  649.         itemVnum = safebox.GetMallItemID(slotIndex)
  650.         if 0 == itemVnum:
  651.             return
  652.  
  653.         self.ClearToolTip()
  654.         metinSlot = []
  655.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  656.             metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i))
  657.         attrSlot = []
  658.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  659.             attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i))
  660.  
  661.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  662.  
  663.     def SetItemToolTip(self, itemVnum):
  664.         self.ClearToolTip()
  665.         metinSlot = []
  666.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  667.             metinSlot.append(0)
  668.         attrSlot = []
  669.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  670.             attrSlot.append((0, 0))
  671.  
  672.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  673.  
  674.     def __AppendAttackSpeedInfo(self, item):
  675.         atkSpd = item.GetValue(0)
  676.  
  677.         if atkSpd < 80:
  678.             stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST
  679.         elif atkSpd <= 95:
  680.             stSpd = localeInfo.TOOLTIP_ITEM_FAST
  681.         elif atkSpd <= 105:
  682.             stSpd = localeInfo.TOOLTIP_ITEM_NORMAL
  683.         elif atkSpd <= 120:
  684.             stSpd = localeInfo.TOOLTIP_ITEM_SLOW
  685.         else:
  686.             stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW
  687.  
  688.         self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR)
  689.  
  690.     def __AppendAttackGradeInfo(self):
  691.         atkGrade = item.GetValue(1)
  692.         self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade))
  693.  
  694.     def __AppendAttackPowerInfo(self):
  695.         minPower = item.GetValue(3)
  696.         maxPower = item.GetValue(4)
  697.         addPower = item.GetValue(5)
  698.         if maxPower > minPower:
  699.             self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower+addPower, maxPower+addPower), self.POSITIVE_COLOR)
  700.         else:
  701.             self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower+addPower), self.POSITIVE_COLOR)
  702.  
  703.     def __AppendMagicAttackInfo(self):
  704.         minMagicAttackPower = item.GetValue(1)
  705.         maxMagicAttackPower = item.GetValue(2)
  706.         addPower = item.GetValue(5)
  707.  
  708.         if minMagicAttackPower > 0 or maxMagicAttackPower > 0:
  709.             if maxMagicAttackPower > minMagicAttackPower:
  710.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower+addPower, maxMagicAttackPower+addPower), self.POSITIVE_COLOR)
  711.             else:
  712.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower+addPower), self.POSITIVE_COLOR)
  713.  
  714.     def __AppendMagicDefenceInfo(self):
  715.         magicDefencePower = item.GetValue(0)
  716.  
  717.         if magicDefencePower > 0:
  718.             self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))
  719.  
  720.     def __AppendAttributeInformation(self, attrSlot):
  721.         if 0 != attrSlot:
  722.  
  723.             for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  724.                 type = attrSlot[i][0]
  725.                 value = attrSlot[i][1]
  726.  
  727.                 if 0 == value:
  728.                     continue
  729.  
  730.                 affectString = self.__GetAffectString(type, value)
  731.                 if affectString:
  732.                     affectColor = self.__GetAttributeColor(i, value)
  733.                     self.AppendTextLine(affectString, affectColor)
  734.  
  735.     def __GetAttributeColor(self, index, value):
  736.         if value > 0:
  737.             if index >= 5:
  738.                 return self.SPECIAL_POSITIVE_COLOR2
  739.             else:
  740.                 return self.SPECIAL_POSITIVE_COLOR
  741.         elif value == 0:
  742.             return self.NORMAL_COLOR
  743.         else:
  744.             return self.NEGATIVE_COLOR
  745.  
  746.     def __IsPolymorphItem(self, itemVnum):
  747.         if itemVnum >= 70103 and itemVnum <= 70106:
  748.             return 1
  749.         return 0
  750.  
  751.     def __SetPolymorphItemTitle(self, monsterVnum):
  752.         if localeInfo.IsVIETNAM():
  753.             itemName =item.GetItemName()
  754.             itemName+=" "
  755.             itemName+=nonplayer.GetMonsterName(monsterVnum)
  756.         else:
  757.             itemName =nonplayer.GetMonsterName(monsterVnum)
  758.             itemName+=" "
  759.             itemName+=item.GetItemName()
  760.         self.SetTitle(itemName)
  761.  
  762.     def __SetNormalItemTitle(self):
  763.         self.SetTitle(item.GetItemName())
  764.  
  765.     def __SetSpecialItemTitle(self):
  766.         self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)
  767.  
  768.     def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
  769.         if localeInfo.IsCANADA():
  770.             if 72726 == itemVnum or 72730 == itemVnum:
  771.                 self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  772.                 return
  773.            
  774.         if self.__IsPolymorphItem(itemVnum):
  775.             self.__SetPolymorphItemTitle(metinSlot[0])
  776.         else:
  777.             if self.__IsAttr(attrSlot):
  778.                 self.__SetSpecialItemTitle()
  779.                 return
  780.  
  781.             self.__SetNormalItemTitle()
  782.  
  783.     def __IsAttr(self, attrSlot):
  784.         if not attrSlot:
  785.             return False
  786.  
  787.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  788.             type = attrSlot[i][0]
  789.             if 0 != type:
  790.                 return True
  791.  
  792.         return False
  793.    
  794.     def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0):
  795.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  796.             metinSlotData=metinSlot[i]
  797.             if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE:
  798.                 metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER
  799.  
  800.         self.AddItemData(itemVnum, metinSlot, attrSlot)
  801.  
  802.     def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot):
  803.         self.__AdjustMaxWidth(attrSlot, itemDesc)
  804.         self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  805.        
  806.         if self.__IsHair(itemVnum):
  807.             self.__AppendHairIcon(itemVnum)
  808.  
  809.         ### Description ###
  810.         self.AppendDescription(itemDesc, 26)
  811.         self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  812.  
  813.     def AddItemData(self, itemVnum, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0):
  814.         self.itemVnum = itemVnum
  815.         item.SelectItem(itemVnum)
  816.         itemType = item.GetItemType()
  817.         itemSubType = item.GetItemSubType()
  818.  
  819.         if 50026 == itemVnum:
  820.             if 0 != metinSlot:
  821.                 name = item.GetItemName()
  822.                 if metinSlot[0] > 0:
  823.                     name += " "
  824.                     name += localeInfo.NumberToMoneyString(metinSlot[0])
  825.                 self.SetTitle(name)
  826.  
  827.                 self.ShowToolTip()
  828.             return
  829.  
  830.         ### Skill Book ###
  831.         elif 50300 == itemVnum:
  832.             if 0 != metinSlot:
  833.                 self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  834.  
  835.                 self.ShowToolTip()
  836.             return
  837.         elif 70037 == itemVnum:
  838.             if 0 != metinSlot:
  839.                 self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  840.                 self.AppendDescription(item.GetItemDescription(), 26)
  841.                 self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  842.  
  843.                 self.ShowToolTip()
  844.             return
  845.         elif 70055 == itemVnum:
  846.             if 0 != metinSlot:
  847.                 self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  848.                 self.AppendDescription(item.GetItemDescription(), 26)
  849.                 self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  850.  
  851.                 self.ShowToolTip()
  852.             return
  853.         ###########################################################################################
  854.  
  855.  
  856.         itemDesc = item.GetItemDescription()
  857.         itemSummary = item.GetItemSummary()
  858.  
  859.         isCostumeItem = 0
  860.         isCostumeHair = 0
  861.         isCostumeBody = 0
  862.            
  863.         if app.ENABLE_COSTUME_SYSTEM:
  864.             if item.ITEM_TYPE_COSTUME == itemType:
  865.                 isCostumeItem = 1
  866.                 isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
  867.                 isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
  868.                
  869.                 #dbg.TraceError("IS_COSTUME_ITEM! body(%d) hair(%d)" % (isCostumeBody, isCostumeHair))
  870.  
  871.         self.__AdjustMaxWidth(attrSlot, itemDesc)
  872.         self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  873.        
  874.         ### Hair Preview Image ###
  875.         if self.__IsHair(itemVnum):
  876.             self.__AppendHairIcon(itemVnum)
  877.  
  878.         ### Description ###
  879.         self.AppendDescription(itemDesc, 26)
  880.         self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  881.  
  882.         ### Weapon ###
  883.         if item.ITEM_TYPE_WEAPON == itemType:
  884.  
  885.             self.__AppendLimitInformation()
  886.  
  887.             self.AppendSpace(5)
  888.  
  889.             ## ??? ?? ??? ?? ????.
  890.             if item.WEAPON_FAN == itemSubType:
  891.                 self.__AppendMagicAttackInfo()
  892.                 self.__AppendAttackPowerInfo()
  893.  
  894.             else:
  895.                 self.__AppendAttackPowerInfo()
  896.                 self.__AppendMagicAttackInfo()
  897.  
  898.             self.__AppendAffectInformation()
  899.             self.__AppendAttributeInformation(attrSlot)
  900.  
  901.             self.AppendWearableInformation()
  902.             self.__AppendMetinSlotInfo(metinSlot)
  903.  
  904.         ### Armor ###
  905.         elif item.ITEM_TYPE_ARMOR == itemType:
  906.             self.__AppendLimitInformation()
  907.  
  908.             ## ???
  909.             defGrade = item.GetValue(1)
  910.             defBonus = item.GetValue(5)*2 ## ??? ?? ?? ?? ??? ??
  911.             if defGrade > 0:
  912.                 self.AppendSpace(5)
  913.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  914.  
  915.             self.__AppendMagicDefenceInfo()
  916.             self.__AppendAffectInformation()
  917.             self.__AppendAttributeInformation(attrSlot)
  918.  
  919.             self.AppendWearableInformation()
  920.  
  921.             if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):             
  922.                 self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  923.             else:
  924.                 self.__AppendMetinSlotInfo(metinSlot)
  925.  
  926.         ### Ring Slot Item (Not UNIQUE) ###
  927.         elif item.ITEM_TYPE_RING == itemType:
  928.             self.__AppendLimitInformation()
  929.             self.__AppendAffectInformation()
  930.             self.__AppendAttributeInformation(attrSlot)
  931.  
  932.             #?? ?? ??? ???? ?? ?? ??
  933.             #self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001)
  934.            
  935.  
  936.         ### Belt Item ###
  937.         elif item.ITEM_TYPE_BELT == itemType:
  938.             self.__AppendLimitInformation()
  939.             self.__AppendAffectInformation()
  940.             self.__AppendAttributeInformation(attrSlot)
  941.  
  942.             self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  943.  
  944.         ## ??? ??? ##
  945.         elif 0 != isCostumeItem:
  946.             self.__AppendLimitInformation()
  947.             self.__AppendAffectInformation()
  948.             self.__AppendAttributeInformation(attrSlot)
  949.  
  950.             self.AppendWearableInformation()
  951.        
  952.             bHasRealtimeFlag = 0
  953.            
  954.             ## ???? ?? ??? ??? ????
  955.             for i in xrange(item.LIMIT_MAX_NUM):
  956.                 (limitType, limitValue) = item.GetLimit(i)
  957.  
  958.                 if item.LIMIT_REAL_TIME == limitType:
  959.                     bHasRealtimeFlag = 1
  960.            
  961.             ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  962.             if 1 == bHasRealtimeFlag:
  963.                 self.AppendMallItemLastTime(metinSlot[0])
  964.                 #dbg.TraceError("1) REAL_TIME flag On ")
  965.                
  966.         ## Rod ##
  967.         elif item.ITEM_TYPE_ROD == itemType:
  968.  
  969.             if 0 != metinSlot:
  970.                 curLevel = item.GetValue(0) / 10
  971.                 curEXP = metinSlot[0]
  972.                 maxEXP = item.GetValue(2)
  973.                 self.__AppendLimitInformation()
  974.                 self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  975.  
  976.         ## Pick ##
  977.         elif item.ITEM_TYPE_PICK == itemType:
  978.  
  979.             if 0 != metinSlot:
  980.                 curLevel = item.GetValue(0) / 10
  981.                 curEXP = metinSlot[0]
  982.                 maxEXP = item.GetValue(2)
  983.                 self.__AppendLimitInformation()
  984.                 self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  985.  
  986.         ## Lottery ##
  987.         elif item.ITEM_TYPE_LOTTERY == itemType:
  988.             if 0 != metinSlot:
  989.  
  990.                 ticketNumber = int(metinSlot[0])
  991.                 stepNumber = int(metinSlot[1])
  992.  
  993.                 self.AppendSpace(5)
  994.                 self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  995.                 self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  996.  
  997.         ### Metin ###
  998.         elif item.ITEM_TYPE_METIN == itemType:
  999.             self.AppendMetinInformation()
  1000.             self.AppendMetinWearInformation()
  1001.  
  1002.         ### Fish ###
  1003.         elif item.ITEM_TYPE_FISH == itemType:
  1004.             if 0 != metinSlot:
  1005.                 self.__AppendFishInfo(metinSlot[0])
  1006.        
  1007.         ## item.ITEM_TYPE_BLEND
  1008.         elif item.ITEM_TYPE_BLEND == itemType:
  1009.             self.__AppendLimitInformation()
  1010.  
  1011.             if metinSlot:
  1012.                 affectType = metinSlot[0]
  1013.                 affectValue = metinSlot[1]
  1014.                 time = metinSlot[2]
  1015.                 self.AppendSpace(5)
  1016.                 affectText = self.__GetAffectString(affectType, affectValue)
  1017.  
  1018.                 self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1019.  
  1020.                 if time > 0:
  1021.                     minute = (time / 60)
  1022.                     second = (time % 60)
  1023.                     timeString = localeInfo.TOOLTIP_POTION_TIME
  1024.  
  1025.                     if minute > 0:
  1026.                         timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1027.                     if second > 0:
  1028.                         timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1029.  
  1030.                     self.AppendTextLine(timeString)
  1031.                 else:
  1032.                     self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME)
  1033.             else:
  1034.                 self.AppendTextLine("BLEND_POTION_NO_INFO")
  1035.  
  1036.         elif item.ITEM_TYPE_UNIQUE == itemType:
  1037.             if 0 != metinSlot:
  1038.                 bHasRealtimeFlag = 0
  1039.                
  1040.                 for i in xrange(item.LIMIT_MAX_NUM):
  1041.                     (limitType, limitValue) = item.GetLimit(i)
  1042.  
  1043.                     if item.LIMIT_REAL_TIME == limitType:
  1044.                         bHasRealtimeFlag = 1
  1045.                
  1046.                 if 1 == bHasRealtimeFlag:
  1047.                     self.AppendMallItemLastTime(metinSlot[0])      
  1048.                 else:
  1049.                     time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1050.  
  1051.                     if 1 == item.GetValue(2): ## ??? ?? Flag / ?? ??? ??
  1052.                         self.AppendMallItemLastTime(time)
  1053.                     else:
  1054.                         self.AppendUniqueItemLastTime(time)
  1055.  
  1056.         ### Use ###
  1057.         elif item.ITEM_TYPE_USE == itemType:
  1058.             self.__AppendLimitInformation()
  1059.  
  1060.             if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1061.                 self.__AppendPotionInformation()
  1062.  
  1063.             elif item.USE_ABILITY_UP == itemSubType:
  1064.                 self.__AppendAbilityPotionInformation()
  1065.  
  1066.  
  1067.             ## ?? ???
  1068.             if 27989 == itemVnum or 76006 == itemVnum:
  1069.                 if 0 != metinSlot:
  1070.                     useCount = int(metinSlot[0])
  1071.  
  1072.                     self.AppendSpace(5)
  1073.                     self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR)
  1074.  
  1075.             ## ??? ???
  1076.             elif 50004 == itemVnum:
  1077.                 if 0 != metinSlot:
  1078.                     useCount = int(metinSlot[0])
  1079.  
  1080.                     self.AppendSpace(5)
  1081.                     self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1082.  
  1083.             ## ????
  1084.             elif constInfo.IS_AUTO_POTION(itemVnum):
  1085.                 if 0 != metinSlot:
  1086.                     ## 0: ???, 1: ???, 2: ??
  1087.                     isActivated = int(metinSlot[0])
  1088.                     usedAmount = float(metinSlot[1])
  1089.                     totalAmount = float(metinSlot[2])
  1090.                    
  1091.                     if 0 == totalAmount:
  1092.                         totalAmount = 1
  1093.                    
  1094.                     self.AppendSpace(5)
  1095.  
  1096.                     if 0 != isActivated:
  1097.                         self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1098.                         self.AppendSpace(5)
  1099.                        
  1100.                     self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1101.                                
  1102.             ## ?? ???
  1103.             elif itemVnum in WARP_SCROLLS:
  1104.                 if 0 != metinSlot:
  1105.                     xPos = int(metinSlot[0])
  1106.                     yPos = int(metinSlot[1])
  1107.  
  1108.                     if xPos != 0 and yPos != 0:
  1109.                         (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1110.                        
  1111.                         localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1112.  
  1113.                         self.AppendSpace(5)
  1114.  
  1115.                         if localeMapName!="":                      
  1116.                             self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1117.                         else:
  1118.                             self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1119.                             dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1120.  
  1121.             #####
  1122.             if item.USE_SPECIAL == itemSubType:
  1123.                 bHasRealtimeFlag = 0
  1124.                 for i in xrange(item.LIMIT_MAX_NUM):
  1125.                     (limitType, limitValue) = item.GetLimit(i)
  1126.  
  1127.                     if item.LIMIT_REAL_TIME == limitType:
  1128.                         bHasRealtimeFlag = 1
  1129.        
  1130.                 ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  1131.                 if 1 == bHasRealtimeFlag:
  1132.                     self.AppendMallItemLastTime(metinSlot[0])
  1133.                 else:
  1134.                     # ... ??... ???? ?? ?? ?? ??? ???...
  1135.                     # ? ??? ??? ??? ??? ?? ??...
  1136.                     if 0 != metinSlot:
  1137.                         time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1138.  
  1139.                         ## ??? ?? Flag
  1140.                         if 1 == item.GetValue(2):
  1141.                             self.AppendMallItemLastTime(time)
  1142.            
  1143.             elif item.USE_TIME_CHARGE_PER == itemSubType:
  1144.                 bHasRealtimeFlag = 0
  1145.                 for i in xrange(item.LIMIT_MAX_NUM):
  1146.                     (limitType, limitValue) = item.GetLimit(i)
  1147.  
  1148.                     if item.LIMIT_REAL_TIME == limitType:
  1149.                         bHasRealtimeFlag = 1
  1150.                 if metinSlot[2]:
  1151.                     self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  1152.                 else:
  1153.                     self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  1154.        
  1155.                 ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  1156.                 if 1 == bHasRealtimeFlag:
  1157.                     self.AppendMallItemLastTime(metinSlot[0])
  1158.  
  1159.             elif item.USE_TIME_CHARGE_FIX == itemSubType:
  1160.                 bHasRealtimeFlag = 0
  1161.                 for i in xrange(item.LIMIT_MAX_NUM):
  1162.                     (limitType, limitValue) = item.GetLimit(i)
  1163.  
  1164.                     if item.LIMIT_REAL_TIME == limitType:
  1165.                         bHasRealtimeFlag = 1
  1166.                 if metinSlot[2]:
  1167.                     self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  1168.                 else:
  1169.                     self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  1170.        
  1171.                 ## ??? ?? ??? ???. ex) ?? ?? : 6? 6?? 58?
  1172.                 if 1 == bHasRealtimeFlag:
  1173.                     self.AppendMallItemLastTime(metinSlot[0])
  1174.  
  1175.         elif item.ITEM_TYPE_QUEST == itemType:
  1176.             self.__AppendLimitInformation()
  1177.             self.__AppendAttributeInformation(attrSlot)
  1178.             for i in xrange(item.LIMIT_MAX_NUM):
  1179.                 (limitType, limitValue) = item.GetLimit(i)
  1180.  
  1181.                 if item.LIMIT_REAL_TIME == limitType:
  1182.                     self.AppendMallItemLastTime(metinSlot[0])
  1183.                    
  1184.                    
  1185.         elif item.ITEM_TYPE_DS == itemType:
  1186.             self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1187.             self.__AppendAttributeInformation(attrSlot)
  1188.         else:
  1189.             self.__AppendLimitInformation()
  1190.  
  1191.         for i in xrange(item.LIMIT_MAX_NUM):
  1192.             (limitType, limitValue) = item.GetLimit(i)
  1193.             #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue))
  1194.            
  1195.             if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1196.                 self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1197.                 #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ")
  1198.                
  1199.             elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1200.                 self.AppendTimerBasedOnWearLastTime(metinSlot)
  1201.                 #dbg.TraceError("1) REAL_TIME flag On ")
  1202.  
  1203.  
  1204.                
  1205.         self.ShowToolTip()
  1206.  
  1207.     def __DragonSoulInfoString (self, dwVnum):
  1208.         step = (dwVnum / 100) % 10
  1209.         refine = (dwVnum / 10) % 10
  1210.         if 0 == step:
  1211.             return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1212.         elif 1 == step:
  1213.             return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1214.         elif 2 == step:
  1215.             return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1216.         elif 3 == step:
  1217.             return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1218.         elif 4 == step:
  1219.             return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1220.         else:
  1221.             return ""
  1222.  
  1223.  
  1224.     ## ?????
  1225.     def __IsHair(self, itemVnum):
  1226.         return (self.__IsOldHair(itemVnum) or
  1227.             self.__IsNewHair(itemVnum) or
  1228.             self.__IsNewHair2(itemVnum) or
  1229.             self.__IsNewHair3(itemVnum) or
  1230.             self.__IsCostumeHair(itemVnum)
  1231.             )
  1232.  
  1233.     def __IsOldHair(self, itemVnum):
  1234.         return itemVnum > 73000 and itemVnum < 74000   
  1235.  
  1236.     def __IsNewHair(self, itemVnum):
  1237.         return itemVnum > 74000 and itemVnum < 75000   
  1238.  
  1239.     def __IsNewHair2(self, itemVnum):
  1240.         return itemVnum > 75000 and itemVnum < 76000   
  1241.  
  1242.     def __IsNewHair3(self, itemVnum):
  1243.         return ((74012 < itemVnum and itemVnum < 74022) or
  1244.             (74262 < itemVnum and itemVnum < 74272) or
  1245.             (74512 < itemVnum and itemVnum < 74522) or
  1246.             (74762 < itemVnum and itemVnum < 74772) or
  1247.             (45000 < itemVnum and itemVnum < 47000))
  1248.  
  1249.     def __IsCostumeHair(self, itemVnum):
  1250.         return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1251.        
  1252.     def __AppendHairIcon(self, itemVnum):
  1253.         itemImage = ui.ImageBox()
  1254.         itemImage.SetParent(self)
  1255.         itemImage.Show()           
  1256.  
  1257.         if self.__IsOldHair(itemVnum):
  1258.             itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1259.         elif self.__IsNewHair3(itemVnum):
  1260.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1261.         elif self.__IsNewHair(itemVnum): # ?? ?? ??? ????? ????. ??? ???? 1000?? ??? ???.
  1262.             itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1263.         elif self.__IsNewHair2(itemVnum):
  1264.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1265.         elif self.__IsCostumeHair(itemVnum):
  1266.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1267.  
  1268.         itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1269.         self.toolTipHeight += itemImage.GetHeight()
  1270.         #self.toolTipWidth += itemImage.GetWidth()/2
  1271.         self.childrenList.append(itemImage)
  1272.         self.ResizeToolTip()
  1273.  
  1274.     ## ???? ? Description ? ?? ?? ???? ????
  1275.     def __AdjustMaxWidth(self, attrSlot, desc):
  1276.         newToolTipWidth = self.toolTipWidth
  1277.         newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1278.         newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1279.         if newToolTipWidth > self.toolTipWidth:
  1280.             self.toolTipWidth = newToolTipWidth
  1281.             self.ResizeToolTip()
  1282.  
  1283.     def __AdjustAttrMaxWidth(self, attrSlot):
  1284.         if 0 == attrSlot:
  1285.             return self.toolTipWidth
  1286.  
  1287.         maxWidth = self.toolTipWidth
  1288.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1289.             type = attrSlot[i][0]
  1290.             value = attrSlot[i][1]
  1291.             if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1292.                 if value > 0:
  1293.                     maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1294.  
  1295.                     # ATTR_CHANGE_TOOLTIP_WIDTH
  1296.                     #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth)
  1297.                     #self.ResizeToolTip()
  1298.                     # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH
  1299.  
  1300.         return maxWidth
  1301.  
  1302.     def __AdjustDescMaxWidth(self, desc):
  1303.         if len(desc) < DESC_DEFAULT_MAX_COLS:
  1304.             return self.toolTipWidth
  1305.    
  1306.         return DESC_WESTERN_MAX_WIDTH
  1307.  
  1308.     def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1309.         skillName = skill.GetSkillName(skillIndex)
  1310.  
  1311.         if not skillName:
  1312.             return
  1313.  
  1314.         if localeInfo.IsVIETNAM():
  1315.             itemName = bookName + " " + skillName
  1316.         else:
  1317.             itemName = skillName + " " + bookName
  1318.         self.SetTitle(itemName)
  1319.  
  1320.     def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1321.         self.AppendSpace(5)
  1322.         self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1323.         self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1324.  
  1325.         if curEXP == maxEXP:
  1326.             self.AppendSpace(5)
  1327.             self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1328.             self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1329.             self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1330.  
  1331.  
  1332.     def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1333.         self.AppendSpace(5)
  1334.         self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1335.         self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1336.  
  1337.         if curEXP == maxEXP:
  1338.             self.AppendSpace(5)
  1339.             self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  1340.             self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  1341.             self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  1342.  
  1343.     def __AppendLimitInformation(self):
  1344.  
  1345.         appendSpace = False
  1346.  
  1347.         for i in xrange(item.LIMIT_MAX_NUM):
  1348.  
  1349.             (limitType, limitValue) = item.GetLimit(i)
  1350.  
  1351.             if limitValue > 0:
  1352.                 if False == appendSpace:
  1353.                     self.AppendSpace(5)
  1354.                     appendSpace = True
  1355.  
  1356.             else:
  1357.                 continue
  1358.  
  1359.             if item.LIMIT_LEVEL == limitType:
  1360.                 color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  1361.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  1362.             """
  1363.             elif item.LIMIT_STR == limitType:
  1364.                 color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  1365.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  1366.             elif item.LIMIT_DEX == limitType:
  1367.                 color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  1368.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  1369.             elif item.LIMIT_INT == limitType:
  1370.                 color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  1371.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  1372.             elif item.LIMIT_CON == limitType:
  1373.                 color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  1374.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  1375.             """
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.     def __GetAffectString(self, affectType, affectValue):
  1389.         if 0 == affectType:
  1390.             return None
  1391.  
  1392.         if 0 == affectValue:
  1393.             return None
  1394.  
  1395.         try:
  1396.             return self.AFFECT_DICT[affectType](affectValue)
  1397.         except TypeError:
  1398.             return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  1399.         except KeyError:
  1400.             return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  1401.  
  1402.     def __AppendAffectInformation(self):
  1403.         for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1404.  
  1405.             (affectType, affectValue) = item.GetAffect(i)
  1406.  
  1407.             affectString = self.__GetAffectString(affectType, affectValue)
  1408.             if affectString:
  1409.                 self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1410.  
  1411.     def AppendWearableInformation(self):
  1412.  
  1413.         self.AppendSpace(5)
  1414.         self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  1415.  
  1416.         flagList = (
  1417.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  1418.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  1419.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  1420.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
  1421.  
  1422.         characterNames = ""
  1423.         for i in xrange(self.CHARACTER_COUNT):
  1424.  
  1425.             name = self.CHARACTER_NAMES[i]
  1426.             flag = flagList[i]
  1427.  
  1428.             if flag:
  1429.                 characterNames += " "
  1430.                 characterNames += name
  1431.  
  1432.         textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  1433.         textLine.SetFeather()
  1434.  
  1435.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  1436.             textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  1437.             textLine.SetFeather()
  1438.  
  1439.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  1440.             textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  1441.             textLine.SetFeather()
  1442.  
  1443.     def __AppendPotionInformation(self):
  1444.         self.AppendSpace(5)
  1445.  
  1446.         healHP = item.GetValue(0)
  1447.         healSP = item.GetValue(1)
  1448.         healStatus = item.GetValue(2)
  1449.         healPercentageHP = item.GetValue(3)
  1450.         healPercentageSP = item.GetValue(4)
  1451.  
  1452.         if healHP > 0:
  1453.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  1454.         if healSP > 0:
  1455.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  1456.         if healStatus != 0:
  1457.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  1458.         if healPercentageHP > 0:
  1459.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  1460.         if healPercentageSP > 0:
  1461.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  1462.  
  1463.     def __AppendAbilityPotionInformation(self):
  1464.  
  1465.         self.AppendSpace(5)
  1466.  
  1467.         abilityType = item.GetValue(0)
  1468.         time = item.GetValue(1)
  1469.         point = item.GetValue(2)
  1470.  
  1471.         if abilityType == item.APPLY_ATT_SPEED:
  1472.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  1473.         elif abilityType == item.APPLY_MOV_SPEED:
  1474.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  1475.  
  1476.         if time > 0:
  1477.             minute = (time / 60)
  1478.             second = (time % 60)
  1479.             timeString = localeInfo.TOOLTIP_POTION_TIME
  1480.  
  1481.             if minute > 0:
  1482.                 timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1483.             if second > 0:
  1484.                 timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1485.  
  1486.             self.AppendTextLine(timeString)
  1487.  
  1488.     def GetPriceColor(self, price):
  1489.         if price>=constInfo.HIGH_PRICE:
  1490.             return self.HIGH_PRICE_COLOR
  1491.         if price>=constInfo.MIDDLE_PRICE:
  1492.             return self.MIDDLE_PRICE_COLOR
  1493.         else:
  1494.             return self.LOW_PRICE_COLOR
  1495.                        
  1496.     def AppendPrice(self, price):  
  1497.         self.AppendSpace(5)
  1498.         self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE  % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1499.        
  1500.     def AppendPriceBySecondaryCoin(self, price):
  1501.         self.AppendSpace(5)
  1502.         self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE  % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  1503.  
  1504.     def AppendSellingPrice(self, price):
  1505.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):           
  1506.             self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  1507.             self.AppendSpace(5)
  1508.         else:
  1509.             self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1510.             self.AppendSpace(5)
  1511.  
  1512.     def AppendMetinInformation(self):
  1513.         affectType, affectValue = item.GetAffect(0)
  1514.         #affectType = item.GetValue(0)
  1515.         #affectValue = item.GetValue(1)
  1516.  
  1517.         affectString = self.__GetAffectString(affectType, affectValue)
  1518.  
  1519.         if affectString:
  1520.             self.AppendSpace(5)
  1521.             self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1522.  
  1523.     def AppendMetinWearInformation(self):
  1524.  
  1525.         self.AppendSpace(5)
  1526.         self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  1527.  
  1528.         flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  1529.                     item.IsWearableFlag(item.WEARABLE_HEAD),
  1530.                     item.IsWearableFlag(item.WEARABLE_FOOTS),
  1531.                     item.IsWearableFlag(item.WEARABLE_WRIST),
  1532.                     item.IsWearableFlag(item.WEARABLE_WEAPON),
  1533.                     item.IsWearableFlag(item.WEARABLE_NECK),
  1534.                     item.IsWearableFlag(item.WEARABLE_EAR),
  1535.                     item.IsWearableFlag(item.WEARABLE_UNIQUE),
  1536.                     item.IsWearableFlag(item.WEARABLE_SHIELD),
  1537.                     item.IsWearableFlag(item.WEARABLE_ARROW))
  1538.  
  1539.         wearNames = ""
  1540.         for i in xrange(self.WEAR_COUNT):
  1541.  
  1542.             name = self.WEAR_NAMES[i]
  1543.             flag = flagList[i]
  1544.  
  1545.             if flag:
  1546.                 wearNames += "  "
  1547.                 wearNames += name
  1548.  
  1549.         textLine = ui.TextLine()
  1550.         textLine.SetParent(self)
  1551.         textLine.SetFontName(self.defFontName)
  1552.         textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  1553.         textLine.SetHorizontalAlignCenter()
  1554.         textLine.SetPackedFontColor(self.NORMAL_COLOR)
  1555.         textLine.SetText(wearNames)
  1556.         textLine.Show()
  1557.         self.childrenList.append(textLine)
  1558.  
  1559.         self.toolTipHeight += self.TEXT_LINE_HEIGHT
  1560.         self.ResizeToolTip()
  1561.  
  1562.     def GetMetinSocketType(self, number):
  1563.         if player.METIN_SOCKET_TYPE_NONE == number:
  1564.             return player.METIN_SOCKET_TYPE_NONE
  1565.         elif player.METIN_SOCKET_TYPE_SILVER == number:
  1566.             return player.METIN_SOCKET_TYPE_SILVER
  1567.         elif player.METIN_SOCKET_TYPE_GOLD == number:
  1568.             return player.METIN_SOCKET_TYPE_GOLD
  1569.         else:
  1570.             item.SelectItem(number)
  1571.             if item.METIN_NORMAL == item.GetItemSubType():
  1572.                 return player.METIN_SOCKET_TYPE_SILVER
  1573.             elif item.METIN_GOLD == item.GetItemSubType():
  1574.                 return player.METIN_SOCKET_TYPE_GOLD
  1575.             elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  1576.                 return player.METIN_SOCKET_TYPE_SILVER
  1577.             elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  1578.                 return player.METIN_SOCKET_TYPE_SILVER
  1579.             elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  1580.                 return player.METIN_SOCKET_TYPE_SILVER
  1581.  
  1582.         return player.METIN_SOCKET_TYPE_NONE
  1583.  
  1584.     def GetMetinItemIndex(self, number):
  1585.         if player.METIN_SOCKET_TYPE_SILVER == number:
  1586.             return 0
  1587.         if player.METIN_SOCKET_TYPE_GOLD == number:
  1588.             return 0
  1589.  
  1590.         return number
  1591.  
  1592.     def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):     
  1593.         ACCESSORY_SOCKET_MAX_SIZE = 3      
  1594.  
  1595.         cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  1596.         end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  1597.  
  1598.         affectType1, affectValue1 = item.GetAffect(0)
  1599.         affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  1600.  
  1601.         affectType2, affectValue2 = item.GetAffect(1)
  1602.         affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  1603.  
  1604.         mtrlPos=0
  1605.         mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  1606.         for mtrl in mtrlList:
  1607.             affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])           
  1608.             affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  1609.  
  1610.             leftTime = 0
  1611.             if cur == mtrlPos+1:
  1612.                 leftTime=metinSlot[2]
  1613.  
  1614.             self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  1615.             mtrlPos+=1
  1616.  
  1617.     def __AppendMetinSlotInfo(self, metinSlot):
  1618.         if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  1619.             return
  1620.  
  1621.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1622.             self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  1623.  
  1624.     def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  1625.         if 0 == metinSlot:
  1626.             return 1
  1627.  
  1628.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1629.             metinSlotData=metinSlot[i]
  1630.             if 0 != self.GetMetinSocketType(metinSlotData):
  1631.                 if 0 != self.GetMetinItemIndex(metinSlotData):
  1632.                     return 0
  1633.  
  1634.         return 1
  1635.  
  1636.     def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  1637.  
  1638.         slotType = self.GetMetinSocketType(metinSlotData)
  1639.         itemIndex = self.GetMetinItemIndex(metinSlotData)
  1640.  
  1641.         if 0 == slotType:
  1642.             return
  1643.  
  1644.         self.AppendSpace(5)
  1645.  
  1646.         slotImage = ui.ImageBox()
  1647.         slotImage.SetParent(self)
  1648.         slotImage.Show()
  1649.  
  1650.         ## Name
  1651.         nameTextLine = ui.TextLine()
  1652.         nameTextLine.SetParent(self)
  1653.         nameTextLine.SetFontName(self.defFontName)
  1654.         nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  1655.         nameTextLine.SetOutline()
  1656.         nameTextLine.SetFeather()
  1657.         nameTextLine.Show()        
  1658.  
  1659.         self.childrenList.append(nameTextLine)
  1660.  
  1661.         if player.METIN_SOCKET_TYPE_SILVER == slotType:
  1662.             slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  1663.         elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  1664.             slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  1665.  
  1666.         self.childrenList.append(slotImage)
  1667.        
  1668.         if localeInfo.IsARABIC():
  1669.             slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  1670.             nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  1671.         else:
  1672.             slotImage.SetPosition(9, self.toolTipHeight-1)
  1673.             nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  1674.  
  1675.         metinImage = ui.ImageBox()
  1676.         metinImage.SetParent(self)
  1677.         metinImage.Show()
  1678.         self.childrenList.append(metinImage)
  1679.  
  1680.         if itemIndex:
  1681.  
  1682.             item.SelectItem(itemIndex)
  1683.  
  1684.             ## Image
  1685.             try:
  1686.                 metinImage.LoadImage(item.GetIconImageFileName())
  1687.             except:
  1688.                 dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  1689.                     (itemIndex, item.GetIconImageFileName())
  1690.                 )
  1691.  
  1692.             nameTextLine.SetText(item.GetItemName())
  1693.            
  1694.             ## Affect      
  1695.             affectTextLine = ui.TextLine()
  1696.             affectTextLine.SetParent(self)
  1697.             affectTextLine.SetFontName(self.defFontName)
  1698.             affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1699.             affectTextLine.SetOutline()
  1700.             affectTextLine.SetFeather()
  1701.             affectTextLine.Show()          
  1702.                
  1703.             if localeInfo.IsARABIC():
  1704.                 metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  1705.                 affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  1706.             else:
  1707.                 metinImage.SetPosition(10, self.toolTipHeight)
  1708.                 affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  1709.                            
  1710.             if custumAffectString:
  1711.                 affectTextLine.SetText(custumAffectString)
  1712.             elif itemIndex!=constInfo.ERROR_METIN_STONE:
  1713.                 affectType, affectValue = item.GetAffect(0)
  1714.                 affectString = self.__GetAffectString(affectType, affectValue)
  1715.                 if affectString:
  1716.                     affectTextLine.SetText(affectString)
  1717.             else:
  1718.                 affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  1719.            
  1720.             self.childrenList.append(affectTextLine)           
  1721.  
  1722.             if custumAffectString2:
  1723.                 affectTextLine = ui.TextLine()
  1724.                 affectTextLine.SetParent(self)
  1725.                 affectTextLine.SetFontName(self.defFontName)
  1726.                 affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1727.                 affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1728.                 affectTextLine.SetOutline()
  1729.                 affectTextLine.SetFeather()
  1730.                 affectTextLine.Show()
  1731.                 affectTextLine.SetText(custumAffectString2)
  1732.                 self.childrenList.append(affectTextLine)
  1733.                 self.toolTipHeight += 16 + 2
  1734.  
  1735.             if 0 != leftTime:
  1736.                 timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  1737.  
  1738.                 timeTextLine = ui.TextLine()
  1739.                 timeTextLine.SetParent(self)
  1740.                 timeTextLine.SetFontName(self.defFontName)
  1741.                 timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1742.                 timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1743.                 timeTextLine.SetOutline()
  1744.                 timeTextLine.SetFeather()
  1745.                 timeTextLine.Show()
  1746.                 timeTextLine.SetText(timeText)
  1747.                 self.childrenList.append(timeTextLine)
  1748.                 self.toolTipHeight += 16 + 2
  1749.  
  1750.         else:
  1751.             nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  1752.  
  1753.         self.toolTipHeight += 35
  1754.         self.ResizeToolTip()
  1755.  
  1756.     def __AppendFishInfo(self, size):
  1757.         if size > 0:
  1758.             self.AppendSpace(5)
  1759.             self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  1760.  
  1761.     def AppendUniqueItemLastTime(self, restMin):
  1762.         restSecond = restMin*60
  1763.         self.AppendSpace(5)
  1764.         self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  1765.  
  1766.     def AppendMallItemLastTime(self, endTime):
  1767.         leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  1768.         self.AppendSpace(5)
  1769.         self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  1770.        
  1771.     def AppendTimerBasedOnWearLastTime(self, metinSlot):
  1772.         if 0 == metinSlot[0]:
  1773.             self.AppendSpace(5)
  1774.             self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  1775.         else:
  1776.             endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  1777.             self.AppendMallItemLastTime(endTime)       
  1778.    
  1779.     def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):    
  1780.         useCount = metinSlot[1]
  1781.         endTime = metinSlot[0]
  1782.        
  1783.         # ? ???? ????? Socket0? ?? ??(2012? 3? 1? 13? 01? ??..) ? ????.
  1784.         # ???? ???? Socket0? ??????(???? 600 ?? ?. ???)? ???? ? ??, 0??? Limit Value? ?? ??????? ????.
  1785.         if 0 == useCount:
  1786.             if 0 == endTime:
  1787.                 (limitType, limitValue) = item.GetLimit(limitIndex)
  1788.                 endTime = limitValue
  1789.  
  1790.             endTime += app.GetGlobalTimeStamp()
  1791.    
  1792.         self.AppendMallItemLastTime(endTime)
  1793.    
  1794. class HyperlinkItemToolTip(ItemToolTip):
  1795.     def __init__(self):
  1796.         ItemToolTip.__init__(self, isPickable=True)
  1797.  
  1798.     def SetHyperlinkItem(self, tokens):
  1799.         minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
  1800.         maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  1801.         if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  1802.             head, vnum, flag = tokens[:3]
  1803.             itemVnum = int(vnum, 16)
  1804.             metinSlot = [int(metin, 16) for metin in tokens[3:6]]
  1805.  
  1806.             rests = tokens[6:]
  1807.             if rests:
  1808.                 attrSlot = []
  1809.  
  1810.                 rests.reverse()
  1811.                 while rests:
  1812.                     key = int(rests.pop(), 16)
  1813.                     if rests:
  1814.                         val = int(rests.pop())
  1815.                         attrSlot.append((key, val))
  1816.  
  1817.                 attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  1818.             else:
  1819.                 attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  1820.  
  1821.             self.ClearToolTip()
  1822.             self.AddItemData(itemVnum, metinSlot, attrSlot)
  1823.  
  1824.             ItemToolTip.OnUpdate(self)
  1825.  
  1826.     def OnUpdate(self):
  1827.         pass
  1828.  
  1829.     def OnMouseLeftButtonDown(self):
  1830.         self.Hide()
  1831.  
  1832. class SkillToolTip(ToolTip):
  1833.  
  1834.     POINT_NAME_DICT = {
  1835.         player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  1836.         player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  1837.     }
  1838.  
  1839.     SKILL_TOOL_TIP_WIDTH = 200
  1840.     PARTY_SKILL_TOOL_TIP_WIDTH = 340
  1841.  
  1842.     PARTY_SKILL_EXPERIENCE_AFFECT_LIST = (  ( 2, 2,  10,),
  1843.                                             ( 8, 3,  20,),
  1844.                                             (14, 4,  30,),
  1845.                                             (22, 5,  45,),
  1846.                                             (28, 6,  60,),
  1847.                                             (34, 7,  80,),
  1848.                                             (38, 8, 100,), )
  1849.  
  1850.     PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = (  ( 4, 2, 1, 0,),
  1851.                                             (10, 3, 2, 0,),
  1852.                                             (16, 4, 2, 1,),
  1853.                                             (24, 5, 2, 2,), )
  1854.  
  1855.     PARTY_SKILL_ATTACKER_AFFECT_LIST = (    ( 36, 3, ),
  1856.                                             ( 26, 1, ),
  1857.                                             ( 32, 2, ), )
  1858.  
  1859.     SKILL_GRADE_NAME = {    player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  1860.                             player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  1861.                             player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  1862.  
  1863.     AFFECT_NAME_DICT =  {
  1864.                             "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  1865.                             "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  1866.                             "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  1867.                             "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  1868.                             "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  1869.                             "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  1870.                             "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  1871.                             "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  1872.                         }
  1873.     AFFECT_APPEND_TEXT_DICT =   {
  1874.                                     "DODGE" : "%",
  1875.                                     "RESIST_NORMAL" : "%",
  1876.                                     "REFLECT_MELEE" : "%",
  1877.                                 }
  1878.  
  1879.     def __init__(self):
  1880.         ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  1881.     def __del__(self):
  1882.         ToolTip.__del__(self)
  1883.  
  1884.     def SetSkill(self, skillIndex, skillLevel = -1):
  1885.  
  1886.         if 0 == skillIndex:
  1887.             return
  1888.  
  1889.         if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  1890.  
  1891.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1892.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1893.                 self.ResizeToolTip()
  1894.  
  1895.             self.AppendDefaultData(skillIndex)
  1896.             self.AppendSkillConditionData(skillIndex)
  1897.             self.AppendGuildSkillData(skillIndex, skillLevel)
  1898.  
  1899.         else:
  1900.  
  1901.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1902.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1903.                 self.ResizeToolTip()
  1904.  
  1905.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1906.             skillGrade = player.GetSkillGrade(slotIndex)
  1907.             skillLevel = player.GetSkillLevel(slotIndex)
  1908.             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  1909.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  1910.  
  1911.             self.AppendDefaultData(skillIndex)
  1912.             self.AppendSkillConditionData(skillIndex)
  1913.             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  1914.             self.AppendSkillRequirement(skillIndex, skillLevel)
  1915.  
  1916.         self.ShowToolTip()
  1917.  
  1918.     def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  1919.  
  1920.         if 0 == skillIndex:
  1921.             return
  1922.  
  1923.         if player.SKILL_INDEX_TONGSOL == skillIndex:
  1924.  
  1925.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1926.             skillLevel = player.GetSkillLevel(slotIndex)
  1927.  
  1928.             self.AppendDefaultData(skillIndex)
  1929.             self.AppendPartySkillData(skillGrade, skillLevel)
  1930.  
  1931.         elif player.SKILL_INDEX_RIDING == skillIndex:
  1932.  
  1933.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1934.             self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  1935.  
  1936.         elif player.SKILL_INDEX_SUMMON == skillIndex:
  1937.  
  1938.             maxLevel = 10
  1939.  
  1940.             self.ClearToolTip()
  1941.             self.__SetSkillTitle(skillIndex, skillGrade)
  1942.  
  1943.             ## Description
  1944.             description = skill.GetSkillDescription(skillIndex)
  1945.             self.AppendDescription(description, 25)
  1946.  
  1947.             if skillLevel == 10:
  1948.                 self.AppendSpace(5)
  1949.                 self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  1950.                 self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  1951.  
  1952.             else:
  1953.                 self.AppendSpace(5)
  1954.                 self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  1955.                 self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  1956.  
  1957.                 self.AppendSpace(5)
  1958.                 self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  1959.                 self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  1960.  
  1961.         elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  1962.  
  1963.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1964.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1965.                 self.ResizeToolTip()
  1966.  
  1967.             self.AppendDefaultData(skillIndex)
  1968.             self.AppendSkillConditionData(skillIndex)
  1969.             self.AppendGuildSkillData(skillIndex, skillLevel)
  1970.  
  1971.         else:
  1972.  
  1973.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1974.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1975.                 self.ResizeToolTip()
  1976.  
  1977.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1978.  
  1979.             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  1980.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  1981.  
  1982.             self.AppendDefaultData(skillIndex, skillGrade)
  1983.             self.AppendSkillConditionData(skillIndex)
  1984.             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  1985.             self.AppendSkillRequirement(skillIndex, skillLevel)
  1986.  
  1987.         self.ShowToolTip()
  1988.  
  1989.     def __SetSkillTitle(self, skillIndex, skillGrade):
  1990.         self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  1991.         self.__AppendSkillGradeName(skillIndex, skillGrade)
  1992.  
  1993.     def __AppendSkillGradeName(self, skillIndex, skillGrade):      
  1994.         if self.SKILL_GRADE_NAME.has_key(skillGrade):
  1995.             self.AppendSpace(5)
  1996.             self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  1997.  
  1998.     def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  1999.         if 0 == skillIndex:
  2000.             return
  2001.  
  2002.         slotIndex = player.GetSkillSlotIndex(skillIndex)
  2003.  
  2004.         self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2005.         self.ResizeToolTip()
  2006.  
  2007.         self.ClearToolTip()
  2008.         self.__SetSkillTitle(skillIndex, skillGrade)       
  2009.         self.AppendDefaultData(skillIndex, skillGrade)
  2010.         self.AppendSkillConditionData(skillIndex)      
  2011.         self.ShowToolTip()
  2012.  
  2013.     def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2014.         self.ClearToolTip()
  2015.         self.__SetSkillTitle(skillIndex, skillGrade)
  2016.  
  2017.         ## Level Limit
  2018.         levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2019.         if levelLimit > 0:
  2020.  
  2021.             color = self.NORMAL_COLOR
  2022.             if player.GetStatus(player.LEVEL) < levelLimit:
  2023.                 color = self.NEGATIVE_COLOR
  2024.  
  2025.             self.AppendSpace(5)
  2026.             self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2027.  
  2028.         ## Description
  2029.         description = skill.GetSkillDescription(skillIndex)
  2030.         self.AppendDescription(description, 25)
  2031.  
  2032.     def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2033.         self.ClearToolTip()
  2034.         self.__SetSkillTitle(skillIndex, skillGrade)
  2035.  
  2036.         ## Description
  2037.         description = skill.GetSkillDescription(skillIndex)
  2038.         self.AppendDescription(description, 25)
  2039.  
  2040.         if 1 == skillGrade:
  2041.             skillLevel += 19
  2042.         elif 2 == skillGrade:
  2043.             skillLevel += 29
  2044.         elif 3 == skillGrade:
  2045.             skillLevel = 40
  2046.  
  2047.         self.AppendSpace(5)
  2048.         self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2049.  
  2050.     def AppendSkillConditionData(self, skillIndex):
  2051.         conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2052.         if conditionDataCount > 0:
  2053.             self.AppendSpace(5)
  2054.             for i in xrange(conditionDataCount):
  2055.                 self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2056.  
  2057.     def AppendGuildSkillData(self, skillIndex, skillLevel):
  2058.         skillMaxLevel = 7
  2059.         skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2060.         skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2061.         ## Current Level
  2062.         if skillLevel > 0:
  2063.             if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2064.                 self.AppendSpace(5)
  2065.                 if skillLevel == skillMaxLevel:
  2066.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2067.                 else:
  2068.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2069.  
  2070.                 #####
  2071.  
  2072.                 for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2073.                     self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2074.  
  2075.                 ## Cooltime
  2076.                 coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2077.                 if coolTime > 0:
  2078.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2079.  
  2080.                 ## SP
  2081.                 needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2082.                 if needGSP > 0:
  2083.                     self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2084.  
  2085.         ## Next Level
  2086.         if skillLevel < skillMaxLevel:
  2087.             if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2088.                 self.AppendSpace(5)
  2089.                 self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2090.  
  2091.                 #####
  2092.  
  2093.                 for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2094.                     self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2095.  
  2096.                 ## Cooltime
  2097.                 coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2098.                 if coolTime > 0:
  2099.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2100.  
  2101.                 ## SP
  2102.                 needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2103.                 if needGSP > 0:
  2104.                     self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2105.  
  2106.     def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  2107.  
  2108.         self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  2109.         self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  2110.  
  2111.         skillLevelUpPoint = 1
  2112.         realSkillGrade = player.GetSkillGrade(slotIndex)
  2113.         skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  2114.         skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  2115.  
  2116.         ## Current Level
  2117.         if skillLevel > 0:
  2118.             if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2119.                 self.AppendSpace(5)
  2120.                 if skillGrade == skill.SKILL_GRADE_COUNT:
  2121.                     pass
  2122.                 elif skillLevel == skillMaxLevelEnd:
  2123.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2124.                 else:
  2125.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2126.                 self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  2127.  
  2128.         ## Next Level
  2129.         if skillGrade != skill.SKILL_GRADE_COUNT:
  2130.             if skillLevel < skillMaxLevelEnd:
  2131.                 if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  2132.                     self.AppendSpace(5)
  2133.                     ## HP??, ???? ????? ??
  2134.                     if skillIndex == 141 or skillIndex == 142:
  2135.                         self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  2136.                     else:
  2137.                         self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  2138.                     self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  2139.  
  2140.     def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  2141.  
  2142.         affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  2143.         if affectDataCount > 0:
  2144.             for i in xrange(affectDataCount):
  2145.                 type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  2146.  
  2147.                 if not self.AFFECT_NAME_DICT.has_key(type):
  2148.                     continue
  2149.  
  2150.                 minValue = int(minValue)
  2151.                 maxValue = int(maxValue)
  2152.                 affectText = self.AFFECT_NAME_DICT[type]
  2153.  
  2154.                 if "HP" == type:
  2155.                     if minValue < 0 and maxValue < 0:
  2156.                         minValue *= -1
  2157.                         maxValue *= -1
  2158.  
  2159.                     else:
  2160.                         affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  2161.  
  2162.                 affectText += str(minValue)
  2163.                 if minValue != maxValue:
  2164.                     affectText += " - " + str(maxValue)
  2165.                 affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  2166.  
  2167.                 #import debugInfo
  2168.                 #if debugInfo.IsDebugMode():
  2169.                 #   affectText = "!!" + affectText
  2170.  
  2171.                 self.AppendTextLine(affectText, color)
  2172.            
  2173.         else:
  2174.             for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2175.                 self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  2176.        
  2177.  
  2178.         ## Duration
  2179.         duration = skill.GetDuration(skillIndex, skillPercentage)
  2180.         if duration > 0:
  2181.             self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  2182.  
  2183.         ## Cooltime
  2184.         coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  2185.         if coolTime > 0:
  2186.             self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  2187.  
  2188.         ## SP
  2189.         needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  2190.         if needSP != 0:
  2191.             continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  2192.  
  2193.             if skill.IsUseHPSkill(skillIndex):
  2194.                 self.AppendNeedHP(needSP, continuationSP, color)
  2195.             else:
  2196.                 self.AppendNeedSP(needSP, continuationSP, color)
  2197.  
  2198.     def AppendSkillRequirement(self, skillIndex, skillLevel):
  2199.  
  2200.         skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  2201.  
  2202.         if skillLevel >= skillMaxLevel:
  2203.             return
  2204.  
  2205.         isAppendHorizontalLine = False
  2206.  
  2207.         ## Requirement
  2208.         if skill.IsSkillRequirement(skillIndex):
  2209.  
  2210.             if not isAppendHorizontalLine:
  2211.                 isAppendHorizontalLine = True
  2212.                 self.AppendHorizontalLine()
  2213.  
  2214.             requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  2215.  
  2216.             color = self.CANNOT_LEVEL_UP_COLOR
  2217.             if skill.CheckRequirementSueccess(skillIndex):
  2218.                 color = self.CAN_LEVEL_UP_COLOR
  2219.             self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  2220.  
  2221.         ## Require Stat
  2222.         requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  2223.         if requireStatCount > 0:
  2224.  
  2225.             for i in xrange(requireStatCount):
  2226.                 type, level = skill.GetSkillRequireStatData(skillIndex, i)
  2227.                 if self.POINT_NAME_DICT.has_key(type):
  2228.  
  2229.                     if not isAppendHorizontalLine:
  2230.                         isAppendHorizontalLine = True
  2231.                         self.AppendHorizontalLine()
  2232.  
  2233.                     name = self.POINT_NAME_DICT[type]
  2234.                     color = self.CANNOT_LEVEL_UP_COLOR
  2235.                     if player.GetStatus(type) >= level:
  2236.                         color = self.CAN_LEVEL_UP_COLOR
  2237.                     self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  2238.  
  2239.     def HasSkillLevelDescription(self, skillIndex, skillLevel):
  2240.         if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  2241.             return True
  2242.         if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  2243.             return True
  2244.         if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  2245.             return True
  2246.  
  2247.         return False
  2248.  
  2249.     def AppendMasterAffectDescription(self, index, desc, color):
  2250.         self.AppendTextLine(desc, color)
  2251.  
  2252.     def AppendNextAffectDescription(self, index, desc):
  2253.         self.AppendTextLine(desc, self.DISABLE_COLOR)
  2254.  
  2255.     def AppendNeedHP(self, needSP, continuationSP, color):
  2256.  
  2257.         self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  2258.  
  2259.         if continuationSP > 0:
  2260.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  2261.  
  2262.     def AppendNeedSP(self, needSP, continuationSP, color):
  2263.  
  2264.         if -1 == needSP:
  2265.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  2266.  
  2267.         else:
  2268.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  2269.  
  2270.         if continuationSP > 0:
  2271.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  2272.  
  2273.     def AppendPartySkillData(self, skillGrade, skillLevel):
  2274.  
  2275.         if 1 == skillGrade:
  2276.             skillLevel += 19
  2277.         elif 2 == skillGrade:
  2278.             skillLevel += 29
  2279.         elif 3 == skillGrade:
  2280.             skillLevel =  40
  2281.  
  2282.         if skillLevel <= 0:
  2283.             return
  2284.  
  2285.         skillIndex = player.SKILL_INDEX_TONGSOL
  2286.         slotIndex = player.GetSkillSlotIndex(skillIndex)
  2287.         skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2288.         if localeInfo.IsBRAZIL():
  2289.             k = skillPower
  2290.         else:
  2291.             k = player.GetSkillLevel(skillIndex) / 100.0
  2292.         self.AppendSpace(5)
  2293.         self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  2294.  
  2295.         if skillLevel>=10:
  2296.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  2297.  
  2298.         if skillLevel>=20:
  2299.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER    % chop(1 + 5 * k))
  2300.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER   % chop(50 + 1450 * k))
  2301.  
  2302.         if skillLevel>=25:
  2303.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  2304.  
  2305.         if skillLevel>=35:
  2306.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  2307.  
  2308.         if skillLevel>=40:
  2309.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  2310.  
  2311.         self.AlignHorizonalCenter()
  2312.  
  2313.     def __AppendSummonDescription(self, skillLevel, color):
  2314.         if skillLevel > 1:
  2315.             self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  2316.         elif 1 == skillLevel:
  2317.             self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  2318.         elif 0 == skillLevel:
  2319.             self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  2320.  
  2321.  
  2322. if __name__ == "__main__": 
  2323.     import app
  2324.     import wndMgr
  2325.     import systemSetting
  2326.     import mouseModule
  2327.     import grp
  2328.     import ui
  2329.    
  2330.     #wndMgr.SetOutlineFlag(True)
  2331.  
  2332.     app.SetMouseHandler(mouseModule.mouseController)
  2333.     app.SetHairColorEnable(True)
  2334.     wndMgr.SetMouseHandler(mouseModule.mouseController)
  2335.     wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2336.     app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2337.     mouseModule.mouseController.Create()
  2338.  
  2339.     toolTip = ItemToolTip()
  2340.     toolTip.ClearToolTip()
  2341.     #toolTip.AppendTextLine("Test")
  2342.     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."
  2343.     summ = ""
  2344.  
  2345.     toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  2346.     toolTip.Show()
  2347.    
  2348.     app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment