______________________________________________________
Informacoes :
Bueno mas que nada le agradesco a Shocks por este sistema increivel.
Eu adapte para el NP4.
______________________________________________________
Para que server
Bueno aqui podemos usar estes sistemas para curar player's online ou para curar olayer en la party. Como magia de cura para los jogadores de seu party.
______________________________________________________
Scritp e intalacao tutorial :
1 *- Crear un nuevo scritp en su juego arriba del main y colocar este scritp.
y llamarlo : [ABS] Animation Global
- Código:
#===============================================================================
# ** Animation Global
#-------------------------------------------------------------------------------
# Author Shocks
# Author Jonny / Kakashy Hatake
# Modified Jonny / Kakashy Hatake
# Vercion = 1.0
#===============================================================================
module Network
class Main
#-------------------------------------------------------------------------------
# Global Animation
#-------------------------------------------------------------------------------
def self.global_animation(name,animation)
return if !$scene.is_a?(Scene_Map)
return if name == @name
for mp in Network::Main.mapplayers.values
next if mp == nil
next if mp.map_id != $game_map.map_id
for p in Network::Main.mapplayers.values
break if p.nome == name
end
return if p.map_id != $game_map.map_id
return if !$game_map.in_range?(p)
@actor = $game_party.actors[0]
$ABS.anim(p, @actor, animation)
end
end
#-------------------------------------------------------------------------------
# Curar
#-------------------------------------------------------------------------------
def self.player_heal(name, hp, mp, animation)
# Interromper: caso não estiver no mapa
return if !$scene.is_a?(Scene_Map)
# Interromper: se você é o alvo
return if name != @name
# Aumentar HP/MP
$game_party.actors[0].hp += hp
$game_party.actors[0].sp += mp
# Mostrar texto
$game_party.actors[0].damage = "+#{hp} HP" if hp > 0
$game_party.actors[0].damage = "+#{mp} MP" if mp > 0
# Aplicar animação
$game_player.animation_id = animation
# Enviar novos dados
self.send_newstats
end
#-------------------------------------------------------------------------------
# Global Damage Text
#-------------------------------------------------------------------------------
def self.global_damage(name, text)
# Interromper: caso não estiver no mapa
return if !$scene.is_a?(Scene_Map)
# Interromper: se você é o alvo
return if name == @name
# Loop de jogadores
for p in Network::Main.mapplayers.values
# Parar caso o seja o jogador alvo
break if p.username == name
end
# Interromper: se o mapa é diferente
return if p.map_id != $game_map.map_id
# Interromper: se o jogador não está visível
return if !$game_map.in_range?(p)
# Aplicar dano
p.show_demage(text, false)
end
end
end
Colocar este scritp acima de :
- Código:
157 #Ranged Weapons
158 RANGE_WEAPONS = {}
- Código:
# ==============================================================
# Habilidades de Área
# ==============================================================
AREA_SKILLS = {}
# AREA_SKILLS[Skill_ID] = [Tamanho da Área]
AREA_SKILLS[1] = [2]
- Código:
#--------------------------------------------------------------------------
# * Range Weapons
#--------------------------------------------------------------------------
def RANGE_WEAPONS
return RANGE_WEAPONS
end
- Código:
#--------------------------------------------------------------------------
# * Area Skills
#--------------------------------------------------------------------------
def AREA_SKILLS
return AREA_SKILLS
end
Luego es ese te mismo scripts mais abaixo encontrar esta linea :
- Código:
#--------------------------------------------------------------------------
# * Hit Enemy(Enemy) or (Player)
#--------------------------------------------------------------------------
def hit_enemy(e,a,animation=nil)
#e.event.jump(0, 0)
return if animation == 0
if animation == nil
e.event.animation_id = a.animation2_id
else
e.event.animation_id = animation
end
end
Colocar esto :
- Código:
#--------------------------------------------------------------------------
# * Aplicar Animação
#--------------------------------------------------------------------------
def anim(e, a, animation = nil)
return if animation == 0
if animation == nil
e.event.animation_id = a.animation2_id
else
e.event.animation_id = animation
end
end
4 *- Ahora de ir a [ABS] PlayerVsPlayer y remplazarlo por este novo scritp :
- Código:
#============================================================================
# * Mr.Mo's ABS
#============================================================================
# Mr.Mo "Muhammet Sivri"
# Modified by Valentine
# Version 1
# 09.16.06
#============================================================================
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("Mr.Mo's ABS") == true
class MrMo_ABS
#--------------------------------------------------------------------------
# * Configurações
#--------------------------------------------------------------------------
VICTORY = '002-Victory02'
EXP_GAIN = 0
GOLD_GAIN = 0
#--------------------------------------------------------------------------
# * Player Melee Attack
#--------------------------------------------------------------------------
def player_melee
return if $data_weapons[@actor.weapon_id] == nil
return if attacked_monster?
return if attacked_player?
end
#--------------------------------------------------------------------------
# * Player Attacked a Monster?
#--------------------------------------------------------------------------
def attacked_monster?
#Get all enemies
for e in @enemies.values
#Skip NIL values or dead enemies
next if e == nil or e.dead?
#Skip the enemy if its not close by or not facing
next if !in_direction?($game_player, e.event) or !in_range?($game_player, e.event, 1)
#Attack the enemy
e.attack_effect(@actor)
#Get Animation
a = $data_weapons[@actor.weapon_id].animation2_id
#Hit enemy if the attack succeeds
hit_enemy(e, @actor, a) if e.damage != "Miss" and e.damage != 0
#Animate the player
if MELEE_ANIMATION[@actor.weapon_id] == nil
animate($game_player, $game_player.character_name+"_melee") if @player_ani
else
m = MELEE_ANIMATION[@actor.weapon_id]
animate($game_player, $game_player.character_name+m.to_s) if @player_ani
end
#Return if the enemy is dead
return true if enemy_dead?(e,@actor)
return true if !e.hate_group.include?(0)
#Set the new target for the enemy
e.attacking = $game_player
#The enemy is now in battle
e.in_battle = true
#Setup movement
setup_movement(e)
$ABS.guardando_hp3(a)
end
return false
end
#--------------------------------------------------------------------------
# * Player Attacked a Player?
#--------------------------------------------------------------------------
def attacked_player?
#Get all enemies
for pl in Network::Main.mapplayers.values
#Skip NIL values or dead enemies
next if pl == nil or pl.hp == 0 or pl.map_id != $game_map.map_id
#Skip the enemy if its not close by or not facing
next if !in_direction?($game_player, pl) or !in_range?($game_player, pl, 1)
if pl.hp < 0 or pl.hp == 0
return
end
return if can_pvp?(pl) == false
#Attack the player
damage = pl.attack_effect
#Get Animation
a = $data_weapons[@actor.weapon_id].animation2_id
#Store the player's net id
netid = pl.netid
#Send the demage and aniamtion
Network::Main.socket.send("<attack_id>#{netid}\n") if damage != "Miss" and damage != 0
Network::Main.socket.send("<attack_effect>dam=#{damage}; ani=#{a} id=#{Network::Main.id}; map=#{$game_map.map_id}</attack_effect>\n") if damage != "Miss" and damage != 0
pl.show_demage(damage,false) if damage != "Miss" and damage != 0
#Hit enemy if the attack succeeds
hit_enemy(pl, @actor, a) if damage != "Miss" and damage != 0
#Animate the player
if MELEE_ANIMATION[@actor.weapon_id] == nil
animate($game_player, $game_player.character_name+"_melee") if @player_ani
else
m = MELEE_ANIMATION[@actor.weapon_id]
animate($game_player, $game_player.character_name+m.to_s) if @player_ani
end
netplayer_killed(pl) if pl.hp <= 0
return true
end
return false
end
#--------------------------------------------------------------------------
# * Player Skill Attack
#--------------------------------------------------------------------------
def player_skill(id)
#Get Skill
skill = $data_skills[id]
#Return if the skill doesn't exist
return if skill == nil
#Return if the actor doesn't have the skill
return if !@actor.skills.include?(skill.id)
#Return if the actor can't use the skill
return if !@actor.can_use_skill?(skill)
#Animate
if SKILL_ANIMATION.has_key?(id)
l = SKILL_ANIMATION[id]
animate($game_player, $game_player.character_name+l.to_s) if @player_ani
else
animate($game_player, $game_player.character_name+"_cast") if @player_ani
end
#Get the skill scope
case skill.scope
when 1 #Enemy
#If the skill is ranged
if RANGE_SKILLS.has_key?(skill.id)
#Add to range
$magia_atk = skill.animation2_id
@range.push(Game_Ranged_Skill.new($game_player, @actor, skill))
@o = RANGE_SKILLS[skill.id]
@online_chara = @o[2]
@online_move_speed = @o[1]
@online_range = @o[0]
$ranged_sprite = true
Network::Main.socket.send("<23>self.range_sprite(#{$game_map.map_id},[#{$game_player.direction},#{$game_player.x},#{$game_player.y}],$game_party.actors[0],#{@actor.weapon_id},'#{@online_chara}',#{@online_move_speed},#{@online_range})</23>\n")
#Take off SP
@actor.sp -= skill.sp_cost
$ABS.guardando_hp2
return
end
#If the skill is not ranged
enemies = []
#Get all enemies
for enemy in @enemies.values
next if enemy == nil
if $event_leva != nil
enemies.push($ABS.enemies[$event_leva.id])
else
if $player_leva != nil
enemies.push($player_leva)
else
enemies.push(enemy)
end
end
end
#Get all players
for player in Network::Main.mapplayers.values
next if player == nil
if $player_leva != nil
enemies.push($player_leva)
else
enemies.push(player)
end
end
#Order them from closest to the farthest
enemies.sort! {|a,b|
return if a == nil or b == nil
get_range(a.event,b.event) - get_range(b.event,a.event) }
return if enemies[0] == nil
#Attack the closest one
enemies[0].effect_skill(@actor, skill)
if enemies[0].is_a?(Game_NetPlayer)
damage = enemies[0].damage
pl = enemies[0]
a = skill.animation2_id
#Store the player's net id
netid = pl.netid
return if can_pvp?(pl) == false
#Send the demage and aniamtion
Network::Main.socket.send("<attack_id>#{netid}\n") if damage != "Miss" and damage != 0
Network::Main.socket.send("<attack_effect>dam=#{damage}; ani=#{a} id=#{Network::Main.id}; map=#{$game_map.map_id}</attack_effect>\n") if damage != "Miss" and damage != 0
pl.show_demage(damage,false) if damage != "Miss" and damage != 0
end
#Take off SP
@actor.sp -= skill.sp_cost
#Show Animetion on enemy
hit_enemy(enemies[0], @actor, skill.animation2_id) if enemies[0].damage != "Miss" and enemies[0].damage != 0
return if enemies[0].is_a?(Game_NetPlayer)
#Return if enemy is dead
return if enemy_dead?(enemies[0],@actor)
return if !enemy.hate_group.include?(0)
#If its alive, put it in battle
enemies[0].in_battle = true
#Make it attack the player
enemies[0].attacking = $game_player
#Setup movement
setup_movement(enemies[0])
$ABS.guardando_hp3(skill.animation2_id)
return
when 2 #All Emenies
#Play the animation on player
$game_player.animation_id = skill.animation2_id
#Take off SP
@actor.sp -= skill.sp_cost
#enemies = get_all_range
#Get all enemies
for e in @enemies.values
#Skip NIL values
next if e == nil
enemy = e
#Attack enemy
e.effect_skill(@actor, skill)
#Show Animetion on enemy
hit_enemy(e, @actor, 0) if enemy.damage != "Miss" and enemy.damage != 0
#Skip this enemy if its dead
next if enemy_dead?(e,@actor)
next if !e.hate_group.include?(0)
#If its alive, put it in battle
enemy.in_battle = true
#Make it attack the player
enemy.attacking = $game_player
#Setup movement
setup_movement(e)
$ABS.guardando_hp3(0)
end
return
when 3 #User
#Use the skill on the player
actor = $game_party.actors[0]
actor.effect_skill(@actor, skill)
#Take off SP
@actor.sp -= skill.sp_cost
#Play Skill animation
$game_player.animation_id = skill.animation1_id
#Send Skill Animation
Network::Main.socket.send("<23>self.global_animation('#{Network::Main.name}',#{skill.animation1_id})</23>\n")
return
when 4
# ----------------------------------------------------------------
# Tipo de Skill: Grupo
# ----------------------------------------------------------------
# --------------------------------------
# Verificar Skill em Área
# --------------------------------------
if AREA_SKILLS.has_key?(skill.id)
# Zerar quantidade de alvos
alvos = 0
# Loop de jogadores
if !$party.empty?
for p in Network::Main.mapplayers.values
# Próximo se o jogador for nulo
next if p == nil
# Skill infos
skill_spr = AREA_SKILLS[skill.id]
area = skill_spr[0]+1
x = $game_player.x
y = $game_player.y
# Verificar se está na área de alcance
if p.x > x-area and p.x < x+area and p.y > y-area and p.y < y+area
# Aplicar skill
p.effect_skill(@actor, skill)
# Interromper: caso não seja magia de cura
return if skill.str_f != 1
# Skill infos
hp = skill.power
mp = skill.atk_f
animation = skill.animation1_id
# Jogador alvo
playername = p.username
# Enviar ação ao servidor
Network::Main.socket.send("<23>self.player_heal('#{playername}',#{hp},#{mp},#{animation})</23>\n")
# Mostrar texto
text1 = "+#{hp} HP"
text2 = "+#{mp} MP"
# Enviar textos
Network::Main.socket.send("<23>self.global_damage('#{playername}','#{text1}')</23>\n") if hp > 0
Network::Main.socket.send("<23>self.global_damage('#{playername}','#{text2}')</23>\n") if mp > 0
# Aplicar animação no alvo
anim(p, @actor, animation)
# Adicionar número de atingidos
alvos += 1
end
end
# Gastar MP da skill
@actor.sp -= skill.sp_cost
# Aplicar animação
$game_player.animation_id = skill.animation1_id
# Enviar animação
Network::Main.socket.send("<23>self.global_animation('#{Network::Main.name}',#{skill.animation1_id})</23>\n")
# Definir texto
if alvos > 0
text1 = "$CUROU #{alvos}"
else
text1 = "*SEM EFEITOS"
end
# Criar texto no personagem
$game_party.actors[0].damage = text1
Network::Main.socket.send("<23>self.global_damage('#{Network::Main.name}','#{text1}')</23>\n")
end
end
# -------------------
# When: case [FIM]
# -------------------
return
end
end
#--------------------------------------------------------------------------
# * Get ALL Range(Element, Range)
#--------------------------------------------------------------------------
def get_all_range(element, range)
objects = []
for e in @enemies.values
next if e == nil
objects.push(e) if in_range?(element, e.event, range)
end
for player in Network::Main.mapplayers.values
next if player == nil
objects.push(player) if in_range?(element, player, range)
end
return objects
end
#--------------------------------------------------------------------------
# * Netplayer Killed
#--------------------------------------------------------------------------
def netplayer_killed(player)
if player.guild != "" and $game_party.actors[0].guild != "" and player.guild != $game_party.actors[0].guild
$guild_points += 1
$guild_created.refresh if $guild_created.visible
for p in Network::Main.players.values
if p.guild == $game_party.actors[0].guild
Network::Main.pchat(p.netid,"[COM] [GUILD_POINTS]")
end
end
end
return if player.hp == 0
return if player.hp < 0
Audio.me_play("Audio/ME/" + VICTORY, 80, 100)
actor = $game_party.actors[0]
actor.damage = "#{player.nome} " + LANGUAGE::PLAYERDEATH
if actor.cant_get_exp? == false
last_level = actor.level
exp = player.level * EXP_GAIN
actor.exp += player.level * EXP_GAIN
#$game_player.show_demage("Gained #{exp} Exp.",false)
if actor.level > last_level
$game_player.show_demage(LANGUAGE::PLAYERLEVELUP,false)
actor.hp = actor.maxhp
actor.sp = actor.maxsp
end
end
return if GOLD_GAIN <= 0
return if player.gold <= 0
gold = player.gold*GOLD_GAIN
$game_party.gain_gold(gold.to_i)
end
end
#============================================================================
# * Game Ranged Skill
#============================================================================
class Game_Ranged_Skill < Range_Base
#--------------------------------------------------------------------------
# * Check Event Trigger Touch(x,y)
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
return if @stop
hit_player if x == $game_player.x and y == $game_player.y
for event in $game_map.events.values
if event.x == x and event.y == y
if event.character_name == ""
froce_movement
else
hit_event(event.id)
$ABS.guardando_hp3($magia_atk)
end
end
end
return if @parent.is_a?(Game_Event)
#Check netplayer hit
for player in Network::Main.mapplayers.values
next if player == nil
next if player.x != x or player.y != y
hit_netplayer(player)
end
end
#--------------------------------------------------------------------------
# * Hit NetPlayer
#--------------------------------------------------------------------------
def hit_netplayer(player)
@stop = true
#Get Actor
actor = player
#Get Enemy
enemy = @actor
#Attack Actor
damage = actor.effect_skill(enemy, @skill)
damage = player.damage
#Store the player's net id
netid = player.netid
a = @skill.animation2_id
return if can_pvp?(player) == false
#Send the demage and aniamtion
Network::Main.socket.send("<attack_id>#{netid}\n") if damage != "Miss" and damage != 0
Network::Main.socket.send("<attack_effect>dam=#{damage}; ani=#{a} id=#{Network::Main.id}; map=#{$game_map.map_id}</attack_effect>\n") if damage != "Miss" and damage != 0
#Show animation on player
player.animation_id = @skill.animation2_id if actor.damage != "Miss" and actor.damage != 0
#Check if enemy is dead
player.show_demage(player.damage,false) if damage != "Miss" and damage != 0
$ABS.netplayer_killed(player) if player.hp <= 0
end
end
#============================================================================
# * Can Pvp?
#============================================================================
def can_pvp?(pl)
# Mapa é NO-PVP?
for i in 0..(User_Edit::MAP_NO_PVP.size-1)
if $game_map.map_id == User_Edit::MAP_NO_PVP[i] and $game_party.actors[0].grupo != "Admin"
$game_temp.chat_log.push(LANGUAGE::NO_PVP)
return false
end
end
# Não tem nome?
if pl.nome == " "
return false
end
# Jogador é administrador?
if pl.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push(LANGUAGE::PVP_ADM)
return false
end
# Jogador da mesma guild?
if User_Edit::ATTACK_MEMBER != true
if pl.guild != "" and $game_party.actors[0].guild != "" and pl.guild == $game_party.actors[0].guild and $guild_position != LANGUAGE::GUILDLEADER
actor = $game_party.actors[0]
$game_temp.chat_log.push(LANGUAGE::PVP_GUILD)
return false
end
end
return true
end
#============================================================================
# * Game Ranged Weapons
#============================================================================
class Game_Ranged_Weapon < Range_Base
#--------------------------------------------------------------------------
# * Check Event Trigger Touch(x,y)
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
return if @stop
hit_player if x == $game_player.x and y == $game_player.y
for event in $game_map.events.values
next if event.x != x or event.y != y
if event.character_name == ""
froce_movement
else
hit_event(event.id)
$ABS.guardando_hp3($magia_atk)
end
end
return if @parent.is_a?(Game_Event)
#Check netplayer hit
for player in Network::Main.mapplayers.values
next if player == nil
next if player.x != x or player.y != y
hit_netplayer(player)
end
end
#--------------------------------------------------------------------------
# * Hit NetPlayer
#--------------------------------------------------------------------------
def hit_netplayer(player)
@stop = true
#Get Enemy
enemy = @actor
#Attack Actor
damage = player.attack_effect(enemy)
#Store the player's net id
netid = player.netid
a = @range_wepaon[2]
return if can_pvp?(player) == false
#Send the demage and aniamtion
Network::Main.socket.send("<attack_id>#{netid}\n") if damage != "Miss" and damage != 0
Network::Main.socket.send("<attack_effect>dam=#{damage}; ani=#{a} id=#{Network::Main.id}; map=#{$game_map.map_id}</attack_effect>\n") if damage != "Miss" and damage != 0
#Show animation on player
player.animation_id = @range_wepaon[2] if player.damage != "Miss" and player.damage != 0
#Check if enemy is dead
player.show_demage(player.damage,false) if damage != "Miss" and damage != 0
$ABS.netplayer_killed(player) if player.hp <= 0
end
end
#--------------------------------------------------------------------------
# * SDK End
#--------------------------------------------------------------------------
end
6 *- crear una nueva habilidad como esta en la img :
- Spoiler:
7 *- Teste con otro jugador e pronto
8 *- De creditos :DObrigado a "Another Land Of Fantasy" ele e la bace teste.
___________________________________________________
Creditos :
Valentine
Jonny
Shocks
Another Land Of Fantasy
Última edição por Jonny em Sáb Fev 01, 2014 7:55 pm, editado 3 vez(es)