AngleOfLove
Youtube Master Race
- 31/7/05
- 34
- 0
PHP:
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 NS_count = 0;
string state="";
byte pt_count = 0;
byte time = 0;
byte pt1 = 0;
byte pt2 = 0;
byte pt3 = 0;
byte pt4 = 0;
/***** Chinh sua ID Member o day *****/
uint idmem1 = 2297435;
uint idmem2 = 414281;
uint idmem3 = 2193188;
uint idmem4_sena = 817650;
public override void MyAttack()
{
CharacterInfo MyChar = ts.Character;
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 10000);
}
public override void MyPartnerAttack()
{
CharacterInfo MyWarrior = ts.CurrentPartner;
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
/********************* Battle Started **********************/
public override void BattleStarted()
{
time=0;
}
/********************* Battle Stoped ***********************/
public override void BattleStopped()
{
AutoEatFood();
ProcessInventoryAction();
CheckDisconnect();
ViewState();
time=0;
ts.SendEnd();
}
public override void doRecvQuestion()
{
state="BTQ";
}
public override void ResponseAnswer()
{
int dtime= 1;
debug("Delay "+dtime.ToString()+" before answer.");
ts.delay(dtime*1000);
string tmp=ts.LastQuestion.Replace("=?","");
int ans=ts.Eval(tmp);
byte ans_index=Convert.ToByte(ts.LastAnswers[ans.ToString()]);
debug("Answer choice:"+ans_index.ToString());
ts.Answer(ans_index);
}
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);
}
}
/******************** 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());
if(DialogId == 12249)
{
ts.ClickOnNPC(50);
ts.ClickOnNPC(50);
ts.SendEnd();
return;
}
ts.SendEnd();
}
/************************ On Timer *************************/
public override void OnTimer()
{
time++;
if (time == 20) {Start();}
if (time == 40) {Start();}
if (time == 60) {Start();}
}
public override void RequestPartyAcceptFrom(uint playerid)
{
if (playerid == idmem1 && ts.Character.ghost <= 2) {ts.AcceptParty(playerid);}
if (playerid == idmem2 && ts.Character.ghost <= 2) {ts.AcceptParty(playerid);}
if (playerid == idmem3 && ts.Character.ghost <= 2) {ts.AcceptParty(playerid);}
if (playerid == idmem4_sena && ts.Character.ghost <= 2) {ts.AcceptParty(playerid);}
}
/********************* Accepted Party **********************/
public override void AcceptedParty(uint playerid)
{
if (playerid == idmem1) {debug(playerid + " Gia nhập đội ngũ");pt1 = 1;}
if (playerid == idmem2) {debug(playerid + " Gia nhập đội ngũ");pt2 = 1;}
if (playerid == idmem3) {debug(playerid + " Gia nhập đội ngũ");pt3 = 1;}
if (playerid == idmem4_sena) {debug(playerid + " Gia nhập đội ngũ");pt4 = 1;
ts.Sena(idmem4_sena);debug(playerid + " Làm Quân Sư");}
if (pt1 == 1 && pt2 == 1 && pt3 == 1 && pt4 == 1)
{
ts.SetTimerOnOff(true);
ts.delay(1000);
debug("Đội ngũ đã đầy -> Start");Start();}
}
/*********************** Party Stop ************************/
public override void PartyStop(uint playerid)
{
if (playerid == idmem1) {debug(playerid+" Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem2) {debug(playerid+" Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem3) {debug(playerid+" Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem4_sena) {debug(playerid+" Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
}
/************************* Start ***************************/
public override void Start()
{
ts.delay(1000);
ts.ClickOnNPC(50);
ts.SendEnd();
}
/********************* Fishish Answer **********************/
public override void FinishAnswer()
{
ts.delay(2000);
ts.ClickOnNPC(50);
ts.SendEnd();
}
void ViewState()
{
debug(" Số con ma : " + ts.Character.ghost ,0xFF0000) ;
}
/************************ Init Bot *************************/
public override void InitBot()
{
AutoEatFood();
ts.SetReconnectTime(3);
ts.SetMaxIdleTime(15);
AddDropItemList("viênongmật");
AddDropItemList("tựđ uốngthuốc");
AddDropItemList("viên công kích");
AddDropItemList("Quả Đào");
AddDropItemList("Búp bê TrgGiác");
ViewState();
}
) chỉ cần bỏ hàm delay khi nhấn thùng là đc.