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

Double exp when killing an NPC with a ranged weapon #12

Closed
AmProsius opened this issue Dec 30, 2020 · 1 comment · Fixed by #104
Closed

Double exp when killing an NPC with a ranged weapon #12

AmProsius opened this issue Dec 30, 2020 · 1 comment · Fixed by #104
Labels
impl: modify/analyze script func This issue requires analyzing and/or modifying the bytecode of script functions. impl: replace func call This issue requires replacing function calls in the scripts. 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
The player gains Experience again when killing an NPC with a ranged weapon if the player already beat the NPC in melee combat.

Expected behavior
The player no longer receives Experience again when killing an NPC with a ranged weapon if the player already beat the NPC in melee combat.

@AmProsius AmProsius added this to To Do in v1.0.0 Dec 30, 2020
@AmProsius AmProsius removed ai labels Jan 1, 2021
@AmProsius AmProsius added validation: required This issue needs validation from one of the validators. validation: validated This issue is still present even with Systempack/Union. and removed validation: required This issue needs validation from one of the validators. labels Jan 28, 2021
@AmProsius
Copy link
Owner Author

AmProsius commented Feb 4, 2021

if C_NpcIsHuman(self)
&& Npc_WasInState(self, ZS_Unconscious)
{
PrintDebugNpc (PD_ZS_CHECK, "...Opfer ist bewußtloser Mensch!");
// SN: keine XP für Finishing-Move!!!
}
else
{
PrintDebugNpc (PD_ZS_CHECK, "...Opfer ist entweder nicht bewußtlos oder kein Mensch!");
B_GiveXP (self.level * XP_PER_LEVEL_DEAD);
};

changed to

    if  C_NpcIsHuman(self)
    &&  (Npc_WasInState(self, ZS_Unconscious) || self.aivar[AIV_WASDEFEATEDBYSC])
    {
        PrintDebugNpc   (PD_ZS_CHECK,   "...Opfer ist bewußtloser Mensch!");
        // SN: keine XP für Finishing-Move!!!
    }
    else
    {
        PrintDebugNpc   (PD_ZS_CHECK,   "...Opfer ist entweder nicht bewußtlos oder kein Mensch!");
        B_GiveXP (self.level * XP_PER_LEVEL_DEAD);
    };

szapp added a commit that referenced this issue Feb 7, 2021
@szapp szapp moved this from To Do to In Progress in v1.0.0 Feb 9, 2021
v1.0.0 automation moved this from In Progress to Done Feb 9, 2021
AmProsius added a commit that referenced this issue Feb 9, 2021
#12: Prevent double XP for ranged combat
@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. type: session fix The fix for this issues is persistent across a session. labels Mar 13, 2021
szapp added a commit that referenced this issue Mar 13, 2021
szapp added a commit that referenced this issue Mar 13, 2021
@szapp szapp added this to Replace calls in Fix templates Mar 15, 2021
@szapp szapp added impl: replace func call This issue requires replacing function calls in the scripts. impl: modify/analyze script func This issue requires analyzing and/or modifying the bytecode of script functions. labels Mar 16, 2021
@szapp szapp moved this from Replace function calls to Unsorted in Fix templates Mar 16, 2021
@szapp szapp moved this from Unsorted to NPC function in Fix templates Mar 17, 2021
@szapp szapp moved this from Modify NPC function to Some NPC Test? (Todo adjust name) 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: modify/analyze script func This issue requires analyzing and/or modifying the bytecode of script functions. impl: replace func call This issue requires replacing function calls in the scripts. 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
NPC manual test (TODO rename)
v1.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants