Thread Tools Display Modes
04-13-17, 09:12 PM   #1
eightflat
A Murloc Raider
Join Date: Apr 2017
Posts: 4
Question PickupSpell Restrictions?

Hi all,

New to addon making, so it could very well be a simple solution or something obvious I am overlooking. When using PickupSpell with SpellID like so...

ClearCursor() PickupSpell(115546) PlaceAction(61) ClearCursor()

I find that there seem to be some restrictions. This was tested on a level 1 Monk.

115546 is Provoke, an ability which all Monks can learn regardless of specialization. When that script is run, the Provoke ability will be inserted into the first slot of the Bottom Left Action Bar, regardless of whether Provoke is actually learned yet. The same format works for Tiger's Palm, which is learned at level 1.

If I try with a specialization specific ability though, like Disable (116095), I can't get the same behavior to occur. I also tried doing this with Diffuse Magic (122783), a talented ability, did not work.

Does anyone know if this is a known restriction? Would it be lifted once the character is actually able to select specializations/talents?
My goal is to be able to have all spells (or at least their placeholders) bindable from level 1.

Thanks for your insights!
  Reply With Quote
04-14-17, 06:13 AM   #2
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
For those spells you are kinda stuck with the place holder macro approach, I use something like this in my personal "action bar saver" addon
Lua Code:
  1. local max_acc_macros = MAX_ACCOUNT_MACROS
  2. local place_holder_macro = {}
  3. place_holder_macro.size = 0
  4.  
  5. local Create_Place_Holder_Macro
  6.  
  7. local function Place_Spell(spell_id,action_slot)
  8.     ClearCursor()
  9.     if spell_id==150544 then -- summon random favorite mount
  10.         C_MountJournal.Pickup(0)
  11.     else
  12.         PickupSpell(spell_id)
  13.         if GetCursorInfo()==nil then
  14.             if place_holder_macro[spell_id]==nil then
  15.                 Create_Place_Holder_Macro(spell_id)
  16.             end
  17.             PickupMacro(place_holder_macro[spell_id])
  18.         end
  19.     end
  20.     PlaceAction(action_slot) --the cursor will have either the spell or a place holder macro
  21.     ClearCursor()
  22. end
  23.  
  24. function Create_Place_Holder_Macro(spell_id)
  25.     place_holder_macro.size = place_holder_macro.size+1
  26.     local macro_name = "PH"..string_format("%02d",place_holder_macro.size)
  27.     local spell_name,_,texture = GetSpellInfo(spell_id)
  28.     CreateMacro(macro_name,texture,"#showtooltip\n/use "..spell_name)
  29.     place_holder_macro[spell_id] = macro_name
  30. end

The place holder macros will be named PH01, PH02, PH03 and so on as spells are not found.
I delete all place holder macros on login (any macros in the format PH## is considered a place holder macro) so I don't end up with a lot of trash macros from other chars.
__________________
"In this world nothing can be said to be certain, except that fractional reserve banking is a Ponzi scheme and that you won't believe it." - Mandrill

Last edited by Banknorris : 04-14-17 at 06:18 AM.
  Reply With Quote
04-14-17, 08:25 AM   #3
Mazzop
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 74
Maybe try not with spellID, but go thru talents or spellbook directly?

Cant find info about http://wowprogramming.com/docs/api/PickupTalent
Here about spellbook http://wow.gamepedia.com/API_PickupSpellBookItem
  Reply With Quote
04-14-17, 03:07 PM   #4
eightflat
A Murloc Raider
Join Date: Apr 2017
Posts: 4
Thanks for your input guys! Back to the books, I appreciate your ideas.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » PickupSpell Restrictions?


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