Jump to content

Photo

Spec portraits script

spec portrait script portraits

  • Please log in to reply
9 replies to this topic

#1 name

name
  • Members
  • Posts: 6

Posted 07 January 2014 - 12:33 AM

Could someone write a script that replaces the portrait of players to their spec icon, and if they currently have no spec selected, then it displays the class icon? Also, if possible, make it not mess with pet and NPC portraits.

Thanks a lot!
  • 0

#2 name

name
  • Members
  • Posts: 6

Posted 07 January 2014 - 11:26 AM

no one?
  • 0

#3 Fugg

Fugg
  • Members
  • Humanclass_name
  • EU-Aegwynn
  • Blutdurst
  • Posts: 79
  • Talents: Shadow 1/1/0/1/0/0/0
  • 2v2: 1012
  • 3v3: 288
  • RBG: 1680
  • LocationEarth

Posted 08 January 2014 - 08:18 AM

There is a stickied thead called "Default UI Scripts". Just saying. Another option what be to use the search function.
  • 0
Posted Image
Touch of Death

#4 name

name
  • Members
  • Posts: 6

Posted 08 January 2014 - 09:07 PM

I know about that thread, but there's no script for what I'm looking for there. Thanks anyway.
  • 0

#5 Fugg

Fugg
  • Members
  • Humanclass_name
  • EU-Aegwynn
  • Blutdurst
  • Posts: 79
  • Talents: Shadow 1/1/0/1/0/0/0
  • 2v2: 1012
  • 3v3: 288
  • RBG: 1680
  • LocationEarth

Posted 09 January 2014 - 11:06 AM

My fault. Mistook it for classicons. I had a look into it. I could be wrong but it seems to me that you can only retrieve the spec (and thus the specicon) of yourself, an inspected unit and arena opponents.
  • 0
Posted Image
Touch of Death

#6 name

name
  • Members
  • Posts: 6

Posted 09 January 2014 - 01:26 PM

Yes, I think you are right.
  • 0

#7 Spyrö

Spyrö
  • Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 205
  • Talents: Shadow 0/1/1/1/0/0/0
  • LocationSpain

Posted 12 January 2014 - 03:24 PM

You can only access that info at inspec range, once the target is out of it and you change your target, that info will be lost, so you would need to maintain a cache for it and use methods to try to guess the spec based on buffs for trying to get that info out of range. It would require considerably more code than the typical class portrait script. I remember X-Perl doing this back on WoTLK when I used it.
  • 0

#8 Brugo

Brugo
  • Members
  • Posts: 7

Posted 13 January 2014 - 08:08 AM

But could it work in arena? Hmm.. it would be cool to replace the level of the character that is next to his portrait and in that circle to put the spec. This way, if you use the class portraits script, the frame would look something like the default arena frames.
  • 0

#9 Fugg

Fugg
  • Members
  • Humanclass_name
  • EU-Aegwynn
  • Blutdurst
  • Posts: 79
  • Talents: Shadow 1/1/0/1/0/0/0
  • 2v2: 1012
  • 3v3: 288
  • RBG: 1680
  • LocationEarth

Posted 13 January 2014 - 09:37 AM

Yes it works in arena. There is "GetArenaOpponentSpec()" which is used for the arena frames -> http://wow.go-hero.n...ard_ArenaUI.lua But as you have it already on the arena frames why have it twice on your screen?
  • 0
Posted Image
Touch of Death

#10 Spyrö

Spyrö
  • Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 205
  • Talents: Shadow 0/1/1/1/0/0/0
  • LocationSpain

Posted 13 January 2014 - 06:20 PM

Yeah in Arena it would be really easy, since you can access that information all the time, something like:
function Addon:PLAYER_TARGET_CHANGED()
  if not UnitExists("target") then return end -- We have no target

  local TargetArenaID
  for i = 1, 5 do -- Getting the ArenaID of the target
    if UnitIsUnit("target", "arena"..i) then
      TargetArenaID = i
      break
    end
  end
  if not TargetArenaID then return end -- Target is not a enemy player

  local IconPath = select(4, GetSpecializationInfoByID(GetArenaOpponentSpec(TargetArenaID)))
  SetPortraitToTexture(TargetFrame.portrait, IconPath)
end
I have written this in a minute so it's completely untested, but you get the idea.
  • 0





Also tagged with one or more of these keywords: spec, portrait, script, portraits

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<