comparison Constants.lua @ 1:d9375a473042

Handle looting items and money from NPCs. Beginning of handling for looting from objects and gathering (mining, herbalism) from NPCs among other spell-related obtaining methods.
author James D. Callahan III <jcallahan@curse.com>
date Fri, 27 Apr 2012 03:49:03 -0500
parents
children 94bc939c2ca6
comparison
equal deleted inserted replaced
0:2e4d83460542 1:d9375a473042
1 -----------------------------------------------------------------------
2 -- Upvalued Lua API.
3 -----------------------------------------------------------------------
4 local _G = getfenv(0)
5
6 local bit = _G.bit
7
8
9 -----------------------------------------------------------------------
10 -- AddOn namespace.
11 -----------------------------------------------------------------------
12 local ADDON_NAME, private = ...
13
14 local LibStub = _G.LibStub
15
16
17 -----------------------------------------------------------------------
18 -- Constants.
19 -----------------------------------------------------------------------
20 private.UNIT_TYPES = {
21 PLAYER = 0,
22 OBJECT = 1,
23 NPC = 3,
24 PET = 4,
25 VEHICLE = 5,
26 }
27
28
29 private.ACTION_TYPE_FLAGS = {
30 ITEM = 0x00000001,
31 NPC = 0x00000002,
32 OBJECT = 0x00000004,
33 ZONE = 0x00000008,
34 }
35
36
37 private.SPELL_LABELS_BY_NAME = {
38 [_G.GetSpellInfo(13262)] = "DISENCHANT",
39 [_G.GetSpellInfo(4036)] = "ENGINEERING",
40 [_G.GetSpellInfo(7620)] = "FISHING",
41 [_G.GetSpellInfo(2366)] = "HERB_GATHERING",
42 [_G.GetSpellInfo(51005)] = "MILLING",
43 [_G.GetSpellInfo(605)] = "MIND_CONTROL",
44 [_G.GetSpellInfo(2575)] = "MINING",
45 [_G.GetSpellInfo(3365)] = "OPENING",
46 [_G.GetSpellInfo(921)] = "PICK_POCKET",
47 [_G.GetSpellInfo(31252)] = "PROSPECTING",
48 [_G.GetSpellInfo(73979)] = "SEARCHING_FOR_ARTIFACTS",
49 [_G.GetSpellInfo(8613)] = "SKINNING",
50 }
51
52 local AF = private.ACTION_TYPE_FLAGS
53
54 private.SPELL_FLAGS_BY_LABEL = {
55 DISENCHANT = AF.ITEM,
56 ENGINEERING = AF.NPC,
57 FISHING = AF.ZONE,
58 HERB_GATHERING = bit.bxor(AF.NPC, AF.OBJECT),
59 MILLING = AF.ITEM,
60 MIND_CONTROL = AF.NPC,
61 MINING = bit.bxor(AF.NPC, AF.OBJECT),
62 OPENING = AF.OBJECT,
63 PICK_POCKET = AF.NPC,
64 PROSPECTING = AF.ITEM,
65 SEARCHING_FOR_ARTIFACTS = AF.OBJECT,
66 SKINNING = AF.NPC,
67 }