KMonsterPals XP
#1
KMonsterPals XP

by Kyonides

Introduction

Well, did you ever wish to let your monsters exact revenge on a hero for killing its pal? Laughing  Now you can do it! Shocked

The Script

Code:
# * KMonsterPals XP
#   Scripter : Kyonides Arkanthes
#   2019-10-29

# This scriptlet allows monsters to (over)react after their pal's defeat.
# It will allow them to use a hidden skill in an attempt to exact revenge on
# the hero that killed their friend! They will calm down if successful.
# Note: If the revengeful monster has little mana, the script will provide it
#       enough mana to let it use it at least once. (Thank their rage for it!)

module KMonster
 PALS = {} # Do Not Touch This!
 PALS.default = {} # Do Not Touch This!
 # [TroopID] = { MonsterIndex => [MonsterPalIndex, PalSkillID], etc. }
 # NOTE: PalSkillID could also be an Array of Skill IDs, e.g. [1,2,3]
 PALS[1] = { 0 => [1, 1], 1 => [0, 1] }
end

class Game_Battler
 alias :kyon_monsterpals_gm_battler_scu :skill_can_use?
 alias :kyon_monsterpals_gm_battler_se :skill_effect
 def skill_can_use?(sid)
   result = kyon_monsterpals_gm_battler_scu(sid)
    return true if result and @revenge_skill == sid
   result
 end

 def skill_effect(user, skill)
   killed = @hp == 0
   result = kyon_monsterpals_gm_battler_se(user, skill)
   if result and self.kind == :enemy and !killed and @hp == 0
     if (ids = KMonster::PALS[@troop_id][@member_index])
       enemy = $game_troop.enemies[ids[0]]
       enemy.revenge_target = $game_party.actors.index(user)
       sid = ids[1].is_a?(Array)? ids[rand(ids.size)] : ids[1]
       enemy.revenge_skill = sid
       cost = $data_skills[sid].sp_cost
       enemy.sp = cost if cost > enemy.sp
     end
   end
   result
 end
end

class Game_Enemy
 attr_writer :revenge_target, :revenge_skill
 alias :kyon_monsterpals_gm_enemy_ma :make_action
 def make_action
   if @revenge_target and @revenge_skill
     if $game_party.actors[@revenge_target].hp == 0 or
        $data_skills[@revenge_skill].sp_cost > @sp
       @revenge_target = @revenge_skill = nil
     else
       a = self.current_action
       a.kind = 1
       a.basic = 0
       a.skill_id = @revenge_skill
       a.target_index = @revenge_target
       return
     end
   end
   kyon_monsterpals_gm_enemy_ma
 end
 def kind() :enemy end
end

class Game_Actor
 def kind() :actor end
end

Terms & Conditions

You must include my nickname and the current website's URL in your game credits.
Free for non commercial games.
Give me a free copy of your completed game if you include at least 2 of my scripts! Laughing + Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#2
Fixing XP and Remaking VX
sort of... Confused
 
Tonight or early this morning I have published a fix for XP version of my script plus the initial release of the VX one! Shocked

I know, why should VX even get its own version!? Laughing Even so VX addicts can't say now that they were ignored by these fellowship of killer ghosts! Shocked So go warn Ralph he's gonna get his buttocks kicked hard if he doesn't learn from Aluxes's mistakes! Laughing + Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#3
OK, I know, a sudden comeback shouldn't surprise you at all at this point Laughing + Tongue sticking out but I had to fix a return value in a certain method so I had to update both scripts. Happy with a sweat If you're using an old version, you better replace it with the current one ASAP. Laughing
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#4
An Ace Visitor Arrived Tonight!

Guess what!? Happy with a sweat I'm back with more news to share with you! Grinning This time I brought another script with me! I'm talking about the VX Ace version of KMonsterPals! Shocked 

I'm not 100% sure my scripts will run smoothly on any game project, so far everything seems to confirm it except for the newbie, namely the ACE version. So don't forget to submit any bug reports! Happy with a sweat (Even if I obviously hope there'll be no need for them. Sarcasm + Confused )
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }




Users browsing this thread: