• Anmelden

Vortex Lord

Ankömmling

  • »Vortex Lord« ist der Autor dieses Themas

Motto: El psy congroo! Tempus edax rerum

  • Nachricht senden

1

Samstag, 18. Mai 2013, 10:40

Script zum verbieten von Items, Waffen und Rüstung

Servus,

Ich stehe derzeit vor einem kleinen Schönheitsproblem von meinem Spiel.
Es geht um Item/Waffen/Rüstungs- Anfordernungen wie z.B


Lederwams ( Armor ID[1] )
Anforderung : Level 5, Str: 15


Nur wenn der Spieler die Anforderung erfüllt soll man den Lederwams auch Tragen können.
Bisher habe ich das als "Notlösung" mit einem Common Event geregelt, der größte Markel an der Sache ist, dass man das Item vorher Anziehen kann und erst dann wird es wieder aus dem EQ ins Inventar entfernt.

Was ebenfalls fehlen würde wäre,dass das Item.Icon nicht Normal angezeigt wird sondern mit einer gewissen Opacity (Wenn Anforderung nicht erfüllt)


Kennt da jmd vielleicht ein gutes Script?

2

Dienstag, 21. Mai 2013, 18:19

Wäre auch interessiert an so einen Script.
!Mein Youtube Großprojekt!

Verschiedene Kurse!
Bild Bild

Schaut jetzt Hier bei mir vorbei!

Avery

Dinoritterin mit Herrschaft über die Contests und Ressourcen

  • Nachricht senden

3

Dienstag, 21. Mai 2013, 18:36


Vortex Lord

Ankömmling

  • »Vortex Lord« ist der Autor dieses Themas

Motto: El psy congroo! Tempus edax rerum

  • Nachricht senden

4

Dienstag, 21. Mai 2013, 18:47

Wunderbare Sache :D
Bekomme leider einen Syntax Error von der Zeile 176.

Spoiler

Quellcode

1
	if @frame == 100 or Input.trigger?(Input::C) or Input.trigger?(Input::<img src='http://forums.rpgmakerweb.com/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />

zum Lesen den Text mit der Maus markieren



Kompletter Code (Von Ayene)
Spoiler

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#===================================================================
# Equipment Requirements [XP]
# by Ayene
# 26.03.2010 ver 1.2
# www.ultimateam.pl
#===================================================================
# Opis:
# The script allows you to set requirements for weapon and armor.
# For instance, outfitting a hero with two-handed axe would be possible
# only after reaching a specific level or having adequate statistics.
# Also added an option that allows to require certain skills.
#
# Instruction:
# To use the script simply configure requirements below (separately for each
# weapon and armor), according to the formula:
#
# WEAPON [weapon ID] = [lv, maxhp, maxsp, str, dex, agi, int, [skill_id, skill_id, ...]]
#
# For example:
# If you want a character to equip a weapon ID 2 at level 6, provided that
# it has 120 max HP, 40 strength, 70 intelligence,
# type in configuration below:
# WEAPON [2] = [6, 120, 0, 40, 0, 0, 70, []]
 
# Next, to equip an armor ID 3, which "requires" adequate agility
# and knowledge of the skill ID 10 and 40, type:
# ARMOR [3] = [0, 0, 0, 0, 70, 0, 0, [10, 40]]
#
#===================================================================
 
# CONFIGURATION
module AYENE
  module EQUIP_REQ
 
   WEAPON = []
   ARMOR = []
 
# ~~~~~~~~~~~~~~~~~BRONIE~~~~~~~~~~~~~~~~
 
  # WEAPON [weapon ID] = [lv, maxhp, maxsp, str, dex, agi, int, [skill_id, skill_id, ...]]
 
  WEAPON[1] = [2, 10, 10, 10, 10, 10, 10, [4]]  
  WEAPON[3] = [3, 500, 20, 0, 0, 0, 0, []]
 
# ~~~~~~~~~~~~~~~~PANCERZE~~~~~~~~~~~~~~~~
 
  # ARMOR [armor ID] = [lv, maxhp, maxsp, str, dex, agi, int, [skill_id, skill_id, ...]]
 
  ARMOR[2] = [1, 300, 0, 0, 0, 0, 0, []]
  ARMOR[3] = [3, 400, 0, 0, 0, 0, 0, []]
 
  ACC_TEXT = "Your stats are too low to equip this item."
  PARAM_NAMES = ["Level", "Max HP", "Max SP", "Strength", "Dexterity", "Agility", "Intelligence", "Skills:"]  
 
  SHOW_SKILL_REQ = true  # Show which skill is needed?
 
  WLH = 32  # Line Height in Requirements Window
  end
end
 
#===================================================================
# Game_Actor
#===================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Determine if Item can be Equiped (Actor's Parameters)
  #	 stat	: stats
  #--------------------------------------------------------------------------
  def equip_allowed?(stat)
	return true if stat[0] <= level && stat[1] <= base_maxhp &&
		  stat[2] <= base_maxsp && stat[3] <= base_str &&
		  stat[4] <= base_dex && stat[5] <= base_agi &&
		  stat[6] <= base_int && equip_skill_allowed?(stat)
	return false
  end
  #--------------------------------------------------------------------------
  # * Determine if Item can be Equiped (Actor's Skills )
  #	 stat	: stats
  #--------------------------------------------------------------------------
  def equip_skill_allowed?(stat)	
	return true if stat[7].empty?
	stat[7].each{|skill_id|
	  return false if !skill_learn?(skill_id)	
	}
	return true
  end
end
 
#===================================================================
# Window_Help
#===================================================================
class Window_EquipReq < Window_Base
  include AYENE::EQUIP_REQ
  #--------------------------------------------------------------------------
  # * Object Initialization
  #	 item	   : item
  #	 data	   : parameters (array)
  #	 actor	  : actor
  #	 skill	  : skill
  #--------------------------------------------------------------------------
  def initialize(item, data, actor, skill)	
	if skill.empty? or !SHOW_SKILL_REQ
	  height = (data.size+1) / 2 * WLH + WLH + 32
	else
	  height = (data.size+1) / 2 * WLH + WLH + 32 + WLH * [skill.size, 7].min
	end	  
	super(100, 200 - height/2, 460, height)
	self.contents = Bitmap.new(width - 32, height - 32)
	self.z = 1000
	self.opacity = 255
	self.contents.font.color = crisis_color
	self.contents.draw_text(4, 0, self.width - 40, WLH, ACC_TEXT, 1)
	x = 10
	y = WLH
	data.each_with_index{|array, i|	
	  self.contents.font.color = system_color
	  self.contents.draw_text(x+i%2*240, y+i/2*WLH, 200, WLH, PARAM_NAMES[array[0]].to_s, 0)	  
	  self.contents.font.color = normal_color
	  self.contents.draw_text(x+120+i%2*240, y+i/2*WLH, 40, WLH, array[1].to_s, 2)
	}
	if !skill.empty? and SHOW_SKILL_REQ
	  size = (data.size+1)/2*WLH
	  self.contents.font.color = system_color
	  self.contents.draw_text(x, y+size, 200, WLH, PARAM_NAMES[7].to_s, 0)	
	  self.contents.font.color = normal_color
	  skill.each_with_index{|id, i|	  
		self.contents.draw_text(x+140, y+size+WLH*i, 200, WLH, "- #{$data_skills[id].name}", 0)		
	  }
	end
  end
end
 
#===================================================================
# Scene_Equip
#===================================================================
class Scene_Equip
  include AYENE::EQUIP_REQ
  #--------------------------------------------------------------------------
  # * Aliased Definitions
  #--------------------------------------------------------------------------
  alias ayene_item_stats_sceq_update update
  alias ayene_item_stats_sceq_update_item update_item
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update	
	@req_window != nil ? update_spec_selection : ayene_item_stats_sceq_update
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
	@stat = nil
	item = @item_window.item
	case item
	when RPG::Weapon
	  @stat = WEAPON[item.id]
	else
	  @stat = ARMOR[item.id]
	end
	unless @stat == nil  
	  if Input.trigger?(Input::C) && !@actor.equip_allowed?(@stat)
		$game_system.se_play($data_system.buzzer_se)	  
		@item_window.active = false
		show_spec_window  
		return
	  end
	end
	ayene_item_stats_sceq_update_item
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when requirements window is active)
  #--------------------------------------------------------------------------
  def update_spec_selection
	@frame < 100 ? @frame += 1 : @frame = 0
	if @frame == 100 or Input.trigger?(Input::C) or Input.trigger?(Input::<img src='http://forums.rpgmakerweb.com/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
	  @req_window.dispose
	  @req_window = nil	  
	  @item_window.active = true	  
	end
  end
  #--------------------------------------------------------------------------
  # * Show Requirements Window
  #--------------------------------------------------------------------------
  def show_spec_window
	@frame = 0
	data = []
	@stat.each_with_index {|value, type|
	  data.push([type, value]) if value > 0 if type < 7  
	}	
	data.sort!{|a,b| a[0] <=> b[0]}	
	skill = @stat[7]
	@req_window = Window_EquipReq.new(@item, data, @actor, skill)	  
  end
end
 
#===================================================================
# Game_Interpreter
#===================================================================
class Interpreter
  include AYENE::EQUIP_REQ
  #--------------------------------------------------------------------------
  # * Aliased Definitions
  #--------------------------------------------------------------------------
  alias aye_command_315 command_315
  alias aye_command_316 command_316
  alias aye_command_317 command_317
  alias aye_command_318 command_318
  #--------------------------------------------------------------------------
  # * Change EXP
  #--------------------------------------------------------------------------
  def command_315
	aye_command_315
	iterate_actor(@parameters[0]) do |actor|
	  check_change_equip(actor)  
	end  
  end
  #--------------------------------------------------------------------------
  # * Change Level
  #--------------------------------------------------------------------------
  def command_316
	aye_command_316
	iterate_actor(@parameters[0]) do |actor|
	  check_change_equip(actor)  
	end
  end  
  #--------------------------------------------------------------------------
  # * Change Parameters
  #--------------------------------------------------------------------------
  def command_317
	aye_command_317
	iterate_actor(@parameters[0]) do |actor|
	  check_change_equip(actor)  
	end
  end
  #--------------------------------------------------------------------------
  # * Change Skills
  #--------------------------------------------------------------------------
  def command_318
	aye_command_318
	iterate_actor(@parameters[0]) do |actor|
	  check_change_equip(actor)  
	end
  end
  #--------------------------------------------------------------------------
  # * Check Equipment
  #	 actor	   : actor
  #--------------------------------------------------------------------------
  def check_change_equip(actor)  
	for i in 0..4
	  case i
	  when 0
		item = $data_weapons[actor.weapon_id]
		stat = WEAPON[item.id]
	  when 1
		item = $data_armors[actor.armor1_id]
		stat = ARMOR[item.id]
	  when 2
		item = $data_armors[actor.armor2_id]
		stat = ARMOR[item.id]
	  when 3
		item = $data_armors[actor.armor3_id]
		stat = ARMOR[item.id]
	  when 4
		item = $data_armors[actor.armor4_id]
		stat = ARMOR[item.id]
	  end
	  actor.equip(i, 0) if !stat.nil? && !actor.equip_allowed?(stat)	  
	end
  end
end
zum Lesen den Text mit der Maus markieren

Avery

Dinoritterin mit Herrschaft über die Contests und Ressourcen

  • Nachricht senden

5

Dienstag, 21. Mai 2013, 19:20

Grade noch ein alternatives Script gefunden:
[XP] Tons of Add-ons

unter "Utility (make your game more unique and better/help you during debug):"

Vortex Lord

Ankömmling

  • »Vortex Lord« ist der Autor dieses Themas

Motto: El psy congroo! Tempus edax rerum

  • Nachricht senden

6

Dienstag, 21. Mai 2013, 20:06

Danke Avery funktioniert gut

Social Bookmarks