Chaos Project

RPG Maker => RPG Maker Scripts => RMVX Script Database => Topic started by: shdwlink1993 on January 11, 2009, 11:59:38 pm

Title: [VX] HoT DoT
Post by: shdwlink1993 on January 11, 2009, 11:59:38 pm
HoT DoT
Authors: shdwlink1993
Version: 1.0b
Type: Poison Control
Key Term: Player / Party / Troop Add-on



Introduction

HoT DoT (Apparantly WoW-speak for Healing/Damage over Time), or Poison Control, is a system designed to let you make poison do more than what it always does. In RMXP and RMVX, poison does one thing only. That can be annoying after a while, like having a recharging health stat, or draining your magic.


Features




Screenshots

These would be completely useless.


Demo

The script is pretty plug-and-play, so I don't think this is needed.


Script

Spoiler: ShowHide

#==============================================================================
# HoT DoT
# Author: Shdwlink1993
# Version: 1.0b
# Type: Poison Control
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# HT Date 1.0b: 1/11/2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# #  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
# #
# # Note that if you share this file, even after editing it, you must still
# # give proper credit to shdwlink1993.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                                ~= Function =~
#
# This script is designed to allow you to expand what poison does to your
# character. Poison now is able to affect HP or MP, and take off a fraction or
# a set amount of HP/MP.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                               ~= Version History =~
#
# Version 1.0b ---------------------------------------------------- [1/11/2009]
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                              ~= Customization =~
#
# Customization can be found right under where the Poison Database begins.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#                               ~= Compatability =~
#
# - Will not work with other Poison-editing scripts.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

module SL93
 
  def self.hotdot(id)
    case id
    #------------------------------------------------------------------------
    # Poison Database Begins
    #------------------------------------------------------------------------
    #  when STATE_NUMBER then return [TYPE, DAMAGE, VARIANCE, LIMIT_DRAIN]
    #  * STATE_NUMBER is the state you want to be affected by this.
    #  * TYPE refers to the thing sustaining damage.
    #      1 = HP, 2 = MP. If the type is positive, the amount is a literal
    #      number (eg. You lose about 50 HP). If the type is negative, then
    #      the amount is a fraction of the maximum (eg. You lose about 50% of
    #      your HP).
    #  * DAMAGE refers to how much damage is healed/taken.
    #      A Positive amount hurts you and a negative amount heals you.
    #  * VARIANCE refers to how much the damage varies. Positive only.
    #      This depends in part on if the type was positive (~5 HP difference)
    #      or negative (~5% HP difference).
    #  * LIMIT_DRAIN refers to if the poison can leave you with 0 HP/SP.
    #      If true, then it is limited, and stops at 1. If false, then it
    #      isn't.
    #------------------------------------------------------------------------
  when 2 then return [-1, 10, 10, false]  # Standard Poison
    #------------------------------------------------------------------------
    # Poison Database Ends
    #------------------------------------------------------------------------
    end
    return false
  end
 
end

class Game_Battler
 
  def slip_damage?
    return @states.any? {|i| SL93.hotdot(i) != false }
  end
 
  def slip_damage_effect
    ids = []
    for i in @states
      ids.push(i) if SL93.hotdot(i) != false
    end
    for i in ids
      damage = SL93.hotdot(i)[1] if SL93.hotdot(i)[0] > 0
      damage = self.maxhp / SL93.hotdot(i)[1] if SL93.hotdot(i)[0] == -1
      damage = self.maxsp / SL93.hotdot(i)[1] if SL93.hotdot(i)[0] == -2
      if damage.abs > 0 && SL93.hotdot(i)[2] > 0
        amp = [damage.abs - SL93.hotdot(i)[2], 1].max if SL93.hotdot(i)[0] > 0
        amp = [damage.abs * SL93.hotdot(i)[2] / 100, 1].max if SL93.hotdot(i)[0] < 0
        damage += rand(amp+1) + rand(amp+1) - amp
      end
      damage = damage * -1 if SL93.hotdot(i)[0] < 0
      if SL93.hotdot(i)[0] == 1 || SL93.hotdot(i)[0] == -1
        damage = self.hp - 1 if !SL93.hotdot(i)[3] && (0 > self.hp += damage)
        self.hp += damage
      elsif SL93.hotdot(i)[0] == 2 || SL93.hotdot(i)[0] == -2
        damage = self.mp - 1 if !SL93.hotdot(i)[3] && (0 > self.mp += damage)
        self.mp += damage
      end
    end
    return true
  end
 
end

class Game_Party
 
  def on_player_walk
    for actor in members
      if actor.slip_damage?
        actor.slip_damage_effect
        $game_map.screen.start_flash(Color.new(255,0,0,64), 4)
        $game_temp.next_scene = "gameover" if $game_party.all_dead?
      end
    end
  end
 
end



Instructions

Found within the script.


Compatibility




Credits and Thanks




Author's Notes

An XP version is available here. (http://forum.chaos-project.com/index.php?topic=2481.0)
Title: Re: [VX] HoT DoT
Post by: Arxur on January 12, 2009, 09:59:45 am
I'm not sure how to set up the script. Could u make an example like:

I want to heal 1000 HP during 4 turns:

when 2 then return [-1, -1000, 10, false]

+ I set the number 2 status effect's duration to last 4 turns?

Thank you for the help! :)
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on January 14, 2009, 09:41:17 am
You would have it set up like this:

when 2 then return [1, 1000, 0, false]

And thank you for the idea!
Title: Re: [VX] HoT DoT
Post by: Sally on January 19, 2009, 09:17:22 pm
wow sweet thx soo much <3 u.
edit:

whats VARIANCE? im having trouble setting up my dots and hots :(
Title: Re: [VX] HoT DoT
Post by: Starrodkirby86 on January 19, 2009, 09:54:34 pm
Quote from: Susys on January 19, 2009, 09:17:22 pm
whats VARIANCE? im having trouble setting up my dots and hots :(

As quoted:
Quote#  * VARIANCE refers to how much the damage varies. Positive only.
    #      This depends in part on if the type was positive (~5 HP difference)
    #      or negative (~5% HP difference).

That would mean the number you put for Variance would be the minimum/maximum the difference from your exact value would be. If your DoT or whatever was 20 and the Variance was 10, any number from 10 to 30 will be selected. It makes things more random.
Title: Re: [VX] HoT DoT
Post by: Sally on January 20, 2009, 04:43:12 pm
hmm, how do u get 10 and 30?
Title: Re: [VX] HoT DoT
Post by: Starrodkirby86 on January 20, 2009, 06:52:49 pm
Quote from: Susys on January 20, 2009, 04:43:12 pm
hmm, how do u get 10 and 30?
It honestly depends on how shdwlink coded the Variance. He might have used RMXP's variance code, or he used his own. I got the numbers 10 and 30 because the original value is 20. There is a 10-number gap between 20 and 10 and 20 and 30, so Variance can select one of those numbers from the lowest to the highest...which is 10 to 30. That's how I always treated Variance.

RMXP calls Variance like: Degree of fluctuation in final effect strength. The effect strength value varies by only as much as the percentage. 15 is an average attack. (This is in the Skills Database)

So if you want to have exact damage, just set the Variance to 0. If you want a minor change, try 1, and as numbers go higher, the varying (Ha, I used the same base word) will expand.
Title: Re: [VX] HoT DoT
Post by: Sally on January 22, 2009, 10:01:12 pm
im cnfused
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on January 22, 2009, 10:27:29 pm
Alright. Variance works basically like this:

If you had your TYPE set to a positive number, then it uses a standard number to determine variance. If you, for instance, had a poison type 1 that dealt 50 damage with a 10 variance, then you could take anywhere between 40 and 60 damage (Both of them being 10 away from 50).

If your TYPE was set to a negative number (meaning that everything is in percentages), then a percentage is used to determine variance. If your poison had a type of -1, 50 damage, and 10 variance, then you would take anywhere between 40% - 60% damage (out of your max).

I hope this helps, Susys. I'm glad to hear that you like it. :)
Title: Re: [VX] HoT DoT
Post by: Sally on January 24, 2009, 12:51:58 pm
ooh and if you had a 20 varience and 50 damage it will be 30-70?   i get it, thanks :)

suggestion,

cant you make it so it deals,
500-1000 damage over 5 turns? thats how WoW has it.
Title: Re: [VX] HoT DoT
Post by: Aqua on January 24, 2009, 01:05:20 pm
Just have the status last 5 turns and the damage at 750 with variance of 250.
Title: Re: [VX] HoT DoT
Post by: Sally on January 30, 2009, 09:23:04 am
i made a HoT, and it hurt my teamates insted of healed them,
this is what i have,
Quotewhen 28 then return [1, -3000, 1000, false] #Rejuvenation
Title: Re: [VX] HoT DoT
Post by: Sally on January 31, 2009, 10:34:15 pm
uhm bump plz help me.
Title: Re: [VX] HoT DoT
Post by: Starrodkirby86 on January 31, 2009, 10:47:57 pm
shdw's documentation is wrong. Negative amounts damage the victim while positive amounts actually heal them. He simply forgot to change the script to accommodate this. That means Poison also heals you, apparently.

So shdw, might as well change the configuration help... :P

Long story short.

Change
    when 28 then return [1, -3000, 1000, false] #Rejuvenation

to
    when 28 then return [1, 3000, 1000, false] #Rejuvenation
Title: Re: [VX] HoT DoT
Post by: Sally on January 31, 2009, 11:03:09 pm
tyvm love you. :)

nop, it still hurts him
Title: Re: [VX] HoT DoT
Post by: Sally on February 02, 2009, 09:08:09 pm
bump again...
Title: Re: [VX] HoT DoT
Post by: Starrodkirby86 on February 02, 2009, 09:22:13 pm
That is really strange. I tried it again and it worked fine. I'm sending the project that I did this on. When the party is inflicted with Sexiness, that means they got the Rejuvenation status, all right?
http://www.sendspace.com/file/vqx81a

Have fun.
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on February 02, 2009, 09:48:12 pm
@SRK: Thanks for looking after the topic for me. Power+ for you doing my job that I forgot to do, you sly dog (:???: ).

@Susys: Sorry I wasn't answering when I should have. :shy:

Yes, the documentation does have that error that cropped up at the last minute. I'll change that momentarily (and, in a related note, new version by the end of the week, methinks. :)).
Also, I also tried SRK's recommendation and it heals the player (or at least it didn't instantly kill them like it should have). Are you sure it's correct?
Title: Re: [VX] HoT DoT
Post by: Sally on February 03, 2009, 06:21:38 am
i have the side view battle maybe thats why it wont work on mine?
Title: Re: [VX] HoT DoT
Post by: Starrodkirby86 on February 03, 2009, 12:17:59 pm
Unless the Side-View Battle System affects something related to Status Effects, I can't see the problem. If it does, maybe you should find that area and disable it (Like comment it out or something with =begin and =end). I don't know.

Thanks shdw. I'm sure you have the skill to answer that. :P
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on February 03, 2009, 07:35:45 pm
Susys, this depends mainly on what side view battle system you are using. I'd bet that there's more than one out there.
Title: Re: [VX] HoT DoT
Post by: Sally on February 03, 2009, 09:53:43 pm
hmmm ill look.
Title: Re: [VX] HoT DoT
Post by: Sally on February 06, 2009, 10:57:31 pm
i couldnt find anther rmvx sideview...
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on February 07, 2009, 01:15:45 am
Susys, I was not wondering what VX sideview battle-systems exist. I was wondering what the name and version of the one YOU are using now for your game is. :haha:
Title: Re: [VX] HoT DoT
Post by: Sally on February 09, 2009, 04:06:47 pm
gimmi a second ill find a link.
http://www.rpgrevolution.com/forums/index.php?showtopic=18304
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on February 11, 2009, 12:19:41 am
Basic question I forgot to ask: Is this script below the Battle System. If it isn't, make sure that you have this below the battle system, if it isn't already. The person who coded it did something really unusual (WHY, oh scripter, WHY would you COPY and PASTE the definition from the RTP??? WHY? >_< )

If that doesn't do it, then I'll need you to send me your script file (Data/Scripts.rvdata).
Title: Re: [VX] HoT DoT
Post by: Sally on February 11, 2009, 06:41:55 am
yeah i have it under the system
Title: Re: [VX] HoT DoT
Post by: shdwlink1993 on February 14, 2009, 04:09:16 am
Quote from: shdwlink1993 on February 11, 2009, 12:19:41 am
If that doesn't do it, then I'll need you to send me your script file (Data/Scripts.rvdata).