Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o tema • Voltar para a ficha do tema
[Resolvido] jogador normal bater em admin
5 participantes
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Dúvidas e pedidos
Página 1 de 1
[Resolvido] jogador normal bater em admin
galera quero uma coisinha pro meu jogo
fazer um jogador normal bater em admin
porque toda hora no meu jogo meus colegas
vao me bater toda hora no pc deles fala
que nao pode bater no administrador
porfavor alguem pode me ajudar neste caso ???
fazer um jogador normal bater em admin
porque toda hora no meu jogo meus colegas
vao me bater toda hora no pc deles fala
que nao pode bater no administrador
porfavor alguem pode me ajudar neste caso ???
_________________
- Jack:
Duel- Aldeia Friend
- Mensagens : 1375
Créditos : 107
Ficha do personagem
Nível: 1
Experiência:
(0/0)
Vida:
(30/30)
Re: [Resolvido] jogador normal bater em admin
Cara seria ruim deixar jogadores bater em vc não? ...
_________________
Re: [Resolvido] jogador normal bater em admin
Cara mando o Script PlayerVsPlayer que to sem o Netplay e RMXP,que faço isso para vc.
KaiqueHunter- Experiente
- Mensagens : 620
Créditos : 51
Re: [Resolvido] jogador normal bater em admin
Substitua o script: [ABS] PLayervsPLayer
por esse:
- Screeshot:
por esse:
- Código:
#============================================================================
# * Mr.Mo's ABS
#============================================================================
# Mr.Mo "Muhammet Sivri"
# Modified by Marlos Gama
# Version 1
# 09.16.06
# Modified² by Nanzin
#============================================================================
#--------------------------------------------------------------------------
# * 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_hp
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
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("Você não pode atacar aqui!")
return
end
end
if pl.nome == " "
next
end
#if !$party.empty?
#for i in 0..$party.members.size
# return if $party.members[i] == nil
# if $parte_s == true
# if pl.id == $charzinho_id
# $game_temp.chat_log.push("Você não pode atacar um membro da party!")
# next
# end
# else
# if pl.id == $party.members[i].netid
# $game_temp.chat_log.push("Você não pode atacar um membro da party!")
# next
# end
# end
#end
#end
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 != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
next
end
end
#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 [email=!@actor.skills.include?(skill.id]!@actor.skills.include?(skill.id[/email])
#Return if the actor can't use the skill
return if [email=!@actor.can_use_skill?(skill]!@actor.can_use_skill?(skill[/email])
#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
@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
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|
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
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("Você não pode atacar aqui!")
return
end
end
if pl.nome == " "
return
end
if pl.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Você não pode atacar o administrador!")
#$pvp_msg = true
#actor.damage = "ADM!"
return
end
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 != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
return
end
end
#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])
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)
end
return
when 3..4, 7 #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 animation
$game_player.animation_id = skill.animation2_id
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)
#$game_player.show_demage("#{player.nome} morreu",false)
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
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} morreu"
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("Level Up!",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)
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
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("Você não pode atacar aqui!")
return
end
end
if player.nome == " "
return
end
if player.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Você não pode atacar o administrador!")
#$pvp_msg = true
#actor.damage = "ADM!"
return
end
if User_Edit::ATTACK_MEMBER != true
if player.guild != "" and $game_party.actors[0].guild != "" and player.guild == $game_party.actors[0].guild and $guild_position != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
return
end
end
#player.jump(0,0) if damage != "Miss" and damage != 0
#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
#============================================================================
# * 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)
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]
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("Você não pode atacar aqui!")
return
end
end
if player.nome == " "
return
end
if player.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Você não pode atacar o administrador!")
#$pvp_msg = true
#actor.damage = "ADM!"
return
end
if User_Edit::ATTACK_MEMBER != true
if player.guild != "" and $game_party.actors[0].guild != "" and player.guild == $game_party.actors[0].guild and $guild_position != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
return
end
end
#player.jump(0,0) if damage != "Miss" and damage != 0
#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
_________________
Para Aqueles que gostam de Min e de meu Trabalho;
Upem Meu Pet nao custa nda!!
- Pet:
Nanzin- Membro de Honra
- Mensagens : 1550
Créditos : 252
Re: [Resolvido] jogador normal bater em admin
no jogo kkkDeidara escreveu:Cara seria ruim deixar jogadores bater em vc não? ...
eu quero que eles me batam porque eu sou gm talvez eles fiquem alegres quando conseguirem me derrotar
_________________
- Jack:
Duel- Aldeia Friend
- Mensagens : 1375
Créditos : 107
Ficha do personagem
Nível: 1
Experiência:
(0/0)
Vida:
(30/30)
Re: [Resolvido] jogador normal bater em admin
Valeu !!!!!!Nanzin escreveu:Substitua o script: [ABS] PLayervsPLayer
- Screeshot:
por esse:
- Código:
#============================================================================
# * Mr.Mo's ABS
#============================================================================
# Mr.Mo "Muhammet Sivri"
# Modified by Marlos Gama
# Version 1
# 09.16.06
# Modified² by Nanzin
#============================================================================
#--------------------------------------------------------------------------
# * 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_hp
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
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("Você não pode atacar aqui!")
return
end
end
if pl.nome == " "
next
end
#if !$party.empty?
#for i in 0..$party.members.size
# return if $party.members[i] == nil
# if $parte_s == true
# if pl.id == $charzinho_id
# $game_temp.chat_log.push("Você não pode atacar um membro da party!")
# next
# end
# else
# if pl.id == $party.members[i].netid
# $game_temp.chat_log.push("Você não pode atacar um membro da party!")
# next
# end
# end
#end
#end
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 != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
next
end
end
#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 [email=!@actor.skills.include?(skill.id]!@actor.skills.include?(skill.id[/email])
#Return if the actor can't use the skill
return if [email=!@actor.can_use_skill?(skill]!@actor.can_use_skill?(skill[/email])
#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
@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
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|
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
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("Você não pode atacar aqui!")
return
end
end
if pl.nome == " "
return
end
if pl.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Você não pode atacar o administrador!")
#$pvp_msg = true
#actor.damage = "ADM!"
return
end
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 != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
return
end
end
#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])
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)
end
return
when 3..4, 7 #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 animation
$game_player.animation_id = skill.animation2_id
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)
#$game_player.show_demage("#{player.nome} morreu",false)
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
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} morreu"
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("Level Up!",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)
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
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("Você não pode atacar aqui!")
return
end
end
if player.nome == " "
return
end
if player.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Você não pode atacar o administrador!")
#$pvp_msg = true
#actor.damage = "ADM!"
return
end
if User_Edit::ATTACK_MEMBER != true
if player.guild != "" and $game_party.actors[0].guild != "" and player.guild == $game_party.actors[0].guild and $guild_position != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
return
end
end
#player.jump(0,0) if damage != "Miss" and damage != 0
#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
#============================================================================
# * 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)
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]
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("Você não pode atacar aqui!")
return
end
end
if player.nome == " "
return
end
if player.grupo == "Admin"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Você não pode atacar o administrador!")
#$pvp_msg = true
#actor.damage = "ADM!"
return
end
if User_Edit::ATTACK_MEMBER != true
if player.guild != "" and $game_party.actors[0].guild != "" and player.guild == $game_party.actors[0].guild and $guild_position != "Lider"
actor = $game_party.actors[0]
$game_temp.chat_log.push("Jogador da mesma Guild!")
#$pvp_msg = true
#actor.damage = "Mesma Guild!"
return
end
end
#player.jump(0,0) if damage != "Miss" and damage != 0
#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
+1 Cred
_________________
- Jack:
Duel- Aldeia Friend
- Mensagens : 1375
Créditos : 107
Ficha do personagem
Nível: 1
Experiência:
(0/0)
Vida:
(30/30)
Re: [Resolvido] jogador normal bater em admin
cuidado com o double-post
_________________
https://www.facebook.com/wallace.o.b
Curta, interaja, compartilhe. :)
Curta, interaja, compartilhe. :)
Tópicos semelhantes
» Movido: jogador normal bater em admin
» [Resolvido]Local onde é aplicado o dano no jogador
» [Resolvido] Alguem pode criar um script ou um sistema de funfar mais de um usuário no grupo do jogador (4 -> 6)
» [Resolvido]Paperdoll da arma aparecer acima do jogador
» [Resolvido]Condição grupo Admin
» [Resolvido]Local onde é aplicado o dano no jogador
» [Resolvido] Alguem pode criar um script ou um sistema de funfar mais de um usuário no grupo do jogador (4 -> 6)
» [Resolvido]Paperdoll da arma aparecer acima do jogador
» [Resolvido]Condição grupo Admin
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Dúvidas e pedidos
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|