Luclin pets

Discussion in 'General Discussion' started by Baltamel, Feb 29, 2024.

  1. Baltamel

    Baltamel New Member

    Messages:
    1
    Hi, will dire charm pets steal exp (even if 1pt of damage is done) ?
     
  2. Darchon

    Darchon I Feel Loved

    Messages:
    3,630
    Yes. Dire charm steals some portion of exp depending on damage dealt I think?

    I’m not sure the exact formula though. Or how it behaves with 2+ dire charmed pets in a group
     
  3. Mokli

    Mokli I Feel Loved

    Messages:
    2,460
  4. Faults

    Faults I Feel Loved

    Messages:
    1,892
    DC can take up to 50% iirc. And i dunno I loved the kill speed (in luclin era in chardok mostly) with 2 DC pets.
     
  5. showstring

    showstring I Feel Loved

    Messages:
    3,339
  6. Break

    Break People Like Me

    Messages:
    616
    This is what Chat GPT tells me the code does:

    1. Checking if the damage done by a pet is greater than zero: This if condition verifies if the damage inflicted by a pet (referred to as dire_pet_damage) is greater than zero. If it is, then it proceeds with the calculation.

    2. Calculating the percentage of damage done by the pet: The percentage of damage done by the pet (pet_dmg_pct) is calculated by dividing the damage done by the pet (dire_pet_damage) by the total damage (total_damage) inflicted in the scenario.

    3. Adjusting experience gained based on pet damage: Depending on the percentage of damage done by the pet, the experience gained (exp) is adjusted. If the pet's damage percentage is equal to or greater than 100% (pet_dmg_pct >= 1.0f), the experience gained is reduced to 25% of the base experience (basexp). If the pet's damage percentage is greater than 50% but less than 100% (pet_dmg_pct > 0.5f), the experience gained is reduced gradually, with a minimum of 25%.

    4. Logging the information: Finally, the code logs the relevant information, including the name of the character (GetName()), the percentage of damage done by the pet, the actual damage done by the pet, the total damage, and the adjusted percentage of experience gained.
     
    Kithani and showstring like this.
  7. showstring

    showstring I Feel Loved

    Messages:
    3,339
    love the ChatGPT "explain to me like I'm not a dev" use case!
    thank you
     
  8. necrotizing

    necrotizing New Member

    Messages:
    3
    My compsci degree continues to be useless. ;-)
     
  9. Mechaike

    Mechaike Well-Known Member

    Messages:
    215
    Double doggo DC team represent. *chants* Chardok Chardok CHARDOK
     
    Ripwind likes this.
  10. kai4785

    kai4785 People Like Me

    Messages:
    321
    Your compsci degree is safe. Giving those instructions back to ChatGPT, and we get a pretty hard to identify bug, and exposes a different bug in the description of #3 above. It says:
    Which churns out the buggy line of code: "0.25f + 0.75f * (1.0f - pet_dmg_pct) * basexp"
    Code:
    [ Only registered users can see the bbcode. Click Here To Register... ]
    A better description of the original code would be:
    If the pet's damage percentage is greater than 50% but less than 100% (pet_dmg_pct > 0.5f), the experience gained is 50% plus half of pet's damage percentage points above 50%.

    When I change just that sentence, I get the following code, which looks correct, if not a little extra verbose. I'll also award points for writing a function rather than a whole class.
    Code:
    [ Only registered users can see the bbcode. Click Here To Register... ]
     
    pivoo likes this.
  11. Pithy

    Pithy I Feel Loved

    Messages:
    2,630
    if pet does less than 50% damage, you get 100% exp

    if pet does 50% damage, you get 75% exp

    if pet does 99.9% damage, you get 50% exp

    (your exp % decreases linearly from 75% to 50% as pet damage increases from 50% to 99.9%)

    if pet does 100% damage, you get 25% exp
     
    Last edited: Mar 31, 2024
  12. Pithy

    Pithy I Feel Loved

    Messages:
    2,630
    the interesting question is whether that code should apply to the damage done by each DC pet, or to the aggregate damage done by all DC pets controlled by all players in the group
     
  13. surron

    surron People Like Me

    Messages:
    554
    i didn't dig much into it, but it looks like `dire_pet_damage` will be incremented any time any DC pet attacks the mob (even if controlling player is not in group)
     
    Pithy likes this.