Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thorus' bribe dialog doesn't disappear #16

Closed
AmProsius opened this issue Dec 30, 2020 · 5 comments · Fixed by #66
Closed

Thorus' bribe dialog doesn't disappear #16

AmProsius opened this issue Dec 30, 2020 · 5 comments · Fixed by #66
Labels
impl: hook script func This issue requires hooking script functions. provided fix This issue has a fix provided in the comments. type: session fix The fix for this issues is persistent across a session. validation: validated This issue is still present even with Systempack/Union.
Milestone

Comments

@AmProsius
Copy link
Owner

AmProsius commented Dec 30, 2020

Describe the bug

  • Thorus can be bribed if the player has already obtained the permit to an audience with Gomez.
  • The option to bribe Thorus stays open after the player has already bribed him.

Expected behavior
Thorus can't be bribed if the player has already obtained the permit to pass the guards. Also the option to bribe Thorus disappears after the player has bribed him.

@AmProsius AmProsius added this to To Do in v1.0.0 Dec 30, 2020
@AmProsius AmProsius removed ai labels Jan 1, 2021
@catalinstoian
Copy link

catalinstoian commented Jan 9, 2021

DIA_GRD_200_Thorus.d

// ************************************************************
// Give1000Ore
// ************************************************************
INSTANCE Info_Thorus_Give1000Ore (C_INFO)
{
npc = GRD_200_THORUS;
nr = 1;
condition = Info_Thorus_Give1000Ore_Condition;
information = Info_Thorus_Give1000Ore_Info;
permanent = 1;
description = "I have the 1000 nuggets of ore. Now let me go in!";
};
FUNC INT Info_Thorus_Give1000Ore_Condition()
{
if (Npc_KnowsInfo(hero,Info_Thorus_BribeGuard))
{
return 1;
};
};
FUNC VOID Info_Thorus_Give1000Ore_Info()
{
AI_Output (other, self,"Info_Thorus_Give1000Ore_15_00"); //I have the 1000 nuggets of ore. Now let me go in!
if (Npc_HasItems(other, ItMiNugget)>=1000)
{
B_GiveInvItems (other,self,ItMiNugget,1000);
AI_Output (self, other,"Info_Thorus_Give1000Ore_09_01"); //Alright, go ahead. You can go in the castle, but don't do anything stupid, okay?
var C_NPC wache212; wache212 = Hlp_GetNpc(Grd_212_Torwache);
var C_NPC wache213; wache213 = Hlp_GetNpc(Grd_213_Torwache);
wache212.aivar[AIV_PASSGATE] = TRUE;
wache213.aivar[AIV_PASSGATE] = TRUE;
}
else
{
AI_Output (self, other,"Info_Thorus_Give1000Ore_09_02"); //Don't try'n trick me, kid. You don't have 1000 nuggets of ore!
};
};

changed to

// ************************************************************
//                      Give1000Ore
// ************************************************************
var int thorus_bribed;

INSTANCE Info_Thorus_Give1000Ore (C_INFO)
{
    npc         = GRD_200_THORUS;
    nr          = 1;
    condition   = Info_Thorus_Give1000Ore_Condition;
    information = Info_Thorus_Give1000Ore_Info;
    permanent   = 1;
    description = "I have the 1000 nuggets of ore. Now let me go in!";
};


FUNC INT Info_Thorus_Give1000Ore_Condition()
{
    if (Npc_KnowsInfo(hero,Info_Thorus_BribeGuard))
    && (Diego_GomezAudience == FALSE)
    && (thorus_bribed == FALSE)
    {
        return 1;
    };
};

FUNC VOID Info_Thorus_Give1000Ore_Info()
{
    AI_Output (other, self,"Info_Thorus_Give1000Ore_15_00"); //I have the 1000 nuggets of ore. Now let me go in!


    if (Npc_HasItems(other, ItMiNugget)>=1000)
    {
        B_GiveInvItems  (other,self,ItMiNugget,1000);
        AI_Output (self, other,"Info_Thorus_Give1000Ore_09_01"); //Alright, go ahead. You can go in the castle, but don't do anything stupid, okay?
        var C_NPC wache212; wache212 = Hlp_GetNpc(Grd_212_Torwache);
        var C_NPC wache213; wache213 = Hlp_GetNpc(Grd_213_Torwache);
        wache212.aivar[AIV_PASSGATE] = TRUE;
        wache213.aivar[AIV_PASSGATE] = TRUE;
        thorus_bribed = TRUE;
    }
    else
    {
        AI_Output (self, other,"Info_Thorus_Give1000Ore_09_02"); //Don't try'n trick me, kid. You don't have 1000 nuggets of ore!
    };
};

FUNC INT Info_Thorus_LetterForMages_Condition()
{
if Npc_KnowsInfo(hero, Info_Thorus_EnterCastle)
&& (Npc_HasItems (hero, ItWr_Fire_Letter_01) || Npc_HasItems (hero, ItWr_Fire_Letter_02))
{
return 1;
};
};

changed to

FUNC INT Info_Thorus_LetterForMages_Condition()
{
    if  Npc_KnowsInfo(hero, Info_Thorus_EnterCastle)
    &&  (Diego_GomezAudience == FALSE)
    &&  (thorus_bribed == FALSE)
    &&  (Npc_HasItems (hero, ItWr_Fire_Letter_01) || Npc_HasItems (hero, ItWr_Fire_Letter_02))
    {
        return 1;
    };
};

@szapp
Copy link
Collaborator

szapp commented Jan 15, 2021

It is quite tricky to set the variable thorus_bribed. It would be easier to check if the AI-variable AIV_PASSGATE of Grd_213_Torwache is set to true, i.e. the hero is allowed to enter the castle. Do you think it would be enough?

@AmProsius
Copy link
Owner Author

Is AIV_PASSGATE set to true when Thorus is bribed? I don't see any problem then.

@catalinstoian
Copy link

It is quite tricky to set the variable thorus_bribed. It would be easier to check if the AI-variable AIV_PASSGATE of Grd_213_Torwache is set to true, i.e. the hero is allowed to enter the castle. Do you think it would be enough?

Should look into Diego_GomezAudience = TRUE

@AmProsius AmProsius linked a pull request Jan 17, 2021 that will close this issue
@szapp
Copy link
Collaborator

szapp commented Jan 18, 2021

It is quite tricky to set the variable thorus_bribed. It would be easier to check if the AI-variable AIV_PASSGATE of Grd_213_Torwache is set to true, i.e. the hero is allowed to enter the castle. Do you think it would be enough?

Should look into Diego_GomezAudience = TRUE

Good hint. It looks like this variable has strictly speaking nothing to do with it. In my opinion, the bribe dialog should always remain there until the player is granted access to the castle. This is unambiguously evident by the AI-variable of the guards at the gates. I will update the PR.

v1.0.0 automation moved this from To Do to Done Jan 18, 2021
AmProsius added a commit that referenced this issue Jan 18, 2021
#16 add new condition to Thorus's bribe dialogs
@szapp szapp added the type: session fix The fix for this issues is persistent across a session. label Jan 18, 2021
@AmProsius AmProsius added this to the v1.0.0 milestone Feb 13, 2021
@AmProsius AmProsius added provided fix This issue has a fix provided in the comments. validation: validated This issue is still present even with Systempack/Union. labels Mar 13, 2021
@szapp szapp added this to Info condition (hook) in Fix templates Mar 15, 2021
@szapp szapp added the impl: hook script func This issue requires hooking script functions. label Mar 16, 2021
@szapp szapp moved this from Hook Daedalus function to Unsorted in Fix templates Mar 16, 2021
@szapp szapp moved this from Unsorted to Dialog: Info condition in Fix templates Mar 17, 2021
AmProsius added a commit that referenced this issue Apr 12, 2021
@szapp szapp moved this from Modify dialog conditions to Add dialog conditions in Fix templates Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impl: hook script func This issue requires hooking script functions. provided fix This issue has a fix provided in the comments. type: session fix The fix for this issues is persistent across a session. validation: validated This issue is still present even with Systempack/Union.
Projects
Fix templates
Add dialog conditions
v1.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants