Hi there, I'm tusing a abs in my game, everything works very good, except for item drops.
monster don't drop any items at all, which isn't too bad but I would prefer it to be possible. is there a simple way to do it?
the part of the code where it checks if the enemy is dead and gives you exp/gold is here. maybe it's where the item part should be?
any help will be appreciated
monster don't drop any items at all, which isn't too bad but I would prefer it to be possible. is there a simple way to do it?
the part of the code where it checks if the enemy is dead and gives you exp/gold is here. maybe it's where the item part should be?
Code:
def check_dead_event(event)
if event.is_a?(Game_Event)
if event.monster_enemy.hp<=0
get_event_exp(event)
event.dead=true
event.action = ACTION_DEAD
event.action_time=MAX_DEADTIME
event.set_through(true)
event.start
event.action_frame=0
end
else
actor_num = event
actor = $game_party.actors[actor_num]
if actor.hp<=0
player = $game_players[actor_num]
player.dead=true
player.action = ACTION_DEAD
player.action_time = MAX_DEADTIME
player.action_frame=0
end
end
end
#--------------------------------------------------------------------------
def get_event_exp(event)
if event.monster_enemy!=nil
if $game_settings.share_exp
#t=(event.monster_enemy.exp / $game_party.actors.size).truncate
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
lastlevel = actor.level
actor.exp += event.monster_enemy.exp
if actor.level > lastlevel
self.animation_id.push($game_settings.levelup_animation_id)
end
end
else
if @actor_id == nil
return
end
actor = $game_party.actors[@actor_id]
if actor==nil
return
end
lastlevel = actor.level
actor.exp+=event.monster_enemy.exp
if actor.level > lastlevel
self.animation_id.push($game_settings.levelup_animation_id)
end
end
$game_party.gain_gold(event.monster_enemy.gold)
end
end