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

DMG Skill's for CzepOts

SakiLegend

New Member
Joined
Dec 29, 2008
Messages
11
Reaction score
0
Help mi.
How more dmg to skill's ?
Sry, my bad English.

player.cpp:
Code:
switch(weaponType){
        case WEAPON_SWORD:
            attackSkill = getSkill(SKILL_SWORD, SKILL_LEVEL) * vocation->getSwordDamage();
            break;

        case WEAPON_CLUB:
        {
            attackSkill = getSkill(SKILL_CLUB, SKILL_LEVEL) * vocation->getClubDamage();
            break;
        }

        case WEAPON_AXE:
        {
            attackSkill = getSkill(SKILL_AXE, SKILL_LEVEL);
            break;
        }
        
        case WEAPON_FIST:
        {
            attackSkill = getSkill(SKILL_FIST, SKILL_LEVEL);
            break;
        }

        case WEAPON_DIST:
        {
            attackSkill = getSkill(SKILL_DIST, SKILL_LEVEL) * vocation->getDistDamage();
            break;
        }
        default:
        {
            attackSkill = 0;
            break;
        }    
    }
    return attackSkill;

combat.cpp:
Code:
#include "otpch.h"

#include "combat.h"

#include "game.h"
#include "condition.h"
#include "creature.h"
#include "player.h"
#include "const80.h"
#include "tools.h"
#include "weapons.h"

#include <sstream>

extern Game g_game;
extern Weapons* g_weapons;

Combat::Combat()
{
	params.condition = NULL;
	params.valueCallback = NULL;
	params.tileCallback = NULL;
	params.targetCallback = NULL;
	area = NULL;

	formulaType = FORMULA_UNDEFINED;
	mina = 0.0;
	minb = 0.0;
	maxa = 0.0;
	maxb = 0.0;
}

Combat::~Combat()
{
	delete params.condition;
	delete params.valueCallback;
	delete params.tileCallback;
	delete params.targetCallback;
	delete area;
}

void Combat::getMinMaxValues(Creature* creature, Creature* target, int32_t& min, int32_t& max) const
{
	if(!creature)
		return;

	if(Player* player = creature->getPlayer())
    {
		if(params.valueCallback)
			params.valueCallback->getMinMaxValues(player, min, max);
		else
        {
			switch(formulaType){
				case FORMULA_LEVELMAGIC:
				{
					max = (int32_t)((player->getLevel() * 1.5 + player->getMagicLevel() * 4) * player->vocation->getMagicDamage() * 0.01 * 1. * mina + minb);
					min = (int32_t)((player->getLevel() * 1.5 + player->getMagicLevel() * 4) * player->vocation->getMagicDamage() * 0.01 * 1. * maxa + maxb);
					break;
				}

				case FORMULA_SKILL:
				{
					Item* tool = player->getWeapon();
					const Weapon* weapon = g_weapons->getWeapon(tool);
					
					min = (int32_t)minb;
					
					if(weapon)
						max = (int32_t)(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb);
					else
						max = (int32_t)maxb;

					break;
				}

				default:
					min = 0;
					max = 0;
					break;
			}

			//std::cout << "No callback set for combat" << std::endl;
		}
	}
	else
		creature->getCombatValues(min, max);
}
 

Similar threads

Back
Top