Thử cái này xem
Script chủ pt
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
double mapid1 = 12421;
double mapid2 = 12815;
byte warpid1 = 2;
byte warpid2 = 1;
string state="";
byte pt_count = 0;
byte turna = 0;
byte turnb = 0;
uint tv1 = 0; //là QS luôn
uint tv2 = 0;
uint tv3 = 0;
uint tv4 = 0;
uint maxpt = 0; //so thanh vien
public override void MyAttack()
{
turna++;
if (turna == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 10000);
}
if (turna >=2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 0, 10000);
}
}
public override void MyPartnerAttack()
{
turnb++;
if (turnb == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
if (turnb >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 4, 10000);
}
}
/********************* Battle Started **********************/
public override void BattleStarted()
{
turnb=0;
turna=0;
}
public override void PreBattleStopped()
{
ts.delay(2000);
}
/********************* Battle Stoped ***********************/
public override void BattleStopped()
{
AutoEatFood();
ProcessInventoryAction();
CheckDisconnect();
ViewState();
}
public override void doRecvQuestion()
{
state="BTQ";
}
public override void ResponseAnswer()
{
int dtime=get_random(1,5);
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);
}
}
public override void PartyStop(uint playerid)
{
if (playerid == tv1 || playerid == tv2 || playerid == tv3 || playerid == tv4) {ts.Disconnect();}
}
/******************** 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());
}
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){
debug(" So thanh vien la : " + pt_count ,0x0000FF);
Start();}
else{
debug(" So thanh vien la : " + pt_count ,0x0000FF);
}
}
/********************** Warp Finish ************************/
public override void warpFinish()
{
Start();
}
/************************* Start ***************************/
public override void Start()
{
if (pt_count == maxpt)
{
if (ts.Character.mapid == mapid1) {
ts.Walk(622,475);
ts.Warp(warpid1);
} else
if (ts.Character.mapid == mapid2) {
ts.Warp(warpid2);
return;
}
}
}
/********************* Fishish Answer **********************/
public override void FinishAnswer()
{
Start();
}
void ViewState()
{
debug(" Số con ma : " + ts.Character.ghost ,0xFF0000) ;
}
/************************ Init Bot *************************/
public override void InitBot()
{
ts.SetTimerOnOff(true);
ts.SetReconnectTime(3);
ts.SetMaxIdleTime(20);
if (ts.Character.mapid == mapid2) {ts.Warp(warpid2);}
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");
ViewState();
}
Đây là script mem
double DisconnectFlag = 0.3; // Disconnect when current HP is below 30%
double hpFractionEat = 0.8; //Eat HP when current HP<= 80%
double spFractionEat = 0.3;
double hpFraction = 0.95; //Eat until current HP >= 95 %
double spFraction = 0.95;
byte DisconFai = 00; // Faith of warrior to disconnect
byte battle_count = 0;
byte NS_count = 0;
string state="";
byte turna = 0;
byte turnb = 0;
/***** Chinh sua ID chu Party o day *****/
uint idchupt = 0;
public override void MyAttack()
{
turna++;
if (turna == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 12003);
}
if (turna >=2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 1, 17001);
}
}
public override void MyPartnerAttack()
{
turnb++;
if (turnb == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 12003);
}
if (turnb >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 1, 17001);
}
}
/********************* Battle Started **********************/
public override void BattleStarted()
{
battle_count++;
turna = 0;
turnb = 0;
}
/********************* Battle Stoped ***********************/
public override void BattleStopped()
{
AutoEatFood();
ProcessInventoryAction();
CheckDisconnect();
ViewState();
}
public override void doRecvQuestion()
{
state="BTQ";
}
public override void ResponseAnswer()
{
int dtime=get_random(1,5);
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);
}
}
/************************ On Timer *************************/
public override void OnTimer()
{
}
/************************* Start ***************************/
public override void Start()
{
debug("Request Party ..........");
ts.RequestParty(idchupt);
}
/************************** Stop ***************************/
public override void Stop()
{
}
/*********************** 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) ;
}
/********************* Accepted Party **********************/
public override void AcceptedParty(uint playerid)
{
if (playerid == idchupt) {debug("Join to " + playerid);}
}
/************************ Party Stop ***********************/
public override void PartyStop(uint playerid)
{
if (playerid == idchupt) {debug(idchupt+ " Giải tán đội ngũ ...");}
}
/************************ Init Bot *************************/
public override void InitBot()
{
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");
ViewState();
debug("Login Okie");
}