What's new

Sila atakow

Dblegend

Active User
Joined
Aug 12, 2008
Messages
133
Reaction score
1
Witajcie mam pewien problem, poniewaz na skillu 60-80 club postac walnie max 60 a ja chcem aby uderzy?a za na 200-300 moze wiecej tylko niewiem gdzie to ustawci tutaj dwa kawaliki source:
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);
}
Jesli bedzie potrzeba wiecej source to podam, aha i jak sie ustawia dmg w vications.xml, tez niedziala dziala tylko na obrazenia magiczne.
Czy to moze byc przez to ze brakowalo mi pliku do dev-cpp: -lasio, wiec go usunelem z linkersow.
Bardzo prosze o pomoc, jest to dlamnie wazne, dam reput.


PS. Bron 50/30 zwieksza dmg tylko o okolo 40-70 ataku, czy mozna by bylo to zmienic ?
 

Szlufik

Active User
Joined
Dec 29, 2008
Messages
129
Reaction score
2
Odp: Sila atakow

mo?e by? tak ?e nieotrzebnie to usuno?e? : dev-cpp: -lasio
a i przyda?o by sie wiencej source..
To mo?e pomoge =)

________________________________________________
Pomog?em ? Daj Reputa !
 

Dblegend

Active User
Joined
Aug 12, 2008
Messages
133
Reaction score
1
Odp: Sila atakow

zaduzo tamtego source jest ;/ nie wejdzie
pisz na gg Plx
 

arabek3929

Advanced User
Joined
Sep 20, 2008
Messages
312
Reaction score
25
Odp: Sila atakow

A jakiego ty silnika u?ywasz w og?le? - Nie pro?ciej by?o by zmieni? to w vocations.xml ? :)
 

Dblegend

Active User
Joined
Aug 12, 2008
Messages
133
Reaction score
1
Odp: Sila atakow

mam czepots, jak zmieniam w vications nie dziala ;p
 
Top