double DisconnectFlag = 0.3; // Disconnect when current HP is below 30%
double hpFractionEat = 0.8; //Eat HP when current HP<= 80%
double spFractionEat = 0.8;
double hpFraction = 0.95; //Eat until current HP >= 95 %
double spFraction = 0.95;
byte DisconFai = 00; // Faith of warrior to disconnect
byte turna = 0;
byte turnb = 0;
byte pt1 = 0;
byte pt2 = 0;
byte pt3 = 0;
byte pt4 = 0;
uint idchupt = 01364987;
/***** Chinh sua ID Member o day *****/
uint idmem1 = 01459105;
uint idmem2 = 01750854;
uint idmem3 = 02093139;
uint idmem4_sena = 01686800;
public override void MyAttack()
{
turna++;
if (turna == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 1, 10000); // gà đánh thường, nếu bắn hỏa tiễn thì thay lại là 12003
}
if (turna >=2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 4, 18001); // turn 2 skill chạy trốn
}
}
public override void MyPartnerAttack()
{
turnb++;
if (turnb == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 1, 12003); // bắn hỏa tiễn
}
if (turnb >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 4, 17001); // turn 2 def
}
}
/********************* Battle Started **********************/
public override void BattleStarted()
{
turnb=0;
turna=0;
}
/********************* Battle Stoped ***********************/
public override void BattleStoped()
{
AutoEatFood();
ProcessInventoryAction();
CheckDisconnect();
Stop();
}
/******************* Receive Question *********************/
public override void doRecvQuestion()
{
}
/******************** Response Answer **********************/
public override void ResponseAnswer()
{
string tmp=ts.LastQuestion.Replace("=?","");
int ans=ts.Eval(tmp);
byte ans_index=Convert.ToByte(ts.LastAnswers[ans.ToString()]);
ts.Answer(ans_index);
}
/******************** NPC Dialog Menu **********************/
public override void NpcDialogMenu(ushort DialogId)
{
debug("Dialog Menu ID = "+DialogId.ToString());
}
/********************* NPC Dialog ID ***********************/
public override void NpcDialog(ushort DialogId)
{
debug("Dialog ID = "+DialogId.ToString());
}
/********************* On NPC Appear ***********************/
public override void onNPCAppear(ushort npcmapid, int x, int y)
{
}
/************************ On Timer *************************/
public override void OnTimer()
{
}
/********************** Warp Finish ************************/
public override void warpFinish()
{
}
/************************* Start ***************************/
public override void Start()
{
}
/************************** Stop ***************************/
public override void Stop()
{
}
/********************* Fishish Answer **********************/
public override void FinishAnswer()
{
}
public override void PlayerOnline(uint playerid)
{
ts.RequestParty(idchupt);
}
/**************** Request Party Accept From ****************/
public override void RequestPartyAcceptFrom(uint playerid)
{
ts.AcceptParty(idchupt);
}
/*********************** Party Stop ************************/
public override void PartyStop(uint playerid)
{
if (playerid == idmem1) {debug(playerid+ "Rời khởi đội ngũ");}
if (playerid == idmem2) {debug(playerid+ "Rời khởi đội ngũ");}
if (playerid == idmem3) {debug(playerid+ "Rời khởi đội ngũ");}
if (playerid == idmem4_sena) {debug(playerid+ "Rời khởi đội ngũ");}
}
/************************ Init Bot *************************/
public override void InitBot()
{
ts.SetReconnectTime(3);
ts.SetMaxIdleTime(15);
AddDropItemList("viênongmật");
AddDropItemList("Dâu đỏ");
AddDropItemList("Táo nhỏ");
AddDropItemList("Mật Ý Nhân");
AddDropItemList("Nhị Quoa đầu");
AddDropItemList("tựđ uốngthuốc");
AddDropItemList("Táo nhỏ");
AddDropItemList("Bành Bột Mì");
AddDropItemList("viên công kích");
Stop();
ts.RequestParty(idchupt);
}