Advertisement
Guest User

Untitled

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