• 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!

Paladins dont attack at same sqm

secondlife

Member
Joined
Aug 1, 2009
Messages
298
Reaction score
23
hi people, i have a problem with tfs 0.4.
Paladins they do not cause damage in players/monsters at same sqm (only effect poof). how can i solve this problem?

58051d4f958ed_probleman1.png.4bcec9fd1c9dc162b7f115db7f0def5e.png


Melee (knights) attack works correctly.
I think it has to do with the distance from the target.
I find this codes in weapons.cpp, Does it have anything to do with it?
Code:
if(item->getWeaponType() == WEAPON_AMMO)
    {
        Item* bow = player->getWeapon(true);
        if(bow && bow->getHitChance() != -1)
            chance += bow->getHitChance();
    }

    if(random_range(1, 100) > chance)
    {
        //we failed attack, miss!
        Tile* destTile = target->getTile();
        if(!Position::areInRange<1,1,0>(player->getPosition(), target->getPosition()))
        {
            std::vector<std::pair<int32_t, int32_t> > destList;

            destList.push_back(std::make_pair(-1, 1));


            std::random_shuffle(destList.begin(), destList.end());
            Position destPos = target->getPosition();

            Tile* tmpTile = NULL;
            for(std::vector<std::pair<int32_t, int32_t> >::iterator it = destList.begin(); it != destList.end(); ++it)
            {
                if((tmpTile = g_game.getTile(destPos.x + it->first, destPos.y + it->second, destPos.z))
                    && !tmpTile->hasProperty(IMMOVABLEBLOCKSOLID) && tmpTile->ground)
                {
                    destTile = tmpTile;
                    break;
                }
            }
        }

        Weapon::internalUseWeapon(player, item, destTile);
    }
    else
        Weapon::internalUseWeapon(player, item, target, damageModifier);

    return true;
}

Many thanks to anyone who can help-me with this issue, hugs!
 
Back
Top