This guide I will be teaching you how to make a morpher NPC. This guide will be using lua for it so get comfortable .
---------------------------------------------------
White = Does not need editing
Red = What needs editing.
Yellow = Information
First ill start with the main parts which is optional to edit although ill mark in red what is optional this part only!!
[[
local npcid = This NEEDS to be changed!
function NPCMorpher_OnTalk(pUnit, event, player)
NPCMorpherMenu(pUnit, player)
end
]] Ok the next parts will be labeled and red is ruled!
function NPCMorpherMenu(pUnit, player)
pUnit:GossipCreateMenu(3544, player, 0)
pUnit:GossipMenuAddItem(4, "Morph 1", 1, 0)
pUnit:GossipMenuAddItem(4, "Morph 2", 2, 0)
pUnit:GossipSendMenu(player)
end
Ok 3544 is the menu id this must change if another menu is added.
ex: 3544, 3543, 3542, 3541.......
Ok 4 is the Icon Here is a picture of all available icons. IDs are icon number!
Ok Morph 1, 2 is the menu name. Change to what ever you want!
1, 2 is the submenu id it must increase on each menu!
function NPCMorpher_OnSelect(pUnit, event, player, id, intid, code, pMisc)
Function Name Your choice to edit.
if(intid == 1) then
player:SetModel(Display ID)
end
if(intid == 2) then
player:SetModel(Display ID)
end
Ok 1, 2 is the submenu id as explained above.
And Display ID is self explanatory.
end
RegisterUnitGossipEvent(npcid, 1, "NPCMorpher_OnTalk")
RegisterUnitGossipEvent(npcid, 2, "NPCMorpher_OnSelect")
This should look familar you should know what todo.!
This is all Put together!
local npcid = This NEEDS to be changed!
function NPCMorpher_OnTalk(pUnit, event, player)
NPCMorpherMenu(pUnit, player)
end
function NPCMorpherMenu(pUnit, player)
pUnit:GossipCreateMenu(3544, player, 0)
pUnit:GossipMenuAddItem(4, "Morph 1", 1, 0)
pUnit:GossipMenuAddItem(4, "Morph 2", 2, 0)
pUnit:GossipSendMenu(player)
end
function NPCMorpher_OnSelect(pUnit, event, player, id, intid, code, pMisc)
if(intid == 1) then
player:SetModel(Display ID)
end
if(intid == 2) then
player:SetModel(Display ID)
end
end
RegisterUnitGossipEvent(npcid, 1, "NPCMorpher_OnTalk")
RegisterUnitGossipEvent(npcid, 2, "NPCMorpher_OnSelect")
I'm sorry for not using CODE tags during the guide but they dont like me very much :P
If you are to lazy to do it send me an email at [email protected] with what you want it to have and ill write it for you