Author
|
Topic: peanut butter cups
|
joshriot |
posted 10-23- 10:03 PM CT (US)
is there any way possible to harness the number of damage that is dealt to a creature? i have a spell and i want it to deal a creature damage and then dink gains life equal to the damage delt. is this in any way possible?
|
me
|
posted 10-26- 10:29 AM CT (US)
me |
me
|
posted 10-26- 10:31 AM CT (US)
y dont you just go to the dink network www.thedink.net and download cheat12.zip if you cant find it email me at czarvodomn@yahoo.com |
FF4LIFE
|
posted 10-26- 04:04 PM CT (US)
Uh...right...Anyway, one thing you could do is deal out a fixed damage. Then you just use sp_damage for whatever then increase dinks hp that much. Another way would be to check the hp of the monster. Wait...i'm not sure if this'll work or not..but maybe something like...... void main(void) { int &hp1 = sp_hitpoints(¤t_sprite, -1); int &hp2; int ✓ } void hit(void) { if (&check == 0) { &hp2 = sp_hitpoints(¤t_sprite, -1); &hp1 -= &hp2; &check = 1; goto end; } if (&check == 1) { &hp1 = sp_hitpoints(¤t_sprite, -1); &hp2 -= &hp1; &check = 0; goto end; } end: } This should work...if you don't understand whats going on, just tell me to explain it in detail. |
joshriot
|
posted 10-27- 01:38 PM CT (US)
got ya. i thought about doing something like that, but i thought maybe there would be an easier way:< oh well. |
Tamtur
|
posted 10-27- 02:40 PM CT (US)
Well, the sprite's defense is just taken right off the top of the damage no matter how the damage is done, I think. All you would have to do is wherever you damage the creature in the script, subtract their defense from the amount of damage and add the resulting number to dink's life. For example, if you used the 'hurt' command to damage the creature (and the target's sprite number has already been figured out and is &target) you could do:int &damage = random(4, 6); hurt (&target, &damage); int &crap = sp_defense(&target, -1); &damage -= &crap; &life += &damage; if (&life > &lifemax) { &life = &lifemax } This would damage the creature for between 6 and 10 points and add it to dink's life. |
joshriot
|
posted 10-27- 02:43 PM CT (US)
okay. i did something like that but one problem. i did &hp1 = sp_hitpoints(missile_target, -1); in the damage() section of the dam-burn for the missile. the problem is that the script can only record the hitpoints AFTER the sprite has already been damaged. this way, the very first time you target a sprite with the spell no life is gained. i tried to do hp1 in the use() of the item-sburn for the spell but it dosnt record &hp1 = sp_hitpoints(missile_target, -1); properly. does missile_target only work after a sprite has already been damaged by the missile? if not, where should i put the statement to record the hp before the target is damaged? if anyone can help it is greatly appreciated. |
joshriot
|
posted 10-27- 02:49 PM CT (US)
tamtur, i like your method too. say the missile has strength 10, how do i know what to use for the random 4,6 thing? i thought it was 10 damage minus a random of defense, not the other way around. im confused about that. |
Tamtur
|
posted 10-27- 03:25 PM CT (US)
Per dinkc.txt, if a sprite has a strength of 10, it will hit between 6 and 10, and the defense is taken straight off the top.In this case, I think I would try not using the missile strength to damage the creature, since it would be complex to figure out how much it damaged the creature. How about something like this as the script attached to your missile: void main (void) { sp_strength(¤t_sprite, 0); sp_touch_damage(¤t_sprite, -1); } void touch ( void ) { int &damage = random(4, 6); hurt (&missile_target, &damage); int &crap = sp_defense(&missile_target, -1); &damage -= &crap; &life += &damage; if (&life > &lifemax) { &life = &lifemax; } wait(1); sp_active(¤t_sprite, 0); }
|
joshriot
|
posted 10-28- 08:52 AM CT (US)
i will try it this way, but say i want the missile to be strength 20, is the damage 6-20, 16-20, or what? |
joshriot
|
posted 10-28- 08:56 AM CT (US)
also, shouldnt the hurt be after the defense - crap? ps, thanks for trying to help me with this |
FF4LIFE
|
posted 10-28- 02:09 PM CT (US)
Hrm, this is quite a predicament... Well, I'm stumped for now.. |
joshriot
|
posted 10-29- 03:02 PM CT (US)
tamtur your method is errorous. touch() is run when dink touches the missile, NOT when the missile hits a sprite. even if touch is run when the missile hits a target, there is no way for the missile to know whether it damages the target or not. dink will still gain the life if the spell is blasted at a tree! this is no good.i have an idea although i have not tried it yet. yesterday i tried giving the missile strength -1, and putting the gain life for damage stuff in the damage() section. it worked flawlessly. now, if i use ff4life's idea of checking for a loss of hitpoints and tamtur's idea of damaging with hurt then the spell might very well work properly. i will try to do this soon and i will let you know how it works out. gee wiliker jumping jiliker jollys!
|
joshriot
|
posted 10-29- 03:52 PM CT (US)
here we go here we go here we go, here we go here we go here we go!sp_strength(¤t_sprite, -1); void damage( void ) { if (sp_hitpoints(&missile_target, -1) > 0) { hurt(&missile_target, 5); &life += 5; if (&life > &lifemax) { &life = &lifemax; } } } the only problem i can see with this is if a sprite has one hitpoint then dink will gain 4 additional life, but hey who cares. im still not sure on the logic of the random 6-10 damage minus defense being the same as sp_strength of 10 for the missile so if someone can explain this to me i will be more than happy. |
Tamtur
|
posted 10-30- 02:49 PM CT (US)
The random 6-10 part is what mimics the strength of 10 -- the sprite's defense is subtracted after hurting the sprite, rather than before, so that dink's gained life will be equal to the actual damage to the sprite. The 'hurt' command automatically subtracts the target sprite's defense before damaging it. |
FF4LIFE
|
posted 10-31- 12:10 AM CT (US)
Yes, putting a bit of a randomness in there and subtracting the sprite's def would definately improve the weapon. |
joshriot
|
posted 10-31- 03:01 PM CT (US)
okay, thanks guyssamson is a monster and you are too we are all monsters and we like poo |