Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Phoenix.HabboHotel.GameClients;
- using Phoenix.HabboHotel.Items;
- using Phoenix.HabboHotel.Rooms;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Phoenix.HabboHotel.Misc.Commands.Combat
- {
- /// <summary>
- /// Class HitCmd implements IChatCommand.
- /// </summary>
- class HitCmd : IChatCommand
- {
- public int RequiredRank
- {
- get { return -1; }
- }
- public string PermissionRequired
- {
- get { return ""; }
- }
- public bool IsAsynchronous
- {
- get { return false; }
- }
- public void Parse(GameClient Session, string Message)
- {
- string[] s = Message.Split(' ');
- if (s.Length == 1 || s.Length == 0)
- {
- return;
- }
- string msg = CommandManager.MergeParams(s, 1);
- var grabTarget = Phoenix.GetGame().GetClientManager().GetClientByHabbo(msg);
- var grabRoom = Phoenix.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
- if (grabTarget != null)
- {
- RoomUser theAttacker = grabRoom.method_53(Session.GetHabbo().Id);
- RoomUser theTarget = grabRoom.method_53(grabTarget.GetHabbo().Id);
- int _damage = Phoenix.GetRandomNumber(1, 10);
- if (Session.GetRoleplay().Strength > 5)
- _damage = Phoenix.GetRandomNumber(2, 15);
- if (Session.GetRoleplay().Strength > 10)
- _damage = Phoenix.GetRandomNumber(6, 25);
- if (Math.Abs(theAttacker.int_3 - theTarget.int_3) < 2 && Math.Abs(theAttacker.int_4 - theTarget.int_4) < 2)
- {
- switch (Phoenix.GetRandomNumber(1, 4))
- {
- case 1:
- {
- if (grabTarget.GetRoleplay().Health <= 0)
- {
- theAttacker.method_1(Session, "*Swings my fist into " + msg + "'s face causing " + _damage + " damage and killing them! [-2E, +35XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- return;
- }
- theAttacker.method_1(Session, "*Swings my fist into " + msg + "'s face causing " + _damage + " damage [-2E, +20XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- Session.GetRoleplay().Energy -= 2;
- theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
- }
- return;
- case 2:
- {
- if (grabTarget.GetRoleplay().Health <= 0)
- {
- theAttacker.method_1(Session, "*Ducks and right-hooks " + msg + " into their jaw causing " + _damage + " damage and killing them! [-2E, +35XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- return;
- }
- theAttacker.method_1(Session, "*Ducks and right-hooks " + msg + " into their jaw causing " + _damage + " damage [-2E, +20XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- Session.GetRoleplay().Energy -= 2;
- theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
- }
- return;
- case 3:
- {
- if (grabTarget.GetRoleplay().Health <= 1)
- {
- theAttacker.method_1(Session, "Sideswipes " + msg + " straight into their privates causing " + _damage + " damage and killing them! [-2E, +35XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- return;
- }
- theAttacker.method_1(Session, "*Sideswipes " + msg + " straight into their privates causing " + _damage + " damage [-2E, +20XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- Session.GetRoleplay().Energy -= 2;
- theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
- }
- return;
- case 4:
- {
- theAttacker.method_1(Session, "*Dropkicks " + msg + " straight into their nose causing " + _damage + " damage [-2E, +20XP]*", true);
- grabTarget.GetRoleplay().Health -= _damage;
- Session.GetRoleplay().Energy -= 2;
- theTarget.method_1(grabTarget, "[" + grabTarget.GetRoleplay().Health + "/100]", true);
- }
- return;
- }
- }
- else
- {
- theAttacker.method_1(Session, "*Swings at " + msg + "'s face but fails to hit them*", true);
- Session.GetHabbo().method_28("This user '" + msg + "' is too far away, try gettig closer!");
- return;
- }
- }
- else
- {
- Session.GetHabbo().method_28("This user '" + msg + "' does not exists!");
- return;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement