1. #########################################
  2. # title_name : System Pack #
  3. # filename : root #
  4. # author : Bvural41 #
  5. # version : Version 0.0.2 #
  6. # date : 2015 04 11 #
  7. # update : 2019 02 05 #
  8. #########################################
  9. import dbg
  10. import player
  11. import item
  12. import grp
  13. import wndMgr
  14. import skill
  15. import shop
  16. import exchange
  17. import grpText
  18. import safebox
  19. import localeInfo
  20. import app
  21. import background
  22. import nonplayer
  23. import chr
  24. import privateShopSearch
  25. import ui
  26. import mouseModule
  27. import constInfo
  28. import chat
  29. import translate
  30. if app.ENABLE_SASH_SYSTEM:
  31. import sash
  32. if app.ENABLE_CHANGELOOK_SYSTEM:
  33. import changelook
  34. if app.ENABLE_AURA_SYSTEM:
  35. import aura
  36. if app.ENABLE_RENDER_TARGET_SYSTEM:
  37. import renderTarget
  38. WARP_SCROLLS = [22011, 22000, 22010]
  39. EXTRA_SLOT = [0,1,2,4,6,9,12,16]
  40. DESC_DEFAULT_MAX_COLS = 26
  41. DESC_WESTERN_MAX_COLS = 35
  42. DESC_WESTERN_MAX_WIDTH = 220
  43. def chop(n):
  44. return round(n - 0.5, 1)
  45. def pointop(n):
  46. t = int(n)
  47. if t / 10 < 1:
  48. return "0."+n
  49. else:
  50. return n[0:len(n)-1]+"."+n[len(n)-1:]
  51. def SplitDescription(desc, limit):
  52. total_tokens = desc.split()
  53. line_tokens = []
  54. line_len = 0
  55. lines = []
  56. for token in total_tokens:
  57. if "|" in token:
  58. sep_pos = token.find("|")
  59. line_tokens.append(token[:sep_pos])
  60. lines.append(" ".join(line_tokens))
  61. line_len = len(token) - (sep_pos + 1)
  62. line_tokens = [token[sep_pos+1:]]
  63. else:
  64. line_len += len(token)
  65. if len(line_tokens) + line_len > limit:
  66. lines.append(" ".join(line_tokens))
  67. line_len = len(token)
  68. line_tokens = [token]
  69. else:
  70. line_tokens.append(token)
  71. if line_tokens:
  72. lines.append(" ".join(line_tokens))
  73. return lines
  74. class ToolTip(ui.ThinBoard):
  75. TOOL_TIP_WIDTH = 190
  76. TOOL_TIP_HEIGHT = 10
  77. TEXT_LINE_HEIGHT = 17
  78. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  79. SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)
  80. NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  81. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  82. PRICE_COLOR = 0xffFFB96D
  83. HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR
  84. MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0)
  85. LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0)
  86. ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  87. DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  88. NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  89. POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)
  90. SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)
  91. SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0)
  92. PRICE_INFO_COLOR = grp.GenerateColor(1.0, 0.88, 0.0, 1.0)
  93. ITEM_BUFF_LEVEL_COLOR = 0xffffd300
  94. ITEM_BUFF_TYPE_COLOR = 0xfffc9c3a
  95. ITEM_BUFF_RATE_COLOR = 0xff40e0d0
  96. ITEM_BUFF_DURATION_COLOR = 0xffadff00
  97. ITEM_BUFF_USAGE_COLOR = 0xffffffff
  98. SHOP_ITEM_COLOR = 0xfffff64e
  99. CONDITION_COLOR = 0xffBEB47D
  100. UNDER_LOOK_COLOR = 0xfffff64e
  101. BEFORE_LOOK_COLOR = 0xff9A9CDB
  102. CAN_LEVEL_UP_COLOR = 0xff8EC292
  103. CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
  104. NEED_SKILL_POINT_COLOR = 0xff9A9CDB
  105. SINIRSIZ_COLOR = 0xffFFFF00
  106. SILAH_EVRIM_VALUE = {
  107. 0 : '',
  108. 1 : ' |cff00ff00|HVectors:|h(+120)|h|r',
  109. 2 : ' |cff00ff00|HVectors:|h(+240)|h|r',
  110. 3 : ' |cff00ff00|HVectors:|h(+360)|h|r',
  111. 4 : ' |cff00ff00|HVectors:|h(+480)|h|r',
  112. 5 : ' |cff00ff00|HVectors:|h(+600)|h|r',
  113. }
  114. SILAH_EVRIM_TITLE = {
  115. 0 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_0,
  116. 1 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_1,
  117. 2 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_2,
  118. 3 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_3,
  119. 4 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_4,
  120. 5 : localeInfo.SILAH_EVRIM_SISTEMI_TITLE_5
  121. }
  122. itemEvolution = 0
  123. def __init__(self, width = TOOL_TIP_WIDTH, isPickable=FALSE):
  124. ui.ThinBoard.__init__(self, "TOP_MOST")
  125. if isPickable:
  126. pass
  127. else:
  128. self.AddFlag("not_pick")
  129. self.AddFlag("float")
  130. self.OnlyDownTooltip = 0
  131. self.followFlag = TRUE
  132. self.toolTipWidth = width
  133. if app.ENABLE_ATTENDANCE_EVENT:
  134. self.isAttendanceRewardItem = False
  135. self.xPos = -1
  136. self.yPos = -1
  137. self.defFontName = localeInfo.UI_DEF_FONT
  138. self.ClearToolTip()
  139. def __del__(self):
  140. ui.ThinBoard.__del__(self)
  141. def ClearToolTip(self):
  142. self.toolTipHeight = 12
  143. self.childrenList = []
  144. def SetFollow(self, flag):
  145. self.followFlag = flag
  146. def SetDefaultFontName(self, fontName):
  147. self.defFontName = fontName
  148. def AppendSpace(self, size):
  149. self.toolTipHeight += size
  150. self.ResizeToolTip()
  151. def AppendHorizontalLine(self):
  152. for i in xrange(2):
  153. horizontalLine = ui.Line()
  154. horizontalLine.SetParent(self)
  155. horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i)
  156. horizontalLine.SetWindowHorizontalAlignCenter()
  157. horizontalLine.SetSize(150, 0)
  158. horizontalLine.Show()
  159. if 0 == i:
  160. horizontalLine.SetColor(0xff555555)
  161. else:
  162. horizontalLine.SetColor(0xff000000)
  163. self.childrenList.append(horizontalLine)
  164. self.toolTipHeight += 11
  165. self.ResizeToolTip()
  166. def AlignHorizonalCenter(self):
  167. for child in self.childrenList:
  168. (x, y)=child.GetLocalPosition()
  169. child.SetPosition(self.toolTipWidth/2, y)
  170. self.ResizeToolTip()
  171. def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  172. textLine = ui.TextLine()
  173. textLine.SetParent(self)
  174. textLine.SetFontName(self.defFontName)
  175. textLine.SetPackedFontColor(color)
  176. textLine.SetText(text)
  177. textLine.SetOutline()
  178. textLine.SetFeather(FALSE)
  179. textLine.Show()
  180. if centerAlign:
  181. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  182. textLine.SetHorizontalAlignCenter()
  183. else:
  184. textLine.SetPosition(10, self.toolTipHeight)
  185. self.childrenList.append(textLine)
  186. (textWidth, textHeight)=textLine.GetTextSize()
  187. textWidth += 40
  188. textHeight += 5
  189. if self.toolTipWidth < textWidth:
  190. self.toolTipWidth = textWidth
  191. self.toolTipHeight += textHeight
  192. return textLine
  193. def AutoAppendNewTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  194. textLine = ui.TextLine()
  195. textLine.SetParent(self)
  196. textLine.SetFontName(self.defFontName)
  197. textLine.SetPackedFontColor(color)
  198. textLine.SetText(text)
  199. textLine.SetOutline()
  200. textLine.SetFeather(FALSE)
  201. textLine.Show()
  202. textLine.SetPosition(15, self.toolTipHeight)
  203. self.childrenList.append(textLine)
  204. (textWidth, textHeight) = textLine.GetTextSize()
  205. textWidth += 30
  206. textHeight += 10
  207. if self.toolTipWidth < textWidth:
  208. self.toolTipWidth = textWidth
  209. self.toolTipHeight += textHeight
  210. self.ResizeToolTipText(textWidth, self.toolTipHeight)
  211. return textLine
  212. def SetThinBoardSize(self, width, height = 12) :
  213. self.toolTipWidth = width
  214. self.toolTipHeight = height
  215. def AppendTextLineNew(self, text, color = FONT_COLOR, centerAlign = True):
  216. textLine = ui.TextLine()
  217. textLine.SetParent(self)
  218. textLine.SetFontName(self.defFontName)
  219. textLine.SetPackedFontColor(color)
  220. textLine.SetText(text)
  221. textLine.SetOutline()
  222. textLine.SetFeather(FALSE)
  223. textLine.Show()
  224. if centerAlign:
  225. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  226. textLine.SetHorizontalAlignCenter()
  227. else:
  228. textLine.SetPosition(10, self.toolTipHeight)
  229. self.childrenList.append(textLine)
  230. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  231. self.ResizeToolTip()
  232. return textLine
  233. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  234. textLine = ui.TextLine()
  235. textLine.SetParent(self)
  236. textLine.SetFontName(self.defFontName)
  237. textLine.SetPackedFontColor(color)
  238. textLine.SetText(text)
  239. textLine.SetOutline()
  240. textLine.SetFeather(FALSE)
  241. textLine.Show()
  242. if centerAlign:
  243. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  244. textLine.SetHorizontalAlignCenter()
  245. else:
  246. textLine.SetPosition(10, self.toolTipHeight)
  247. self.childrenList.append(textLine)
  248. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  249. self.ResizeToolTip()
  250. return textLine
  251. def AppendDescription(self, desc, limit, color = FONT_COLOR):
  252. if localeInfo.IsEUROPE():
  253. self.__AppendDescription_WesternLanguage(desc, color)
  254. else:
  255. self.__AppendDescription_EasternLanguage(desc, limit, color)
  256. def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR):
  257. length = len(description)
  258. if 0 == length:
  259. return
  260. lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation)
  261. for i in xrange(lineCount):
  262. if 0 == i:
  263. self.AppendSpace(5)
  264. self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color)
  265. def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR):
  266. lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS)
  267. if not lines:
  268. return
  269. self.AppendSpace(5)
  270. for line in lines:
  271. self.AppendTextLine(line, color)
  272. def ResizeToolTip(self):
  273. self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight)
  274. def ResizeToolTipText(self, x, y):
  275. self.SetSize(x, y)
  276. def SetTitle(self, name):
  277. self.AppendTextLine(name, self.TITLE_COLOR)
  278. def GetLimitTextLineColor(self, curValue, limitValue):
  279. if curValue < limitValue:
  280. return self.DISABLE_COLOR
  281. return self.ENABLE_COLOR
  282. def GetChangeTextLineColor(self, value, isSpecial=FALSE):
  283. if value > 0:
  284. if isSpecial:
  285. return self.SPECIAL_POSITIVE_COLOR
  286. else:
  287. return self.POSITIVE_COLOR
  288. if 0 == value:
  289. return self.NORMAL_COLOR
  290. return self.NEGATIVE_COLOR
  291. def SetToolTipPosition(self, x = -1, y = -1):
  292. self.xPos = x
  293. self.yPos = y
  294. def ShowToolTip(self):
  295. self.SetTop()
  296. self.Show()
  297. self.OnUpdate()
  298. def HideToolTip(self):
  299. self.Hide()
  300. def OnlyDown(self):
  301. self.OnlyDownTooltip = 1
  302. def OnUpdate(self):
  303. if not self.followFlag:
  304. return
  305. x = 0
  306. y = 0
  307. width = self.GetWidth()
  308. height = self.toolTipHeight
  309. if -1 == self.xPos and -1 == self.yPos:
  310. (mouseX, mouseY) = wndMgr.GetMousePosition()
  311. if not self.OnlyDownTooltip:
  312. if mouseY < wndMgr.GetScreenHeight() - 300:
  313. y = mouseY + 40
  314. else:
  315. y = mouseY - height - 30
  316. else:
  317. y = mouseY + 40
  318. x = mouseX - width/2
  319. else:
  320. x = self.xPos - width/2
  321. y = self.yPos - height
  322. x = max(x, 0)
  323. y = max(y, 0)
  324. x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2
  325. y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight()
  326. parentWindow = self.GetParentProxy()
  327. if parentWindow:
  328. (gx, gy) = parentWindow.GetGlobalPosition()
  329. x -= gx
  330. y -= gy
  331. self.SetPosition(x, y)
  332. class ItemToolTip(ToolTip):
  333. if app.ENABLE_SEND_TARGET_INFO:
  334. isStone = False
  335. isBook = False
  336. isBook2 = False
  337. if app.ENABLE_RENDER_TARGET_SYSTEM:
  338. MountVnum = {
  339. 52001:20201,
  340. 52002:20201,
  341. 52003:20201,
  342. 52004:20201,
  343. 52005:20201,
  344. 52006:20205,
  345. 52007:20205,
  346. 52008:20205,
  347. 52009:20205,
  348. 52010:20205,
  349. 52011:20209,
  350. 52012:20209,
  351. 52013:20209,
  352. 52014:20209,
  353. 52015:20209,
  354. 52016:20202,
  355. 52017:20202,
  356. 52018:20202,
  357. 52019:20202,
  358. 52020:20202,
  359. 52021:20206,
  360. 52022:20206,
  361. 52023:20206,
  362. 52024:20206,
  363. 52025:20206,
  364. 52026:20210,
  365. 52027:20210,
  366. 52028:20210,
  367. 52029:20210,
  368. 52030:20210,
  369. 52031:20204,
  370. 52032:20204,
  371. 52033:20204,
  372. 52034:20204,
  373. 52035:20204,
  374. 52036:20208,
  375. 52037:20208,
  376. 52038:20208,
  377. 52039:20208,
  378. 52040:20208,
  379. 52041:20212,
  380. 52042:20212,
  381. 52043:20212,
  382. 52044:20212,
  383. 52045:20212,
  384. 52046:20203,
  385. 52047:20203,
  386. 52048:20203,
  387. 52049:20203,
  388. 52050:20203,
  389. 52051:20207,
  390. 52052:20207,
  391. 52053:20207,
  392. 52054:20207,
  393. 52055:20207,
  394. 52056:20211,
  395. 52057:20211,
  396. 52058:20211,
  397. 52059:20211,
  398. 52060:20211,
  399. 52061:20213,
  400. 52062:20213,
  401. 52063:20213,
  402. 52064:20213,
  403. 52065:20213,
  404. 52066:20214,
  405. 52067:20214,
  406. 52068:20214,
  407. 52069:20214,
  408. 52070:20214,
  409. 52071:20215,
  410. 52072:20215,
  411. 52073:20215,
  412. 52074:20215,
  413. 52075:20215,
  414. 52076:20216,
  415. 52077:20216,
  416. 52078:20216,
  417. 52079:20216,
  418. 52080:20216,
  419. 52081:20217,
  420. 52082:20217,
  421. 52083:20217,
  422. 52084:20217,
  423. 52085:20217,
  424. 52086:20218,
  425. 52087:20218,
  426. 52088:20218,
  427. 52089:20218,
  428. 52090:20218,
  429. 52091:20223,
  430. 52092:20223,
  431. 52093:20223,
  432. 52094:20223,
  433. 52095:20223,
  434. 52096:20224,
  435. 52097:20224,
  436. 52098:20224,
  437. 52099:20224,
  438. 52100:20224,
  439. 52101:20225,
  440. 52102:20225,
  441. 52103:20225,
  442. 52104:20225,
  443. 52105:20225,
  444. 52107:20228,
  445. 52106:20228,
  446. 52108:20228,
  447. 52109:20228,
  448. 52110:20228,
  449. 52111:20229,
  450. 52112:20229,
  451. 52113:20229,
  452. 52114:20229,
  453. 52115:20229,
  454. 52116:20230,
  455. 52117:20230,
  456. 52118:20230,
  457. 52119:20230,
  458. 52120:20230,
  459. 71114:20110,
  460. 71116:20111,
  461. 71118:20112,
  462. 71120:20113,
  463. 71115:20110,
  464. 71117:20111,
  465. 71119:20112,
  466. 71121:20113,
  467. 71124:20114,
  468. 71125:20115,
  469. 71126:20116,
  470. 71127:20117,
  471. 71128:20118,
  472. 71131:20119,
  473. 71132:20119,
  474. 71133:20119,
  475. 71134:20119,
  476. 71137:20120,
  477. 71138:20121,
  478. 71139:20122,
  479. 71140:20123,
  480. 71141:20124,
  481. 71142:20125,
  482. 71161:20219,
  483. 71164:20220,
  484. 71165:20221,
  485. 71166:20222,
  486. 71171:20227,
  487. 71172:20226,
  488. 71176:20231,
  489. 71177:20232,
  490. 71182:20233,
  491. 71183:20234,
  492. 71184:20235,
  493. 71185:20236,
  494. 71186:20237,
  495. 71187:20238,
  496. 71192:20240,
  497. 71193:20239,
  498. 71197:20241,
  499. 71198:20242,
  500. 71220:20243
  501. }
  502. PetVnum = {
  503. 53001:34001,
  504. 53002:34002,
  505. 53003:34003,
  506. 53005:34004,
  507. 53006:34009,
  508. 53007:34010,
  509. 53008:34011,
  510. 53009:34012,
  511. 53010:34008,
  512. 53011:34007,
  513. 53012:34005,
  514. 53013:34006,
  515. 53014:34013,
  516. 53015:34014,
  517. 53016:34015,
  518. 53017:34016,
  519. 53018:34020,
  520. 53019:34019,
  521. 53020:34017,
  522. 53021:34018,
  523. 53022:34021,
  524. 53023:34022,
  525. 53024:34023,
  526. 53025:34024,
  527. 53218:34023,
  528. 53219:34023,
  529. 53220:34024,
  530. 53221:34024,
  531. 53222:34026,
  532. 53223:34027,
  533. 53224:34028,
  534. 53225:34029,
  535. 53226:34030,
  536. 53227:34031,
  537. 53228:34033,
  538. 53229:34032,
  539. 53230:34034,
  540. 53231:34035,
  541. 53232:34039,
  542. 53233:34055,
  543. 53234:34056,
  544. 53235:34057,
  545. 53236:34060,
  546. 53237:34061,
  547. 53238:34058,
  548. 53239:34059,
  549. 53240:34063,
  550. 53241:34062,
  551. 53256:34066,
  552. 53242:34066,
  553. 53243:34066,
  554. 53244:34067,
  555. 53245:34068,
  556. 53246:34069,
  557. 53247:34070,
  558. 53248:34071,
  559. 53249:34072,
  560. 53250:34084,
  561. 53251:34085,
  562. 38200:34006,
  563. 38201:34006,
  564. }
  565. ModelPreviewBoard = None
  566. ModelPreview = None
  567. ModelPreviewText = None
  568. CHARACTER_NAMES = (
  569. localeInfo.TOOLTIP_WARRIOR,
  570. localeInfo.TOOLTIP_ASSASSIN,
  571. localeInfo.TOOLTIP_SURA,
  572. localeInfo.TOOLTIP_SHAMAN,
  573. localeInfo.TOOLTIP_WOLFMAN
  574. )
  575. CHARACTER_COUNT = len(CHARACTER_NAMES)
  576. WEAR_NAMES = (
  577. localeInfo.TOOLTIP_ARMOR,
  578. localeInfo.TOOLTIP_HELMET,
  579. localeInfo.TOOLTIP_SHOES,
  580. localeInfo.TOOLTIP_WRISTLET,
  581. localeInfo.TOOLTIP_WEAPON,
  582. localeInfo.TOOLTIP_NECK,
  583. localeInfo.TOOLTIP_EAR,
  584. localeInfo.TOOLTIP_UNIQUE,
  585. localeInfo.TOOLTIP_SHIELD,
  586. localeInfo.TOOLTIP_ARROW,
  587. )
  588. WEAR_COUNT = len(WEAR_NAMES)
  589. AFFECT_DICT = {
  590. item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP,
  591. item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP,
  592. item.APPLY_CON : localeInfo.TOOLTIP_CON,
  593. item.APPLY_INT : localeInfo.TOOLTIP_INT,
  594. item.APPLY_STR : localeInfo.TOOLTIP_STR,
  595. item.APPLY_DEX : localeInfo.TOOLTIP_DEX,
  596. item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED,
  597. item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED,
  598. item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED,
  599. item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN,
  600. item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN,
  601. item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT,
  602. item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT,
  603. item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT,
  604. item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,
  605. item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT,
  606. item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  607. item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  608. item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA,
  609. item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  610. item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  611. item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  612. item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL,
  613. item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC,
  614. item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO,
  615. item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  616. item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  617. item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP,
  618. item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP,
  619. item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT,
  620. item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER,
  621. item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK,
  622. item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE,
  623. item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD,
  624. item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND,
  625. item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER,
  626. item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL,
  627. item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN,
  628. item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW,
  629. item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE,
  630. item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC,
  631. item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC,
  632. item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND,
  633. item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE,
  634. item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE,
  635. item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE,
  636. item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER,
  637. item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS,
  638. item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS,
  639. item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS,
  640. item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS,
  641. item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER,
  642. item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN,
  643. item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW,
  644. item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL,
  645. item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE,
  646. item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE,
  647. item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE,
  648. item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE,
  649. item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE,
  650. item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA,
  651. item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS,
  652. item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS,
  653. item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS,
  654. item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS,
  655. item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS,
  656. item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS,
  657. item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS,
  658. item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS,
  659. item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS,
  660. item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC,
  661. item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC,
  662. item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR,
  663. item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN,
  664. item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA,
  665. item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN,
  666. item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT,
  667. item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT,
  668. item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY,
  669. item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS,
  670. item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER,
  671. item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER,
  672. item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE,
  673. item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH,
  674. item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK,
  675. item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT,
  676. item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT,
  677. item.APPLY_BLEEDING_PCT : localeInfo.TOOLTIP_APPLY_BLEEDING_PCT,
  678. item.APPLY_BLEEDING_REDUCE : localeInfo.TOOLTIP_APPLY_BLEEDING_REDUCE,
  679. item.APPLY_ATTBONUS_WOLFMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_WOLFMAN,
  680. item.APPLY_RESIST_WOLFMAN : localeInfo.TOOLTIP_APPLY_RESIST_WOLFMAN,
  681. item.APPLY_RESIST_CLAW : localeInfo.TOOLTIP_APPLY_RESIST_CLAW,
  682. }
  683. if app.ELEMENT_NEW_BONUSES:
  684. AFFECT_DICT[item.APPLY_ENCHANT_DARK] = localeInfo.TOOLTIP_APPLY_ENCHANT_DARK
  685. AFFECT_DICT[item.APPLY_ENCHANT_EARTH] = localeInfo.TOOLTIP_APPLY_ENCHANT_EARTH
  686. AFFECT_DICT[item.APPLY_ENCHANT_ELECT] = localeInfo.TOOLTIP_APPLY_ENCHANT_ELECT
  687. AFFECT_DICT[item.APPLY_ENCHANT_FIRE] = localeInfo.TOOLTIP_APPLY_ENCHANT_FIRE
  688. AFFECT_DICT[item.APPLY_ENCHANT_ICE] = localeInfo.TOOLTIP_APPLY_ENCHANT_ICE
  689. AFFECT_DICT[item.APPLY_ENCHANT_WIND] = localeInfo.TOOLTIP_APPLY_ENCHANT_WIND
  690. if app.ENABLE_ANTI_RESIST_MAGIC_BONUS_SYSTEM:
  691. AFFECT_DICT.update({
  692. item.APPLY_ANTI_RESIST_MAGIC : localeInfo.APPLY_ANTI_RESIST_MAGIC,
  693. })
  694. if app.ENABLE_PENDANT:
  695. AFFECT_DICT[item.APPLY_ATTBONUS_SWORD] = localeInfo.TOOLTIP_APPLY_ATTBONUS_SWORD
  696. AFFECT_DICT[item.APPLY_ATTBONUS_TWOHAND]= localeInfo.TOOLTIP_APPLY_ATTBONUS_TWOHAND
  697. AFFECT_DICT[item.APPLY_ATTBONUS_DAGGER] = localeInfo.TOOLTIP_APPLY_ATTBONUS_DAGGER
  698. AFFECT_DICT[item.APPLY_ATTBONUS_BELL] = localeInfo.TOOLTIP_APPLY_ATTBONUS_BELL
  699. AFFECT_DICT[item.APPLY_ATTBONUS_FAN] = localeInfo.TOOLTIP_APPLY_ATTBONUS_FAN
  700. AFFECT_DICT[item.APPLY_ATTBONUS_BOW] = localeInfo.TOOLTIP_APPLY_ATTBONUS_BOW
  701. AFFECT_DICT[item.APPLY_ATTBONUS_CLAW] = localeInfo.TOOLTIP_APPLY_ATTBONUS_CLAW
  702. AFFECT_DICT[item.APPLY_RESIST_HUMAN] = localeInfo.TOOLTIP_APPLY_RESIST_HUMAN
  703. AFFECT_DICT[item.APPLY_ATTBONUS_BOCEK] = localeInfo.TOOLTIP_APPLY_ATTBONUS_BOCEK
  704. AFFECT_DICT[item.APPLY_ATTBONUS_COL] = localeInfo.TOOLTIP_APPLY_ATTBONUS_COL
  705. AFFECT_DICT[item.APPLY_ATTBONUS_CZ] = localeInfo.TOOLTIP_APPLY_ATTBONUS_CZ
  706. AFFECT_DICT[item.APPLY_RESIST_DUSUS] = localeInfo.TOOLTIP_APPLY_RESIST_DUSUS
  707. AFFECT_DICT[item.APPLY_ATTBONUS_HIDRA] = localeInfo.TOOLTIP_APPLY_ATTBONUS_HIDRA
  708. AFFECT_DICT[item.APPLY_ATTBONUS_METIN] = localeInfo.TOOLTIP_APPLY_ATTBONUS_METIN
  709. ATTRIBUTE_NEED_WIDTH = {
  710. 23 : 230,
  711. 24 : 230,
  712. 25 : 230,
  713. 26 : 220,
  714. 27 : 210,
  715. 35 : 210,
  716. 36 : 210,
  717. 37 : 210,
  718. 38 : 210,
  719. 39 : 210,
  720. 40 : 210,
  721. 41 : 210,
  722. 42 : 220,
  723. 43 : 230,
  724. 45 : 230,
  725. }
  726. ANTI_FLAG_DICT = {
  727. 0 : item.ITEM_ANTIFLAG_WARRIOR,
  728. 1 : item.ITEM_ANTIFLAG_ASSASSIN,
  729. 2 : item.ITEM_ANTIFLAG_SURA,
  730. 3 : item.ITEM_ANTIFLAG_SHAMAN,
  731. 4 : item.ITEM_ANTIFLAG_WOLFMAN,
  732. }
  733. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  734. def __init__(self, *args, **kwargs):
  735. ToolTip.__init__(self, *args, **kwargs)
  736. self.itemVnum = 0
  737. self.isShopItem = FALSE
  738. self.isOfflineShopItem = FALSE
  739. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  740. self.isPrivateSearchItem = False
  741. self.bCannotUseItemForceSetDisableColor = TRUE
  742. def __del__(self):
  743. ToolTip.__del__(self)
  744. if app.ENABLE_RENDER_TARGET_SYSTEM:
  745. def CanViewRendering(self):
  746. race = player.GetRace()
  747. job = chr.RaceToJob(race)
  748. if not self.ANTI_FLAG_DICT.has_key(job):
  749. return False
  750. if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  751. return False
  752. sex = chr.RaceToSex(race)
  753. MALE = 1
  754. FEMALE = 0
  755. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  756. return False
  757. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  758. return False
  759. return True
  760. def CanViewRenderingSex(self):
  761. race = player.GetRace()
  762. sex = chr.RaceToSex(race)
  763. MALE = 1
  764. FEMALE = 0
  765. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  766. return False
  767. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  768. return False
  769. return True
  770. def SetCannotUseItemForceSetDisableColor(self, enable):
  771. self.bCannotUseItemForceSetDisableColor = enable
  772. def CanEquip(self):
  773. if not item.IsEquipmentVID(self.itemVnum):
  774. return TRUE
  775. race = player.GetRace()
  776. job = chr.RaceToJob(race)
  777. if not self.ANTI_FLAG_DICT.has_key(job):
  778. return FALSE
  779. if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  780. return FALSE
  781. sex = chr.RaceToSex(race)
  782. MALE = 1
  783. FEMALE = 0
  784. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  785. return FALSE
  786. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  787. return FALSE
  788. for i in xrange(item.LIMIT_MAX_NUM):
  789. (limitType, limitValue) = item.GetLimit(i)
  790. if item.LIMIT_LEVEL == limitType:
  791. if player.GetStatus(player.LEVEL) < limitValue:
  792. return FALSE
  793. return TRUE
  794. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
  795. if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
  796. color = self.DISABLE_COLOR
  797. return ToolTip.AppendTextLine(self, text, color, centerAlign)
  798. def ClearToolTip(self):
  799. self.isShopItem = FALSE
  800. if app.ENABLE_ATTENDANCE_EVENT:
  801. self.isAttendanceRewardItem = False
  802. self.isOfflineShopItem = FALSE
  803. self.toolTipWidth = self.TOOL_TIP_WIDTH
  804. ToolTip.ClearToolTip(self)
  805. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  806. self.isPrivateSearchItem = False
  807. def OnlyDown(self):
  808. ToolTip.OnlyDown(self)
  809. def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY):
  810. itemVnum = player.GetItemIndex(window_type, slotIndex)
  811. if 0 == itemVnum:
  812. return
  813. self.ClearToolTip()
  814. if shop.IsOpen():
  815. if not shop.IsPrivateShop() or not shop.IsOfflineShop():
  816. item.SelectItem(itemVnum)
  817. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex)*5)
  818. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  819. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  820. if app.ENABLE_CHANGELOOK_SYSTEM:
  821. if app.ENABLE_RENDER_TARGET_SYSTEM:
  822. self.AddItemData(itemVnum, metinSlot, attrSlot,player.GetItemEvolution(window_type, slotIndex), 0, player.INVENTORY, slotIndex, 1)
  823. else:
  824. self.AddItemData(itemVnum, metinSlot, attrSlot,player.GetItemEvolution(window_type, slotIndex), 0, player.INVENTORY, slotIndex)
  825. else:
  826. if app.ENABLE_RENDER_TARGET_SYSTEM:
  827. self.AddItemData(itemVnum, metinSlot, attrSlot,player.GetItemEvolution(window_type, slotIndex), 1)
  828. else:
  829. self.AddItemData(itemVnum, metinSlot, attrSlot,player.GetItemEvolution(window_type, slotIndex))
  830. # self.AddItemData(itemVnum, metinSlot, attrSlot, 0, player.INVENTORY, slotIndex)
  831. # else:
  832. # self.AddItemData(itemVnum, metinSlot, attrSlot)
  833. self.__AppendSealInformation(player.INVENTORY, slotIndex)
  834. def SetOfflineShopBuilderItem(self, invenType, invenPos, offlineShopIndex):
  835. itemVnum = player.GetItemIndex(invenType, invenPos)
  836. if (itemVnum == 0):
  837. return
  838. self.ClearToolTip()
  839. item.SelectItem(itemVnum)
  840. #self.AppendSellingPrice(shop.GetOfflineShopItemPrice2(invenType, invenPos))
  841. metinSlot = []
  842. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  843. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  844. attrSlot = []
  845. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  846. attrSlot.append(player.GetItemAttribute(invenPos, i))
  847. if app.ENABLE_CHANGELOOK_SYSTEM:
  848. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, invenType, invenPos)
  849. else:
  850. self.AddItemData(itemVnum, metinSlot, attrSlot, 0)
  851. price = shop.GetOfflineShopItemPrice2(invenType, invenPos)
  852. if app.ENABLE_CHEQUE_SYSTEM:
  853. price_cheque = shop.GetOfflineShopItemPriceCheque2(invenType, invenPos)
  854. price_yang = shop.GetOfflineShopItemPrice2(invenType, invenPos)
  855. self.AppendSpace(5)
  856. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  857. if price_cheque > 0:
  858. self.AppendSpace(5)
  859. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  860. if price_yang > 0:
  861. self.AppendSpace(5)
  862. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  863. else:
  864. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  865. def SetOfflineShopItem(self, slotIndex, addprice = 0, waltype = 0):
  866. itemVnum = shop.GetOfflineShopItemID(slotIndex)
  867. if (itemVnum == 0):
  868. return
  869. price = shop.GetOfflineShopItemPrice(slotIndex)
  870. if app.ENABLE_CHEQUE_SYSTEM:
  871. price_cheque = shop.GetOfflineShopItemPriceCheque(slotIndex)
  872. price_yang = shop.GetOfflineShopItemPrice(slotIndex)
  873. self.ClearToolTip()
  874. self.isOfflineShopItem = TRUE
  875. metinSlot = []
  876. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  877. metinSlot.append(shop.GetOfflineShopItemMetinSocket(slotIndex, i))
  878. attrSlot = []
  879. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  880. attrSlot.append(shop.GetOfflineShopItemAttribute(slotIndex, i))
  881. if app.ENABLE_CHANGELOOK_SYSTEM:
  882. transmutation = shop.GetOfflineShopItemTransmutation(slotIndex)
  883. if not transmutation:
  884. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetOfflineShoItemEvolution(slotIndex))
  885. else:
  886. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetOfflineShoItemEvolution(slotIndex), 0, player.INVENTORY, -1, transmutation)
  887. else:
  888. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetOfflineShoItemEvolution(slotIndex))
  889. if waltype == 0:
  890. if app.ENABLE_CHEQUE_SYSTEM:
  891. if shop.IsOfflineShop():
  892. self.AppendSpace(5)
  893. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  894. if price_cheque > 0:
  895. self.AppendSpace(5)
  896. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  897. if price_yang > 0:
  898. self.AppendSpace(5)
  899. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  900. else:
  901. self.AppendSpace(5)
  902. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  903. if price_cheque > 0:
  904. self.AppendSpace(5)
  905. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  906. if price_yang > 0:
  907. self.AppendSpace(5)
  908. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  909. else:
  910. self.AppendPrice(price)
  911. else:
  912. self.AppendSpace(5)
  913. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(addprice)[:-5]), self.SPECIAL_TITLE_COLOR)
  914. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  915. def SetPrivateSearchItem(self, slotIndex):
  916. itemVnum = privateShopSearch.GetSearchItemVnum(slotIndex)
  917. if 0 == itemVnum:
  918. return
  919. self.ClearToolTip()
  920. self.isPrivateSearchItem = True
  921. metinSlot = []
  922. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  923. metinSlot.append(privateShopSearch.GetSearchItemMetinSocket(slotIndex, i))
  924. attrSlot = []
  925. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  926. attrSlot.append(privateShopSearch.GetSearchItemAttribute(slotIndex, i))
  927. self.AddItemData(itemVnum, metinSlot, attrSlot,privateShopSearch.GetSearchItemEvolution(slotIndex, i))
  928. if app.ENABLE_CHANGELOOK_SYSTEM:
  929. self.AppendChangeLookInfoPrivateShopWIndow(slotIndex)
  930. def SetInventoryItemAttrTransfer(self, slotIndex_1, slotIndex_2, window_type = player.INVENTORY):
  931. itemVnum = player.GetItemIndex(window_type, slotIndex_1)
  932. itemVnum_2 = player.GetItemIndex(window_type, slotIndex_2)
  933. if itemVnum == 0 or itemVnum_2 == 0:
  934. return
  935. self.ClearToolTip()
  936. if shop.IsOpen():
  937. if not shop.IsPrivateShop() or not shop.IsOfflineShop():
  938. item.SelectItem(itemVnum)
  939. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex_2))
  940. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex_2, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  941. attrSlot = [player.GetItemAttribute(window_type, slotIndex_2, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  942. self.AddItemDataAttrTransfer(itemVnum, itemVnum_2, metinSlot, attrSlot, 0, 0, window_type, slotIndex_2)
  943. def AddItemDataAttrTransfer(self, itemVnum, itemVnum_2, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0, window_type = player.INVENTORY, slotIndex = -1):
  944. self.itemVnum = itemVnum
  945. item.SelectItem(itemVnum)
  946. itemType = item.GetItemType()
  947. itemSubType = item.GetItemSubType()
  948. itemDesc = item.GetItemDescription()
  949. itemSummary = item.GetItemSummary()
  950. self.__AdjustMaxWidth(attrSlot, itemDesc)
  951. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  952. self.AppendDescription(itemDesc, 26)
  953. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  954. self.__AppendLimitInformation()
  955. self.__AppendAffectInformation()
  956. item.SelectItem(itemVnum_2)
  957. self.__AppendAttributeInformation(attrSlot)
  958. item.SelectItem(itemVnum)
  959. self.AppendWearableInformation()
  960. bHasRealtimeFlag = 0
  961. for i in xrange(item.LIMIT_MAX_NUM):
  962. (limitType, limitValue) = item.GetLimit(i)
  963. if item.LIMIT_REAL_TIME == limitType:
  964. bHasRealtimeFlag = 1
  965. if 1 == bHasRealtimeFlag:
  966. self.AppendMallItemLastTime(metinSlot[0])
  967. self.ShowToolTip()
  968. def SetShopItem(self, slotIndex, addprice = 0, waltype = 0):
  969. import localeInfo
  970. itemVnum = shop.GetItemID(slotIndex)
  971. if 0 == itemVnum:
  972. return
  973. price = shop.GetItemPrice(slotIndex)
  974. if app.ENABLE_CHEQUE_SYSTEM:
  975. price_cheque = shop.GetItemPriceCheque(slotIndex)
  976. price_yang = shop.GetItemPrice(slotIndex)
  977. self.ClearToolTip()
  978. self.isShopItem = True
  979. item.SelectItem(itemVnum)
  980. metinSlot = []
  981. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  982. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  983. attrSlot = []
  984. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  985. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  986. if app.ENABLE_CHANGELOOK_SYSTEM:
  987. transmutation = shop.GetItemTransmutation(slotIndex)
  988. if not transmutation:
  989. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetItemEvolution(slotIndex))
  990. else:
  991. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetItemEvolution(slotIndex), 0, player.INVENTORY, -1, transmutation)
  992. else:
  993. self.AddItemData(itemVnum, metinSlot, attrSlot,shop.GetItemEvolution(slotIndex))
  994. if waltype == 0:
  995. if app.ENABLE_BUY_WITH_ITEM:
  996. buyItemVnum = shop.GetBuyWithItem(slotIndex)
  997. if buyItemVnum != 0:
  998. if itemVnum >= 26000 and itemVnum <= 26021 or itemVnum == 26023 or itemVnum == 72329:
  999. self.AppendSpace(5)
  1000. self.AppendTextLine("[Satın alma sınırı doldu.]" , self.SHOP_ITEM_COLOR)
  1001. else:
  1002. item.SelectItem(buyItemVnum)
  1003. istenenItemAd = item.GetItemName()
  1004. istenenItemVnum = item.GetVnum()
  1005. if shop.IsLimitedItemShop():
  1006. if itemVnum >= 26000 and itemVnum <= 26021 or itemVnum == 26023 or itemVnum == 72329:
  1007. self.AppendPrice(price)
  1008. else:
  1009. self.AppendPriceCheque(price)
  1010. else:
  1011. self.AppendPrice_WithItem(price, istenenItemVnum, istenenItemAd)
  1012. else:
  1013. if shop.IsLimitedItemShop():
  1014. if itemVnum >= 26000 and itemVnum <= 26021 or itemVnum == 26023 or itemVnum == 72329:
  1015. self.AppendPrice(price)
  1016. else:
  1017. self.AppendPriceCheque(price)
  1018. else:
  1019. self.AppendPrice(price)
  1020. elif app.ENABLE_CHEQUE_SYSTEM:
  1021. if shop.IsPrivateShop():
  1022. self.AppendSpace(5)
  1023. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  1024. if price_cheque > 0:
  1025. self.AppendSpace(5)
  1026. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  1027. if price_yang > 0:
  1028. self.AppendSpace(5)
  1029. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  1030. else:
  1031. self.AppendSpace(5)
  1032. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(addprice)[:-5]), self.SPECIAL_TITLE_COLOR)
  1033. if app.ENABLE_12ZI:
  1034. if shop.IsLimitedItemShop():
  1035. count = shop.GetLimitedCount(slotIndex)
  1036. if count != 0:
  1037. if not (itemVnum >= 26000 and itemVnum <= 26021 or itemVnum == 26023 or itemVnum == 72329):
  1038. self.AppendLimitedCountChequeDesk(shop.GetLimitedPurchaseCount(slotIndex), shop.GetMyStok(slotIndex))
  1039. if (app.WJ_COMBAT_ZONE):
  1040. def SetShopItemByCombatZoneCoin(self, slotIndex):
  1041. itemVnum = shop.GetItemID(slotIndex)
  1042. if 0 == itemVnum:
  1043. return
  1044. price = shop.GetItemPrice(slotIndex)
  1045. self.ClearToolTip()
  1046. self.isShopItem = TRUE
  1047. metinSlot = []
  1048. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1049. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  1050. attrSlot = []
  1051. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1052. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  1053. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1054. self.AppendSpace(5)
  1055. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToCombatZoneCoinString(price)), self.HIGH_PRICE_COLOR)
  1056. def SetShopItemBySecondaryCoin(self, slotIndex):
  1057. itemVnum = shop.GetItemID(slotIndex)
  1058. if 0 == itemVnum:
  1059. return
  1060. price = shop.GetItemPrice(slotIndex)
  1061. self.ClearToolTip()
  1062. self.isShopItem = TRUE
  1063. metinSlot = []
  1064. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1065. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  1066. attrSlot = []
  1067. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1068. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  1069. if app.ENABLE_CHANGELOOK_SYSTEM:
  1070. transmutation = shop.GetItemTransmutation(slotIndex)
  1071. if not transmutation:
  1072. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1073. else:
  1074. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, player.INVENTORY, -1, transmutation)
  1075. else:
  1076. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1077. self.AppendPriceBySecondaryCoin(price)
  1078. def SetExchangeOwnerItem(self, slotIndex):
  1079. itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
  1080. if 0 == itemVnum:
  1081. return
  1082. self.ClearToolTip()
  1083. metinSlot = []
  1084. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1085. metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i))
  1086. attrSlot = []
  1087. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1088. attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i))
  1089. if app.ENABLE_CHANGELOOK_SYSTEM:
  1090. transmutation = exchange.GetItemTransmutation(slotIndex, True)
  1091. if not transmutation:
  1092. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromSelf(slotIndex))
  1093. else:
  1094. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromSelf(slotIndex), 0, player.INVENTORY, -1, transmutation)
  1095. else:
  1096. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromSelf(slotIndex))
  1097. def SetExchangeTargetItem(self, slotIndex):
  1098. itemVnum = exchange.GetItemVnumFromTarget(slotIndex)
  1099. if 0 == itemVnum:
  1100. return
  1101. self.ClearToolTip()
  1102. metinSlot = []
  1103. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1104. metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i))
  1105. attrSlot = []
  1106. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1107. attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i))
  1108. if app.ENABLE_CHANGELOOK_SYSTEM:
  1109. transmutation = exchange.GetItemTransmutation(slotIndex, True)
  1110. if not transmutation:
  1111. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromTarget(slotIndex))
  1112. else:
  1113. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromTarget(slotIndex), 0, player.INVENTORY, -1, transmutation)
  1114. else:
  1115. self.AddItemData(itemVnum, metinSlot, attrSlot,exchange.GetItemEvolutionFromTarget(slotIndex))
  1116. def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex):
  1117. itemVnum = player.GetItemIndex(invenType, invenPos)
  1118. if 0 == itemVnum:
  1119. return
  1120. item.SelectItem(itemVnum)
  1121. self.ClearToolTip()
  1122. metinSlot = []
  1123. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1124. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  1125. attrSlot = []
  1126. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1127. attrSlot.append(player.GetItemAttribute(invenPos, i))
  1128. if app.ENABLE_CHANGELOOK_SYSTEM:
  1129. self.AddItemData(itemVnum, metinSlot, attrSlot, 0, invenType, invenPos)
  1130. else:
  1131. self.AddItemData(itemVnum, metinSlot, attrSlot, 0)
  1132. price = shop.GetPrivateShopItemPrice(invenType, invenPos)
  1133. if app.ENABLE_CHEQUE_SYSTEM:
  1134. price_cheque = shop.GetPrivateShopItemPriceCheque(invenType, invenPos)
  1135. price_yang = shop.GetPrivateShopItemPrice(invenType, invenPos)
  1136. self.AppendSpace(5)
  1137. self.AppendTextLine(localeInfo.CHEQUE_SYSTEM_SELL_PRICE, grp.GenerateColor(255./255, 246./255, 78./255, 1.0))
  1138. if price_cheque > 0:
  1139. self.AppendSpace(5)
  1140. self.AppendTextLine(localeInfo.NumberToWonString(price_cheque), grp.GenerateColor(0./255, 215./255, 255./255, 1.0))
  1141. if price_yang > 0:
  1142. self.AppendSpace(5)
  1143. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  1144. else:
  1145. self.AppendTextLine(localeInfo.NumberToGoldString(price), self.GetPriceColor(price))
  1146. def SetSafeBoxItem(self, slotIndex):
  1147. itemVnum = safebox.GetItemID(slotIndex)
  1148. if 0 == itemVnum:
  1149. return
  1150. self.ClearToolTip()
  1151. metinSlot = []
  1152. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1153. metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i))
  1154. attrSlot = []
  1155. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1156. attrSlot.append(safebox.GetItemAttribute(slotIndex, i))
  1157. if app.ENABLE_CHANGELOOK_SYSTEM:
  1158. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemEvolution(slotIndex), safebox.GetItemFlags(slotIndex), player.SAFEBOX, slotIndex, 0)
  1159. else:
  1160. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemEvolution(slotIndex), safebox.GetItemFlags(slotIndex), 0)
  1161. self.__AppendSealInformation(player.SAFEBOX, slotIndex)
  1162. def SetMallItem(self, slotIndex):
  1163. itemVnum = safebox.GetMallItemID(slotIndex)
  1164. if 0 == itemVnum:
  1165. return
  1166. self.ClearToolTip()
  1167. metinSlot = []
  1168. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1169. metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i))
  1170. attrSlot = []
  1171. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1172. attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i))
  1173. if app.ENABLE_CHANGELOOK_SYSTEM:
  1174. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetMallItemEvolution(slotIndex), 0, player.MALL, slotIndex)
  1175. else:
  1176. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1177. self.__AppendSealInformation(player.MALL, slotIndex)
  1178. def SetItemToolTip(self, itemVnum):
  1179. self.ClearToolTip()
  1180. metinSlot = []
  1181. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1182. metinSlot.append(0)
  1183. attrSlot = []
  1184. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1185. attrSlot.append((0, 0))
  1186. self.AddItemData(itemVnum, metinSlot, attrSlot, 1)
  1187. if app.ENABLE_ATTENDANCE_EVENT:
  1188. def SetAttendanceRewardItem(self, itemVnum, itemCount):
  1189. if 0 == itemVnum:
  1190. return
  1191. self.ClearToolTip()
  1192. self.isAttendanceRewardItem = True
  1193. metinSlot = []
  1194. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1195. metinSlot.append(0)
  1196. attrSlot = []
  1197. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1198. attrSlot.append((0, 0))
  1199. metinSlot[0] = itemCount
  1200. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1201. if app.ENABLE_SEND_TARGET_INFO:
  1202. def SetItemToolTipStone(self, itemVnum):
  1203. self.itemVnum = itemVnum
  1204. item.SelectItem(itemVnum)
  1205. itemType = item.GetItemType()
  1206. itemDesc = item.GetItemDescription()
  1207. itemSummary = item.GetItemSummary()
  1208. attrSlot = 0
  1209. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1210. itemName = item.GetItemName()
  1211. realName = itemName[:itemName.find("+")]
  1212. self.SetTitle(realName + " +0 - +4")
  1213. ## Description ###
  1214. self.AppendDescription(itemDesc, 26)
  1215. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1216. if item.ITEM_TYPE_METIN == itemType:
  1217. self.AppendMetinInformation()
  1218. self.AppendMetinWearInformation()
  1219. for i in xrange(item.LIMIT_MAX_NUM):
  1220. (limitType, limitValue) = item.GetLimit(i)
  1221. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1222. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1223. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1224. self.AppendTimerBasedOnWearLastTime(metinSlot)
  1225. self.ShowToolTip()
  1226. def __AppendAttackSpeedInfo(self, item):
  1227. atkSpd = item.GetValue(0)
  1228. if atkSpd < 80:
  1229. stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST
  1230. elif atkSpd <= 95:
  1231. stSpd = localeInfo.TOOLTIP_ITEM_FAST
  1232. elif atkSpd <= 105:
  1233. stSpd = localeInfo.TOOLTIP_ITEM_NORMAL
  1234. elif atkSpd <= 120:
  1235. stSpd = localeInfo.TOOLTIP_ITEM_SLOW
  1236. else:
  1237. stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW
  1238. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR)
  1239. def __AppendAttackGradeInfo(self):
  1240. atkGrade = item.GetValue(1)
  1241. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade))
  1242. if app.ENABLE_SASH_SYSTEM:
  1243. def CalcSashValue(self, value, abs):
  1244. if not value:
  1245. return 0
  1246. valueCalc = int((round(value * abs) / 100) - .5) + int(int((round(value * abs) / 100) - .5) > 0)
  1247. if valueCalc <= 0 and value > 0:
  1248. value = 1
  1249. else:
  1250. value = valueCalc
  1251. return value
  1252. def __AppendAttackPowerInfo(self, itemAbsChance = 0):
  1253. minPower = item.GetValue(3)
  1254. maxPower = item.GetValue(4)
  1255. addPower = item.GetValue(5)
  1256. if app.ENABLE_SASH_SYSTEM:
  1257. if itemAbsChance:
  1258. minPower = self.CalcSashValue(minPower, itemAbsChance)
  1259. maxPower = self.CalcSashValue(maxPower, itemAbsChance)
  1260. addPower = self.CalcSashValue(addPower, itemAbsChance)
  1261. if maxPower > minPower:
  1262. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower+addPower, maxPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  1263. else:
  1264. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  1265. def __AppendMagicAttackInfo(self, itemAbsChance = 0):
  1266. minMagicAttackPower = item.GetValue(1)
  1267. maxMagicAttackPower = item.GetValue(2)
  1268. addPower = item.GetValue(5)
  1269. if app.ENABLE_SASH_SYSTEM:
  1270. if itemAbsChance:
  1271. minMagicAttackPower = self.CalcSashValue(minMagicAttackPower, itemAbsChance)
  1272. maxMagicAttackPower = self.CalcSashValue(maxMagicAttackPower, itemAbsChance)
  1273. addPower = self.CalcSashValue(addPower, itemAbsChance)
  1274. if minMagicAttackPower > 0 or maxMagicAttackPower > 0:
  1275. if maxMagicAttackPower > minMagicAttackPower:
  1276. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower+addPower, maxMagicAttackPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  1277. else:
  1278. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower+addPower)+self.SILAH_EVRIM_VALUE[self.itemEvolution], self.POSITIVE_COLOR)
  1279. def __AppendMagicDefenceInfo(self, itemAbsChance = 0):
  1280. magicDefencePower = item.GetValue(0)
  1281. if app.ENABLE_SASH_SYSTEM:
  1282. if itemAbsChance:
  1283. magicDefencePower = self.CalcSashValue(magicDefencePower, itemAbsChance)
  1284. if magicDefencePower > 0:
  1285. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))
  1286. def __AppendAttributeInformation(self, attrSlot, itemAbsChance = 0):
  1287. if 0 != attrSlot:
  1288. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1289. type = attrSlot[i][0]
  1290. value = attrSlot[i][1]
  1291. if 0 == value:
  1292. continue
  1293. affectString = self.__GetAffectString(type, value)
  1294. if app.ENABLE_SASH_SYSTEM:
  1295. if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_SASH and itemAbsChance:
  1296. value = self.CalcSashValue(value, itemAbsChance)
  1297. affectString = self.__GetAffectString(type, value)
  1298. if app.ENABLE_AURA_SYSTEM:
  1299. if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_AURA and itemAbsChance:
  1300. value = self.CalcSashValue(value, itemAbsChance)
  1301. affectString = self.__GetAffectString(type, value)
  1302. if affectString:
  1303. affectColor = self.__GetAttributeColor(i, value)
  1304. self.AppendTextLine(affectString, affectColor)
  1305. def __GetAttributeColor(self, index, value):
  1306. if value > 0:
  1307. if index >= 5:
  1308. return self.SPECIAL_POSITIVE_COLOR2
  1309. else:
  1310. return self.SPECIAL_POSITIVE_COLOR
  1311. elif value == 0:
  1312. return self.NORMAL_COLOR
  1313. else:
  1314. return self.NEGATIVE_COLOR
  1315. def __IsPolymorphItem(self, itemVnum):
  1316. if itemVnum >= 70103 and itemVnum <= 70106:
  1317. return 1
  1318. return 0
  1319. def __SetPolymorphItemTitle(self, monsterVnum):
  1320. if localeInfo.IsVIETNAM():
  1321. itemName =item.GetItemName()
  1322. itemName+=" "
  1323. itemName+=nonplayer.GetMonsterName(monsterVnum)
  1324. else:
  1325. itemName =nonplayer.GetMonsterName(monsterVnum)
  1326. itemName+=" "
  1327. itemName+=item.GetItemName()
  1328. self.SetTitle(itemName)
  1329. def __SetNormalItemTitle(self):
  1330. if app.ENABLE_SEND_TARGET_INFO:
  1331. if self.isStone:
  1332. itemName = item.GetItemName()
  1333. realName = itemName[:itemName.find("+")]
  1334. self.SetTitle(realName + " +0 - +4")
  1335. else:
  1336. #self.SetTitle(item.GetItemName())
  1337. self.SetTitle(self.SILAH_EVRIM_TITLE[self.itemEvolution] % (localeInfo.SILAH_EVRIM_TEXT.get(self.itemEvolution,"") + item.GetItemName()))
  1338. #Bvural41 won masasi
  1339. else:
  1340. self.SetTitle(item.GetItemName())
  1341. def __SetSpecialItemTitle(self):
  1342. self.AppendTextLine(self.SILAH_EVRIM_TITLE[self.itemEvolution] % (localeInfo.SILAH_EVRIM_TEXT.get(self.itemEvolution,"") + item.GetItemName()), self.SPECIAL_TITLE_COLOR)
  1343. def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
  1344. if app.ENABLE_ATTENDANCE_EVENT:
  1345. if self.isAttendanceRewardItem:
  1346. self.SetTitle(item.GetItemName()+" - |cffffc800|H|h"+str(metinSlot[0])+" adet|h|r")
  1347. return
  1348. if localeInfo.IsCANADA():
  1349. if 72726 == itemVnum or 72730 == itemVnum:
  1350. self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  1351. return
  1352. if self.__IsPolymorphItem(itemVnum):
  1353. self.__SetPolymorphItemTitle(metinSlot[0])
  1354. else:
  1355. if self.__IsAttr(attrSlot):
  1356. self.__SetSpecialItemTitle()
  1357. return
  1358. self.__SetNormalItemTitle()
  1359. def __IsAttr(self, attrSlot):
  1360. if not attrSlot:
  1361. return FALSE
  1362. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1363. type = attrSlot[i][0]
  1364. if 0 != type:
  1365. return TRUE
  1366. return FALSE
  1367. def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0, targetItemPos = -1):
  1368. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1369. metinSlotData=metinSlot[i]
  1370. if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE:
  1371. metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER
  1372. if targetItemPos != -1:
  1373. self.AddItemData(itemVnum, metinSlot, attrSlot, player.GetItemEvolution(targetItemPos))
  1374. else:
  1375. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1376. def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot):
  1377. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1378. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1379. if self.__IsHair(itemVnum):
  1380. self.__AppendHairIcon(itemVnum)
  1381. ### Description ###
  1382. self.AppendDescription(itemDesc, 26)
  1383. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1384. def check_sigillo(self, item_vnum):
  1385. for x in range(55701,55711):
  1386. if x == item_vnum:
  1387. return TRUE
  1388. if item_vnum == 55801:
  1389. return TRUE
  1390. return FALSE
  1391. def __TumunuAc(self, file):
  1392. iconFile = str(file)
  1393. itemImage = ui.ImageBox()
  1394. itemImage.SetParent(self)
  1395. itemImage.Show()
  1396. itemImage.LoadImage(iconFile)
  1397. itemImage.SetPosition(itemImage.GetWidth()/ 2 - 50+82, self.toolTipHeight)
  1398. self.toolTipHeight += itemImage.GetHeight()
  1399. self.childrenList.append(itemImage)
  1400. self.ResizeToolTip()
  1401. def __SandikIngoru(self, file):
  1402. iconFile = str(file)
  1403. itemImage = ui.ImageBox()
  1404. itemImage.SetParent(self)
  1405. itemImage.Show()
  1406. itemImage.LoadImage(iconFile)
  1407. itemImage.SetPosition(itemImage.GetWidth()/ 2 - 50+82, self.toolTipHeight)
  1408. self.toolTipHeight += itemImage.GetHeight()
  1409. self.childrenList.append(itemImage)
  1410. self.ResizeToolTip()
  1411. def AddItemData(self, itemVnum, metinSlot, attrSlot = 0,evolution = 0,flags = 0,window_type = player.INVENTORY, slotIndex = -1, transmutation = -1, preview = 1):
  1412. self.itemVnum = itemVnum
  1413. item.SelectItem(itemVnum)
  1414. itemType = item.GetItemType()
  1415. itemSubType = item.GetItemSubType()
  1416. self.itemEvolution = evolution
  1417. if 50026 == itemVnum:
  1418. if 0 != metinSlot:
  1419. name = item.GetItemName()
  1420. if metinSlot[0] > 0:
  1421. name += " "
  1422. name += localeInfo.NumberToMoneyString(metinSlot[0])
  1423. self.SetTitle(name)
  1424. self.ShowToolTip()
  1425. return
  1426. ### Skill Book ###
  1427. if app.ENABLE_SEND_TARGET_INFO:
  1428. if 50300 == itemVnum and not self.isBook:
  1429. if 0 != metinSlot and not self.isBook:
  1430. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1431. self.ShowToolTip()
  1432. elif self.isBook:
  1433. self.SetTitle(item.GetItemName())
  1434. self.AppendDescription(item.GetItemDescription(), 26)
  1435. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1436. self.ShowToolTip()
  1437. return
  1438. elif 70037 == itemVnum :
  1439. if 0 != metinSlot and not self.isBook2:
  1440. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1441. self.AppendDescription(item.GetItemDescription(), 26)
  1442. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1443. self.ShowToolTip()
  1444. elif self.isBook2:
  1445. self.SetTitle(item.GetItemName())
  1446. self.AppendDescription(item.GetItemDescription(), 26)
  1447. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1448. self.ShowToolTip()
  1449. return
  1450. elif 70055 == itemVnum:
  1451. if 0 != metinSlot:
  1452. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1453. self.AppendDescription(item.GetItemDescription(), 26)
  1454. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1455. self.ShowToolTip()
  1456. return
  1457. else:
  1458. if 50300 == itemVnum:
  1459. if 0 != metinSlot:
  1460. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  1461. self.ShowToolTip()
  1462. return
  1463. elif 70037 == itemVnum:
  1464. if 0 != metinSlot:
  1465. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1466. self.AppendDescription(item.GetItemDescription(), 26)
  1467. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1468. self.ShowToolTip()
  1469. return
  1470. elif 70055 == itemVnum:
  1471. if 0 != metinSlot:
  1472. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  1473. self.AppendDescription(item.GetItemDescription(), 26)
  1474. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  1475. self.ShowToolTip()
  1476. return
  1477. ###########################################################################################
  1478. itemDesc = item.GetItemDescription()
  1479. itemSummary = item.GetItemSummary()
  1480. isCostumeItem = 0
  1481. isCostumeHair = 0
  1482. isCostumeBody = 0
  1483. isCostumeMount = 0
  1484. if app.ENABLE_SASH_SYSTEM:
  1485. isCostumeSash = 0
  1486. if app.ENABLE_COSTUME_WEAPON_SYSTEM:
  1487. isCostumeWeapon = 0
  1488. if app.ENABLE_AURA_SYSTEM:
  1489. isCostumeAura = 0
  1490. if app.ENABLE_COSTUME_SYSTEM:
  1491. if item.ITEM_TYPE_COSTUME == itemType:
  1492. isCostumeItem = 1
  1493. isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
  1494. isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
  1495. isCostumeMount = item.COSTUME_SLOT_MOUNT == itemSubType
  1496. if app.ENABLE_SASH_SYSTEM:
  1497. isCostumeSash = itemSubType == item.COSTUME_TYPE_SASH
  1498. if app.ENABLE_COSTUME_WEAPON_SYSTEM:
  1499. isCostumeWeapon = item.COSTUME_TYPE_WEAPON == itemSubType
  1500. if app.ENABLE_AURA_SYSTEM:
  1501. isCostumeAura = itemSubType == item.COSTUME_TYPE_AURA
  1502. self.__AdjustMaxWidth(attrSlot, itemDesc)
  1503. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  1504. if app.ENABLE_RENDER_TARGET_SYSTEM:
  1505. self.__ModelPreviewClose()
  1506. if self.__IsHair(itemVnum):
  1507. self.__AppendHairIcon(itemVnum)
  1508. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  1509. if self.isPrivateSearchItem:
  1510. if not self.__IsHair(itemVnum):
  1511. self.__AppendPrivateSearchItemicon(itemVnum)
  1512. if app.ENABLE_ATTENDANCE_EVENT:
  1513. if self.isAttendanceRewardItem:
  1514. if not self.__IsHair(itemVnum):
  1515. self.__AppendAttendanceRewardItemIcon(itemVnum)
  1516. ### Description ###
  1517. self.AppendDescription(itemDesc, 26)
  1518. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  1519. if self.check_sigillo(itemVnum) or itemVnum == 55002:
  1520. if attrSlot[0][1] != 0:
  1521. self.AppendSpace(2)
  1522. blackyas = (int(attrSlot[5][1])/60)/24
  1523. getskillslot = (int(attrSlot[6][1]))
  1524. #petevobl = (int(attrSlot[6][1]))
  1525. self.AppendTextLine("|cffffffffSeviye:"+str(metinSlot[1]) + " (" + str(getskillslot) +")", self.NORMAL_COLOR)
  1526. #if (str(petevobl)) == "0":
  1527. #self.AppendTextLine(localeInfo.PET_TEXTT_7, grp.GenerateColor(0, 78, 0, 1))
  1528. #elif (str(petevobl)) == "1":
  1529. #self.AppendTextLine(localeInfo.PET_SYSTEM_EVO2, grp.GenerateColor(0, 78, 0, 1))
  1530. #elif (str(petevobl)) == "2":
  1531. #self.AppendTextLine(localeInfo.PET_SYSTEM_EVO3, grp.GenerateColor(0, 78, 0, 1))
  1532. #elif (str(petevobl)) == "3":
  1533. #self.AppendTextLine(localeInfo.PET_SYSTEM_EVO4, grp.GenerateColor(0, 78, 0, 1))
  1534. self.AppendSpace(2)
  1535. self.AppendTextLine("Can: +"+pointop(str(attrSlot[0][1]))+"%", self.SPECIAL_POSITIVE_COLOR)
  1536. self.AppendTextLine("Savunma: +"+pointop(str(attrSlot[1][1]))+"%", self.SPECIAL_POSITIVE_COLOR)
  1537. self.AppendTextLine("Hasar: +"+pointop(str(attrSlot[2][1]))+"%", self.SPECIAL_POSITIVE_COLOR)
  1538. self.AppendSpace(5)
  1539. if itemVnum != 55002:
  1540. days = (int(attrSlot[3][1])/60)/24
  1541. hours = (int(attrSlot[3][1]) - (days*60*24)) / 60
  1542. mins = int(attrSlot[3][1]) - (days*60*24) - (hours*60)
  1543. self.AppendTextLine(localeInfo.PET_TEXTT_1 % (days, hours, mins), self.SPECIAL_POSITIVE_COLOR)
  1544. ##Support Shaman
  1545. if itemVnum == 8383 or itemVnum == 8384:
  1546. if 0 != metinSlot:
  1547. useCount = int(metinSlot[0])
  1548. self.AppendSpace(5)
  1549. self.AppendTextLine("Kritik Oranı: +41" , self.ITEM_BUFF_RATE_COLOR)
  1550. self.AppendTextLine("Yansıtma Oranı: +41" , self.ITEM_BUFF_RATE_COLOR)
  1551. self.AppendTextLine("Bloklama Oranı: +41" , self.ITEM_BUFF_RATE_COLOR)
  1552. if metinSlot[1] == 1:
  1553. self.AppendTextLine("Åžaman Destek Aktif", grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  1554. if itemVnum == 70605:
  1555. self.AppendSpace(5)
  1556. self.AppendTextLine("Geçerli olan zindanlar:" , self.NEGATIVE_COLOR)
  1557. self.AppendTextLine("Wju Tapınağı" , self.POSITIVE_COLOR)
  1558. self.AppendTextLine("Gemi Savunması" , self.POSITIVE_COLOR)
  1559. self.AppendTextLine("Nemere Gözlemevi" , self.POSITIVE_COLOR)
  1560. self.AppendTextLine("Rhae Agile'nin ini" , self.POSITIVE_COLOR)
  1561. if itemVnum >= 50255 and itemVnum <= 50260:
  1562. self.__TumunuAc("d:/ymir work/ui/ctrl+sag.tga")
  1563. self.AppendTextLine("(10x açmak için tıklayın.)", self.SPECIAL_POSITIVE_COLOR)
  1564. if item.ITEM_TYPE_GACHA == itemType or\
  1565. item.ITEM_TYPE_GIFTBOX == itemType and\
  1566. itemVnum != 31374 and itemVnum != 50255 and itemVnum != 50187 and\
  1567. itemVnum != 50197 and itemVnum != 50188 and itemVnum != 50189 and\
  1568. itemVnum != 50190 and itemVnum != 50191 and itemVnum != 50192 and\
  1569. itemVnum != 50193 and itemVnum != 50194 and itemVnum != 50195 and\
  1570. itemVnum != 50196 and itemVnum != 50286 and itemVnum != 50285 and\
  1571. itemVnum != 26030 and itemVnum != 26031 and itemVnum != 26032 and\
  1572. itemVnum != 26033 and itemVnum != 26034 and itemVnum != 26035 and\
  1573. itemVnum != 26036 and itemVnum != 26037 and itemVnum != 26038 and\
  1574. itemVnum != 26039 and itemVnum != 26040 and itemVnum != 26041 and\
  1575. itemVnum != 26042 and itemVnum != 26043 and itemVnum != 26044 and\
  1576. itemVnum != 26045 and itemVnum != 26046 and itemVnum != 26047 and\
  1577. itemVnum != 26048 and itemVnum != 26049 and itemVnum != 26050 and\
  1578. itemVnum != 26051:
  1579. self.__SandikIngoru("d:/ymir work/ui/shift+sag.tga")
  1580. self.AppendTextLine("(Sandık içgörü için tıklayın.)", self.SPECIAL_POSITIVE_COLOR)
  1581. if itemVnum == 61205:
  1582. self.__TumunuAc("d:/ymir work/ui/ctrl+sag.tga")
  1583. self.AppendTextLine("(100x Efsun Nesnesi = 1x Kadim Efsun Nesnesi)", self.SPECIAL_POSITIVE_COLOR)
  1584. if itemVnum >= 53001 and itemVnum <= 53267:
  1585. self.__AppendLimitInformation()
  1586. self.__AppendAffectInformation()
  1587. self.__AppendAttributeInformation(attrSlot)
  1588. self.AppendWearableInformation()
  1589. ### Weapon ###
  1590. if item.ITEM_TYPE_WEAPON == itemType:
  1591. self.__AppendLimitInformation()
  1592. self.AppendSpace(5)
  1593. if item.WEAPON_FAN == itemSubType:
  1594. self.__AppendMagicAttackInfo()
  1595. self.__AppendAttackPowerInfo()
  1596. else:
  1597. self.__AppendAttackPowerInfo()
  1598. self.__AppendMagicAttackInfo()
  1599. self.__AppendAffectInformation()
  1600. self.__AppendAttributeInformation(attrSlot)
  1601. if app.ENABLE_CHANGELOOK_SYSTEM:
  1602. self.AppendTransmutation(window_type, slotIndex, transmutation)
  1603. self.AppendWearableInformation()
  1604. bHasRealtimeFlag = 0
  1605. for i in xrange(item.LIMIT_MAX_NUM):
  1606. (limitType, limitValue) = item.GetLimit(i)
  1607. if item.LIMIT_REAL_TIME == limitType:
  1608. bHasRealtimeFlag = 1
  1609. if bHasRealtimeFlag == 1:
  1610. self.AppendMallItemLastTime(metinSlot[0])
  1611. else:
  1612. self.__AppendMetinSlotInfo(metinSlot)
  1613. if app.ENABLE_RENDER_TARGET_SYSTEM:
  1614. if preview != 0:
  1615. if item.WEAPON_SWORD == itemSubType:
  1616. if player.GetRace() != 7 and player.GetRace() != 3:
  1617. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1618. if item.WEAPON_DAGGER == itemSubType or item.WEAPON_BOW == itemSubType:
  1619. if player.GetRace() == 5 or player.GetRace() == 1:
  1620. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1621. if item.WEAPON_TWO_HANDED == itemSubType:
  1622. if player.GetRace() == 0 or player.GetRace() == 4:
  1623. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1624. if item.WEAPON_BELL == itemSubType or item.WEAPON_FAN == itemSubType:
  1625. if player.GetRace() == 7 or player.GetRace() == 3:
  1626. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1627. ### Armor ###
  1628. elif item.ITEM_TYPE_ARMOR == itemType:
  1629. self.__AppendLimitInformation()
  1630. ## ¹æ¾î·Â
  1631. defGrade = item.GetValue(1)
  1632. defBonus = item.GetValue(5)*2
  1633. if defGrade > 0:
  1634. self.AppendSpace(5)
  1635. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  1636. self.__AppendMagicDefenceInfo()
  1637. self.__AppendAffectInformation()
  1638. self.__AppendAttributeInformation(attrSlot)
  1639. if app.ENABLE_RENDER_TARGET_SYSTEM:
  1640. if preview != 0 and itemSubType == 0:
  1641. if self.__ItemGetRace() == player.GetRace() or self.__ItemGetRace() == 3 and player.GetRace() == 7:
  1642. self.__ModelPreview(itemVnum, 2, player.GetRace())
  1643. if self.__ItemGetRace() == player.GetRace() or self.__ItemGetRace() == 1 and player.GetRace() == 5:
  1644. self.__ModelPreview(itemVnum, 2, player.GetRace())
  1645. if self.__ItemGetRace() == player.GetRace() or self.__ItemGetRace() == 0 and player.GetRace() == 4:
  1646. self.__ModelPreview(itemVnum, 2, player.GetRace())
  1647. else:
  1648. self.__ModelPreview(itemVnum, 2, player.GetRace())
  1649. if app.ENABLE_CHANGELOOK_SYSTEM:
  1650. self.AppendTransmutation(window_type, slotIndex, transmutation)
  1651. self.AppendWearableInformation()
  1652. if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR, item.ARMOR_PENDANT):
  1653. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  1654. else:
  1655. self.__AppendMetinSlotInfo(metinSlot)
  1656. ### Ring Slot Item (Not UNIQUE) ###
  1657. elif item.ITEM_TYPE_RING == itemType:
  1658. self.__AppendLimitInformation()
  1659. self.__AppendAffectInformation()
  1660. self.__AppendAttributeInformation(attrSlot)
  1661. bHasRealtimeFlag = 0
  1662. for i in xrange(item.LIMIT_MAX_NUM):
  1663. (limitType, limitValue) = item.GetLimit(i)
  1664. if item.LIMIT_REAL_TIME == limitType:
  1665. bHasRealtimeFlag = 1
  1666. if bHasRealtimeFlag == 1:
  1667. if metinSlot != 0:
  1668. self.AppendMallItemLastTime(metinSlot[0])
  1669. ### Belt Item ###
  1670. elif item.ITEM_TYPE_BELT == itemType:
  1671. self.__AppendLimitInformation()
  1672. self.__AppendAffectInformation()
  1673. self.__AppendAttributeInformation(attrSlot)
  1674. self.AppendTextLine("Kullanılabilir Slot : %s " % EXTRA_SLOT[item.GetValue(0)], self.SPECIAL_POSITIVE_COLOR)
  1675. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  1676. elif itemVnum in self.MountVnum:
  1677. self.__ModelPreview(itemVnum, 5, self.MountVnum[itemVnum])
  1678. elif itemVnum in self.PetVnum:
  1679. self.__ModelPreview(itemVnum, 5, self.PetVnum[itemVnum])
  1680. elif 0 != isCostumeItem:
  1681. self.__AppendLimitInformation()
  1682. if app.ENABLE_RENDER_TARGET_SYSTEM:
  1683. ## If you dont see attributes in costume uncomment this ###
  1684. ##self.__AppendAffectInformation()
  1685. ##self.__AppendAttributeInformation(attrSlot)
  1686. ##########################################################
  1687. if preview != 0:
  1688. if itemSubType == 0: #body
  1689. if self.__ItemGetRace() == player.GetRace():
  1690. self.__ModelPreview(itemVnum, 2, player.GetRace())
  1691. elif itemSubType == 1: #Hair
  1692. if item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) == False and (player.GetRace() == 4 or player.GetRace() == 0):
  1693. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and chr.RaceToSex(player.GetRace()) == 0):
  1694. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1695. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and chr.RaceToSex(player.GetRace()) == 1):
  1696. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1697. if item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) == False and (player.GetRace() == 5 or player.GetRace() == 1):
  1698. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and chr.RaceToSex(player.GetRace()) == 0):
  1699. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1700. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and chr.RaceToSex(player.GetRace()) == 1):
  1701. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1702. if item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA) == False and (player.GetRace() == 2 or player.GetRace() == 6):
  1703. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and chr.RaceToSex(player.GetRace()) == 0):
  1704. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1705. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and chr.RaceToSex(player.GetRace()) == 1):
  1706. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1707. elif item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN) == False and (player.GetRace() == 7 or player.GetRace() == 3):
  1708. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and chr.RaceToSex(player.GetRace()) == 0):
  1709. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1710. if(item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and chr.RaceToSex(player.GetRace()) == 1):
  1711. self.__ModelPreview(item.GetValue(3), 1, player.GetRace())
  1712. elif itemSubType == 3: #weapon
  1713. if player.GetRace() != 7 and player.GetRace() != 3:
  1714. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1715. if player.GetRace() == 5 or player.GetRace() == 1:
  1716. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1717. if player.GetRace() == 0 or player.GetRace() == 4:
  1718. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1719. if player.GetRace() == 7 or player.GetRace() == 3:
  1720. self.__ModelPreview(itemVnum, 3, player.GetRace())
  1721. if app.ENABLE_SASH_SYSTEM:
  1722. if isCostumeSash:
  1723. ## ABSORPTION RATE
  1724. absChance = int(metinSlot[sash.ABSORPTION_SOCKET])
  1725. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (absChance), self.CONDITION_COLOR)
  1726. ## END ABSOPRTION RATE
  1727. itemAbsorbedVnum = int(metinSlot[sash.ABSORBED_SOCKET])
  1728. if app.ENABLE_RENDER_TARGET_SYSTEM:
  1729. if preview != 0:
  1730. self.__ModelPreview(itemVnum, 4, self.__ItemGetRace())
  1731. if itemAbsorbedVnum:
  1732. ## ATTACK / DEFENCE
  1733. item.SelectItem(itemAbsorbedVnum)
  1734. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  1735. if item.GetItemSubType() == item.WEAPON_FAN:
  1736. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1737. item.SelectItem(itemAbsorbedVnum)
  1738. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1739. else:
  1740. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1741. item.SelectItem(itemAbsorbedVnum)
  1742. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1743. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1744. defGrade = item.GetValue(1)
  1745. defBonus = item.GetValue(5) * 2
  1746. defGrade = self.CalcSashValue(defGrade, metinSlot[sash.ABSORPTION_SOCKET])
  1747. defBonus = self.CalcSashValue(defBonus, metinSlot[sash.ABSORPTION_SOCKET])
  1748. if defGrade > 0:
  1749. self.AppendSpace(5)
  1750. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  1751. item.SelectItem(itemAbsorbedVnum)
  1752. self.__AppendMagicDefenceInfo(metinSlot[sash.ABSORPTION_SOCKET])
  1753. ## END ATTACK / DEFENCE
  1754. ## EFFECT
  1755. item.SelectItem(itemAbsorbedVnum)
  1756. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1757. (affectType, affectValue) = item.GetAffect(i)
  1758. affectValue = self.CalcSashValue(affectValue, metinSlot[sash.ABSORPTION_SOCKET])
  1759. affectString = self.__GetAffectString(affectType, affectValue)
  1760. if affectString and affectValue > 0:
  1761. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1762. item.SelectItem(itemAbsorbedVnum)
  1763. # END EFFECT
  1764. item.SelectItem(itemVnum)
  1765. ## ATTR
  1766. self.__AppendAttributeInformation(attrSlot, metinSlot[sash.ABSORPTION_SOCKET])
  1767. # END ATTR
  1768. else:
  1769. # ATTR
  1770. self.__AppendAttributeInformation(attrSlot)
  1771. # END ATTR
  1772. elif isCostumeAura:
  1773. ## ABSORPTION RATE
  1774. absChance = (float(metinSlot[aura.ABSORPTION_SOCKET]) / 10.0)
  1775. self.AppendTextLine(localeInfo.AURA_LEVEL_STEP % (int(metinSlot[aura.LEVEL_SOCKET]), int(metinSlot[aura.LEVEL_SOCKET])), self.CONDITION_COLOR)
  1776. self.AppendTextLine(localeInfo.AURA_DRAIN_PER % (absChance), self.CONDITION_COLOR)
  1777. ## END ABSOPRTION RATE
  1778. itemAbsorbedVnum = int(metinSlot[aura.ABSORBED_SOCKET])
  1779. if itemAbsorbedVnum:
  1780. ## ATTACK / DEFENCE
  1781. item.SelectItem(itemAbsorbedVnum)
  1782. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  1783. if item.GetItemSubType() == item.WEAPON_FAN:
  1784. self.__AppendMagicAttackInfo(absChance)
  1785. item.SelectItem(itemAbsorbedVnum)
  1786. self.__AppendAttackPowerInfo(absChance)
  1787. else:
  1788. self.__AppendAttackPowerInfo(absChance)
  1789. item.SelectItem(itemAbsorbedVnum)
  1790. self.__AppendMagicAttackInfo(absChance)
  1791. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1792. defGrade = item.GetValue(1)
  1793. defBonus = item.GetValue(5) * 2
  1794. defGrade = self.CalcSashValue(defGrade, absChance)
  1795. defBonus = self.CalcSashValue(defBonus, absChance)
  1796. if defGrade > 0:
  1797. self.AppendSpace(5)
  1798. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  1799. item.SelectItem(itemAbsorbedVnum)
  1800. self.__AppendMagicDefenceInfo(absChance)
  1801. ## END ATTACK / DEFENCE
  1802. ## EFFECT
  1803. item.SelectItem(itemAbsorbedVnum)
  1804. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1805. (affectType, affectValue) = item.GetAffect(i)
  1806. affectValue = self.CalcSashValue(affectValue, absChance)
  1807. affectString = self.__GetAffectString(affectType, affectValue)
  1808. if affectString and affectValue > 0:
  1809. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1810. item.SelectItem(itemAbsorbedVnum)
  1811. # END EFFECT
  1812. item.SelectItem(itemVnum)
  1813. ## ATTR
  1814. self.__AppendAttributeInformation(attrSlot, absChance)
  1815. # END ATTR
  1816. else:
  1817. # ATTR
  1818. self.__AppendAttributeInformation(attrSlot)
  1819. # END ATTR
  1820. else:
  1821. self.__AppendAffectInformation()
  1822. self.__AppendAttributeInformation(attrSlot)
  1823. else:
  1824. self.__AppendAffectInformation()
  1825. self.__AppendAttributeInformation(attrSlot)
  1826. if app.ENABLE_CHANGELOOK_SYSTEM:
  1827. self.AppendTransmutation(window_type, slotIndex, transmutation)
  1828. self.AppendWearableInformation()
  1829. bHasRealtimeFlag = 0
  1830. for i in xrange(item.LIMIT_MAX_NUM):
  1831. (limitType, limitValue) = item.GetLimit(i)
  1832. if item.LIMIT_REAL_TIME == limitType:
  1833. bHasRealtimeFlag = 1
  1834. if bHasRealtimeFlag == 1:
  1835. self.AppendMallItemLastTime(metinSlot[0])
  1836. ## Rod ##
  1837. elif item.ITEM_TYPE_ROD == itemType:
  1838. if 0 != metinSlot:
  1839. curLevel = item.GetValue(0) / 10
  1840. curEXP = metinSlot[0]
  1841. maxEXP = item.GetValue(2)
  1842. self.__AppendLimitInformation()
  1843. self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  1844. ## Pick ##
  1845. elif item.ITEM_TYPE_PICK == itemType:
  1846. if 0 != metinSlot:
  1847. curLevel = item.GetValue(0) / 10
  1848. curEXP = metinSlot[0]
  1849. maxEXP = item.GetValue(2)
  1850. self.__AppendLimitInformation()
  1851. self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  1852. ## Lottery ##
  1853. elif item.ITEM_TYPE_LOTTERY == itemType:
  1854. if 0 != metinSlot:
  1855. ticketNumber = int(metinSlot[0])
  1856. stepNumber = int(metinSlot[1])
  1857. self.AppendSpace(5)
  1858. self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  1859. self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  1860. ### Metin ###
  1861. elif item.ITEM_TYPE_METIN == itemType:
  1862. self.AppendMetinInformation()
  1863. self.AppendMetinWearInformation()
  1864. ### Fish ###
  1865. elif item.ITEM_TYPE_FISH == itemType:
  1866. if 0 != metinSlot:
  1867. self.__AppendFishInfo(metinSlot[0])
  1868. ### Gacha = Battle Shop Chest ###
  1869. elif item.ITEM_TYPE_GACHA == itemType:
  1870. if 0 != metinSlot:
  1871. if self.isShopItem and int(metinSlot[0]) == 0:
  1872. restUsableCount = int(item.GetLimit(1)[1])
  1873. else:
  1874. restUsableCount = int(metinSlot[0])
  1875. self.AppendSpace(5)
  1876. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (restUsableCount), grp.GenerateColor(0.5, 1.0, 0.3, 1.0))
  1877. ## item.ITEM_TYPE_BLEND
  1878. elif item.ITEM_TYPE_BLEND == itemType:
  1879. self.__AppendLimitInformation()
  1880. if metinSlot:
  1881. affectType = metinSlot[0]
  1882. affectValue = metinSlot[1]
  1883. time = metinSlot[2]
  1884. self.AppendSpace(5)
  1885. affectText = self.__GetAffectString(affectType, affectValue)
  1886. self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1887. if time >= 0:
  1888. minute = (time / 60)
  1889. second = (time % 60)
  1890. timeString = localeInfo.TOOLTIP_POTION_TIME
  1891. if minute >= 0:
  1892. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1893. if second >= 0:
  1894. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1895. self.AppendTextLine(timeString)
  1896. else:
  1897. self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME)
  1898. else:
  1899. self.AppendTextLine("BLEND_POTION_NO_INFO")
  1900. elif item.ITEM_TYPE_UNIQUE == itemType:
  1901. if 0 != metinSlot:
  1902. bHasRealtimeFlag = 0
  1903. for i in xrange(item.LIMIT_MAX_NUM):
  1904. (limitType, limitValue) = item.GetLimit(i)
  1905. if item.LIMIT_REAL_TIME == limitType:
  1906. bHasRealtimeFlag = 1
  1907. if 1 == bHasRealtimeFlag:
  1908. self.AppendMallItemLastTime(metinSlot[0])
  1909. else:
  1910. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1911. if 1 == item.GetValue(2):
  1912. self.AppendMallItemLastTime(time)
  1913. else:
  1914. self.AppendUniqueItemLastTime(time)
  1915. ### Use ###
  1916. elif item.ITEM_TYPE_USE == itemType:
  1917. self.__AppendLimitInformation()
  1918. if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1919. self.__AppendPotionInformation()
  1920. elif item.USE_ABILITY_UP == itemSubType:
  1921. self.__AppendAbilityPotionInformation()
  1922. if 27989 == itemVnum or 76006 == itemVnum:
  1923. if 0 != metinSlot:
  1924. useCount = int(metinSlot[0])
  1925. if (app.WJ_COMBAT_ZONE):
  1926. if itemVnum in [50287, 50288, 50290]:
  1927. if 0 != metinSlot:
  1928. useCount = int(metinSlot[0])
  1929. self.AppendSpace(5)
  1930. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % ((3 - useCount)), self.CONDITION_COLOR)
  1931. if 50027 == itemVnum:
  1932. if 0 != metinSlot:
  1933. wonCount = int(metinSlot[0])
  1934. self.AppendSpace(5)
  1935. self.AppendTextLine(localeInfo.NumberToWonString(wonCount), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  1936. if 50004 == itemVnum:
  1937. if 0 != metinSlot:
  1938. useCount = int(metinSlot[0])
  1939. self.AppendSpace(5)
  1940. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1941. if constInfo.IS_AUTO_POTION(itemVnum):
  1942. if 0 != metinSlot:
  1943. isActivated = int(metinSlot[0])
  1944. usedAmount = float(metinSlot[1])
  1945. totalAmount = float(metinSlot[2])
  1946. if 0 == totalAmount:
  1947. totalAmount = 1
  1948. self.AppendSpace(5)
  1949. if 0 != isActivated:
  1950. self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1951. self.AppendSpace(5)
  1952. if itemVnum == 27126 or itemVnum == 27127 or itemVnum == 27128 or itemVnum == 27129 or itemVnum == 27130 or itemVnum == 27131 or itemVnum == 27132 or itemVnum == 27133:
  1953. self.AppendTextLine("Kalan miktar: Sınırsız" , self.POSITIVE_COLOR)
  1954. else:
  1955. self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1956. if itemVnum in WARP_SCROLLS:
  1957. if 0 != metinSlot:
  1958. xPos = int(metinSlot[0])
  1959. yPos = int(metinSlot[1])
  1960. if xPos != 0 and yPos != 0:
  1961. (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1962. localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1963. self.AppendSpace(5)
  1964. if localeMapName!="":
  1965. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1966. else:
  1967. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1968. dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1969. if itemVnum >= 70500 and itemVnum <= 70504:
  1970. if 0 != metinSlot:
  1971. useCount = int(metinSlot[0])
  1972. self.AppendSpace(7)
  1973. self.AppendTextLine("Oyun süresi: 60/60 dak. Oyun" , self.ITEM_BUFF_RATE_COLOR)
  1974. self.AppendTextLine("süresine ulaştığında saldırı" , self.ITEM_BUFF_RATE_COLOR)
  1975. self.AppendTextLine("hasarı x1.5 artar." , self.ITEM_BUFF_RATE_COLOR)
  1976. self.AppendTextLine("Şunlarda geçerli değildir. Pvp" , self.ITEM_BUFF_TYPE_COLOR)
  1977. self.AppendTextLine("dönüşüm, binek sürmek." , self.ITEM_BUFF_TYPE_COLOR)
  1978. if 0 != useCount:
  1979. self.AppendTextLine("Efekt etkinleÅŸtirildi." , self.POSITIVE_COLOR)
  1980. elif 0 == useCount:
  1981. self.AppendTextLine("Efekt etkinleÅŸtirilmedi.", self.NEGATIVE_COLOR)
  1982. self.AppendTextLine("Kalan sınırlar : Sınırsız")
  1983. if itemVnum >= 70505 and itemVnum <= 70509:
  1984. if 0 != metinSlot:
  1985. useCount = int(metinSlot[0])
  1986. self.AppendSpace(7)
  1987. self.AppendTextLine("Oyun süresi: 60/60 dak. Oyun" , self.ITEM_BUFF_RATE_COLOR)
  1988. self.AppendTextLine("süresine ulaştığında beceri" , self.ITEM_BUFF_RATE_COLOR)
  1989. self.AppendTextLine("hasarı x1.5 artar." , self.ITEM_BUFF_RATE_COLOR)
  1990. self.AppendTextLine("Şunlarda geçerli değildir. Pvp" , self.ITEM_BUFF_TYPE_COLOR)
  1991. self.AppendTextLine("dönüşüm, binek sürmek." , self.ITEM_BUFF_TYPE_COLOR)
  1992. if 0 != useCount:
  1993. self.AppendTextLine("Efekt etkinleÅŸtirildi." , self.POSITIVE_COLOR)
  1994. elif 0 == useCount:
  1995. self.AppendTextLine("Efekt etkinleÅŸtirilmedi.", self.NEGATIVE_COLOR)
  1996. self.AppendTextLine("Kalan sınırlar : Sınırsız")
  1997. if 79000 == itemVnum:
  1998. if 0 != metinSlot:
  1999. useCount = int(metinSlot[0])
  2000. self.AppendSpace(5)
  2001. self.AppendTextLine("Kutsama Seviyesi: [MASTER]" , self.ITEM_BUFF_LEVEL_COLOR)
  2002. self.AppendTextLine("Verilen Kutsama: Bloklama" , self.ITEM_BUFF_TYPE_COLOR)
  2003. self.AppendTextLine("Kutsama Oranı: %24" , self.ITEM_BUFF_RATE_COLOR)
  2004. self.AppendTextLine("Kutsama Süresi: 164" , self.ITEM_BUFF_DURATION_COLOR)
  2005. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2006. if 79001 == itemVnum:
  2007. if 0 != metinSlot:
  2008. useCount = int(metinSlot[0])
  2009. self.AppendSpace(5)
  2010. self.AppendTextLine("Kutsama Seviyesi: [GRAND]" , self.ITEM_BUFF_LEVEL_COLOR)
  2011. self.AppendTextLine("Verilen Kutsama: Bloklama" , self.ITEM_BUFF_TYPE_COLOR)
  2012. self.AppendTextLine("Kutsama Oranı: %29" , self.ITEM_BUFF_RATE_COLOR)
  2013. self.AppendTextLine("Kutsama Süresi: 224" , self.ITEM_BUFF_DURATION_COLOR)
  2014. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2015. if 79002 == itemVnum:
  2016. if 0 != metinSlot:
  2017. useCount = int(metinSlot[0])
  2018. self.AppendSpace(5)
  2019. self.AppendTextLine("Kutsama Seviyesi: [PERFECT]" , self.ITEM_BUFF_LEVEL_COLOR)
  2020. self.AppendTextLine("Verilen Kutsama: Bloklama" , self.ITEM_BUFF_TYPE_COLOR)
  2021. self.AppendTextLine("Kutsama Oranı: %35" , self.ITEM_BUFF_RATE_COLOR)
  2022. self.AppendTextLine("Kutsama Süresi: 310" , self.ITEM_BUFF_DURATION_COLOR)
  2023. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2024. if 79003 == itemVnum:
  2025. if 0 != metinSlot:
  2026. useCount = int(metinSlot[0])
  2027. self.AppendSpace(5)
  2028. self.AppendTextLine("Kutsama Seviyesi: [MASTER]" , self.ITEM_BUFF_LEVEL_COLOR)
  2029. self.AppendTextLine("Verilen Kutsama: Kritik" , self.ITEM_BUFF_TYPE_COLOR)
  2030. self.AppendTextLine("Kutsama Oranı: %24" , self.ITEM_BUFF_RATE_COLOR)
  2031. self.AppendTextLine("Kutsama Süresi: 110" , self.ITEM_BUFF_DURATION_COLOR)
  2032. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2033. if 79004 == itemVnum:
  2034. if 0 != metinSlot:
  2035. useCount = int(metinSlot[0])
  2036. self.AppendSpace(5)
  2037. self.AppendTextLine("Kutsama Seviyesi: [GRAND]" , self.ITEM_BUFF_LEVEL_COLOR)
  2038. self.AppendTextLine("Verilen Kutsama: Kritik" , self.ITEM_BUFF_TYPE_COLOR)
  2039. self.AppendTextLine("Kutsama Oranı: %29" , self.ITEM_BUFF_RATE_COLOR)
  2040. self.AppendTextLine("Kutsama Süresi: 142" , self.ITEM_BUFF_DURATION_COLOR)
  2041. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2042. if 79005 == itemVnum:
  2043. if 0 != metinSlot:
  2044. useCount = int(metinSlot[0])
  2045. self.AppendSpace(5)
  2046. self.AppendTextLine("Kutsama Seviyesi: [PERFECT]" , self.ITEM_BUFF_LEVEL_COLOR)
  2047. self.AppendTextLine("Verilen Kutsama: Kritik" , self.ITEM_BUFF_TYPE_COLOR)
  2048. self.AppendTextLine("Kutsama Oranı: %35" , self.ITEM_BUFF_RATE_COLOR)
  2049. self.AppendTextLine("Kutsama Süresi: 185" , self.ITEM_BUFF_DURATION_COLOR)
  2050. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2051. if 79006 == itemVnum:
  2052. if 0 != metinSlot:
  2053. useCount = int(metinSlot[0])
  2054. self.AppendSpace(5)
  2055. self.AppendTextLine("Kutsama Seviyesi: [MASTER]" , self.ITEM_BUFF_LEVEL_COLOR)
  2056. self.AppendTextLine("Verilen Kutsama: Yansıtma" , self.ITEM_BUFF_TYPE_COLOR)
  2057. self.AppendTextLine("Kutsama Oranı: %21" , self.ITEM_BUFF_RATE_COLOR)
  2058. self.AppendTextLine("Kutsama Süresi: 160" , self.ITEM_BUFF_DURATION_COLOR)
  2059. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(80 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2060. if 79007 == itemVnum:
  2061. if 0 != metinSlot:
  2062. useCount = int(metinSlot[0])
  2063. self.AppendSpace(5)
  2064. self.AppendTextLine("Kutsama Seviyesi: [GRAND]" , self.ITEM_BUFF_LEVEL_COLOR)
  2065. self.AppendTextLine("Verilen Kutsama: Yansıtma" , self.ITEM_BUFF_TYPE_COLOR)
  2066. self.AppendTextLine("Kutsama Oranı: %31" , self.ITEM_BUFF_RATE_COLOR)
  2067. self.AppendTextLine("Kutsama Süresi: 224" , self.ITEM_BUFF_DURATION_COLOR)
  2068. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(60 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2069. if 79008 == itemVnum:
  2070. if 0 != metinSlot:
  2071. useCount = int(metinSlot[0])
  2072. self.AppendSpace(5)
  2073. self.AppendTextLine("Kutsama Seviyesi: [PERFECT]" , self.ITEM_BUFF_LEVEL_COLOR)
  2074. self.AppendTextLine("Verilen Kutsama: Yansıtma" , self.ITEM_BUFF_TYPE_COLOR)
  2075. self.AppendTextLine("Kutsama Oranı: %45" , self.ITEM_BUFF_RATE_COLOR)
  2076. self.AppendTextLine("Kutsama Süresi: 310" , self.ITEM_BUFF_DURATION_COLOR)
  2077. self.AppendTextLine("Kalan Kutsama Hakkı: %s " %(50 - useCount), self.ITEM_BUFF_USAGE_COLOR)
  2078. #####
  2079. if item.USE_SPECIAL == itemSubType:
  2080. bHasRealtimeFlag = 0
  2081. for i in xrange(item.LIMIT_MAX_NUM):
  2082. (limitType, limitValue) = item.GetLimit(i)
  2083. if item.LIMIT_REAL_TIME == limitType:
  2084. bHasRealtimeFlag = 1
  2085. if 1 == bHasRealtimeFlag:
  2086. self.AppendMallItemLastTime(metinSlot[0])
  2087. else:
  2088. if 0 != metinSlot:
  2089. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  2090. if 1 == item.GetValue(2):
  2091. self.AppendMallItemLastTime(time)
  2092. elif item.USE_TIME_CHARGE_PER == itemSubType:
  2093. bHasRealtimeFlag = 0
  2094. for i in xrange(item.LIMIT_MAX_NUM):
  2095. (limitType, limitValue) = item.GetLimit(i)
  2096. if item.LIMIT_REAL_TIME == limitType:
  2097. bHasRealtimeFlag = 1
  2098. if metinSlot[2]:
  2099. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  2100. else:
  2101. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  2102. if 1 == bHasRealtimeFlag:
  2103. self.AppendMallItemLastTime(metinSlot[0])
  2104. elif item.USE_TIME_CHARGE_FIX == itemSubType:
  2105. bHasRealtimeFlag = 0
  2106. for i in xrange(item.LIMIT_MAX_NUM):
  2107. (limitType, limitValue) = item.GetLimit(i)
  2108. if item.LIMIT_REAL_TIME == limitType:
  2109. bHasRealtimeFlag = 1
  2110. if metinSlot[2]:
  2111. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  2112. else:
  2113. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  2114. if 1 == bHasRealtimeFlag:
  2115. self.AppendMallItemLastTime(metinSlot[0])
  2116. elif item.ITEM_TYPE_QUEST == itemType:
  2117. if app.ENABLE_ATTENDANCE_EVENT:
  2118. if itemVnum == 71150:
  2119. self.AppendMagicEggInformation(metinSlot)
  2120. for i in xrange(item.LIMIT_MAX_NUM):
  2121. (limitType, limitValue) = item.GetLimit(i)
  2122. if item.LIMIT_REAL_TIME == limitType:
  2123. self.AppendMallItemLastTime(metinSlot[0])
  2124. elif item.ITEM_TYPE_DS == itemType:
  2125. self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  2126. self.__AppendAttributeInformation(attrSlot)
  2127. else:
  2128. self.__AppendLimitInformation()
  2129. for i in xrange(item.LIMIT_MAX_NUM):
  2130. (limitType, limitValue) = item.GetLimit(i)
  2131. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  2132. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  2133. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  2134. self.AppendTimerBasedOnWearLastTime(metinSlot)
  2135. if chr.IsGameMaster(player.GetMainCharacterIndex()):
  2136. self.AppendTextLine(localeInfo.ITEM_VNUM_TOOLTIP % (int(itemVnum)), self.SINIRSIZ_COLOR)
  2137. if app.ENABLE_MINI_GAME_CATCH_KING:
  2138. if self.itemVnum in [79603, 79604]:
  2139. if 0 != metinSlot[0]:
  2140. self.AppendMallItemLastTime(metinSlot[0])
  2141. self.ShowToolTip()
  2142. def __DragonSoulInfoString (self, dwVnum):
  2143. step = (dwVnum / 100) % 10
  2144. refine = (dwVnum / 10) % 10
  2145. if 0 == step:
  2146. return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  2147. elif 1 == step:
  2148. return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  2149. elif 2 == step:
  2150. return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  2151. elif 3 == step:
  2152. return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  2153. elif 4 == step:
  2154. return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  2155. else:
  2156. return ""
  2157. if app.ENABLE_ATTENDANCE_EVENT:
  2158. def AppendMagicEggInformation(self, metinSlot):
  2159. self.AppendSpace(5)
  2160. if metinSlot[1] == 0:
  2161. self.AppendTextLine("[ 3 Kalan ]")
  2162. else:
  2163. self.AppendTextLine("[ %d Kalan ]" % metinSlot[0])
  2164. if app.GetGlobalTimeStamp() > metinSlot[1]:
  2165. self.AppendSpace(5)
  2166. self.AppendTextLine("Mevcut")
  2167. else:
  2168. leftSec = max(0, metinSlot[1] - app.GetGlobalTimeStamp())
  2169. self.AppendSpace(5)
  2170. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec))
  2171. def __IsHair(self, itemVnum):
  2172. return (self.__IsOldHair(itemVnum) or
  2173. self.__IsNewHair(itemVnum) or
  2174. self.__IsNewHair2(itemVnum) or
  2175. self.__IsNewHair3(itemVnum) or
  2176. self.__IsCostumeHair(itemVnum)
  2177. )
  2178. def __IsOldHair(self, itemVnum):
  2179. return itemVnum > 73000 and itemVnum < 74000
  2180. def __IsNewHair(self, itemVnum):
  2181. return itemVnum > 74000 and itemVnum < 75000
  2182. def __IsNewHair2(self, itemVnum):
  2183. return itemVnum > 75000 and itemVnum < 76000
  2184. def __IsNewHair3(self, itemVnum):
  2185. return ((74012 < itemVnum and itemVnum < 74022) or
  2186. (74262 < itemVnum and itemVnum < 74272) or
  2187. (74512 < itemVnum and itemVnum < 74522) or
  2188. (74762 < itemVnum and itemVnum < 74772) or
  2189. (45000 < itemVnum and itemVnum < 47000))
  2190. def __IsCostumeHair(self, itemVnum):
  2191. return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  2192. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  2193. def __AppendPrivateSearchItemicon(self, itemVnum):
  2194. itemImage = ui.ImageBox()
  2195. itemImage.SetParent(self)
  2196. itemImage.Show()
  2197. item.SelectItem(itemVnum)
  2198. itemImage.LoadImage(item.GetIconImageFileName())
  2199. itemImage.SetPosition((self.toolTipWidth/2)-16, self.toolTipHeight)
  2200. self.toolTipHeight += itemImage.GetHeight()
  2201. self.childrenList.append(itemImage)
  2202. self.ResizeToolTip()
  2203. if app.ENABLE_ATTENDANCE_EVENT:
  2204. def __AppendAttendanceRewardItemIcon(self, itemVnum):
  2205. itemImage = ui.ImageBox()
  2206. itemImage.SetParent(self)
  2207. itemImage.Show()
  2208. item.SelectItem(itemVnum)
  2209. itemImage.LoadImage(item.GetIconImageFileName())
  2210. itemImage.SetPosition((self.toolTipWidth/2)-16, self.toolTipHeight)
  2211. self.toolTipHeight += itemImage.GetHeight()
  2212. self.childrenList.append(itemImage)
  2213. self.ResizeToolTip()
  2214. def __AppendHairIcon(self, itemVnum):
  2215. itemImage = ui.ImageBox()
  2216. itemImage.SetParent(self)
  2217. itemImage.Show()
  2218. if self.__IsOldHair(itemVnum):
  2219. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  2220. elif self.__IsNewHair3(itemVnum):
  2221. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  2222. elif self.__IsNewHair(itemVnum):
  2223. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  2224. elif self.__IsNewHair2(itemVnum):
  2225. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  2226. if app.ENABLE_PRIVATESHOP_SEARCH_SYSTEM:
  2227. if self.isPrivateSearchItem:
  2228. itemImage.SetPosition((self.toolTipWidth/2)-48, self.toolTipHeight)
  2229. else:
  2230. itemImage.SetPosition((self.toolTipWidth/2)-48, self.toolTipHeight)
  2231. else:
  2232. itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  2233. self.toolTipHeight += itemImage.GetHeight()
  2234. self.childrenList.append(itemImage)
  2235. self.ResizeToolTip()
  2236. if app.ENABLE_RENDER_TARGET_SYSTEM:
  2237. def __ModelPreview(self, Vnum, test, model):
  2238. if constInfo.DISABLE_MODEL_PREVIEW == 1:
  2239. return
  2240. RENDER_TARGET_INDEX = 1
  2241. self.ModelPreviewBoard = ui.ThinBoard()
  2242. self.ModelPreviewBoard.SetParent(self)
  2243. self.ModelPreviewBoard.SetSize(190+10, 210+30)
  2244. self.ModelPreviewBoard.SetPosition(-202, 0)
  2245. self.ModelPreviewBoard.Show()
  2246. self.ModelPreview = ui.RenderTarget()
  2247. self.ModelPreview.SetParent(self.ModelPreviewBoard)
  2248. self.ModelPreview.SetSize(190, 210)
  2249. self.ModelPreview.SetPosition(5, 22)
  2250. self.ModelPreview.SetRenderTarget(RENDER_TARGET_INDEX)
  2251. self.ModelPreview.Show()
  2252. self.ModelPreviewText = ui.TextLine()
  2253. self.ModelPreviewText.SetParent(self.ModelPreviewBoard)
  2254. self.ModelPreviewText.SetFontName(self.defFontName)
  2255. self.ModelPreviewText.SetPackedFontColor(grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0))
  2256. self.ModelPreviewText.SetPosition(0, 5)
  2257. self.ModelPreviewText.SetText("Vorschau by Volvox")
  2258. self.ModelPreviewText.SetOutline()
  2259. self.ModelPreviewText.SetFeather(False)
  2260. self.ModelPreviewText.SetWindowHorizontalAlignCenter()
  2261. self.ModelPreviewText.SetHorizontalAlignCenter()
  2262. self.ModelPreviewText.Show()
  2263. renderTarget.SetBackground(RENDER_TARGET_INDEX, "d:/ymir work/ui/game/myshop_deco/model_view_bg.sub")
  2264. renderTarget.SetVisibility(RENDER_TARGET_INDEX, True)
  2265. renderTarget.SelectModel(RENDER_TARGET_INDEX, model)
  2266. if test == 1:
  2267. renderTarget.SetHair(RENDER_TARGET_INDEX, Vnum)
  2268. elif test == 2:
  2269. renderTarget.SetArmor(RENDER_TARGET_INDEX, Vnum)
  2270. elif test == 3:
  2271. renderTarget.SetWeapon(RENDER_TARGET_INDEX, Vnum)
  2272. elif test == 4:
  2273. renderTarget.SetSash(RENDER_TARGET_INDEX, Vnum)
  2274. def __ModelPreviewClose(self):
  2275. RENDER_TARGET_INDEX = 1
  2276. if self.ModelPreviewBoard:
  2277. self.ModelPreviewBoard.Hide()
  2278. self.ModelPreview.Hide()
  2279. self.ModelPreviewText.Hide()
  2280. self.ModelPreviewBoard = None
  2281. self.ModelPreview = None
  2282. self.ModelPreviewText = None
  2283. renderTarget.SetVisibility(RENDER_TARGET_INDEX, False)
  2284. def __ItemGetRace(self):
  2285. race = 0
  2286. if item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN):
  2287. race = 9
  2288. elif item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN):
  2289. race = 1
  2290. elif item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) and item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN):
  2291. race = 2
  2292. elif item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) and item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA):
  2293. race = 3
  2294. sex = chr.RaceToSex(player.GetRace())
  2295. MALE = 1
  2296. FEMALE = 0
  2297. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  2298. race = player.GetRace() + 4
  2299. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  2300. race = player.GetRace()
  2301. if race == 0:
  2302. race = player.GetRace()
  2303. if race == 9:
  2304. race = 0
  2305. return race
  2306. def __AdjustMaxWidth(self, attrSlot, desc):
  2307. newToolTipWidth = self.toolTipWidth
  2308. newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  2309. newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  2310. if newToolTipWidth > self.toolTipWidth:
  2311. self.toolTipWidth = newToolTipWidth
  2312. self.ResizeToolTip()
  2313. def __AdjustAttrMaxWidth(self, attrSlot):
  2314. if 0 == attrSlot:
  2315. return self.toolTipWidth
  2316. maxWidth = self.toolTipWidth
  2317. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  2318. type = attrSlot[i][0]
  2319. value = attrSlot[i][1]
  2320. if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  2321. if value > 0:
  2322. maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  2323. return maxWidth
  2324. def __AdjustDescMaxWidth(self, desc):
  2325. if len(desc) < DESC_DEFAULT_MAX_COLS:
  2326. return self.toolTipWidth
  2327. return DESC_WESTERN_MAX_WIDTH
  2328. def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  2329. skillName = skill.GetSkillName(skillIndex)
  2330. if not skillName:
  2331. return
  2332. if localeInfo.IsVIETNAM():
  2333. itemName = bookName + " " + skillName
  2334. else:
  2335. itemName = skillName + " " + bookName
  2336. self.SetTitle(itemName)
  2337. def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  2338. self.AppendSpace(5)
  2339. self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  2340. self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  2341. if curEXP == maxEXP:
  2342. self.AppendSpace(5)
  2343. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  2344. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  2345. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  2346. def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  2347. self.AppendSpace(5)
  2348. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  2349. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  2350. if curEXP == maxEXP:
  2351. self.AppendSpace(5)
  2352. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  2353. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  2354. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  2355. def __AppendLimitInformation(self):
  2356. if app.ENABLE_ATTENDANCE_EVENT:
  2357. if self.isAttendanceRewardItem:
  2358. return
  2359. appendSpace = False
  2360. for i in xrange(item.LIMIT_MAX_NUM):
  2361. (limitType, limitValue) = item.GetLimit(i)
  2362. if limitValue > 0:
  2363. if FALSE == appendSpace:
  2364. self.AppendSpace(5)
  2365. appendSpace = TRUE
  2366. else:
  2367. continue
  2368. if item.LIMIT_LEVEL == limitType:
  2369. color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  2370. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  2371. def __AppendSealInformation(self, window_type, slotIndex):
  2372. if window_type == player.SAFEBOX:
  2373. if safebox.GetItemBind(slotIndex) <= 1:
  2374. itemSoulTime = safebox.GetItemBind(slotIndex)
  2375. else:
  2376. itemSoulTime = max(0, safebox.GetItemBind(slotIndex) - app.GetGlobalTimeStamp())
  2377. elif window_type == player.MALL:
  2378. if safebox.GetMallItemBind(slotIndex) <= 1:
  2379. itemSoulTime = safebox.GetMallItemBind(slotIndex)
  2380. else:
  2381. itemSoulTime = max(0, safebox.GetMallItemBind(slotIndex) - app.GetGlobalTimeStamp())
  2382. elif window_type == player.INVENTORY:
  2383. if player.GetItemBind(slotIndex) <= 1:
  2384. itemSoulTime = player.GetItemBind(slotIndex)
  2385. else:
  2386. itemSoulTime = max(0, player.GetItemBind(slotIndex) - app.GetGlobalTimeStamp())
  2387. else:
  2388. return
  2389. if itemSoulTime == 0:
  2390. return
  2391. elif itemSoulTime == 1:
  2392. self.AppendSpace(5)
  2393. self.AppendTextLine(localeInfo.TOOLTIP_SEALED, self.NEGATIVE_COLOR)
  2394. elif itemSoulTime > 1:
  2395. self.AppendSpace(5)
  2396. hrs = itemSoulTime / 3600
  2397. itemSoulTime -= 3600 * hrs
  2398. mins = itemSoulTime / 60
  2399. itemSoulTime -= 60 * mins
  2400. self.AppendTextLine(localeInfo.TOOLTIP_UNSEAL_LEFT_TIME % (hrs, mins), self.NEGATIVE_COLOR)
  2401. def __GetAffectString(self, affectType, affectValue):
  2402. if 0 == affectType:
  2403. return None
  2404. if 0 == affectValue:
  2405. return None
  2406. try:
  2407. return self.AFFECT_DICT[affectType](affectValue)
  2408. except TypeError:
  2409. return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  2410. except KeyError:
  2411. return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  2412. def __AppendAffectInformation(self):
  2413. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2414. (affectType, affectValue) = item.GetAffect(i)
  2415. affectString = self.__GetAffectString(affectType, affectValue)
  2416. if affectString:
  2417. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2418. def AppendWearableInformation(self):
  2419. itemType = item.GetItemType()
  2420. self.AppendSpace(5)
  2421. if item.ITEM_TYPE_WEAPON == itemType or item.ITEM_TYPE_ARMOR == itemType or item.ARMOR_FOOTS == itemType or item.ARMOR_NECK == itemType or item.ARMOR_EAR == itemType:
  2422. self.AppendTextLine("Bir ekstra bonus ekleyebilirsin.",self.SINIRSIZ_COLOR)
  2423. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  2424. flagList = (
  2425. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  2426. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  2427. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  2428. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN),
  2429. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WOLFMAN)
  2430. )
  2431. characterNames = ""
  2432. for i in xrange(self.CHARACTER_COUNT):
  2433. name = self.CHARACTER_NAMES[i]
  2434. flag = flagList[i]
  2435. if flag:
  2436. characterNames += " "
  2437. characterNames += name
  2438. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, TRUE)
  2439. textLine.SetFeather()
  2440. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  2441. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, TRUE)
  2442. textLine.SetFeather()
  2443. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  2444. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, TRUE)
  2445. textLine.SetFeather()
  2446. def __AppendPotionInformation(self):
  2447. self.AppendSpace(5)
  2448. healHP = item.GetValue(0)
  2449. healSP = item.GetValue(1)
  2450. healStatus = item.GetValue(2)
  2451. healPercentageHP = item.GetValue(3)
  2452. healPercentageSP = item.GetValue(4)
  2453. if healHP > 0:
  2454. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  2455. if healSP > 0:
  2456. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  2457. if healStatus != 0:
  2458. self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  2459. if healPercentageHP > 0:
  2460. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  2461. if healPercentageSP > 0:
  2462. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  2463. def __AppendAbilityPotionInformation(self):
  2464. self.AppendSpace(5)
  2465. abilityType = item.GetValue(0)
  2466. time = item.GetValue(1)
  2467. point = item.GetValue(2)
  2468. if abilityType == item.APPLY_ATT_SPEED:
  2469. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  2470. elif abilityType == item.APPLY_MOV_SPEED:
  2471. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  2472. if time > 0:
  2473. minute = (time / 60)
  2474. second = (time % 60)
  2475. timeString = localeInfo.TOOLTIP_POTION_TIME
  2476. if minute > 0:
  2477. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  2478. if second > 0:
  2479. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  2480. self.AppendTextLine(timeString)
  2481. def GetPriceColor(self, price):
  2482. if price>=constInfo.HIGH_PRICE:
  2483. return self.HIGH_PRICE_COLOR
  2484. if price>=constInfo.MIDDLE_PRICE:
  2485. return self.MIDDLE_PRICE_COLOR
  2486. else:
  2487. return self.LOW_PRICE_COLOR
  2488. def AppendPrice(self, price):
  2489. self.AppendSpace(5)
  2490. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2491. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  2492. def AppendPriceCheque(self, price):
  2493. self.AppendSpace(5)
  2494. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2495. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToChequeString(price)), self.GetPriceColor(price))
  2496. def AppendChequeDesk(self, price):
  2497. self.AppendSpace(5)
  2498. self.AppendTextLine(localeInfo.NumberToChequeString(price), self.SHOP_ITEM_COLOR)
  2499. if app.ENABLE_12ZI:
  2500. def AppendLimitedCount(self, count, purchaseCount):
  2501. self.AppendSpace(5)
  2502. self.AppendTextLine(localeInfo.SHOP_LIMITED_ITEM_REMAIN_COUNT % (count-purchaseCount), grp.GenerateColor(1.0, 1.0, 1.0, 1.0))
  2503. def RefreshShopToolTip(self):
  2504. if self.IsShow() and self.isShopItem:
  2505. self.SetShopItem(self.ShopSlotIndex)
  2506. def AppendLimitedCountChequeDesk(self, purchaseCount, mystok):
  2507. self.AppendTextLineNew(localeInfo.SHOP_LIMITED_ITEM_REMAIN_COUNT % (purchaseCount), grp.GenerateColor(1.0, 1.0, 1.0, 1.0))
  2508. self.AppendTextLineNew(localeInfo.SHOP_LIMITED_ITEM_REMAIN_COUNT_2 % (mystok), grp.GenerateColor(1.0, 1.0, 1.0, 1.0))
  2509. def AppendLimitedCountChequeDeskZodiac(self, purchaseCount):
  2510. self.AppendTextLineNew(localeInfo.SHOP_LIMITED_ITEM_REMAIN_COUNT % (purchaseCount), grp.GenerateColor(1.0, 1.0, 1.0, 1.0))
  2511. if app.ENABLE_BUY_WITH_ITEM:
  2512. def AppendPrice_WithItem(self, price, itemVnum, itemName):
  2513. self.AppendSpace(5)
  2514. self.AppendTextLine("[Nesne ile satın alınabilir.]" , self.SHOP_ITEM_COLOR)
  2515. item.SelectItem(itemVnum)
  2516. eklenecekIcon = item.GetIconImageFileName()
  2517. self.AppendTextLine_WithItem((localeInfo.NumberToWithItemString(price, itemName)), eklenecekIcon, self.GetPriceColor(price))
  2518. def AppendTextLine_WithItem(self, text, image, color = FONT_COLOR):
  2519. ayraC = text.split("|")
  2520. resimdenOnce, resimdenSonra = (ayraC[0], ayraC[1])
  2521. textLine = ui.TextLine()
  2522. textLine.SetParent(self)
  2523. textLine.SetFontName(self.defFontName)
  2524. textLine.SetPackedFontColor(color)
  2525. textLine.SetText(resimdenOnce)
  2526. textLine.SetOutline()
  2527. textLine.SetFeather(FALSE)
  2528. itemIcon = ui.ImageBox()
  2529. itemIcon.SetParent(self)
  2530. itemIcon.LoadImage(image)
  2531. textLine2 = ui.TextLine()
  2532. textLine2.SetParent(self)
  2533. textLine2.SetFontName(self.defFontName)
  2534. textLine2.SetPackedFontColor(color)
  2535. textLine2.SetText(resimdenSonra)
  2536. textLine2.SetOutline()
  2537. textLine2.SetFeather(FALSE)
  2538. textLine.Show()
  2539. itemIcon.Show()
  2540. textLine2.Show()
  2541. baslangicX_a = self.GetWidth() / 2 - 75
  2542. baslangicX_b = textLine.GetTextSize()[0]
  2543. baslangicX_c = itemIcon.GetWidth()
  2544. textLine.SetPosition(baslangicX_a, self.toolTipHeight+6)
  2545. itemIcon.SetPosition(baslangicX_a + baslangicX_b, self.toolTipHeight)
  2546. textLine2.SetPosition(baslangicX_a + baslangicX_b + baslangicX_c, self.toolTipHeight+6)
  2547. self.childrenList.append(textLine)
  2548. self.childrenList.append(itemIcon)
  2549. self.childrenList.append(textLine2)
  2550. self.toolTipHeight += itemIcon.GetHeight()
  2551. self.ResizeToolTip()
  2552. return textLine
  2553. return itemIcon
  2554. return textLine2
  2555. def AppendPriceBySecondaryCoin(self, price):
  2556. self.AppendSpace(5)
  2557. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2558. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  2559. def AppendSellingPrice(self, price):
  2560. if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
  2561. self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  2562. self.AppendSpace(5)
  2563. else:
  2564. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE1 , self.SHOP_ITEM_COLOR)
  2565. self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  2566. self.AppendSpace(5)
  2567. def AppendMetinInformation(self):
  2568. affectType, affectValue = item.GetAffect(0)
  2569. affectString = self.__GetAffectString(affectType, affectValue)
  2570. if affectString:
  2571. self.AppendSpace(5)
  2572. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2573. def AppendMetinWearInformation(self):
  2574. self.AppendSpace(5)
  2575. self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  2576. flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  2577. item.IsWearableFlag(item.WEARABLE_HEAD),
  2578. item.IsWearableFlag(item.WEARABLE_FOOTS),
  2579. item.IsWearableFlag(item.WEARABLE_WRIST),
  2580. item.IsWearableFlag(item.WEARABLE_WEAPON),
  2581. item.IsWearableFlag(item.WEARABLE_NECK),
  2582. item.IsWearableFlag(item.WEARABLE_EAR),
  2583. item.IsWearableFlag(item.WEARABLE_UNIQUE),
  2584. item.IsWearableFlag(item.WEARABLE_SHIELD),
  2585. item.IsWearableFlag(item.WEARABLE_ARROW))
  2586. wearNames = ""
  2587. for i in xrange(self.WEAR_COUNT):
  2588. name = self.WEAR_NAMES[i]
  2589. flag = flagList[i]
  2590. if flag:
  2591. wearNames += " "
  2592. wearNames += name
  2593. textLine = ui.TextLine()
  2594. textLine.SetParent(self)
  2595. textLine.SetFontName(self.defFontName)
  2596. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  2597. textLine.SetHorizontalAlignCenter()
  2598. textLine.SetPackedFontColor(self.NORMAL_COLOR)
  2599. textLine.SetText(wearNames)
  2600. textLine.Show()
  2601. self.childrenList.append(textLine)
  2602. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  2603. self.ResizeToolTip()
  2604. def GetMetinSocketType(self, number):
  2605. if player.METIN_SOCKET_TYPE_NONE == number:
  2606. return player.METIN_SOCKET_TYPE_NONE
  2607. elif player.METIN_SOCKET_TYPE_SILVER == number:
  2608. return player.METIN_SOCKET_TYPE_SILVER
  2609. elif player.METIN_SOCKET_TYPE_GOLD == number:
  2610. return player.METIN_SOCKET_TYPE_GOLD
  2611. else:
  2612. item.SelectItem(number)
  2613. if item.METIN_NORMAL == item.GetItemSubType():
  2614. return player.METIN_SOCKET_TYPE_SILVER
  2615. elif item.METIN_GOLD == item.GetItemSubType():
  2616. return player.METIN_SOCKET_TYPE_GOLD
  2617. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  2618. return player.METIN_SOCKET_TYPE_SILVER
  2619. elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  2620. return player.METIN_SOCKET_TYPE_SILVER
  2621. elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  2622. return player.METIN_SOCKET_TYPE_SILVER
  2623. return player.METIN_SOCKET_TYPE_NONE
  2624. def GetMetinItemIndex(self, number):
  2625. if player.METIN_SOCKET_TYPE_SILVER == number:
  2626. return 0
  2627. if player.METIN_SOCKET_TYPE_GOLD == number:
  2628. return 0
  2629. return number
  2630. def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
  2631. ACCESSORY_SOCKET_MAX_SIZE = 3
  2632. cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  2633. end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  2634. affectType1, affectValue1 = item.GetAffect(0)
  2635. affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  2636. affectType2, affectValue2 = item.GetAffect(1)
  2637. affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  2638. mtrlPos=0
  2639. mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  2640. for mtrl in mtrlList:
  2641. affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
  2642. affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  2643. leftTime = 0
  2644. if cur == mtrlPos+1:
  2645. leftTime=metinSlot[2]
  2646. self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  2647. mtrlPos+=1
  2648. def __AppendMetinSlotInfo(self, metinSlot):
  2649. if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  2650. return
  2651. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2652. self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  2653. def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  2654. if 0 == metinSlot:
  2655. return 1
  2656. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2657. metinSlotData=metinSlot[i]
  2658. if 0 != self.GetMetinSocketType(metinSlotData):
  2659. if 0 != self.GetMetinItemIndex(metinSlotData):
  2660. return 0
  2661. return 1
  2662. def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  2663. slotType = self.GetMetinSocketType(metinSlotData)
  2664. itemIndex = self.GetMetinItemIndex(metinSlotData)
  2665. if 0 == slotType:
  2666. return
  2667. self.AppendSpace(5)
  2668. slotImage = ui.ImageBox()
  2669. slotImage.SetParent(self)
  2670. slotImage.Show()
  2671. nameTextLine = ui.TextLine()
  2672. nameTextLine.SetParent(self)
  2673. nameTextLine.SetFontName(self.defFontName)
  2674. nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  2675. nameTextLine.SetOutline()
  2676. nameTextLine.SetFeather()
  2677. nameTextLine.Show()
  2678. self.childrenList.append(nameTextLine)
  2679. if player.METIN_SOCKET_TYPE_SILVER == slotType:
  2680. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  2681. elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  2682. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  2683. self.childrenList.append(slotImage)
  2684. if localeInfo.IsARABIC():
  2685. slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  2686. nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  2687. else:
  2688. slotImage.SetPosition(9, self.toolTipHeight-1)
  2689. nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  2690. metinImage = ui.ImageBox()
  2691. metinImage.SetParent(self)
  2692. metinImage.Show()
  2693. self.childrenList.append(metinImage)
  2694. if itemIndex:
  2695. item.SelectItem(itemIndex)
  2696. try:
  2697. metinImage.LoadImage(item.GetIconImageFileName())
  2698. except:
  2699. dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  2700. (itemIndex, item.GetIconImageFileName())
  2701. )
  2702. nameTextLine.SetText(item.GetItemName())
  2703. affectTextLine = ui.TextLine()
  2704. affectTextLine.SetParent(self)
  2705. affectTextLine.SetFontName(self.defFontName)
  2706. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2707. affectTextLine.SetOutline()
  2708. affectTextLine.SetFeather()
  2709. affectTextLine.Show()
  2710. if localeInfo.IsARABIC():
  2711. metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  2712. affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  2713. else:
  2714. metinImage.SetPosition(10, self.toolTipHeight)
  2715. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  2716. if custumAffectString:
  2717. affectTextLine.SetText(custumAffectString)
  2718. elif itemIndex!=constInfo.ERROR_METIN_STONE:
  2719. affectType, affectValue = item.GetAffect(0)
  2720. affectString = self.__GetAffectString(affectType, affectValue)
  2721. if affectString:
  2722. affectTextLine.SetText(affectString)
  2723. else:
  2724. affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  2725. self.childrenList.append(affectTextLine)
  2726. if custumAffectString2:
  2727. affectTextLine = ui.TextLine()
  2728. affectTextLine.SetParent(self)
  2729. affectTextLine.SetFontName(self.defFontName)
  2730. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2731. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2732. affectTextLine.SetOutline()
  2733. affectTextLine.SetFeather()
  2734. affectTextLine.Show()
  2735. affectTextLine.SetText(custumAffectString2)
  2736. self.childrenList.append(affectTextLine)
  2737. self.toolTipHeight += 16 + 2
  2738. if 0 != leftTime:
  2739. timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  2740. timeTextLine = ui.TextLine()
  2741. timeTextLine.SetParent(self)
  2742. timeTextLine.SetFontName(self.defFontName)
  2743. timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  2744. timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  2745. timeTextLine.SetOutline()
  2746. timeTextLine.SetFeather()
  2747. timeTextLine.Show()
  2748. timeTextLine.SetText(timeText)
  2749. self.childrenList.append(timeTextLine)
  2750. self.toolTipHeight += 16 + 2
  2751. else:
  2752. nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  2753. self.toolTipHeight += 35
  2754. self.ResizeToolTip()
  2755. def __AppendFishInfo(self, size):
  2756. if size > 0:
  2757. self.AppendSpace(5)
  2758. self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  2759. def AppendUniqueItemLastTime(self, restMin):
  2760. if app.ENABLE_ATTENDANCE_EVENT:
  2761. if self.isAttendanceRewardItem:
  2762. return
  2763. restSecond = restMin*60
  2764. self.AppendSpace(5)
  2765. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  2766. def AppendMallItemLastTime(self, endTime):
  2767. if app.ENABLE_ATTENDANCE_EVENT:
  2768. if self.isAttendanceRewardItem:
  2769. return
  2770. leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  2771. self.AppendSpace(5)
  2772. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  2773. def AppendTimerBasedOnWearLastTime(self, metinSlot):
  2774. if app.ENABLE_ATTENDANCE_EVENT:
  2775. if self.isAttendanceRewardItem:
  2776. return
  2777. if 0 == metinSlot[0]:
  2778. self.AppendSpace(5)
  2779. self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  2780. else:
  2781. endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  2782. self.AppendMallItemLastTime(endTime)
  2783. def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):
  2784. if app.ENABLE_ATTENDANCE_EVENT:
  2785. if self.isAttendanceRewardItem:
  2786. return
  2787. if metinSlot != 0:
  2788. useCount = metinSlot[1]
  2789. endTime = metinSlot[0]
  2790. if 0 == useCount:
  2791. if 0 == endTime:
  2792. (limitType, limitValue) = item.GetLimit(limitIndex)
  2793. endTime = limitValue
  2794. endTime += app.GetGlobalTimeStamp()
  2795. self.AppendMallItemLastTime(endTime)
  2796. if app.ENABLE_SASH_SYSTEM:
  2797. def SetSashResultItem(self, slotIndex, window_type = player.INVENTORY):
  2798. (itemVnum, MinAbs, MaxAbs) = sash.GetResultItem()
  2799. if not itemVnum:
  2800. return
  2801. self.ClearToolTip()
  2802. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2803. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2804. item.SelectItem(itemVnum)
  2805. itemType = item.GetItemType()
  2806. itemSubType = item.GetItemSubType()
  2807. if itemType != item.ITEM_TYPE_COSTUME and itemSubType != item.COSTUME_TYPE_SASH:
  2808. return
  2809. absChance = MaxAbs
  2810. itemDesc = item.GetItemDescription()
  2811. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2812. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  2813. self.AppendDescription(itemDesc, 26)
  2814. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  2815. self.__AppendLimitInformation()
  2816. if MinAbs == MaxAbs:
  2817. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (MinAbs), self.CONDITION_COLOR)
  2818. else:
  2819. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE2 % (MinAbs, MaxAbs), self.CONDITION_COLOR)
  2820. itemAbsorbedVnum = int(metinSlot[sash.ABSORBED_SOCKET])
  2821. if itemAbsorbedVnum:
  2822. item.SelectItem(itemAbsorbedVnum)
  2823. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  2824. if item.GetItemSubType() == item.WEAPON_FAN:
  2825. self.__AppendMagicAttackInfo(absChance)
  2826. item.SelectItem(itemAbsorbedVnum)
  2827. self.__AppendAttackPowerInfo(absChance)
  2828. else:
  2829. self.__AppendAttackPowerInfo(absChance)
  2830. item.SelectItem(itemAbsorbedVnum)
  2831. self.__AppendMagicAttackInfo(absChance)
  2832. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2833. defGrade = item.GetValue(1)
  2834. defBonus = item.GetValue(5) * 2
  2835. defGrade = self.CalcSashValue(defGrade, absChance)
  2836. defBonus = self.CalcSashValue(defBonus, absChance)
  2837. if defGrade > 0:
  2838. self.AppendSpace(5)
  2839. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  2840. item.SelectItem(itemAbsorbedVnum)
  2841. self.__AppendMagicDefenceInfo(absChance)
  2842. item.SelectItem(itemAbsorbedVnum)
  2843. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2844. (affectType, affectValue) = item.GetAffect(i)
  2845. affectValue = self.CalcSashValue(affectValue, absChance)
  2846. affectString = self.__GetAffectString(affectType, affectValue)
  2847. if affectString and affectValue > 0:
  2848. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2849. item.SelectItem(itemAbsorbedVnum)
  2850. item.SelectItem(itemVnum)
  2851. self.__AppendAttributeInformation(attrSlot, MaxAbs)
  2852. self.AppendWearableInformation()
  2853. self.ShowToolTip()
  2854. def SetSashResultAbsItem(self, slotIndex1, slotIndex2, window_type = player.INVENTORY):
  2855. itemVnumSash = player.GetItemIndex(window_type, slotIndex1)
  2856. itemVnumTarget = player.GetItemIndex(window_type, slotIndex2)
  2857. if not itemVnumSash or not itemVnumTarget:
  2858. return
  2859. self.ClearToolTip()
  2860. item.SelectItem(itemVnumSash)
  2861. itemType = item.GetItemType()
  2862. itemSubType = item.GetItemSubType()
  2863. if itemType != item.ITEM_TYPE_COSTUME and itemSubType != item.COSTUME_TYPE_SASH:
  2864. return
  2865. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex1, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2866. attrSlot = [player.GetItemAttribute(window_type, slotIndex2, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2867. itemDesc = item.GetItemDescription()
  2868. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2869. self.__SetItemTitle(itemVnumSash, metinSlot, attrSlot)
  2870. self.AppendDescription(itemDesc, 26)
  2871. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  2872. item.SelectItem(itemVnumSash)
  2873. self.__AppendLimitInformation()
  2874. self.AppendTextLine(localeInfo.SASH_ABSORB_CHANCE % (metinSlot[sash.ABSORPTION_SOCKET]), self.CONDITION_COLOR)
  2875. itemAbsorbedVnum = itemVnumTarget
  2876. item.SelectItem(itemAbsorbedVnum)
  2877. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  2878. if item.GetItemSubType() == item.WEAPON_FAN:
  2879. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2880. item.SelectItem(itemAbsorbedVnum)
  2881. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2882. else:
  2883. self.__AppendAttackPowerInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2884. item.SelectItem(itemAbsorbedVnum)
  2885. self.__AppendMagicAttackInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2886. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2887. defGrade = item.GetValue(1)
  2888. defBonus = item.GetValue(5) * 2
  2889. defGrade = self.CalcSashValue(defGrade, metinSlot[sash.ABSORPTION_SOCKET])
  2890. defBonus = self.CalcSashValue(defBonus, metinSlot[sash.ABSORPTION_SOCKET])
  2891. if defGrade > 0:
  2892. self.AppendSpace(5)
  2893. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  2894. item.SelectItem(itemAbsorbedVnum)
  2895. self.__AppendMagicDefenceInfo(metinSlot[sash.ABSORPTION_SOCKET])
  2896. item.SelectItem(itemAbsorbedVnum)
  2897. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  2898. (affectType, affectValue) = item.GetAffect(i)
  2899. affectValue = self.CalcSashValue(affectValue, metinSlot[sash.ABSORPTION_SOCKET])
  2900. affectString = self.__GetAffectString(affectType, affectValue)
  2901. if affectString and affectValue > 0:
  2902. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  2903. item.SelectItem(itemAbsorbedVnum)
  2904. item.SelectItem(itemAbsorbedVnum)
  2905. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  2906. type = attrSlot[i][0]
  2907. value = attrSlot[i][1]
  2908. if not value:
  2909. continue
  2910. value = self.CalcSashValue(value, metinSlot[sash.ABSORPTION_SOCKET])
  2911. affectString = self.__GetAffectString(type, value)
  2912. if affectString and value > 0:
  2913. affectColor = self.__GetAttributeColor(i, value)
  2914. self.AppendTextLine(affectString, affectColor)
  2915. item.SelectItem(itemAbsorbedVnum)
  2916. item.SelectItem(itemVnumSash)
  2917. self.AppendSpace(5)
  2918. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  2919. item.SelectItem(itemVnumSash)
  2920. flagList = (
  2921. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  2922. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  2923. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  2924. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN)
  2925. )
  2926. flagList += (not item.IsAntiFlag(item.ITEM_ANTIFLAG_WOLFMAN),)
  2927. characterNames = ""
  2928. for i in xrange(self.CHARACTER_COUNT):
  2929. name = self.CHARACTER_NAMES[i]
  2930. flag = flagList[i]
  2931. if flag:
  2932. characterNames += " "
  2933. characterNames += name
  2934. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  2935. textLine.SetFeather()
  2936. item.SelectItem(itemVnumSash)
  2937. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  2938. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  2939. textLine.SetFeather()
  2940. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  2941. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  2942. textLine.SetFeather()
  2943. self.ShowToolTip()
  2944. if app.ENABLE_CHANGELOOK_SYSTEM:
  2945. def AppendTransmutation(self, window_type, slotIndex, transmutation):
  2946. itemVnum = 0
  2947. if transmutation == -1:
  2948. if window_type == player.INVENTORY:
  2949. itemVnum = player.GetItemTransmutation(window_type, slotIndex)
  2950. elif window_type == player.SAFEBOX:
  2951. itemVnum = safebox.GetItemTransmutation(slotIndex)
  2952. elif window_type == player.MALL:
  2953. itemVnum = safebox.GetMallItemTransmutation(slotIndex)
  2954. else:
  2955. itemVnum = transmutation
  2956. if not itemVnum:
  2957. return
  2958. item.SelectItem(itemVnum)
  2959. itemName = item.GetItemName()
  2960. if not itemName or itemName == "":
  2961. return
  2962. self.AppendSpace(5)
  2963. title = "[ " + localeInfo.CHANGE_LOOK_TITLE + " ]"
  2964. self.AppendTextLine(title, self.BEFORE_LOOK_COLOR)
  2965. textLine = self.AppendTextLine(itemName, self.UNDER_LOOK_COLOR, True)
  2966. textLine.SetFeather()
  2967. def AppendChangeLookInfoPrivateShopWIndow(self, slotIndex):
  2968. transmutation = privateShopSearch.GetSearchItemTransmutation(slotIndex)
  2969. itemVnum = transmutation
  2970. if not itemVnum:
  2971. return
  2972. item.SelectItem(itemVnum)
  2973. itemName = item.GetItemName()
  2974. if not itemName or itemName == "":
  2975. return
  2976. self.AppendSpace(5)
  2977. title = "[ " + localeInfo.CHANGE_LOOK_TITLE + " ]"
  2978. self.AppendTextLine(title, self.BEFORE_LOOK_COLOR)
  2979. textLine = self.AppendTextLine(itemName, self.UNDER_LOOK_COLOR, True)
  2980. textLine.SetFeather()
  2981. if app.ENABLE_AURA_SYSTEM:
  2982. def SetAuraResultItem(self, slotIndex, window_type = player.INVENTORY):
  2983. (itemVnum, MinAbs, MaxAbs) = aura.GetResultItem()
  2984. if not itemVnum:
  2985. return
  2986. self.ClearToolTip()
  2987. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  2988. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  2989. item.SelectItem(itemVnum)
  2990. itemType = item.GetItemType()
  2991. itemSubType = item.GetItemSubType()
  2992. if itemType != item.ITEM_TYPE_COSTUME and itemSubType != item.COSTUME_TYPE_AURA:
  2993. return
  2994. absChance = float(MinAbs) / 10.0
  2995. itemDesc = item.GetItemDescription()
  2996. self.__AdjustMaxWidth(attrSlot, itemDesc)
  2997. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  2998. self.AppendDescription(itemDesc, 26)
  2999. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  3000. self.__AppendLimitInformation()
  3001. ## ABSORPTION RATE
  3002. self.AppendTextLine(localeInfo.AURA_LEVEL_STEP % (int(metinSlot[aura.LEVEL_SOCKET]), int(metinSlot[aura.LEVEL_SOCKET])), self.CONDITION_COLOR)
  3003. self.AppendTextLine(localeInfo.AURA_DRAIN_PER % (absChance), self.CONDITION_COLOR)
  3004. ## END ABSOPRTION RATE
  3005. itemAbsorbedVnum = int(metinSlot[aura.ABSORBED_SOCKET])
  3006. if itemAbsorbedVnum:
  3007. ## ATTACK / DEFENCE
  3008. item.SelectItem(itemAbsorbedVnum)
  3009. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  3010. if item.GetItemSubType() == item.WEAPON_FAN:
  3011. self.__AppendMagicAttackInfo(absChance)
  3012. item.SelectItem(itemAbsorbedVnum)
  3013. self.__AppendAttackPowerInfo(absChance)
  3014. else:
  3015. self.__AppendAttackPowerInfo(absChance)
  3016. item.SelectItem(itemAbsorbedVnum)
  3017. self.__AppendMagicAttackInfo(absChance)
  3018. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  3019. defGrade = item.GetValue(1)
  3020. defBonus = item.GetValue(5) * 2
  3021. defGrade = self.CalcSashValue(defGrade, absChance)
  3022. defBonus = self.CalcSashValue(defBonus, absChance)
  3023. if defGrade > 0:
  3024. self.AppendSpace(5)
  3025. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  3026. item.SelectItem(itemAbsorbedVnum)
  3027. self.__AppendMagicDefenceInfo(absChance)
  3028. ## END ATTACK / DEFENCE
  3029. ## EFFECT
  3030. item.SelectItem(itemAbsorbedVnum)
  3031. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  3032. (affectType, affectValue) = item.GetAffect(i)
  3033. affectValue = self.CalcSashValue(affectValue, absChance)
  3034. affectString = self.__GetAffectString(affectType, affectValue)
  3035. if affectString and affectValue > 0:
  3036. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  3037. item.SelectItem(itemAbsorbedVnum)
  3038. # END EFFECT
  3039. item.SelectItem(itemVnum)
  3040. ## ATTR
  3041. self.__AppendAttributeInformation(attrSlot, MaxAbs)
  3042. # END ATTR
  3043. self.AppendWearableInformation()
  3044. self.ShowToolTip()
  3045. def SetAuraResultAbsItem(self, slotIndex1, slotIndex2, window_type = player.INVENTORY):
  3046. itemVnumAura = player.GetItemIndex(window_type, slotIndex1)
  3047. itemVnumTarget = player.GetItemIndex(window_type, slotIndex2)
  3048. if not itemVnumAura or not itemVnumTarget:
  3049. return
  3050. self.ClearToolTip()
  3051. item.SelectItem(itemVnumAura)
  3052. itemType = item.GetItemType()
  3053. itemSubType = item.GetItemSubType()
  3054. if itemType != item.ITEM_TYPE_COSTUME and itemSubType != item.COSTUME_TYPE_AURA:
  3055. return
  3056. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex1, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  3057. attrSlot = [player.GetItemAttribute(window_type, slotIndex2, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  3058. itemDesc = item.GetItemDescription()
  3059. self.__AdjustMaxWidth(attrSlot, itemDesc)
  3060. self.__SetItemTitle(itemVnumAura, metinSlot, attrSlot)
  3061. self.AppendDescription(itemDesc, 26)
  3062. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  3063. item.SelectItem(itemVnumAura)
  3064. self.__AppendLimitInformation()
  3065. absChance = float(metinSlot[aura.ABSORPTION_SOCKET]) / 10.0
  3066. ## ABSORPTION RATE
  3067. self.AppendTextLine(localeInfo.AURA_LEVEL_STEP % (int(metinSlot[aura.LEVEL_SOCKET]), int(metinSlot[aura.LEVEL_SOCKET])), self.CONDITION_COLOR)
  3068. self.AppendTextLine(localeInfo.AURA_DRAIN_PER % (absChance), self.CONDITION_COLOR)
  3069. ## END ABSOPRTION RATE
  3070. ## ATTACK / DEFENCE
  3071. itemAbsorbedVnum = itemVnumTarget
  3072. item.SelectItem(itemAbsorbedVnum)
  3073. if item.GetItemType() == item.ITEM_TYPE_WEAPON:
  3074. if item.GetItemSubType() == item.WEAPON_FAN:
  3075. self.__AppendMagicAttackInfo(absChance)
  3076. item.SelectItem(itemAbsorbedVnum)
  3077. self.__AppendAttackPowerInfo(absChance)
  3078. else:
  3079. self.__AppendAttackPowerInfo(absChance)
  3080. item.SelectItem(itemAbsorbedVnum)
  3081. self.__AppendMagicAttackInfo(absChance)
  3082. elif item.GetItemType() == item.ITEM_TYPE_ARMOR:
  3083. defGrade = item.GetValue(1)
  3084. defBonus = item.GetValue(5) * 2
  3085. defGrade = self.CalcSashValue(defGrade, absChance)
  3086. defBonus = self.CalcSashValue(defBonus, absChance)
  3087. if defGrade > 0:
  3088. self.AppendSpace(5)
  3089. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade + defBonus), self.GetChangeTextLineColor(defGrade))
  3090. item.SelectItem(itemAbsorbedVnum)
  3091. self.__AppendMagicDefenceInfo(absChance)
  3092. ## END ATTACK / DEFENCE
  3093. ## EFFECT
  3094. item.SelectItem(itemAbsorbedVnum)
  3095. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  3096. (affectType, affectValue) = item.GetAffect(i)
  3097. affectValue = self.CalcSashValue(affectValue, absChance)
  3098. affectString = self.__GetAffectString(affectType, affectValue)
  3099. if affectString and affectValue > 0:
  3100. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  3101. item.SelectItem(itemAbsorbedVnum)
  3102. ## END EFFECT
  3103. ## ATTR
  3104. item.SelectItem(itemAbsorbedVnum)
  3105. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  3106. type = attrSlot[i][0]
  3107. value = attrSlot[i][1]
  3108. if not value:
  3109. continue
  3110. value = self.CalcSashValue(value, absChance)
  3111. affectString = self.__GetAffectString(type, value)
  3112. if affectString and value > 0:
  3113. affectColor = self.__GetAttributeColor(i, value)
  3114. self.AppendTextLine(affectString, affectColor)
  3115. item.SelectItem(itemAbsorbedVnum)
  3116. ## END ATTR
  3117. ## WEARABLE
  3118. item.SelectItem(itemVnumAura)
  3119. self.AppendSpace(5)
  3120. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  3121. item.SelectItem(itemVnumAura)
  3122. flagList = (
  3123. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  3124. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  3125. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  3126. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN)
  3127. )
  3128. flagList += (not item.IsAntiFlag(item.ITEM_ANTIFLAG_WOLFMAN),)
  3129. characterNames = ""
  3130. for i in xrange(self.CHARACTER_COUNT):
  3131. name = self.CHARACTER_NAMES[i]
  3132. flag = flagList[i]
  3133. if flag:
  3134. characterNames += " "
  3135. characterNames += name
  3136. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  3137. textLine.SetFeather()
  3138. item.SelectItem(itemVnumAura)
  3139. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  3140. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  3141. textLine.SetFeather()
  3142. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  3143. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  3144. textLine.SetFeather()
  3145. ## END WEARABLE
  3146. self.ShowToolTip()
  3147. class HyperlinkItemToolTip(ItemToolTip):
  3148. def __init__(self):
  3149. ItemToolTip.__init__(self, isPickable=TRUE)
  3150. def SetHyperlinkItem(self, tokens):
  3151. minTokenCount = 5 + player.METIN_SOCKET_MAX_NUM
  3152. maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  3153. if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  3154. head, vnum, flag = tokens[:3]
  3155. itemVnum = int(vnum, 16)
  3156. metinSlot = [int(metin, 16) for metin in tokens[3:7]]
  3157. evolution = int(tokens[7])
  3158. transmutation = int(tokens[8])
  3159. rests = tokens[9:]
  3160. if rests:
  3161. attrSlot = []
  3162. rests.reverse()
  3163. while rests:
  3164. key = int(rests.pop(), 16)
  3165. if rests:
  3166. val = int(rests.pop())
  3167. attrSlot.append((key, val))
  3168. attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  3169. else:
  3170. attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  3171. self.ClearToolTip()
  3172. self.isHyperLinkItem = True
  3173. if app.ENABLE_CHANGELOOK_SYSTEM:
  3174. if not transmutation:
  3175. self.AddItemData(itemVnum, metinSlot, attrSlot, evolution, 1)
  3176. else:
  3177. self.AddItemData(itemVnum, metinSlot, attrSlot, evolution, 0, player.INVENTORY, -1, transmutation, 1)
  3178. else:
  3179. self.AddItemData(itemVnum, metinSlot, attrSlot, 1)
  3180. ItemToolTip.OnUpdate(self)
  3181. def OnUpdate(self):
  3182. pass
  3183. def OnMouseLeftButtonDown(self):
  3184. self.Hide()
  3185. class SkillToolTip(ToolTip):
  3186. POINT_NAME_DICT = {
  3187. player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  3188. player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  3189. }
  3190. SKILL_TOOL_TIP_WIDTH = 200
  3191. PARTY_SKILL_TOOL_TIP_WIDTH = 340
  3192. PARTY_SKILL_EXPERIENCE_AFFECT_LIST = ( ( 2, 2, 10,),
  3193. ( 8, 3, 20,),
  3194. (14, 4, 30,),
  3195. (22, 5, 45,),
  3196. (28, 6, 60,),
  3197. (34, 7, 80,),
  3198. (38, 8, 100,), )
  3199. PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = ( ( 4, 2, 1, 0,),
  3200. (10, 3, 2, 0,),
  3201. (16, 4, 2, 1,),
  3202. (24, 5, 2, 2,), )
  3203. PARTY_SKILL_ATTACKER_AFFECT_LIST = ( ( 36, 3, ),
  3204. ( 26, 1, ),
  3205. ( 32, 2, ), )
  3206. SKILL_GRADE_NAME = { player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  3207. player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  3208. player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  3209. AFFECT_NAME_DICT = {
  3210. "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  3211. "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  3212. "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  3213. "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  3214. "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  3215. "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  3216. "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  3217. "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  3218. }
  3219. AFFECT_APPEND_TEXT_DICT = {
  3220. "DODGE" : "%",
  3221. "RESIST_NORMAL" : "%",
  3222. "REFLECT_MELEE" : "%",
  3223. }
  3224. def __init__(self):
  3225. ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  3226. def __del__(self):
  3227. ToolTip.__del__(self)
  3228. def SetSkill(self, skillIndex, skillLevel = -1):
  3229. if 0 == skillIndex:
  3230. return
  3231. if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  3232. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  3233. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  3234. self.ResizeToolTip()
  3235. self.AppendDefaultData(skillIndex)
  3236. self.AppendSkillConditionData(skillIndex)
  3237. self.AppendGuildSkillData(skillIndex, skillLevel)
  3238. else:
  3239. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  3240. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  3241. self.ResizeToolTip()
  3242. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3243. skillGrade = player.GetSkillGrade(slotIndex)
  3244. skillLevel = player.GetSkillLevel(slotIndex)
  3245. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  3246. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  3247. self.AppendDefaultData(skillIndex)
  3248. self.AppendSkillConditionData(skillIndex)
  3249. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  3250. self.AppendSkillRequirement(skillIndex, skillLevel)
  3251. self.ShowToolTip()
  3252. def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  3253. if 0 == skillIndex:
  3254. return
  3255. if player.SKILL_INDEX_TONGSOL == skillIndex:
  3256. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3257. skillLevel = player.GetSkillLevel(slotIndex)
  3258. self.AppendDefaultData(skillIndex)
  3259. self.AppendPartySkillData(skillGrade, skillLevel)
  3260. elif player.SKILL_INDEX_RIDING == skillIndex:
  3261. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3262. self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  3263. elif player.SKILL_INDEX_SUMMON == skillIndex:
  3264. maxLevel = 10
  3265. self.ClearToolTip()
  3266. self.__SetSkillTitle(skillIndex, skillGrade)
  3267. ## Description
  3268. description = skill.GetSkillDescription(skillIndex)
  3269. self.AppendDescription(description, 25)
  3270. if skillLevel == 10:
  3271. self.AppendSpace(5)
  3272. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  3273. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  3274. else:
  3275. self.AppendSpace(5)
  3276. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  3277. self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  3278. self.AppendSpace(5)
  3279. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  3280. self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  3281. elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  3282. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  3283. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  3284. self.ResizeToolTip()
  3285. self.AppendDefaultData(skillIndex)
  3286. self.AppendSkillConditionData(skillIndex)
  3287. self.AppendGuildSkillData(skillIndex, skillLevel)
  3288. else:
  3289. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  3290. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  3291. self.ResizeToolTip()
  3292. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3293. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  3294. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  3295. self.AppendDefaultData(skillIndex, skillGrade)
  3296. self.AppendSkillConditionData(skillIndex)
  3297. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  3298. self.AppendSkillRequirement(skillIndex, skillLevel)
  3299. self.ShowToolTip()
  3300. def __SetSkillTitle(self, skillIndex, skillGrade):
  3301. self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  3302. self.__AppendSkillGradeName(skillIndex, skillGrade)
  3303. def __AppendSkillGradeName(self, skillIndex, skillGrade):
  3304. if self.SKILL_GRADE_NAME.has_key(skillGrade):
  3305. self.AppendSpace(5)
  3306. self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  3307. def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  3308. if 0 == skillIndex:
  3309. return
  3310. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3311. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  3312. self.ResizeToolTip()
  3313. self.ClearToolTip()
  3314. self.__SetSkillTitle(skillIndex, skillGrade)
  3315. self.AppendDefaultData(skillIndex, skillGrade)
  3316. self.AppendSkillConditionData(skillIndex)
  3317. self.ShowToolTip()
  3318. def AppendDefaultData(self, skillIndex, skillGrade = 0):
  3319. self.ClearToolTip()
  3320. self.__SetSkillTitle(skillIndex, skillGrade)
  3321. ## Level Limit
  3322. levelLimit = skill.GetSkillLevelLimit(skillIndex)
  3323. if levelLimit > 0:
  3324. color = self.NORMAL_COLOR
  3325. if player.GetStatus(player.LEVEL) < levelLimit:
  3326. color = self.NEGATIVE_COLOR
  3327. self.AppendSpace(5)
  3328. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  3329. ## Description
  3330. description = skill.GetSkillDescription(skillIndex)
  3331. self.AppendDescription(description, 25)
  3332. def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  3333. self.ClearToolTip()
  3334. self.__SetSkillTitle(skillIndex, skillGrade)
  3335. ## Description
  3336. description = skill.GetSkillDescription(skillIndex)
  3337. self.AppendDescription(description, 25)
  3338. if 1 == skillGrade:
  3339. skillLevel += 19
  3340. elif 2 == skillGrade:
  3341. skillLevel += 29
  3342. elif 3 == skillGrade:
  3343. skillLevel = 40
  3344. self.AppendSpace(5)
  3345. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  3346. def AppendSkillConditionData(self, skillIndex):
  3347. conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  3348. if conditionDataCount > 0:
  3349. self.AppendSpace(5)
  3350. for i in xrange(conditionDataCount):
  3351. self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  3352. def AppendGuildSkillData(self, skillIndex, skillLevel):
  3353. skillMaxLevel = 7
  3354. skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  3355. skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  3356. ## Current Level
  3357. if skillLevel > 0:
  3358. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  3359. self.AppendSpace(5)
  3360. if skillLevel == skillMaxLevel:
  3361. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  3362. else:
  3363. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  3364. #####
  3365. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  3366. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  3367. ## Cooltime
  3368. coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  3369. if coolTime > 0:
  3370. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  3371. ## SP
  3372. needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  3373. if needGSP > 0:
  3374. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  3375. ## Next Level
  3376. if skillLevel < skillMaxLevel:
  3377. if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  3378. self.AppendSpace(5)
  3379. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  3380. #####
  3381. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  3382. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  3383. ## Cooltime
  3384. coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  3385. if coolTime > 0:
  3386. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  3387. ## SP
  3388. needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  3389. if needGSP > 0:
  3390. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  3391. def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  3392. self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  3393. self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  3394. skillLevelUpPoint = 1
  3395. realSkillGrade = player.GetSkillGrade(slotIndex)
  3396. skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  3397. skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  3398. ## Current Level
  3399. if skillLevel > 0:
  3400. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  3401. self.AppendSpace(5)
  3402. if skillGrade == skill.SKILL_GRADE_COUNT:
  3403. pass
  3404. elif skillLevel == skillMaxLevelEnd:
  3405. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  3406. else:
  3407. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  3408. self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  3409. ## Next Level
  3410. if skillGrade != skill.SKILL_GRADE_COUNT:
  3411. if skillLevel < skillMaxLevelEnd:
  3412. if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  3413. self.AppendSpace(5)
  3414. if skillIndex == 141 or skillIndex == 142:
  3415. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  3416. else:
  3417. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  3418. self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  3419. def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  3420. affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  3421. if affectDataCount > 0:
  3422. for i in xrange(affectDataCount):
  3423. type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  3424. if not self.AFFECT_NAME_DICT.has_key(type):
  3425. continue
  3426. minValue = int(minValue)
  3427. maxValue = int(maxValue)
  3428. affectText = self.AFFECT_NAME_DICT[type]
  3429. if "HP" == type:
  3430. if minValue < 0 and maxValue < 0:
  3431. minValue *= -1
  3432. maxValue *= -1
  3433. else:
  3434. affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  3435. affectText += str(minValue)
  3436. if minValue != maxValue:
  3437. affectText += " - " + str(maxValue)
  3438. affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  3439. self.AppendTextLine(affectText, color)
  3440. else:
  3441. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  3442. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  3443. ## Duration
  3444. duration = skill.GetDuration(skillIndex, skillPercentage)
  3445. if duration > 0:
  3446. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  3447. ## Cooltime
  3448. coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  3449. if coolTime > 0:
  3450. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  3451. ## SP
  3452. needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  3453. if needSP != 0:
  3454. continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  3455. if skill.IsUseHPSkill(skillIndex):
  3456. self.AppendNeedHP(needSP, continuationSP, color)
  3457. else:
  3458. self.AppendNeedSP(needSP, continuationSP, color)
  3459. def AppendSkillRequirement(self, skillIndex, skillLevel):
  3460. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  3461. if skillLevel >= skillMaxLevel:
  3462. return
  3463. isAppendHorizontalLine = FALSE
  3464. ## Requirement
  3465. if skill.IsSkillRequirement(skillIndex):
  3466. if not isAppendHorizontalLine:
  3467. isAppendHorizontalLine = TRUE
  3468. self.AppendHorizontalLine()
  3469. requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  3470. color = self.CANNOT_LEVEL_UP_COLOR
  3471. if skill.CheckRequirementSueccess(skillIndex):
  3472. color = self.CAN_LEVEL_UP_COLOR
  3473. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  3474. ## Require Stat
  3475. requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  3476. if requireStatCount > 0:
  3477. for i in xrange(requireStatCount):
  3478. type, level = skill.GetSkillRequireStatData(skillIndex, i)
  3479. if self.POINT_NAME_DICT.has_key(type):
  3480. if not isAppendHorizontalLine:
  3481. isAppendHorizontalLine = TRUE
  3482. self.AppendHorizontalLine()
  3483. name = self.POINT_NAME_DICT[type]
  3484. color = self.CANNOT_LEVEL_UP_COLOR
  3485. if player.GetStatus(type) >= level:
  3486. color = self.CAN_LEVEL_UP_COLOR
  3487. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  3488. def HasSkillLevelDescription(self, skillIndex, skillLevel):
  3489. if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  3490. return TRUE
  3491. if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  3492. return TRUE
  3493. if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  3494. return TRUE
  3495. return FALSE
  3496. def AppendMasterAffectDescription(self, index, desc, color):
  3497. self.AppendTextLine(desc, color)
  3498. def AppendNextAffectDescription(self, index, desc):
  3499. self.AppendTextLine(desc, self.DISABLE_COLOR)
  3500. def AppendNeedHP(self, needSP, continuationSP, color):
  3501. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  3502. if continuationSP > 0:
  3503. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  3504. def AppendNeedSP(self, needSP, continuationSP, color):
  3505. if -1 == needSP:
  3506. self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  3507. else:
  3508. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  3509. if continuationSP > 0:
  3510. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  3511. def AppendPartySkillData(self, skillGrade, skillLevel):
  3512. if 1 == skillGrade:
  3513. skillLevel += 19
  3514. elif 2 == skillGrade:
  3515. skillLevel += 29
  3516. elif 3 == skillGrade:
  3517. skillLevel = 40
  3518. if skillLevel <= 0:
  3519. return
  3520. skillIndex = player.SKILL_INDEX_TONGSOL
  3521. slotIndex = player.GetSkillSlotIndex(skillIndex)
  3522. skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  3523. if localeInfo.IsBRAZIL():
  3524. k = skillPower
  3525. else:
  3526. k = player.GetSkillLevel(skillIndex) / 100.0
  3527. self.AppendSpace(5)
  3528. self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  3529. if skillLevel>=10:
  3530. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  3531. if skillLevel>=20:
  3532. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER % chop(1 + 5 * k))
  3533. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER % chop(50 + 1450 * k))
  3534. if skillLevel>=25:
  3535. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  3536. if skillLevel>=35:
  3537. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  3538. if skillLevel>=40:
  3539. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  3540. self.AlignHorizonalCenter()
  3541. def __AppendSummonDescription(self, skillLevel, color):
  3542. if skillLevel > 1:
  3543. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  3544. elif 1 == skillLevel:
  3545. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  3546. elif 0 == skillLevel:
  3547. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  3548. if __name__ == "__main__":
  3549. import app
  3550. import wndMgr
  3551. import systemSetting
  3552. import mouseModule
  3553. import grp
  3554. import ui
  3555. #wndMgr.SetOutlineFlag(TRUE)
  3556. app.SetMouseHandler(mouseModule.mouseController)
  3557. app.SetHairColorEnable(TRUE)
  3558. wndMgr.SetMouseHandler(mouseModule.mouseController)
  3559. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  3560. app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  3561. mouseModule.mouseController.Create()
  3562. toolTip = ItemToolTip()
  3563. toolTip.ClearToolTip()
  3564. #toolTip.AppendTextLine("Test")
  3565. 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."
  3566. summ = ""
  3567. toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  3568. toolTip.Show()
  3569. app.Loop()