Advertisement
EmuDevs

EmuDevs: TrinityCore - ItemScript Template

Mar 30th, 2016
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. /*
  2.     EmuDevs - (http://emudevs.com)
  3.     Use this as your template. Make sure to point credits towards ED.
  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) override
  13.     {
  14.         return true;
  15.     }
  16.  
  17.     // Called when a player accepts a quest from the item.
  18.     bool OnQuestAccept(Player* player, Item* item, Quest const* quest) override
  19.     {
  20.         return true;
  21.     }
  22.  
  23.     // Called when a player uses the item.
  24.     bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) override
  25.     {
  26.         return true;
  27.     }
  28.  
  29.     // Called when the item expires (is destroyed).
  30.     bool OnExpire(Player* player, ItemTemplate const* proto) override
  31.     {
  32.         return true;
  33.     }
  34. };
  35.  
  36. void AddSC_template() // ScriptLoader setup function
  37. {
  38.     new item_template(); // Call item_template as new
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement