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

Get wand min/maxchange

Sherice

Sky&Wind
Joined
Jan 20, 2012
Messages
183
Reaction score
7
Location
Sweden
Hello, I've tried to figure this out for about 5h+, but since I'm a total noob at C++, I still haven't figured it out and I ask for help.

What I'm trying to do is to get the min/max change in class WeaponWand.

In weapons.h(and class WeaponWand):
Code:
int32_t minChange, maxChange;

and in weapons.cpp:

Code:
WeaponWand::WeaponWand(LuaInterface* _interface):
    Weapon(_interface)
{
    minChange = 0;
    maxChange = 0;
    params.blockedByArmor = false;
    params.blockedByShield = false;
}

also

Code:
bool WeaponWand::configureEvent(xmlNodePtr p)
{
    if(!Weapon::configureEvent(p))
        return false;

    int32_t intValue;
    if(readXMLInteger(p, "min", intValue))
        minChange = intValue;

    if(readXMLInteger(p, "max", intValue))
        maxChange = intValue;

    return true;
}

So, I'm trying to get the min/max change to get the wand damage. The min/max is written in weapons.xml, but I don't know how to get the values.
I tried with (u)int32_t getblabla() const {return minChange;} and then WeaponWand->getblabla() but that didn't do it.
I made a lua function:
Code:
            Item* item = player->getWeapon(false);
            const Weapon* weapon = g_weapons->getWeapon(item);
            float multiplier = 1.0f;
                if(Vocation* vocation = player->getVocation())
                    multiplier = vocation->getMultiplier(MULTIPLIER_WAND);
        
            int32_t maxValue = (int32_t)(weapon->getMinChange() * multiplier);

            lua_pushnumber(L, maxValue);
(with extern Weapons* g_weapons)
The multiplier is probably self explanatory.

Sorry if this is totally wrong, but I just tried, copied some lines from other codes :p

Thanks in advance, Sherice.
 
I am no expert in c++ and i am unable to help you in that matter, but could you enlighten me why would you need to "get min/max wand damage"?
 
Well, I want to show the dmg ingame >.< much like D3, so you can see how much dmg you have, and compare with other players, since im going to have other functions that increases the dmg.
Maybe it's unnecessary, but still it would be nice to have, I think. Well if it cant be solved, I'll just dump the idea.
 
Eh not really dps, but how much damage you do with your weapon, or with your fist. I've already got so you can check damage from melee weps, and dist, but not wand.
 
Back
Top