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

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

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

Post by thrydwolf » Tue Sep 25, 2012 3:58 am

Howdy! I scripted this little quest tonight. It tested okay by me and a buddy. Thanks!
~Thrydwolf
Attachments
TooBeeOrNotTooBee.rar
(2.11 KiB) Downloaded 317 times

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 » Tue Sep 25, 2012 5:06 am

Code: Select all

player:completeQuest(WINDURST,TO_BEE_OR_NOT_TO_BEE);
it save your quest status and fame, then you must to add fame first

Code: Select all

player:addFame(WINDURST,WIN_FAME*30);
player:completeQuest(WINDURST,TO_BEE_OR_NOT_TO_BEE);

Code: Select all

require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/shop");
require("scripts/globals/quests");
require("scripts/zones/Windurst_Walls/TextIDs");
in Zayhi-Bauhi.lua you don't use shop, keyitems and titles, why you have included them ?

you don't check item count in trade
try not to use the second variable "TooBeeOrNot_var2"

Code: Select all

player:addItem(4156,3); -- Mulsum x3
player:messageSpecial(ITEM_OBTAINED, 4156); 
player:messageSpecial(ITEM_OBTAINED, 4156); 
player:messageSpecial(ITEM_OBTAINED, 4156); 
you must add

Code: Select all

ITEMS_OBTAINED = xxxx; -- You obtain <number> <item>!
in Windurst_Walls/TextIDs. use POLUtils for it.

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 » Tue Sep 25, 2012 9:36 am

Awesome Information!!!
to save your quest status and fame, then you must to add fame first

Sweet! Will Fix.
in Zayhi-Bauhi.lua you don't use shop, keyitems and titles, why you have included them ?
I just followed the Quest Guide on the Wiki and included all... I will clean that up.
you don't check item count in trade
Oopsy, we don't want someone to loose something else by accident . Will fix.
try not to use the second variable "TooBeeOrNot_var2"
Hrmm, I guess I can use bitmask again... I did a quest with that last year... or can change it so that quest doesn't really begin until you receive honey from Raamimi... what would keep the events in a linear fashion so a player couldn't trade honey to Zayhi until give the first one my Raamimi. ;) I think thats the ticket.
you must add 'ITEMS_OBTAINED = xxxx; -- You obtain <number> <item>!'
Thanks!!! I was wondering how to do that. Will fix.
in Windurst_Walls/TextIDs. use POLUtils for it.
Thanks!!

Again, great response. Thanks!!! I will fix and upload new version :)

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

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

Post by bluekirby0 » Tue Sep 25, 2012 10:35 am

I guess I need to fix up the quest writing guide >.<

I literally wrote that as I was learning the scripting so I guess there are still some bad assumptions in there...also there are functions now to aid with bitmasks (look at scripts/zones/Norg/Mamaulabion.lua for reference).

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 » Tue Sep 25, 2012 11:24 am

Thanks guys! I ended up not using the bitmask, but I am sure I will in some other quest. New files attached with all previously discussed issues addressed. Thanks!!!
TooBeeOrNotTooBee_Quest_v2.rar
(2.57 KiB) Downloaded 341 times

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 » Tue Sep 25, 2012 12:52 pm

I was following ffxiecyclopedia originally, but now looking at Kazam, Kalupa-Tawalupa & Rutango-Botango have something to say during the quest, so I will upload a version 3 with their LUAs in a bit. Thanks!

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 » Tue Sep 25, 2012 8:59 pm

Okay, here is version 3 with Kalupa-Tawalupa & Rutango-Botango added in. Thanks!
TooBeeOrNotTooBee_Quest_v3.rar
(4.19 KiB) Downloaded 349 times

Metalfiiish
Developer
Posts: 176
Joined: Tue Jul 31, 2012 7:21 am

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

Post by Metalfiiish » Wed Sep 26, 2012 4:44 am

Welcome back btw!

So I was checking through this and noticed a problem or two.

Your still not checking to ensure only item is in the trade. You did it for one of the IF's but you did not do so for all of the trades. So make it like this for Zayhi:

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");
		local itemCount = trade:getItemCount();
		if(ToBeeOrNotStatus == 10 and trade:hasItemQty(4370,1) and itemCount == 1) then 
			player:startEvent(0x0045); -- After Honey#1: Clearing throat
		elseif(ToBeeOrNotStatus == 1 and trade:hasItemQty(4370,1) and itemCount == 1) then
			player:startEvent(0x0046); -- After Honey#2: Tries to speak again... coughs
		elseif(ToBeeOrNotStatus == 2 and trade:hasItemQty(4370,1) and itemCount == 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 itemCount == 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 itemCount == 1) then
			player:startEvent(0x004B); -- After Honey#5: ToBee quest Finish (tooth hurts from all the Honey
		end
	end
end; 

You currently have the quest ending when trading the 5th honey to to Zayhi. this should not be the case. He should set the var to 5 and then when talking to Raamimi it should check to see if var is 5 and if so then complete the quest.

so here is what you have on Zayhi for completion:

Code: Select all

	elseif(csid == 0x004B) then -- After Honey#5: ToBee quest Finish (tooth hurts from all the Honey)
		player:tradeComplete();
		player:setVar("ToBeeOrNot_var",5);
		player:addFame(WINDURST,WIN_FAME*30);
		player:completeQuest(WINDURST,TO_BEE_OR_NOT_TO_BEE);
		player:needToZone(true);
I would change it to this:

Code: Select all

	elseif(csid == 0x004B) then -- After Honey#5: ToBee quest Finish (tooth hurts from all the Honey)
		player:tradeComplete();
		player:setVar("ToBeeOrNot_var",5);
Then on Raamimi make a new onTrigger that checks if player has that var set to 5. Now Raamimi needs some changes for onTrigger:

Code: Select all

function onTrigger(player,npc)
	local ToBee = player:getQuestStatus(WINDURST,TO_BEE_OR_NOT_TO_BEE);
	local ToBeeOrNotStatus = player:getVar("ToBeeOrNot_var");
	
	if(ToBeeOrNotStatus == 10 and ToBee == QUEST_AVAILABLE) then
		player:startEvent(0x0043); -- Quest Started - He gives you honey
	elseif(ToBee == QUEST_ACCEPTED and ToBeeOrNotStatus < 5) then 
		player:startEvent(0x0044); -- After honey is given to player...... but before 5th hondy is given to Zayhi
	elseif(ToBee == QUEST_COMPLETED and ToBeeOrNotStatus == 5) then
		player:startEvent(0x0050); -- Quest Finish - Gives Mulsum
	elseif(ToBee == QUEST_COMPLETED and player:needToZone()) then
		player:startEvent(0x004F); -- After Quest but before zoning "it's certainly gotten quiet around here..."
	else		
		player:startEvent(0x0128);
	end
end;
and the add to his onEventFinish:

Code: Select all

	elseif(csid == 0x0050) then -- After Honey#5: ToBee quest Finish (tooth hurts from all the Honey)
		if (player:getFreeSlotsCount() == 0) then 
			player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4156); -- Cannot give Mulsum because player Inventory is full
		else
			player:setVar("ToBeeOrNot_var",0);
			player:addItem(4156,3); -- Mulsum x3
			player:messageSpecial(ITEMS_OBTAINED, 4156,3);  
			player:addFame(WINDURST,WIN_FAME*30);
			player:completeQuest(WINDURST,TO_BEE_OR_NOT_TO_BEE);
			player:needToZone(true);
		end
I think that should make it solid. Let me know what you think.

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 » Wed Sep 26, 2012 10:55 pm

Thanks for the great info!!

The reason I set the quest finish with Zahir is because that is when you get the quest finish music... when you trade 5th honey. I also thought it was strange that you didn't get a reward until you talk to Ramimi, but I figured the quest should complete when you hear the quest complete music. I actually wrote it with a finish at Ramimi first, then went the other direction. I am good going either way with it.

Great catch on the check for item on trade.. I missed that one...

Gosh, sorry its taking me soo many tried to get this quest right. I sure appreciate everyones time checking it for me. I will have version 4 done and posted when possible. Thanks!! :)

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 1:31 am

Thanks Metal! I just got distracted when adding the Item trade check and thus only added it at one location accidentally... think that was when it was time for dinner or something... so thanks for catching that. I love learning this stuff and really appreciate the guidance.

I updated Zayhi in the version below. I have decided to leave the quest finish where it is at unless someone wants to overrule me... it's just seems right to finish on Zayhi because that's the event that give the "Quest Finish" music. The player can still get the reward afterwards from Raamimi, and then Char_var will stay active until they do.

Let me know what you think. Thanks!!!
TooBeeOrNotTooBee_Quest_v4.rar
(10.8 KiB) Downloaded 340 times

Post Reply