⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mbm_include.d2l

📁 转载其他网站的资料与大家分享
💻 D2L
📖 第 1 页 / 共 2 页
字号:
// Version 0.95

//骀骀骀骀骀骀骀骀骀骀骀骀骀骀
//System Variables
//骀骀骀骀骀骀骀骀骀骀骀骀骀骀

// ---- Added by Brand.X ----

//骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀?//Immunities/Resistances/Enchantments to skip
//骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀骀?
// Moved here because in patch 1.09, Mephisto never has immunities/resistances/enchantments
//Set each to true to chicken out if Mephisto is immune to that kind of damage

var immunities=new Array(7);
immunities[1]=false;			// Physical
immunities[2]=false;			// Magic
immunities[3]=false;			// Fire
immunities[4]=false;			// Lightning
immunities[5]=false;			// Cold
immunities[6]=false;			// Poison

// Immunities Combinations
// Method:  if set to true, will chicken with that immunities# / immunities# combination
// immunecombos[next number] = new Array(immunities#,immunities#,true/false);

var immunecombos=new Array();
immunecombos[1]=new Array(1,2,false);	// Immune to Physical and Immune to Magic
immunecombos[2]=new Array(4,5,true);	// Immune to Lightning and Immune to Cold

//Set each to true to chicken out if Mephisto has that enchantment

var enchantments = new Array(13);
enchantments[1]=false;		//Extra Strong
enchantments[2]=false;		//Extra Fast
enchantments[3]=false;		//Cursed
enchantments[4]=false;		//Magic Resistant
enchantments[5]=false;		//Fire Enchanted
enchantments[6]=false;		//Lightning Enchanted
enchantments[7]=false;		//Cold Enchanted
enchantments[8]=false;		//Mana Burn
enchantments[9]=false;		//Teleportation
enchantments[10]=false;		//Spectral Hit
enchantments[11]=false;		//Stone Skin
enchantments[12]=false;		//Multiple Shot

// Enchantment Combinations
// Method:  if set to true, will chicken with that enchantment# / enchantment# combination
// enchantcombos[next number] = new Array(enchantment#,enchantment#,true/false);

var enchantcombos=new Array();
enchantcombos[1]=new Array(6,12,true);	// Multiple Shot Lightning
enchantcombos[2]=new Array(2,8,false);	// Extra Fast Mana Burn

// Set each to true to chicken out if Mephisto has that aura

var auras = new Array(8);
auras[1]=false;			//Conviction
auras[2]=false;			//Might
auras[3]=false;			//Holy Fire
auras[4]=false;			//Blessed Aim
auras[5]=false;			//Holy Freeze
auras[6]=false;			//Holy Shock
auras[7]=true;			//Fanaticism

// Enchantment / Aura Combinations
// Method:  if set to true, will chicken with that enchantment# / aura# combination
// enchantauracombos[next number] = new Array(enchantment#,aura#,true/false);

var enchantauracombos=new Array();
enchantauracombos[1]=new Array(2,2,true);	// Extra Fast Might
enchantauracombos[2]=new Array(2,5,false);	// Extra Fast Holy Freeze
enchantauracombos[3]=new Array(2,7,true);	// Extra Fast Fanaticism


// Don't Touch Variables
//===================================

var FullINV=false;
var InvSpace=0;
var DropEM=1;
var dlevel = 0;

var ActDelay=0;

// NPC and monster names
//=======================================

const PINDLESKIN="Pindleskin";
const PINDLE_MINION="Defiled Warrior";
const MALAH="Malah";
const QUAL_KEHK="Qual-Kehk";
const ANYA="Anya";
const LARZUK="Larzuk";
const SHENK="Shenk the Overseer";
const SHENK_MINION="Enslaved";
const ELDRITCH="Eldritch the Rectifier";
const ELDRITCH_MINION="Enslaved";
const AKARA="Akara";
const KASHYA="Kashya";
const CHARSI="Charsi";

var InvHeight=4;			// Inventory height
var InvWidth=10;			// Inventory width
var NextUnidItem=null;			// Next item to identify
var IdedItems=new Array();		// Identified item ids list
var needpotions=false;			// True if we need to buy healing potions
var needtps=false;			// True if we need TPs/a TP tome
var needtptome=false;			// True if we need a TP Tome
var Niceitem=false;			// True if we need to stash an identified item
var InteractDist=4;			// Distance for NPC interaction to start
var portaltries=5;			// Number of tries to try entering the red portal before giving up
var uniditemx, uniditemy;		// Location of next unided item (for ParseIT)
var maxtik=50; 				// Controls delays for things like repairing
var tik=30;				// Leave this alone if you're not having problems
var mephprintdelay=20;			// Debug print delay
var StashHeight=8 			// Stash Height
var StashWidth=6;			// Stash Width
var DuranceMapHeight=160;		// Height of durance three
var DuranceMapWidth=240;		// Width of the durance map
var DuranceMap=null;			// Map of durance three
var DuranceMinX=17500;			// Upper left hand corner
var DuranceMinY=8000;			// Upper left hand corner
var TeleportDist=35;			// Maximum range of the teleport spell
var BuyPotion="hp5";			// Potion type to buy. Automatically set.
var DodgeTest=false;			// True if testing dodges
var DontDrinkPots=new Array();		// Pots that we dont drink at the start (anything better than the buy potion)
var UberChest=false;			// True if we are opening the "uber" chest past Mephisto (classic only)
var needkeys=false;			// True if we need to buy keys
var needsell=false;			// True if we have some money items to sell
var GoldDisabled=false;			// True if gold pickup is disabled
var NormalSnagRadius=15;		// Normal snagit radius
var UberChestRadius=40;			// Snagit radius for the uber-chest
var UberChestPos={x:17530,y:8063};	// Uber chest position
var Uniditem=false;			// True if we need to ID an item
var SnagFile=("settings/"+charsnag);	// SnagIt INI
var MoneyCondition=null;		// Parsed condition for the money items
var StartGold = null;			// Starting gold amount
var DropCnt = 0;			// Items sold
var Stashed = true;			// True if we stashed an item
var PortalMinDist = 3;			// Minimum distance to a portal before we take it

const FrameTime=40;			// Time of one frame

var Monsters=new Array();
Monsters.push(COUNCILMEMBER);
Monsters.push(BLOODLORD);
Monsters.push(BREMMSPARKFIST);
Monsters.push(WYANDVOIDBRINGER);
Monsters.push(MAFFERDRAGONHAND);
Monsters.push(FOULWOLF);
Monsters.push(EVILFORCE);

// Ignored
// RandomMove=true/false	This will make your movements random
// RandomMoveDel=true/false	This will make movement delays random
// RandomDel=true/false		This will randomize all delays to make the script harder to detect by blizz
var RandomMove=false;
var RandomMoveDel=false;
var RandomDel=true;

// ---- End Added by Brand.X ----

var right_hand = 0, left_hand = 1;
var rx = 0, tx = 1;

var idied=false;
var needheal=false;
var needstash=true;
var needrepair=false;
var needrevive=false;
var needammo=false;
var needmerc=false;
var mercname="Mercenary";

var mymaxlife=0;
var mymaxmana=0;
var mercmaxlife=0;
var lifethreshold=0;
var manathreshold=0;
var mychickenlife=0;
var mychickenmana=0;
var mymercchickenlife=0;
var mypotionlife=0;
var mypotionmana=0;
var myrejuvmana=0;
var mymercpotionlife=0;

var retries=10;
var target=null;
var merc=null;
var attackscompleted=0;

var immunecheck = new Array(7);
immunecheck[1]=new Array(36,"Immune to Physical");
immunecheck[2]=new Array(37,"Immune to Magic");
immunecheck[3]=new Array(39,"Immune to Fire");
immunecheck[4]=new Array(41,"Immune to Lightning");
immunecheck[5]=new Array(43,"Immune to Cold");
immunecheck[6]=new Array(45,"Immune to Poison");

var enchantmentcheck = new Array(13);
enchantmentcheck[1]=new Array(5,"Extra Strong");
enchantmentcheck[2]=new Array(6,"Extra Fast");
enchantmentcheck[3]=new Array(7,"Cursed");
enchantmentcheck[4]=new Array(8,"Magic Resistant");
enchantmentcheck[5]=new Array(9,"Fire Enchanted");
enchantmentcheck[6]=new Array(17,"Lightning Enchanted");
enchantmentcheck[7]=new Array(18,"Cold Enchanted");
enchantmentcheck[8]=new Array(25,"Mana Burn");
enchantmentcheck[9]=new Array(26,"Teleportation");
enchantmentcheck[10]=new Array(27,"Spectral Hit");
enchantmentcheck[11]=new Array(28,"Stone Skin");
enchantmentcheck[12]=new Array(29,"Multi-Shot");

var auracheck = new Array(8);
auracheck[1]=new Array(28,"Conviction Aura Enchanted");
auracheck[2]=new Array(33,"Might Aura Enchanted");
auracheck[3]=new Array(35,"Holy Fire Aura Enchanted");
auracheck[4]=new Array(40,"Blessed Aim Aura Enchanted");
auracheck[5]=new Array(43,"Holy Freeze Aura Enchanted");
auracheck[6]=new Array(46,"Holy Shock Aura Enchanted");
auracheck[7]=new Array(49,"Fanaticism Aura Enchanted");

var invspace=new Array(4);
invspace[0]=new Array(10);
invspace[1]=new Array(10);
invspace[2]=new Array(10);
invspace[3]=new Array(10);

//骀骀骀骀骀骀骀骀骀骀骀骀骀骀
//Event triggers
//骀骀骀骀骀骀骀骀骀骀骀骀骀骀

// From PwnageInclude.d2l
function DoDel(amount)
{
	if(RandomDel) delay(amount+rnd(0,amount));
	else delay(amount+rnd(0,10));
}

// For compatibility
function DoCast(a, b, c, d, e)
{
	return mbm_Cast(a, b, c, d, e);
}

function MoveTo(a, b, c, d, e)
{
	return walkto(a, b, c, d, e);
}

function corpsecollect()
{
	mycorpse = getUnit(0, me.name, 17);
	if (!mycorpse)
	{
		if (debuglevel > 1)
		{
			me.overhead("I'm alive!  Yay!");
			delay(250);
		}
		return;
	}
	if (mycorpse)
	{
		delay(1000);
		idied = true;
		me.overhead("Shit, I died again!");
		delay(250);
		print("Collecting corpse");
		delay(1000);
		for (c = 1; c <= retries; c++)
		{
			mycorpse = getUnit(0, me.name,17);
			if (mycorpse)
			{
				mycorpse.move();
				delay(1000);
				mycorpse.interact();
				delay(1000);
			}
			else
			{
				print("Body recovered");
				delay(500);
				mbm_plus_deaths();
				return;
			}
		}
		mycorpse = getUnit(0, me.name, 17);
		if (mycorpse) mbm_abortmessage("Cannot retrieve body!");

		print("Body recovered");
		delay(500);
	}
}

function mbm_checkheal()
{
	if ((me.hp < lifethreshold) || (me.mp < manathreshold))
	{
		print("Need to heal at " + healname);
		needheal = true;
	}
}

function verbose_checkrepair()
{
	mbm_checkrepair();
	if (needrepair)
		print("Need to repair");
	else {
		print("Don't need to repair, Lowest item is at " + lowestitem + "% durability");
	}	
}

function mbm_checkrepair()
{
	if (repairpercent >= 100)
		repairpercent = 99;
	
	var maxdur, curdur, curdur;
	
	needrepair = false;
	
	lowestitem = 100;
	check = getUnit(4);
	if (check) do
	{
		owner = check.getParent();
		if (owner && owner.name == me.name)
		{
			if (check.mode == c_UnitMode_Item_Equipped)
			{
				maxdur = check.getStat(c_UnitStat_MaxDurability);
				curdur = check.getStat(c_UnitStat_Durability);
				maxpct = check.getStat(c_UnitStat_ItemMaxDurabilityPercent);
				
				if(maxdur > 0)
				{
					if (maxpct > 0) {
						currentitem = parseInt(((curdur * maxpct) / maxdur) * 100);
					} else { 
						currentitem = parseInt((curdur / maxdur) * 100);
					}
					if (currentitem < lowestitem) lowestitem = currentitem;
					if (currentitem <= repairpercent)
					{
						needrepair=true
						return;
					}
				}
			}
		}
	}
	while (check.getNext(null,1));
}

function checkammo()
{
	print("Don't need ammo (placeholder)");
	needammo = false;
	if (debuglevel > 1) delay(250);
}

function verbose_checkmerc()
{
	switch (mbm_checkmerc()) {
		case 0:
			print("Mercenary's name is " + mercname);
			break;
		case 1:
			print("Need to revive merc.");
			break;
		case 2:
			print("Not enough gold to revive Mercenary!!!");
			break;
		default:
			break;
	}		
			
}

function mbm_checkmerc()
{
	if (UseMerc)
	{
		needrevive = true;
		merc = getUnit(1);
		if (merc) do
		{
			// print("npc name is " + merc.name);
			parent = merc.getParent();
			if (parent)
			{
				if (parent.name == me.name)
				{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -