DarkstarProject / darkstar

DEPRECATED - FFXI Server Emulator - See Project Topaz
https://github.com/project-topaz/topaz
GNU General Public License v3.0
455 stars 549 forks source link

STILL having issues with daisy-chained cs events. #1865

Closed TeoTwawki closed 6 years ago

TeoTwawki commented 9 years ago

I still see issues with daisy chained CS's, for example: trying to implement cs's for voidwatch that dsp doesn't have yet, in pashow (s) the verdical conflux needs to start event 8 immediately following event 7..the second cs never plays, leaves character on black screen. Same thing going from 9 to 10 and in both cases these need to play back to back.

-----------------------------------
-- Area: Pashhow Marshlands [S]
--  NPC: Veridical Conflux
-----------------------------------
package.loaded["scripts/zones/Pashhow_Marshlands_[S]/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/quests");
require("scripts/zones/Pashhow_Marshlands_[S]/TextIDs");

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

function onTrade(player,npc,trade)
end;

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

function onTrigger(player,npc)
    if (player:getQuestStatus(CRYSTAL_WAR, GUARDIAN_OF_THE_VOID) == QUEST_AVAILABLE) then
        -- For stage IV Crimson, Indigo, and Jade, we set 1 bit each
        -- for VW_3_NATIONS instead of for a var named for the KIs.
        if (player:isMaskFull(player:getVar("VW_3_NATIONS"),3) == true) then
            player:startEvent(7);
        end
    elseif (player:getQuestStatus(CRYSTAL_WAR, A_CAIT_CALLS) == QUEST_ACCEPTED) then
        player:startEvent(9);
    end
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

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

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

function onEventFinish(player,csid,option)
    -- printf("CSID: %u",csid);
    -- printf("RESULT: %u",option);
    if (csid == 7) then
        player:startEvent(8);
    elseif (csid == 8) then
        player:addQuest(CRYSTAL_WAR, GUARDIAN_OF_THE_VOID);
        player:setVar("VW_3_NATIONS", 0);
    elseif (csid == 9) then
        player:startEvent(10);
    elseif (csid == 10) then
        player:completeQuest(CRYSTAL_WAR, A_CAIT_CALLS);
        player:addQuest(CRYSTAL_WAR, THE_TRUTH_IS_OUT_THERE);
    elseif (csid == 12) then
        -- player:addQuest(CRYSTAL_WAR, ???);
    end
end;
takhlaq commented 9 years ago

iirc events arent chained, but cutscenes take params/make use of onEventUpdate to 'chain' cutscenes (i dont think chaining was ever a thing)

TeoTwawki commented 9 years ago

You can't use on eventUpdate to trigger a cs because that trips the error about another event being called while this one is running blah blah.

TeoTwawki commented 9 years ago

Also this is exactly what is happening ehre anyway https://github.com/Enignite/darkstar/blob/63ecf03a203280f6df17a62edf80a78300d88831/scripts/zones/Sacrificial_Chamber/bcnms/temple_of_uggalepih.lua#L57

So obviously you should be able to chain them. I'd also like to know why that allegedly works in the bcnm's lua but not in the zone lua or as I have found, not in the NPC lua's either.