I'm working on my own script, Item template similar to the one on AT which will equip you with enchants, glyphs and items with 1 click if you preffer not to customize your character.
So, I currently have an ApplyGlyph function in my script, however I really want a similar one for items, for example ApplyItem
Here's my script: http://pastebin.com/q3HvuBV9
I think it's very similar, just need to change a bit of code. I have an ApplyEnchant function and it looks like the ApplyGlyph.
Appreciate your help!
ApplyGlyph Function
ApplyEnchant Function
So, I currently have an ApplyGlyph function in my script, however I really want a similar one for items, for example ApplyItem
Here's my script: http://pastebin.com/q3HvuBV9
I think it's very similar, just need to change a bit of code. I have an ApplyEnchant function and it looks like the ApplyGlyph.
Appreciate your help!
ApplyGlyph Function
Code:
void ApplyGlyph(Player* player, uint8 slot, uint32 glyphID)
{
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyphID))
{
if (uint32 oldGlyph = player->GetGlyph(slot))
player->RemoveAurasDueToSpell(sGlyphPropertiesStore.LookupEntry(oldGlyph)->SpellId);
player->CastSpell(player, gp->SpellId, true);
player->SetGlyph(slot, glyphID);
player->SendTalentsInfoData(false);
}
}
ApplyEnchant Function
Code:
void Enchant(Player* player, Item* item, uint32 enchantid)
{
player->ApplyEnchantment(item, PERM_ENCHANTMENT_SLOT, false);
item->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchantid, 0, 0);
player->ApplyEnchantment(item, PERM_ENCHANTMENT_SLOT, true);
player->GetSession()->SendNotification("|cff800080%s |cffFF0000 Successfully enchanted!", item->GetTemplate()->Name1.c_str());
}
Last edited: