Searched the forum but really couldnt find anything.. Anyone know off hand. I tried increasing strength and agi and it doesnt seem to do anything.
Is damage based on their level?
BTW i dont have any gear on my npcs, that probably also has to do with it but is there any way to increase their base damage without gear?
How do increase damage done by spawns?
Moderator: Team Members
Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
- Astal
- Posts: 96
- Joined: Tue Dec 09, 2008 1:35 pm
How do increase damage done by spawns?
I DIE FREE!!
-
bolly
- Retired
- Posts: 389
- Joined: Mon Sep 21, 2009 3:03 pm
- Location: Leeds, UK
Re: How do increase damage done by spawns?
I'm not sure if this is the correct function to be looking at but i'm sure someone will clarify this later on. It does look like some things may not apply to NPCs or again this is just for players so hopefully someone can post more
Combat::MeleeAttack in combat.cpp
It checks if it's the primary or secondary being used then gets the damage type of the weapon involved and then queries the weapon damage for that weapon. Then it checks the resists on the victim and also adds some additional damage for monks and bruisers. Then it tries to add a crit chance. The crit chance seems to be determined on the attackers level / 3 + 5.
If its not a bruiser or monk then it goes to Combat::DamageSpawn which generally uses this
damage = (rand()%((int)(high_damage/2-low_damage/2) + low_damage/2)) + (rand()%((int)(high_damage/2-low_damage/2) + low_damage/2)); //this can be simplified by taking out the / 2, but I wanted the damage to be more consistent
so overall the low and high is based around the weapon rather than the attacker - if you take a look into the function NPC_AI::ProcessMelee which is in NPC_AI.cpp you can see it triggers Combat::MeleeAttack in combat.cpp
If the NPC is not wearing a weapon as would probably be likely in most cases then it determines the weapon min and weapon damage like this (seen in Entity::ChangePrimaryWeapon())
melee_combat_data.primary_weapon_damage_low = (int32)(1 + GetLevel() * .2);
melee_combat_data.primary_weapon_damage_high = (int32)(5 + GetLevel() * (GetLevel()/5));
then add this on top
melee_combat_data.primary_weapon_damage_high += (int32)(GetInfoStruct()->str / 10);
Hope that helps, i'm sure there's alot more involved but someone should be able to clarify for you, but as far as i can see Level and the strength of the NPC are the most important factors when the NPC is not wearing a weapon
Combat::MeleeAttack in combat.cpp
It checks if it's the primary or secondary being used then gets the damage type of the weapon involved and then queries the weapon damage for that weapon. Then it checks the resists on the victim and also adds some additional damage for monks and bruisers. Then it tries to add a crit chance. The crit chance seems to be determined on the attackers level / 3 + 5.
If its not a bruiser or monk then it goes to Combat::DamageSpawn which generally uses this
damage = (rand()%((int)(high_damage/2-low_damage/2) + low_damage/2)) + (rand()%((int)(high_damage/2-low_damage/2) + low_damage/2)); //this can be simplified by taking out the / 2, but I wanted the damage to be more consistent
so overall the low and high is based around the weapon rather than the attacker - if you take a look into the function NPC_AI::ProcessMelee which is in NPC_AI.cpp you can see it triggers Combat::MeleeAttack in combat.cpp
If the NPC is not wearing a weapon as would probably be likely in most cases then it determines the weapon min and weapon damage like this (seen in Entity::ChangePrimaryWeapon())
melee_combat_data.primary_weapon_damage_low = (int32)(1 + GetLevel() * .2);
melee_combat_data.primary_weapon_damage_high = (int32)(5 + GetLevel() * (GetLevel()/5));
then add this on top
melee_combat_data.primary_weapon_damage_high += (int32)(GetInfoStruct()->str / 10);
Hope that helps, i'm sure there's alot more involved but someone should be able to clarify for you, but as far as i can see Level and the strength of the NPC are the most important factors when the NPC is not wearing a weapon
- Astal
- Posts: 96
- Joined: Tue Dec 09, 2008 1:35 pm
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: How do increase damage done by spawns?
It is also based on the attacker's skill with the weapon. Originally I had strength being a factor in the damage calculation but it seems to have been removed. Guess I'll have to add it back 
Who is online
Users browsing this forum: No registered users and 0 guests