PHP:
<!--START - Accept all Quests from an NPC -->
<While Condition="HasQuestAvailable(MOBID)" >
<CustomBehavior File="InteractWith" MobId="MOBID" NumOfTimes="1" CollectionDistance="200" WaitTime="1000" X="XCOORD" Y="YCOORD" Z="ZCOORD" />
<CustomBehavior File="RunMacro" Macro="/click GossipTitleButton1" NumOfTimes="1" WaitTime="1000" />
<CustomBehavior File="RunMacro" Macro="/click QuestFrameAcceptButton" NumOfTimes="1" WaitTime="1000" />
</While>
<!-- END - Accept all Quests from an NPC -->
<!-- START - Do the quest(s) -->
<If Condition="((HasQuest(QUESTID)) && (!IsQuestCompleted(QUESTID)))">
<!-- START - Your Questaction here -->
<Objective QuestName="GQUESTNAME" QuestId="QUESTID" Type="KillMob" MobId="MOBIDTOKILL" KillCount="NUMOFKILLS" />
<!-- END - Your Questaction here -->
</If>
<!-- END - Do the quest(s) -->
This should be the easiest way to do that.
I know it's not perfect, but to check if the NPC has a specific quest u'll need to do a lot more of work.
This is easier, but maybe u'll get some quests, u don't want to do.
Hope that helps
Normally u would use an if-statement here in this special case, but we can't directly check IF the mob has THE quest we wanna pickup, so we have to pickup all Quest WHILE the NPC has quests for us.
and later in the profile u'll check IF u have the quest, and do this one (or two or three ... whatever)
The following things have to be replaced with IDs
MOBID = ID of NPC
XCOORD = x-Coordinate of the NPC
YCOORD = y-Coordinate of the NPC
ZCOORD = z-Coordinate of the NPC
QUESTID = your questid
QUESTNAME = your questname
MOBIDTOKILL = id of the mob u wanna kill (if it's an killaction)