Working on WOTG missions

Post Reply
Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Working on WOTG missions

Post by Delaide » Mon Mar 09, 2015 11:49 am

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.

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Working on WOTG missions

Post by whasf » Mon Mar 09, 2015 2:29 pm

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
-- Whasf

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Working on WOTG missions

Post by demolish » Mon Mar 09, 2015 4:04 pm

player:addQuest(AREA, QUEST_ID); AREA can be found at the top of quests.lua
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: Working on WOTG missions

Post by Delaide » Mon Mar 09, 2015 8:49 pm

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.

Desufire
Posts: 162
Joined: Sun Feb 22, 2015 2:58 am

Re: Working on WOTG missions

Post by Desufire » Mon Mar 09, 2015 10:21 pm

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.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Working on WOTG missions

Post by kjLotus » Mon Mar 09, 2015 10:24 pm

player:addQuest(CRYSTAL_WAR, THE_FIGHTING_FOURTH);

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: Working on WOTG missions

Post by Delaide » Mon Mar 09, 2015 11:30 pm

kjLotus wrote:player:addQuest(CRYSTAL_WAR, THE_FIGHTING_FOURTH);
Got it. More readable. Thanks. I will do this once I get home and test.

Post Reply