mọi người cho em hỏi cái scrip legn@ kiếm tiền này bị lỗi phần nào vậy .... khi em chạy nó thì con ga` của em drop hết hp sp mà không chịu bán .... mong dc sự giúp đở của mọi người .
uint mapid = 12004;
ushort Warpid = 4;
ushort X = 122;
ushort Y = 755;
void Money()
{
if (ts.Character.mapid == 12001 && money == 2){ts.SendEnd();ts.Warp(Warpid);}
}
/************************** Phần không cần sửa chữa ***************************/
double Time = 0;
byte turn = 0;
byte money = 0;
string state="";
public override void MyAttack()
{
turn++;
if ( turn >= 1 ){
CharacterInfo MyChar = ts.Character;
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 17001);}
}
public override void BattleStarted()
{
}
public override void BattleStoped()
{
}
public override void doRecvQuestion()
{
state="BTQ";
}
public override void ResponseAnswer()
{
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);
}
void DropMoney()
{
//ts.DropItem(2,1);
ts.Chat(1,"drop");
//ts.delay(200);
}
public override void Start()
{
ts.CreateCharName(tenga);
ts.CreateChar(1,17, 1, 0, 0, 0, 0, 0, 6, pass,amma);
}
public override void CreateCharacter()
{
debug("Xóa gà thành công",0x000ABC);
debug("Đang tạo gà, đợi chút...",0x00ADEF);
ts.CreateCharName(tenga);
ts.CreateChar(1,17, 1, 0, 0, 0, 0, 0, 6, pass,amma);
}
public override void Stop()
{
ts.DeleteChar(pass,amma);
}
public override void NpcDialogMenu(ushort DialogId)
{
debug("dialog menu ID="+DialogId.ToString());
if ( DialogId == 4){ts.SelectChoice(2); ts.SendEnd();ts.delay(200);ts.Sell(3,50);ts.Sell(4,50);Money();}
if ( DialogId == 3){ts.SelectChoice(1);ts.SendEnd();}
}
public override void NpcDialog(ushort DialogId)
{
debug("Dialog Id: "+DialogId,0x0000FF);
if(DialogId == 10476) { ts.SendEnd();ts.SendEnd();ts.Warp(2);ts.SelectChoice(1);ts.SendEnd();}
if(DialogId == 10456) { ts.SendEnd();ts.SendEnd();ts.Warp(2);ts.SelectChoice(1);ts.SendEnd();}
else
{ts.SendEnd();}
}
public override void warpFinish()
{
xuongnui();
DiBanDo();
if (ts.Character.mapid == mapid){ts.Walk(X,Y);DropMoney();Stop();}
}
public override void OnTimer()
{
Time++;
if (Time == 15 ) {Stop();}
}
public override void PartyStop(uint playerid)
{
}
public override void FinishAnswer()
{
Stop();
}
public override void InitBot()
{
ts.SetTimerOnOff(true);
ts.SetReconnectTime(1);
ts.SetMaxIdleTime(20);
if (ts.Character.ghost >=1) {Stop();}
if (ts.Character.mapid > 10871 && ts.Character.mapid != 12805) {Stop();}
xuongnui();
}