Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Scripting combat


shadowwulf
 Share

Recommended Posts

so in on attack i want to do the following.

run my subs for player development on both parties-done
calculate/perform roll for the target to dodge the attack-designed but not scripted
calculate damage to be done-where i have trouble
calculate/perform roll for chance to crit-designed but not scripted
reduce damage if hit based on target def-designed but not scripted

now i can mess with the damage variable all i want but what about weapons?
if i change it i am ignoring weapon bonuses.
i didnt see any commands for checking the damage.
would i have to script all weapons?
Link to comment
Share on other sites

im dumb… now that i read this the next day i realize that if damage is basically the weapon damage then i should just use damage=damage+mycalculations

right?

icould do the same for bows i guess... but it takes the player somuch skill to hit with bows already....
Link to comment
Share on other sites

You could do "damage=damage+mycalculations" but when the sub ends it wont add it to the damage they are doing, You would have to set that yourself. with```
Call DamagePlayer(PersonDoingDamageIndex, PersonRecievingDamageIndex, DamageAmount)
```
Link to comment
Share on other sites

wait, what? when scripting is enabled, all damage is handled by sadscript. the server just calculates the damage, then damageplayer damages it in the onattack sub in main.txt. if you delete damageplayer from onattack, you can't damage anything. so if you modify the damage, you can change the damage people are doing. I don't know what Brutal is talking about with returning the damage, but modifying the damage variable will work if you modify it before the damageplayer call.
Link to comment
Share on other sites

exactly what i thought.
the only question is how is damage being figured before OnAttack?
i know the weapon is a factor and there is no other way to get a bonus from weapon damage.
so making damage equal only my calculations is bad.
but how else do i get weapon bonus?
Link to comment
Share on other sites

@Shadowwulf:

> exactly what i thought.
> the only question is how is damage being figured before OnAttack?
> i know the weapon is a factor and there is no other way to get a bonus from weapon damage.
> so making damage equal only my calculations is bad.
> but how else do i get weapon bonus?

```
Damage = Damage - GetPlayerStr(index) \ 2
```

Adding that line should make damage equal to just weapon and item bonuses. The Damage variable doesn't include an enemy's defense beforehand, I think. I haven't tested, though, so I'm not sure.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...