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

only for knights... doesnt work!

xexam

New Member
Joined
Aug 3, 2010
Messages
172
Reaction score
2
how do i make requirement "only for knights" or "only for sorcerer"? for knights, in weapons.xml i have
Code:
<melee id="7777" level="50" unproperly="1" event="function" value="default">
		<vocation id="4"/>
		<vocation id="8" showInDescription="0"/>

and in game it stays "can be blablabla only by knight at level 50 or higher" but every vocation can wear it!!!!- they can only equip it and for example sorcerers can equip it but they cant attack with this weapon. how make this weapon not possible to equip by sorcerers,druids and paladins? (only possible by knights)

another little question : how to change player for example fist attack? because my character has a 25k lvl and 10 skill fist fighting, and anyway my char hit other players 1000dmg with fist... its weird... how to lower it?
 
remove the code from weapons.xml, and add it to movements.xml (it's not the same code though!)

about fist damage, it's because of your level. the skill level that's used in formula is actually skill + level
you can modify weapons.cpp:
Code:
bool Weapon::useFist(Player* player, Creature* target)
{
	const Position& playerPos = player->getPosition();
	const Position& targetPos = target->getPosition();
	if(!Position::areInRange<1,1>(playerPos, targetPos))
		return false;

	float attackFactor = player->getAttackFactor();
[B]	int32_t attackSkill = player->[COLOR="red"]skills[SKILL_FIST][SKILL_LEVEL][/COLOR];[/B]
	int32_t attackValue = 7;

	double maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor);
	if(random_range(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE))
	{
		maxDamage = std::pow(maxDamage, g_config.getDouble(ConfigManager::CRITICAL_HIT_MUL));
		player->sendCritical();
	}

	Vocation* vocation = player->getVocation();
	if(vocation && vocation->getMultiplier(MULTIPLIER_MELEE) != 1.0)
		maxDamage *= vocation->getMultiplier(MULTIPLIER_MELEE);

	maxDamage = std::floor(maxDamage);
	int32_t damage = -random_range(0, (int32_t)maxDamage, DISTRO_NORMAL);

	CombatParams fist;
	fist.blockedByArmor = true;
	fist.blockedByShield = true;
	fist.combatType = COMBAT_PHYSICALDAMAGE;

	Combat::doCombatHealth(player, target, damage, damage, fist);
	if(!player->hasFlag(PlayerFlag_NotGainSkill) && player->getAddAttackSkill())
		player->addSkillAdvance(SKILL_FIST, 1);

	return true;
}
 
Last edited:
but... there are about 100+ weapons, do i have to do it one by one?

btw. CPP = C++? Do i need to use special program to edit the code? Btw, wheres the weapons.cpp file? Cant find it

Thanks for your answer :)
 
Back
Top