Advertisement
Guest User

look.lua

a guest
Jul 27th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.25 KB | None | 0 0
  1. local NPCBattle = {
  2. ["Brock"] = {artig = "He is", cidbat = "Pewter"},
  3. ["Misty"] = {artig = "She is", cidbat = "Cerulean"},
  4. ["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
  5. ["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v1.9 \/ peguem tudo!
  6. ["Kira"] = {artig = "She is", cidbat = "Viridian"},
  7. ["Koga"] = {artig = "He is", cidbat = "Fushcia"},
  8. ["Erika"] = {artig = "She is", cidbat = "Celadon"},
  9. ["Surge"] = {artig = "He is", cidbat = "Vermilion"},
  10. }
  11.  
  12. local shinys = {
  13. ["Shiny Abra"] = "Dark Abra",
  14. ["Shiny Onix"] = "Crystal Onix",
  15. ["Shiny Gyarados"] = "Red Gyarados",
  16. ["Shiny Charizard"] = "Elder Charizard",
  17. ["Shiny Venusaur"] = "Ancient Venusaur",
  18. ["Shiny Blastoise"] = "Ancient Blastoise",
  19. ["Shiny Farfetch'd"] = "Elite Farfetch'd",
  20. ["Shiny Hitmonlee"] = "Elite Hitmonlee",
  21. ["Shiny Himonchan"] = "Elite Hitmonchan",
  22. ["Shiny Snorlax"] = "Big Snorlax",
  23. }
  24.  
  25. -- tabela adicionado ao configuration só procura por price = ..--
  26.  
  27. local xhelds = {
  28. [1] = {name = "X-Defense(Tier: 1)"},
  29. [2] = {name = "X-Defense(Tier: 2)"},
  30. [3] = {name = "X-Defense(Tier: 3)"},
  31. [4] = {name = "X-Defense(Tier: 4)"},
  32. [5] = {name = "X-Defense(Tier: 5)"},
  33. [6] = {name = "X-Defense(Tier: 6)"},
  34. [7] = {name = "X-Defense(Tier: 7)"},
  35. [8] = {name = "X-Attack(Tier : 1)"},
  36. [9] = {name = "X-Attack(Tier : 2)"},
  37. [10] = {name = "X-Attack(Tier: 3)"},
  38. [11] = {name = "X-Attack(Tier: 4)"},
  39. [12] = {name = "X-Attack(Tier: 5)"},
  40. [13] = {name = "X-Attack(Tier: 6)"},
  41. [14] = {name = "X-Attack(Tier: 7)"},
  42. [15] = {name = "X-Return(Tier: 1)"},
  43. [16] = {name = "X-Return(Tier: 2)"},
  44. [17] = {name = "X-Return(Tier: 3)"},
  45. [18] = {name = "X-Return(Tier: 4)"},
  46. [19] = {name = "X-Return(Tier: 5)"},
  47. [20] = {name = "X-Return(Tier: 6)"},
  48. [21] = {name = "X-Return(Tier: 7)"},
  49. [22] = {name = "X-Hellfire(Tier: 1)"},
  50. [23] = {name = "X-Hellfire(Tier: 2)"},
  51. [24] = {name = "X-Hellfire(Tier: 3)"},
  52. [25] = {name = "X-Hellfire(Tier: 4)"},
  53. [26] = {name = "X-Hellfire(Tier: 5)"},
  54. [27] = {name = "X-Hellfire(Tier: 6)"},
  55. [28] = {name = "X-Hellfire(Tier: 7)"},
  56. [29] = {name = "X-Poison(Tier: 1)"},
  57. [30] = {name = "X-Poison(Tier: 2)"},
  58. [31] = {name = "X-Poison(Tier: 3)"},
  59. [32] = {name = "X-Poison(Tier: 4)"},
  60. [33] = {name = "X-Poison(Tier: 5)"},
  61. [34] = {name = "X-Poison(Tier: 6)"},
  62. [35] = {name = "X-Poison(Tier: 7)"},
  63. [36] = {name = "X-Boost(Tier: 1)"},
  64. [37] = {name = "X-Boost(Tier: 2)"},
  65. [38] = {name = "X-Boost(Tier: 3)"},
  66. [39] = {name = "X-Boost(Tier: 4)"},
  67. [40] = {name = "X-Boost(Tier: 5)"},
  68. [41] = {name = "X-Boost(Tier: 6)"},
  69. [42] = {name = "X-Boost(Tier: 7)"},
  70. [43] = {name = "X-Agility(Tier: 1)"},
  71. [44] = {name = "X-Agility(Tier: 2)"},
  72. [45] = {name = "X-Agility(Tier: 3)"},
  73. [46] = {name = "X-Agility(Tier: 4)"},
  74. [47] = {name = "X-Agility(Tier: 5)"},
  75. [48] = {name = "X-Agility(Tier: 6)"},
  76. [49] = {name = "X-Agility(Tier: 7)"},
  77. [50] = {name = "X-Strafe(Tier: 1)"},
  78. [51] = {name = "X-Strafe(Tier: 2)"},
  79. [52] = {name = "X-Strafe(Tier: 3)"},
  80. [53] = {name = "X-Strafe(Tier: 4)"},
  81. [54] = {name = "X-Strafe(Tier: 5)"},
  82. [55] = {name = "X-Strafe(Tier: 6)"},
  83. [56] = {name = "X-Strafe(Tier: 7)"},
  84. [57] = {name = "X-Rage(Tier: 1)"},
  85. [58] = {name = "X-Rage(Tier: 2)"},
  86. [59] = {name = "X-Rage(Tier: 3)"},
  87. [60] = {name = "X-Rage(Tier: 4)"},
  88. [61] = {name = "X-Rage(Tier: 5)"},
  89. [62] = {name = "X-Rage(Tier: 6)"},
  90. [63] = {name = "X-Rage(Tier: 7)"},
  91. [64] = {name = "X-Harden(Tier: 1)"},
  92. [65] = {name = "X-Harden(Tier: 2)"},
  93. [66] = {name = "X-Harden(Tier: 3)"},
  94. [67] = {name = "X-Harden(Tier: 4)"},
  95. [68] = {name = "X-Harden(Tier: 5)"},
  96. [69] = {name = "X-Harden(Tier: 6)"},
  97. [70] = {name = "X-Harden(Tier: 7)"},
  98. [71] = {name = "X-Experience(Tier: 1)"},
  99. [72] = {name = "X-Experience(Tier: 2)"},
  100. [73] = {name = "X-Experience(Tier: 3)"},
  101. [74] = {name = "X-Experience(Tier: 4)"},
  102. [75] = {name = "X-Experience(Tier: 5)"},
  103. [76] = {name = "X-Experience(Tier: 6)"},
  104. [77] = {name = "X-Experience(Tier: 7)"},
  105. [78] = {name = "X-Elemental(Tier: 1)"},
  106. [79] = {name = "X-Elemental(Tier: 2)"},
  107. [80] = {name = "X-Elemental(Tier: 3)"},
  108. [81] = {name = "X-Elemental(Tier: 4)"},
  109. [82] = {name = "X-Elemental(Tier: 5)"},
  110. [83] = {name = "X-Elemental(Tier: 6)"},
  111. [84] = {name = "X-Elemental(Tier: 7)"},
  112. [85] = {name = "X-Critical(Tier: 1)"},
  113. [86] = {name = "X-Critical(Tier: 2)"},
  114. [87] = {name = "X-Critical(Tier: 3)"},
  115. [88] = {name = "X-Critical(Tier: 4)"},
  116. [89] = {name = "X-Critical(Tier: 5)"},
  117. [90] = {name = "X-Critical(Tier: 6)"},
  118. [91] = {name = "X-Critical(Tier: 7)"},
  119. [92] = {name = "X-Vitality(Tier: 1)"},
  120. [93] = {name = "X-Vitality(Tier: 2)"},
  121. [94] = {name = "X-Vitality(Tier: 3)"},
  122. [95] = {name = "X-X-Vitality(Tier: 4)"},
  123. [96] = {name = "X-X-Vitality(Tier: 5)"},
  124. [97] = {name = "X-X-Vitality(Tier: 6)"},
  125. [98] = {name = "X-X-Vitality(Tier: 7)"},
  126. [99] = {name = "X-Haste(Tier: 1)"},
  127. [100] = {name = "X-Haste(Tier: 2)"},
  128. [101] = {name = "X-Haste(Tier: 3)"},
  129. [102] = {name = "X-Haste(Tier: 4)"},
  130. [103] = {name = "X-Haste(Tier: 5)"},
  131. [104] = {name = "X-Haste(Tier: 6)"},
  132. [105] = {name = "X-Haste(Tier: 7)"},
  133. [106] = {name = "X-Accuracy(Tier: 1)"},
  134. [107] = {name = "X-Accuracy(Tier: 2)"},
  135. [108] = {name = "X-Accuracy(Tier: 3)"},
  136. [109] = {name = "X-Accuracy(Tier: 4)"},
  137. [110] = {name = "X-Accuracy(Tier: 5)"},
  138. [111] = {name = "X-Accuracy(Tier: 6)"},
  139. [112] = {name = "X-Accuracy(Tier: 7)"},
  140. [113] = {name = "X-Cooldown(Tier: 3)"},
  141. [114] = {name = "X-Cooldown(Tier: 5)"},
  142. [115] = {name = "X-Cooldown(Tier: 7)"},
  143. [116] = {name = "X-Blink(Tier: 5)"},
  144. }
  145.  
  146. local yhelds = {
  147. [1] = {name = "Y-Regeneration(Tier: 1)"},
  148. [2] = {name = "Y-Regeneration(Tier: 2)"},
  149. [3] = {name = "Y-Regeneration(Tier: 3)"},
  150. [4] = {name = "Y-Regeneration(Tier: 4)"},
  151. [5] = {name = "Y-Regeneration(Tier: 5)"},
  152. [6] = {name = "Y-Regeneration(Tier: 6)"},
  153. [7] = {name = "Y-Regeneration(Tier: 7)"},
  154. [8] = {name = "Y-Cure(Tier: 1)"},
  155. [9] = {name = "Y-Cure(Tier: 2)"},
  156. [10] = {name = "Y-Cure(Tier: 3)"},
  157. [11] = {name = "Y-Cure(Tier: 4)"},
  158. [12] = {name = "Y-Cure(Tier: 5)"},
  159. [13] = {name = "Y-Cure(Tier: 6)"},
  160. [14] = {name = "Y-Cure(Tier: 7)"},
  161. [15] = {name = "Y-Wing(Tier: 1)"},
  162. [16] = {name = "Y-Wing(Tier: 2)"},
  163. [17] = {name = "Y-Wing(Tier: 3)"},
  164. [18] = {name = "Y-Wing(Tier: 4)"},
  165. [19] = {name = "Y-Wing(Tier: 5)"},
  166. [20] = {name = "Y-Wing(Tier: 6)"},
  167. [21] = {name = "Y-Wing(Tier: 7)"},
  168. [22] = {name = "Y-Ghost(Tier: 4)"},
  169. }
  170.  
  171. function onLook(cid, thing, position, lookDistance)
  172.  
  173. local str = {}
  174.  
  175. if not isCreature(thing.uid) then
  176. local iname = getItemInfo(thing.itemid)
  177. if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
  178.  
  179. unLock(thing.uid)
  180. local lock = getItemAttribute(thing.uid, "lock")
  181. local pokename = getItemAttribute(thing.uid, "poke")
  182. local heldx = getItemAttribute(thing.uid, "heldx")
  183. local heldy = getItemAttribute(thing.uid, "heldy")
  184. table.insert(str, "You see "..iname.article.." "..iname.name..".")
  185. if getItemAttribute(thing.uid, "unique") then
  186. table.insert(str, " It's an unique item.")
  187. end
  188. if getItemAttribute(thing.uid, "ehditto") == 1 then
  189. table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n")
  190. else
  191. table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n")
  192. end
  193. if lock and lock > 0 then
  194. table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")
  195. end
  196. local boost = getItemAttribute(thing.uid, "boost") or 0
  197. local Reset = getItemAttribute(thing.uid, "Reset") or 0
  198. local extraInfo, megaStone = "", getItemAttribute(thing.uid, "megaStone")
  199. if megaStone then
  200. extraInfo = getItemNameById(megaStone)
  201. if pokename:find("Mega") then
  202. pokename = megaEvolutions[megaStone][1]
  203. end
  204. end
  205. if boost > 0 then
  206. table.insert(str, "Boost level: +"..boost..".\n")
  207. end
  208. if Reset > 0 then
  209. table.insert(str, "Reset level: +"..Reset..".\n")
  210. end
  211. if getItemAttribute(thing.uid, "nick") then
  212. table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
  213. end
  214. if heldx and heldy then
  215. table.insert(str, "Holding: "..(xhelds[heldx].name).." and "..(yhelds[heldy].name)..". ")
  216. elseif heldx then
  217. table.insert(str, "Holding: "..(xhelds[heldx].name)..". ")
  218. elseif heldy then
  219. table.insert(str, "Holding: "..(yhelds[heldy].name)..". ")
  220. end
  221. if getItemAttribute(thing.uid, "gender") == SEX_MALE then
  222. table.insert(str, "It is male.")
  223. elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
  224. table.insert(str, "It is female.")
  225. else
  226. table.insert(str, "It is genderless.")
  227. end
  228. if extraInfo ~= "" then
  229. table.insert(str, "\nIt's holding a(n) "..extraInfo..".")
  230. end
  231. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  232. return false
  233.  
  234. elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
  235.  
  236. table.insert(str, "You see a "..string.lower(iname.name)..". ")
  237. if isContainer(thing.uid) then
  238. table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
  239. end
  240. table.insert(str, "\n")
  241. if getItemAttribute(thing.uid, "gender") == SEX_MALE then
  242. table.insert(str, "It is male.")
  243. elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
  244. table.insert(str, "It is female.")
  245. else
  246. table.insert(str, "It is genderless.")
  247. end
  248. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  249. return false
  250.  
  251. elseif isContainer(thing.uid) then --containers
  252.  
  253. if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
  254. table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
  255. table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
  256. table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
  257. else
  258. table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
  259. end
  260. if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
  261. table.insert(str, "\nItemID: ["..thing.itemid.."]")
  262. local pos = getThingPos(thing.uid)
  263. table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
  264. end
  265. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  266. return false
  267.  
  268. elseif getItemAttribute(thing.uid, "unique") then
  269. local p = getThingPos(thing.uid)
  270.  
  271. table.insert(str, "You see ")
  272. if thing.type > 1 then
  273. table.insert(str, thing.type.." "..iname.plural..".")
  274. else
  275. table.insert(str, iname.article.." "..iname.name..".")
  276. end
  277. table.insert(str, " It's an unique item.\n"..iname.description)
  278.  
  279. if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
  280. table.insert(str, "\nItemID: ["..thing.itemid.."]")
  281. table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
  282. end
  283.  
  284. sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
  285. return false
  286. else
  287. return true
  288. end
  289. end
  290.  
  291. local npcname = getCreatureName(thing.uid)
  292. if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel
  293. table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
  294. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  295. return false
  296. end
  297. if getPlayerStorageValue(thing.uid, 697548) ~= -1 then
  298. table.insert(str, getPlayerStorageValue(thing.uid, 697548))
  299. local pos = getThingPos(thing.uid)
  300. if youAre[getPlayerGroupId(cid)] then
  301. table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
  302. end
  303. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  304. return false
  305. end
  306.  
  307. if not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs
  308. table.insert(str, "You see "..getCreatureName(thing.uid)..".")
  309. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  310. return false
  311. end
  312.  
  313. if isPlayer(thing.uid) then --player
  314. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))
  315. return false
  316. end
  317.  
  318. if getCreatureName(thing.uid) == "Evolution" then return false end
  319.  
  320. if not isSummon(thing.uid) then --monstros
  321.  
  322. table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n")
  323. table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
  324. if getPokemonGender(thing.uid) == SEX_MALE then
  325. table.insert(str, "It is male.")
  326. elseif getPokemonGender(thing.uid) == SEX_FEMALE then
  327. table.insert(str, "It is female.")
  328. else
  329. table.insert(str, "It is genderless.")
  330. end
  331. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  332. return false
  333.  
  334. elseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons
  335.  
  336. local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
  337. local Resetlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "Reset") or 0
  338. if getCreatureMaster(thing.uid) == cid then
  339. local myball = getPlayerSlotItem(cid, 8).uid
  340. table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".")
  341. if boostlevel > 0 then
  342. table.insert(str, "\nBoost level: +"..boostlevel..".")
  343. end
  344. if Resetlevel > 0 then
  345. table.insert(str, "\nReset level: +"..boostlevel..".")
  346. end
  347. table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
  348. table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
  349. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  350. else
  351. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
  352. end
  353. return false
  354. end
  355. return true
  356. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement