nickyboy304 Posted January 12, 2010 Author Share Posted January 12, 2010 yea i was wondering how do i make npc's/player's hit randomly instead of the same number over and over again. so likeex:a guy with 3 str will hit 3 all the time, but if we have random hit's from 0-item max hit he could hit 0, 3, 2, 3, 3, 0, 0, 1, 1, 0, 3, something like that.so i was wondering does anyone know how to do this? Link to comment Share on other sites More sharing options...
MasterBit13 Posted January 13, 2010 Share Posted January 13, 2010 @nickyboy304:> yea i was wondering how do i make npc's/player's hit randomly instead of the same number over and over again. so like> > ex:> > a guy with 3 str will hit 3 all the time, but if we have random hit's from 0-item max hit he could hit 0, 3, 2, 3, 3, 0, 0, 1, 1, 0, 3, something like that.> > so i was wondering does anyone know how to do this?No, but I'm guessing this is a Source Edit. Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted January 13, 2010 Share Posted January 13, 2010 you should script it; look for the damage calculation method within the server's source. Link to comment Share on other sites More sharing options...
Kimimaru Posted January 13, 2010 Share Posted January 13, 2010 This is pretty simple to do. Find this in your Main.txt:```Sub OnAttack(Index, Damage) Dim Target```Right under it, add this:```Damage = Int(Rand(Damage + 4, Damage - 4))```Do the same with **Sub OnArrowHit(Index, Damage)**Now, find this:```Sub PlayerHit(Index, NPCNum, Damage)```Add this right under it:```Damage = Int(Rand(Damage + 4, Damage - 4))```That should make it so that your range of damage is 9\. For example, let's say you'd normally hit a 5 on an enemy. After implementing this, you can hit from 1 - 9\. Of course, you can change the numbers to your liking. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now