Guest User

Untitled

a guest
Jun 24th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.18 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 owner = getItemAttribute(thing.uid, "firstpoke")
  12.      
  13.                             local pokename = getItemAttribute(thing.uid, "poke")
  14.                             local item = getItemInfo(thing.itemid)
  15.                             str = "You see "..item.article.." "..item.name..".\n"
  16.                             str = str.."It contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n"
  17.      
  18.                             if owner and owner ~= getCreatureName(cid) then
  19.                                     str = str.."It belongs to "..owner..".\nIt is a unique item."
  20.                                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  21.                             return false
  22.                             end
  23.      
  24.                             local boost = getItemAttribute(thing.uid, "boost") or 0
  25.                             local boostshow = ""
  26.      
  27.                             if boost > 0 then
  28.                                     str = str.."Boost level: +"..boost..".\n"
  29.                             end
  30.      
  31.                             if getItemAttribute(thing.uid, "nick") then
  32.                                     str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
  33.                             end
  34.                    
  35.                             if getItemAttribute(thing.uid, "gender") == SEX_MALE then
  36.                                     str = str.."It is male."
  37.                             elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
  38.                                     str = str.."It is female."
  39.                             else
  40.                                     str = str.."It is genderless."
  41.                             end
  42.            
  43.                             str = str.."\n--- Status ---"
  44.                             str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
  45.                             str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
  46.                             str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""      
  47.      
  48.                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  49.      
  50.                     return false
  51.      
  52.                     elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
  53.      
  54.                             str = "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."].\n"
  55.      
  56.                             if getItemAttribute(thing.uid, "gender") == SEX_MALE then
  57.                                     str = str.."It is male."
  58.                             elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
  59.                                     str = str.."It is female."
  60.                             else
  61.                                     str = str.."It is genderless."
  62.                             end
  63.                             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  64.      
  65.                     return false
  66.      
  67.                     else
  68.      
  69.                     return true
  70.      
  71.                     end
  72.             end
  73.      
  74.             local npcname = getCreatureName(thing.uid)
  75.             local l = string.len(npcname)
  76.                     if not isPlayer(thing.uid) and not isMonster(thing.uid) then
  77.                             --string.sub(npcname, l - 1, l) == "  " then
  78.                             local article = getPlayerStorageValue(thing.uid, 9891) == 1 and "He is" or "She is"
  79.                             local nname = string.sub(npcname, 1, l - 2)
  80.                             --local plvl = getCreatureLevel(thing.uid, 88995)
  81.                             if nname == getCreatureName(cid) then
  82.                                     nname = "yourself"
  83.                                     article = "You are"                    
  84.                                    
  85.                                    
  86.                             end
  87.                             str = "You see "..nname..". "..article.." a pokemon trainer"
  88.                             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  89.                     return false
  90.             elseif isPlayer(thing.uid) and cid == thing.uid then
  91.             local city = getPlayerTown(cid)
  92.             local cityname = getTownName(city)
  93.             str = "You see Yourself. You are a "..getVocationInfo(getPlayerVocation(cid)).name.." from "..cityname..", Level: ("..getPlayerLevel(cid)..")."
  94.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  95.             return false
  96.             elseif isPlayer(thing.uid) and cid ~= thing.uid then
  97.             str = "You see "..getCreatureName(thing.uid)..","
  98.             if getPlayerSex(thing.uid) == 0 then
  99.             str = str.." She is a"
  100.             else
  101.             str = str.." He is a"
  102.             end
  103.             if getPlayerVocation(thing.uid) > 3 then
  104.             str = str.." "..getVocationInfo(getPlayerVocation(thing.uid)).name..""
  105.             else
  106.             str = str.." Pokemon Trainer"
  107.             end
  108.             local city = getPlayerTown(cid)
  109.             local cityname = getTownName(city)
  110.             str = str.." from "..cityname..", Level: ("..getPlayerLevel(thing.uid)..")."
  111.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  112.             return false
  113.         end
  114.      
  115.             if not isMonster(thing.uid) then
  116.             return true
  117.             end
  118.      
  119.             if getCreatureName(thing.uid) == "Evolution" then return false end
  120.      
  121.             if not isSummon(thing.uid) then
  122.                     local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
  123.                     if getPokemonGender(thing.uid)  == SEX_MALE then
  124.                             str = str.."It is male."
  125.                     elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
  126.                             str = str.."It is female."
  127.                     else
  128.                             str = str.."It is genderless."
  129.                     end
  130.                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  131.             return false
  132.             elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
  133.      
  134.                     local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
  135.                     local boostshow = " + "..boostlevel.."]"
  136.      
  137.                     if showBoostSeparated then
  138.                             boostshow = "] [+"..boostlevel.."]"
  139.                     end
  140.      
  141.                     local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
  142.      
  143.                     if getCreatureMaster(thing.uid) == cid then
  144.                             local myball = getPlayerSlotItem(cid, 8).uid
  145.                             local nexp = getItemAttribute(myball, "nextlevelexp")
  146.      
  147.                             local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
  148.                             string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
  149.                             string = string.."\n"..getPokemonHappinessDescription(thing.uid)
  150.                                     if getItemAttribute(myball, "level") <= 99 then
  151.                                             string = string.."\nExperience needed to level up: "..nexp.."."
  152.                                     end
  153.                             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
  154.                     else
  155.                             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
  156.                     end
  157.      
  158.      
  159.             return false
  160.             end
  161.      
  162.     return true
  163.     end
Add Comment
Please, Sign In to add comment