herokin2008
Youtube Master Race
- 22/4/06
- 87
- 0
PHP:
double DisconnectFlag = 0.1; // 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 time = 0;
byte battle_count = 0;
byte NS_count = 0;
byte myturn = 0;
byte peturn = 0;
/******** Chinh sua ID o day ********/
uint idchupt = 2124521;
/*************************************/
/*********************** My Attack *************************/
public override void MyAttack()
{
myturn++;
if (myturn == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 10000);
}
if (myturn >= 2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 10000);
}
}
/******************* My Partner Attack *********************/
public override void MyPartnerAttack()
{
peturn++;
if (peturn == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
if (peturn >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
}
/********************* Battle Started **********************/
public override void BattleStarted()
{
battle_count++;
myturn = 0;
peturn = 0;
time = 0;
}
/********************* Battle Stoped ***********************/
public override void BattleStopped()
{
AutoEatFood();
ProcessInventoryAction();
//CheckDisconnect();
NS_count = 0;
time = 0;
}
/******************* Receive Question *********************/
public override void doRecvQuestion()
{
NS_count++;
}
/******************** 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()]);
if (NS_count == 3) {ts.Answer(ans_index);ts.SendEnd();ts.SendEnd();}
ts.Answer(ans_index);
}
public override void UnGhostFinished()
{
ts.Warp(1);
}
/******************** NPC Dialog Menu **********************/
public override void NpcDialogMenu(ushort DialogId)
{
debug("Dialog Menu ID = "+DialogId.ToString());
if (DialogId == 4) {ts.SelectChoice(1);ts.SendEnd();}
}
/********************* NPC Dialog ID ***********************/
public override void NpcDialog(ushort DialogId)
{
//debug("Dialog ID = "+DialogId.ToString());
ts.SendEnd();
}
/************************ On Timer *************************/
public override void OnTimer()
{
time++;if (time == 60) {ts.Disconnect();}
ts.RequestParty(idchupt);
}
/************************* Start ***************************/
public override void Start()
{
debug("Request Party ..........");
ts.RequestParty(idchupt);
}
/************************** Stop ***************************/
public override void Stop()
{
for(byte i=0;i<25;i++){
Slot oSlot = (Slot)ts.MyItems[i];
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if(oSlot.itemid == 0){ continue; }
debug(oItem.itemname + " at slot " + oSlot.slot.ToString() + " with ID " + oSlot.itemid.ToString(),0);
}
}
/*********************** View State ************************/
void ViewState()
{
debug("************************************************** **********************",255) ;
debug(" Số trận đánh : " + battle_count ,255) ;
debug(" HP của "+ts.Character.CharName+" = " + ts.Character.HP +" "+ "/" +" "+ ts.Character.MAXHP,255);
debug(" HP của "+ts.CurrentPartner.CharName +" = " + ts.CurrentPartner.HP + " "+"/" +" "+ ts.CurrentPartner.MAXHP +" "+" FAI = " + ts.CurrentPartner.fai,255);
debug(" Số lần gặp BTQ : "+ NS_count +" Số con ma : " + ts.Character.ghost ,255) ;
debug("======= Script by Jet007 - Copy Right GameVN–™ =======",255) ;
}
/********************** Warp Finished **********************/
public override void warpFinish()
{
if (ts.Character.ghost >= 1 && ts.Character.mapid == 12011) {ts.Walk(462,515);ts.ClickOnNPC(9);}
if (ts.Character.ghost >= 1 && ts.Character.mapid == 12000) {ts.Warp(6);}
if (ts.Character.ghost == 0 && ts.Character.mapid == 12000) {ts.SetTimerOnOff(true);}
}
/********************** Disconnected ***********************/
public override void Disconnected()
{
ts.SetTimerOnOff(false);
}
/************************ Init Bot *************************/
public override void InitBot()
{
if (ts.Character.mapid==11000 && ts.Character.ghost == 0) {ts.Warp(1);ts.SetTimerOnOff(true);}
if (ts.Character.mapid==11000 && ts.Character.ghost >= 1) {ts.Warp(1);}
ts.SetReconnectTime(3);
ts.SetMaxIdleTime(15);
ts.RequestParty(idchupt);
ViewState();
debug("Login Okie");
if (ts.Character.ghost >= 1 && ts.Character.mapid == 12000) {ts.Warp(6);}
if (ts.Character.ghost == 0 && ts.Character.x == 462 && ts.Character.y ==515 && ts.Character.mapid == 12011) {ts.Warp(1);ts.SetTimerOnOff(true);}
if (ts.Character.ghost == 0 && ts.Character.mapid == 12000) {ts.SetTimerOnOff(true);}
AddDropItemList("viênongmật");
AddDropItemList("tựđ uốngthuốc");
AddDropItemList("viên công kích");
AddDropItemList("Thịt Dê khô");
AddDropItemList("Táo đỏ");
AddDropItemList("Bánh Lạc");
AddDropItemList("Nấm Rơm");
AddDropItemList("Rượu Bạch Cang");
AddDropItemList("ThuốcThôngPhổi");
AddDropItemList("Bánh Lạc Hành");
}
thanks net very much
