Advertisement
Guest User

Look.lua

a guest
May 20th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.22 KB | None | 0 0
  1. function onLook(cid, thing, position, lookDistance)
  2.  
  3. local str = ""
  4.  
  5. if not isCreature(thing.uid) then
  6.  
  7. local iname = getItemInfo(thing.itemid)
  8.  
  9. if isPokeball(thing.itemid) then
  10.  
  11. local unique = getItemAttribute(thing.uid, "unique")  --alterado v2.6
  12.  
  13. local pokename = getItemAttribute(thing.uid, "poke")
  14. if(not pokename) then
  15.     pokename = "a"
  16. end
  17.  
  18. local item = getItemInfo(thing.itemid)
  19. str = "You see "..item.article.." "..item.name.."." --alterado v2.6
  20. if unique and unique == getCreatureName(cid) then
  21.     str = str.." It's an unique item."   --alterado v2.6
  22. end
  23. str = str.."\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6
  24.  
  25.             --alterado v2.6
  26.                
  27. local boost = getItemAttribute(thing.uid, "boost") or 0
  28. local boostshow = ""
  29.  
  30. if boost > 0 then
  31. str = str.."Boost level: +"..boost..".\n"
  32. end
  33.  
  34. if getItemAttribute(thing.uid, "nick") then
  35. str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
  36. end
  37.  
  38. if getItemAttribute(thing.uid, "gender") == SEX_MALE then
  39. str = str.."It is male."
  40. elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
  41. str = str.."It is female."
  42. else
  43. str = str.."It is genderless."
  44. end
  45.  
  46. str = str.."\n--- Status ---"
  47. str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
  48. str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
  49. str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""
  50.  
  51. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  52.  
  53. return false
  54.  
  55. elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
  56.  
  57. str = "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."].\n"
  58.  
  59. if getItemAttribute(thing.uid, "gender") == SEX_MALE then
  60. str = str.."It is male."
  61. elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
  62. str = str.."It is female."
  63. else
  64. str = str.."It is genderless."
  65. end
  66. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  67.  
  68. return false
  69.  
  70. else
  71.  
  72. return true
  73.  
  74. end
  75. end
  76.  
  77. local NPCBattle = {
  78. ["Brock"] = {artig = "He is", cidbat = "Pewter"},
  79. ["Misty"] = {artig = "She is", cidbat = "Cerulean"},
  80. }  
  81.                                                        --edited npc name
  82. NPCname = {"Brock", "Misty"}
  83.  
  84. local npcname = getCreatureName(thing.uid)
  85. if not isPlayer(thing.uid) and not isMonster(thing.uid) and isInArray(NPCname, npcname) then
  86.    str = "You see "..npcname..". "..NPCBattle[npcname].artig.." a pokemon trainer from "..NPCBattle[npcname].cidbat.."."
  87.    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  88.    return false
  89. end
  90.  
  91. if not isPlayer(thing.uid) and not isMonster(thing.uid) then    
  92.    str = "You see "..getCreatureName(thing.uid).."."
  93.    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  94.    return false
  95. end
  96.  
  97. look = {
  98. [1] = {"a Volcanic Spark", "a Volcanic Flame","a Volcanic Firetamer","a Volcanic Pyromancer","a Volcanic Master"},
  99. [2] = {"a Seavell Drop", "a Seavell Icelake","a Seavell Waterfall","a Seavell Frost","a Seavell Master"},
  100. [3] = {"an Orebound Sand", "an Orebound Rock","an Orebound Solid","an Orebound Hardskin","an Orebound Hero"},
  101. [4] = {"a Wingeon Cloud", "a Wingeon Wind","a Wingeon Sky","a Wingeon Falcon","a Wingeon Dragon"},
  102. [5] = {"a Malefic Troublemaker", "a Malefic Venomancer","a Malefic Spectre","a Malefic Nightwalker","a Malefic Master"},
  103. [6] = {"a Gardestrike Fist", "a Gardestrike Tamer","a Gardestrike Fighter","a Gardestrike DeathHand","a Gardestrike Champion"},
  104. [7] = {"a Psycraft Mind", "a Psycraft Brain","a Psycraft Scholar","a Psycraft Telepath","a Psycraft Medium"},
  105. [8] = {"a Naturia Seed", "a Naturia Sprout","a Naturia Webhead","a Naturia Woodtrunk","a Naturia Keeper"},
  106. [9] = {"a Raibolt Shock", "a Raibolt Watt","a Raibolt Electrician","a Raibolt Overcharged","a Raibolt Legend"},
  107. }
  108.  
  109. youAre = {
  110. [3] = "a Senior Tutor",
  111. [4] = "a Game Master",
  112. [5] = "a Sub",                     --alterado v2.3
  113. [6] = "a GOD"
  114. }
  115.  
  116. if thing.uid == cid then
  117.      
  118.    if getPlayerStorageValue(thing.uid, 86228) <= 0 then
  119.       if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then    --alterado v2.3
  120.           pos = getCreaturePosition(thing.uid)
  121.           ocupacao = youAre[getPlayerGroupId(thing.uid)]          --alterado v2.3
  122.           str = "You see yourself. You are "..ocupacao..".\n"
  123.           str = str.."Pos: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
  124.       else
  125.           str = "You see yourself. You are a Pokemon Trainer."
  126.       end
  127.      
  128.    else
  129.       vocation = getPlayerStorageValue(thing.uid, 86228)
  130.       rank = getPlayerStorageValue(thing.uid, 862281)
  131.       promote = look[vocation][rank]
  132.       if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
  133.           pos = getCreaturePosition(thing.uid)
  134.           ocupacao = youAre[getPlayerGroupId(thing.uid)]          --alterado v2.3
  135.           str = "You see yourself. You are "..ocupacao.." and "..promote..".\n"
  136.           str = str.."Pos: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
  137.       else
  138.           str = "You see yourself. You are "..promote.."."
  139.       end
  140.    end
  141.    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  142.  
  143. return false
  144. end
  145.                                                                     --edited clan system
  146.  
  147.  
  148. if isPlayer(thing.uid) and thing.uid ~= cid then
  149.  
  150.    vocation2 = getPlayerStorageValue(thing.uid, 86228)
  151.    rank2 = getPlayerStorageValue(thing.uid, 862281)
  152.  
  153.    if getPlayerStorageValue(thing.uid, 86228) <= 0 then
  154.       promote2 = "a Pokemon Trainer"
  155.    else
  156.       promote2 = look[vocation2][rank2]
  157.    end
  158.  
  159.    if getPlayerSex(thing.uid) == 1 then
  160.       artic = "He is"
  161.    elseif getPlayerSex(thing.uid) == 0 then
  162.       artic = "She is"
  163.    end
  164.    
  165.    if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then   --alterado v2.3
  166.        pos = getCreaturePosition(thing.uid)
  167.        ocupacao = youAre[getPlayerGroupId(thing.uid)]          --alterado v2.3
  168.        str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..ocupacao.." and "..promote2..".\n"
  169.        str = str.."Poss: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
  170.    else
  171.        str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2.."."
  172.    end
  173.    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  174.          
  175. return false
  176. end
  177.  
  178. if getCreatureName(thing.uid) == "Evolution" then return false end
  179.  
  180. if not isSummon(thing.uid) then
  181. local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
  182. if getPokemonGender(thing.uid)  == SEX_MALE then
  183. str = str.."It is male."
  184. elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
  185. str = str.."It is female."
  186. else
  187. str = str.."It is genderless."
  188. end
  189. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  190. return false
  191. elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
  192.  
  193. local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
  194. local boostshow = " + "..boostlevel.."]"
  195.  
  196. if showBoostSeparated then
  197. boostshow = "] [+"..boostlevel.."]"
  198. end
  199.  
  200. local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
  201.  
  202. if getCreatureMaster(thing.uid) == cid then
  203. local myball = getPlayerSlotItem(cid, 8).uid
  204. local nexp = getItemAttribute(myball, "nextlevelexp")
  205.  
  206. local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
  207. string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
  208. string = string.."\n"..getPokemonHappinessDescription(thing.uid)
  209. if getItemAttribute(myball, "level") <= 99 then
  210. string = string.."\nExperience needed to level up: "..nexp.."."
  211. end
  212. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
  213. else
  214. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
  215. end
  216.  
  217.  
  218. return false
  219. end
  220.  
  221. return true
  222. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement