Advertisement
Guest User

Untitled

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