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

Request weapon: It's a cool idea i think!

Mindless

New Member
Joined
Feb 25, 2010
Messages
8
Reaction score
0
Location
Peanutbutterland!
Hello,
I'm creating a server, it's based on diffrent vocations. And i'm trying to make a weapon. Use of the weapon? It hits very fast ( 0.2 per sec ) so 5 x a second, it want a crit chance on it, like 4 %. ( If you crit you will shoot a throwing knife, and you will see a text like BOOM!) It's just an idea. I hope someone could help me.

And with help i mean: Could you make an example script :)
I'll give reputation for this, because in my eyes it's hard to make haha!

Thanks in advance.
 
Well i would like to put it on 8 ,but that's just a piece of cake. I'll just have to change the damage. But the script.. I'm not practised yet, to make that. Would be so cool..
 
source edit .. (weapons.cpp)
Code:
int32_t WeaponMelee::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
{
	int32_t attackSkill = player->getWeaponSkill(item);
	int32_t attackValue = std::max((int32_t)0, (int32_t(item->getAttack() + item->getExtraAttack()) - elementDamage));
	float attackFactor = player->getAttackFactor();

	double maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor);
[B][COLOR="Red"]	if(random_range(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE))[/COLOR][/B]
	{
		maxValue = std::pow(maxValue, g_config.getDouble(ConfigManager::CRITICAL_HIT_MUL));
		player->sendCritical();
	}
 
Back
Top