Van du dao sĩ nè :
Mã:
double DisconnectFlag = 0.2; // Disconnect when current HP is below 30%
double hpFractionEat = 0.5; //Eat HP when current HP<= 80%
double spFractionEat = 0.5;
double hpFraction = 0.95; //Eat until current HP >= 95 %
double spFraction = 0.95;
byte DisconFai = 00; // Faith of warrior to disconnect
byte pt_count = 0;
byte myturn = 0;
byte peturn = 0;
uint tv1 = 0207963; // là QS luôn
uint tv2 = 007969; // L
uint tv3 = 0036360; // L
uint tv4 = 0218518; // G
uint maxpt = 3; //so thanh vien
public override void MyAttack()
{
myturn++;
if (myturn == 1)
{
CharacterInfo MyChar = ts.Character;
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 10000);
}
if (myturn >= 2)
{
CharacterInfo MyChar = ts.Character;
ts.SendAttack(MyChar.Row, MyChar.Col, 1, 3, 10000);
}
}
public override void MyPartnerAttack()
{
peturn++;
if (peturn == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
if (peturn >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 1, 3, 10000);
}
}
public override void BattleStarted()
{
myturn = 0;
peturn = 0;
}
public override void BattleStoped()
{
ProcessInventoryAction();
AutoEatFood();
ts.ClickOnNPC(6);
}
public override void doRecvQuestion()
{
debug("Gap BTQ roi`, tra loi` ko noi dau, chay thoi !",0xFF0000);
ts.Disconnect();
}
public override void ResponseAnswer()
{
ts.delay(10000);
}
public override void onPlayerWalk(uint uid, ushort x, ushort y)
{
if (uid > 1 && uid < 501) {
debug("GM den roi chay thoi",0xFF0000);
ts.Disconnect(false);
}
}
public override void PartyStop(uint playerid)
{
if (playerid == tv1 || playerid == tv2 || playerid == tv3 || playerid == tv4) {debug("Disconnect boi " + playerid,0xFF2200);ts.Disconnect();}
}
public override void Start()
{
ts.ClickOnNPC(6);
}
public override void FinishAnswer()
{
ts.ClickOnNPC(6);
}
public override void NpcDialogMenu(ushort DialogId)
{
debug("Menu ID="+DialogId.ToString());
if (DialogId==1) {ts.SelectChoice(1); ts.SendEnd(); }
else {ts.SendEnd();}
}
public override void NpcDialog(ushort DialogId)
{
debug("Dialog ID="+DialogId.ToString());
if (DialogId==12210) {ts.ClickOnNPC(6);}
else {ts.SendEnd();}
}
public override void OnTimer()
{
ts.AcceptParty(tv1);
ts.AcceptParty(tv2);
ts.AcceptParty(tv3);
ts.AcceptParty(tv4);
}
public override void AcceptedParty(uint playerid)
{
if(playerid == tv1) {ts.Sena(playerid);}
pt_count++;
if(pt_count==maxpt){
ts.SetTimerOnOff(false);
debug(" So thanh vien la : " + pt_count + " ===> Go Let's Go !" ,0x0000FF);
ts.SetTimerOnOff(false);
Start();}
else{
debug(" So thanh vien la : " + pt_count ,0x0000FF);
}
}
public override void InitBot()
{
ts.SetTimerOnOff(true);
ts.SetReconnectTime(1);
ts.SetMaxIdleTime(20);
debug(" S? con ma : " + ts.Character.ghost ,0xFF0000) ;
}
