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