You would be better off just setting the quest to use globals and then having an NPC spawn at the end of the fight for people to hail and get the new flag (global) if they have the quest started up to the point needed.
Changing loot tables with quests isn't easy. Though, there is another way you could do it if you really want it to be a dropped item. Basically, setup a quest NPC near the boss that will use the "quest::signalwith(212025,1,0);" command to the boss and have the boss use the "quest::addloot(2845,1);" quest command.
Here is an example from one of my quests that I adjusted to work for your case:
The Quest on the NPC that sends the signal to the boss to add loot:
Code:
sub EVENT_SAY {
if ($text =~/Hail/i) {
if (defined($qglobals{bossloot})) {
if ($qglobals{bossloot} == 1) {
quest::say("Hello, $name, I will get your loot added right away.");
$client->Message(15, "Your loot has been added to the boss.");
quest::signalwith(212025,1,0);
quest::setglobal("bossloot", 2, 5, "F"); }
if ($qglobals{bossloot} == 2) {
quest::say("You already have the loot added to this boss."); }
}
else {
quest::say("You need to begin the quest before we can speak further."); }
}
}
The Quest on the Boss NPC:
Code:
#NPCID 212025
sub EVENT_SIGNAL {
if ($signal == 1) {
quest::addloot(2845,1); }
}
That should give you someplace to start, though you might want to make more adjustments to how the globals work.