• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[PvP] Players dmg

yoiker

Member
Joined
Jan 21, 2012
Messages
194
Solutions
1
Reaction score
9
Hi good morning my country. I wish someone who knows could add sources here I found this forum and I liked my combat.cpp that is not in my combat.cpp as there used TFS 1.2

this is what I want to add:

https://otland.net/threads/pvp-play...el-and-less-damage-using-physical-dmg.178061/

and this is my combat.cpp which of course is not equal

Code:
void Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, CombatDamage* data)
{
    assert(data);
    CombatDamage damage = *data;
    if (g_game.combatBlockHit(damage, caster, target, params.blockedByShield, params.blockedByArmor, params.itemId != 0)) {
        return;
    }

    if ((damage.primary.value < 0 || damage.secondary.value < 0) && caster) {
        Player* targetPlayer = target->getPlayer();
        if (targetPlayer && caster->getPlayer() && targetPlayer->getSkull() != SKULL_BLACK) {
            damage.primary.value /= 2;
            damage.secondary.value /= 2;
        }
    }

    if (g_game.combatChangeHealth(caster, target, damage)) {
        CombatConditionFunc(caster, target, params, nullptr);
        CombatDispelFunc(caster, target, params, nullptr);
    }
}

Sorry for my bad translation
 
EuKjdX6.png
 
Cause this function isnt designed for your TFS (Correct me if im wrong, just a theory). It would save you a lot of brain hurting to just do this in statschange or w/e is used in tfs 1x+
Remember you would have to basically create your own function for effects if you use statschange to reduce pvp damage cause default is the drawblood effect or whatever effect you set it to be.
Nobody is most likely (sadly) going to do this source edit for free for you
 
Last edited:
Back
Top