Advertisement
Guest User

look.lua

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