MMORPG-extreme
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le deal à ne pas rater :
Bon plan achat en duo : 2ème robot cuiseur Moulinex Companion ...
600 €
Voir le deal

Bestiaire [XP]

Aller en bas

Bestiaire [XP] Empty Bestiaire [XP]

Message  Hitsugaya Sam 26 Juin - 11:42

Voici un petit bestiaire pour rpg maker XP.Script venant de rpg maker créative.
Faite un nouveau script et nommez le Scene_Liste_Monstres
Puis collez ceci:

Script:

#==============================
# ¦ Scene_Liste_Monstres v2 par Krazplay
#------------------------------
# Ce scrîpt fonctionne avec les scrîpts Window_Monstres et Window_details_monstre.
# N'oubliez pas que les variables 4001 à 4000+Nbre de monstres dans votre database
# sont utilisés pour mémoriser le nombre de monstres tués de chaque sorte.
# Pour appeller ce menu il suffit d'écrire la ligne suivante :
# $scene = Scene_Liste_Monstres.new
# Si vous venez depuis un menu vous pouvez ajouter cela :
# $vientdumenu = 1
# Cela permet de revenir dans le menu et non sur la carte après avoir consulter
# le bestiaire.
# A propos de @detailspardefaut et @nomspardefaut respectivement ligne 26 et 197
# Ces 2 variables sont mis en vrai par défaut, mais vous pouvez les mettre en
# false. Si @detailspardefaut est mis en false vous ne pourrez voir les détails
# des ennemis que si vous en avez tuer au moins un, si @nomspardefaut est mis
# en false vous ne verrez pas le nom des ennemis que vous n'avez jamais tué.
# Je remercie aussi celui qui a créé le graphique de défense élémentale, seule
# chose que je n'ai pas faite moi-même, j'ai du y opérer quelques modifications
# mais il fonctionne parfaitement Wink
#==============================

class Scene_Liste_Monstres

def initialize
@detailspardefaut = true
end

def main
@monstres_window = Window_Monstres.new(0,0)
Graphics.transition
@monstres_window.refresh
loop do
Graphics.update #Efface ce qu'on pourrait voir par transparence
Input.update
update_command
if $scene != self #Si la scène ne doit plus être celle-ci
@monstres_window.dispose #On efface la fenêtre des monstres
break #On casse la boucle sinon on restera tjs ici
end
end
end #main

def update_command
if Input.trigger?(Input::B) #B = Bouton échap
$game_system.se_play($data_system.cancel_se)
if @monstres_window.active? == 1
if $vientdumenu == 1
$vientdumenu = 0
$scene = Scene_Menu.new(0) #On repart dans le menu (curseur sur Objets)
else
$scene = Scene_Map.new #On repart sur la carte
end
Graphics.freeze #Pour éviter une transition trop brutal
end
if @Window_details_monstre_active == 1
@Window_details_monstre.dispose
@Window_details_monstre_active = 0
@monstres_window = Window_Monstres.new(@memo[0], @memo[1])
end
end

if Input.trigger?(Input::RIGHT)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.pageplusun
@monstres_window.refresh
end
if @Window_details_monstre_active == 1 and @monstres_window.selection+@pagetourne < $data_enemies.size-1
if $game_variables[4000 + @monstres_window.selection+@pagetourne+1] != 0 or @detailspardefaut == true
@Window_details_monstre.dispose
@pagetourne += 1
@Window_details_monstre = Window_details_monstre.new(@monstres_window.selection+@pagetourne)
end
end
end

if Input.trigger?(Input::LEFT)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.pagemoinsun
@monstres_window.refresh
end
if @Window_details_monstre_active == 1 and @monstres_window.selection+@pagetourne > 1
if $game_variables[4000 + @monstres_window.selection+@pagetourne-1] != 0 or @detailspardefaut == true
@Window_details_monstre.dispose
@pagetourne -= 1
@Window_details_monstre = Window_details_monstre.new(@monstres_window.selection+@pagetourne)
end
end
end

if Input.trigger?(Input::UP)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.ligneplusun
@monstres_window.refresh
end
end

if Input.trigger?(Input::DOWN)
if @monstres_window.active? == 1
@monstres_window.nettoyage
@monstres_window.lignemoinsun
@monstres_window.refresh
end
end

if Input.trigger?(Input::C) #Confirmer
if @monstres_window.active? == 1 and @Window_details_monstre_active != 1
if $game_variables[4000 + @monstres_window.selection] != 0 or @detailspardefaut == true
@pagetourne = 0
@memo = @monstres_window.inactive
@monstres_window.dispose
@Window_details_monstre_active = 1
@Window_details_monstre = Window_details_monstre.new(@monstres_window.selection)
end
end
end

end #update_command
end #class Scene_Liste_Monstres

#==============================
# ¦ Window_details_monstre v2 par Krazplay
#------------------------------
#Permet de créer une fenêtre avec les détails d'un ennemi
#==============================
class Window_details_monstre < Window_Base

def initialize(monstre_id)
super(5, 5, 630, 470)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.clear
draw_actor_battler($data_enemies[monstre_id], 215, 220)
self.contents.font.size = 29
self.contents.font.color = Color.new(255, 155, 155, 255)
monster_name_width = contents.text_size($data_enemies[monstre_id].name).width
self.contents.draw_text(300 - (monster_name_width / 2), 0, 500, 32, $data_enemies[monstre_id].name)
self.contents.font.size = 24
self.contents.font.color = normal_color
self.contents.draw_text(50, 30, 300, 32, "HP : " + $data_enemies[monstre_id].maxhp.to_s)
self.contents.draw_text(50, 55, 300, 32, "SP : " + $data_enemies[monstre_id].maxsp.to_s)
self.contents.draw_text(400, 50, 300, 32, "Attaque :")
self.contents.draw_text(550, 50, 300, 32, $data_enemies[monstre_id].atk.to_s)
self.contents.draw_text(400, 80, 300, 32, "Déf physique :")
self.contents.draw_text(550, 80, 300, 32, $data_enemies[monstre_id].pdef.to_s)
self.contents.draw_text(400, 110, 300, 32, "Déf magique :")
self.contents.draw_text(550, 110, 300, 32, $data_enemies[monstre_id].mdef.to_s)
self.contents.draw_text(400, 140, 300, 32, "Force :")
self.contents.draw_text(550, 140, 300, 32, $data_enemies[monstre_id].str.to_s)
self.contents.draw_text(400, 170, 300, 32, "Dextérité :")
self.contents.draw_text(550, 170, 300, 32, $data_enemies[monstre_id].dex.to_s)
self.contents.draw_text(400, 200, 300, 32, "Agilité :")
self.contents.draw_text(550, 200, 300, 32, $data_enemies[monstre_id].agi.to_s)
self.contents.draw_text(400, 230, 300, 32, "Intelligence :")
self.contents.draw_text(550, 230, 300, 32, $data_enemies[monstre_id].int.to_s)
self.contents.draw_text(10, 360, 300, 30, "Expérience : " + $data_enemies[monstre_id].exp.to_s)
self.contents.draw_text(10, 385, 300, 30, "Argent : " + $data_enemies[monstre_id].gold.to_s)
self.contents.draw_text(10, 410, 300, 30, "Objet détenu : ")

if $data_enemies[monstre_id].weapon_id != 0
bitmap = RPG::Cache.icon($data_weapons[$data_enemies[monstre_id].weapon_id].icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône
self.contents.draw_text(150+30, 410, 212, 32, $data_weapons[$data_enemies[monstre_id].weapon_id].name, 0) #nom
self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %")
end
if $data_enemies[monstre_id].armor_id != 0
bitmap = RPG::Cache.icon($data_armors[$data_enemies[monstre_id].armor_id].icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône
self.contents.draw_text(150+30, 410, 212, 32, $data_armors[$data_enemies[monstre_id].armor_id].name, 0) #nom
self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %")
end
if $data_enemies[monstre_id].item_id != 0
bitmap = RPG::Cache.icon($data_items[$data_enemies[monstre_id].item_id].icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(150, 410+4, bitmap, Rect.new(0, 0, 24, 24), opacity) #Icône
self.contents.draw_text(150+30, 410, 212, 32, $data_items[$data_enemies[monstre_id].item_id].name, 0) #nom
self.contents.draw_text(430, 410, 300, 30, $data_enemies[monstre_id].treasure_prob.to_s + " %")
end
self.draw_enemy_element_radar_graph($data_enemies[monstre_id], 400, 270, radius = 30)
end #def initialize
end


#==============================
# ¦ Window_Monstres v2 par Krazplay
#------------------------------
#Permet de créer une fenêtre avec le nom de tout les ennemis tués et combien de
#fois ils ont été tués.
#==============================
class Window_Monstres < Window_Base

def initialize(page, ligne)
@nomspardefaut = true
@active = 1
@page = page
@ligne = ligne
#Taille du cadre que l'on voie, mais dont on ne peut pas écrire dessus :
super(0, 0, 640, 480)
#Image invisible où l'on va pouvoir écrire dessus :
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
self.contents.clear
self.contents.draw_text(20, 0, 500, 32, "Noms des monstres :")
self.contents.draw_text(400, 0, 500, 32, "Nombres tués :")
#Call'aile du canard de la dernière page :
@dernierepage = Integer($data_enemies.size / 15) + 1
@derniereligne = Integer($data_enemies.size % 15) - 1
refresh
end #def initialize

def refresh
self.contents.draw_text(240, 420, 500, 32, "Page " + (@page+1).to_s + " / " + @dernierepage.to_s)
self.cursor_rect.set(0, (40 + 26*@ligne), 580, 27)
m = 1
if @page == @dernierepage - 1
monstremoins = 15 - (($data_enemies.size - 1) % 15)
else
monstremoins = 0
end
for i in (1 + 15*@page)...(16 + 15*@page - monstremoins)
if $game_variables[4000 + i] != 0 or @nomspardefaut == true
self.contents.draw_text(20, (26 * m) + 15, 500, 26, $data_enemies.name)
else
self.contents.draw_text(20, (26 * m) + 15, 500, 26, "Ennemi inconnu")
end
self.contents.draw_text(470, (26 * m) + 15, 500, 26, $game_variables[4000 + i].to_s)
m += 1
end
end #end refresh
def pageplusun
if @page < @dernierepage -1
@page += 1
end
if @ligne > @derniereligne -1 and @page == @dernierepage -1
@ligne = @derniereligne -1
end
end
def pagemoinsun
if @page > 0
@page -= 1
end
end
def ligneplusun
if @ligne > 0
@ligne -= 1
end
end
def lignemoinsun
if @ligne < 14
unless @ligne >= @derniereligne -1 and @page == @dernierepage -1
@ligne += 1
end
end
end
def selection
return (@ligne+1) + (@page*15)
end
def nettoyage
self.contents.clear
self.contents.draw_text(20, 0, 500, 32, "Noms des monstres :")
self.contents.draw_text(400, 0, 500, 32, "Nombres tués :")
end
def active?
return @active
end
def inactive
@active=0
return [@page,@ligne]
end
end #class Window_Monstres

#------------------------------
# ? draw_actor_battler de Krazplay
# Dessine le battler de l'acteur aux coordonnées x,y
# L'acteur peut aussi bien être un monstre qu'un personnage
#------------------------------
class Window_Base < Window
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch / 2, bitmap, src_rect)
end
end

#==============================
# Graphic_Def_Elem
#==============================
class Window_Base
FONT_SIZE = 18
WORD_ELEMENT_GUARD = "Déf. Elémentale"
NUMBER_OF_ELEMENTS = 8
ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
end
#==============================
# ?¡ Window_Status
#==============================
class Window_Base
#------------------------------
def draw_enemy_element_radar_graph(enemy, x, y, radius = 56)
cx = x + radius + FONT_SIZE + 48
cy = y + radius + FONT_SIZE + 32
self.contents.font.color = system_color
#self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
for loop_i in 0..NUMBER_OF_ELEMENTS
if loop_i == 0

else
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
end
if loop_i == NUMBER_OF_ELEMENTS
eo = ELEMENT_ORDER[0]
else
eo = ELEMENT_ORDER[loop_i]
end
er = element_pourcent(enemy, eo)
estr = $data_system.elements[eo]
@color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
@now_x = cx + (radius * Math.cos(th)).floor
@now_y = cy - (radius * Math.sin(th)).floor
@now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
@now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
@now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_ex = cx + (er.abs*radius/100 * Math.cos(th)).floor
@now_ey = cy - (er.abs*radius/100 * Math.sin(th)).floor
if loop_i == 0
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
else

end
next if loop_i == 0
self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
self.contents.font.size = FONT_SIZE
self.contents.font.color = system_color
self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
self.contents.font.color = Color.new(255,255,255,128)
self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, er.to_s + "%", 2)
end
end
#end

#------------------------------
# ? ????????
# element_id : ?? ID
#------------------------------
def element_pourcent(enemy, element_id)
table = [0,200,150,100,50,0,-100]
return table[enemy.element_ranks[element_id]]
end
end
#==============================
# ?¸ ¦O?????C?u???¦
#==============================
class Bitmap
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end


Utilisation:

Pour appeller se script faite insérer un script: $scene = Scene_Liste_Monstres.new

[i]Modifications possible:


Il est possible de modifier les "permissions" du joueur quant à l'affichage de ce menu bestiaire.

Ligne 26 :


@detailspardefaut = true

Mettez "false" à la place de "true" si vous désirez que les détails sur la fiche des ennemis ne puissent être aperçu que lorsque vous tuez au moins un animal de cette espèce.

Ligne 198:


@nomspardefaut = true

Mettez "false" à la place de "true" si vous désirez que le nom des monstres que vous n'avez jamais combattu ne s'affiche pas dans le bestiaire.

Attention! Pour que le script soit opérationnel Ouvrez le script "Scene_Battle 2" et allez cherchez la ligne 147, il y a ceci :

unless enemy.hidden
Rajoutez juste en dessous :

# Ajout pour la liste des monstres de Krazplay
$game_variables[4000 + enemy.id] += 1


Screens:

Bestiaire [XP] Screen%20menu%20bestiaire

Bestiaire [XP] Screen%20menu%20bestiaire%202

Hitsugaya
Hitsugaya
Admin

Messages : 75
Date d'inscription : 24/06/2010

https://mmorpg-extreme.forum-actif.net

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum