Quote:
Originally Posted by _DreadNought_
API*
Also, I bet you ultimation's tournamentAPI whoops all of yours. :p
Also pro4never, did you ever notice AcidCOV3 implemented man vs machine? (The idea you were on about where you literally fight bots. ;))
|
I already have the 2nd lmao (I assume you just meant duelbots). Will also be including it in the tournaments, where bots joins tournaments if there isn't enough players aye.
And yeah sorry for forgetting the P :( Hahahaha
This is basically mine: (Recently changing it to scripting as well, so rebuilding the server is not necessary.)
Code:
public abstract class TournamentBase
{
public TournamentBase()
{
}
public abstract int MeasureEndTime();
public abstract void Start();
public abstract void Send();
public abstract void End();
public abstract bool SignUp(Entities.GameClient client, out bool AlreadySigned);
public void SendMessage(string Message)
{
using (var msg = Packets.Message.MessageCore.CreateCenter(Message))
{
Packets.Message.MessageCore.SendGlobalMessage(msg);
}
}
public void SendMessageBC(string Message)
{
using (var msg = Packets.Message.MessageCore.CreateBroadcast("SYSTEM", Message))
{
Packets.Message.MessageCore.SendGlobalMessage(msg);
}
}
public void SendMessage(Entities.GameClient client, string Message)
{
using (var msg = Packets.Message.MessageCore.CreateCenter(Message))
{
client.Send(msg);
}
}
public abstract void UpdateBroadcast();
}
Code:
public abstract class BattleClass
{
public abstract bool HandleBeginAttack(Entities.GameClient Attacker);
public abstract bool HandleAttack(Entities.GameClient Attacker, Entities.GameClient Attacked, ref uint damage);
public abstract bool HandleBeginHit_Physical(Entities.GameClient Attacker);
public abstract bool HandleBeginHit_Ranged(Entities.GameClient Attacker);
public abstract bool HandleBeginHit_Magic(Entities.GameClient Attacker, Packets.UseSpellPacket usespell);
public abstract bool HandleDeath(Entities.GameClient Attacker, Entities.GameClient Attacked);
}
The battle class is used in other things such as arena as well. Let's me control the attack-handler dynamically.
Example for LastManStanding:
Code:
public class LastManStandingBattleClass : Data.BattleClass
{
public LastManStanding LastManStanding;
public override bool HandleBeginAttack(ProjectX_V3_Game.Entities.GameClient Attacker)
{
return (DateTime.Now >= LastManStanding.TournamentStartTime);
}
public override bool HandleBeginHit_Physical(ProjectX_V3_Game.Entities.GameClient Attacker)
{
return false;
}
public override bool HandleBeginHit_Ranged(ProjectX_V3_Game.Entities.GameClient Attacker)
{
return false;
}
public override bool HandleBeginHit_Magic(ProjectX_V3_Game.Entities.GameClient Attacker, Packets.UseSpellPacket usespell)
{
if (usespell.SpellID != 1045 && usespell.SpellID != 1046)
return false;
return true;
}
public override bool HandleAttack(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked, ref uint damage)
{
damage = 1;
Attacked.TournamentScore.CurrentHP -= 1;
LastManStanding.SendMessage(Attacked, string.Format(LastManStanding.HEALTH, Attacked.TournamentScore.CurrentHP));
if (Attacked.TournamentScore.CurrentHP <= 0)
{
Attacker.TournamentScore.CurrentScore += 1;
Attacker.TournamentInfo.TotalKills += 1;
Entities.GameClient rClient;
LastManStanding.Players.TryRemove(Attacked.EntityUID, out rClient);
Attacked.Battle = null;
Attacked.Equipments.ClearMask();
if (Attacked.TournamentScore.CurrentScore >= 5)
Attacked.TournamentInfo.TournamentPoints += LastManStanding.EXTRA_SCORE;
Attacked.TournamentInfo.TotalDeaths -= 1;
Attacked.Teleport(Attacked.LastMapID, Attacked.LastMapX, Attacked.LastMapY);
LastManStanding.UpdateBroadcast();
LastManStanding.CheckForWin();
}
return false;
}
public override bool HandleDeath(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked)
{
return false;
}
}
Still not finished though.
inb4gettingofftopic