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

Tfs 1.5 by nekiro palladin no attack weapon when use pot

jareczekjsp

Member
Joined
Jan 30, 2023
Messages
202
Reaction score
11
GitHub
Jarek123
Hello guys I use tfs 1.5 and I have problem whe palladin use potion sto attack from weapon how I can change this ?

If I change in config.lua
Lua:
classicAttackSpeed = false
to
Code:
classicAttackSpeed = true
Is every time lags

when I add to weapons.xml
swing="true" --- not working

I try compile in weapons.h i Change


change from
error in console
Code:
/home/ots/src/weapons.h:79:22: error: ‘bool Weapon::interruptSwing() const’ mark                                ed ‘final’, but is not virtual
   79 |                 bool interruptSwing() const final {
      |                      ^~~~~~~~~~~~~~
/home/ots/src/weapons.h: In member function ‘bool Weapon::interruptSwing() cons                                 ’:
/home/ots/src/weapons.h:81:17: error: expected ‘;’ before ‘}’ token
   81 |                 }
      |                 ^
In file included from /home/ots/src/combat.cpp:25:
/home/ots/src/weapons.h: At global scope:
/home/ots/src/weapons.h:264:22: error: ‘bool WeaponDistance::interruptSwing() co                                nst’ marked ‘override’, but does not override
  264 |                 bool interruptSwing() const override {
      |                      ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/tfs.dir/build.make:189: CMakeFiles/tfs.dir/src/combat.c                                pp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/tfs.dir/all] Error 2
 
try this
The same no attack ehen use potions
Post automatically merged:

try this maybe i wonder maybe its actually same thing im not sure
or tell us if ur using original fluids.lua script or custom?
fluids.lua

Lua:
local drunk = Condition(CONDITION_DRUNK)
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)

local poison = Condition(CONDITION_POISON)
poison:setParameter(CONDITION_PARAM_DELAYED, true)
poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
poison:setParameter(CONDITION_PARAM_STARTVALUE, -5)
poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 4000)
poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local fluidMessage = {
    [FLUID_BEER] = "Aah...",
    [FLUID_SLIME] = "Urgh!",
    [FLUID_LEMONADE] = "Mmmh.",
    [FLUID_MANA] = "Aaaah...",
    [FLUID_LIFE] = "Aaaah...",
    [FLUID_OIL] = "Urgh!",
    [FLUID_URINE] = "Urgh!",
    [FLUID_WINE] = "Aah...",
    [FLUID_MUD] = "Urgh!",
    [FLUID_RUM] = "Aah...",
    [FLUID_MEAD] = "Aaaah..."
}

local distillery = {[5513] = 5469, [5514] = 5470}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local targetItemType = ItemType(target.itemid)
    if targetItemType and targetItemType:isFluidContainer() then
        if target.type == FLUID_NONE and item.type ~= FLUID_NONE then
            target:transform(target:getId(), item.type)
            item:transform(item:getId(), FLUID_NONE)
            return true
        elseif target.type ~= FLUID_NONE and item.type == FLUID_NONE then
            item:transform(item:getId(), target.type)
            target:transform(target:getId(), FLUID_NONE)
            return true
        end
    end

    if target.itemid == 1 then
        if item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        elseif target.uid == player.uid then
            if table.contains({FLUID_BEER, FLUID_WINE, FLUID_MEAD}, item.type) then
                player:addCondition(drunk)
            elseif item.type == FLUID_SLIME then
                player:addCondition(poison)
            elseif item.type == FLUID_MANA then
                player:addMana(math.random(50, 150))
                fromPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            elseif item.type == FLUID_LIFE then
                player:addHealth(60)
                fromPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            end
            player:say(fluidMessage[item.type] or "Gulp.", TALKTYPE_MONSTER_SAY)
            item:transform(item:getId(), FLUID_NONE)
        else
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    else
        local fluidSource = targetItemType and targetItemType:getFluidSource() or FLUID_NONE
        if fluidSource ~= FLUID_NONE then
            item:transform(item:getId(), fluidSource)
        elseif table.contains(distillery, target.itemid) then
            local tmp = distillery[target.itemid]
            if tmp then
                item:transform(item:getId(), FLUID_NONE)
            else
                player:sendCancelMessage("You have to process the bunch into the distillery to get rum.")
            end
        elseif item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        else
            if toPosition.x == CONTAINER_POSITION then
                toPosition = player:getPosition()
            end
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    end
    return true
end
 
so its related to actions the delay is added when commiting an Action
weird that nekiro forgot to downgrade that feature but we take it its because of lack of funding consider donating to nekiro maybe he will fix it
Spit Take Lol GIF by Justin


C++:
void Player::doAttacking(uint32_t)
{
    if (lastAttack == 0) {
        lastAttack = OTSYS_TIME() - getAttackSpeed() - 1;
    }

    if (hasCondition(CONDITION_PACIFIED)) {
        return;
    }

    if ((OTSYS_TIME() - lastAttack) >= getAttackSpeed()) {
        bool result = false;

        Item* tool = getWeapon();
        const Weapon* weapon = g_weapons->getWeapon(tool);
        uint32_t delay = getAttackSpeed();

        if (weapon) {
            if (!weapon->interruptSwing()) {
                result = weapon->useWeapon(this, tool, attackedCreature);
            } else {
                result = weapon->useWeapon(this, tool, attackedCreature);
            }
        } else {
            result = Weapon::useFist(this, attackedCreature);
        }

        SchedulerTask* task = createSchedulerTask(std::max<uint32_t>(SCHEDULER_MINTICKS, delay), std::bind(&Game::checkCreatureAttack, &g_game, getID()));
        setNextActionTask(task, false);

        if (result) {
            lastAttack = OTSYS_TIME();
        }
    }
}
 
Last edited:
I change in player.cpp i paste your script and is better but when I use potion my fast attack very slow down
Post automatically merged:

did u try the new doAttacking i posted?
what is specs of the machine ur hosting on if u dont even have like 4ghz processor on single core why not get dedicated machine on which there be no lag when using !classicspeed?
I change in player.cpp i paste your script and is better but when I use potion my fast attack very slow down,can you help me pal?
 
Last edited:
Back
Top