juncanalex

Untitled

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