The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Falcon on April 10, 2007, 03:43:48 AM

Title: Luck Script
Post by: Falcon on April 10, 2007, 03:43:48 AM
You all can go fuck yourselves, I'm not going to put up with this crap of stealing people's work.
Title: Re: Luck Script
Post by: :) on April 10, 2007, 04:07:57 AM
<3 script! Thanks much dark!
Title: Re: Luck Script
Post by: Jalkson on April 10, 2007, 05:06:05 AM
Nice, I've been looking for a script like this for a couple days now. :D
Title: Re: Luck Script
Post by: modern algebra on April 10, 2007, 05:14:47 AM
Awesome script Darklord. Plus I like how you made the map look nice. It functions as both a script and a mapping tutorial  ;8

Damn, it's still a shame you're going. Oh well. I am definitely using this script.
Title: Re: Luck Script
Post by: Falcon on April 10, 2007, 12:06:07 PM
Just wanted to say that if anyone needs help with this script, it's better to PM me over on .org (The_Darklord) or post in the topic:

(for now)
http://www.dragonkid.org/forums/showthread.php?p=189660
(later, when the domain is fixed)
http://www.hbgames.org/forums/showthread.php?p=189660
Title: Re: Luck Script
Post by: Blizzard on April 10, 2007, 05:15:25 PM
Compatibility

Probably incompatible with SDK, I rewrite too many methods.

I love you.
Title: Re: Luck Script
Post by: Kokowam on April 10, 2007, 07:22:50 PM
Wow! Cool! I wish you made the summoning one, but this is still cool! :D
Title: Re: Luck Script
Post by: GhstHawk on April 13, 2007, 03:45:36 PM
Great script.
How would you go about adding a certain amount to the luck stat with the call script? For example, I want to make an item that adds +10 luck to a character lets say.
Title: Re: Luck Script
Post by: modern algebra on April 13, 2007, 04:12:21 PM
Darklord has left RMRK: you'd be better off asking questions on his thread at .org. I think I can answer that one though. Try:

$game_actors[XXX].luck += 10

where XXX is the actor's id.
Title: Re: Luck Script
Post by: Blizzard on April 13, 2007, 04:14:40 PM
I checked through the script. Yes, what MA said will work.
Title: Re: Luck Script
Post by: Winged on April 14, 2007, 01:59:58 AM
Yay for luck! (Even though I like the STR stat more)I wonder if he'd still be posting his other scripts here..

~Winged
Title: Re: Luck Script
Post by: modern algebra on April 14, 2007, 02:21:29 AM
Unfortunately, I don't see that happening  :'(
Title: Re: Luck Script
Post by: Falcon on April 14, 2007, 02:28:46 AM
I will not be posting any more scripts here unless I decide to return.

Here's Modern Algebra's patch for the RTAB. I'll check it later to make sure it's bug free and whatnot.

Code: [Select]
class Game_Battler 
  #--------------------------------------------------------------------------
  # * Applying Normal Attack Effects
  #     attacker : battler
  #--------------------------------------------------------------------------
  def attack_effect(attacker)
    # ?????????????
    self.critical[attacker] = false
    state_p[attacker] = []
    state_m[attacker] = []
    # ??????
    hit_result = (rand(100) < attacker.hit)
    # ?????
    if hit_result == true
      # ?????????
      atk = [attacker.atk - self.pdef / 2, 0].max
      self.damage[attacker] = atk * (20 + attacker.str) / 20
      # ????
      self.damage[attacker] *= elements_correct(attacker.element_set)
      self.damage[attacker] /= 100
      # ????????????
      if self.damage[attacker] > 0
        # ????????
        random = (rand(100) - (Integer(attacker.luck/10)))
        if random < 4 * attacker.dex / self.agi
          self.damage[attacker] *= 2
          self.critical[attacker] = true
        end

        # ????
        if self.guarding?
          self.damage[attacker] /= 2
        end
      end
      # ??
      if self.damage[attacker].abs > 0
        amp = [self.damage[attacker].abs * 15 / 100, 1].max
        self.damage[attacker] += rand(amp+1) + rand(amp+1) - amp
      end
      # ??????
      eva = 8 * self.agi / attacker.dex + self.eva
      hit = self.damage[attacker] < 0 ? 100 : 100 - eva
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
    end
    # ?????
    if hit_result == true
      # ????????
      remove_states_shock
      # HP ?????????
      # ??????
      @state_changed = false
      states_plus(attacker, attacker.plus_state_set)
      states_minus(attacker, attacker.minus_state_set)
    # ?????
    else
      # ????? "Miss" ???
      self.damage[attacker] = "Miss"
      # ?????????????
      self.critical[attacker] = false
    end
    # ??????
    return true
  end
end

Now, I'm out of here.