Skip to content

Commit

Permalink
Added EET compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Aug 2, 2016
1 parent 7bcf2fd commit 5ab04a3
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 29 deletions.
16 changes: 8 additions & 8 deletions DjinniCompanion/dialogs/A7Afaaq.d
Expand Up @@ -45,28 +45,28 @@ IF ~~ TalkIntro.1
SAY @11170 /* The pleasure is all mine. */
+ ~CheckStatLT(Player1, 10, WIS)~ + @11171 /* Are you the proverbial djinni in a...lamp? */ + TalkIntro.4
+ ~CheckStatGT(Player1, 9, WIS)~ + @11172 /* How did you come to be bound to this lamp? */ + TalkIntro.5
+ ~GlobalLT("Chapter", "GLOBAL", 4)~ + @11173 /* Please excuse my lack of manners, but I still have a wizard to catch. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", 4) Global("A7Q1AfaaqRewarded", "GLOBAL", 0)~ + @11174 /* We should move on, Afaaq. I have yet another companion to free from her captors. */ + TalkIntro.6
+ ~GlobalGT("Chapter", "GLOBAL", 4) GlobalLT("Chapter", "GLOBAL", 8)~ + @11175 /* Please excuse my lack of manners, but I'm in a hurry to reclaim my soul. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%)~ + @11173 /* Please excuse my lack of manners, but I still have a wizard to catch. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) Global("A7Q1AfaaqRewarded", "GLOBAL", 0)~ + @11174 /* We should move on, Afaaq. I have yet another companion to free from her captors. */ + TalkIntro.6
+ ~GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_8%)~ + @11175 /* Please excuse my lack of manners, but I'm in a hurry to reclaim my soul. */ + TalkIntro.6
++ @11176 /* Well then, let's go! */ + TalkIntro.6
END

IF ~~ TalkIntro.2
SAY @11177 /* You are a cautious one. But I have no intention to harm you. */
+ ~CheckStatLT(Player1, 10, WIS)~ + @11171 /* Are you the proverbial djinni in a...lamp? */ + TalkIntro.4
+ ~CheckStatGT(Player1, 9, WIS)~ + @11172 /* How did you come to be bound to this lamp? */ + TalkIntro.5
+ ~GlobalLT("Chapter", "GLOBAL", 4)~ + @11173 /* Please excuse my lack of manners, but I still have a wizard to catch. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", 4) Global("A7Q1AfaaqRewarded", "GLOBAL", 0)~ + @11174 /* We should move on, Afaaq. I have yet another companion to free from her captors. */ + TalkIntro.6
+ ~GlobalGT("Chapter", "GLOBAL", 4) GlobalLT("Chapter", "GLOBAL", 8)~ + @11175 /* Please excuse my lack of manners, but I'm in a hurry to reclaim my soul. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%)~ + @11173 /* Please excuse my lack of manners, but I still have a wizard to catch. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) Global("A7Q1AfaaqRewarded", "GLOBAL", 0)~ + @11174 /* We should move on, Afaaq. I have yet another companion to free from her captors. */ + TalkIntro.6
+ ~GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_8%)~ + @11175 /* Please excuse my lack of manners, but I'm in a hurry to reclaim my soul. */ + TalkIntro.6
++ @11176 /* Well then, let's go! */ + TalkIntro.6
END

IF ~~ TalkIntro.3
SAY @11178 /* As you wish. */
+ ~CheckStatLT(Player1, 10, WIS)~ + @11171 /* Are you the proverbial djinni in a...lamp? */ + TalkIntro.4
+ ~CheckStatGT(Player1, 9, WIS)~ + @11172 /* How did you come to be bound to this lamp? */ + TalkIntro.5
+ ~GlobalLT("Chapter", "GLOBAL", 4)~ + @11179 /* We should move on, Afaaq. I still have a wizard to catch. */ + TalkIntro.6
+ ~GlobalGT("Chapter", "GLOBAL", 4) GlobalLT("Chapter", "GLOBAL", 8)~ + @11180 /* We should move on, Afaaq. I still have a soul to reclaim. */ + TalkIntro.6
+ ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%)~ + @11179 /* We should move on, Afaaq. I still have a wizard to catch. */ + TalkIntro.6
+ ~GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_8%)~ + @11180 /* We should move on, Afaaq. I still have a soul to reclaim. */ + TalkIntro.6
++ @11176 /* Well then, let's go! */ + TalkIntro.6
END

Expand Down
2 changes: 1 addition & 1 deletion DjinniCompanion/dialogs/A7AfaaqBanter_Cernd.d
Expand Up @@ -64,7 +64,7 @@ EXIT


// Banter #3 (after CHARNAME has gotten back his soul)
// CHAIN IF ~Name("Cernd", LastTalkedToBy) GlobalGT("Chapter", "GLOBAL", 7) Global("BanterActive", "LOCALS", 1) Global("A7BanterCernd", "GLOBAL", 2)~ THEN A7AFAAQ Cernd.2
// CHAIN IF ~Name("Cernd", LastTalkedToBy) GlobalGT("Chapter", "GLOBAL", %bg2_chapter_7%) Global("BanterActive", "LOCALS", 1) Global("A7BanterCernd", "GLOBAL", 2)~ THEN A7AFAAQ Cernd.2
// ~(TODO: Afaaq praises Cernd for his steadfast loyalty to <CHARNAME> during his search for <PRO_HISHER> soul, and reminds him that he shouldn't forget his own obligations for the well-being of his son...)~ DO ~SetGlobal("A7BanterCernd", "GLOBAL", 3)~
// == BCERND25 ~Cernd thanks Afaaq for his concern, but tells him that his task isn't over until the Bhaalspawn saga hasn't been solved completely.~
// == A7AFAAQ ~Afaaq tells him that he can't take care of everything by himself and the Bhaalspawn saga will be solved even without his active involvement. He suggests Cernd to think about it and set his priorities accordingly.~
Expand Down
2 changes: 1 addition & 1 deletion DjinniCompanion/dialogs/A7AfaaqInterjections.d
Expand Up @@ -41,7 +41,7 @@ END

// SoA: Trademeet fortuneteller
EXTEND_BOTTOM TRGYP02 2
IF ~Race(LastTalkedToBy, GENIE) Name("A7Afaaq", LastTalkedToBy) GlobalLT("Chapter", "GLOBAL", 6)~ + Gypsy.Fortune.1
IF ~Race(LastTalkedToBy, GENIE) Name("A7Afaaq", LastTalkedToBy) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_6%)~ + Gypsy.Fortune.1
END

CHAIN TRGYP02 Gypsy.Fortune.1
Expand Down
20 changes: 10 additions & 10 deletions DjinniCompanion/dialogs/A7Afaaq_generic.d
Expand Up @@ -379,16 +379,16 @@ APPEND %afq_dialog%
AreaCheck("AR6106") AreaCheck("AR6107") AreaCheck("AR6109") AreaCheck("AR6110") AreaCheck("AR6111") !Dead("sendai") RandomNum(4, 2)~ + TalkGeneric.Advice.AR6101.2 // Sendai's Enclave

// situation-specific tips (max. 15% chance)
IF ~GlobalLT("Chapter", "GLOBAL", 4) RandomNum(28, 1)~ + TalkGeneric.Advice.Specific.FollowIrenicus.1 // CHARNAME follows Irenicus and abducted Imoen
IF ~GlobalLT("Chapter", "GLOBAL", 4) RandomNum(28, 2)~ + TalkGeneric.Advice.Specific.FollowIrenicus.2 // CHARNAME follows Irenicus and abducted Imoen
IF ~GlobalLT("Chapter", "GLOBAL", 4) GlobalGT("WorkingForAran", "GLOBAL", 0) RandomNum(28, 3)~ + TalkGeneric.Advice.Specific.ShadowThieves.1 // CHARNAME joins the Shadow Thieves
IF ~GlobalLT("Chapter", "GLOBAL", 4) GlobalGT("WorkingForAran", "GLOBAL", 0) GlobalGT("AranJob", "GLOBAL", 0) GlobalLT("AranJob", "GLOBAL", 3) RandomNum(28, 4)~ + TalkGeneric.Advice.Specific.ShadowThieves.2 // CHARNAME joins the Shadow Thieves (while working for them)
IF ~GlobalLT("Chapter", "GLOBAL", 4) GlobalGT("WorkingForBodhi", "GLOBAL", 0) RandomNum(28, 3)~ + TalkGeneric.Advice.Specific.Bodhi.1 // CHARNAME joins Bodhi
IF ~GlobalGT("Chapter", "GLOBAL", 4) GlobalLT("Chapter", "GLOBAL", 7) RandomNum(20, 1)~ + TalkGeneric.Advice.Specific.LostSoul.1 // CHARNAME has lost his soul
IF ~GlobalGT("Chapter", "GLOBAL", 4) GlobalLT("Chapter", "GLOBAL", 7) RandomNum(20, 2)~ + TalkGeneric.Advice.Specific.LostSoul.2 // CHARNAME has lost his soul
IF ~GlobalGT("Chapter", "GLOBAL", 4) GlobalLT("Chapter", "GLOBAL", 7) Global("A7TalkAboutLostSoul", "GLOBAL", 0) RandomNum(20, 3)~ + TalkGeneric.Advice.Specific.LostSoul.3 // CHARNAME has lost his soul
IF ~Global("Chapter", "GLOBAL", 6) RandomNum(16, 1)~ + TalkGeneric.Advice.Specific.IrenicusGoal.1 // CHARNAME knows about Irenicus' true intent
IF ~Global("Chapter", "GLOBAL", 6) RandomNum(16, 2)~ + TalkGeneric.Advice.Specific.IrenicusGoal.2 // CHARNAME knows about Irenicus' true intent
IF ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) RandomNum(28, 1)~ + TalkGeneric.Advice.Specific.FollowIrenicus.1 // CHARNAME follows Irenicus and abducted Imoen
IF ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) RandomNum(28, 2)~ + TalkGeneric.Advice.Specific.FollowIrenicus.2 // CHARNAME follows Irenicus and abducted Imoen
IF ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalGT("WorkingForAran", "GLOBAL", 0) RandomNum(28, 3)~ + TalkGeneric.Advice.Specific.ShadowThieves.1 // CHARNAME joins the Shadow Thieves
IF ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalGT("WorkingForAran", "GLOBAL", 0) GlobalGT("AranJob", "GLOBAL", 0) GlobalLT("AranJob", "GLOBAL", 3) RandomNum(28, 4)~ + TalkGeneric.Advice.Specific.ShadowThieves.2 // CHARNAME joins the Shadow Thieves (while working for them)
IF ~GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalGT("WorkingForBodhi", "GLOBAL", 0) RandomNum(28, 3)~ + TalkGeneric.Advice.Specific.Bodhi.1 // CHARNAME joins Bodhi
IF ~GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_7%) RandomNum(20, 1)~ + TalkGeneric.Advice.Specific.LostSoul.1 // CHARNAME has lost his soul
IF ~GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_7%) RandomNum(20, 2)~ + TalkGeneric.Advice.Specific.LostSoul.2 // CHARNAME has lost his soul
IF ~GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_7%) Global("A7TalkAboutLostSoul", "GLOBAL", 0) RandomNum(20, 3)~ + TalkGeneric.Advice.Specific.LostSoul.3 // CHARNAME has lost his soul
IF ~Global("Chapter", "GLOBAL", %bg2_chapter_6%) RandomNum(16, 1)~ + TalkGeneric.Advice.Specific.IrenicusGoal.1 // CHARNAME knows about Irenicus' true intent
IF ~Global("Chapter", "GLOBAL", %bg2_chapter_6%) RandomNum(16, 2)~ + TalkGeneric.Advice.Specific.IrenicusGoal.2 // CHARNAME knows about Irenicus' true intent
IF ~Global("TalkedSarMel01", "GLOBAL", 1) !Dead("gromnir") RandomNum(24, 1)~ + TalkGeneric.Advice.Specific.Melissan.1 // speculating about Melissan and her plans (before Gromnir's defeat)
IF ~Dead("yaga01") OR(2) !Dead("abazigal") !Dead("sendai") Global("A7TalkAboutMelissan", "GLOBAL", 0) RandomNum(24, 2)~ + TalkGeneric.Advice.Specific.Melissan.2 // speculating about Melissan and her plans (after Yaga-Shura is dead)
IF ~Dead("abazigal") Dead("sendai") !Dead("balth") RandomNum(24, 3)~ + TalkGeneric.Advice.Specific.Melissan.3 // speculating about Melissan and her plans (after CHARNAME saw a vision of Melissan being detained)
Expand Down
9 changes: 9 additions & 0 deletions DjinniCompanion/lib/eet.tph
@@ -0,0 +1,9 @@
// *** EET-specific initializations ***

// Setting bg2_chapter_1, bg2_chapter_2, ... to actual chapter value for BG2 part of the game
OUTER_SET bg2_chapter = (GAME_IS ~eet~) ? 12 : 0
OUTER_FOR (i = 1; i < 11; ++i) BEGIN
OUTER_SET bg2_chapter += 1
OUTER_TEXT_SPRINT name_source ~bg2_chapter_%i%~
OUTER_SET EVAL ~%name_source%~ = bg2_chapter
END
2 changes: 1 addition & 1 deletion DjinniCompanion/scripts/a77005.baf
Expand Up @@ -52,7 +52,7 @@ END

// Mark Quest as finished after leaving Underdark
IF
GlobalGT("Chapter", "GLOBAL", 5)
GlobalGT("Chapter", "GLOBAL", %bg2_chapter_5%)
Global("Quest3Finished", "A77005", 0)
THEN RESPONSE #100
SetGlobal("Quest3Finished", "A77005", 1)
Expand Down
10 changes: 5 additions & 5 deletions DjinniCompanion/scripts/a7afqtlk.baf
Expand Up @@ -527,7 +527,7 @@ END
IF
Delay(12) See(Player1) !StateCheck(Player1, CD_STATE_NOTVALID) !StateCheck(Myself, CD_STATE_NOTVALID) !ActuallyInCombat()
OR(2) !AreaType(DUNGEON) InWatchersKeep()
GlobalGT("BanterPCHeritage", "LOCALS", 1) Global("BanterPCIrenicusHunt", "LOCALS", 0) GlobalLT("Chapter", "GLOBAL", 4)
GlobalGT("BanterPCHeritage", "LOCALS", 1) Global("BanterPCIrenicusHunt", "LOCALS", 0) GlobalLT("Chapter", "GLOBAL", %bg2_chapter_4%)
Global("A7AfaaqEnslaved", "GLOBAL", 0) RealGlobalTimerExpired("A7AfaaqBanterTimer", "GLOBAL")
THEN RESPONSE #100
SetInterrupt(FALSE)
Expand Down Expand Up @@ -665,7 +665,7 @@ IF
Delay(12) See(Player1) !StateCheck(Player1, CD_STATE_NOTVALID) !StateCheck(Myself, CD_STATE_NOTVALID) !ActuallyInCombat()
!AreaCheck("AR6200") OR(7) !AreaType(DUNGEON) AreaCheck("AR2100") AreaCheck("AR2102") AreaCheck("AR2300") AreaCheck("AR5201") AreaCheck("AR5204") InWatchersKeep()
Global("A7AfaaqEnslaved", "GLOBAL", 0) RealGlobalTimerExpired("A7AfaaqBanterTimer", "GLOBAL")
GlobalGT("Chapter", "GLOBAL", 4) Global("BanterPCHeritage", "LOCALS", 6)
GlobalGT("Chapter", "GLOBAL", %bg2_chapter_4%) Global("BanterPCHeritage", "LOCALS", 6)
THEN RESPONSE #100
SetInterrupt(FALSE)
SetGlobal("BanterPCHeritage", "LOCALS", 7)
Expand All @@ -679,7 +679,7 @@ IF
Delay(12) See(Player1) !StateCheck(Player1, CD_STATE_NOTVALID) !StateCheck(Myself, CD_STATE_NOTVALID) !ActuallyInCombat()
Global("A7AfaaqEnslaved", "GLOBAL", 0) RealGlobalTimerExpired("A7AfaaqBanterTimer", "GLOBAL")
GlobalGT("AsylumPlot", "GLOBAL", 55) // after defeating Irenicus/talking to Saemon in Spellhold
GlobalLT("Chapter", "GLOBAL", 6) Global("PCToldAboutHeritage", "LOCALS", 1) GlobalLT("A7Quest3", "GLOBAL", 10) Global("BanterPCSoul", "LOCALS", 0)
GlobalLT("Chapter", "GLOBAL", %bg2_chapter_6%) Global("PCToldAboutHeritage", "LOCALS", 1) GlobalLT("A7Quest3", "GLOBAL", 10) Global("BanterPCSoul", "LOCALS", 0)
THEN RESPONSE #100
SetInterrupt(FALSE)
SetGlobal("BanterPCSoul", "LOCALS", 1)
Expand All @@ -693,7 +693,7 @@ IF
Delay(12) See(Player1) !StateCheck(Player1, CD_STATE_NOTVALID) !StateCheck(Myself, CD_STATE_NOTVALID) !ActuallyInCombat()
!AreaCheck("AR6200") OR(7) !AreaType(DUNGEON) AreaCheck("AR2100") AreaCheck("AR2102") AreaCheck("AR2300") AreaCheck("AR5201") AreaCheck("AR5204") InWatchersKeep()
Global("A7AfaaqEnslaved", "GLOBAL", 0) RealGlobalTimerExpired("A7AfaaqBanterTimer", "GLOBAL")
Global("Chapter", "GLOBAL", 5) Global("PCToldAboutHeritage", "LOCALS", 1) Global("BanterIrenicusPlans", "LOCALS", 0)
Global("Chapter", "GLOBAL", %bg2_chapter_5%) Global("PCToldAboutHeritage", "LOCALS", 1) Global("BanterIrenicusPlans", "LOCALS", 0)
THEN RESPONSE #100
SetInterrupt(FALSE)
SetGlobal("BanterIrenicusPlans", "LOCALS", 1)
Expand Down Expand Up @@ -735,7 +735,7 @@ IF
Delay(12) See(Player1) !StateCheck(Player1, CD_STATE_NOTVALID) !StateCheck(Myself, CD_STATE_NOTVALID) !ActuallyInCombat()
!AreaCheck("AR6200") OR(7) !AreaType(DUNGEON) AreaCheck("AR2100") AreaCheck("AR2102") AreaCheck("AR2300") AreaCheck("AR5201") AreaCheck("AR5204") InWatchersKeep()
Global("A7AfaaqEnslaved", "GLOBAL", 0) RealGlobalTimerExpired("A7AfaaqBanterTimer", "GLOBAL")
GlobalGT("Chapter", "GLOBAL", 7) Global("BanterPCHeritage", "LOCALS", 8)
GlobalGT("Chapter", "GLOBAL", %bg2_chapter_7%) Global("BanterPCHeritage", "LOCALS", 8)
THEN RESPONSE #100
SetInterrupt(FALSE)
SetGlobal("BanterPCHeritage", "LOCALS", 9)
Expand Down
2 changes: 1 addition & 1 deletion DjinniCompanion/scripts/a7q2trig.baf
Expand Up @@ -25,7 +25,7 @@ IF
!PartyHasItem("misc8u")
GlobalGT("KruinTalked", "GLOBAL", 0)
OR(3) // don't interfere with the vampire quest
Global("Chapter", "GLOBAL", 6)
Global("Chapter", "GLOBAL", %bg2_chapter_6%)
GlobalGT("VampShadWar", "GLOBAL", 5)
!TimeOfDay(NIGHT)
!StateCheck(Player1, CD_STATE_NOTVALID)
Expand Down
4 changes: 2 additions & 2 deletions DjinniCompanion/scripts/npc_edwin.baf
Expand Up @@ -41,7 +41,7 @@ END
// PartyRested()
// HasItem("A7DJLMP", Player1)
// InParty(Myself)
// GlobalGT("Chapter", "GLOBAL", 5)
// GlobalGT("Chapter", "GLOBAL", %bg2_chapter_5%)
// Global("EnteredAR2806", "GLOBAL", 0) // can be triggered until reaching the Tree of Life
// Global("A7AfaaqSummoned", "GLOBAL", 0)
// Global("A7EdwinTakesControl", "GLOBAL", 1)
Expand All @@ -60,7 +60,7 @@ END
// Detect("A7Afaaq")
// HasItem("A7DJLMP", Player1)
// InParty(Myself)
// GlobalGT("Chapter", "GLOBAL", 5)
// GlobalGT("Chapter", "GLOBAL", %bg2_chapter_5%)
// Global("EnteredAR2806", "GLOBAL", 0) // can be triggered until reaching the Tree of Life
// Global("A7AfaaqSummoned", "GLOBAL", 1)
// Global("A7EdwinTakesControl", "GLOBAL", 1)
Expand Down
2 changes: 2 additions & 0 deletions DjinniCompanion/setup-DjinniCompanion.tp2
Expand Up @@ -3,6 +3,8 @@ AUTHOR ~Argent77 at Spellhold Studios~
VERSION ~v2.3~

ALWAYS
INCLUDE ~DjinniCompanion/lib/eet.tph~

ACTION_DEFINE_ARRAY a7noconvert BEGIN setup bg2ee iwdee END
ACTION_DEFINE_ARRAY a7reload BEGIN afaaq misc quest1 quest2 quest3 quest4 quest5 END
LAF HANDLE_CHARSETS
Expand Down

0 comments on commit 5ab04a3

Please sign in to comment.