Advertisement
EmuDevs

EmuDevs: TrinityCore - ItemScript Template

Aug 16th, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. /*
  2.     EmuDevs ItemScript Template
  3.     <http://emudevs.com>
  4. */
  5.  
  6. class item_template : public ItemScript
  7. {
  8. public:
  9.     item_template() : ItemScript("item_template") { }
  10.    
  11.     // Called when a dummy spell effect is triggered on the item.
  12.     bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effectIndex, Item* target)
  13.     {
  14.         return true;
  15.     }
  16.     // Called when a player accepts a quest from the item.
  17.     bool OnQuestAccept(Player* player, Item* item, Quest const* quest)
  18.     {
  19.         return true;
  20.     }
  21.     // Called when a player uses the item.
  22.     bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
  23.     {
  24.         return true;
  25.     }
  26.     // Called when the item expires (is destroyed).
  27.     bool OnExpire(Player* player, ItemTemplate const* proto)
  28.     {
  29.         return true;
  30.     }
  31. };
  32.  
  33. void AddSC_template()
  34. {
  35.     new item_template();
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement