Tibia Mod
Forum zostało Przeniesione tutaj:
http://tibiamod.xaa.pl/

Zapraszam.

Join the forum, it's quick and easy

Tibia Mod
Forum zostało Przeniesione tutaj:
http://tibiamod.xaa.pl/

Zapraszam.
Tibia Mod
Czy chcesz zareagować na tę wiadomość? Zarejestruj się na forum za pomocą kilku kliknięć lub zaloguj się, aby kontynuować.

[8.54] System 2 broni

Go down

[8.54] System 2 broni Empty [8.54] System 2 broni

Pisanie by Anastazjusz Czw Lis 15, 2012 8:33 pm

Witam.
Przedstawiam wam kod dzięki któremu nasz dmg będzie wzmacniany nie przez 1, a przez 2 bronie jednocześnie.
Testowane na TFS 0.3.6pl

W player.cpp znajdź
Kod:
ret = RET_CANONLYUSEONEWEAPON;

Znajdziesz 2 takie linijki, obydwie zastąp:
Kod:
ret = RET_NOERROR;

W weapons.h znajdź:
Kod:
const Weapon* getWeapon(const Item* item) const;

I poniżej wklej:
Kod:

static int32_t getAttackLeft;
static int32_t getAttackRigth;
static int32_t getLeftExtraAttack;
static int32_t getRigthExtraAttack;

Następnie w weapons.cpp znajdź:
Kod:

int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
{
        int32_t attackSkill = player->getWeaponSkill(item);
        int32_t attackValue = std::max((int32_t)0, (int32_t(item->getAttack() + item->getExtraAttack()) - elementDamage));
        float attackFactor = player->getAttackFactor();

I zamień na:
Kod:

int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
{
               
    int32_t getAttackLeft;
    int32_t getAttackRigth;
    int32_t getLeftExtraAttack;
        int32_t getRigthExtraAttack;
   
    getAttackLeft = 0;
    getAttackRigth = 0;
    getLeftExtraAttack = 0;
        getRigthExtraAttack = 0;
   
    if (getAttackLeft == 0)
    {
        if (player->getInventoryItem(SLOT_LEFT) != NULL)
        {
        getAttackLeft = player->getInventoryItem(SLOT_LEFT)->getAttack();
        getLeftExtraAttack = player->getInventoryItem(SLOT_LEFT)->getExtraAttack();
        }
        else if (player->getInventoryItem(SLOT_LEFT) == NULL)
        {
        getAttackLeft = 0;
        getLeftExtraAttack = 0; 
        }
    } 
   
    if (getAttackRigth == 0)
    {
        if (player->getInventoryItem(SLOT_RIGHT) != NULL)
        {
        getAttackRigth = player->getInventoryItem(SLOT_RIGHT)->getAttack();
        getRigthExtraAttack = player->getInventoryItem(SLOT_RIGHT)->getExtraAttack();
        }
        else if (player->getInventoryItem(SLOT_RIGHT) == NULL)
        {
        getAttackRigth = 0;
        getRigthExtraAttack = 0; 
        }
    }                                               
   
   
    int32_t attackValue = std::max((int32_t)0, (int32_t)((getAttackLeft + getLeftExtraAttack + getAttackRigth + getRigthExtraAttack) - elementDamage));                                             
           
    int32_t attackSkill = player->getWeaponSkill(item);
    float attackFactor = player->getAttackFactor();

Skompiluj.

Pozdrawiam


Anastazjusz
Moderator

Liczba postów : 12
Join date : 14/11/2012

Powrót do góry Go down

Powrót do góry

- Similar topics

 
Permissions in this forum:
Nie możesz odpowiadać w tematach