WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Released AddOns (https://www.wowinterface.com/forums/forumdisplay.php?f=9)
-   -   Pet Battle Fight Announcer (https://www.wowinterface.com/forums/showthread.php?t=44507)

zork 09-25-12 06:42 AM

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.

zork 09-25-12 05:57 PM

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.

suicidalkatt 09-25-12 11:46 PM

So silly :3

Love it!

tinyu 09-25-12 11:54 PM

Vote for weekly pick.

Phanx 09-26-12 01:54 AM

Quote:

Originally Posted by zork (Post 265066)
rPetBattleAnnouncerStreetFighter

And the award for longest addon name of all time goes to... :D

zork 09-26-12 02:39 AM

I did not pick that thing...the website does. :)

Seerah 09-26-12 01:15 PM

Quote:

Originally Posted by zork (Post 265096)
...the website does. :)

Only because that's what you told the website its name was. :p

zork 09-27-12 01:31 AM

Added some more stuff. Just for the fun of it.


All times are GMT -6. The time now is 02:15 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI