vanchip
Mr & Ms Pac-Man
- 8/9/05
- 256
- 0
Mã:
Của con leader
var state = "stand"
var ghost_count = 0;
var die_count = 0;
var battle_count = 0;
var pt_count = 1;
//********** MAKE PARTY **********//
//*****Tao bang gom cac ID cua nhom*****//
var myParty = new Array(523908,907025,661293,0,0); // Các ID trong nhóm Party
pt_leader = 661293; // ID chu Party
pt_sena = 907025; // ID quân su
//*****Hàm chap nhan party cua cac thanh vien*****//
function WaitAcceptParty(playerid){
for (var i=0; i<myParty.length;i++){
if(playerid == myParty[i]){
ts.AcceptParty(playerid);
}
}
}
//*****Hàm set ID pt_sena lam quân su*****//
function AcceptedParty(playerid){
if (playerid == pt_sena){
ts.sena(playerid) // Set quân su
debug("SET QUAN SU",0xFF0000)
}
if(pt_count == 4){
Start() // du nguoi --> danh
}
pt_count++;
}
//*****Hàm DIS khi 1 thanh vien DIS*****
function PartyStop(playerid){
for (var i=0; i<myParty.length;i++) {
if (playerid == myParty[i]){
ts.Disconect();
}
}
}
//********** ATTACK **********//
//*****Hàm attack cua nguoi choi*****//
function MyAttack(){
m = SelectF1Target()
sk = 12003;
ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, m.Row
, m.Col
, sk
)
}
function MyPartnerAttack(){
m = SelectF1Target()
sk = 12003;
ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, m.Row
, m.Col
, sk
)
}
//********** EAT, DROP ITEM **********//
//*****Hàm tu dong vut cai Item không can*****//
function DoDropItem() {
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if(oSlot.itemid == 0){
continue;
}
var oItem = ITEMS.Item(oSlot.itemid);
var itemname = oItem.getName();
if( itemname == "AutoAttackPill" ||
itemname == "AutoTonicPill" ||
itemname == "DaQuWine" ||
itemname == "Cleardewwine" ||
itemname == "PainKiller" ||
itemname == "Red date" ||
itemname == "Morale pill" ||
itemname == "Honey pill" ||
itemname == "HerbalPill" ||
itemname == "Small apple" ||
itemname == "Strawberry") ts.DropItem(oSlot.slot,oSlot.num);
}
}
//**********TRA LOI BTQ**********//
function onEvilGod(){
ghost_count++
debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF)
msg = "Wrong.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("Wrong.js",msg)
WarpLink( 12063 ,2 , 12301 ,1)
}
function onLuckyGod(){
debug("LUCKY G O D.",0xFF0000)
if(!QA.Exists(ts.LastQuestion)){
QA.Add(ts.LastQuestion,ts.LastResponseAnswer)
msg = "QA.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("QA.js",msg)
}
WarpLink( 12063 ,2 , 12301 ,1)
}
//*****Hàm tra loi BTQ xong thì dánh tiep*****//
function FinishAnswerFuckGod(){
if(ghost_count>=3){
ts.Disconect();
}
if(state=="warp"){
ts.delay(3000)
WarpLink( 12063 ,2 , 12301 ,1)
}
}
//************** HOANG CUNG DIEP THANH **************//
// Kiem tra xem nhân vat dang dung o dâu ? Trong hay Ngoai HC //
// (1). Trong: di ra ngoài. //
// (2). Ngoài: di toi, nói chuyên roi dánh. //
// (3). Quay lai buoc (1). //
//************************************************** ****//
//state: gom 2 trang thái: stand & warp
function warpFinish(){
if(state=="warp"){
if(ts.Character.mapid == 12301){ // Trong Hoàng Cung
WarpLink(12063 ,2 , 12301 ,1)
}
else if(ts.Character.mapid==12063){ // Ngoài Hoàng Cung
ts.delay(2000)
ts.Walk(562,315)
WarpLink(12063 ,2 , 12301 ,1)
}
}
}
//********** MAIN **********//
//****Hàm hiên trang thái sau tran dánh*****//
function ViewState(){
debug("************************************",0xFF0000)
debug(" Battle Count : " + battle_count ,0xFF0000)
debug(" Dead Count : " + die_count ,0xFF0000)
debug(" Ghost Count : " + ts.Character.Ghost ,0xFF0000)
debug(" Warrior's FAI : " + ts.CurrentPartner.CharName +" : " + ts.CurrentPartner.fai,0xFF0000)
debug("************************************",0xFF0000)
}
//*****Hàm tra loi NPC*****//
function NpcDialogMenu(DialogId){
ts.SelectChoice(1);
ts.SendEnd();
}
function NpcDialog(DialogId){
ts.SendEnd();
}
//*****Hàm Dis khi HP cua PET het*****//
function SaveWarrior(){
if(ts.CurrentPartner.HP == 1){
ts.Disconect();
debug(" SAVE THE FAI DISCONNECT NOW! : ",0x0000FF);
}
}
//*****Hàm neu chet 3 lan thì Dis*****//
function CheckDisconnect(){
if(ts.Character.HP == 1){
die_count++
}
if(die_count>3){
ts.Disconect();
}
}
//*****Hàm BOT*****//
function InitBot(){
state= "stand"
debug("***** BOT HCDT *****", 0x00FF00)
Timer.Enabled=true;
}
//*****Hàm bat dau tran dánh*****//
function BattleStarted(){
battle_count++;
}
//****Hàm khi tran dánh ket thúc*****//
function BattleStoped(){
SaveWarrior();
DoDropItem();
ViewState();
}
//*****Hàm OnTime*****//
function OnTimer(){
if(ts.Character.mapid == 12301){ // Trong Hoàng Cung
WarpLink(12063 ,2 , 12301 ,1)
}
if(ts.Character.mapid == 12062){ // Out of map
WarpLink(12062 ,2 , 12301 ,1)
}
}
//*****Hàm Start****//
function Start(){
state="warp"
WarpLink(12063, 2, 12301, 1)
}
//*****Hàm Stop*****//
function Stop(){
state="stand"
}
InitBot()
Mã:
Của con member
var state = "stand"
var ghost_count = 0;
var die_count = 0;
var battle_count = 0;
var pt_count = 1;
function PlayerOnline(playerid){
if(getPlayerName(playerid) == "PHoaLieuNguyen" // nick ch? party
){
ts.RequestParty(playerid)
}
}
//********** MAKE PARTY **********//
//*****Tao bang gom cac ID cua nhom*****//
var myParty = new Array(523908,907025,661293,759781,795720); // Các ID trong nhóm Party
//*****Hàm DIS khi 1 thanh vien DIS*****
function PartyStop(playerid){
for (var i=0; i<myParty.length;i++) {
if (playerid == myParty[i]){
ts.Disconect();
}
}
}
//********** ATTACK **********//
//*****Hàm attack cua nguoi choi*****//
function MyAttack(){
m = SelectF1Target()
sk = 12003;
ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, m.Row
, m.Col
, sk
)
}
function MyPartnerAttack(){
m = SelectF1Target()
sk = 12003;
ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, m.Row
, m.Col
, sk
)
}
//********** EAT, DROP ITEM **********//
//*****Hàm tu dong vut cai Item không can*****//
function DoDropItem() {
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if(oSlot.itemid == 0){
continue;
}
var oItem = ITEMS.Item(oSlot.itemid);
var itemname = oItem.getName();
if( itemname == "AutoAttackPill" ||
itemname == "AutoTonicPill" ||
itemname == "DaQuWine" ||
itemname == "Cleardewwine" ||
itemname == "PainKiller" ||
itemname == "Red date" ||
itemname == "Morale pill" ||
itemname == "Honey pill" ||
itemname == "HerbalPill" ||
itemname == "Small apple" ||
itemname == "Strawberry") ts.DropItem(oSlot.slot,oSlot.num);
}
}
//**********TRA LOI BTQ**********//
function onEvilGod(){
ghost_count++
debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF)
msg = "Wrong.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("Wrong.js",msg)
WarpLink( 12063 ,2 , 12301 ,1)
}
function onLuckyGod(){
debug("LUCKY G O D.",0xFF0000)
if(!QA.Exists(ts.LastQuestion)){
QA.Add(ts.LastQuestion,ts.LastResponseAnswer)
msg = "QA.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("QA.js",msg)
}
WarpLink( 12063 ,2 , 12301 ,1)
}
//*****Hàm tra loi BTQ xong thì dánh tiep*****//
function FinishAnswerFuckGod(){
if(ghost_count>=3){
ts.Disconect();
}
if(state=="warp"){
ts.delay(3000)
WarpLink( 12063 ,2 , 12301 ,1)
}
}
//********** MAIN **********//
//****Hàm hiên trang thái sau tran dánh*****//
function ViewState(){
debug("************************************",0xFF0000)
debug(" Battle Count : " + battle_count ,0xFF0000)
debug(" Dead Count : " + die_count ,0xFF0000)
debug(" Ghost Count : " + ts.Character.Ghost ,0xFF0000)
debug(" Warrior's FAI : " + ts.CurrentPartner.CharName +" : " + ts.CurrentPartner.fai,0xFF0000)
debug("************************************",0xFF0000)
}
//*****Hàm Dis khi HP cua PET het*****//
function SaveWarrior(){
if(ts.CurrentPartner.HP == 1){
ts.Disconect();
debug(" Thoat ra neu ko tuong bo di! : ",0x0000FF);
}
}
//*****Hàm neu chet 3 lan thì Dis*****//
function CheckDisconnect(){
if(ts.Character.HP == 1){
die_count++
}
if(die_count>3){
ts.Disconect();
}
}
//*****Hàm BOT*****//
function InitBot(){
state= "stand"
debug("***** BOT HCDT *****", 0x00FF00)
Timer.Enabled=true;
}
//*****Hàm bat dau tran dánh*****//
function BattleStarted(){
battle_count++;
}
//****Hàm khi tran dánh ket thúc*****//
function BattleStoped(){
SaveWarrior();
DoDropItem();
ViewState();
}
//*****Hàm OnTime*****//
function OnTimer(){
if(ts.Character.mapid == 12301){ // Trong Hoàng Cung
WarpLink(12063 ,2 , 12301 ,1)
}
if(ts.Character.mapid == 12062){ // Out of map
WarpLink(12062 ,2 , 12301 ,1)
}
}
//*****Hàm Start****//
function Start(){
state="warp"
WarpLink(12063, 2, 12301, 1)
}
//*****Hàm Stop*****//
function Stop(){
state="stand"
}
InitBot()
.nhiều lúc nó cầm con gà vào dánh luôn ::(.sửa giúp giùm với MC 