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

Attack Damage/Attack Speed on Bow/Crossbow

Advent

Custom RPG Maker
Joined
Oct 3, 2009
Messages
306
Reaction score
7
Hello, I made script which changes attack speed on item upgrade and stuff but it does not work on bow type weapon. I want to somehow make bow change attackspeed as well. It can be other weapon or wrote in other style but it shall take ammunition and require ammunition to shoot. How is it possible ?

Lets say that I am using /attr set attackspeed 500 on Sword and its attacking really fast but after I use it on bow, nothing happens. Please help, show me way to do this. I am going to keep on researching and looking for solution but if you know how I can do it then please tell me in this thread.

I thought about something like creating script for this weapon but treating it as normal weapon (assassin star without stacks ?) which is going to make animation of shooting arrows and keeps on taking arrows from backpack/arrow place and if you do not have arrows, it doesnt shot. Can you help ?
 
the attackspeed of the bow depends on the arrows. since it takes the damage from the arrows, it also takes the attackspeed from the arrows.
A way you can do is by using "onEquip" with the arrows, and automatically set thier attackspeed to what the bow has.

I would be ever so grateful if you could point me in the right direction as to where/how I would go about doing this?
movements.xml?
weapons.xml?
items.xml? (obviously this is where I change the ammo attackspeed)

in which of the files to I add the "onEquip" you mention, and what would it look like in text form?

Thank you so much for your help. This has been driving me insane for an entire day. :mad:
 
I know this is old thread, but I came across the same problem - attackspeed on distance weapons like bows and crossbows.

This because "weapon" variable inside function getAttackSpeed defined here - Fir3element/3777 don't contain distance weapons with ammunition because this part of code - Fir3element/3777. My workaround (not the best, but works) is to replace Fir3element/3777 with

Lua:
void Player::doAttacking(uint32_t)
{
    Item* item = getWeapon(false);
    uint32_t attackSpeed = (item && item->getAttackSpeed() != 0) ? item->getAttackSpeed() : getAttackSpeed();

    if(!lastAttack)
        lastAttack = OTSYS_TIME() - attackSpeed - 1;
    else if((OTSYS_TIME() - lastAttack) < attackSpeed)
        return;

    if(hasCondition(CONDITION_PACIFIED) && !hasCustomFlag(PlayerCustomFlag_IgnorePacification))
    {
        lastAttack = OTSYS_TIME();
        return;
    }

    if(const Weapon* _weapon = g_weapons->getWeapon(item))
 
Back
Top