Page 1 of 1

Working on WOTG missions

Posted: Mon Mar 09, 2015 11:49 am
by Delaide
Okay, as the topic says, I am working on WOTG missions. But, this being my first time making a quest/mission, I hit a point and got stuck.

I need to figure out what I am missing. I can get the CS I want (At this point, just working on the first step), I can check for key item, get the new key item, increment the mission counter so the cs doesn't keep going, but, I cannot get the quest to flag.

Here is what I have:

Code: Select all

-----------------------------------
-- Area: Bastok Markets (S)
-- NPC: Adelbrecht
-- Starts Quests: The Fighting Fourth
-- Involved in Missions: Back to the Beginning
-----------------------------------
package.loaded["scripts/zones/Bastok_Markets_[S]/TextIDs"] = nil;
package.loaded["scripts/globals/missions"] = nil;
-----------------------------------

require("scripts/globals/titles");
require("scripts/globals/missions");
require("scripts/globals/quests");
require("scripts/zones/Bastok_Markets_[S]/TextIDs");
require("scripts/globals/keyitems");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)

if (player:getCurrentMission(WOTG) == BACK_TO_THE_BEGINNING and player:getVar("WotgStatus")==12) then
		player:startEvent(0x008b,0,922);--WOTG event
		end
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);

		if(csid == 0x008b and option == 1) then
			player:addKeyItem(BATTLE_RATIONS);
			player:messageSpecial(KEYITEM_OBTAINED,BATTLE_RATIONS);
			player:addQuest(THE_FIGHTING_FOURTH);
			player:setVar("WotgStatus",13);
		end
end;
Now I realize there is more I will need to add, like his after quest acceptance speech, etc. I could use the WotgStatus flag, but it seems like it should be tied to the quest right now, not the mission, but I don't see "The fighting fourth" anywhere. Can anyone tell me what I have done wrong? Because it doesn't make sense to keep going if I can't get this stage to work right.

Re: Working on WOTG missions

Posted: Mon Mar 09, 2015 2:29 pm
by whasf
is THE_FIGHTING_FOURTH defined in /scripts/global/quests.lua ? (I'm at work so I can't check)

If not, that would be why you can't flag the quest. You'll probably get an error in the game server on that line too

Re: Working on WOTG missions

Posted: Mon Mar 09, 2015 4:04 pm
by demolish
player:addQuest(AREA, QUEST_ID); AREA can be found at the top of quests.lua

Re: Working on WOTG missions

Posted: Mon Mar 09, 2015 8:49 pm
by Delaide
whasf wrote:is THE_FIGHTING_FOURTH defined in /scripts/global/quests.lua ? (I'm at work so I can't check)

If not, that would be why you can't flag the quest. You'll probably get an error in the game server on that line too
From the quests:

Code: Select all

THE_FIGHTING_FOURTH              = 7;
demolish wrote:player:addQuest(AREA, QUEST_ID); AREA can be found at the top of quests.lua
Okay, I think I understand. So, I change:

Code: Select all

player:addQuest(THE_FIGHTING_FOURTH);
to

Code: Select all

player:addQuest(7,THE_FIGHTING_FOURTH);
Or do I change to:

Code: Select all

player:addQuest(7,7);
since quests.lua shows that this is quest 7?

And to both of you, thanks for the time. I want to help contribute to the project, that is why I started working on the DSP Control, to practice up on programming. Now I am trying to take what I have learned from doing that and bring to the actual project to help expand it. Not that I will stop development of my DSP Control, just that I can do more for the project.

Re: Working on WOTG missions

Posted: Mon Mar 09, 2015 10:21 pm
by Desufire
Delaide wrote: Okay, I think I understand. So, I change:

Code: Select all

player:addQuest(THE_FIGHTING_FOURTH);
to

Code: Select all

player:addQuest(7,THE_FIGHTING_FOURTH);
Or do I change to:

Code: Select all

player:addQuest(7,7);
since quests.lua shows that this is quest 7?
From what I've read and adjusted myself, either should work, but I mostly see the first

Code: Select all

(7,THE_FIGHTING_FOURTH);
.
I think it's because if anyone goes into the script after you, they can see the quest name itself instead of having to go into the quest.lua and figuring it out.

I'm still new at a lot of this though.

Re: Working on WOTG missions

Posted: Mon Mar 09, 2015 10:24 pm
by kjLotus
player:addQuest(CRYSTAL_WAR, THE_FIGHTING_FOURTH);

Re: Working on WOTG missions

Posted: Mon Mar 09, 2015 11:30 pm
by Delaide
kjLotus wrote:player:addQuest(CRYSTAL_WAR, THE_FIGHTING_FOURTH);
Got it. More readable. Thanks. I will do this once I get home and test.