Reply
Thread Tools Display Modes
Unread 09-25-12, 06:42 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,351
Pet Battle Fight Announcer

By looking at PetBattleQuality I had the idea to do sth like the Street Fighter "FIGHT" thing.

Concept:


When a pet battle starts you can extract the pet names + quality.

You could display that data on screen.

Lua Code:
  1. local pet_quality = {
  2.       [1] = "|cff999999", --gray, poor
  3.       [2] = "|cffffffff", --white, common
  4.       [3] = "|cff009900", --green, uncommon
  5.       [4] = "|cff0099ff", --blue, rare
  6.       [5] = "|cffcc33cc", --purple, epic
  7.       [6] = "|cffff6600", --orange, legendary
  8.     }
  9.      
  10.     local function getPetString(ownerId)
  11.       local string
  12.       for i = 1, C_PetBattles.GetNumPets(ownerId) do
  13.         local pet, quality
  14.         pet = C_PetBattles.GetName(ownerId, i)
  15.         quality = pet_quality[C_PetBattles.GetBreedQuality(ownerId, i)]
  16.         if i > 1 then
  17.           string = string.." + "
  18.         end
  19.         if pet and quality then
  20.           string = string..quality..pet.."|r"
  21.         else
  22.           string = string.."ErrorFindingPet"
  23.         end
  24.       end
  25.       return string
  26.     end
  27.      
  28.     local function init()
  29.       local playerPetString = getPetString(1)
  30.       local enemyPetString = getPetString(2)
  31.       print("READY, SET, FIGHT!!!")
  32.       print(playerPetString.." VS. "..enemyPetString)
  33.     end
  34.      
  35.     local frame = CreateFrame("Frame")
  36.     frame:Hide()
  37.     frame:SetScript("OnEvent", init)
  38.     frame:RegisterEvent("PET_BATTLE_OPENING_START")

Maybe we can even extract the pet ID and use it to display a number of portraits + school of magic.
Pet quality is already in.

Ok there is sth like:
Lua Code:
  1. local speciesID, customName, level, xp, maxXp, displayID, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable = C_PetJournal.GetPetInfoByPetID(petID)

Plus there is GetDisplayID(). Not tested but this may return the DisplayID() that could be used in a 3D portrait. Which would be good since that is enough to display: portrait, name, quality.
Lua Code:
  1. C_PetBattles.GetDisplayID(ownerId, i) -- This function is not yet documented
  2. C_PetBattles.GetHealth(ownerId, i) -- This function is not yet documented
  3. C_PetBattles.GetIcon(ownerId, i)     -- This function is not yet documented
  4. C_PetBattles.GetLevel(ownerId, i) -- This function is not yet documented
http://wowprogramming.com/docs/api

I'm thinking of sth like this:
http://images-mediawiki-sites.theful...2942977455.gif

Under the portrait would be the petname in petquality.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-25-12 at 07:47 AM.
zork is offline   Reply With Quote
Unread 09-25-12, 05:57 PM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,351
Finished!



--> http://www.wowinterface.com/download...etFighter.html <--

Info:

Once petbattle is initiated the splash screen is fading in playing an SF2 jingle.

You get the pet overview. Now you have the option to FIGHT or to EXIT(forfeit). If you choose fight it will load the petbattle ui.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-25-12 at 06:14 PM.
zork is offline   Reply With Quote
Unread 09-25-12, 11:46 PM   #3
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 311
So silly :3

Love it!
suicidalkatt is offline   Reply With Quote
Unread 09-25-12, 11:54 PM   #4
tinyu
A Molten Giant
 
tinyu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 816
Vote for weekly pick.
__________________


"There's no such thing as too many addons."
Lothaer
Titan Dev Team Member.
tinyu is offline   Reply With Quote
Unread 09-26-12, 01:54 AM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,239
Originally Posted by zork View Post
rPetBattleAnnouncerStreetFighter
And the award for longest addon name of all time goes to...
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 09-26-12, 02:39 AM   #6
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,351
I did not pick that thing...the website does.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline   Reply With Quote
Unread 09-26-12, 01:15 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,581
Originally Posted by zork View Post
...the website does.
Only because that's what you told the website its name was.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Unread 09-27-12, 01:31 AM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,351
Added some more stuff. Just for the fun of it.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » Released AddOns » Pet Battle Fight Announcer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off