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

caster vocation

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,638
Solutions
35
Reaction score
351
i need help in something in caster (combat.cpp)
i want this cod check caster vocation
if(target->getPlayer() || target->getMonster())
caster->isKnight()->getStorage((uint32_t)170218, value);
but always give me this error
class Creature’ has no member named ‘isKnight’

i have in player.cpp
isknight have vocation id 4 - 8 -12
0.4
 
i need help in something in caster (combat.cpp)
i want this cod check caster vocation
if(target->getPlayer() || target->getMonster())
caster->isKnight()->getStorage((uint32_t)170218, value);
but always give me this error
class Creature’ has no member named ‘isKnight’

i have in player.cpp
isknight have vocation id 4 - 8 -12
0.4
Player == Creature but Creature != Player.
Use caster->getPlayer()->isKnight().
 
C++:
if (Player* player = caster->getPlayer())
{
    if (player->isKnight())
    {
        // Code
    }
}
i did
Code:
if(target->getPlayer() || target->getMonster())
        {
if (Player* player = caster->getPlayer())
{
    if (player->isKnight())
    {
            std::string value;
             caster->getPlayer()->isKnight()&&caster->getPlayer()->getStorage((uint32_t)170298, value); // Knight attack bouns
            int32_t plus  = (int32_t)(atoi(value.c_str()));
             if(plus  > 0)
                if (params.combatType == COMBAT_ENERGYDAMAGE or params.combatType ==COMBAT_FIREDAMAGE or params.combatType == COMBAT_PHYSICALDAMAGE or params.combatType ==COMBAT_ICEDAMAGE or params.combatType ==COMBAT_DEATHDAMAGE or params.combatType ==COMBAT_EARTHDAMAGE or params.combatType ==COMBAT_HOLYDAMAGE)
         change  = (int32_t)std::ceil (change  + change  * plus  /300);
        }
}

    }

nothing happen in game but in compile no error

and when i do
Code:
if(target->getPlayer() || target->getMonster())
        {
            std::string value;
             caster->getPlayer()->isKnight()&&caster->getPlayer()->getStorage((uint32_t)170298, value); // Knight attack bouns
            int32_t plus  = (int32_t)(atoi(value.c_str()));
             if(plus  > 0)
                if (caster->getPlayer()->isKnight()&& params.combatType != COMBAT_HEALING)
             change  = (int32_t)std::ceil (change  + change  * plus  /450);
        }
//-----------
server get crash when monster attack player
 
i did
Code:
if(target->getPlayer() || target->getMonster())
        {
if (Player* player = caster->getPlayer())
{
    if (player->isKnight())
    {
            std::string value;
             caster->getPlayer()->isKnight()&&caster->getPlayer()->getStorage((uint32_t)170298, value); // Knight attack bouns
            int32_t plus  = (int32_t)(atoi(value.c_str()));
             if(plus  > 0)
                if (params.combatType == COMBAT_ENERGYDAMAGE or params.combatType ==COMBAT_FIREDAMAGE or params.combatType == COMBAT_PHYSICALDAMAGE or params.combatType ==COMBAT_ICEDAMAGE or params.combatType ==COMBAT_DEATHDAMAGE or params.combatType ==COMBAT_EARTHDAMAGE or params.combatType ==COMBAT_HOLYDAMAGE)
         change  = (int32_t)std::ceil (change  + change  * plus  /300);
        }
}

    }

nothing happen in game but in compile no error

and when i do
Code:
if(target->getPlayer() || target->getMonster())
        {
            std::string value;
             caster->getPlayer()->isKnight()&&caster->getPlayer()->getStorage((uint32_t)170298, value); // Knight attack bouns
            int32_t plus  = (int32_t)(atoi(value.c_str()));
             if(plus  > 0)
                if (caster->getPlayer()->isKnight()&& params.combatType != COMBAT_HEALING)
             change  = (int32_t)std::ceil (change  + change  * plus  /450);
        }
//-----------
server get crash when monster attack player
What the hell is this code :eek:
C++:
if(target->getPlayer() || target->getMonster())
{
    if(Player* player = caster->getPlayer())
    {
        std::string value;
        player->getStorage(170298, value); // Knight attack bouns
        int32_t plus = atoi(value.c_str());

        if(plus > 0)
        {
            if (params.combatType != COMBAT_HEALING)
                change = std::ceil(change + change * plus / 450);
        }
    }
}
 
What the hell is this code :eek:
C++:
if(target->getPlayer() || target->getMonster())
{
    if(Player* player = caster->getPlayer())
    {
        std::string value;
        player->getStorage(170298, value); // Knight attack bouns
        int32_t plus = atoi(value.c_str());

        if(plus > 0)
        {
            if (params.combatType != COMBAT_HEALING)
                change = std::ceil(change + change * plus / 450);
        }
    }
}
ur code work but with small change
change = (int32_t)std::ceil (change + change * plus /200);

and where isknight()?

and my first code work from 6 month but on other source
today i changed the source so i got this problem
 
Last edited:
Back
Top