WoW:API RollOnLoot: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API RollOnLoot to API RollOnLoot without leaving a redirect)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<center>'''RollOnLoot'''</center>
{{wowapi}}


  RollOnLoot(RollID{,roll});
  RollOnLoot(RollID{,roll});
Line 14: Line 14:
:(Optional)
:(Optional)
:;roll : Number/nil - Is the roll a pass on the item or a real roll? send <tt>nil</tt> to pass on the item, send <tt>1</tt> to roll.
:;roll : Number/nil - Is the roll a pass on the item or a real roll? send <tt>nil</tt> to pass on the item, send <tt>1</tt> to roll.
:Note: Blizzard uses 0 to pass, 1 to Need an item, 2 to Greed an item, and 3 to Disenchant an item.


----
----
Line 34: Line 35:
     DEFAULT_CHAT_FRAME:AddMessage("You passed on the item with id: " .. Rollid );
     DEFAULT_CHAT_FRAME:AddMessage("You passed on the item with id: " .. Rollid );
   end
   end
   Pre_WoW_Rollonloot(id, roll);
   Pre_WoW_Rollonloot(Rollid, roll);
  end
  end


Line 40: Line 41:


:Will display a message when you roll or pass on a roll. This could easily be changed to record how many times you roll on loot.
:Will display a message when you roll or pass on a roll. This could easily be changed to record how many times you roll on loot.
----
-Documentation by --[[User:Wiebbe|Wiebbe]] 12:29, 23 Apr 2005 (EDT)
{{Template:WoW API}}

Latest revision as of 04:47, 15 August 2023

WoW API < RollOnLoot

RollOnLoot(RollID{,roll});

Roll on the Loot roll identified with Rollid, roll is nil when passing, otherwise it uses 1 to roll on loot.


Arguments
(required)
Rollid
Number - The number increases with every roll you have in a party. Till how high it counts is currently unknown.


(Optional)
roll
Number/nil - Is the roll a pass on the item or a real roll? send nil to pass on the item, send 1 to roll.
Note: Blizzard uses 0 to pass, 1 to Need an item, 2 to Greed an item, and 3 to Disenchant an item.

Returns
Nothing

Example
Hooks the function
Pre_WoW_Rollonloot = RollOnLoot;
RollOnLoot = YourAddon_RollOnLoot;
Run the new function
function YourAddon_RollOnLoot(Rollid, roll)
 if (roll ~= nil) then
   DEFAULT_CHAT_FRAME:AddMessage("You rolled on the item with id: " .. Rollid );
 else
   DEFAULT_CHAT_FRAME:AddMessage("You passed on the item with id: " .. Rollid );
 end
 Pre_WoW_Rollonloot(Rollid, roll);
end
Result
Will display a message when you roll or pass on a roll. This could easily be changed to record how many times you roll on loot.