"Too Bee or Not Too Bee" Quest in Windurst Walls

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: "Too Bee or Not Too Bee" Quest in Windurst Walls

Post by diatanato » Thu Sep 27, 2012 2:05 am

Code: Select all

function onTrade(player,npc,trade)
	local ToBee = player:getQuestStatus(WINDURST,TO_BEE_OR_NOT_TO_BEE);
	
	if(ToBee == QUEST_ACCEPTED) then 
		local ToBeeOrNotStatus = player:getVar("ToBeeOrNot_var");
		if(ToBeeOrNotStatus == 10 and trade:hasItemQty(4370,1) and trade:getItemCount() == 1) then 
			player:startEvent(0x0045); -- After Honey#1: Clearing throat
		elseif(ToBeeOrNotStatus == 1 and trade:hasItemQty(4370,1) and trade:getItemCount() == 1) then
			player:startEvent(0x0046); -- After Honey#2: Tries to speak again... coughs
		elseif(ToBeeOrNotStatus == 2 and trade:hasItemQty(4370,1) and trade:getItemCount() == 1) then
			player:startEvent(0x0049); -- After Honey#3: Tries to speak again... coughs..asked for more Honey
		elseif(ToBeeOrNotStatus == 3 and trade:hasItemQty(4370,1) and trade:getItemCount() == 1) then
			player:startEvent(0x004A); -- After Honey#4: Feels like its getting a lot better but there is still iritaion
		elseif(ToBeeOrNotStatus == 4 and trade:hasItemQty(4370,1) and trade:getItemCount() == 1) then
			player:startEvent(0x004B); -- After Honey#5: ToBee quest Finish (tooth hurts from all the Honey
		end
	end
end; 
you can check ItemQty and ItemCount only one time

Code: Select all

function onTrade(player,npc,trade)
	if(player:getQuestStatus(WINDURST,TO_BEE_OR_NOT_TO_BEE) == QUEST_ACCEPTED) then 
        if (trade:hasItemQty(4370,1) and trade:getItemCount() == 1) then
            local ToBeeOrNotStatus = player:getVar("ToBeeOrNot_var");
            if(ToBeeOrNotStatus == 10) then 
                player:startEvent(0x0045); -- After Honey#1: Clearing throat
            elseif(ToBeeOrNotStatus == 1) then
                player:startEvent(0x0046); -- After Honey#2: Tries to speak again... coughs
            elseif(ToBeeOrNotStatus == 2) then
                player:startEvent(0x0049); -- After Honey#3: Tries to speak again... coughs..asked for more Honey
            elseif(ToBeeOrNotStatus == 3) then
                player:startEvent(0x004A); -- After Honey#4: Feels like its getting a lot better but there is still iritaion
            elseif(ToBeeOrNotStatus == 4) then
                player:startEvent(0x004B); -- After Honey#5: ToBee quest Finish (tooth hurts from all the Honey
            end
        end
	end
end;
thx ^^ added to rev1836

thrydwolf
Posts: 30
Joined: Sat Aug 25, 2012 5:32 am

Re: "Too Bee or Not Too Bee" Quest in Windurst Walls

Post by thrydwolf » Thu Sep 27, 2012 4:23 pm

Sweet! Ty

Post Reply