Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 76.59 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.             for i in xrange(item.LIMIT_MAX_NUM):
  1177.                 (limitType, limitValue) = item.GetLimit(i)
  1178.  
  1179.                 if item.LIMIT_REAL_TIME == limitType:
  1180.                     self.AppendMallItemLastTime(metinSlot[0])
  1181.         # elif item.ITEM_TYPE_DS == itemType:
  1182.             self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1183.             # self.__AppendAttributeInformation(attrSlot)
  1184.         else:
  1185.             self.__AppendLimitInformation()
  1186.  
  1187.         for i in xrange(item.LIMIT_MAX_NUM):
  1188.             (limitType, limitValue) = item.GetLimit(i)
  1189.             #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue))
  1190.            
  1191.             if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1192.                 self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1193.                 #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ")
  1194.                
  1195.             elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1196.                 self.AppendTimerBasedOnWearLastTime(metinSlot)
  1197.                 #dbg.TraceError("1) REAL_TIME flag On ")
  1198.  
  1199.  
  1200.                
  1201.         self.ShowToolTip()
  1202.  
  1203.      def __DragonSoulInfoString (self, dwVnum):
  1204.               step = (dwVnum / 100) % 10
  1205.               refine = (dwVnum / 10) % 10
  1206.             if 0 == step:
  1207.                 return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1208.             elif 1 == step:
  1209.                 return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1210.             elif 2 == step:
  1211.                 return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1212.             elif 3 == step:
  1213.                 return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1214.             elif 4 == step:
  1215.                 return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1216.             else:
  1217.                 return ""
  1218.  
  1219.  
  1220.     ## 헤어인가?
  1221.     def __IsHair(self, itemVnum):
  1222.         return (self.__IsOldHair(itemVnum) or
  1223.             self.__IsNewHair(itemVnum) or
  1224.             self.__IsNewHair2(itemVnum) or
  1225.             self.__IsNewHair3(itemVnum) or
  1226.             self.__IsCostumeHair(itemVnum)
  1227.             )
  1228.  
  1229.     def __IsOldHair(self, itemVnum):
  1230.         return itemVnum > 73000 and itemVnum < 74000   
  1231.  
  1232.     def __IsNewHair(self, itemVnum):
  1233.         return itemVnum > 74000 and itemVnum < 75000   
  1234.  
  1235.     def __IsNewHair2(self, itemVnum):
  1236.         return itemVnum > 75000 and itemVnum < 76000   
  1237.  
  1238.     def __IsNewHair3(self, itemVnum):
  1239.         return ((74012 < itemVnum and itemVnum < 74022) or
  1240.             (74262 < itemVnum and itemVnum < 74272) or
  1241.             (74512 < itemVnum and itemVnum < 74522) or
  1242.             (74762 < itemVnum and itemVnum < 74772) or
  1243.             (45000 < itemVnum and itemVnum < 47000))
  1244.  
  1245.     def __IsCostumeHair(self, itemVnum):
  1246.         return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1247.        
  1248.     def __AppendHairIcon(self, itemVnum):
  1249.         itemImage = ui.ImageBox()
  1250.         itemImage.SetParent(self)
  1251.         itemImage.Show()           
  1252.  
  1253.         if self.__IsOldHair(itemVnum):
  1254.             itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1255.         elif self.__IsNewHair3(itemVnum):
  1256.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1257.         elif self.__IsNewHair(itemVnum): # 기존 헤어 번호를 연결시켜서 사용한다. 새로운 아이템은 1000만큼 번호가 늘었다.
  1258.             itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1259.         elif self.__IsNewHair2(itemVnum):
  1260.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1261.         elif self.__IsCostumeHair(itemVnum):
  1262.             itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1263.  
  1264.         itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1265.         self.toolTipHeight += itemImage.GetHeight()
  1266.         #self.toolTipWidth += itemImage.GetWidth()/2
  1267.         self.childrenList.append(itemImage)
  1268.         self.ResizeToolTip()
  1269.  
  1270.     ## 사이즈가 큰 Description 일 경우 툴팁 사이즈를 조정한다
  1271.     def __AdjustMaxWidth(self, attrSlot, desc):
  1272.         newToolTipWidth = self.toolTipWidth
  1273.         newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1274.         newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1275.         if newToolTipWidth > self.toolTipWidth:
  1276.             self.toolTipWidth = newToolTipWidth
  1277.             self.ResizeToolTip()
  1278.  
  1279.     def __AdjustAttrMaxWidth(self, attrSlot):
  1280.         if 0 == attrSlot:
  1281.             return self.toolTipWidth
  1282.  
  1283.         maxWidth = self.toolTipWidth
  1284.         for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1285.             type = attrSlot[i][0]
  1286.             value = attrSlot[i][1]
  1287.             if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1288.                 if value > 0:
  1289.                     maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1290.  
  1291.                     # ATTR_CHANGE_TOOLTIP_WIDTH
  1292.                     #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth)
  1293.                     #self.ResizeToolTip()
  1294.                     # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH
  1295.  
  1296.         return maxWidth
  1297.  
  1298.     def __AdjustDescMaxWidth(self, desc):
  1299.         if len(desc) < DESC_DEFAULT_MAX_COLS:
  1300.             return self.toolTipWidth
  1301.    
  1302.         return DESC_WESTERN_MAX_WIDTH
  1303.  
  1304.     def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1305.         skillName = skill.GetSkillName(skillIndex)
  1306.  
  1307.         if not skillName:
  1308.             return
  1309.  
  1310.         if localeInfo.IsVIETNAM():
  1311.             itemName = bookName + " " + skillName
  1312.         else:
  1313.             itemName = skillName + " " + bookName
  1314.         self.SetTitle(itemName)
  1315.  
  1316.     def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1317.         self.AppendSpace(5)
  1318.         self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1319.         self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1320.  
  1321.         if curEXP == maxEXP:
  1322.             self.AppendSpace(5)
  1323.             self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1324.             self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1325.             self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1326.  
  1327.  
  1328.     def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1329.         self.AppendSpace(5)
  1330.         self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1331.         self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1332.  
  1333.         if curEXP == maxEXP:
  1334.             self.AppendSpace(5)
  1335.             self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  1336.             self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  1337.             self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  1338.  
  1339.     def __AppendLimitInformation(self):
  1340.  
  1341.         appendSpace = False
  1342.  
  1343.         for i in xrange(item.LIMIT_MAX_NUM):
  1344.  
  1345.             (limitType, limitValue) = item.GetLimit(i)
  1346.  
  1347.             if limitValue > 0:
  1348.                 if False == appendSpace:
  1349.                     self.AppendSpace(5)
  1350.                     appendSpace = True
  1351.  
  1352.             else:
  1353.                 continue
  1354.  
  1355.             if item.LIMIT_LEVEL == limitType:
  1356.                 color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  1357.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  1358.             """
  1359.             elif item.LIMIT_STR == limitType:
  1360.                 color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  1361.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  1362.             elif item.LIMIT_DEX == limitType:
  1363.                 color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  1364.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  1365.             elif item.LIMIT_INT == limitType:
  1366.                 color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  1367.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  1368.             elif item.LIMIT_CON == limitType:
  1369.                 color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  1370.                 self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  1371.             """
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.     def __GetAffectString(self, affectType, affectValue):
  1385.         if 0 == affectType:
  1386.             return None
  1387.  
  1388.         if 0 == affectValue:
  1389.             return None
  1390.  
  1391.         try:
  1392.             return self.AFFECT_DICT[affectType](affectValue)
  1393.         except TypeError:
  1394.             return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  1395.         except KeyError:
  1396.             return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  1397.  
  1398.     def __AppendAffectInformation(self):
  1399.         for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1400.  
  1401.             (affectType, affectValue) = item.GetAffect(i)
  1402.  
  1403.             affectString = self.__GetAffectString(affectType, affectValue)
  1404.             if affectString:
  1405.                 self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1406.  
  1407.     def AppendWearableInformation(self):
  1408.  
  1409.         self.AppendSpace(5)
  1410.         self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  1411.  
  1412.         flagList = (
  1413.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  1414.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  1415.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  1416.             not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
  1417.  
  1418.         characterNames = ""
  1419.         for i in xrange(self.CHARACTER_COUNT):
  1420.  
  1421.             name = self.CHARACTER_NAMES[i]
  1422.             flag = flagList[i]
  1423.  
  1424.             if flag:
  1425.                 characterNames += " "
  1426.                 characterNames += name
  1427.  
  1428.         textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  1429.         textLine.SetFeather()
  1430.  
  1431.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  1432.             textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  1433.             textLine.SetFeather()
  1434.  
  1435.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  1436.             textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  1437.             textLine.SetFeather()
  1438.  
  1439.     def __AppendPotionInformation(self):
  1440.         self.AppendSpace(5)
  1441.  
  1442.         healHP = item.GetValue(0)
  1443.         healSP = item.GetValue(1)
  1444.         healStatus = item.GetValue(2)
  1445.         healPercentageHP = item.GetValue(3)
  1446.         healPercentageSP = item.GetValue(4)
  1447.  
  1448.         if healHP > 0:
  1449.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  1450.         if healSP > 0:
  1451.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  1452.         if healStatus != 0:
  1453.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  1454.         if healPercentageHP > 0:
  1455.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  1456.         if healPercentageSP > 0:
  1457.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  1458.  
  1459.     def __AppendAbilityPotionInformation(self):
  1460.  
  1461.         self.AppendSpace(5)
  1462.  
  1463.         abilityType = item.GetValue(0)
  1464.         time = item.GetValue(1)
  1465.         point = item.GetValue(2)
  1466.  
  1467.         if abilityType == item.APPLY_ATT_SPEED:
  1468.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  1469.         elif abilityType == item.APPLY_MOV_SPEED:
  1470.             self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  1471.  
  1472.         if time > 0:
  1473.             minute = (time / 60)
  1474.             second = (time % 60)
  1475.             timeString = localeInfo.TOOLTIP_POTION_TIME
  1476.  
  1477.             if minute > 0:
  1478.                 timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1479.             if second > 0:
  1480.                 timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1481.  
  1482.             self.AppendTextLine(timeString)
  1483.  
  1484.     def GetPriceColor(self, price):
  1485.         if price>=constInfo.HIGH_PRICE:
  1486.             return self.HIGH_PRICE_COLOR
  1487.         if price>=constInfo.MIDDLE_PRICE:
  1488.             return self.MIDDLE_PRICE_COLOR
  1489.         else:
  1490.             return self.LOW_PRICE_COLOR
  1491.                        
  1492.     def AppendPrice(self, price):  
  1493.         self.AppendSpace(5)
  1494.         self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE  % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1495.        
  1496.     def AppendPriceBySecondaryCoin(self, price):
  1497.         self.AppendSpace(5)
  1498.         self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE  % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  1499.  
  1500.     def AppendSellingPrice(self, price):
  1501.         if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):           
  1502.             self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  1503.             self.AppendSpace(5)
  1504.         else:
  1505.             self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1506.             self.AppendSpace(5)
  1507.  
  1508.     def AppendMetinInformation(self):
  1509.         affectType, affectValue = item.GetAffect(0)
  1510.         #affectType = item.GetValue(0)
  1511.         #affectValue = item.GetValue(1)
  1512.  
  1513.         affectString = self.__GetAffectString(affectType, affectValue)
  1514.  
  1515.         if affectString:
  1516.             self.AppendSpace(5)
  1517.             self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1518.  
  1519.     def AppendMetinWearInformation(self):
  1520.  
  1521.         self.AppendSpace(5)
  1522.         self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  1523.  
  1524.         flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  1525.                     item.IsWearableFlag(item.WEARABLE_HEAD),
  1526.                     item.IsWearableFlag(item.WEARABLE_FOOTS),
  1527.                     item.IsWearableFlag(item.WEARABLE_WRIST),
  1528.                     item.IsWearableFlag(item.WEARABLE_WEAPON),
  1529.                     item.IsWearableFlag(item.WEARABLE_NECK),
  1530.                     item.IsWearableFlag(item.WEARABLE_EAR),
  1531.                     item.IsWearableFlag(item.WEARABLE_UNIQUE),
  1532.                     item.IsWearableFlag(item.WEARABLE_SHIELD),
  1533.                     item.IsWearableFlag(item.WEARABLE_ARROW))
  1534.  
  1535.         wearNames = ""
  1536.         for i in xrange(self.WEAR_COUNT):
  1537.  
  1538.             name = self.WEAR_NAMES[i]
  1539.             flag = flagList[i]
  1540.  
  1541.             if flag:
  1542.                 wearNames += "  "
  1543.                 wearNames += name
  1544.  
  1545.         textLine = ui.TextLine()
  1546.         textLine.SetParent(self)
  1547.         textLine.SetFontName(self.defFontName)
  1548.         textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  1549.         textLine.SetHorizontalAlignCenter()
  1550.         textLine.SetPackedFontColor(self.NORMAL_COLOR)
  1551.         textLine.SetText(wearNames)
  1552.         textLine.Show()
  1553.         self.childrenList.append(textLine)
  1554.  
  1555.         self.toolTipHeight += self.TEXT_LINE_HEIGHT
  1556.         self.ResizeToolTip()
  1557.  
  1558.     def GetMetinSocketType(self, number):
  1559.         if player.METIN_SOCKET_TYPE_NONE == number:
  1560.             return player.METIN_SOCKET_TYPE_NONE
  1561.         elif player.METIN_SOCKET_TYPE_SILVER == number:
  1562.             return player.METIN_SOCKET_TYPE_SILVER
  1563.         elif player.METIN_SOCKET_TYPE_GOLD == number:
  1564.             return player.METIN_SOCKET_TYPE_GOLD
  1565.         else:
  1566.             item.SelectItem(number)
  1567.             if item.METIN_NORMAL == item.GetItemSubType():
  1568.                 return player.METIN_SOCKET_TYPE_SILVER
  1569.             elif item.METIN_GOLD == item.GetItemSubType():
  1570.                 return player.METIN_SOCKET_TYPE_GOLD
  1571.             elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  1572.                 return player.METIN_SOCKET_TYPE_SILVER
  1573.             elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  1574.                 return player.METIN_SOCKET_TYPE_SILVER
  1575.             elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  1576.                 return player.METIN_SOCKET_TYPE_SILVER
  1577.  
  1578.         return player.METIN_SOCKET_TYPE_NONE
  1579.  
  1580.     def GetMetinItemIndex(self, number):
  1581.         if player.METIN_SOCKET_TYPE_SILVER == number:
  1582.             return 0
  1583.         if player.METIN_SOCKET_TYPE_GOLD == number:
  1584.             return 0
  1585.  
  1586.         return number
  1587.  
  1588.     def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):     
  1589.         ACCESSORY_SOCKET_MAX_SIZE = 3      
  1590.  
  1591.         cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  1592.         end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  1593.  
  1594.         affectType1, affectValue1 = item.GetAffect(0)
  1595.         affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  1596.  
  1597.         affectType2, affectValue2 = item.GetAffect(1)
  1598.         affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  1599.  
  1600.         mtrlPos=0
  1601.         mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  1602.         for mtrl in mtrlList:
  1603.             affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])           
  1604.             affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  1605.  
  1606.             leftTime = 0
  1607.             if cur == mtrlPos+1:
  1608.                 leftTime=metinSlot[2]
  1609.  
  1610.             self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  1611.             mtrlPos+=1
  1612.  
  1613.     def __AppendMetinSlotInfo(self, metinSlot):
  1614.         if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  1615.             return
  1616.  
  1617.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1618.             self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  1619.  
  1620.     def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  1621.         if 0 == metinSlot:
  1622.             return 1
  1623.  
  1624.         for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1625.             metinSlotData=metinSlot[i]
  1626.             if 0 != self.GetMetinSocketType(metinSlotData):
  1627.                 if 0 != self.GetMetinItemIndex(metinSlotData):
  1628.                     return 0
  1629.  
  1630.         return 1
  1631.  
  1632.     def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  1633.  
  1634.         slotType = self.GetMetinSocketType(metinSlotData)
  1635.         itemIndex = self.GetMetinItemIndex(metinSlotData)
  1636.  
  1637.         if 0 == slotType:
  1638.             return
  1639.  
  1640.         self.AppendSpace(5)
  1641.  
  1642.         slotImage = ui.ImageBox()
  1643.         slotImage.SetParent(self)
  1644.         slotImage.Show()
  1645.  
  1646.         ## Name
  1647.         nameTextLine = ui.TextLine()
  1648.         nameTextLine.SetParent(self)
  1649.         nameTextLine.SetFontName(self.defFontName)
  1650.         nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  1651.         nameTextLine.SetOutline()
  1652.         nameTextLine.SetFeather()
  1653.         nameTextLine.Show()        
  1654.  
  1655.         self.childrenList.append(nameTextLine)
  1656.  
  1657.         if player.METIN_SOCKET_TYPE_SILVER == slotType:
  1658.             slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  1659.         elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  1660.             slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  1661.  
  1662.         self.childrenList.append(slotImage)
  1663.        
  1664.         if localeInfo.IsARABIC():
  1665.             slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  1666.             nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  1667.         else:
  1668.             slotImage.SetPosition(9, self.toolTipHeight-1)
  1669.             nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  1670.  
  1671.         metinImage = ui.ImageBox()
  1672.         metinImage.SetParent(self)
  1673.         metinImage.Show()
  1674.         self.childrenList.append(metinImage)
  1675.  
  1676.         if itemIndex:
  1677.  
  1678.             item.SelectItem(itemIndex)
  1679.  
  1680.             ## Image
  1681.             try:
  1682.                 metinImage.LoadImage(item.GetIconImageFileName())
  1683.             except:
  1684.                 dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  1685.                     (itemIndex, item.GetIconImageFileName())
  1686.                 )
  1687.  
  1688.             nameTextLine.SetText(item.GetItemName())
  1689.            
  1690.             ## Affect      
  1691.             affectTextLine = ui.TextLine()
  1692.             affectTextLine.SetParent(self)
  1693.             affectTextLine.SetFontName(self.defFontName)
  1694.             affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1695.             affectTextLine.SetOutline()
  1696.             affectTextLine.SetFeather()
  1697.             affectTextLine.Show()          
  1698.                
  1699.             if localeInfo.IsARABIC():
  1700.                 metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  1701.                 affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  1702.             else:
  1703.                 metinImage.SetPosition(10, self.toolTipHeight)
  1704.                 affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  1705.                            
  1706.             if custumAffectString:
  1707.                 affectTextLine.SetText(custumAffectString)
  1708.             elif itemIndex!=constInfo.ERROR_METIN_STONE:
  1709.                 affectType, affectValue = item.GetAffect(0)
  1710.                 affectString = self.__GetAffectString(affectType, affectValue)
  1711.                 if affectString:
  1712.                     affectTextLine.SetText(affectString)
  1713.             else:
  1714.                 affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  1715.            
  1716.             self.childrenList.append(affectTextLine)           
  1717.  
  1718.             if custumAffectString2:
  1719.                 affectTextLine = ui.TextLine()
  1720.                 affectTextLine.SetParent(self)
  1721.                 affectTextLine.SetFontName(self.defFontName)
  1722.                 affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1723.                 affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1724.                 affectTextLine.SetOutline()
  1725.                 affectTextLine.SetFeather()
  1726.                 affectTextLine.Show()
  1727.                 affectTextLine.SetText(custumAffectString2)
  1728.                 self.childrenList.append(affectTextLine)
  1729.                 self.toolTipHeight += 16 + 2
  1730.  
  1731.             if 0 != leftTime:
  1732.                 timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  1733.  
  1734.                 timeTextLine = ui.TextLine()
  1735.                 timeTextLine.SetParent(self)
  1736.                 timeTextLine.SetFontName(self.defFontName)
  1737.                 timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1738.                 timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1739.                 timeTextLine.SetOutline()
  1740.                 timeTextLine.SetFeather()
  1741.                 timeTextLine.Show()
  1742.                 timeTextLine.SetText(timeText)
  1743.                 self.childrenList.append(timeTextLine)
  1744.                 self.toolTipHeight += 16 + 2
  1745.  
  1746.         else:
  1747.             nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  1748.  
  1749.         self.toolTipHeight += 35
  1750.         self.ResizeToolTip()
  1751.  
  1752.     def __AppendFishInfo(self, size):
  1753.         if size > 0:
  1754.             self.AppendSpace(5)
  1755.             self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  1756.  
  1757.     def AppendUniqueItemLastTime(self, restMin):
  1758.         restSecond = restMin*60
  1759.         self.AppendSpace(5)
  1760.         self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  1761.  
  1762.     def AppendMallItemLastTime(self, endTime):
  1763.         leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  1764.         self.AppendSpace(5)
  1765.         self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  1766.        
  1767.     def AppendTimerBasedOnWearLastTime(self, metinSlot):
  1768.         if 0 == metinSlot[0]:
  1769.             self.AppendSpace(5)
  1770.             self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  1771.         else:
  1772.             endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  1773.             self.AppendMallItemLastTime(endTime)       
  1774.    
  1775.     def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):    
  1776.         useCount = metinSlot[1]
  1777.         endTime = metinSlot[0]
  1778.        
  1779.         # 한 번이라도 사용했다면 Socket0에 종료 시간(2012년 3월 1일 13시 01분 같은..) 이 박혀있음.
  1780.         # 사용하지 않았다면 Socket0에 이용가능시간(이를테면 600 같은 값. 초단위)이 들어있을 수 있고, 0이라면 Limit Value에 있는 이용가능시간을 사용한다.
  1781.         if 0 == useCount:
  1782.             if 0 == endTime:
  1783.                 (limitType, limitValue) = item.GetLimit(limitIndex)
  1784.                 endTime = limitValue
  1785.  
  1786.             endTime += app.GetGlobalTimeStamp()
  1787.    
  1788.         self.AppendMallItemLastTime(endTime)
  1789.    
  1790. class HyperlinkItemToolTip(ItemToolTip):
  1791.     def __init__(self):
  1792.         ItemToolTip.__init__(self, isPickable=True)
  1793.  
  1794.     def SetHyperlinkItem(self, tokens):
  1795.         minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
  1796.         maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  1797.         if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  1798.             head, vnum, flag = tokens[:3]
  1799.             itemVnum = int(vnum, 16)
  1800.             metinSlot = [int(metin, 16) for metin in tokens[3:6]]
  1801.  
  1802.             rests = tokens[6:]
  1803.             if rests:
  1804.                 attrSlot = []
  1805.  
  1806.                 rests.reverse()
  1807.                 while rests:
  1808.                     key = int(rests.pop(), 16)
  1809.                     if rests:
  1810.                         val = int(rests.pop())
  1811.                         attrSlot.append((key, val))
  1812.  
  1813.                 attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  1814.             else:
  1815.                 attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  1816.  
  1817.             self.ClearToolTip()
  1818.             self.AddItemData(itemVnum, metinSlot, attrSlot)
  1819.  
  1820.             ItemToolTip.OnUpdate(self)
  1821.  
  1822.     def OnUpdate(self):
  1823.         pass
  1824.  
  1825.     def OnMouseLeftButtonDown(self):
  1826.         self.Hide()
  1827.  
  1828. class SkillToolTip(ToolTip):
  1829.  
  1830.     POINT_NAME_DICT = {
  1831.         player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  1832.         player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  1833.     }
  1834.  
  1835.     SKILL_TOOL_TIP_WIDTH = 200
  1836.     PARTY_SKILL_TOOL_TIP_WIDTH = 340
  1837.  
  1838.     PARTY_SKILL_EXPERIENCE_AFFECT_LIST = (  ( 2, 2,  10,),
  1839.                                             ( 8, 3,  20,),
  1840.                                             (14, 4,  30,),
  1841.                                             (22, 5,  45,),
  1842.                                             (28, 6,  60,),
  1843.                                             (34, 7,  80,),
  1844.                                             (38, 8, 100,), )
  1845.  
  1846.     PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = (  ( 4, 2, 1, 0,),
  1847.                                             (10, 3, 2, 0,),
  1848.                                             (16, 4, 2, 1,),
  1849.                                             (24, 5, 2, 2,), )
  1850.  
  1851.     PARTY_SKILL_ATTACKER_AFFECT_LIST = (    ( 36, 3, ),
  1852.                                             ( 26, 1, ),
  1853.                                             ( 32, 2, ), )
  1854.  
  1855.     SKILL_GRADE_NAME = {    player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  1856.                             player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  1857.                             player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  1858.  
  1859.     AFFECT_NAME_DICT =  {
  1860.                             "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  1861.                             "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  1862.                             "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  1863.                             "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  1864.                             "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  1865.                             "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  1866.                             "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  1867.                             "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  1868.                         }
  1869.     AFFECT_APPEND_TEXT_DICT =   {
  1870.                                     "DODGE" : "%",
  1871.                                     "RESIST_NORMAL" : "%",
  1872.                                     "REFLECT_MELEE" : "%",
  1873.                                 }
  1874.  
  1875.     def __init__(self):
  1876.         ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  1877.     def __del__(self):
  1878.         ToolTip.__del__(self)
  1879.  
  1880.     def SetSkill(self, skillIndex, skillLevel = -1):
  1881.  
  1882.         if 0 == skillIndex:
  1883.             return
  1884.  
  1885.         if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  1886.  
  1887.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1888.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1889.                 self.ResizeToolTip()
  1890.  
  1891.             self.AppendDefaultData(skillIndex)
  1892.             self.AppendSkillConditionData(skillIndex)
  1893.             self.AppendGuildSkillData(skillIndex, skillLevel)
  1894.  
  1895.         else:
  1896.  
  1897.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1898.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1899.                 self.ResizeToolTip()
  1900.  
  1901.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1902.             skillGrade = player.GetSkillGrade(slotIndex)
  1903.             skillLevel = player.GetSkillLevel(slotIndex)
  1904.             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  1905.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  1906.  
  1907.             self.AppendDefaultData(skillIndex)
  1908.             self.AppendSkillConditionData(skillIndex)
  1909.             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  1910.             self.AppendSkillRequirement(skillIndex, skillLevel)
  1911.  
  1912.         self.ShowToolTip()
  1913.  
  1914.     def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  1915.  
  1916.         if 0 == skillIndex:
  1917.             return
  1918.  
  1919.         if player.SKILL_INDEX_TONGSOL == skillIndex:
  1920.  
  1921.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1922.             skillLevel = player.GetSkillLevel(slotIndex)
  1923.  
  1924.             self.AppendDefaultData(skillIndex)
  1925.             self.AppendPartySkillData(skillGrade, skillLevel)
  1926.  
  1927.         elif player.SKILL_INDEX_RIDING == skillIndex:
  1928.  
  1929.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1930.             self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  1931.  
  1932.         elif player.SKILL_INDEX_SUMMON == skillIndex:
  1933.  
  1934.             maxLevel = 10
  1935.  
  1936.             self.ClearToolTip()
  1937.             self.__SetSkillTitle(skillIndex, skillGrade)
  1938.  
  1939.             ## Description
  1940.             description = skill.GetSkillDescription(skillIndex)
  1941.             self.AppendDescription(description, 25)
  1942.  
  1943.             if skillLevel == 10:
  1944.                 self.AppendSpace(5)
  1945.                 self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  1946.                 self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  1947.  
  1948.             else:
  1949.                 self.AppendSpace(5)
  1950.                 self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  1951.                 self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  1952.  
  1953.                 self.AppendSpace(5)
  1954.                 self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  1955.                 self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  1956.  
  1957.         elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  1958.  
  1959.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1960.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1961.                 self.ResizeToolTip()
  1962.  
  1963.             self.AppendDefaultData(skillIndex)
  1964.             self.AppendSkillConditionData(skillIndex)
  1965.             self.AppendGuildSkillData(skillIndex, skillLevel)
  1966.  
  1967.         else:
  1968.  
  1969.             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1970.                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  1971.                 self.ResizeToolTip()
  1972.  
  1973.             slotIndex = player.GetSkillSlotIndex(skillIndex)
  1974.  
  1975.             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  1976.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  1977.  
  1978.             self.AppendDefaultData(skillIndex, skillGrade)
  1979.             self.AppendSkillConditionData(skillIndex)
  1980.             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  1981.             self.AppendSkillRequirement(skillIndex, skillLevel)
  1982.  
  1983.         self.ShowToolTip()
  1984.  
  1985.     def __SetSkillTitle(self, skillIndex, skillGrade):
  1986.         self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  1987.         self.__AppendSkillGradeName(skillIndex, skillGrade)
  1988.  
  1989.     def __AppendSkillGradeName(self, skillIndex, skillGrade):      
  1990.         if self.SKILL_GRADE_NAME.has_key(skillGrade):
  1991.             self.AppendSpace(5)
  1992.             self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  1993.  
  1994.     def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  1995.         if 0 == skillIndex:
  1996.             return
  1997.  
  1998.         slotIndex = player.GetSkillSlotIndex(skillIndex)
  1999.  
  2000.         self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2001.         self.ResizeToolTip()
  2002.  
  2003.         self.ClearToolTip()
  2004.         self.__SetSkillTitle(skillIndex, skillGrade)       
  2005.         self.AppendDefaultData(skillIndex, skillGrade)
  2006.         self.AppendSkillConditionData(skillIndex)      
  2007.         self.ShowToolTip()
  2008.  
  2009.     def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2010.         self.ClearToolTip()
  2011.         self.__SetSkillTitle(skillIndex, skillGrade)
  2012.  
  2013.         ## Level Limit
  2014.         levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2015.         if levelLimit > 0:
  2016.  
  2017.             color = self.NORMAL_COLOR
  2018.             if player.GetStatus(player.LEVEL) < levelLimit:
  2019.                 color = self.NEGATIVE_COLOR
  2020.  
  2021.             self.AppendSpace(5)
  2022.             self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2023.  
  2024.         ## Description
  2025.         description = skill.GetSkillDescription(skillIndex)
  2026.         self.AppendDescription(description, 25)
  2027.  
  2028.     def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2029.         self.ClearToolTip()
  2030.         self.__SetSkillTitle(skillIndex, skillGrade)
  2031.  
  2032.         ## Description
  2033.         description = skill.GetSkillDescription(skillIndex)
  2034.         self.AppendDescription(description, 25)
  2035.  
  2036.         if 1 == skillGrade:
  2037.             skillLevel += 19
  2038.         elif 2 == skillGrade:
  2039.             skillLevel += 29
  2040.         elif 3 == skillGrade:
  2041.             skillLevel = 40
  2042.  
  2043.         self.AppendSpace(5)
  2044.         self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2045.  
  2046.     def AppendSkillConditionData(self, skillIndex):
  2047.         conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2048.         if conditionDataCount > 0:
  2049.             self.AppendSpace(5)
  2050.             for i in xrange(conditionDataCount):
  2051.                 self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2052.  
  2053.     def AppendGuildSkillData(self, skillIndex, skillLevel):
  2054.         skillMaxLevel = 7
  2055.         skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2056.         skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2057.         ## Current Level
  2058.         if skillLevel > 0:
  2059.             if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2060.                 self.AppendSpace(5)
  2061.                 if skillLevel == skillMaxLevel:
  2062.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2063.                 else:
  2064.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2065.  
  2066.                 #####
  2067.  
  2068.                 for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2069.                     self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2070.  
  2071.                 ## Cooltime
  2072.                 coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2073.                 if coolTime > 0:
  2074.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2075.  
  2076.                 ## SP
  2077.                 needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2078.                 if needGSP > 0:
  2079.                     self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2080.  
  2081.         ## Next Level
  2082.         if skillLevel < skillMaxLevel:
  2083.             if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2084.                 self.AppendSpace(5)
  2085.                 self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2086.  
  2087.                 #####
  2088.  
  2089.                 for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2090.                     self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2091.  
  2092.                 ## Cooltime
  2093.                 coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2094.                 if coolTime > 0:
  2095.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2096.  
  2097.                 ## SP
  2098.                 needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2099.                 if needGSP > 0:
  2100.                     self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2101.  
  2102.     def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  2103.  
  2104.         self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  2105.         self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  2106.  
  2107.         skillLevelUpPoint = 1
  2108.         realSkillGrade = player.GetSkillGrade(slotIndex)
  2109.         skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  2110.         skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  2111.  
  2112.         ## Current Level
  2113.         if skillLevel > 0:
  2114.             if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2115.                 self.AppendSpace(5)
  2116.                 if skillGrade == skill.SKILL_GRADE_COUNT:
  2117.                     pass
  2118.                 elif skillLevel == skillMaxLevelEnd:
  2119.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2120.                 else:
  2121.                     self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2122.                 self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  2123.  
  2124.         ## Next Level
  2125.         if skillGrade != skill.SKILL_GRADE_COUNT:
  2126.             if skillLevel < skillMaxLevelEnd:
  2127.                 if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  2128.                     self.AppendSpace(5)
  2129.                     ## HP보강, 관통회피 보조스킬의 경우
  2130.                     if skillIndex == 141 or skillIndex == 142:
  2131.                         self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  2132.                     else:
  2133.                         self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  2134.                     self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  2135.  
  2136.     def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  2137.  
  2138.         affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  2139.         if affectDataCount > 0:
  2140.             for i in xrange(affectDataCount):
  2141.                 type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  2142.  
  2143.                 if not self.AFFECT_NAME_DICT.has_key(type):
  2144.                     continue
  2145.  
  2146.                 minValue = int(minValue)
  2147.                 maxValue = int(maxValue)
  2148.                 affectText = self.AFFECT_NAME_DICT[type]
  2149.  
  2150.                 if "HP" == type:
  2151.                     if minValue < 0 and maxValue < 0:
  2152.                         minValue *= -1
  2153.                         maxValue *= -1
  2154.  
  2155.                     else:
  2156.                         affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  2157.  
  2158.                 affectText += str(minValue)
  2159.                 if minValue != maxValue:
  2160.                     affectText += " - " + str(maxValue)
  2161.                 affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  2162.  
  2163.                 #import debugInfo
  2164.                 #if debugInfo.IsDebugMode():
  2165.                 #   affectText = "!!" + affectText
  2166.  
  2167.                 self.AppendTextLine(affectText, color)
  2168.            
  2169.         else:
  2170.             for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2171.                 self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  2172.        
  2173.  
  2174.         ## Duration
  2175.         duration = skill.GetDuration(skillIndex, skillPercentage)
  2176.         if duration > 0:
  2177.             self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  2178.  
  2179.         ## Cooltime
  2180.         coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  2181.         if coolTime > 0:
  2182.             self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  2183.  
  2184.         ## SP
  2185.         needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  2186.         if needSP != 0:
  2187.             continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  2188.  
  2189.             if skill.IsUseHPSkill(skillIndex):
  2190.                 self.AppendNeedHP(needSP, continuationSP, color)
  2191.             else:
  2192.                 self.AppendNeedSP(needSP, continuationSP, color)
  2193.  
  2194.     def AppendSkillRequirement(self, skillIndex, skillLevel):
  2195.  
  2196.         skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  2197.  
  2198.         if skillLevel >= skillMaxLevel:
  2199.             return
  2200.  
  2201.         isAppendHorizontalLine = False
  2202.  
  2203.         ## Requirement
  2204.         if skill.IsSkillRequirement(skillIndex):
  2205.  
  2206.             if not isAppendHorizontalLine:
  2207.                 isAppendHorizontalLine = True
  2208.                 self.AppendHorizontalLine()
  2209.  
  2210.             requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  2211.  
  2212.             color = self.CANNOT_LEVEL_UP_COLOR
  2213.             if skill.CheckRequirementSueccess(skillIndex):
  2214.                 color = self.CAN_LEVEL_UP_COLOR
  2215.             self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  2216.  
  2217.         ## Require Stat
  2218.         requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  2219.         if requireStatCount > 0:
  2220.  
  2221.             for i in xrange(requireStatCount):
  2222.                 type, level = skill.GetSkillRequireStatData(skillIndex, i)
  2223.                 if self.POINT_NAME_DICT.has_key(type):
  2224.  
  2225.                     if not isAppendHorizontalLine:
  2226.                         isAppendHorizontalLine = True
  2227.                         self.AppendHorizontalLine()
  2228.  
  2229.                     name = self.POINT_NAME_DICT[type]
  2230.                     color = self.CANNOT_LEVEL_UP_COLOR
  2231.                     if player.GetStatus(type) >= level:
  2232.                         color = self.CAN_LEVEL_UP_COLOR
  2233.                     self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  2234.  
  2235.     def HasSkillLevelDescription(self, skillIndex, skillLevel):
  2236.         if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  2237.             return True
  2238.         if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  2239.             return True
  2240.         if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  2241.             return True
  2242.  
  2243.         return False
  2244.  
  2245.     def AppendMasterAffectDescription(self, index, desc, color):
  2246.         self.AppendTextLine(desc, color)
  2247.  
  2248.     def AppendNextAffectDescription(self, index, desc):
  2249.         self.AppendTextLine(desc, self.DISABLE_COLOR)
  2250.  
  2251.     def AppendNeedHP(self, needSP, continuationSP, color):
  2252.  
  2253.         self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  2254.  
  2255.         if continuationSP > 0:
  2256.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  2257.  
  2258.     def AppendNeedSP(self, needSP, continuationSP, color):
  2259.  
  2260.         if -1 == needSP:
  2261.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  2262.  
  2263.         else:
  2264.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  2265.  
  2266.         if continuationSP > 0:
  2267.             self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  2268.  
  2269.     def AppendPartySkillData(self, skillGrade, skillLevel):
  2270.  
  2271.         if 1 == skillGrade:
  2272.             skillLevel += 19
  2273.         elif 2 == skillGrade:
  2274.             skillLevel += 29
  2275.         elif 3 == skillGrade:
  2276.             skillLevel =  40
  2277.  
  2278.         if skillLevel <= 0:
  2279.             return
  2280.  
  2281.         skillIndex = player.SKILL_INDEX_TONGSOL
  2282.         slotIndex = player.GetSkillSlotIndex(skillIndex)
  2283.         skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2284.         if localeInfo.IsBRAZIL():
  2285.             k = skillPower
  2286.         else:
  2287.             k = player.GetSkillLevel(skillIndex) / 100.0
  2288.         self.AppendSpace(5)
  2289.         self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  2290.  
  2291.         if skillLevel>=10:
  2292.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  2293.  
  2294.         if skillLevel>=20:
  2295.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER    % chop(1 + 5 * k))
  2296.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER   % chop(50 + 1450 * k))
  2297.  
  2298.         if skillLevel>=25:
  2299.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  2300.  
  2301.         if skillLevel>=35:
  2302.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  2303.  
  2304.         if skillLevel>=40:
  2305.             self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  2306.  
  2307.         self.AlignHorizonalCenter()
  2308.  
  2309.     def __AppendSummonDescription(self, skillLevel, color):
  2310.         if skillLevel > 1:
  2311.             self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  2312.         elif 1 == skillLevel:
  2313.             self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  2314.         elif 0 == skillLevel:
  2315.             self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  2316.  
  2317.  
  2318. if __name__ == "__main__": 
  2319.     import app
  2320.     import wndMgr
  2321.     import systemSetting
  2322.     import mouseModule
  2323.     import grp
  2324.     import ui
  2325.    
  2326.     #wndMgr.SetOutlineFlag(True)
  2327.  
  2328.     app.SetMouseHandler(mouseModule.mouseController)
  2329.     app.SetHairColorEnable(True)
  2330.     wndMgr.SetMouseHandler(mouseModule.mouseController)
  2331.     wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2332.     app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2333.     mouseModule.mouseController.Create()
  2334.  
  2335.     toolTip = ItemToolTip()
  2336.     toolTip.ClearToolTip()
  2337.     #toolTip.AppendTextLine("Test")
  2338.     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."
  2339.     summ = ""
  2340.  
  2341.     toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  2342.     toolTip.Show()
  2343.    
  2344.     app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement