#include "stdafx.h"
#include "Jass.h"
#include "MyArray.h"
#include "MyString.h"
#include "war3map.h"
#include "Additional_functions.h"
#include "JassApi_functions_extern.h"

typedef void(fFuncThread)(void);

rect bj_mapInitialPlayableArea = NULL;
const integer bj_MAX_PLAYER_SLOTS = 16;
const integer bj_PLAYER_NEUTRAL_VICTIM = 13;
const alliancetype ALLIANCE_SHARED_ADVANCED_CONTROL = (HALLIANCETYPE)7;
const real bj_PI = 3.14159;
static const int CONST_MAX_SIZE_MASS = 8190;
static sGlobal *pGlobal;
HHASHTABLE vHT_Ex;
TEventRegistrationHandle vEndMapHandle;
HPLAYER vLocalPlayer;

integer fMyStringHash(String vStr)
{
	int vLen = strlen(vStr);
	const int p = 31;
	const int n = 2;
	integer hash = 0, p_pow = 1;
	for (size_t i=0; i<vLen; ++i)
	{
		hash += ((vStr[i] >= 'a' && vStr[i] <= 'z' ? (vStr[i] - 'a') : (vStr[i] >= 'A' && vStr[i] <= 'Z' ? (vStr[i] - 'A') + p : p * n + 1)) + 1) * p_pow;
		p_pow *= p * n + 1 + 1;
	}
	return hash;
}

sMyString fMyGetUnitName(unit u)
{
	return sMyString(GetUnitName(u));
}

sMyString fMySubString(sMyString &source, Integer start, Integer end_)
{
	char *pStr;
	String vStr;
	vStr = new char[end_-start + 1];
	pStr = vStr;
	memcpy(pStr,((char*)source)+start,end_-start);
	pStr += end_-start;
	*pStr = '\0';
	static sMyString *vMyString;
	vMyString = new sMyString();
	vMyString->vTempData = fCpyStr(vStr);
	vMyString->vBoolTempData = true;
	vMyString->fTempData2();
	delete vStr;
	return *vMyString;
}

sMyString fMyI2S(integer vInt)
{
	return sMyString(I2S(vInt));
}

void fMain()
{
	fMapBegin();
	fFuncsInit();
	fMainJass();
}

procedure fMyExecuteFunc(String funcName)
{
	integer vAddress;
	vAddress = LoadInteger(vHT_Ex,0,fMyStringHash(funcName));
	if (vAddress == NULL) return;
	fFuncThread *pFunc = (fFuncThread *)vAddress;
	if (pFunc)
	{
		pFunc();
	}
}

void fMapBegin()
{
	pGlobal = new sGlobal;
	vHT_Ex = InitHashtable();
	IncrementHandleReferences(vHT_Ex);
	vEndMapHandle = AddEventHandler(jeMainThreadDestroyed,(TJassEventCallback*)&fMapEnd,NULL);
	vLocalPlayer = 0;
	vLocalPlayer = GetLocalPlayer();
}

HPLAYER fMyGetLocalPlayer()
{
	return vLocalPlayer;
}

void fMapEnd()
{
	if (pGlobal > 0)
	{
		delete pGlobal;
		pGlobal = NULL;
	}
	if (vEndMapHandle)
	{
		RemoveEventHandler((TEventRegistrationHandle)vEndMapHandle);
		vEndMapHandle = NULL;
	}
}

integer s__Buffer__allocate()
{
	integer this_2=pGlobal->si__Buffer_F;
	if (this_2!=0)
	{
		pGlobal->si__Buffer_F=pGlobal->si__Buffer_V[this_2][0];
	}
	else 
	{
		pGlobal->si__Buffer_I=pGlobal->si__Buffer_I+1;
		this_2=pGlobal->si__Buffer_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->si__Buffer_V[this_2][0]=-1;
	return  this_2;
}

integer s__Memory__allocate()
{
	integer this_2=pGlobal->si__Memory_F;
	if (this_2!=0)
	{
		pGlobal->si__Memory_F=pGlobal->si__Memory_V[this_2][0];
	}
	else 
	{
		pGlobal->si__Memory_I=pGlobal->si__Memory_I+1;
		this_2=pGlobal->si__Memory_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->si__Memory_V[this_2][0]=-1;
	return  this_2;
}

integer s__TJassString__allocate()
{
	integer this_2=pGlobal->si__TJassString_F;
	if (this_2!=0)
	{
		pGlobal->si__TJassString_F=pGlobal->si__TJassString_V[this_2][0];
	}
	else 
	{
		pGlobal->si__TJassString_I=pGlobal->si__TJassString_I+1;
		this_2=pGlobal->si__TJassString_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->si__TJassString_V[this_2][0]=-1;
	return  this_2;
}

integer s__Chain__allocate()
{
	integer this_2=pGlobal->si__Chain_F;
	if (this_2!=0)
	{
		pGlobal->si__Chain_F=pGlobal->si__Chain_V[this_2][0];
	}
	else 
	{
		pGlobal->si__Chain_I=pGlobal->si__Chain_I+1;
		this_2=pGlobal->si__Chain_I;
	}
	if (this_2>818)
	{
		return  0;
	}
	pGlobal->s__Chain_offsets[this_2][0]=(this_2-1)*10;
	pGlobal->si__Chain_V[this_2][0]=-1;
	return  this_2;
}

integer s__TRefCnt__allocate()
{
	integer this_2=pGlobal->si__TRefCnt_F;
	if (this_2!=0)
	{
		pGlobal->si__TRefCnt_F=pGlobal->si__TRefCnt_V[this_2][0];
	}
	else 
	{
		pGlobal->si__TRefCnt_I=pGlobal->si__TRefCnt_I+1;
		this_2=pGlobal->si__TRefCnt_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->si__TRefCnt_type[this_2][0]=9;
	pGlobal->si__TRefCnt_V[this_2][0]=-1;
	return  this_2;
}

integer s__TSLinkedList_Enumerator__allocate()
{
	integer this_2=pGlobal->si__TSLinkedList_Enumerator_F;
	if (this_2!=0)
	{
		pGlobal->si__TSLinkedList_Enumerator_F=pGlobal->si__TSLinkedList_Enumerator_V[this_2][0];
	}
	else 
	{
		pGlobal->si__TSLinkedList_Enumerator_I=pGlobal->si__TSLinkedList_Enumerator_I+1;
		this_2=pGlobal->si__TSLinkedList_Enumerator_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]=0;
	pGlobal->si__TSLinkedList_Enumerator_V[this_2][0]=-1;
	return  this_2;
}

void s__TSLinkedList_Enumerator_deallocate( integer this_2)
{
	if (this_2==NULL)
	{
		return ;
	}
	else if(pGlobal->si__TSLinkedList_Enumerator_V[this_2][0]!=-1)
	{
		return ;
	}
	pGlobal->si__TSLinkedList_Enumerator_V[this_2][0]=pGlobal->si__TSLinkedList_Enumerator_F;
	pGlobal->si__TSLinkedList_Enumerator_F=this_2;
}

integer s__TSArray__allocate()
{
	integer this_2=pGlobal->si__TSArray_F;
	if (this_2!=0)
	{
		pGlobal->si__TSArray_F=pGlobal->si__TSArray_V[this_2][0];
	}
	else 
	{
		pGlobal->si__TSArray_I=pGlobal->si__TSArray_I+1;
		this_2=pGlobal->si__TSArray_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->si__TSArray_type[this_2][0]=7;
	pGlobal->si__TSArray_V[this_2][0]=-1;
	return  this_2;
}

integer s__TSLinkedList__allocate()
{
	integer this_2=pGlobal->si__TSLinkedList_F;
	if (this_2!=0)
	{
		pGlobal->si__TSLinkedList_F=pGlobal->si__TSLinkedList_V[this_2][0];
	}
	else 
	{
		pGlobal->si__TSLinkedList_I=pGlobal->si__TSLinkedList_I+1;
		this_2=pGlobal->si__TSLinkedList_I;
	}
	if (this_2>8190)
	{
		return  0;
	}
	pGlobal->si__TSLinkedList_V[this_2][0]=-1;
	return  this_2;
}

void s__TSLinkedList_deallocate( integer this_2)
{
	if (this_2==NULL)
	{
		return ;
	}
	else if(pGlobal->si__TSLinkedList_V[this_2][0]!=-1)
	{
		return ;
	}
	pGlobal->si__TSLinkedList_V[this_2][0]=pGlobal->si__TSLinkedList_F;
	pGlobal->si__TSLinkedList_F=this_2;
}

integer s__TJassStrings__allocate()
{
	integer this_2=s__TSArray__allocate();
	integer kthis;
	if (this_2==0)
	{
		return  0;
	}
	pGlobal->si__TSArray_type[this_2][0]=13;
	kthis=this_2;
	return  this_2;
}

integer s__TSArrayOfInt__allocate()
{
	integer this_2=s__TSArray__allocate();
	integer kthis;
	if (this_2==0)
	{
		return  0;
	}
	pGlobal->si__TSArray_type[this_2][0]=8;
	kthis=this_2;
	return  this_2;
}

integer s__TStringRep__allocate()
{
	integer this_2=s__TRefCnt__allocate();
	integer kthis;
	if (this_2==0)
	{
		return  0;
	}
	pGlobal->si__TRefCnt_type[this_2][0]=10;
	kthis=this_2;
	return  this_2;
}

integer s__TRCString__allocate()
{
	integer this_2=s__TRefCnt__allocate();
	integer kthis;
	if (this_2==0)
	{
		return  0;
	}
	pGlobal->si__TRefCnt_type[this_2][0]=11;
	kthis=this_2;
	return  this_2;
}

void typecast___setCode( code c)
{
	pGlobal->l__Typecast_Code=c;
	return ;
}

void typecast___setInt( integer i)
{
	pGlobal->l__Typecast_Int=i;
	return ;
}

void typecast___setStr( sMyString s)
{
	pGlobal->l__Typecast_Str=s;
	return ;
}

void typecast___Typecast1()
{
	integer l__Typecast_Code;
	code l__Typecast_Int;
}

integer C2I( code c)
{
	typecast___setCode(c);
	return  pGlobal->l__Typecast_Code;
}

code I2C( integer i)
{
	typecast___setInt(i);
	return  pGlobal->l__Typecast_Int;
}

void typecast___Typecast2()
{
	integer l__Typecast_Str;
	sMyString l__Typecast_Int;
}

integer SH2I( sMyString s)
{
	typecast___setStr(s);
	return  pGlobal->l__Typecast_Str;
}

void typecast___Typecast3()
{
	integer l__Typecast_Bool;
	boolean l__Typecast_Int;
}

integer shl( integer value, integer offset)
{
	integer cjlocgn_00000000=0;
	while(true)
	{
		if ( !(cjlocgn_00000000<offset)) break;
		value=value*(2);
		cjlocgn_00000000=cjlocgn_00000000+1;
	}
	return  value;
}

integer shr( integer value, integer offset)
{
	integer cjlocgn_00000000=0;
	while(true)
	{
		if ( !(cjlocgn_00000000<offset)) break;
		value=value/(2);
		cjlocgn_00000000=cjlocgn_00000000+1;
	}
	return  value;
}

real GetGameTime()
{
	return  TimerGetElapsed(pGlobal->utils__GameTimer);
}

void utils__init_hex()
{
	pGlobal->utils__hex[0x0][0]=sMyString(0x30);
	pGlobal->utils__hex[0x1][0]=sMyString(0x31);
	pGlobal->utils__hex[0x2][0]=sMyString(0x32);
	pGlobal->utils__hex[0x3][0]=sMyString(0x33);
	pGlobal->utils__hex[0x4][0]=sMyString(0x34);
	pGlobal->utils__hex[0x5][0]=sMyString(0x35);
	pGlobal->utils__hex[0x6][0]=sMyString(0x36);
	pGlobal->utils__hex[0x7][0]=sMyString(0x37);
	pGlobal->utils__hex[0x8][0]=sMyString(0x38);
	pGlobal->utils__hex[0x9][0]=sMyString(0x39);
	pGlobal->utils__hex[0xA][0]=sMyString(0x41);
	pGlobal->utils__hex[0xB][0]=sMyString(0x42);
	pGlobal->utils__hex[0xC][0]=sMyString(0x43);
	pGlobal->utils__hex[0xD][0]=sMyString(0x44);
	pGlobal->utils__hex[0xE][0]=sMyString(0x45);
	pGlobal->utils__hex[0xF][0]=sMyString(0x46);
}

void utils__InitChars()
{
	pGlobal->utils__Chars[0x01][0]=sMyString(0x01);
	pGlobal->utils__Chars[0x02][0]=sMyString(0x02);
	pGlobal->utils__Chars[0x03][0]=sMyString(0x03);
	pGlobal->utils__Chars[0x04][0]=sMyString(0x04);
	pGlobal->utils__Chars[0x05][0]=sMyString(0x05);
	pGlobal->utils__Chars[0x06][0]=sMyString(0x06);
	pGlobal->utils__Chars[0x07][0]=sMyString(0x07);
	pGlobal->utils__Chars[0x08][0]=sMyString(0x08);
	pGlobal->utils__Chars[0x09][0]=sMyString(0x09);
	pGlobal->utils__Chars[0x0A][0]=sMyString(0x0A);
	pGlobal->utils__Chars[0x0B][0]=sMyString(0x0B);
	pGlobal->utils__Chars[0x0C][0]=sMyString(0x0C);
	pGlobal->utils__Chars[0x0D][0]=sMyString(0x0D);
	pGlobal->utils__Chars[0x0E][0]=sMyString(0x0E);
	pGlobal->utils__Chars[0x0F][0]=sMyString(0x0F);
	pGlobal->utils__Chars[0x10][0]=sMyString(0x10);
	pGlobal->utils__Chars[0x11][0]=sMyString(0x11);
	pGlobal->utils__Chars[0x12][0]=sMyString(0x12);
	pGlobal->utils__Chars[0x13][0]=sMyString(0x13);
	pGlobal->utils__Chars[0x14][0]=sMyString(0x14);
	pGlobal->utils__Chars[0x16][0]=sMyString(0x16);
	pGlobal->utils__Chars[0x17][0]=sMyString(0x17);
	pGlobal->utils__Chars[0x19][0]=sMyString(0x19);
	pGlobal->utils__Chars[0x1A][0]=sMyString(0x1A);
	pGlobal->utils__Chars[0x1B][0]=sMyString(0x1B);
	pGlobal->utils__Chars[0x1C][0]=sMyString(0x1C);
	pGlobal->utils__Chars[0x1D][0]=sMyString(0x1D);
	pGlobal->utils__Chars[0x1E][0]=sMyString(0x1E);
	pGlobal->utils__Chars[0x1F][0]=sMyString(0x1F);
	pGlobal->utils__Chars[0x20][0]=sMyString(0x20);
	pGlobal->utils__Chars[0x21][0]=sMyString(0x21);
	pGlobal->utils__Chars[0x22][0]=sMyString(0x02);
	pGlobal->utils__Chars[0x23][0]=sMyString(0x23);
	pGlobal->utils__Chars[0x24][0]=sMyString(0x24);
	pGlobal->utils__Chars[0x25][0]=sMyString(0x25);
	pGlobal->utils__Chars[0x26][0]=sMyString(0x26);
	pGlobal->utils__Chars[0x27][0]=sMyString(0x27);
	pGlobal->utils__Chars[0x28][0]=sMyString(0x28);
	pGlobal->utils__Chars[0x29][0]=sMyString(0x29);
	pGlobal->utils__Chars[0x2A][0]=sMyString(0x2A);
	pGlobal->utils__Chars[0x2B][0]=sMyString(0x2B);
	pGlobal->utils__Chars[0x2C][0]=sMyString(0x2C);
	pGlobal->utils__Chars[0x2D][0]=sMyString(0x2D);
	pGlobal->utils__Chars[0x2E][0]=sMyString(0x2E);
	pGlobal->utils__Chars[0x2F][0]=sMyString(0x2F);
	pGlobal->utils__Chars[0x30][0]=sMyString(0x30);
	pGlobal->utils__Chars[0x31][0]=sMyString(0x31);
	pGlobal->utils__Chars[0x32][0]=sMyString(0x32);
	pGlobal->utils__Chars[0x33][0]=sMyString(0x33);
	pGlobal->utils__Chars[0x34][0]=sMyString(0x34);
	pGlobal->utils__Chars[0x35][0]=sMyString(0x35);
	pGlobal->utils__Chars[0x36][0]=sMyString(0x36);
	pGlobal->utils__Chars[0x37][0]=sMyString(0x37);
	pGlobal->utils__Chars[0x38][0]=sMyString(0x38);
	pGlobal->utils__Chars[0x39][0]=sMyString(0x39);
	pGlobal->utils__Chars[0x3A][0]=sMyString(0x3A);
	pGlobal->utils__Chars[0x3B][0]=sMyString(0x3B);
	pGlobal->utils__Chars[0x3C][0]=sMyString(0x3C);
	pGlobal->utils__Chars[0x3D][0]=sMyString(0x3D);
	pGlobal->utils__Chars[0x3E][0]=sMyString(0x3E);
	pGlobal->utils__Chars[0x3F][0]=sMyString(0x3F);
	pGlobal->utils__Chars[0x40][0]=sMyString(0x40);
	pGlobal->utils__Chars[0x41][0]=sMyString(0x41);
	pGlobal->utils__Chars[0x42][0]=sMyString(0x42);
	pGlobal->utils__Chars[0x43][0]=sMyString(0x43);
	pGlobal->utils__Chars[0x44][0]=sMyString(0x44);
	pGlobal->utils__Chars[0x45][0]=sMyString(0x45);
	pGlobal->utils__Chars[0x46][0]=sMyString(0x46);
	pGlobal->utils__Chars[0x47][0]=sMyString(0x47);
	pGlobal->utils__Chars[0x48][0]=sMyString(0x48);
	pGlobal->utils__Chars[0x49][0]=sMyString(0x49);
	pGlobal->utils__Chars[0x4A][0]=sMyString(0x4A);
	pGlobal->utils__Chars[0x4B][0]=sMyString(0x4B);
	pGlobal->utils__Chars[0x4C][0]=sMyString(0x4C);
	pGlobal->utils__Chars[0x4D][0]=sMyString(0x4D);
	pGlobal->utils__Chars[0x4E][0]=sMyString(0x4E);
	pGlobal->utils__Chars[0x4F][0]=sMyString(0x4F);
	pGlobal->utils__Chars[0x50][0]=sMyString(0x50);
	pGlobal->utils__Chars[0x51][0]=sMyString(0x51);
	pGlobal->utils__Chars[0x52][0]=sMyString(0x52);
	pGlobal->utils__Chars[0x53][0]=sMyString(0x53);
	pGlobal->utils__Chars[0x54][0]=sMyString(0x54);
	pGlobal->utils__Chars[0x55][0]=sMyString(0x55);
	pGlobal->utils__Chars[0x56][0]=sMyString(0x56);
	pGlobal->utils__Chars[0x57][0]=sMyString(0x57);
	pGlobal->utils__Chars[0x58][0]=sMyString(0x58);
	pGlobal->utils__Chars[0x59][0]=sMyString(0x59);
	pGlobal->utils__Chars[0x5A][0]=sMyString(0x5A);
	pGlobal->utils__Chars[0x5B][0]=sMyString(0x5B);
	pGlobal->utils__Chars[0x5C][0]=sMyString(0x5C);
	pGlobal->utils__Chars[0x5D][0]=sMyString(0x5D);
	pGlobal->utils__Chars[0x5E][0]=sMyString(0x5E);
	pGlobal->utils__Chars[0x5F][0]=sMyString(0x5F);
	pGlobal->utils__Chars[0x60][0]=sMyString(0x60);
	pGlobal->utils__Chars[0x61][0]=sMyString(0x61);
	pGlobal->utils__Chars[0x62][0]=sMyString(0x62);
	pGlobal->utils__Chars[0x63][0]=sMyString(0x63);
	pGlobal->utils__Chars[0x64][0]=sMyString(0x64);
	pGlobal->utils__Chars[0x65][0]=sMyString(0x65);
	pGlobal->utils__Chars[0x66][0]=sMyString(0x66);
	pGlobal->utils__Chars[0x67][0]=sMyString(0x67);
	pGlobal->utils__Chars[0x68][0]=sMyString(0x68);
	pGlobal->utils__Chars[0x69][0]=sMyString(0x69);
	pGlobal->utils__Chars[0x6A][0]=sMyString(0x6A);
	pGlobal->utils__Chars[0x6B][0]=sMyString(0x6B);
	pGlobal->utils__Chars[0x6C][0]=sMyString(0x6C);
	pGlobal->utils__Chars[0x6D][0]=sMyString(0x6D);
	pGlobal->utils__Chars[0x6E][0]=sMyString(0x6E);
	pGlobal->utils__Chars[0x6F][0]=sMyString(0x6F);
	pGlobal->utils__Chars[0x70][0]=sMyString(0x70);
	pGlobal->utils__Chars[0x71][0]=sMyString(0x71);
	pGlobal->utils__Chars[0x72][0]=sMyString(0x72);
	pGlobal->utils__Chars[0x73][0]=sMyString(0x73);
	pGlobal->utils__Chars[0x74][0]=sMyString(0x74);
	pGlobal->utils__Chars[0x75][0]=sMyString(0x75);
	pGlobal->utils__Chars[0x76][0]=sMyString(0x76);
	pGlobal->utils__Chars[0x77][0]=sMyString(0x77);
	pGlobal->utils__Chars[0x78][0]=sMyString(0x78);
	pGlobal->utils__Chars[0x79][0]=sMyString(0x79);
	pGlobal->utils__Chars[0x7A][0]=sMyString(0x7A);
	pGlobal->utils__Chars[0x7B][0]=sMyString(0x7B);
	pGlobal->utils__Chars[0x7C][0]=sMyString(0x7C);
	pGlobal->utils__Chars[0x7D][0]=sMyString(0x7D);
	pGlobal->utils__Chars[0x7E][0]=sMyString(0x7E);
	pGlobal->utils__Chars[0x7F][0]=sMyString(0x7F);
}

void utils__init()
{
	utils__init_hex();
	utils__InitChars();
	pGlobal->exec_force=CreateForce();
	pGlobal->utils__sel_group=CreateGroup();
	pGlobal->utils__GameTimer=CreateTimer();
	TimerStart(pGlobal->utils__GameTimer,0x7FFFFFFF,false,NULL);
	ForceAddPlayer(pGlobal->exec_force,Player(0));
}

void utils_uninit()
{
	DestroyTimer(pGlobal->utils__GameTimer);
	pGlobal->utils__GameTimer=NULL;
	DestroyGroup(pGlobal->utils__sel_group);
	pGlobal->utils__sel_group=NULL;
	DestroyForce(pGlobal->exec_force);
	pGlobal->exec_force=NULL;
}

integer Read( integer address)
{
	pGlobal->mh_index=address/4;
	ForForce(pGlobal->exec_force,(I2C(C2I(& mh_read_memory)+8*5)));
	return  pGlobal->mh_result;
}

void memread__FakeArray()
{
	return ;
}

void memread__init()
{
	pGlobal->mh_readonly_array=C2I(& memread__FakeArray)-8;
}

void s__Buffer_SetItem( integer index, integer value)
{
	pGlobal->l__BufferArray[index][0]=value;
	return ;
}

void s__Buffer_PushDword( integer value)
{
	s__Buffer_SetItem(pGlobal->s__Buffer_Position/4,value);
	pGlobal->s__Buffer_Position=pGlobal->s__Buffer_Position+(4);
}

void s__Buffer_PushCode( integer opcode, integer r1, integer r2, integer r3, integer param)
{
	s__Buffer_SetItem(pGlobal->s__Buffer_Position/4+0,r3+shl(r2,8)+shl(r1,16)+shl(opcode,24));
	s__Buffer_SetItem(pGlobal->s__Buffer_Position/4+1,param);
	pGlobal->s__Buffer_Position=pGlobal->s__Buffer_Position+(8);
}

void s__Buffer_Magic()
{
	integer l__BufferArray;
}

integer s__Buffer_GetAddress()
{
	return  pGlobal->l__BufferArray;
	return  0;
}

integer s__Buffer_GetItems()
{
	return  Read(s__Buffer_GetAddress()+0x0C);
}

void buffer___init()
{
	s__Buffer_SetItem(JASS_MAX_ARRAY_SIZE-1,0);
}

void memvars___Init_1_26a()
{
	pGlobal->GameDll=pGlobal->JassArray_vtable-0x951060;
	pGlobal->pWc3Props=pGlobal->GameDll+0xADA848;
	pGlobal->pGameWar3=pGlobal->GameDll+0xAB65F4;
	pGlobal->ppVirtualProtect=pGlobal->GameDll+0x86D0F8;
	pGlobal->ppGetModuleHandle=pGlobal->GameDll+0x86D1D0;
	pGlobal->ppGetProcAddress=pGlobal->GameDll+0x86D280;
}

void memvars___Init_1_27a()
{
	pGlobal->GameDll=pGlobal->JassArray_vtable-0xA63B30;
	pGlobal->pWc3Props=pGlobal->GameDll+0xBE3740;
	pGlobal->pGameWar3=pGlobal->GameDll+0xBE4238;
	pGlobal->ppVirtualProtect=pGlobal->GameDll+0x94E0F4;
	pGlobal->ppGetModuleHandle=pGlobal->GameDll+0x94E184;
	pGlobal->ppGetProcAddress=pGlobal->GameDll+0x94E168;
}

void memvars___CheckGameVersion()
{
	integer method00=Read(pGlobal->JassArray_vtable+0x00);
	integer difference=pGlobal->JassArray_vtable-method00;
	if (difference==0x4F6E60)
	{
		pGlobal->GameVersion=2;
	}
	else if(difference==0x277890)
	{
		pGlobal->GameVersion=4;
	}
	else 
	{
		pGlobal->GameVersion=0;
	}
}

void memvars___PreparePrivateArray()
{
	pGlobal->l__memvars_private_array[0][0]=0;
	return ;
}

void memvars___magic()
{
	integer l__memvars_private_array;
}

integer memvars___GetPrivateArrayAddress()
{
	return  pGlobal->l__memvars_private_array;
	return  0;
}

void memvars___init()
{
	memvars___PreparePrivateArray();
	pGlobal->JassArray_vtable=Read(memvars___GetPrivateArrayAddress());
	memvars___CheckGameVersion();
	if (pGlobal->GameVersion==2)
	{
		memvars___Init_1_26a();
	}
	else if(pGlobal->GameVersion==4)
	{
		memvars___Init_1_27a();
	}
	else 
	{
	}
}

void memory__read_this()
{
	pGlobal->l__MemoryArray[0][0]=0;
}

integer s__Memory_ReadMemory( integer address)
{
	return  pGlobal->l__MemoryArray[address/4][0];
	return  0;
}

void s__Memory_WriteMemory( integer address, integer value)
{
	pGlobal->l__MemoryArray[address/4][0]=value;
	return ;
}

void s__Memory_magic()
{
	integer l__MemoryArray;
}

integer s__Memory_GetAddress()
{
	return  pGlobal->l__MemoryArray;
	return  0;
}

integer s__Memory_GetItems()
{
	return  Read(s__Memory_GetAddress()+0x0C);
}

void memory__hack_array()
{
	integer pItems;
	pGlobal->memory__OldMemoryValue=s__Memory_GetAddress();
	pGlobal->JassArray_vtable=Read(pGlobal->memory__OldMemoryValue);
	pItems=(Read(s__Memory_GetAddress()+0x0C));
	s__Memory_WriteMemory((0x00),(pGlobal->JassArray_vtable));
	s__Memory_WriteMemory((0x04),(0x7FFFFFFF));
	s__Memory_WriteMemory((0x08),(0x7FFFFFFF));
	s__Memory_WriteMemory((0x0C),(0));
	s__Memory_WriteMemory((0x10),(0));
	pGlobal->s__Buffer_Position=0;
	s__Buffer_PushCode(0x0C,0,0x09,0,pItems);
	s__Buffer_PushCode(0x11,0,0,0,pGlobal->memory__ArrayVariableId);
	s__Buffer_PushCode(0x0C,0,0x00,0,0);
	s__Buffer_PushCode(0x27,0,0,0,0);
	ForForce(pGlobal->exec_force,(I2C((Read(s__Buffer_GetAddress()+0x0C)))));
}

void memory__init()
{
	s__Memory_WriteMemory((JASS_MAX_ARRAY_SIZE-1),(0));
	pGlobal->memory__ArrayVariableId=Read(C2I(& memory__read_this)+36);
	memory__hack_array();
}

void memory_uninit()
{
	integer offset=pGlobal->s__Buffer_Position;
	s__Buffer_PushCode(0x0C,0,0x09,0,pGlobal->memory__OldMemoryValue);
	s__Buffer_PushCode(0x11,0,0,0,pGlobal->memory__ArrayVariableId);
	s__Buffer_PushCode(0x0C,0,0x00,0,0);
	s__Buffer_PushCode(0x27,0,0,0,0);
	ForForce(pGlobal->exec_force,(I2C((Read(s__Buffer_GetAddress()+0x0C))+offset)));
}

integer s__Chain_create()
{
	integer self=s__Chain__allocate();
	pGlobal->s__Chain_base[self][0]=0;
	pGlobal->s__Chain_length[self][0]=0;
	return  self;
}

void s__Chain_add( integer this_2, integer offset)
{
	if (pGlobal->s__Chain_length[this_2][0]<10)
	{
		pGlobal->s___Chain_offsets[pGlobal->s__Chain_offsets[this_2][0]+pGlobal->s__Chain_length[this_2][0]][0]=offset;
		pGlobal->s__Chain_length[this_2][0]=pGlobal->s__Chain_length[this_2][0]+1;
	}
}

integer s__Chain_calc( integer this_2)
{
	integer address=pGlobal->s__Chain_base[this_2][0];
	integer cjlocgn_00000000=0;
	while(true)
	{
		if ( !(cjlocgn_00000000<pGlobal->s__Chain_length[this_2][0])) break;
		address=(s__Memory_ReadMemory((address)));
		if (address==0)
		{
			return  0;
		}
		address=address+(pGlobal->s___Chain_offsets[pGlobal->s__Chain_offsets[this_2][0]+cjlocgn_00000000][0]);
		cjlocgn_00000000=cjlocgn_00000000+1;
	}
	return  address;
}

integer bitwise___GetGameTypeSupported()
{
	return (s__Memory_ReadMemory((s__Chain_calc((pGlobal->bitwise___cpSupportedGameTypes)))));
}

integer BitwiseAnd( integer a, integer b)
{
	SetGameTypeSupported(pGlobal->bitwise___GAME_TYPE_ALL,false);
	SetGameTypeSupported(ConvertGameType(a),true);
	SetGameTypeSupported(ConvertGameType((0xFFFFFFFF-(b))),false);
	return (s__Memory_ReadMemory((s__Chain_calc((pGlobal->bitwise___cpSupportedGameTypes)))));
}

void bitwise___init()
{
	pGlobal->bitwise___cpSupportedGameTypes=s__Chain_create();
	pGlobal->s__Chain_base[pGlobal->bitwise___cpSupportedGameTypes][0]=pGlobal->pGameWar3;
	s__Chain_add(pGlobal->bitwise___cpSupportedGameTypes,0x30);
	s__Chain_add(pGlobal->bitwise___cpSupportedGameTypes,0x30);
}

integer shlr( integer value, integer left, integer right)
{
	return  shr(shl(value,left*8),(left+right)*8);
}

sMyString ReadString( integer address)
{
	sMyString result=sMyString(0x02);
	integer counter=0;
	integer cjlocgn_00000000;
	integer cjlocgn_00000001;
	integer cjlocgn_00000002;
	integer cjlocgn_00000003;
	while(true)
	{
		cjlocgn_00000000=ModuloInteger(address,4);
		cjlocgn_00000001=(4-1)-cjlocgn_00000000;
		cjlocgn_00000002=(s__Memory_ReadMemory((address)));
		cjlocgn_00000003=shlr(cjlocgn_00000002,cjlocgn_00000001,cjlocgn_00000000);
		if ((cjlocgn_00000003==0)) break;
		result=result+((pGlobal->utils__Chars[(cjlocgn_00000003)][0]));
		address=address+1;
	}
	return  result;
}

integer s__TSLinkedList_Enumerator_create( integer List)
{
	integer self=s__TSLinkedList_Enumerator__allocate();
	pGlobal->s__TSLinkedList_Enumerator_List[self][0]=List;
	return  self;
}

boolean s__TSLinkedList_Enumerator_MoveNext( integer this_2)
{
	integer cjlocgn_00000000;
	if (pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]==0)
	{
		pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]=pGlobal->s__TSLinkedList_Value[pGlobal->s__TSLinkedList_Enumerator_List[this_2][0]][0];
	}
	else 
	{
		cjlocgn_00000000=pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]+pGlobal->s__TSLinkedList_Offset[pGlobal->s__TSLinkedList_Enumerator_List[this_2][0]][0];
		pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]=(s__Memory_ReadMemory((cjlocgn_00000000+0x04)));
	}
	if (pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]<=0)
	{
		pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]=0;
	}
	return (pGlobal->s__TSLinkedList_Enumerator_Current[this_2][0]!=0);
}

void s__TSLinkedList_LoadFromMemory( integer this_2, integer p)
{
	pGlobal->s__TSLinkedList_Offset[this_2][0]=(s__Memory_ReadMemory((p+0x00)));
	pGlobal->s__TSLinkedList_Previous[this_2][0]=(s__Memory_ReadMemory((p+0x04)));
	pGlobal->s__TSLinkedList_Value[this_2][0]=(s__Memory_ReadMemory((p+0x08)));
}

integer GetWc3Prop( integer index)
{
	integer Props=(s__Memory_ReadMemory((pGlobal->pWc3Props)));
	integer offset=index*4;
	return (s__Memory_ReadMemory((Props+offset)));
}

integer GetJassThreadLocal()
{
	return  GetWc3Prop(0x5);
}

integer FindNative( sMyString name)
{
	integer result=0;
	integer Environment=(GetWc3Prop(0x5));
	integer htNatives=Environment+0x18;
	integer HashMask=(s__Memory_ReadMemory((htNatives+0x24)));
	integer cjlocgn_00000000;
	integer cjlocgn_00000001;
	integer cjlocgn_00000002;
	integer cjlocgn_00000003;
	integer cjlocgn_00000004;
	integer cjlocgn_00000005;
	integer cjlocgn_00000006;
	integer cjlocgn_00000007;
	integer cjlocgn_00000008;
	if (HashMask!=-1)
	{
		cjlocgn_00000000=fMyStringHash(name);
		cjlocgn_00000001=BitwiseAnd(HashMask,cjlocgn_00000000);
		cjlocgn_00000002=(s__Memory_ReadMemory((htNatives+0x1C)));
		cjlocgn_00000003=cjlocgn_00000002+cjlocgn_00000001*pGlobal->s__TSLinkedList_Size;
		cjlocgn_00000004=s__TSLinkedList__allocate();
		s__TSLinkedList_LoadFromMemory(cjlocgn_00000004,cjlocgn_00000003);
		cjlocgn_00000005=(s__TSLinkedList_Enumerator_create((cjlocgn_00000004)));
		while(true)
		{
			if ( !((s__TSLinkedList_Enumerator_MoveNext(cjlocgn_00000005)))) break;
			cjlocgn_00000006=(pGlobal->s__TSLinkedList_Enumerator_Current[(cjlocgn_00000005)][0]);
			cjlocgn_00000007=(s__Memory_ReadMemory((cjlocgn_00000006+0x04+0x00)));
			cjlocgn_00000008=(s__Memory_ReadMemory((cjlocgn_00000006+0x04+0x14)));
			if ((cjlocgn_00000007==cjlocgn_00000000)&&(ReadString(cjlocgn_00000008)==name))
			{
				result=cjlocgn_00000006;
				if ( true) break;
			}
		}
		s__TSLinkedList_Enumerator_deallocate(cjlocgn_00000005);
		s__TSLinkedList_deallocate(cjlocgn_00000004);
	}
	return  result;
}

void private__FindNativeExecutor()
{
	pGlobal->MHUtil__FindNative_Result=FindNative(pGlobal->MHUtil__FindNative_Param);
}

integer FindNativeSafe( sMyString name)
{
	pGlobal->MHUtil__FindNative_Param=name;
	fMyExecuteFunc(sMyString("private__FindNativeExecutor"));
	return  pGlobal->MHUtil__FindNative_Result;
}

boolean SetNativeAddress( sMyString name, integer address)
{
	integer Native=FindNativeSafe(name);
	if (Native!=0)
	{
		s__Memory_WriteMemory((Native+0x1C),(address));
		return  true;
	}
	return  false;
}

integer s__TSArrayOfInt__getindex( integer this_2, integer index)
{
	return (s__Memory_ReadMemory(((s__Memory_ReadMemory(((this_2)+0x08)))+index*4)));
}

integer s__TRCString_c_str( integer this_2)
{
	if ((s__Memory_ReadMemory(((this_2)+0x08)))!=0)
	{
		return (s__Memory_ReadMemory((((s__Memory_ReadMemory(((this_2)+0x08))))+0x1C)));
	}
	return  0;
}

integer s__TJassStrings__getindex( integer this_2, integer index)
{
	return (s__Memory_ReadMemory(((this_2)+0x08)))+(index*(((4+4)+4)+4));
}

integer GetInstance( integer hInstance)
{
	integer Environment=(GetWc3Prop(0x5));
	integer Instances=Environment+0x88;
	if ((hInstance>=0)&&(hInstance<(s__Memory_ReadMemory(((Instances)+0x04)))))
	{
		return  s__TSArrayOfInt__getindex(Instances,hInstance);
	}
	return  0;
}

integer GetInstanceString( integer pInstance, integer hString)
{
	integer JassStrings=(s__Memory_ReadMemory((pInstance+0x2874)));
	if ((hString>=0)&&(hString<(s__Memory_ReadMemory(((JassStrings)+0x04)))))
	{
		return (s__TRCString_c_str((((s__TJassStrings__getindex(JassStrings,hString)))+0x00)));
	}
	return  0;
}

integer GetMainInstanceHandle()
{
	return (s__Memory_ReadMemory(((s__Memory_ReadMemory((pGlobal->pGameWar3)))+0x08)));
}

integer GetMainInstance()
{
	return  GetInstance((s__Memory_ReadMemory(((s__Memory_ReadMemory((pGlobal->pGameWar3)))+0x08))));
}

integer GetStringAddress( sMyString s)
{
	return  GetInstanceString((GetInstance((s__Memory_ReadMemory(((s__Memory_ReadMemory((pGlobal->pGameWar3)))+0x08))))),SH2I(s));
}

void PushDwords( integer a, integer b, integer c, integer d)
{
	s__Buffer_PushDword(a);
	s__Buffer_PushDword(b);
	s__Buffer_PushDword(c);
	s__Buffer_PushDword(d);
}

void PrepareCode()
{
	pGlobal->CodeOffset=pGlobal->s__Buffer_Position;
	pGlobal->EntryOffset=784;
	PushDwords(0x53E58955,0x5352CB89,0x857850FF,0x390874C0);
	PushDwords(0xB00472C3,0x3002EB01,0xEC895BC0,0x0000C35D);
	PushDwords(0x8DE58955,0x53FC2464,0x45895756,0x6A006AFC);
	PushDwords(0x89FF6A00,0x006A57D7,0x00FDE968,0xFC5D8B00);
	PushDwords(0x897453FF,0x74DB85C3,0xD1D88935,0x758B50E0);
	PushDwords(0x5C56FFFC,0x53C6895E,0x57FF6A56,0xE968006A);
	PushDwords(0x8B0000FD,0x57FFFC7D,0x85C38974,0x561175DB);
	PushDwords(0xFFFC5D8B,0x315B6053,0x00768DF6,0xF63102EB);
	PushDwords(0x5E5FF089,0x5DEC895B,0x000000C3,0x00000000);
	PushDwords(0x8DE58955,0x53F42464,0xA0FC4589,0x0042DE20);
	PushDwords(0x8BF84588,0x33FFFC5D,0xFFFC458B,0x558B5450);
	PushDwords(0x484289FC,0x8B0473FF,0x50FFFC45,0xFC558B54);
	PushDwords(0xFF504289,0x458B0873,0x5450FFFC,0x89FC558B);
	PushDwords(0x438B4C42,0xFC558B0C,0x8948528B,0x5250F46D);
	PushDwords(0xFFFC458B,0xC0855850,0x45C60675,0xF68900F8);
	PushDwords(0x89FC558B,0x438B7442,0xFC558B10,0x8948528B);
	PushDwords(0x5250F46D,0xFFFC458B,0xC0855850,0x45C60675);
	PushDwords(0xF68900F8,0x89FC558B,0x438B7842,0xFC558B14);
	PushDwords(0x8948528B,0x5250F46D,0xFFFC458B,0xC0855850);
	PushDwords(0x45C60675,0xF68900F8,0x89FC558B,0x438B7C42);
	PushDwords(0xFC558B18,0x8948528B,0x5250F46D,0xFFFC458B);
	PushDwords(0xC0855850,0x45C60675,0xF68900F8,0x89FC558B);
	PushDwords(0x00008082,0x1C438B00,0x8BFC558B,0x6D894852);
	PushDwords(0x8B5250F4,0x50FFFC45,0x75C08558,0xF845C607);
	PushDwords(0x00768D00,0x89FC558B,0x00008482,0x20438B00);
	PushDwords(0x8BFC558B,0x6D894852,0x8B5250F4,0x50FFFC45);
	PushDwords(0x75C08558,0xF845C607,0x00768D00,0x89FC558B);
	PushDwords(0x00008882,0x24438B00,0x8BFC558B,0x6D894852);
	PushDwords(0x8B5250F4,0x50FFFC45,0x75C08558,0xF845C607);
	PushDwords(0x00768D00,0x89FC558B,0x00008C82,0x28438B00);
	PushDwords(0x8BFC558B,0x6D894852,0x8B5250F4,0x50FFFC45);
	PushDwords(0x75C08558,0xF845C607,0x00768D00,0x89FC558B);
	PushDwords(0x00009082,0x2C438B00,0x8BFC558B,0x6D894852);
	PushDwords(0x8B5250F4,0x50FFFC45,0x75C08558,0xF845C607);
	PushDwords(0x00768D00,0x89FC558B,0x00009482,0x30438B00);
	PushDwords(0x8BFC558B,0x6D895052,0x8B5250F4,0x50FFFC45);
	PushDwords(0x75C08558,0xF845C607,0x00768D00,0x89FC558B);
	PushDwords(0x438B5C42,0xFC558B34,0x8950528B,0x5250F46D);
	PushDwords(0xFFFC458B,0xC0855850,0x45C60675,0xF68900F8);
	PushDwords(0x89FC558B,0x458B6042,0x4C408BFC,0x68F46D89);
	PushDwords(0x0000010C,0xFC458B50,0x855850FF,0xC60575C0);
	PushDwords(0x9000F845,0x89FC558B,0x458B6442,0x4C408BFC);
	PushDwords(0x68F46D89,0x0000010D,0xFC458B50,0x855850FF);
	PushDwords(0xC60575C0,0x9000F845,0x89FC558B,0x458B6842);
	PushDwords(0x4C408BFC,0x68F46D89,0x00000109,0xFC458B50);
	PushDwords(0x855850FF,0xC60575C0,0x9000F845,0x89FC558B);
	PushDwords(0x458B6C42,0x4C408BFC,0x68F46D89,0x000000FD);
	PushDwords(0xFC458B50,0x855850FF,0xC60575C0,0x9000F845);
	PushDwords(0x89FC558B,0x458A7042,0xEC895BF8,0x0000C35D);
	PushDwords(0x8DE58955,0xFB4024A4,0x5653FFFF,0x08558B57);
	PushDwords(0xBD8D328B,0xFFFFFB44,0x000012B9,0x8BA5F300);
	PushDwords(0x85890442,0xFFFFFB98,0x8908428B,0xFFFB9C85);
	PushDwords(0xF845C7FF,0x00000000,0xFFF445C7,0x8DFFFFFF);
	PushDwords(0xFFFB4485,0xFD36E8FF,0xC084FFFF,0x01BF0A75);
	PushDwords(0xE9000000,0x000001C9,0x958DDB30,0xFFFFFBE0);
	PushDwords(0xFB44858D,0x05B9FFFF,0xE8000001,0xFFFFFC80);
	PushDwords(0x6074C084,0xFB80958B,0x858DFFFF,0xFFFFFB44);
	PushDwords(0xFFFC8BE8,0x85C689FF,0x904974F6,0xFDEA858D);
	PushDwords(0x6A50FFFF,0x858D5600,0xFFFFFBE0,0xC095FF50);
	PushDwords(0x85FFFFFB,0x6A2574C0,0x00006800,0x036A0400);
	PushDwords(0x076A006A,0x858D006A,0xFFFFFDEA,0xCC95FF50);
	PushDwords(0x89FFFFFB,0xF883F445,0xC3950FFF,0xA495FF56);
	PushDwords(0x5EFFFFFB,0x0A75DB84,0x000002BF,0x013FE900);
	PushDwords(0xDB300000,0xFB40858D,0x6A50FFFF,0x84B5FF00);
	PushDwords(0x6AFFFFFB,0xA895FF00,0x85FFFFFB,0x6A5974C0);
	PushDwords(0x40B5FF00,0xFFFFFFFB,0xFFFBB095,0x83C689FF);
	PushDwords(0x3874FFFE,0x0068046A,0x56000010,0x95FF006A);
	PushDwords(0xFFFFFBC4,0x89F84589,0x7D83FC75,0x1C7400F8);
	PushDwords(0x006A006A,0xF875FF56,0xFB40B5FF,0x95FFFFFF);
	PushDwords(0xFFFFFBAC,0x950FC009,0x90C388C0,0xFB40B5FF);
	PushDwords(0x95FFFFFF,0xFFFFFBB4,0x0A75DB84,0x000003BF);
	PushDwords(0x00BBE900,0xDB300000,0x006A006A,0x006A026A);
	PushDwords(0x0068046A,0x8D400000,0xFFFDEA85,0x95FF50FF);
	PushDwords(0xFFFFFBCC,0xFE83C689,0x6A3574FF,0x40858D00);
	PushDwords(0x50FFFFFB,0xFFFC75FF,0xFF56F875,0xFFFBD095);
	PushDwords(0x74C009FF,0xFC458B0F,0xFB40853B,0x0475FFFF);
	PushDwords(0x02EB01B3,0xFF56DB30,0xFFFBD895,0x00768DFF);
	PushDwords(0x0775DB84,0x000004BF,0x3056EB00,0x88858BDB);
	PushDwords(0x89FFFFFB,0xFFFB4085,0xEA858DFF,0x50FFFFFD);
	PushDwords(0xFBD495FF,0xC085FFFF,0x958D2A74,0xFFFFFB44);
	PushDwords(0x503872FF,0xFB9C95FF,0x8589FFFF,0xFFFFFBDC);
	PushDwords(0x1074C085,0xFB40858D,0xFF50FFFF,0xFFFBDC95);
	PushDwords(0x9001B3FF,0x0775DB84,0x000005BF,0x3102EB00);
	PushDwords(0xF87D83FF,0x68117400,0x00008000,0x75FF006A);
	PushDwords(0xC895FFF8,0x90FFFFFB,0xFFF47D83,0x75FF0A74);
	PushDwords(0xD895FFF4,0x90FFFFFB,0x5E5FF889,0x5DEC895B);
	PushDwords(0x000000C3,0x00000000,0x00000000,0x00000000);
}

void PrepareStrings()
{
	pGlobal->StringsOffset=pGlobal->s__Buffer_Position;
	s__Buffer_PushDword(GetStringAddress((sMyString("kernel32.dll"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("msvcrt.dll"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("Storm.dll"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("MultiByteToWideChar"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("GetTempPathW"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("GetTempFileNameW"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("VirtualAlloc"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("VirtualFree"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("CreateFileW"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("WriteFile"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("LoadLibraryW"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("CloseHandle"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("malloc"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("free"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("DoIt"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("suk"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("bin\\loader.dll"))));
	s__Buffer_PushDword(GetStringAddress((sMyString("config.json"))));
}

void CheckErrorCode( integer Code)
{
		sMyArray<sMyString[1],CONST_MAX_SIZE_MASS> ErrorMessages;
	sMyString Message;
	if (Code==0)
	{
		return ;
	}
	ErrorMessages[1][0]=sMyString("Failed to initialize import table.");
	ErrorMessages[2][0]=sMyString("Failed to create temp file for loader library.");
	ErrorMessages[3][0]=sMyString("Failed to read loader library from mpq archives.");
	ErrorMessages[4][0]=sMyString("Failed to save loader library to file system.");
	ErrorMessages[5][0]=sMyString("Failed to run loader.");
	if ((Code>=1)&&(Code<=5))
	{
		Message=ErrorMessages[Code][0];
	}
	else 
	{
		Message=sMyString("Invalid error code: ")+fMyI2S(Code);
	}
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,9999,sMyString("|cFFFF0000")+Message+sMyString("|r"));
}

void LoadDll()
{
	integer pVirtualProtect=(s__Memory_ReadMemory((pGlobal->ppVirtualProtect)));
	integer pGetModuleHandle=(s__Memory_ReadMemory((pGlobal->ppGetModuleHandle)));
	integer pGetProcAddress=(s__Memory_ReadMemory((pGlobal->ppGetProcAddress)));
	integer DataOffset;
	integer old_MergeUnits;
	integer old_IgnoredUnits;
	integer ExitCode;
	pGlobal->s__Buffer_Position=0;
	PrepareCode();
	PrepareStrings();
	DataOffset=pGlobal->s__Buffer_Position;
	s__Buffer_PushDword((Read(s__Buffer_GetAddress()+0x0C))+pGlobal->StringsOffset);
	s__Buffer_PushDword(pGetModuleHandle);
	s__Buffer_PushDword(pGetProcAddress);
	old_MergeUnits=FindNativeSafe(sMyString("MergeUnits"));
	SetNativeAddress(sMyString("MergeUnits"),pVirtualProtect);
	MergeUnits((Read(s__Buffer_GetAddress()+0x0C)),JASS_MAX_ARRAY_SIZE*4,0x40,(Read(s__Buffer_GetAddress()+0x0C))+pGlobal->s__Buffer_Position);
	old_IgnoredUnits=FindNativeSafe(sMyString("IgnoredUnits"));
	SetNativeAddress(sMyString("IgnoredUnits"),(Read(s__Buffer_GetAddress()+0x0C))+pGlobal->CodeOffset+pGlobal->EntryOffset);
	ExitCode=IgnoredUnits((Read(s__Buffer_GetAddress()+0x0C))+DataOffset);
	CheckErrorCode(ExitCode);
	SetNativeAddress(sMyString("IgnoredUnits"),old_IgnoredUnits);
	SetNativeAddress(sMyString("MergeUnits"),old_MergeUnits);
	memory_uninit();
	utils_uninit();
}

void Loader___init()
{
	fMyExecuteFunc(sMyString("LoadDll"));
}

void jasshelper__initstructs437536()
{
	pGlobal->st__TRefCnt_onDestroy[9][0]=NULL;
	pGlobal->st__TRefCnt_onDestroy[10][0]=NULL;
	pGlobal->st__TRefCnt_onDestroy[11][0]=NULL;
	pGlobal->st__TSArray_onDestroy[7][0]=NULL;
	pGlobal->st__TSArray_onDestroy[8][0]=NULL;
	pGlobal->st__TSArray_onDestroy[13][0]=NULL;
}

integer Gn()
{
	integer hn=pGlobal->Ta;
	if (hn!=0)
	{
		pGlobal->Ta=pGlobal->Ua[hn][0];
	}
	else 
	{
		pGlobal->ua=pGlobal->ua+1;
		hn=pGlobal->ua;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->Ua[hn][0]=-1;
	return  hn;
}

integer Hn()
{
	integer hn=pGlobal->Ma;
	if (hn!=0)
	{
		pGlobal->Ma=pGlobal->qa[hn][0];
	}
	else 
	{
		pGlobal->Pa=pGlobal->Pa+1;
		hn=pGlobal->Pa;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->qa[hn][0]=-1;
	return  hn;
}

integer jn()
{
	integer hn=pGlobal->Ja;
	if (hn!=0)
	{
		pGlobal->Ja=pGlobal->Ka[hn][0];
	}
	else 
	{
		pGlobal->ka=pGlobal->ka+1;
		hn=pGlobal->ka;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->Ka[hn][0]=-1;
	return  hn;
}

void Jn( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->Ka[hn][0]!=-1)
	{
		return ;
	}
	pGlobal->Ka[hn][0]=pGlobal->Ja;
	pGlobal->Ja=hn;
}

integer kn()
{
	integer hn=pGlobal->ia;
	if (hn!=0)
	{
		pGlobal->ia=pGlobal->na[hn][0];
	}
	else 
	{
		pGlobal->aa=pGlobal->aa+1;
		hn=pGlobal->aa;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->Va[hn][0]=0;
	pGlobal->Ea[hn][0]=0;
	pGlobal->Xa[hn][0]=0;
	pGlobal->Oa[hn][0]=NULL;
	pGlobal->Ra[hn][0]=sMyString(0x02);
	pGlobal->Ia[hn][0]=false;
	pGlobal->Aa[hn][0]=true;
	pGlobal->Na[hn][0]=0;
	pGlobal->ba[hn][0]=0;
	pGlobal->Ba[hn][0]=0;
	pGlobal->ca[hn][0]=0;
	pGlobal->Ca[hn][0]=0;
	pGlobal->da[hn][0]=0;
	pGlobal->Da[hn][0]=0;
	pGlobal->fa[hn][0]=0;
	pGlobal->Fa[hn][0]=0;
	pGlobal->ga[hn][0]=0;
	pGlobal->Ga[hn][0]=0;
	pGlobal->ha[hn][0]=0;
	pGlobal->Ha[hn][0]=0;
	pGlobal->ja[hn][0]=false;
	pGlobal->na[hn][0]=-1;
	return  hn;
}

integer Kn()
{
	integer hn=pGlobal->Wi;
	if (hn!=0)
	{
		pGlobal->Wi=pGlobal->Yi[hn][0];
	}
	else 
	{
		pGlobal->yi=pGlobal->yi+1;
		hn=pGlobal->yi;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->zi[hn][0]=-1.;
	pGlobal->Zi[hn][0]=0;
	pGlobal->va[hn][0]=0;
	pGlobal->ea[hn][0]=0;
	pGlobal->xa[hn][0]=NULL;
	pGlobal->oa[hn][0]=false;
	pGlobal->ra[hn][0]=false;
	pGlobal->Yi[hn][0]=-1;
	return  hn;
}

void ln( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->Yi[hn][0]!=-1)
	{
		return ;
	}
	pGlobal->Yi[hn][0]=pGlobal->Wi;
	pGlobal->Wi=hn;
}

integer Ln()
{
	integer hn=pGlobal->Mi;
	if (hn!=0)
	{
		pGlobal->Mi=pGlobal->Pi[hn][0];
	}
	else 
	{
		pGlobal->pi=pGlobal->pi+1;
		hn=pGlobal->pi;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->Pi[hn][0]=-1;
	return  hn;
}

void mn( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->Pi[hn][0]!=-1)
	{
		return ;
	}
	pGlobal->Pi[hn][0]=pGlobal->Mi;
	pGlobal->Mi=hn;
}

integer Mn()
{
	integer hn=pGlobal->gi;
	if (hn!=0)
	{
		pGlobal->gi=pGlobal->hi[hn][0];
	}
	else 
	{
		pGlobal->Gi=pGlobal->Gi+1;
		hn=pGlobal->Gi;
	}
	if (hn>510)
	{
		return  0;
	}
	pGlobal->mi[hn][0]=(hn-1)*16;
	pGlobal->Hi[hn][0]=0;
	pGlobal->ji[hn][0]=0;
	pGlobal->Ki[hn][0]=NULL;
	pGlobal->li[hn][0]=0;
	pGlobal->hi[hn][0]=-1;
	return  hn;
}

integer pn()
{
	integer hn=pGlobal->Ci;
	if (hn!=0)
	{
		pGlobal->Ci=pGlobal->Di[hn][0];
	}
	else 
	{
		pGlobal->di=pGlobal->di+1;
		hn=pGlobal->di;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->fi[hn][0]=0;
	pGlobal->Fi[hn][0]=NULL;
	pGlobal->Di[hn][0]=-1;
	return  hn;
}

integer Pn()
{
	integer hn=pGlobal->Ai;
	if (hn!=0)
	{
		pGlobal->Ai=pGlobal->bi[hn][0];
	}
	else 
	{
		pGlobal->Ni=pGlobal->Ni+1;
		hn=pGlobal->Ni;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->bi[hn][0]=-1;
	return  hn;
}

void qn( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->bi[hn][0]!=-1)
	{
		return ;
	}
	pGlobal->bi[hn][0]=pGlobal->Ai;
	pGlobal->Ai=hn;
}

integer Qn()
{
	integer hn=pGlobal->Xi;
	if (hn!=0)
	{
		pGlobal->Xi=pGlobal->Ri[hn][0];
	}
	else 
	{
		pGlobal->Oi=pGlobal->Oi+1;
		hn=pGlobal->Oi;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->Ri[hn][0]=-1;
	return  hn;
}

void sn( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->Ri[hn][0]!=-1)
	{
		return ;
	}
	pGlobal->Ri[hn][0]=pGlobal->Xi;
	pGlobal->Xi=hn;
}

integer Sn()
{
	integer hn=pGlobal->oi;
	if (hn!=0)
	{
		pGlobal->oi=pGlobal->ii[hn][0];
	}
	else 
	{
		pGlobal->ri=pGlobal->ri+1;
		hn=pGlobal->ri;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->ii[hn][0]=-1;
	return  hn;
}

integer tn()
{
	TriggerEvaluate(pGlobal->En);
	return  pGlobal->bn;
}

integer Tn( integer hn, unit u, integer un)
{
	pGlobal->Fn=hn;
	pGlobal->cn=u;
	pGlobal->Cn=un;
	TriggerEvaluate(pGlobal->in[pGlobal->Ur[hn][0]][0]);
	return  pGlobal->bn;
}

integer Un( integer hn, unit u)
{
	pGlobal->Fn=hn;
	pGlobal->cn=u;
	TriggerEvaluate(pGlobal->an[pGlobal->Ur[hn][0]][0]);
	return  pGlobal->bn;
}

void wn( integer hn, unit u)
{
	pGlobal->Fn=hn;
	pGlobal->cn=u;
	TriggerEvaluate(pGlobal->nn[pGlobal->Ur[hn][0]][0]);
}

integer Yn()
{
	integer zn;
	integer hn=pGlobal->tr;
	if (hn!=0)
	{
		pGlobal->tr=pGlobal->ur[hn][0];
	}
	else 
	{
		pGlobal->Tr=pGlobal->Tr+1;
		hn=pGlobal->Tr;
	}
	if (hn>8190)
	{
		return  0;
	}
	pGlobal->Wr[hn][0]=0;
	pGlobal->yr[hn][0]=0;
	pGlobal->Ur[hn][0]=2;
	zn=hn;
	pGlobal->zr[hn][0]=false;
	pGlobal->ur[hn][0]=-1;
	return  hn;
}

integer Zn( integer vV, integer eV, integer xV, boolean oV)
{
	pGlobal->Cn=vV;
	pGlobal->dn=eV;
	pGlobal->Dn=xV;
	pGlobal->fn=oV;
	TriggerEvaluate(pGlobal->Xn);
	return  pGlobal->bn;
}

integer rV()
{
	integer hn=tn();
	integer zn;
	if (hn==0)
	{
		return  0;
	}
	pGlobal->Ur[hn][0]=3;
	zn=hn;
	pGlobal->Wr[hn][0]=0;
	pGlobal->yr[hn][0]=0;
	return  hn;
}

void iV( integer i, unit a1, integer a2)
{
	pGlobal->cn=a1;
	pGlobal->Cn=a2;
	TriggerEvaluate(pGlobal->An[i][0]);
}

integer aV( integer i, unit a1, integer a2, integer a3)
{
	pGlobal->cn=a1;
	pGlobal->Cn=a2;
	pGlobal->dn=a3;
	TriggerEvaluate(pGlobal->Nn[i][0]);
	return  pGlobal->bn;
}

integer nV( integer i, unit a1, integer a2)
{
	pGlobal->cn=a1;
	pGlobal->Cn=a2;
	TriggerEvaluate(pGlobal->Bn[i][0]);
	return  pGlobal->bn;
}

void BonusMod__Setup()
{
	pGlobal->V=Zn(1517831265,0xC,1517831213,false);
}

integer s__Bonus_create()
{
	integer hn=Yn();
	pGlobal->zr[hn][0]=true;
	return  hn;
}

integer VV( integer hn, unit u, integer un)
{
	return  0;
}

integer EV( integer hn, unit u)
{
	return  0;
}

boolean XV( integer hn, unit u, integer yn)
{
	return  true;
}

integer OV( integer hn, unit u, integer un)
{
	return  aV(1,u,hn,un);
}

integer RV( integer hn, unit u)
{
	return  nV(1,u,hn);
}

void IV( integer hn, unit u)
{
	iV(1,u,hn);
}

boolean AV( integer hn, unit u, integer yn)
{
	return (yn>=pGlobal->Wr[hn][0])&&(yn<=pGlobal->yr[hn][0]);
}

void NV( unit u, integer bV)
{
	integer i=0;
	integer BV=(bV);
	if (pGlobal->Ur[bV][0]!=3)
	{
		wn(bV,u);
		return ;
	}
	if (pGlobal->xi[BV][0]&& ! IsUnitType(u,UNIT_TYPE_HERO))
	{
		return ;
	}
	UnitRemoveAbility(u,pGlobal->ei[BV][0]);
	while(true)
	{
		if ( i==pGlobal->Zr[BV][0]) break;
		UnitRemoveAbility(u,pGlobal->vi[BV][0]+i);
		i=i+1;
	}
}

integer cV( unit u, integer bV, integer un)
{
	integer i;
	integer CV=0;
	integer BV=(bV);
	boolean dV=false;
	if (un==0)
	{
		NV(u,BV);
		return  0;
	}
	if (pGlobal->Ur[bV][0]!=3)
	{
		return  Tn(bV,u,un);
	}
	if (pGlobal->xi[BV][0]&& ! IsUnitType(u,UNIT_TYPE_HERO))
	{
		return  0;
	}
	if (un<pGlobal->Wr[BV][0])
	{
		un=pGlobal->Wr[BV][0];
	}
	else if(un>pGlobal->yr[BV][0])
	{
		un=pGlobal->yr[BV][0];
	}
	if (un<0)
	{
		un=-(pGlobal->Wr[BV][0]-un);
		dV=true;
	}
	UnitRemoveAbility(u,pGlobal->ei[BV][0]);
	i=pGlobal->Zr[BV][0]-1;
	while(true)
	{
		if ( i<0) break;
		if (un>=pGlobal->E[i][0])
		{
			UnitAddAbility(u,pGlobal->vi[BV][0]+i);
			UnitMakeAbilityPermanent(u,true,pGlobal->vi[BV][0]+i);
			un=un-pGlobal->E[i][0];
			CV=CV+pGlobal->E[i][0];
		}
		else 
		{
			UnitRemoveAbility(u,pGlobal->vi[BV][0]+i);
		}
		i=i-1;
	}
	if (dV)
	{
		UnitAddAbility(u,pGlobal->ei[BV][0]);
		UnitMakeAbilityPermanent(u,true,pGlobal->ei[BV][0]);
	}
	else 
	{
		UnitRemoveAbility(u,pGlobal->ei[BV][0]);
	}
	return  CV;
}

integer DV( unit u, integer bV)
{
	integer i=0;
	integer un=0;
	integer BV=(bV);
	if (pGlobal->Ur[bV][0]!=3)
	{
		return  Un(bV,u);
	}
	if (pGlobal->xi[BV][0]&& ! IsUnitType(u,UNIT_TYPE_HERO))
	{
		return  0;
	}
	if (GetUnitAbilityLevel(u,pGlobal->ei[BV][0])>0)
	{
		un=pGlobal->Wr[BV][0];
	}
	while(true)
	{
		if ( i==pGlobal->Zr[BV][0]) break;
		if (GetUnitAbilityLevel(u,pGlobal->vi[BV][0]+i)>0)
		{
			un=un+pGlobal->E[i][0];
		}
		i=i+1;
	}
	return  un;
}

void fV()
{
	integer i;
	pGlobal->E[0][0]=1;
	pGlobal->X=1;
	pGlobal->V=Zn(1517831265,0xC,1517831213,false);
}

sMyString HCL_GetCommandString()
{
	return  pGlobal->O;
}

void FV()
{
	integer i;
	integer j;
	integer h;
	integer v;
	sMyString gV=sMyString("abcdefghijklmnopqrstuvwxyz0123456789 -=,.");
		sMyArray<integer[1],CONST_MAX_SIZE_MASS> GV;
		sMyArray<boolean[1],CONST_MAX_SIZE_MASS> hV;
	hV[0][0]=true;
	hV[50][0]=true;
	hV[60][0]=true;
	hV[70][0]=true;
	hV[80][0]=true;
	hV[90][0]=true;
	hV[100][0]=true;
	i=0;
	j=0;
	while(true)
	{
		if (hV[j][0])
		{
			j=j+1;
		}
		if ( j>=256) break;
		GV[j][0]=i;
		i=i+1;
		j=j+1;
	}
	i=0;
	while(true)
	{
		if ( i>=0xC) break;
		h=R2I(100*GetPlayerHandicap(Player(i))+.5);
		if (! hV[h][0])
		{
			h=GV[h][0];
			v=h/ 6;
			h=h-v*6;
			SetPlayerHandicap(Player(i),0.5+h/ 10.);
			pGlobal->O=pGlobal->O+fMySubString(gV,v,v+1);
		}
		i=i+1;
	}
}

void HV( unit jV, integer JV, player kV)
{
	texttag tt=CreateTextTag();
	sMyString KV=sMyString(0x2B)+fMyI2S(JV);
	SetTextTagText(tt,KV,.024);
	SetTextTagPos(tt,GetUnitX(jV)-16.,GetUnitY(jV),.0);
	SetTextTagColor(tt,0xFF,0xDC,0,0xFF);
	SetTextTagVelocity(tt,.0,.03);
	SetTextTagVisibility(tt,fMyGetLocalPlayer()==kV);
	SetTextTagFadepoint(tt,2.);
	SetTextTagLifespan(tt,3.);
	SetTextTagPermanent(tt,false);
	KV=NULL;
	tt=NULL;
}

timer lV( integer yn)
{
	if (pGlobal->A==0)
	{
		if (! pGlobal->B)
		{
			TriggerEvaluate(pGlobal->In[(1)][0]);
			pGlobal->A=pGlobal->A-1;
		}
		else 
		{
			pGlobal->Ya[0][0]=CreateTimer();
		}
	}
	else 
	{
		pGlobal->A=pGlobal->A-1;
	}
	SaveInteger(pGlobal->I,0,GetHandleId((pGlobal->Ya[pGlobal->A][0])),(yn));
	return  pGlobal->Ya[pGlobal->A][0];
}

timer NewTimer()
{
	return  lV(0);
}

void LV( timer t)
{
	if (t==NULL)
	{
		return ;
	}
	if (pGlobal->A==8190)
	{
		DestroyTimer(t);
	}
	else 
	{
		PauseTimer(t);
		if ((LoadInteger(pGlobal->I,0,GetHandleId((t))))==pGlobal->N)
		{
			return ;
		}
		SaveInteger(pGlobal->I,0,GetHandleId((t)),(pGlobal->N));
		pGlobal->Ya[pGlobal->A][0]=t;
		pGlobal->A=pGlobal->A+1;
	}
}

void mV()
{
	integer i=0;
	integer o=-1;
	boolean oops=false;
	if (pGlobal->B)
	{
		return ;
	}
	else 
	{
		pGlobal->B=true;
	}
	pGlobal->I=InitHashtable();
	while(true)
	{
		if ((i==256)) break;
		pGlobal->Ya[i][0]=CreateTimer();
		SaveInteger(pGlobal->I,0,GetHandleId((pGlobal->Ya[i][0])),(pGlobal->N));
		i=i+1;
	}
	pGlobal->A=256;
}

void MV( sMyString s)
{
}

void PV( unit qV, unitstate QV, real sV)
{
	integer SV;
	integer vV;
	integer tV;
	integer TV;
	integer uV;
	if (QV==UNIT_STATE_MAX_LIFE)
	{
		vV=1517833313;
		if (sV<1)
		{
			MV(sMyString("You can not set a unit's max life to below 1"));
			return ;
		}
	}
	else if(QV==UNIT_STATE_MAX_MANA)
	{
		vV=1517833569;
		if (sV<0)
		{
			MV(sMyString("You can not set a unit's max mana to below 0"));
			return ;
		}
	}
	else 
	{
		SetUnitState(qV,QV,sV);
		return ;
	}
	SV=R2I(sV)-R2I(GetUnitState(qV,QV));
	if (SV<0)
	{
		SV=-SV;
		vV=vV+5;
	}
	tV=5-1;
	TV=4;
	uV=vV+tV;
	while(true)
	{
		if ( SV==0) break;
		if (SV>=pGlobal->C[tV*3+(TV-2)][0])
		{
			UnitAddAbility(qV,uV);
			SetUnitAbilityLevel(qV,uV,TV);
			UnitRemoveAbility(qV,uV);
			SV=SV-pGlobal->C[tV*3+(TV-2)][0];
		}
		else 
		{
			TV=TV-1;
			if (TV<=1)
			{
				tV=tV-1;
				TV=4;
				uV=vV+tV;
			}
		}
	}
}

void UV()
{
	integer i;
	integer k;
	i=1;
	pGlobal->C[0][0]=1;
	while(true)
	{
		if ( i==5*2*2*3+1) break;
		pGlobal->C[i][0]=pGlobal->C[i-1][0]*2;
		i=i+1;
	}
}

void wV()
{
	while(true)
	{
		if ( pGlobal->Y==0) break;
		pGlobal->Y=pGlobal->Y-1;
		SetWidgetLife(pGlobal->w[pGlobal->Y][0],GetWidgetLife(pGlobal->w[pGlobal->Y][0])+pGlobal->W[pGlobal->Y][0]);
		pGlobal->w[pGlobal->Y][0]=NULL;
	}
}

void WV( unit u, real yV)
{
	real YV=GetWidgetLife(u);
	real zV=GetUnitState(u,UNIT_STATE_MAX_LIFE);
	if (YV<yV+1)
	{
		if (YV+yV>zV)
		{
			SetWidgetLife(u,zV);
			pGlobal->w[pGlobal->Y][0]=u;
			pGlobal->W[pGlobal->Y][0]=YV+yV-zV;
			pGlobal->Y=pGlobal->Y+1;
			TimerStart(pGlobal->U,.0,false,& wV);
		}
		else 
		{
			SetWidgetLife(u,YV+yV);
		}
	}
	else if(YV+yV>zV)
	{
		pGlobal->w[pGlobal->Y][0]=u;
		pGlobal->W[pGlobal->Y][0]=yV;
		pGlobal->Y=pGlobal->Y+1;
		TimerStart(pGlobal->U,.0,false,& wV);
	}
	else 
	{
		SetWidgetLife(u,YV+yV);
	}
}

integer ZV( sMyString s, integer a, integer b)
{
	sMyString vE=sMyString("0123456789ABCDEF");
	sMyString eE=sMyString("0123456789abcdef");
	integer i;
	integer r=0;
	sMyString c;
	while(true)
	{
		if ( a>=b) break;
		c=fMySubString(s,a,a+1);
		i=0;
		while(true)
		{
			if ( i>=16) break;
			if ( c==fMySubString(vE,i,i+1)) break;
			if ( c==fMySubString(eE,i,i+1)) break;
			i=i+1;
		}
		if (i>=16)
		{
			i=0;
		}
		r=r*16+i;
		a=a+1;
	}
	return  r;
}

integer xE( sMyString oE)
{
	integer c=Sn();
	pGlobal->Ei[c][0]=sMyString("|cff")+oE;
	pGlobal->ai[c][0]=ZV(oE,0,2);
	pGlobal->ni[c][0]=ZV(oE,0,4);
	pGlobal->Vi[c][0]=ZV(oE,0,6);
	return  c;
}

void rE()
{
	pGlobal->z[0][0]=xE(sMyString("FF0303"));
	pGlobal->z[1][0]=xE(sMyString("0042FF"));
	pGlobal->z[2][0]=xE(sMyString("1CE6B9"));
	pGlobal->z[3][0]=xE(sMyString("540081"));
	pGlobal->z[4][0]=xE(sMyString("FFFC00"));
	pGlobal->z[5][0]=xE(sMyString("FE8A0E"));
	pGlobal->z[6][0]=xE(sMyString("20C000"));
	pGlobal->z[7][0]=xE(sMyString("E55BB0"));
	pGlobal->z[8][0]=xE(sMyString("959697"));
	pGlobal->z[9][0]=xE(sMyString("7FBFF1"));
	pGlobal->z[0xA][0]=xE(sMyString("106246"));
	pGlobal->z[0xB][0]=xE(sMyString("492A04"));
	pGlobal->z[0xC][0]=xE(sMyString("FFFFFF"));
}

void iE()
{
	integer i=0;
	while(true)
	{
		if ( i>=pGlobal->vv) break;
		pGlobal->ev[i][0]=pGlobal->ev[i][0]-1;
		if (pGlobal->ev[i][0]==0)
		{
			KillUnit(pGlobal->Z[i][0]);
			pGlobal->vv=pGlobal->vv-1;
			pGlobal->Z[i][0]=pGlobal->Z[pGlobal->vv][0];
			pGlobal->ev[i][0]=pGlobal->ev[pGlobal->vv][0];
			pGlobal->Z[pGlobal->vv][0]=NULL;
		}
		else 
		{
			i=i+1;
		}
	}
	if (pGlobal->vv==0)
	{
		PauseTimer(pGlobal->xv);
	}
}

unit aE( player p, real x, real y)
{
	pGlobal->Z[pGlobal->vv][0]=CreateUnit(p,1751414125,x,y,0);
	pGlobal->ev[pGlobal->vv][0]=5;
	if (pGlobal->vv==0)
	{
		TimerStart(pGlobal->xv,1.,true,& iE);
	}
	pGlobal->vv=pGlobal->vv+1;
	return  pGlobal->Z[pGlobal->vv-1][0];
}

void nE( player p, unit u, integer id, sMyString VE)
{
	unit d=aE(p,GetUnitX(u),GetUnitY(u));
	UnitAddAbility(d,id);
	IssueTargetOrder(d,VE,u);
	d=NULL;
}

void EE()
{
	pGlobal->ov=InitHashtable();
}

void XE( real OE, sMyString RE)
{
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),.0,.0,OE,RE);
}

integer IE( unit u)
{
	integer uh=Qn();
	pGlobal->Ii[uh][0]=u;
	return  uh;
}

integer AE( unit u, effect e)
{
	integer NE=Pn();
	pGlobal->Bi[NE][0]=u;
	pGlobal->ci[NE][0]=e;
	return  NE;
}

integer bE( integer BE)
{
	integer cE=fMyStringHash(GetPlayerName(Player(BE)));
	integer id;
	if (HaveSavedInteger(pGlobal->av,0,cE))
	{
		id=LoadInteger(pGlobal->av,0,cE);
		if (StringCase(GetObjectName(id),false)==StringCase(GetPlayerName(Player(BE)),false))
		{
			return  id;
		}
	}
	return  1747988784;
}

void CE()
{
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("caesio"))),(1747988813));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("cheekything"))),(1747988806));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("daveazocier"))),(1747988825));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("deja_"))),(1749889076));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("loathed"))),(1747989042));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("king_crusher"))),(1749889074));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("shadowly"))),(1749889075));
	SaveInteger(pGlobal->av,0,fMyStringHash((sMyString("wbc]stormraider"))),(1747989043));
}

trigger dE()
{
	pGlobal->nv[pGlobal->Vv][0]=CreateTrigger();
	pGlobal->Vv=pGlobal->Vv+1;
	return  pGlobal->nv[pGlobal->Vv-1][0];
}

void DE()
{
	integer i;
	i=(0)-1;
	while(true)
	{
		i=i+1;
		if ( i>(pGlobal->Vv)) break;
		DisableTrigger(pGlobal->nv[i][0]);
	}
}

sMyString fE( real t)
{
	integer it=R2I(t);
	integer m=it/ 60;
	integer s=it-m*60;
	if (s<0xA)
	{
		return  fMyI2S(m)+sMyString(":0")+fMyI2S(s);
	}
	else 
	{
		return  fMyI2S(m)+sMyString(0x3A)+fMyI2S(s);
	}
}

sMyString FE( real t)
{
	integer it=R2I(t);
	integer m=it/ 60;
	integer s=it-m*60;
	integer ms=R2I(1000.0*(t-it));
	if (s<0xA)
	{
		return  fMyI2S(m)+sMyString(":0")+fMyI2S(s)+sMyString("|cff444444.")+fMyI2S(ms)+sMyString("|r");
	}
	else 
	{
		return  fMyI2S(m)+sMyString(0x3A)+fMyI2S(s)+sMyString("|cff444444.")+fMyI2S(ms)+sMyString("|r");
	}
}

void gE( trigger GE, playerevent hE)
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerEvent(GE,Player(i),hE);
		i=i+1;
	}
}

void HE( trigger GE, playerunitevent hE, boolexpr jE)
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerUnitEvent(GE,Player(i),hE,jE);
		i=i+1;
	}
}

void JE( trigger GE, sMyString kE, boolean KE)
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerChatEvent(GE,Player(i),kE,KE);
		i=i+1;
	}
}

boolean lE( unit u)
{
	return  true;
}

boolean LE()
{
	if (lE(GetSpellAbilityUnit())&& pGlobal->Ev[GetSpellAbilityId()-1093677104][0]!=0)
	{
		TriggerEvaluate(pGlobal->In[(pGlobal->Ev[GetSpellAbilityId()-1093677104][0])][0]);
	}
	return  false;
}

boolean mE()
{
	if (lE(GetSpellAbilityUnit())&& pGlobal->Xv[GetSpellAbilityId()-1093677104][0]!=0)
	{
		TriggerEvaluate(pGlobal->In[(pGlobal->Xv[GetSpellAbilityId()-1093677104][0])][0]);
	}
	return  false;
}

boolean ME()
{
	if (lE(GetSpellAbilityUnit())&& pGlobal->Ov[GetSpellAbilityId()-1093677104][0]!=0)
	{
		TriggerEvaluate(pGlobal->In[(pGlobal->Ov[GetSpellAbilityId()-1093677104][0])][0]);
	}
	return  false;
}

boolean pE()
{
	if (lE(GetSpellAbilityUnit())&& pGlobal->Rv[GetSpellAbilityId()-1093677104][0]!=0)
	{
		TriggerEvaluate(pGlobal->In[(pGlobal->Rv[GetSpellAbilityId()-1093677104][0])][0]);
	}
	return  false;
}

void PE()
{
	integer i=0;
	trigger T;
	T=dE();
	i=0;
	while(true)
	{
		TriggerRegisterPlayerUnitEvent(T,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,NULL);
		i=i+1;
		if ( i==bj_MAX_PLAYER_SLOTS) break;
	}
	TriggerAddCondition(T,Condition(& LE));
	T=dE();
	i=0;
	while(true)
	{
		TriggerRegisterPlayerUnitEvent(T,Player(i),EVENT_PLAYER_UNIT_SPELL_CAST,NULL);
		i=i+1;
		if ( i==bj_MAX_PLAYER_SLOTS) break;
	}
	TriggerAddCondition(T,Condition(& mE));
	T=dE();
	i=0;
	while(true)
	{
		TriggerRegisterPlayerUnitEvent(T,Player(i),EVENT_PLAYER_UNIT_SPELL_FINISH,NULL);
		i=i+1;
		if ( i==bj_MAX_PLAYER_SLOTS) break;
	}
	TriggerAddCondition(T,Condition(& ME));
	T=dE();
	i=0;
	while(true)
	{
		TriggerRegisterPlayerUnitEvent(T,Player(i),EVENT_PLAYER_UNIT_SPELL_ENDCAST,NULL);
		i=i+1;
		if ( i==bj_MAX_PLAYER_SLOTS) break;
	}
	TriggerAddCondition(T,Condition(& pE));
}

void qE( unit u)
{
	integer BE=GetPlayerId(GetOwningPlayer(u));
	integer QE=GetHeroLevel(pGlobal->Oa[pGlobal->J[BE][0]][0]);
	integer id=GetUnitTypeId(u);
	if (pGlobal->Ea[pGlobal->J[BE][0]][0]==1)
	{
		return ;
	}
	PV(u,UNIT_STATE_MAX_LIFE,500+(QE*50));
	if (id==1848651852)
	{
		cV(u,pGlobal->V,QE*0xA);
	}
	if (QE>=30 && pGlobal->Iv)
	{
		if (id==1848651854)
		{
			UnitAddAbility(u,1093677639);
			UnitAddAbility(u,1093677638);
		}
	}
}

void sE( integer BE)
{
	player p=Player(BE);
	unit u;
	if (GetHeroLevel(pGlobal->Oa[pGlobal->J[BE][0]][0])<30)
	{
		return ;
	}
	SetPlayerAbilityAvailable(p,1093743159,false);
	SetPlayerAbilityAvailable(p,1093743160,false);
	GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(1848651854),NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ((u==NULL)) break;
		if (GetOwningPlayer(u)==p)
		{
			UnitAddAbility(u,1093677639);
			UnitAddAbility(u,1093677638);
		}
		GroupRemoveUnit(pGlobal->rv,u);
		u=FirstOfGroup(pGlobal->rv);
	}
}

void SE( player p, integer QE)
{
	unit u;
	if (QE>=30)
	{
		AddPlayerTechResearched(p,1378889806,1);
	}
	if (QE>=30 && pGlobal->Iv)
	{
		SetPlayerAbilityAvailable(p,1093743159,false);
		SetPlayerAbilityAvailable(p,1093743160,false);
	}
	GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(1848651852),NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ((u==NULL)) break;
		if (GetOwningPlayer(u)==p)
		{
			PV(u,UNIT_STATE_MAX_LIFE,500+(QE*50));
			cV(u,pGlobal->V,QE*0xA);
		}
		GroupRemoveUnit(pGlobal->rv,u);
		u=FirstOfGroup(pGlobal->rv);
	}
	if (QE>=30 && pGlobal->Iv)
	{
		GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(1848651854),NULL);
		u=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ((u==NULL)) break;
			if (GetOwningPlayer(u)==p)
			{
				UnitAddAbility(u,1093677639);
				UnitAddAbility(u,1093677638);
			}
			GroupRemoveUnit(pGlobal->rv,u);
			u=FirstOfGroup(pGlobal->rv);
		}
	}
	GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(1848651854),NULL);
	GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(1848651855),NULL);
	GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(1848651851),NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ((u==NULL)) break;
		if (GetOwningPlayer(u)==p)
		{
			PV(u,UNIT_STATE_MAX_LIFE,500+(QE*50));
		}
		GroupRemoveUnit(pGlobal->rv,u);
		u=FirstOfGroup(pGlobal->rv);
	}
}

boolean tE()
{
	integer i=0;
	pGlobal->Iv=true;
	while(true)
	{
		if ((i>=0xC)) break;
		SetPlayerTechResearched(Player(i),1378889812,1);
		if (pGlobal->Ea[pGlobal->J[i][0]][0]!=1)
		{
			sE(i);
		}
		i=i+1;
	}
	return  false;
}

void TE()
{
	trigger T=dE();
	TriggerRegisterTimerEvent(T,900,false);
	TriggerAddCondition(T,Condition(& tE));
}

void uE()
{
	player p=Player((LoadInteger(pGlobal->I,0,GetHandleId((GetExpiredTimer())))));
	unit u;
	GroupEnumUnitsOfPlayer(pGlobal->rv,p,NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ((u==NULL)) break;
		if (GetUnitTypeId(u)==1752528689&&(GetUnitCurrentOrder(u)==0|| GetUnitCurrentOrder(u)==0xD0004))
		{
			IssueImmediateOrderById(u,0xD0036);
		}
		GroupRemoveUnit(pGlobal->rv,u);
		u=FirstOfGroup(pGlobal->rv);
	}
	LV(GetExpiredTimer());
}

boolean UE()
{
	integer wE=GetResearched();
	unit u;
	if (wE==1378889810)
	{
		GroupEnumUnitsOfPlayer(pGlobal->rv,GetOwningPlayer(GetResearchingUnit()),NULL);
		u=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ((u==NULL)) break;
			if (GetUnitTypeId(u)==1752528689)
			{
				UnitRemoveAbility(u,1093677620);
				UnitAddAbility(u,1093677621);
			}
			GroupRemoveUnit(pGlobal->rv,u);
			u=FirstOfGroup(pGlobal->rv);
		}
		TimerStart(lV(GetPlayerId(GetOwningPlayer(GetResearchingUnit()))),.0,false,& uE);
	}
	return  false;
}

void WE()
{
	trigger T=dE();
	integer i;
	TriggerAddCondition(T,Condition(& UE));
	i=0;
	while(true)
	{
		if ( i>=0xC) break;
		TriggerRegisterPlayerUnitEvent(T,Player(i),EVENT_PLAYER_UNIT_RESEARCH_FINISH,NULL);
		i=i+1;
	}
}

void yE()
{
	timer t=GetExpiredTimer();
	pGlobal->Av=false;
	pGlobal->Nv=NULL;
	t=NULL;
}

void YE()
{
	timer t=GetExpiredTimer();
	UnitAddItemById(pGlobal->Nv,1227894852);
	pGlobal->Av=false;
	pGlobal->Nv=NULL;
	t=NULL;
}

boolean zE()
{
	timer t=CreateTimer();
	TimerStart(t,1.,false,& yE);
	if (GetSpellAbilityId()==1093677123)
	{
		pGlobal->Av=true;
		pGlobal->Nv=GetTriggerUnit();
	}
	t=NULL;
	return  false;
}

void ZE()
{
	timer t=CreateTimer();
	TimerStart(t,.0,false,& YE);
	t=NULL;
}

void vX()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_SPELL_CAST,NULL);
	TriggerAddCondition(eX,Condition(& zE));
	eX=NULL;
}

integer xX()
{
	if (pGlobal->f>1)
	{
		return  pGlobal->f/ 2+1;
	}
	else 
	{
		return  2;
	}
}

unit oX( player p)
{
	group g=CreateGroup();
	unit u;
	unit rc=NULL;
	GroupEnumUnitsOfType(g,UnitId2String(1966092362),NULL);
	while(true)
	{
		u=FirstOfGroup(g);
		if ( u==NULL) break;
		GroupRemoveUnit(g,u);
		if (GetOwningPlayer(u)==p)
		{
			rc=u;
		}
	}
	DestroyGroup(g);
	g=NULL;
	return  rc;
}

boolean rX( unit u)
{
	return  u!=NULL && IsUnitType(u,UNIT_TYPE_PEON)&& GetUnitTypeId(u)!=1747988561&& GetUnitTypeId(u)!=1747989040;
}

boolean iX( unit u)
{
	integer id;
	if (u==NULL)
	{
		return  false;
	}
	id=GetUnitTypeId(u);
	if (id==1160785969|| id==1160785970|| id==1096173142)
	{
		return  true;
	}
	else if(id==1429221431|| id==1429221432)
	{
		return  true;
	}
	else 
	{
		return  false;
	}
}

boolean aX( unit u)
{
	return  GetUnitTypeId(u)==1213430093|| GetUnitTypeId(u)==1211117900;
}

boolean nX( unit u)
{
	integer id=GetUnitTypeId(u);
	return  id==1752528689|| id==1752528690|| id==1747988535|| id==1747988545|| id==1747988555|| id==1747988564;
}

void VX()
{
	pGlobal->P=true;
	DE();
	StopMusic(true);
	StartSound(pGlobal->po);
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xE10,sMyString("|cFFFF0000The world is saved...|r"));
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xE10,sMyString("|cFFFF0000Get the latest version from http://fire.vampirism.eu/|r"));
	StartSound(pGlobal->Do);
}

void EX()
{
	pGlobal->P=true;
	DE();
	StopMusic(true);
	StartSound(pGlobal->so);
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xE10,sMyString("|cFFFF0000The world is doomed...|r"));
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xE10,sMyString("|cFFFF0000Get the latest version from http://fire.vampirism.eu/|r"));
	StartSound(pGlobal->Do);
}

void bloodlust__onBloodlust()
{
	nE(GetOwningPlayer(GetSpellTargetUnit()),GetSpellTargetUnit(),1093677398,sMyString("bloodlust"));
}

void bloodlust__onLol()
{
	nE(GetOwningPlayer(GetSpellTargetUnit()),GetSpellTargetUnit(),1093677364,sMyString("bloodlust"));
}

void XX()
{
	pGlobal->Xv[(1093677399)-1093677104][0]=((2));
	pGlobal->Xv[(1093677400)-1093677104][0]=((3));
}

void changeGender___onChangeGender()
{
	integer p=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit()));
	if (pGlobal->ca[pGlobal->J[p][0]][0]==1)
	{
		pGlobal->ca[pGlobal->J[p][0]][0]=2;
	}
	else 
	{
		pGlobal->ca[pGlobal->J[p][0]][0]=1;
	}
}

void OX()
{
	pGlobal->Xv[(1093677634)-1093677104][0]=((4));
}

void detonate___onDetonate()
{
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl"),GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit())));
	RemoveUnit(GetSpellAbilityUnit());
}

void RX()
{
	pGlobal->Xv[(1093677395)-1093677104][0]=((5));
}

void IX()
{
	KillUnit(pGlobal->Ii[((LoadInteger(pGlobal->I,0,GetHandleId((GetExpiredTimer())))))][0]);
	LV(GetExpiredTimer());
}

void infernalMeteorExplode__onMeteorExplode()
{
	unit u=GetSpellAbilityUnit();
	TimerStart(lV(IE(u)),.5,false,& IX);
	u=NULL;
}

void AX()
{
	pGlobal->Ev[(1093677623)-1093677104][0]=((6));
}

void NX( unit u, rect r)
{
	SetUnitPosition(u,GetRandomReal(GetRectMinX(r),GetRectMaxX(r)),GetRandomReal(GetRectMinY(r),GetRectMaxY(r)));
}

void bX()
{
	ResetTerrainFog();
	StopMusic(true);
}

void BX( real t, integer cX, real CX, real dX, real DX, real fX, real FX, real gX, sMyString GX)
{
	SetTerrainFogEx(cX,CX,dX,DX,fX,FX,gX);
	if (GX!=sMyString(0x02))
	{
		PlayThematicMusic(GX);
	}
	TimerStart(pGlobal->cv,t,false,& bX);
}

void hX( player p, sMyString s)
{
	sound HX=CreateSoundFromLabel(sMyString("InterfaceError"),false,false,false,0xA,0xA);
	if (fMyGetLocalPlayer()==p)
	{
		if (s!=sMyString(0x02) && s!=NULL)
		{
			ClearTextMessages();
			DisplayTimedTextToPlayer(p,.5,-1.,2.,sMyString("|cffffcc00")+s+sMyString("|r"));
		}
		StartSound(HX);
	}
	KillSoundWhenDone(HX);
}

sMyString jX( player p)
{
	integer d=pGlobal->J[GetPlayerId(p)][0];
	if (pGlobal->ca[d][0]==2)
	{
		return sMyString("her");
	}
	else 
	{
		return sMyString("his");
	}
}

void JX( unit u)
{
	if (! IsUnitType(u,UNIT_TYPE_DEAD))
	{
		if (IsUnitType(u,UNIT_TYPE_STRUCTURE))
		{
			DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl"),GetUnitX(u),GetUnitY(u)));
		}
		else 
		{
			DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl"),GetUnitX(u),GetUnitY(u)));
		}
	}
	RemoveUnit(u);
}

sMyString kX( player p)
{
	return  pGlobal->Ei[pGlobal->z[GetPlayerId(p)][0]][0]+pGlobal->Ra[pGlobal->J[GetPlayerId(p)][0]][0]+sMyString("|r");
}

sMyString KX( integer id)
{
	return  pGlobal->Ei[pGlobal->z[id][0]][0]+pGlobal->Ra[pGlobal->J[id][0]][0]+sMyString("|r");
}

void lX( player p, integer LX, integer mX)
{
	SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)+LX);
	SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)+mX);
}

player MX( sMyString s)
{
	integer i=0;
	integer j;
	sMyString o;
	s=StringCase(s,false);
	if (s==sMyString("red") || s==sMyString(0x31))
	{
		return  Player(0);
	}
	else if(s==sMyString("blue") || s==sMyString(0x32))
	{
		return  Player(1);
	}
	else if(s==sMyString("teal") || s==sMyString("cyan") || s==sMyString(0x33))
	{
		return  Player(2);
	}
	else if(s==sMyString("purple") || s==sMyString(0x34))
	{
		return  Player(3);
	}
	else if(s==sMyString("yellow") || s==sMyString(0x35))
	{
		return  Player(4);
	}
	else if(s==sMyString("orange") || s==sMyString(0x36))
	{
		return  Player(5);
	}
	else if(s==sMyString("green") || s==sMyString(0x37))
	{
		return  Player(6);
	}
	else if(s==sMyString("pink") || s==sMyString(0x38))
	{
		return  Player(7);
	}
	else if(s==sMyString("gray") || s==sMyString("grey") || s==sMyString(0x39))
	{
		return  Player(8);
	}
	else if(s==sMyString("light blue") || s==sMyString("lightblue") || s==sMyString("lb") || s==sMyString("10"))
	{
		return  Player(9);
	}
	else if(s==sMyString("dark green") || s==sMyString("darkgreen") || s==sMyString("dg") || s==sMyString("11"))
	{
		return  Player(0xA);
	}
	else if(s==sMyString("brown") || s==sMyString("12"))
	{
		return  Player(0xB);
	}
	while(true)
	{
		if ( i>0xB) break;
		j=0;
		o=StringCase(GetPlayerName(Player(i)),false);
		while(true)
		{
			if ( j>StringLength(o)-StringLength(s)) break;
			if (fMySubString(o,j,j+StringLength(s))==s)
			{
				return  Player(i);
			}
			j=j+1;
		}
		i=i+0xB;
	}
	return  NULL;
}

void pX( integer i)
{
	player p=fMyGetLocalPlayer();
	if (i!=0xC)
	{
		p=Player(i);
	}
	DisplayTimedTextToPlayer(p,0,0,20.,sMyString("There are ")+fMyI2S(pGlobal->D)+sMyString(" humans and ")+fMyI2S(pGlobal->f)+sMyString(" vampires in game, goldmine income is now ")+fMyI2S(xX()));
}

void PX( boolean qX)
{
	integer i=0;
	pGlobal->D=0;
	pGlobal->f=0;
	pGlobal->F=0;
	pGlobal->G=0;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Xa[pGlobal->J[i][0]][0]==1)
		{
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==1)
			{
				pGlobal->D=pGlobal->D+1;
			}
			else if(pGlobal->Ea[pGlobal->J[i][0]][0]==2)
			{
				pGlobal->G=pGlobal->G+1;
				pGlobal->f=pGlobal->f+1;
			}
			else if(pGlobal->Ea[pGlobal->J[i][0]][0]==3)
			{
				pGlobal->F=pGlobal->F+1;
				pGlobal->f=pGlobal->f+1;
			}
		}
		i=i+1;
	}
	if ((! pGlobal->P)&& pGlobal->L&& pGlobal->M)
	{
		if (pGlobal->D==0)
		{
			EX();
		}
		else if(pGlobal->f==0)
		{
			VX();
		}
		else 
		{
			if (qX)
			{
				pX(0xC);
			}
		}
	}
}

void QX()
{
	pGlobal->bv=pGlobal->bv+0x4D2;
	TimerStart(pGlobal->Bv,0x4D2,false,& QX);
}

real GameTime()
{
	return  pGlobal->bv+TimerGetElapsed(pGlobal->Bv);
}

void sX()
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		pGlobal->J[i][0]=kn();
		pGlobal->Ra[pGlobal->J[i][0]][0]=GetPlayerName(Player(i));
		i=i+1;
	}
	TimerStart(pGlobal->Bv,0x4D2,false,& QX);
	pGlobal->Q[0][0]=1160785969;
	pGlobal->Q[1][0]=1160785970;
	pGlobal->Q[2][0]=1096173142;
	pGlobal->S=3;
}

void rodTeleport__onTeleport()
{
	unit uC=GetSpellAbilityUnit();
	unit uT=GetSpellTargetUnit();
	unit uR;
	player pC=GetOwningPlayer(uC);
	boolean SX=false;
	if (uT==NULL)
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(pC,sMyString("You must target a friendly unit!"));
	}
	else 
	{
		GroupEnumUnitsInRange(pGlobal->rv,GetUnitX(uT),GetUnitY(uT),0x96,NULL);
		uR=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ( uR==NULL) break;
			GroupRemoveUnit(pGlobal->rv,uR);
			if (IsUnitType(uR,UNIT_TYPE_STRUCTURE)&& pGlobal->Ea[pGlobal->J[GetPlayerId(GetOwningPlayer(uR))][0]][0]==1)
			{
				SX=true;
			}
			uR=FirstOfGroup(pGlobal->rv);
		}
		if (SX)
		{
			IssueImmediateOrderById(uC,0xD0004);
			hX(pC,sMyString("You are trying to teleport too close to a human building!"));
		}
	}
	uC=NULL;
	uT=NULL;
}

void tX()
{
	pGlobal->Xv[(1093677649)-1093677104][0]=((7));
}

boolean TX()
{
	unit u;
	GroupEnumUnitsInRect(pGlobal->rv,pGlobal->ro,NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ( u==NULL) break;
		GroupRemoveUnit(pGlobal->rv,u);
		if (aX(u)&& GetUnitState(u,UNIT_STATE_LIFE)>0)
		{
			SetHeroLevel(u,GetHeroLevel(u)+1,true);
		}
		u=FirstOfGroup(pGlobal->rv);
	}
	return  false;
}

void uX()
{
	trigger T=dE();
	TriggerRegisterTimerEvent(T,60.,true);
	TriggerAddCondition(T,Condition(& TX));
}

void stopResearch__onStopResearch()
{
	unit u=GetSpellAbilityUnit();
	unit UX=(LoadUnitHandle(pGlobal->ov,GetHandleId((u)),(2)));
	unit wX;
	FlushChildHashtable(pGlobal->ov,GetHandleId((u)));
	ShowUnit(u,false);
	ShowUnit(UX,false);
	wX=CreateUnit(GetOwningPlayer(u),1750364771,GetUnitX(u),GetUnitY(u),GetUnitFacing(u));
	if (IsUnitSelected(u,GetOwningPlayer(u)))
	{
		if (fMyGetLocalPlayer()==GetOwningPlayer(u))
		{
			SelectUnit(wX,true);
		}
	}
	RemoveUnit(u);
	RemoveUnit(UX);
	UX=NULL;
	wX=NULL;
	u=NULL;
}

void WX()
{
	pGlobal->Xv[(1093677651)-1093677104][0]=((8));
}

void yX()
{
	timer t=GetExpiredTimer();
	integer NE=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	real x=GetRandomReal(GetRectMinX(pGlobal->no),GetRectMaxX(pGlobal->no));
	real y=GetRandomReal(GetRectMinY(pGlobal->no),GetRectMaxY(pGlobal->no));
	DestroyEffect(pGlobal->ci[NE][0]);
	if (!(IsUnitType(pGlobal->Bi[NE][0],UNIT_TYPE_DEAD)))
	{
		SetUnitPosition(pGlobal->Bi[NE][0],x,y);
	}
	qn(NE);
	LV(t);
}

void vampireRecall___onRecall()
{
	TimerStart(lV(AE(GetSpellAbilityUnit(),AddSpecialEffectTarget(sMyString("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl"),GetSpellAbilityUnit(),sMyString("origin")))),10.,false,& yX);
}

void YX()
{
	pGlobal->Xv[(1093677616)-1093677104][0]=((9));
}

void vampireTrap__onTrap()
{
	unit uC=GetSpellAbilityUnit();
	real x=GetSpellTargetX();
	real y=GetSpellTargetY();
	rect r=pGlobal->io;
	player pC=GetOwningPlayer(uC);
	if (x>=GetRectMinX(r)&& x<=GetRectMaxX(r)&& y>=GetRectMinY(r)&& y<=GetRectMaxY(r))
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(pC,sMyString("You cannot place Vampire Traps in the Slayer Pool!"));
	}
	uC=NULL;
}

void zX()
{
	pGlobal->Xv[(1093677650)-1093677104][0]=((0xA));
}

void ZX()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	IssuePointOrderById((LoadUnitHandle(pGlobal->ov,GetHandleId((pGlobal->Ii[uh][0])),(1))),0xD010E,(LoadReal(pGlobal->ov,GetHandleId((pGlobal->Ii[uh][0])),(2))),(LoadReal(pGlobal->ov,GetHandleId((pGlobal->Ii[uh][0])),(3))));
	sn(uh);
	LV(t);
}

void volcanicStrike___onVolcanicStrike()
{
	unit uC=GetSpellAbilityUnit();
	unit qV;
	player pC=GetOwningPlayer(uC);
	SaveReal(pGlobal->ov,GetHandleId((uC)),(2),((GetSpellTargetX())*1.));
	SaveReal(pGlobal->ov,GetHandleId((uC)),(3),((GetSpellTargetY())*1.));
	TimerStart(lV(IE(uC)),5.,false,& ZX);
	uC=NULL;
	qV=NULL;
}

void vO()
{
	pGlobal->Xv[(1093677658)-1093677104][0]=((0xB));
}

boolean eO()
{
	unit u=GetDyingUnit();
	player p=GetOwningPlayer(GetKillingUnit());
	integer xO=GetPlayerId(p);
	integer oO=GetUnitUserData(u);
	integer JV=GetUnitPointValue(u);
	if (JV>5)
	{
		JV=5;
	}
	if (pGlobal->Ea[pGlobal->J[xO][0]][0]!=1)
	{
		HV(GetDyingUnit(),JV,p);
		lX(p,JV,0);
		pGlobal->H=pGlobal->H+JV;
		pGlobal->ga[pGlobal->J[oO][0]][0]=pGlobal->ga[pGlobal->J[oO][0]][0]+JV;
		pGlobal->ha[pGlobal->J[xO][0]][0]=pGlobal->ha[pGlobal->J[xO][0]][0]+JV;
	}
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl"),GetUnitX(u),GetUnitY(u)));
	ShowUnit(u,false);
	return  false;
}

void rO()
{
	trigger T=CreateTrigger();
	TriggerRegisterPlayerUnitEvent(T,Player(bj_PLAYER_NEUTRAL_VICTIM),EVENT_PLAYER_UNIT_DEATH,NULL);
	TriggerAddCondition(T,Condition(& eO));
}

boolean iO()
{
	if (aX(GetEventDamageSource()))
	{
		KillUnit(GetTriggerUnit());
	}
	return  false;
}

void aO()
{
	TriggerAddCondition(pGlobal->Cv,Condition(& iO));
}

void nO()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	UnitRemoveAbility(pGlobal->Ii[uh][0],1095200356);
	sn(uh);
	LV(t);
}

void VO()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	UnitRemoveAbility(pGlobal->Ii[uh][0],1094874470);
	UnitRemoveAbility(pGlobal->Ii[uh][0],1111977572);
	sn(uh);
	LV(t);
}

void chainOfDeath__onChainEffect()
{
	unit uT=GetSpellTargetUnit();
	unit u;
	GroupEnumUnitsInRange(pGlobal->rv,GetUnitX(uT),GetUnitY(uT),200.,NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ( u==NULL) break;
		GroupRemoveUnit(pGlobal->rv,u);
		if (rX(u))
		{
			if (GetUnitAbilityLevel(u,1111977572)>0)
			{
				if (pGlobal->ja[(pGlobal->J[GetPlayerId((GetOwningPlayer(GetSpellAbilityUnit())))][0])][0])
				{
					DisplayTextToPlayer(GetOwningPlayer(GetSpellAbilityUnit()),.0,.0,sMyString("placing grounded resistance buff on ")+fMyGetUnitName(u));
				}
				UnitAddAbility(u,1095200356);
				UnitMakeAbilityPermanent(u,true,1095200356);
				TimerStart(lV(IE(u)),.0,false,& nO);
			}
			else if(GetUnitAbilityLevel(u,1111977572)==0)
			{
				if (pGlobal->ja[(pGlobal->J[GetPlayerId((GetOwningPlayer(GetSpellAbilityUnit())))][0])][0])
				{
					DisplayTextToPlayer(GetOwningPlayer(GetSpellAbilityUnit()),.0,.0,fMyGetUnitName(u)+sMyString(" was grounded"));
				}
				UnitAddAbility(u,1094874470);
				UnitMakeAbilityPermanent(u,true,1094874470);
				TimerStart(lV(IE(u)),8.,false,& VO);
			}
		}
		u=FirstOfGroup(pGlobal->rv);
	}
	uT=NULL;
}

void EO()
{
	pGlobal->Ev[(1093677647)-1093677104][0]=((0xC));
}

void cyclone__onCyclone()
{
	unit uC=GetSpellAbilityUnit();
	if (iX(GetSpellTargetUnit()))
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(GetOwningPlayer(uC),sMyString("You cannot cyclone vampires!"));
	}
	uC=NULL;
}

void XO()
{
	pGlobal->Xv[(1093677648)-1093677104][0]=((0xD));
}

boolean OO()
{
	boolean b=!(pGlobal->ja[(pGlobal->J[GetPlayerId((GetTriggerPlayer()))][0])][0]);
	pGlobal->ja[(pGlobal->J[GetPlayerId((GetTriggerPlayer()))][0])][0]=b;
	if (fMyGetLocalPlayer()!=GetTriggerPlayer())
	{
		return  false;
	}
	if (b)
	{
		DisplayTextToPlayer(fMyGetLocalPlayer(),.0,.0,sMyString("Debug information enabled"));
	}
	else 
	{
		DisplayTextToPlayer(fMyGetLocalPlayer(),.0,.0,sMyString("Debug information disabled"));
	}
	return  false;
}

void RO()
{
	trigger eX=dE();
	integer i=0;
	while(true)
	{
		if ((i>0xB)) break;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-debuginfo"),true);
		i=i+1;
	}
	TriggerAddCondition(eX,Condition(& OO));
}

void IO()
{
	integer AO=xX();
	integer i;
	unit u;
	GroupEnumUnitsOfType(pGlobal->rv,UnitId2String(pGlobal->dv),NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ( u==NULL) break;
		GroupRemoveUnit(pGlobal->rv,u);
		i=GetPlayerId(GetOwningPlayer(u));
		pGlobal->za[i][0]=pGlobal->za[i][0]+1;
		u=FirstOfGroup(pGlobal->rv);
	}
	i=0;
	while(true)
	{
		if ((i>=0xA)) break;
		if (pGlobal->za[i][0]!=0)
		{
			SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,AO*pGlobal->za[i][0]+GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD));
			pGlobal->za[i][0]=0;
		}
		i=i+1;
	}
}

void NO()
{
	pGlobal->dv=1749182317;
	IO();
}

void bO()
{
	pGlobal->dv=1747988532;
	IO();
}

void BO()
{
	pGlobal->dv=1747988559;
	IO();
}

void cO()
{
	pGlobal->dv=1747988793;
	IO();
}

void CO()
{
	TimerStart(CreateTimer(),60.,true,& NO);
	TimerStart(CreateTimer(),15.,true,& bO);
	TimerStart(CreateTimer(),6.,true,& BO);
	TimerStart(CreateTimer(),4.,true,& cO);
}

boolean dO()
{
	unit u;
	player p=GetOwningPlayer(GetBuyingUnit());
	integer id=GetUnitTypeId(GetSoldUnit());
	if (pGlobal->Ea[pGlobal->J[GetPlayerId(p)][0]][0]==1 && id==1848651852 || id==1848651847)
	{
		hX(p,sMyString("Only vampires can hire Infernals."));
		u=GetSoldUnit();
		SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetUnitGoldCost(GetUnitTypeId(u))+GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD));
		RemoveUnit(u);
		u=NULL;
	}
	return  false;
}

void DO()
{
	trigger T=dE();
	TriggerRegisterPlayerUnitEvent(T,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_SELL,NULL);
	TriggerAddCondition(T,Condition(& dO));
}

integer fO( sMyString FO)
{
	integer b=Mn();
	pGlobal->ji[b][0]=pGlobal->Dv;
	pGlobal->Ji[b][0]=FO;
	pGlobal->ki[b][0]=CreateTimer();
	pGlobal->Dv=b;
	SaveInteger(pGlobal->ov,GetHandleId((pGlobal->ki[b][0])),(0),(b));
	return  b;
}

void gO( integer b, rect r)
{
	integer rc=pn();
	pGlobal->Fi[rc][0]=r;
	pGlobal->fi[rc][0]=pGlobal->Hi[b][0];
	pGlobal->Hi[b][0]=rc;
}

boolean GO( integer b, real x, real y)
{
	integer rc=pGlobal->Hi[b][0];
	while(true)
	{
		if ( rc==0) break;
		if (x>=GetRectMinX(pGlobal->Fi[rc][0])&& x<=GetRectMaxX(pGlobal->Fi[rc][0])&& y>=GetRectMinY(pGlobal->Fi[rc][0])&& y<=GetRectMaxY(pGlobal->Fi[rc][0]))
		{
			return  true;
		}
		rc=pGlobal->fi[rc][0];
	}
	return  false;
}

integer hO( real x, real y)
{
	integer b=pGlobal->Dv;
	while(true)
	{
		if ( b==0) break;
		if (GO(b,x,y))
		{
			return  b;
		}
		b=pGlobal->ji[b][0];
	}
	return  0;
}

void HO( integer b)
{
	group g;
	unit u;
	if (pGlobal->Ki[b][0]!=NULL)
	{
		g=CreateGroup();
		GroupEnumUnitsOfType(g,UnitId2String(1749445735),NULL);
		while(true)
		{
			u=FirstOfGroup(g);
			if ( u==NULL) break;
			GroupRemoveUnit(g,u);
			if (GetOwningPlayer(u)==pGlobal->Ki[b][0]&& GO(b,GetUnitX(u),GetUnitY(u)))
			{
				RemoveUnit(u);
			}
		}
		DestroyGroup(g);
		g=NULL;
	}
	pGlobal->Ki[b][0]=NULL;
	pGlobal->li[b][0]=0;
}

integer jO( player p)
{
	integer b=pGlobal->Dv;
	while(true)
	{
		if ( b==0) break;
		if (pGlobal->Ki[b][0]==p)
		{
			return  b;
		}
		b=pGlobal->ji[b][0];
	}
	return  0;
}

void JO( integer b, real kO)
{
	integer KO;
	if (pGlobal->Hi[b][0]!=0&& pGlobal->Fi[pGlobal->Hi[b][0]][0]!=NULL)
	{
		if (pGlobal->Ea[(pGlobal->J[GetPlayerId((fMyGetLocalPlayer()))][0])][0]==1&& pGlobal->Ki[b][0]!=NULL)
		{
			KO=pGlobal->z[GetPlayerId(pGlobal->Ki[b][0])][0];
			PingMinimapEx(GetRectCenterX(pGlobal->Fi[pGlobal->Hi[b][0]][0]),GetRectCenterY(pGlobal->Fi[pGlobal->Hi[b][0]][0]),kO,pGlobal->ai[KO][0],pGlobal->ni[KO][0],pGlobal->Vi[KO][0],false);
		}
	}
}

void lO( real kO)
{
	integer b=pGlobal->Dv;
	while(true)
	{
		if ( b==0) break;
		JO(b,kO);
		b=pGlobal->ji[b][0];
	}
}

void LO( integer b, player p, integer mO)
{
	integer i=0;
	HO(b);
	if (pGlobal->Ki[b][0]==NULL)
	{
		pGlobal->Ki[b][0]=p;
		pGlobal->li[b][0]=mO;
		while(true)
		{
			if ( i>0xF) break;
			pGlobal->Li[pGlobal->mi[b][0]+i][0]=false;
			i=i+1;
		}
		if (mO>=2)
		{
			JO(b,3.);
		}
		else 
		{
			JO(b,1.);
		}
		pGlobal->Li[pGlobal->mi[b][0]+GetPlayerId(p)][0]=true;
	}
}

boolean MO( integer b, player p)
{
	return  b==0|| pGlobal->Ki[b][0]==NULL || pGlobal->Li[pGlobal->mi[b][0]+GetPlayerId(p)][0]|| pGlobal->li[b][0]<2;
}

void pO( player p)
{
	integer b=jO(p);
	if (b!=0)
	{
		HO(b);
	}
}

boolean PO()
{
	unit u=GetConstructingStructure();
	integer b=hO(GetUnitX(u),GetUnitY(u));
	integer o;
	player p=GetOwningPlayer(u);
	if (pGlobal->Ea[(pGlobal->J[GetPlayerId((p))][0])][0]!=1)
	{
		return  false;
	}
	if (! MO(b,p))
	{
		if (pGlobal->Av)
		{
			ZE();
		}
		else 
		{
			lX(p,GetUnitGoldCost(GetUnitTypeId(u)),GetUnitWoodCost(GetUnitTypeId(u)));
		}
		JX(u);
		DisplayTextToPlayer(p,0,0,kX(pGlobal->Ki[b][0])+sMyString(" has claimed this base!"));
	}
	else if(b!=0&& pGlobal->Ki[b][0]==NULL)
	{
		o=jO(p);
		if (o!=0&&(GetUnitTypeId(u)==1749445735|| pGlobal->li[o][0]<2))
		{
			HO(o);
			o=0;
		}
		if (o==0)
		{
			if (GetUnitTypeId(u)==1749445735)
			{
				LO(b,p,2);
				if (IsPlayerAlly(fMyGetLocalPlayer(),p))
				{
					DisplayTextToPlayer(fMyGetLocalPlayer(),0,0,kX(p)+sMyString(" has claimed base ")+pGlobal->Ji[b][0]+sMyString(0x21));
				}
			}
			else 
			{
				LO(b,p,1);
			}
		}
	}
	else if(GetUnitTypeId(u)==1749445735&&(b!=0 && pGlobal->Ki[b][0]==p&& pGlobal->li[b][0]<2))
	{
		pGlobal->li[b][0]=2;
		if (IsPlayerAlly(fMyGetLocalPlayer(),p))
		{
			DisplayTextToPlayer(fMyGetLocalPlayer(),0,0,kX(p)+sMyString(" has claimed base ")+pGlobal->Ji[b][0]+sMyString(0x21));
			JO(b,3.);
		}
	}
	else if(GetUnitTypeId(u)==1749445735&&(b==0 || pGlobal->Ki[b][0]!=p))
	{
		lX(p,GetUnitGoldCost(GetUnitTypeId(u)),GetUnitWoodCost(GetUnitTypeId(u)));
		JX(u);
		DisplayTextToPlayer(p,0,0,sMyString("You can only build the ")+fMyGetUnitName(u)+sMyString(" in your own base!"));
	}
	u=NULL;
	p=NULL;
	return  false;
}

boolean qO()
{
	player p=GetTriggerPlayer();
	sMyString s=StringCase(GetEventPlayerChatString(),false);
	player o;
	integer b=jO(p);
	if (b==0)
	{
		p=NULL;
		return  false;
	}
	if (s==sMyString("-unclaim"))
	{
		HO(b);
	}
	else if(fMySubString(s,0,7)==sMyString("-allow "))
	{
		s=fMySubString(s,7,StringLength(s));
		o=MX(s);
		if (o==NULL || pGlobal->Ea[(pGlobal->J[GetPlayerId((o))][0])][0]!=1)
		{
			DisplayTextToPlayer(p,0,0,sMyString("Cannot allow this player!"));
		}
		else 
		{
			if (! pGlobal->Li[pGlobal->mi[b][0]+GetPlayerId(o)][0])
			{
				DisplayTextToPlayer(o,0,0,kX(p)+sMyString(" has allowed you to build in his/her base."));
				DisplayTextToPlayer(p,0,0,sMyString("You have allowed ")+kX(o)+sMyString(" to build in your base."));
			}
			else 
			{
				DisplayTextToPlayer(p,0,0,sMyString("You have already allowed ")+kX(o)+sMyString(" to build in your base."));
			}
			pGlobal->Li[pGlobal->mi[b][0]+GetPlayerId(o)][0]=true;
		}
	}
	else if(fMySubString(s,0,9)==sMyString("-unallow "))
	{
		s=fMySubString(s,9,StringLength(s));
		o=MX(s);
		if (o==NULL || pGlobal->Ea[(pGlobal->J[GetPlayerId((o))][0])][0]!=1)
		{
			DisplayTextToPlayer(p,0,0,sMyString("Cannot unallow this player!"));
		}
		else 
		{
			if (pGlobal->Li[pGlobal->mi[b][0]+GetPlayerId(o)][0])
			{
				DisplayTextToPlayer(o,0,0,kX(p)+sMyString(" has denied your ability to build in his/her base."));
				DisplayTextToPlayer(p,0,0,sMyString("You have denied ")+kX(p)+sMyString("'s ability to build in your base."));
			}
			else 
			{
				DisplayTextToPlayer(p,0,0,kX(p)+sMyString(" was not allowed to build in your base."));
			}
			pGlobal->Li[pGlobal->mi[b][0]+GetPlayerId(o)][0]=false;
		}
	}
	p=NULL;
	o=NULL;
	return  false;
}

void QO()
{
	timer t=GetExpiredTimer();
	integer b=(LoadInteger(pGlobal->ov,GetHandleId((t)),(0)));
	player p=(LoadPlayerHandle(pGlobal->ov,GetHandleId((t)),(1)));
	unit u=pGlobal->Oa[(pGlobal->J[GetPlayerId((p))][0])][0];
	if (rX(u)&& GO(b,GetUnitX(u),GetUnitY(u)))
	{
		LO(b,p,1);
		if (IsPlayerAlly(fMyGetLocalPlayer(),p))
		{
			DisplayTextToPlayer(fMyGetLocalPlayer(),0,0,pGlobal->Ji[b][0]+sMyString(" has been reclaimed by ")+kX(p)+sMyString(0x2E));
		}
	}
	PauseTimer(t);
	t=NULL;
	p=NULL;
}

boolean sO()
{
	unit u=GetDyingUnit();
	player p=GetOwningPlayer(u);
	integer b=jO(p);
	unit h=pGlobal->Oa[(pGlobal->J[GetPlayerId((p))][0])][0];
	if (rX(h)&& IsUnitType(u,UNIT_TYPE_STRUCTURE)&& IsUnitEnemy(GetKillingUnit(),p))
	{
		if (GO(b,GetUnitX(u),GetUnitY(u))&&(! GO(b,GetUnitX(h),GetUnitY(h))))
		{
			HO(b);
			PauseTimer(pGlobal->ki[b][0]);
			SavePlayerHandle(pGlobal->ov,GetHandleId((pGlobal->ki[b][0])),(1),(p));
			TimerStart(pGlobal->ki[b][0],30,false,& QO);
			if (IsPlayerAlly(fMyGetLocalPlayer(),p))
			{
				DisplayTextToPlayer(fMyGetLocalPlayer(),0,0,pGlobal->Ji[b][0]+sMyString(" (owned by ")+kX(p)+sMyString(") is being destroyed and has been unclaimed."));
			}
		}
	}
	u=NULL;
	p=NULL;
	h=NULL;
	return  false;
}

void SO()
{
	integer i;
	trigger tO=dE();
	trigger TO=dE();
	trigger uO=dE();
	i=(0)-1;
	while(true)
	{
		i=i+1;
		if ( i>(0xB)) break;
		TriggerRegisterPlayerUnitEvent(tO,Player(i),EVENT_PLAYER_UNIT_CONSTRUCT_START,NULL);
		TriggerRegisterPlayerChatEvent(TO,Player(i),sMyString("-unclaim"),true);
		TriggerRegisterPlayerChatEvent(TO,Player(i),sMyString("-allow"),false);
		TriggerRegisterPlayerChatEvent(TO,Player(i),sMyString("-unallow"),false);
		TriggerRegisterPlayerUnitEvent(uO,Player(i),EVENT_PLAYER_UNIT_DEATH,NULL);
	}
	TriggerAddCondition(tO,Condition(& PO));
	TriggerAddCondition(TO,Condition(& qO));
	TriggerAddCondition(uO,Condition(& sO));
	pGlobal->fv=InitHashtable();
	tO=NULL;
	TO=NULL;
	uO=NULL;
}

void UO( player p, integer g, real x, real y)
{
	if (g>0)
	{
		lX(p,g,0);
	}
}

boolean wO( integer WO)
{
	integer id=GetUnitTypeId(GetTriggerUnit());
	if (id==WO&& LoadBoolean(pGlobal->Fv,id,0)==false)
	{
		SaveBoolean(pGlobal->Fv,id,0,true);
		return  true;
	}
	return  false;
}

boolean yO( integer id)
{
	if (LoadBoolean(pGlobal->Fv,id,0)==false)
	{
		SaveBoolean(pGlobal->Fv,id,0,true);
		return  true;
	}
	return  false;
}

boolean YO()
{
	if (wO(1747988551))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,5,sMyString("A Human has constructed the Citadel of Faith!"));
	}
	if (wO(1747988549))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,5,sMyString("A Human has constructed a Ruby Wall!"));
	}
	if (wO(1749249380))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,5,sMyString("A Human has constructed the Command Center!"));
	}
	if (wO(1747988558))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,5,sMyString("A Human has constructed the Base of Operations!"));
	}
	if (wO(1747988545))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,5,sMyString("A Human has trained a level 3 harvester!"));
	}
	return  false;
}

void zO( integer ZO, integer wX)
{
	group g=CreateGroup();
	unit u;
	GroupEnumUnitsOfType(g,UnitId2String(ZO),NULL);
	while(true)
	{
		u=FirstOfGroup(g);
		if ( u==NULL) break;
		GroupRemoveUnit(g,u);
		ShowUnit(u,false);
		CreateUnit(GetOwningPlayer(u),wX,GetUnitX(u),GetUnitY(u),GetUnitFacing(u));
		RemoveUnit(u);
	}
	DestroyGroup(g);
	g=NULL;
}

boolean vR()
{
	integer eR=pGlobal->Ea[(pGlobal->J[GetPlayerId((fMyGetLocalPlayer()))][0])][0];
	if (pGlobal->gv==0)
	{
		if (eR!=1)
		{
			DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xA,sMyString("|cffff0022You can now purchase <Urn of Dracula>|r"));
		}
	}
	else if(pGlobal->gv==1)
	{
		zO(1848651841,1848651842);
		StartSound(pGlobal->mo);
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,sMyString("|cffff002215 minutes have passed! Vampires may now combine advanced items in the Recipe Shop!|r"));
	}
	else if(pGlobal->gv==2)
	{
		if (eR!=1)
		{
			DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xA,sMyString("|cffff0022You can now purchase <Demonic Remains>|r"));
		}
	}
	else if(pGlobal->gv==3)
	{
		zO(1848651828,1848651829);
		StartSound(pGlobal->lo);
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xA,sMyString("|cffff0022The Demonic Gate has opened...|r"));
	}
	pGlobal->gv=pGlobal->gv+1;
	return  false;
}

void xR()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_UPGRADE_FINISH,NULL);
	HE(eX,EVENT_PLAYER_UNIT_CONSTRUCT_FINISH,NULL);
	HE(eX,EVENT_PLAYER_UNIT_TRAIN_FINISH,NULL);
	TriggerAddCondition(eX,Condition(& YO));
	eX=dE();
	TriggerRegisterTimerEvent(eX,660,false);
	TriggerRegisterTimerEvent(eX,900,false);
	TriggerRegisterTimerEvent(eX,0x5DC,false);
	TriggerRegisterTimerEvent(eX,0x834,false);
	TriggerAddCondition(eX,Condition(& vR));
}

void oR()
{
	timer t=GetExpiredTimer();
	integer rR=LoadInteger(pGlobal->qi,GetHandleId(t),0);
	player p=fMyGetLocalPlayer();
	if (pGlobal->Si[rR][0]<=pGlobal->Gv[GetPlayerId(p)][0])
	{
		if (pGlobal->Ti[rR][0]==p|| pGlobal->hv[pGlobal->si[rR][0]*4+pGlobal->Ea[(pGlobal->J[GetPlayerId((p))][0])][0]][0]!=0)
		{
			StartSound(pGlobal->Hv);
			DisplayTextToPlayer(p,0,0,sMyString("Tip: |c006699cc")+pGlobal->ti[rR][0]+sMyString("|r"));
			if (pGlobal->ui[rR][0])
			{
				PingMinimapEx(pGlobal->Ui[rR][0],pGlobal->wi[rR][0],5,0xFF,0xFF,0xFF,true);
			}
		}
	}
	FlushChildHashtable(pGlobal->qi,GetHandleId(t));
	PauseTimer(t);
	DestroyTimer(t);
	pGlobal->Qi[rR][0]=NULL;
	t=NULL;
	mn(rR);
}

integer iR( integer aR, integer QE, real nR, sMyString KV)
{
	integer rR=Ln();
	pGlobal->Qi[rR][0]=CreateTimer();
	pGlobal->si[rR][0]=aR;
	pGlobal->Si[rR][0]=QE;
	pGlobal->ti[rR][0]=KV;
	pGlobal->Ti[rR][0]=NULL;
	pGlobal->ui[rR][0]=false;
	SaveInteger(pGlobal->qi,GetHandleId(pGlobal->Qi[rR][0]),0,rR);
	TimerStart(pGlobal->Qi[rR][0],nR,false,& oR);
	return  rR;
}

void OR( integer hn, real x, real y)
{
	pGlobal->ui[hn][0]=true;
	pGlobal->Ui[hn][0]=x;
	pGlobal->wi[hn][0]=y;
}

void RR( integer aR, integer a, integer b, integer c)
{
	pGlobal->hv[aR*4+0][0]=0;
	pGlobal->hv[aR*4+1][0]=a;
	pGlobal->hv[aR*4+2][0]=b;
	pGlobal->hv[aR*4+3][0]=c;
}

boolean IR()
{
	integer p=GetPlayerId(GetTriggerPlayer());
	if (pGlobal->Gv[p][0]==0)
	{
		DisplayTextToPlayer(Player(p),0,0,sMyString("|cff6699ccTips have been enabled|r"));
	}
	pGlobal->Gv[p][0]=1;
	return  false;
}

void AR()
{
	trigger eX=dE();
	integer i=0;
	RR(0,0,0,0);
	RR(1,1,0,0);
	RR(2,0,1,0);
	RR(3,1,1,0);
	RR(4,0,0,1);
	RR(5,1,0,1);
	RR(6,0,1,1);
	RR(7,1,1,1);
	pGlobal->Hv=CreateSound(sMyString("Sound\\Interface\\SecretFound.wav"),false,false,false,0xA,0xA,sMyString(0x02));
	SetSoundParamsFromLabel(pGlobal->Hv,sMyString("SecretFound"));
	SetSoundDuration(pGlobal->Hv,0x9DD);
	i=(0)-1;
	while(true)
	{
		i=i+1;
		if ( i>(0xB)) break;
		pGlobal->Gv[i][0]=0;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-tips"),true);
	}
	TriggerAddCondition(eX,Condition(& IR));
	iR(1+2+4,0,((2.)*1.),(sMyString("|cffffcc00Type -tips to enable tips|r")));
	iR(1,0,((1.)*1.),(sMyString("Run! Run! Run! The Vampires are arriving any minute now, we barely have time to hide!")));
	iR(1,0,((5.)*1.),(sMyString("Use Blink (Hotkey N or K) to get around the map faster.")));
	iR(1,1,((15.)*1.),(sMyString("Try to find yourself a base with one exit so it will be easier to defend against vampires.")));
	iR(1,1,((45.)*1.),(sMyString("Make sure you recruit as many workers as possible to harvest lumber faster.")));
	iR(1,1,((60.)*1.),(sMyString("Build a flag in your base to claim it. Type -allow <color> to allow another player to build inside your base.")));
	iR(1,1,((75.)*1.),(sMyString("Build a Slayer's Tavern when you have enough lumber and start summoning your slayer.")));
	iR(1,1,((150.)*1.),(sMyString("If your base has a wide entrance that you can fit two walls into, you can most likely build one wall in the center and the vampire will not be able to get in.")));
	iR(1,1,((120.)*1.),(sMyString("If a Vampire finds your base and breaks through your defenses, don't panic! Detonate your workers by selecting them and then pressing D and clicking mutiple times - this way the Vampire will have less to feed on.")));
	OR((iR(1,1,((180.)*1.),(sMyString("Once you have summoned your slayer, move him/her to the Slayer's Pool to gain levels: every minute all Slayers in the pool are awarded one level.")))),0xFA0,0xDAC);
	iR(1,1,((210.)*1.),(sMyString("If you see a Vampire destroying someone's base, watch out for coins that drop from destroyed buildings and killed units and be ready to blink in with your Slayer and steal the coins.")));
	iR(1,1,((240.)*1.),(sMyString("Sometimes Vampires will try to build Massive Graves near your base. Once built, they will deal a lot of damage to your workers and you will not have time to detonate them unless you have researched Improved Worker Motivation.")));
	iR(1,1,((300.)*1.),(sMyString("Try to save up as much lumber until you get some gold, because then you can greatly improve your wall and start upgrading your base.")));
	iR(1,1,((360.)*1.),(sMyString("Leave some space behind your wall so several Humans can help repair the wall against Vampires.")));
	iR(1,1,((420.)*1.),(sMyString("The vampires can recruit small invisible shades which can sneak past your wall and hide inside your base if you leave gaps between your towers. The vampire can later teleport to those shades and destroy your base from inside.")));
	iR(1,1,((730.)*1.),(sMyString("Now that you've got some gold, build a Slayer's Vault and upgrade your wall to Sapphire or even Emerald. Save lumber and build Gold Mines to get additional gold.")));
	iR(1,1,((850.)*1.),(sMyString("Later on the Vampires can buy a Sphere of Doom which will allow them to jump a very short distance, so build simple walls along the edge of your base where there are no trees.")));
	iR(1,1,((1000.)*1.),(sMyString("When you get Furbolg Harvesters, have them build Wall Towers in place of those extra walls or towers you made to protect against shades or Sphere of Doom.")));
	iR(2+4,0,((5.)*1.),(sMyString("You are about to enter the world of mortals, your goal is to destroy all humans and convert them to your bidding.")));
	iR(2+4,1,((15.)*1.),(sMyString("Once you get control of your Vampire, it is recommended that you skill up Veil of Darkness and Shadow Sight, they will allow you to find human bases faster and escape death in case humans are prepared for your visit.")));
	iR(2+4,1,((30.)*1.),(sMyString("Whenever you kill a Human, he will be reborn as your Minion. Type -nomini if you do not wish to have Minions.")));
	iR(2+4,1,((45.)*1.),(sMyString("Whenever you kill a unit or destroy a structure it might drop coins that you have to pick up before Slayers can steal them.")));
	iR(2+4,1,((90.)*1.),(sMyString("Be very careful and do not get trapped in by walls, workers, or slayers. If you find yourself in such a situation, try to use Veil of Darkness and run away if it not too late.")));
	iR(2+4,1,((120.)*1.),(sMyString("For 30 gold you can buy Massive Graves that let you build a structure that kills workers in 1000 range to get lots of gold and experience. Make sure humans do not see you building them or they can detonate their workers before its finished.")));
	iR(2+4,1,((180.)*1.),(sMyString("Never use Chain of Death on workers if you cannot pick the gold that may drop from the workers.")));
	iR(2+4,1,((660.)*1.),(sMyString("Now that 11 minutes have passed, you can buy an Urn of Dracula for 200 gold. It will bring you additional gold and lumber every minute, so its always a great investment, however you can only buy one of these.")));
}

integer NR( unit u)
{
	integer d=Kn();
	return  d;
}

void bR( unit u)
{
	ShowUnit(u,false);
	if (IsUnitType(u,UNIT_TYPE_HERO))
	{
		if (GetUnitUserData(u)!=0)
		{
			ln(GetUnitUserData(u));
			SetUnitUserData(u,0);
		}
	}
	else 
	{
		KillUnit(u);
	}
	RemoveUnit(u);
}

void BR( unit u)
{
	integer d=GetUnitUserData(u);
	if (pGlobal->oa[d][0]==false)
	{
		pGlobal->oa[d][0]=true;
		TriggerRegisterUnitEvent(pGlobal->jv,u,EVENT_UNIT_DAMAGED);
	}
}

boolean cR()
{
	unit u=GetDyingUnit();
	if (! IsUnitType(u,UNIT_TYPE_HERO)&& GetUnitUserData(u)!=0)
	{
		ln(GetUnitUserData(u));
		SetUnitUserData(u,0);
	}
	u=NULL;
	return  false;
}

boolean CR()
{
	unit u=GetEnteringUnit();
	SetUnitUserData(u,NR(u));
	if (IsUnitType(u,UNIT_TYPE_HERO))
	{
		BR(u);
	}
	u=NULL;
	return  false;
}

void dR()
{
	unit u=GetEnumUnit();
	SetUnitUserData(u,NR(u));
	if (IsUnitType(u,UNIT_TYPE_HERO))
	{
		BR(u);
	}
	u=NULL;
}

void DR()
{
	trigger eX=dE();
	group g=CreateGroup();
	region fR=CreateRegion();
	pGlobal->jv=dE();
	GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,NULL);
	ForGroup(g,& dR);
	DestroyGroup(g);
	g=NULL;
	RegionAddRect(fR,bj_mapInitialPlayableArea);
	TriggerRegisterEnterRegion(eX,fR,NULL);
	TriggerAddCondition(eX,Condition(& CR));
	eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_DEATH,NULL);
	TriggerAddCondition(eX,Condition(& cR));
	eX=NULL;
	fR=NULL;
}

void FR( integer gR, integer GR, sMyString KV)
{
	multiboarditem it=MultiboardGetItem(pGlobal->Jv,gR,GR);
	MultiboardSetItemValue(it,KV);
	MultiboardReleaseItem(it);
	it=NULL;
}

void hR( integer p)
{
	sMyString FO;
	integer i=0;
	boolean HR=true;
	boolean jR=true;
	if (pGlobal->Jv==NULL || pGlobal->kv[p][0]==0)
	{
		return ;
	}
	if (pGlobal->Xa[pGlobal->J[p][0]][0]==1)
	{
		FO=pGlobal->Ei[pGlobal->z[p][0]][0]+GetPlayerName(Player(p))+sMyString("|r");
	}
	else 
	{
		FO=sMyString("|cff808080")+GetPlayerName(Player(p))+sMyString("|r");
	}
	FR(pGlobal->kv[p][0],0,FO);
	if (IsPlayerAlly(Player(p),fMyGetLocalPlayer()))
	{
		FR(pGlobal->kv[p][0],1,sMyString("|cffffcc00")+fMyI2S(GetPlayerState(Player(p),PLAYER_STATE_RESOURCE_GOLD))+sMyString("|r"));
		FR(pGlobal->kv[p][0],2,sMyString("|cff9dbb61")+fMyI2S(GetPlayerState(Player(p),PLAYER_STATE_RESOURCE_LUMBER))+sMyString("|r"));
	}
	else 
	{
		FR(pGlobal->kv[p][0],1,sMyString(0x2D));
		FR(pGlobal->kv[p][0],2,sMyString(0x2D));
	}
	if (pGlobal->Ea[pGlobal->J[p][0]][0]==1&& pGlobal->ga[pGlobal->J[p][0]][0]>0)
	{
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==1)
			{
				if (pGlobal->ga[pGlobal->J[i][0]][0]>pGlobal->ga[pGlobal->J[p][0]][0])
				{
					HR=false;
				}
				else if(pGlobal->ga[pGlobal->J[i][0]][0]<pGlobal->ga[pGlobal->J[p][0]][0])
				{
					jR=false;
				}
			}
			i=i+1;
		}
		if (HR)
		{
			FR(pGlobal->kv[p][0],3,sMyString("|cffff0404")+fMyI2S(pGlobal->ga[pGlobal->J[p][0]][0])+sMyString("|r"));
		}
		else if(jR)
		{
			FR(pGlobal->kv[p][0],3,sMyString("|cff20c000")+fMyI2S(pGlobal->ga[pGlobal->J[p][0]][0])+sMyString("|r"));
		}
		else 
		{
			FR(pGlobal->kv[p][0],3,sMyString("|cffffcc00")+fMyI2S(pGlobal->ga[pGlobal->J[p][0]][0])+sMyString("|r"));
		}
	}
	else if((pGlobal->Ea[pGlobal->J[p][0]][0]==2 || pGlobal->Ea[pGlobal->J[p][0]][0]==3)&& pGlobal->Ga[pGlobal->J[p][0]][0]>0)
	{
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==2|| pGlobal->Ea[pGlobal->J[i][0]][0]==3)
			{
				if (pGlobal->Ga[pGlobal->J[i][0]][0]>pGlobal->Ga[pGlobal->J[p][0]][0])
				{
					HR=false;
				}
				else if(pGlobal->Ga[pGlobal->J[i][0]][0]<pGlobal->Ga[pGlobal->J[p][0]][0])
				{
					jR=false;
				}
			}
			i=i+1;
		}
		if (HR)
		{
			FR(pGlobal->kv[p][0],3,sMyString("|cffff0404")+fMyI2S(pGlobal->Ga[pGlobal->J[p][0]][0])+sMyString("|r"));
		}
		else if(jR)
		{
			FR(pGlobal->kv[p][0],3,sMyString("|cff20c000")+fMyI2S(pGlobal->Ga[pGlobal->J[p][0]][0])+sMyString("|r"));
		}
		else 
		{
			FR(pGlobal->kv[p][0],3,sMyString("|cffffcc00")+fMyI2S(pGlobal->Ga[pGlobal->J[p][0]][0])+sMyString("|r"));
		}
	}
}

void JR()
{
	integer i=0;
	if (pGlobal->Jv==NULL)
	{
		return ;
	}
	MultiboardSetTitleText(pGlobal->Jv,sMyString("Game time: ")+fE((pGlobal->bv+TimerGetElapsed(pGlobal->Bv))));
	while(true)
	{
		if ( i>0xB) break;
		hR(i);
		i=i+1;
	}
}

void kR()
{
	integer i=0;
	multiboarditem it;
	integer KR=0;
	boolean lR=false;
	boolean LR=false;
	boolean mR=true;
	while(true)
	{
		if ( i>0xF) break;
		pGlobal->kv[i][0]=0;
		i=i+1;
	}
	if (! pGlobal->Kv)
	{
		return ;
	}
	if (pGlobal->Jv!=NULL)
	{
		mR=IsMultiboardMinimized(pGlobal->Jv);
		DestroyMultiboard(pGlobal->Jv);
	}
	pGlobal->Jv=CreateMultiboard();
	i=0;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Xa[pGlobal->J[i][0]][0]!=0)
		{
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==1)
			{
				KR=KR+1;
				lR=true;
			}
			else if(pGlobal->Ea[pGlobal->J[i][0]][0]==2|| pGlobal->Ea[pGlobal->J[i][0]][0]==3)
			{
				KR=KR+1;
				LR=true;
			}
		}
		i=i+1;
	}
	if (lR)
	{
		KR=KR+1;
	}
	if (LR)
	{
		KR=KR+1;
	}
	MultiboardSetRowCount(pGlobal->Jv,KR);
	MultiboardSetColumnCount(pGlobal->Jv,4);
	i=0;
	while(true)
	{
		if ( i>=KR) break;
		it=MultiboardGetItem(pGlobal->Jv,i,0);
		MultiboardSetItemStyle(it,true,false);
		MultiboardSetItemWidth(it,.12);
		MultiboardReleaseItem(it);
		it=MultiboardGetItem(pGlobal->Jv,i,1);
		MultiboardSetItemStyle(it,true,false);
		MultiboardSetItemWidth(it,.05);
		MultiboardReleaseItem(it);
		it=MultiboardGetItem(pGlobal->Jv,i,2);
		MultiboardSetItemStyle(it,true,false);
		MultiboardSetItemWidth(it,.05);
		MultiboardReleaseItem(it);
		it=MultiboardGetItem(pGlobal->Jv,i,3);
		MultiboardSetItemStyle(it,true,false);
		MultiboardSetItemWidth(it,.04);
		MultiboardReleaseItem(it);
		i=i+1;
	}
	KR=0;
	if (lR)
	{
		FR(0,0,sMyString("Humans"));
		FR(0,1,sMyString("Gold"));
		FR(0,2,sMyString("Lumber"));
		FR(0,3,sMyString("Fed"));
		KR=1;
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Xa[pGlobal->J[i][0]][0]!=0&& pGlobal->Ea[pGlobal->J[i][0]][0]==1)
			{
				pGlobal->kv[i][0]=KR;
				KR=KR+1;
			}
			i=i+1;
		}
	}
	if (LR)
	{
		FR(KR,0,sMyString("Vampires"));
		FR(KR,1,sMyString("Gold"));
		FR(KR,2,sMyString("Lumber"));
		FR(KR,3,sMyString("Leaked"));
		KR=KR+1;
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Xa[pGlobal->J[i][0]][0]!=0&&(pGlobal->Ea[pGlobal->J[i][0]][0]==2 || pGlobal->Ea[pGlobal->J[i][0]][0]==3))
			{
				pGlobal->kv[i][0]=KR;
				KR=KR+1;
			}
			i=i+1;
		}
	}
	JR();
	MultiboardDisplay(pGlobal->Jv,true);
	MultiboardMinimize(pGlobal->Jv,mR);
	it=NULL;
}

void MR()
{
	timer t=CreateTimer();
	TimerStart(t,1.,true,& JR);
	t=NULL;
	pGlobal->Kv=true;
	kR();
	DestroyTimer(GetExpiredTimer());
}

void pR()
{
	timer t=CreateTimer();
	TimerStart(t,.0,false,& MR);
	t=NULL;
}

void observe___onObserveHuman()
{
	unit uC=GetSpellAbilityUnit();
	ShowUnit(uC,false);
	RemoveUnit(uC);
	uC=NULL;
}

void observe___onObserveVampire()
{
	unit uC=GetSpellAbilityUnit();
	unit PR=CreateUnit(GetOwningPlayer(uC),1966092359,GetUnitX(uC),GetUnitY(uC),GetUnitFacing(uC));
	integer p=GetPlayerId(GetOwningPlayer(uC));
	integer i;
	boolean qR;
	SetPlayerName(Player(p),pGlobal->Ra[pGlobal->J[p][0]][0]);
	pGlobal->Ea[pGlobal->J[p][0]][0]=3;
	i=0;
	while(true)
	{
		if ((i>0xB)) break;
		if (i!=p)
		{
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_CONTROL,false);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_ADVANCED_CONTROL,false);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_CONTROL,false);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_ADVANCED_CONTROL,false);
			qR=(pGlobal->Ea[pGlobal->J[i][0]][0]!=1);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_PASSIVE,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_HELP_REQUEST,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_HELP_RESPONSE,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_XP,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_SPELLS,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_VISION,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_PASSIVE,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_HELP_REQUEST,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_HELP_RESPONSE,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_XP,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_SPELLS,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_VISION,qR);
		}
		i=i+1;
	}
	ShowUnit(uC,false);
	if (fMyGetLocalPlayer()==GetOwningPlayer(uC))
	{
		SetCameraPosition(GetUnitX(uC),GetUnitY(uC));
		SelectUnit(PR,true);
	}
	SetUnitFlyHeight(PR,0xC8,60);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathSmall\\UDeathSmall.mdl"),GetUnitX(uC),GetUnitY(uC)));
	RemoveUnit(uC);
	uC=NULL;
	PR=NULL;
}

void QR()
{
	pGlobal->Xv[(1093677642)-1093677104][0]=((0xE));
	pGlobal->Xv[(1093677633)-1093677104][0]=((0xF));
}

void sR( integer p)
{
	integer gp=GetPlayerState(Player(p),PLAYER_STATE_RESOURCE_GOLD);
	integer wd=GetPlayerState(Player(p),PLAYER_STATE_RESOURCE_LUMBER);
	integer SR=0;
	integer i=0;
	integer tR;
	integer TR;
	SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_GOLD,0);
	SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_LUMBER,0);
	while(true)
	{
		if ( i>0xB) break;
		if (IsPlayerAlly(Player(p),Player(i))&& pGlobal->Xa[pGlobal->J[i][0]][0]==1&& i!=p)
		{
			SR=SR+1;
		}
		i=i+1;
	}
	if (SR>0)
	{
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if (IsPlayerAlly(Player(p),Player(i))&& pGlobal->Xa[pGlobal->J[i][0]][0]==1&& i!=p)
			{
				tR=gp/ SR;
				TR=wd/ SR;
				lX(Player(i),tR,TR);
				if (tR>0)
				{
					if (TR>0)
					{
						DisplayTextToPlayer(Player(i),0,0,sMyString("|cffffcc00Received ")+fMyI2S(tR)+sMyString(" gold and ")+fMyI2S(TR)+sMyString(" lumber from ")+kX(Player(p)));
					}
					else 
					{
						DisplayTextToPlayer(Player(i),0,0,sMyString("|cffffcc00Received ")+fMyI2S(tR)+sMyString(" gold from ")+kX(Player(p)));
					}
				}
				else if(TR>0)
				{
					DisplayTextToPlayer(Player(i),0,0,sMyString("|cff9dbb61Received ")+fMyI2S(TR)+sMyString(" lumber from ")+kX(Player(p)));
				}
				gp=gp-tR;
				wd=wd-TR;
				SR=SR-1;
			}
			i=i+1;
		}
	}
}

void UR( integer p)
{
	unit u=CreateUnit(Player(p),1848651827,0,-256,0);
	integer i=0;
	integer KR=0;
	item it;
	while(true)
	{
		if ( i>5) break;
		it=UnitItemInSlot(pGlobal->Oa[pGlobal->J[p][0]][0],i);
		if (it!=NULL && GetItemTypeId(it)!=1227895113)
		{
			SetItemCharges(UnitAddItemById(u,GetItemTypeId(it)),GetItemCharges(it));
			RemoveItem(it);
			KR=KR+1;
		}
		i=i+1;
	}
	if (KR!=0)
	{
		pGlobal->Lv[pGlobal->mv][0]=u;
		pGlobal->mv=pGlobal->mv+1;
		if (pGlobal->mv>1)
		{
			i=0;
			while(true)
			{
				if ( i>=pGlobal->mv) break;
				ShowUnit(pGlobal->Lv[i][0],false);
				SetUnitX(pGlobal->Lv[i][0],-256-256*Cos(bj_PI*2*i/ pGlobal->mv));
				SetUnitY(pGlobal->Lv[i][0],-512+256*Sin(bj_PI*2*i/ pGlobal->mv));
				ShowUnit(pGlobal->Lv[i][0],true);
				i=i+1;
			}
		}
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if ((pGlobal->Ea[pGlobal->J[i][0]][0]==2 || pGlobal->Ea[pGlobal->J[i][0]][0]==3)&& pGlobal->Xa[pGlobal->J[i][0]][0]==1)
			{
				SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_CONTROL,true);
				if (fMyGetLocalPlayer()==Player(i))
				{
					DisplayTextToPlayer(fMyGetLocalPlayer(),0,0,kX(Player(p))+sMyString("|cffffcc00 has left behind some artifacts hidden in a part of his soul|r"));
					PingMinimap(-256,-512,5.);
				}
			}
			i=i+1;
		}
	}
	else 
	{
		ShowUnit(u,false);
		KillUnit(u);
	}
	u=NULL;
	it=NULL;
}

void wR()
{
	timer t=GetExpiredTimer();
	integer BE=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	pGlobal->Za[BE][0]=pGlobal->Za[BE][0]+1;
	if (pGlobal->Za[BE][0]==1)
	{
		TimerStart(t,30.,false,& wR);
		TimerDialogSetTitle(pGlobal->en[BE][0],sMyString("Sphere Recharging (1)"));
	}
	else if(pGlobal->Za[BE][0]==2)
	{
		DestroyTimerDialog(pGlobal->en[BE][0]);
		pGlobal->en[BE][0]=NULL;
		LV(t);
		pGlobal->vn[BE][0]=false;
	}
}

void WR( integer BE)
{
	timer t=lV(BE);
	TimerStart(t,30.,false,& wR);
	pGlobal->en[BE][0]=CreateTimerDialog(t);
	TimerDialogSetTitle(pGlobal->en[BE][0],sMyString("Sphere Recharging (1)"));
	if (fMyGetLocalPlayer()==Player(BE))
	{
		TimerDialogDisplay(pGlobal->en[BE][0],true);
	}
	pGlobal->vn[BE][0]=true;
}

void sphereOfDoom___onSphereBlink()
{
	unit u=GetSpellAbilityUnit();
	integer BE=GetPlayerId(GetOwningPlayer(u));
	if (pGlobal->Za[BE][0]==0)
	{
		IssueImmediateOrderById(u,0xD0004);
		hX(Player(BE),sMyString("Blinking failed because your Sphere of Doom hasn't charged enough yet!"));
	}
	else 
	{
		pGlobal->Za[BE][0]=pGlobal->Za[BE][0]-1;
		if (pGlobal->Za[BE][0]==0)
		{
			TimerDialogSetTitle(pGlobal->en[BE][0],sMyString("Sphere Recharging (0)"));
		}
		if (!(pGlobal->vn[BE][0]))
		{
			WR(BE);
		}
	}
	u=NULL;
}

void yR()
{
	integer i;
	pGlobal->Xv[(1093677113)-1093677104][0]=((16));
	i=0;
	while(true)
	{
		if ((i>0xB)) break;
		pGlobal->Za[i][0]=2;
		i=i+1;
	}
}

void YR( unit u)
{
	SetUnitVertexColor(u,32,0,0,0xE0);
	AddSpecialEffectTarget(sMyString("Abilities\\Spells\\Other\\BreathOfFire\\BreathOfFireDamage.mdl"),u,sMyString("origin"));
}

void zR( real nR, code ZR)
{
	timer t=CreateTimer();
	TimerStart(t,nR,false,ZR);
	t=NULL;
}

void vI()
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		RemoveUnit(pGlobal->Mv[i][0]);
		i=i+1;
	}
	DestroyTimer(GetExpiredTimer());
}

void eI()
{
	integer i=0;
	PauseTimer(pGlobal->Qv);
	DestroyTimer(pGlobal->Qv);
	PauseTimer(pGlobal->sv);
	DestroyTimer(pGlobal->sv);
	while(true)
	{
		if ( i>=0xA) break;
		DestroyEffect(AddSpecialEffect(sMyString("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl"),GetUnitX(pGlobal->pv[i][0]),GetUnitY(pGlobal->pv[i][0])));
		DestroyLightning(pGlobal->Pv[i][0]);
		KillUnit(pGlobal->pv[i][0]);
		i=i+1;
	}
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl"),pGlobal->Sv,pGlobal->tv));
	KillDestructable(pGlobal->qv);
	StartSound(pGlobal->Lo);
	DisplayTextToPlayer(fMyGetLocalPlayer(),0,0,sMyString("|cffFF0000The portal has been closed, but not before it unleashed a powerful evil upon this world."));
	zR(5.,& vI);
}

void xI()
{
	integer i=0;
	if (GetExpiredTimer()==pGlobal->sv)
	{
		i=1;
	}
	while(true)
	{
		if ( i>=0xA) break;
		SetUnitAnimation(pGlobal->pv[i][0],sMyString("spell"));
		i=i+2;
	}
}

void oI()
{
	integer i=1;
	lightning l;
	while(true)
	{
		if ( i>=0xA) break;
		SetUnitAnimation(pGlobal->pv[i][0],sMyString("spell"));
		l=AddLightningEx(sMyString("DRAB"),true,pGlobal->Sv,pGlobal->tv,0x96,GetUnitX(pGlobal->pv[i][0]),GetUnitY(pGlobal->pv[i][0]),50);
		pGlobal->Pv[i][0]=l;
		i=i+2;
	}
	l=NULL;
	TimerStart(pGlobal->sv,2.,true,& xI);
	DestroyTimer(GetExpiredTimer());
}

void rI()
{
	pGlobal->qv=CreateDestructable(1330934640,pGlobal->Sv,pGlobal->tv,270,1.,0);
	TimerStart(GetExpiredTimer(),4.,false,& oI);
}

void iI()
{
	integer i=0;
	integer j;
	lightning l;
	while(true)
	{
		if ( i>=0xA) break;
		j=i+4;
		if (j>=0xA)
		{
			j=j-0xA;
		}
		SetUnitAnimation(pGlobal->pv[i][0],sMyString("spell"));
		l=AddLightningEx(sMyString("AFOD"),true,GetUnitX(pGlobal->pv[i][0]),GetUnitY(pGlobal->pv[i][0]),50,GetUnitX(pGlobal->pv[j][0]),GetUnitY(pGlobal->pv[j][0]),50);
		pGlobal->Pv[i][0]=l;
		i=i+2;
	}
	l=NULL;
	TimerStart(pGlobal->Qv,2.,true,& xI);
	TimerStart(GetExpiredTimer(),2.,false,& rI);
}

void aI()
{
	integer i=0;
	real r=384;
	real x;
	real y;
	real a;
	while(true)
	{
		if ( i>=0xA) break;
		a=bj_PI*i/ 5.;
		x=pGlobal->Sv-r*Sin(a);
		y=pGlobal->tv+r*Cos(a);
		a=270+36*i;
		pGlobal->pv[i][0]=CreateUnit(Player(0xF),1966092341,x,y,a);
		i=i+1;
	}
	TimerStart(GetExpiredTimer(),2.,false,& iI);
}

void nI()
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		pGlobal->Mv[i][0]=CreateUnit(Player(i),1867934067,pGlobal->Sv,pGlobal->tv,0);
		i=i+1;
	}
}

void VI()
{
	nI();
	PanCameraTo(GetRectCenterX(pGlobal->ao),GetRectCenterY(pGlobal->ao));
	zR(1.,& aI);
}

void upgradeInfernal__onUpgradeInvisibleInfernal()
{
	unit uC=GetSpellAbilityUnit();
	UnitRemoveAbility(uC,1093677873);
	UnitAddAbility(uC,1093677107);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	uC=NULL;
}

void EI()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit PR;
	player p=GetOwningPlayer(pGlobal->Ii[uh][0]);
	if (GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE)>0)
	{
		ShowUnit(pGlobal->Ii[uh][0],false);
		PR=CreateUnit(p,1848651854,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
		SetUnitState(PR,UNIT_STATE_LIFE,GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE));
		if (IsUnitSelected(pGlobal->Ii[uh][0],p))
		{
			if (fMyGetLocalPlayer()==p)
			{
				SelectUnit(PR,true);
			}
		}
		RemoveUnit(pGlobal->Ii[uh][0]);
		DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(PR),GetUnitY(PR)));
	}
	PR=NULL;
	sn(uh);
	LV(t);
}

void upgradeInfernal__onUpgradeRangedInfernal()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& EI);
	uC=NULL;
}

void XI()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit PR;
	player p=GetOwningPlayer(pGlobal->Ii[uh][0]);
	if (GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE)>0)
	{
		ShowUnit(pGlobal->Ii[uh][0],false);
		PR=CreateUnit(p,1848651855,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
		SetUnitState(PR,UNIT_STATE_LIFE,GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE));
		if (IsUnitSelected(pGlobal->Ii[uh][0],p))
		{
			if (fMyGetLocalPlayer()==p)
			{
				SelectUnit(PR,true);
			}
		}
		RemoveUnit(pGlobal->Ii[uh][0]);
		DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(PR),GetUnitY(PR)));
	}
	PR=NULL;
	sn(uh);
	LV(t);
}

void upgradeInfernal__onUpgradeCorruptedInfernal()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& XI);
	uC=NULL;
}

void OI()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit PR;
	player p=GetOwningPlayer(pGlobal->Ii[uh][0]);
	if (GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE)>0)
	{
		ShowUnit(pGlobal->Ii[uh][0],false);
		PR=CreateUnit(p,1848651851,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
		SetUnitState(PR,UNIT_STATE_LIFE,GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE));
		if (IsUnitSelected(pGlobal->Ii[uh][0],p))
		{
			if (fMyGetLocalPlayer()==p)
			{
				SelectUnit(PR,true);
			}
		}
		RemoveUnit(pGlobal->Ii[uh][0]);
		DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(PR),GetUnitY(PR)));
	}
	PR=NULL;
	sn(uh);
	LV(t);
}

void upgradeInfernal__onUpgradeFrozenInfernal()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& OI);
	uC=NULL;
}

void RI()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	SaveUnitHandle(pGlobal->ov,GetHandleId((pGlobal->Ii[uh][0])),(0),(CreateUnit(GetOwningPlayer(pGlobal->Ii[uh][0]),1747989066,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),270.)));
	SaveUnitHandle(pGlobal->ov,GetHandleId((pGlobal->Ii[uh][0])),(1),(CreateUnit(GetOwningPlayer(pGlobal->Ii[uh][0]),1747989064,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),270.)));
	ShowUnit(pGlobal->Ii[uh][0],true);
	sn(uh);
	LV(t);
}

void II()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit PR;
	player p=GetOwningPlayer(pGlobal->Ii[uh][0]);
	if (GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE)>0)
	{
		ShowUnit(pGlobal->Ii[uh][0],false);
		PR=CreateUnit(p,1848651856,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
		ShowUnit(PR,false);
		SetUnitState(PR,UNIT_STATE_LIFE,GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE));
		if (IsUnitSelected(pGlobal->Ii[uh][0],p))
		{
			if (fMyGetLocalPlayer()==p)
			{
				SelectUnit(PR,true);
			}
		}
		RemoveUnit(pGlobal->Ii[uh][0]);
		DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(PR),GetUnitY(PR)));
		TimerStart(lV(IE(PR)),.0,false,& RI);
	}
	PR=NULL;
	sn(uh);
	LV(t);
}

void upgradeInfernal__onUpgradeVolcanicInfernal()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& II);
	uC=NULL;
}

void AI()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit PR;
	player p=GetOwningPlayer(pGlobal->Ii[uh][0]);
	if (GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE)>0)
	{
		ShowUnit(pGlobal->Ii[uh][0],false);
		PR=CreateUnit(p,1848651847,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
		SetUnitState(PR,UNIT_STATE_LIFE,GetUnitState(pGlobal->Ii[uh][0],UNIT_STATE_LIFE));
		if (IsUnitSelected(pGlobal->Ii[uh][0],p))
		{
			if (fMyGetLocalPlayer()==p)
			{
				SelectUnit(PR,true);
			}
		}
		RemoveUnit(pGlobal->Ii[uh][0]);
		DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(PR),GetUnitY(PR)));
	}
	PR=NULL;
	sn(uh);
	LV(t);
}

void upgradeInfernal__onUpgradeInfernalMeteor()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& AI);
	uC=NULL;
}

void NI()
{
	pGlobal->Ev[(1093677873)-1093677104][0]=((17));
	pGlobal->Ev[(1093677637)-1093677104][0]=((18));
	pGlobal->Ev[(1093677638)-1093677104][0]=((19));
	pGlobal->Ev[(1093677639)-1093677104][0]=((20));
	pGlobal->Ev[(1093677640)-1093677104][0]=((21));
	pGlobal->Ev[(1093677624)-1093677104][0]=((22));
}

void buildingProtection___onBuildingProtection()
{
	unit uC=GetSpellAbilityUnit();
	integer b=hO(GetUnitX(uC),GetUnitY(uC));
	if (b!=0 && pGlobal->Ki[b][0]!=NULL)
	{
		if (GetOwningPlayer(uC)!=pGlobal->Ki[b][0]&& pGlobal->xn[GetPlayerId(pGlobal->Ki[b][0])][0])
		{
			IssueImmediateOrderById(uC,0xD0004);
			hX(GetOwningPlayer(uC),kX(pGlobal->Ki[b][0])+sMyString(" does not want you to use Building Protection in ")+jX(pGlobal->Ki[b][0])+sMyString(" base!"));
		}
	}
	uC=NULL;
}

boolean bI()
{
	integer BE=GetPlayerId(GetTriggerPlayer());
	boolean BI=(GetEventPlayerChatString()==sMyString("-noprotect"));
	if (pGlobal->Ea[pGlobal->J[BE][0]][0]==1 && pGlobal->xn[BE][0]!=BI)
	{
		if (BI)
		{
			DisplayTextToPlayer(Player(BE),.0,.0,sMyString("|cffffcc00Other humans can no longer use Building Protection within your base (cancel with -yesprotect)|r"));
		}
		else 
		{
			DisplayTextToPlayer(Player(BE),.0,.0,sMyString("|cffffcc00Other humans can now use Building Protection within your base (cancel with -noprotect)|r"));
		}
	}
	pGlobal->xn[BE][0]=BI;
	return  false;
}

void cI()
{
	trigger T=dE();
	integer i;
	pGlobal->Xv[(1093677369)-1093677104][0]=((23));
	i=0;
	while(true)
	{
		if ((i>0xB)) break;
		TriggerRegisterPlayerChatEvent(T,Player(i),sMyString("-noprotect"),true);
		TriggerRegisterPlayerChatEvent(T,Player(i),sMyString("-yesprotect"),true);
		i=i+1;
	}
	TriggerAddCondition(T,Condition(& bI));
}

void chopTree__onChopTree()
{
	destructable d=GetSpellTargetDestructable();
	unit u=GetSpellAbilityUnit();
	integer b=hO(GetDestructableX(d),GetDestructableY(d));
	if (b==0 || MO(b,GetOwningPlayer(u)))
	{
		KillDestructable(d);
	}
	else 
	{
		DisplayTextToPlayer(GetOwningPlayer(u),.0,.0,kX(pGlobal->Ki[b][0])+sMyString(" has claimed this base!"));
		SetUnitX(u,GetRectCenterX(pGlobal->oo));
		SetUnitY(u,GetRectCenterY(pGlobal->oo));
	}
	d=NULL;
	u=NULL;
}

void CI()
{
	destructable d=GetEnumDestructable();
	if ((GetDestructableX(d)-pGlobal->uv)*(GetDestructableX(d)-pGlobal->uv)+(GetDestructableY(d)-pGlobal->Uv)*(GetDestructableY(d)-pGlobal->Uv)<pGlobal->Tv*pGlobal->Tv)
	{
		DestructableRestoreLife(d,GetDestructableMaxLife(d),true);
	}
	d=NULL;
}

void chopTree__onRegrowTree()
{
	real x=GetSpellTargetX();
	real y=GetSpellTargetY();
	SetRect(pGlobal->iv,x-pGlobal->Tv,y-pGlobal->Tv,x+pGlobal->Tv,y+pGlobal->Tv);
	pGlobal->uv=x;
	pGlobal->Uv=y;
	EnumDestructablesInRect(pGlobal->iv,NULL,& CI);
}

void dI()
{
	pGlobal->Xv[(1093677645)-1093677104][0]=((24));
	pGlobal->Xv[(1093677646)-1093677104][0]=((25));
}

void DI()
{
	integer i=0;
	integer ud;
	while(true)
	{
		if ((i>=pGlobal->yv)) break;
		ud=(GetUnitUserData((pGlobal->Wv[i][0])));
		if (ud!=0 && pGlobal->zi[ud][0]>.1)
		{
			pGlobal->zi[ud][0]=pGlobal->zi[ud][0]-.1;
			if (GetWidgetLife(pGlobal->Wv[i][0])>pGlobal->wv+5.)
			{
				SetWidgetLife(pGlobal->Wv[i][0],GetWidgetLife(pGlobal->Wv[i][0])-pGlobal->wv);
			}
			i=i+1;
		}
		else 
		{
			if (ud!=0)
			{
				pGlobal->zi[ud][0]=-1.;
			}
			pGlobal->yv=pGlobal->yv-1;
			pGlobal->Wv[i][0]=pGlobal->Wv[pGlobal->yv][0];
			pGlobal->Wv[pGlobal->yv][0]=NULL;
		}
	}
	if (pGlobal->yv==0)
	{
		PauseTimer(pGlobal->Yv);
	}
}

boolean fI()
{
	integer ud;
	integer id;
	unit u;
	if (GetUnitTypeId(GetEventDamageSource())!=1848651855|| GetEventDamage()<=.5)
	{
		return  true;
	}
	u=GetTriggerUnit();
	id=GetUnitTypeId(u);
	if (id==1749182317 || id==1747988532 || id==1747988559 || id==1747988793 || id==1750357858 || id==1848651832)
	{
		ud=(GetUnitUserData((u)));
		if (pGlobal->zi[ud][0]<-.5)
		{
			pGlobal->Wv[pGlobal->yv][0]=u;
			pGlobal->yv=pGlobal->yv+1;
			if (pGlobal->yv==1)
			{
				TimerStart(pGlobal->Yv,.1,true,& DI);
			}
		}
		pGlobal->zi[ud][0]=5.;
	}
	u=NULL;
	return  true;
}

boolean FI()
{
	integer id;
	if (GetUnitTypeId(GetAttacker())!=1848651855)
	{
		return  false;
	}
	id=GetUnitTypeId(GetTriggerUnit());
	if (id==1749182317 || id==1747988532 || id==1747988559 || id==1747988793 || id==1750357858 || id==1848651832)
	{
		BR(GetTriggerUnit());
	}
	return  false;
}

void gI()
{
	trigger T=dE();
	HE(T,EVENT_PLAYER_UNIT_ATTACKED,NULL);
	TriggerAddCondition(T,Condition(& FI));
	TriggerAddCondition(pGlobal->jv,Condition(& fI));
}

void GI()
{
	SetUnitVertexColor(GetEnumUnit(),0,0,0,pGlobal->Zv);
}

void hI()
{
	timer t=GetExpiredTimer();
	integer p=(LoadInteger(pGlobal->ov,GetHandleId((t)),(0)));
	SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_GOLD,0);
	SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_LUMBER,0);
	t=NULL;
}

void HI()
{
	timer t=GetExpiredTimer();
	integer BE=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit u;
	LV(t);
	GroupEnumUnitsOfPlayer(pGlobal->rv,Player(bj_PLAYER_NEUTRAL_VICTIM),NULL);
	while(true)
	{
		u=FirstOfGroup(pGlobal->rv);
		if ( u==NULL) break;
		GroupRemoveUnit(pGlobal->rv,u);
		if (GetUnitUserData(u)==BE)
		{
			DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl"),GetUnitX(u),GetUnitY(u)));
			RemoveUnit(u);
		}
	}
}

void jI( integer pD, integer pK, boolean JI)
{
	unit u;
	timer t;
	integer i;
	group g=CreateGroup();
	GroupEnumUnitsOfPlayer(g,Player(pD),NULL);
	while(true)
	{
		u=FirstOfGroup(g);
		if ( u==NULL) break;
		GroupRemoveUnit(g,u);
		if (GetUnitTypeId(u)!=1747989063)
		{
			PauseUnit(u,false);
		}
	}
	DestroyGroup(g);
	g=NULL;
	TimerStart(lV(pD),90.,false,& HI);
	pO(Player(pD));
	SetPlayerState(Player(pD),PLAYER_STATE_GIVES_BOUNTY,1);
	t=CreateTimer();
	SaveInteger(pGlobal->ov,GetHandleId((t)),(0),(pD));
	TimerStart(t,.0,false,& hI);
	t=NULL;
	u=pGlobal->Oa[pGlobal->J[pD][0]][0];
	UnitAddAbility(u,1093677642);
	UnitMakeAbilityPermanent(u,true,1093677642);
	if (JI)
	{
		UnitAddAbility(u,1093677633);
		UnitMakeAbilityPermanent(u,true,1093677633);
		DisplayTimedTextToPlayer(Player(pD),0,0,30.,sMyString("|cffff0000You have been bitten by a vampire and have died! You may return as a vampire minion or observe the game as a human spirit."));
	}
	else 
	{
		DisplayTimedTextToPlayer(Player(pD),0,0,30.,sMyString("|cffff0000You are dead! The vampire did not bite you... You may continue to observe the game as a human spirit."));
	}
	UnitApplyTimedLife(u,0,60.);
	pGlobal->Oa[pGlobal->J[pD][0]][0]=NULL;
	pGlobal->Xa[pGlobal->J[pD][0]][0]=2;
	PX(true);
	kR();
	u=NULL;
}

void kI()
{
	timer t=GetExpiredTimer();
	integer a=(LoadInteger(pGlobal->ov,GetHandleId((t)),(0)));
	group g=(LoadGroupHandle(pGlobal->ov,GetHandleId((t)),(1)));
	a=a-5;
	if (a>pGlobal->zv)
	{
		pGlobal->Zv=a;
		ForGroup(g,& GI);
		SaveInteger(pGlobal->ov,GetHandleId((t)),(0),(a));
	}
	else 
	{
		jI((LoadInteger(pGlobal->ov,GetHandleId((t)),(2))),(LoadInteger(pGlobal->ov,GetHandleId((t)),(3))),(LoadBoolean(pGlobal->ov,GetHandleId((t)),(4))));
		FlushChildHashtable(pGlobal->ov,GetHandleId((t)));
		PauseTimer(t);
		DestroyTimer(t);
	}
	t=NULL;
	g=NULL;
}

void KI( integer pD, integer pK)
{
	unit u;
	unit wX;
	timer t;
	boolean JI=false;
	group lI=CreateGroup();
	group LI=CreateGroup();
	pGlobal->Xa[pGlobal->J[pD][0]][0]=2;
	pGlobal->Ca[pGlobal->J[pD][0]][0]=R2I((pGlobal->bv+TimerGetElapsed(pGlobal->Bv)));
	pGlobal->Fa[pGlobal->J[pD][0]][0]=GetHeroLevel(pGlobal->Oa[pGlobal->J[pK][0]][0]);
	SetPlayerState(Player(pD),PLAYER_STATE_GIVES_BOUNTY,0);
	SetPlayerName(Player(pD),pGlobal->Ra[pGlobal->J[pD][0]][0]+sMyString(" (Dead)"));
	u=pGlobal->Oa[pGlobal->J[pD][0]][0];
	ShowUnit(u,false);
	wX=CreateUnit(GetOwningPlayer(u),1747989063,GetUnitX(u),GetUnitY(u),GetUnitFacing(u));
	pGlobal->Oa[pGlobal->J[pD][0]][0]=wX;
	if (fMyGetLocalPlayer()==Player(pD))
	{
		SelectUnit(wX,true);
		SetCameraPosition(GetUnitX(u),GetUnitY(u));
	}
	RemoveUnit(u);
	GroupEnumUnitsOfPlayer(lI,Player(pD),NULL);
	while(true)
	{
		u=FirstOfGroup(lI);
		if ( u==NULL) break;
		GroupRemoveUnit(lI,u);
		if (GetUnitTypeId(u)==1747989063)
		{
			DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl"),GetUnitX(u),GetUnitY(u)));
		}
		else if(IsUnitType(u,UNIT_TYPE_STRUCTURE)&&(! IsUnitType(u,UNIT_TYPE_DEAD)))
		{
			SetUnitOwner(u,Player(bj_PLAYER_NEUTRAL_VICTIM),false);
			TriggerRegisterUnitEvent(pGlobal->Cv,(u),EVENT_UNIT_DAMAGED);
			SetUnitUserData(u,pD);
			GroupAddUnit(LI,u);
		}
		else 
		{
			JX(u);
		}
	}
	DestroyGroup(lI);
	lI=NULL;
	SetPlayerState(Player(pD),PLAYER_STATE_RESOURCE_GOLD,0);
	SetPlayerState(Player(pD),PLAYER_STATE_RESOURCE_LUMBER,0);
	if (pGlobal->Ea[pGlobal->J[pK][0]][0]!=1)
	{
		JI=pGlobal->Aa[pGlobal->J[pK][0]][0];
	}
	t=CreateTimer();
	SaveInteger(pGlobal->ov,GetHandleId((t)),(0),(0xFF));
	SaveGroupHandle(pGlobal->ov,GetHandleId((t)),(1),(LI));
	SaveInteger(pGlobal->ov,GetHandleId((t)),(2),(pD));
	SaveInteger(pGlobal->ov,GetHandleId((t)),(3),(pK));
	SaveBoolean(pGlobal->ov,GetHandleId((t)),(4),(JI));
	TimerStart(t,.1,true,& kI);
	LI=NULL;
	t=NULL;
	StartSound(pGlobal->rr);
	DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(pD))+sMyString(" has fallen"));
	wX=NULL;
	u=NULL;
}

void mI()
{
	timer t=GetExpiredTimer();
	unit u;
	GroupEnumUnitsOfPlayer(pGlobal->rv,Player((LoadInteger(pGlobal->I,0,GetHandleId((t))))),NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ( u==NULL) break;
		GroupRemoveUnit(pGlobal->rv,u);
		JX(u);
		u=FirstOfGroup(pGlobal->rv);
	}
	LV(t);
}

void MI( integer BE)
{
	player p=Player(BE);
	unit u;
	GroupEnumUnitsOfPlayer(pGlobal->rv,p,NULL);
	if ((pGlobal->bv+TimerGetElapsed(pGlobal->Bv))-pGlobal->Na[pGlobal->J[BE][0]][0]<30)
	{
		XE(10.,KX(BE)+sMyString("|cffffcc00's base was being destroyed, ")+jX(p)+sMyString(" structures and workers will remain in the game for one minute.|r"));
		u=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ( u==NULL) break;
			GroupRemoveUnit(pGlobal->rv,u);
			if (!(IsUnitType(u,UNIT_TYPE_STRUCTURE)|| nX(u)))
			{
				JX(u);
			}
			u=FirstOfGroup(pGlobal->rv);
		}
		TimerStart(lV(BE),60.,false,& mI);
	}
	else 
	{
		u=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ( u==NULL) break;
			GroupRemoveUnit(pGlobal->rv,u);
			JX(u);
			u=FirstOfGroup(pGlobal->rv);
		}
	}
}

void pI()
{
	player p=GetTriggerPlayer();
	integer BE=GetPlayerId(p);
	pO(p);
	sR(BE);
	if (pGlobal->Xa[pGlobal->J[BE][0]][0]==1)
	{
		pGlobal->Xa[pGlobal->J[BE][0]][0]=3;
		SetPlayerName(p,pGlobal->Ra[pGlobal->J[BE][0]][0]+sMyString(" (Left)"));
		XE(10.,KX(BE)+sMyString(" has left the game"));
		MI(BE);
	}
	else if(pGlobal->Xa[pGlobal->J[BE][0]][0]==2)
	{
		pGlobal->Xa[pGlobal->J[BE][0]][0]=3;
		SetPlayerName(p,pGlobal->Ra[pGlobal->J[BE][0]][0]+sMyString(" (Dead & Left)"));
		XE(10.,KX(BE)+sMyString(" (Dead) has left the game"));
	}
}

void PI()
{
	player p=GetTriggerPlayer();
	integer BE=GetPlayerId(p);
	unit u;
	if (pGlobal->Xa[pGlobal->J[BE][0]][0]==1)
	{
		pGlobal->Xa[pGlobal->J[BE][0]][0]=3;
		sR(BE);
		UR(BE);
		GroupEnumUnitsOfPlayer(pGlobal->rv,p,NULL);
		u=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ( u==NULL) break;
			GroupRemoveUnit(pGlobal->rv,u);
			if (GetUnitTypeId(u)!=1848651827)
			{
				RemoveUnit(u);
			}
			u=FirstOfGroup(pGlobal->rv);
		}
		SetPlayerName(p,pGlobal->Ra[pGlobal->J[BE][0]][0]+sMyString(" (Left)"));
		XE(10.,KX(BE)+sMyString(" has left the game"));
	}
	else if(pGlobal->Xa[pGlobal->J[BE][0]][0]==2)
	{
		pGlobal->Xa[pGlobal->J[BE][0]][0]=3;
		SetPlayerName(p,pGlobal->Ra[pGlobal->J[BE][0]][0]+sMyString(" (Dead & Left)"));
		XE(10.,KX(BE)+sMyString(" (Dead) has left the game"));
	}
}

boolean qI()
{
	if (pGlobal->Ea[pGlobal->J[GetPlayerId(GetTriggerPlayer())][0]][0]==1)
	{
		pI();
	}
	else 
	{
		PI();
	}
	PX(true);
	kR();
	return  false;
}

void QI()
{
	trigger T=dE();
	gE(T,EVENT_PLAYER_LEAVE);
	TriggerAddCondition(T,Condition(& qI));
}

void sI()
{
	unit u=GetEnumUnit();
	unit u2;
	real SI;
	boolean ok=true;
	GroupEnumUnitsInRange(pGlobal->re,GetUnitX(u),GetUnitY(u),0x80,NULL);
	while(true)
	{
		u2=FirstOfGroup(pGlobal->re);
		if ( u2==NULL) break;
		GroupRemoveUnit(pGlobal->re,u2);
		if (u2!=pGlobal->ee&&(GetUnitX(u)-GetUnitX(u2))*(GetUnitX(u)-GetUnitX(u2))+(GetUnitY(u)-GetUnitY(u2))*(GetUnitY(u)-GetUnitY(u2))<64*64)
		{
			ok=false;
		}
	}
	if (ok)
	{
		SI=(GetUnitX(u)-GetUnitX(pGlobal->ee))*(GetUnitX(u)-GetUnitX(pGlobal->ee))+(GetUnitY(u)-GetUnitY(pGlobal->ee))*(GetUnitY(u)-GetUnitY(pGlobal->ee));
		if (pGlobal->xe==NULL || SI<pGlobal->oe)
		{
			pGlobal->xe=u;
			pGlobal->oe=SI;
		}
	}
	u=NULL;
}

void tI( unit TI)
{
	if (GetUnitX(TI)>GetRectMinX(pGlobal->io)&& GetUnitX(TI)<GetRectMaxX(pGlobal->io)&& GetUnitY(TI)>GetRectMinY(pGlobal->io)&& GetUnitY(TI)<GetRectMaxY(pGlobal->io))
	{
		pGlobal->re=CreateGroup();
		pGlobal->ee=TI;
		pGlobal->xe=NULL;
		pGlobal->oe=0;
		ForGroup(pGlobal->ve,& sI);
		DestroyGroup(pGlobal->re);
		if (pGlobal->xe!=NULL)
		{
			DisableTrigger(pGlobal->ie);
			IssuePointOrderById(TI,0xD0012,GetUnitX(pGlobal->xe),GetUnitY(pGlobal->xe));
			EnableTrigger(pGlobal->ie);
			if (pGlobal->xa[(GetUnitUserData((TI)))][0]!=NULL)
			{
				PauseTimer(pGlobal->xa[(GetUnitUserData((TI)))][0]);
			}
		}
	}
}

void uI()
{
	timer t=GetExpiredTimer();
	tI((LoadUnitHandle(pGlobal->ov,GetHandleId((t)),(0))));
	t=NULL;
}

boolean UI()
{
	unit u=GetOrderedUnit();
	integer ud;
	if (aX(u))
	{
		ud=(GetUnitUserData((u)));
		if (pGlobal->xa[ud][0]==NULL)
		{
			pGlobal->xa[ud][0]=CreateTimer();
			SaveUnitHandle(pGlobal->ov,GetHandleId((pGlobal->xa[ud][0])),(0),(u));
		}
		TimerStart(pGlobal->xa[ud][0],5.,true,& uI);
	}
	u=NULL;
	return  false;
}

boolean wI()
{
	UnitAddAbility(GetFilterUnit(),1097625443);
	return  true;
}

void WI()
{
	pGlobal->ie=dE();
	HE(pGlobal->ie,EVENT_PLAYER_UNIT_ISSUED_ORDER,NULL);
	HE(pGlobal->ie,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,NULL);
	HE(pGlobal->ie,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,NULL);
	TriggerAddCondition(pGlobal->ie,Condition(& UI));
	GroupEnumUnitsOfType(pGlobal->ve,UnitId2String(1747988824),Filter(& wI));
}

void yI( integer a)
{
	pGlobal->ae[pGlobal->ne][0]=a;
	pGlobal->ne=pGlobal->ne+1;
}

integer YI()
{
	integer i;
	integer j;
	integer zI=0xA;
		sMyArray<integer[1],CONST_MAX_SIZE_MASS> ZI;
		sMyArray<integer[1],CONST_MAX_SIZE_MASS> vA;
	integer eA=0;
	i=0;
	while(true)
	{
		if ((i>=pGlobal->ne)) break;
		ZI[i][0]=0;
		i=i+1;
	}
	i=0;
	while(true)
	{
		if ((i>=0xC)) break;
		j=0;
		while(true)
		{
			if ((j>pGlobal->ne)) break;
			if (pGlobal->fa[pGlobal->J[i][0]][0]==pGlobal->ae[j][0]&& pGlobal->Xa[pGlobal->J[i][0]][0]==1)
			{
				ZI[j][0]=ZI[j][0]+1;
			}
			j=j+1;
		}
		i=i+1;
	}
	i=0;
	while(true)
	{
		if ((i>=pGlobal->ne)) break;
		if (zI>ZI[i][0])
		{
			if (!(pGlobal->ae[i][0]==1093677635 && zI>0))
			{
				zI=ZI[i][0];
			}
		}
		i=i+1;
	}
	i=0;
	while(true)
	{
		if ((i>=pGlobal->ne)) break;
		if (ZI[i][0]==zI)
		{
			if (!(pGlobal->ae[i][0]==1093677635 && zI>0))
			{
				vA[eA][0]=pGlobal->ae[i][0];
				eA=eA+1;
			}
		}
		i=i+1;
	}
	return  vA[GetRandomInt(0,eA-1)][0];
}

void xA()
{
	timer t=GetExpiredTimer();
	integer uh=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	unit PR;
	integer p=GetPlayerId(GetOwningPlayer(pGlobal->Ii[uh][0]));
	integer oA;
	if (GetPlayerSlotState(GetOwningPlayer(pGlobal->Ii[uh][0]))!=PLAYER_SLOT_STATE_PLAYING)
	{
		sn(uh);
		LV(t);
		return ;
	}
	if (pGlobal->ca[pGlobal->J[p][0]][0]==1)
	{
		PR=CreateUnit(Player(p),1429221431,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
	}
	else 
	{
		PR=CreateUnit(Player(p),1429221432,GetUnitX(pGlobal->Ii[uh][0]),GetUnitY(pGlobal->Ii[uh][0]),GetUnitFacing(pGlobal->Ii[uh][0]));
	}
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathSmall\\UDeathSmall.mdl"),GetUnitX(PR),GetUnitY(PR)));
	SetHeroLevel(PR,pGlobal->Fa[pGlobal->J[p][0]][0],false);
	SE(Player(p),pGlobal->Fa[pGlobal->J[p][0]][0]);
	pGlobal->Ha[pGlobal->J[p][0]][0]=pGlobal->Ha[pGlobal->J[p][0]][0]+1;
	UnitAddItemById(PR,1227895113);
	SetPlayerState(Player(p),PLAYER_STATE_RESOURCE_GOLD,0xA*(pGlobal->Ca[pGlobal->J[p][0]][0]/ 60));
	oA=YI();
	if (GetOwningPlayer(PR)==fMyGetLocalPlayer())
	{
		SelectUnit(PR,true);
	}
	UnitAddAbility(PR,oA);
	UnitRemoveAbility(PR,oA);
	ShowUnit(pGlobal->Ii[uh][0],false);
	RemoveUnit(pGlobal->Ii[uh][0]);
	pGlobal->fa[pGlobal->J[p][0]][0]=oA;
	pGlobal->Da[pGlobal->J[p][0]][0]=R2I((pGlobal->bv+TimerGetElapsed(pGlobal->Bv)));
	pGlobal->Oa[pGlobal->J[p][0]][0]=PR;
	pGlobal->Xa[pGlobal->J[p][0]][0]=1;
	PX(true);
	kR();
	PR=NULL;
	sn(uh);
	LV(t);
}

void turnMinion___onTurnMinion()
{
	unit uC=GetSpellAbilityUnit();
	if (IsPointBlighted(GetUnitX(uC),GetUnitY(uC))==false)
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(GetOwningPlayer(uC),sMyString("You must be on blight to turn!"));
		return ;
	}
	UnitAddAbility(uC,1097625443);
	SetUnitFlyHeight(uC,20,60);
	TimerStart(lV(IE(uC)),3.,false,& xA);
	uC=NULL;
}

void rA()
{
	pGlobal->Xv[(1093677652)-1093677104][0]=((26));
	yI(1093677636);
	yI(1093677388);
	yI(1093677389);
	yI(1093677635);
}

void iA( integer aA, integer nA)
{
	unit uD=pGlobal->Oa[pGlobal->J[aA][0]][0];
	unit u;
	integer l;
	pGlobal->Xa[pGlobal->J[aA][0]][0]=2;
	pGlobal->da[pGlobal->J[aA][0]][0]=R2I((pGlobal->bv+TimerGetElapsed(pGlobal->Bv)));
	SetPlayerName(Player(aA),pGlobal->Ra[pGlobal->J[aA][0]][0]+sMyString(" (Dead)"));
	sR(aA);
	UR(aA);
	GroupEnumUnitsOfPlayer(pGlobal->rv,Player(aA),NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ((u==NULL)) break;
		if (GetUnitTypeId(u)!=1848651827&& u!=uD)
		{
			RemoveUnit(u);
		}
		GroupRemoveUnit(pGlobal->rv,u);
		u=FirstOfGroup(pGlobal->rv);
	}
	StartSound(pGlobal->ho);
	if (pGlobal->Ea[pGlobal->J[aA][0]][0]==2)
	{
		l=4;
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(aA))+sMyString(" the Ancient Vampire has been killed by ")+kX(Player(nA))+sMyString("|r"));
	}
	else if(pGlobal->Ea[pGlobal->J[aA][0]][0]==3)
	{
		l=2;
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(aA))+sMyString(" the Vampire has been killed by ")+kX(Player(nA))+sMyString("|r"));
	}
	GroupEnumUnitsInRange(pGlobal->rv,GetUnitX(uD),GetUnitY(uD),400,NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ((u==NULL)) break;
		if (aX(u))
		{
			SetHeroLevel(u,GetHeroLevel(u)+l,true);
		}
		GroupRemoveUnit(pGlobal->rv,u);
		u=FirstOfGroup(pGlobal->rv);
	}
	TerrainDeformRipple(GetUnitX(uD),GetUnitY(uD),0xC8,0xC8,0x7D0,1,5.33,4,1.5,false);
	PX(true);
	kR();
}

void RA( integer id, integer IA, integer un)
{
	pGlobal->ar[pGlobal->Er][0]=id;
	pGlobal->nr[pGlobal->Er][0]=IA;
	pGlobal->Vr[pGlobal->Er][0]=un;
	pGlobal->Er=pGlobal->Er+1;
}

void AA( integer NA, integer i0, integer i1, integer i2, integer i3, integer i4, integer i5)
{
	pGlobal->Nr[pGlobal->Cr][0]=NA;
	if (pGlobal->Cr==0)
	{
		pGlobal->Br[pGlobal->Cr][0]=0;
	}
	else 
	{
		pGlobal->Br[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr-1][0];
	}
	pGlobal->cr[pGlobal->Cr][0]=pGlobal->Br[pGlobal->Cr][0];
	if (i0!=0)
	{
		pGlobal->br[pGlobal->cr[pGlobal->Cr][0]][0]=i0;
		pGlobal->cr[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr][0]+1;
	}
	if (i1!=0)
	{
		pGlobal->br[pGlobal->cr[pGlobal->Cr][0]][0]=i1;
		pGlobal->cr[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr][0]+1;
	}
	if (i2!=0)
	{
		pGlobal->br[pGlobal->cr[pGlobal->Cr][0]][0]=i2;
		pGlobal->cr[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr][0]+1;
	}
	if (i3!=0)
	{
		pGlobal->br[pGlobal->cr[pGlobal->Cr][0]][0]=i3;
		pGlobal->cr[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr][0]+1;
	}
	if (i4!=0)
	{
		pGlobal->br[pGlobal->cr[pGlobal->Cr][0]][0]=i4;
		pGlobal->cr[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr][0]+1;
	}
	if (i5!=0)
	{
		pGlobal->br[pGlobal->cr[pGlobal->Cr][0]][0]=i5;
		pGlobal->cr[pGlobal->Cr][0]=pGlobal->cr[pGlobal->Cr][0]+1;
	}
	pGlobal->Cr=pGlobal->Cr+1;
}

void bA( unit u)
{
		sMyArray<boolean[1],CONST_MAX_SIZE_MASS> BA;
	integer r=0;
	integer i;
	integer j;
	boolean cA;
	while(true)
	{
		if ( r>=pGlobal->Cr) break;
		j=0;
		while(true)
		{
			if ( j>=UnitInventorySize(u)) break;
			BA[j][0]=false;
			j=j+1;
		}
		i=pGlobal->Br[r][0];
		cA=false;
		while(true)
		{
			if ( i>=pGlobal->cr[r][0]) break;
			j=0;
			cA=false;
			while(true)
			{
				if ( j>=UnitInventorySize(u)) break;
				if ((! BA[j][0])&& GetItemTypeId(UnitItemInSlot(u,j))==pGlobal->br[i][0])
				{
					cA=true;
					BA[j][0]=true;
					j=6;
				}
				j=j+1;
			}
			if (! cA)
			{
				i=pGlobal->cr[r][0];
			}
			i=i+1;
		}
		if (cA)
		{
			j=0;
			while(true)
			{
				if ( j>=UnitInventorySize(u)) break;
				if (BA[j][0])
				{
					RemoveItem(UnitItemInSlot(u,j));
				}
				j=j+1;
			}
			UnitAddItemById(u,pGlobal->Nr[r][0]);
			r=-1;
		}
		r=r+1;
	}
}

void CA()
{
	integer i=0;
	integer j;
	integer eV;
	integer id;
	unit u;
	integer m=0;
	DisableTrigger(pGlobal->Ar);
	while(true)
	{
		if ( m>=pGlobal->Rr) break;
		i=0;
		u=pGlobal->Xr[m][0];
		while(true)
		{
			if ( i>=pGlobal->Er) break;
			j=0;
			eV=0;
			while(true)
			{
				if ( j>=UnitInventorySize(u)) break;
				id=GetItemTypeId(UnitItemInSlot(u,j));
				if (id==pGlobal->ar[i][0]|| id==pGlobal->nr[i][0])
				{
					if (id==pGlobal->ar[i][0]&& eV>=pGlobal->Vr[i][0])
					{
						RemoveItem(UnitItemInSlot(u,j));
						UnitAddItemToSlotById(u,pGlobal->nr[i][0],j);
					}
					else if(id==pGlobal->nr[i][0]&& eV<pGlobal->Vr[i][0])
					{
						RemoveItem(UnitItemInSlot(u,j));
						UnitAddItemToSlotById(u,pGlobal->ar[i][0],j);
					}
					eV=eV+1;
				}
				j=j+1;
			}
			i=i+1;
		}
		m=m+1;
	}
	bA(u);
	EnableTrigger(pGlobal->Ar);
	u=NULL;
}

boolean dA()
{
	unit u;
	if (GetTriggerEventId()==EVENT_PLAYER_UNIT_PICKUP_ITEM|| GetTriggerEventId()==EVENT_PLAYER_UNIT_DROP_ITEM)
	{
		u=GetManipulatingUnit();
	}
	else 
	{
		u=GetBuyingUnit();
	}
	pGlobal->Xr[pGlobal->Rr][0]=u;
	pGlobal->Rr=pGlobal->Rr+1;
	TimerStart(pGlobal->Ir,.01,false,& CA);
	return  false;
}

void DA()
{
	integer i=0;
	pGlobal->Ar=dE();
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerUnitEvent(pGlobal->Ar,Player(i),EVENT_PLAYER_UNIT_PICKUP_ITEM,NULL);
		TriggerRegisterPlayerUnitEvent(pGlobal->Ar,Player(i),EVENT_PLAYER_UNIT_DROP_ITEM,NULL);
		TriggerRegisterPlayerUnitEvent(pGlobal->Ar,Player(i),EVENT_PLAYER_UNIT_SELL_ITEM,NULL);
		TriggerRegisterPlayerUnitEvent(pGlobal->Ar,Player(i),EVENT_PLAYER_UNIT_PAWN_ITEM,NULL);
		i=i+1;
	}
	TriggerAddCondition(pGlobal->Ar,Condition(& dA));
	RA(1227894862,1227894853,2);
	AA(1227894835,1227894855,1227894859,1227894871,0,0,0);
	AA(1227895095,1227894870,1668048493,1227894866,0,0,0);
}

void fA()
{
	integer b;
	b=fO(sMyString(0x34));
	gO(b,pGlobal->udg_rect3);
	gO(b,pGlobal->udg_rect4);
	gO(b,pGlobal->udg_rect5);
	gO(b,pGlobal->udg_rect6);
	b=fO(sMyString(0x39));
	gO(b,pGlobal->udg_rect7);
	gO(b,pGlobal->udg_rect8);
	b=fO(sMyString("10"));
	gO(b,pGlobal->udg_rect9);
	gO(b,pGlobal->udg_rect10);
	gO(b,pGlobal->udg_rect11);
	gO(b,pGlobal->udg_rect12);
	gO(b,pGlobal->udg_rect13);
	gO(b,pGlobal->udg_rect14);
	b=fO(sMyString("11"));
	gO(b,pGlobal->udg_rect15);
	gO(b,pGlobal->udg_rect16);
	gO(b,pGlobal->udg_rect17);
	gO(b,pGlobal->udg_rect18);
	b=fO(sMyString("12"));
	gO(b,pGlobal->udg_rect19);
	gO(b,pGlobal->udg_rect20);
	gO(b,pGlobal->udg_rect21);
	gO(b,pGlobal->udg_rect22);
	gO(b,pGlobal->udg_rect23);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect24);
	gO(b,pGlobal->udg_rect25);
	gO(b,pGlobal->udg_rect26);
	b=fO(sMyString(0x34));
	gO(b,pGlobal->udg_rect27);
	gO(b,pGlobal->udg_rect28);
	gO(b,pGlobal->udg_rect29);
	gO(b,pGlobal->udg_rect30);
	b=fO(sMyString(0x39));
	gO(b,pGlobal->udg_rect31);
	gO(b,pGlobal->udg_rect34);
	b=fO(sMyString("10"));
	gO(b,pGlobal->udg_rect35);
	gO(b,pGlobal->udg_rect37);
	gO(b,pGlobal->udg_rect38);
	gO(b,pGlobal->udg_rect39);
	gO(b,pGlobal->udg_rect40);
	gO(b,pGlobal->udg_rect41);
	gO(b,pGlobal->udg_rect42);
	b=fO(sMyString("11"));
	gO(b,pGlobal->udg_rect43);
	gO(b,pGlobal->udg_rect44);
	gO(b,pGlobal->udg_rect45);
	gO(b,pGlobal->udg_rect46);
	b=fO(sMyString("12"));
	gO(b,pGlobal->udg_rect47);
	gO(b,pGlobal->udg_rect48);
	gO(b,pGlobal->udg_rect49);
	gO(b,pGlobal->udg_rect50);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect53);
	gO(b,pGlobal->udg_rect54);
	gO(b,pGlobal->udg_rect55);
	b=fO(sMyString(0x34));
	gO(b,pGlobal->udg_rect56);
	gO(b,pGlobal->udg_rect58);
	gO(b,pGlobal->udg_rect59);
	gO(b,pGlobal->udg_rect60);
	b=fO(sMyString(0x39));
	gO(b,pGlobal->udg_rect61);
	gO(b,pGlobal->udg_rect62);
	b=fO(sMyString("10"));
	gO(b,pGlobal->udg_rect63);
	gO(b,pGlobal->udg_rect64);
	gO(b,pGlobal->udg_rect65);
	gO(b,pGlobal->udg_rect66);
	gO(b,pGlobal->udg_rect67);
	gO(b,pGlobal->udg_rect68);
	b=fO(sMyString("11"));
	gO(b,pGlobal->udg_rect69);
	gO(b,pGlobal->udg_rect70);
	b=fO(sMyString("12"));
	gO(b,pGlobal->udg_rect71);
	gO(b,pGlobal->udg_rect72);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect73);
	gO(b,pGlobal->udg_rect74);
	gO(b,pGlobal->udg_rect75);
	b=fO(sMyString(0x39));
	gO(b,pGlobal->udg_rect76);
	b=fO(sMyString("10"));
	gO(b,pGlobal->udg_rect77);
	gO(b,pGlobal->udg_rect78);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect79);
	gO(b,pGlobal->udg_rect80);
	gO(b,pGlobal->udg_rect81);
	b=fO(sMyString("24"));
	gO(b,pGlobal->udg_rect82);
	gO(b,pGlobal->udg_rect83);
	gO(b,pGlobal->udg_rect85);
	b=fO(sMyString(0x32));
	gO(b,pGlobal->udg_rect86);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect87);
	gO(b,pGlobal->udg_rect90);
	gO(b,pGlobal->udg_rect91);
	b=fO(sMyString("24"));
	gO(b,pGlobal->udg_rect92);
	gO(b,pGlobal->udg_rect93);
	gO(b,pGlobal->udg_rect94);
	gO(b,pGlobal->udg_rect95);
	b=fO(sMyString(0x33));
	gO(b,pGlobal->udg_rect96);
	gO(b,pGlobal->udg_rect97);
	b=fO(sMyString(0x32));
	gO(b,pGlobal->udg_rect98);
	gO(b,pGlobal->udg_rect99);
	gO(b,pGlobal->udg_rect100);
	gO(b,pGlobal->udg_rect102);
	gO(b,pGlobal->udg_rect103);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect104);
	gO(b,pGlobal->udg_rect105);
	gO(b,pGlobal->udg_rect106);
	b=fO(sMyString("23"));
	gO(b,pGlobal->udg_rect107);
	gO(b,pGlobal->udg_rect108);
	b=fO(sMyString("24"));
	gO(b,pGlobal->udg_rect109);
	gO(b,pGlobal->udg_rect110);
	gO(b,pGlobal->udg_rect111);
	gO(b,pGlobal->udg_rect112);
	b=fO(sMyString(0x33));
	gO(b,pGlobal->udg_rect113);
	gO(b,pGlobal->udg_rect114);
	gO(b,pGlobal->udg_rect115);
	b=fO(sMyString(0x32));
	gO(b,pGlobal->udg_rect116);
	gO(b,pGlobal->udg_rect117);
	gO(b,pGlobal->udg_rect118);
	gO(b,pGlobal->udg_rect119);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect120);
	gO(b,pGlobal->udg_rect121);
	b=fO(sMyString("23"));
	gO(b,pGlobal->udg_rect122);
	gO(b,pGlobal->udg_rect123);
	b=fO(sMyString("24"));
	gO(b,pGlobal->udg_rect124);
	gO(b,pGlobal->udg_rect125);
	gO(b,pGlobal->udg_rect126);
	gO(b,pGlobal->udg_rect127);
	b=fO(sMyString(0x33));
	gO(b,pGlobal->udg_rect128);
	gO(b,pGlobal->udg_rect129);
	gO(b,pGlobal->udg_rect130);
	b=fO(sMyString(0x32));
	gO(b,pGlobal->udg_rect131);
	gO(b,pGlobal->udg_rect132);
	b=fO(sMyString("13"));
	gO(b,pGlobal->udg_rect133);
	gO(b,pGlobal->udg_rect134);
	gO(b,pGlobal->udg_rect135);
	b=fO(sMyString("23"));
	gO(b,pGlobal->udg_rect136);
	gO(b,pGlobal->udg_rect137);
	b=fO(sMyString(0x33));
	gO(b,pGlobal->udg_rect138);
	b=fO(sMyString(0x32));
	gO(b,pGlobal->udg_rect139);
	gO(b,pGlobal->udg_rect140);
	b=fO(sMyString("23"));
	gO(b,pGlobal->udg_rect141);
	gO(b,pGlobal->udg_rect142);
	b=fO(sMyString(0x32));
	gO(b,pGlobal->udg_rect143);
	gO(b,pGlobal->udg_rect144);
	b=fO(sMyString("23"));
	gO(b,pGlobal->udg_rect145);
	gO(b,pGlobal->udg_rect146);
	b=fO(sMyString("14"));
	gO(b,pGlobal->udg_rect147);
	gO(b,pGlobal->udg_rect148);
	b=fO(sMyString("23"));
	gO(b,pGlobal->udg_rect149);
	b=fO(sMyString("14"));
	gO(b,pGlobal->udg_rect150);
	gO(b,pGlobal->udg_rect151);
	gO(b,pGlobal->udg_rect152);
	gO(b,pGlobal->udg_rect153);
	b=fO(sMyString(0x31));
	gO(b,pGlobal->udg_rect154);
	gO(b,pGlobal->udg_rect155);
	gO(b,pGlobal->udg_rect156);
	gO(b,pGlobal->udg_rect157);
	b=fO(sMyString("14"));
	gO(b,pGlobal->udg_rect158);
	gO(b,pGlobal->udg_rect159);
	gO(b,pGlobal->udg_rect160);
	gO(b,pGlobal->udg_rect161);
	b=fO(sMyString("26"));
	gO(b,pGlobal->udg_rect162);
	gO(b,pGlobal->udg_rect163);
	gO(b,pGlobal->udg_rect164);
	b=fO(sMyString(0x31));
	gO(b,pGlobal->udg_rect165);
	gO(b,pGlobal->udg_rect166);
	gO(b,pGlobal->udg_rect167);
	gO(b,pGlobal->udg_rect168);
	b=fO(sMyString("14"));
	gO(b,pGlobal->udg_rect169);
	gO(b,pGlobal->udg_rect170);
	gO(b,pGlobal->udg_rect171);
	b=fO(sMyString("25"));
	gO(b,pGlobal->udg_rect172);
	b=fO(sMyString("22"));
	gO(b,pGlobal->udg_rect173);
	b=fO(sMyString("26"));
	gO(b,pGlobal->udg_rect174);
	gO(b,pGlobal->udg_rect175);
	gO(b,pGlobal->udg_rect176);
	b=fO(sMyString(0x37));
	gO(b,pGlobal->udg_rect177);
	b=fO(sMyString(0x31));
	gO(b,pGlobal->udg_rect178);
	gO(b,pGlobal->udg_rect179);
	gO(b,pGlobal->udg_rect180);
	b=fO(sMyString("25"));
	gO(b,pGlobal->udg_rect181);
	gO(b,pGlobal->udg_rect182);
	gO(b,pGlobal->udg_rect183);
	b=fO(sMyString("22"));
	gO(b,pGlobal->udg_rect184);
	gO(b,pGlobal->udg_rect185);
	gO(b,pGlobal->udg_rect188);
	gO(b,pGlobal->udg_rect189);
	b=fO(sMyString("26"));
	gO(b,pGlobal->udg_rect190);
	gO(b,pGlobal->udg_rect192);
	b=fO(sMyString(0x37));
	gO(b,pGlobal->udg_rect193);
	gO(b,pGlobal->udg_rect194);
	b=fO(sMyString(0x31));
	gO(b,pGlobal->udg_rect195);
	gO(b,pGlobal->udg_rect196);
	gO(b,pGlobal->udg_rect197);
	b=fO(sMyString("25"));
	gO(b,pGlobal->udg_rect198);
	gO(b,pGlobal->udg_rect199);
	gO(b,pGlobal->udg_rect200);
	b=fO(sMyString("15"));
	gO(b,pGlobal->udg_rect201);
	gO(b,pGlobal->udg_rect202);
	b=fO(sMyString("22"));
	gO(b,pGlobal->udg_rect203);
	gO(b,pGlobal->udg_rect204);
	gO(b,pGlobal->udg_rect205);
	gO(b,pGlobal->udg_rect206);
	b=fO(sMyString("26"));
	gO(b,pGlobal->udg_rect207);
	gO(b,pGlobal->udg_rect208);
	b=fO(sMyString(0x37));
	gO(b,pGlobal->udg_rect209);
	gO(b,pGlobal->udg_rect210);
	b=fO(sMyString(0x31));
	gO(b,pGlobal->udg_rect211);
	gO(b,pGlobal->udg_rect212);
	gO(b,pGlobal->udg_rect213);
	b=fO(sMyString("25"));
	gO(b,pGlobal->udg_rect216);
	gO(b,pGlobal->udg_rect217);
	b=fO(sMyString("15"));
	gO(b,pGlobal->udg_rect218);
	gO(b,pGlobal->udg_rect219);
	gO(b,pGlobal->udg_rect220);
	b=fO(sMyString("22"));
	gO(b,pGlobal->udg_rect221);
	gO(b,pGlobal->udg_rect222);
	gO(b,pGlobal->udg_rect223);
	gO(b,pGlobal->udg_rect224);
	b=fO(sMyString("26"));
	gO(b,pGlobal->udg_rect225);
	gO(b,pGlobal->udg_rect226);
	b=fO(sMyString(0x37));
	gO(b,pGlobal->udg_rect227);
	gO(b,pGlobal->udg_rect228);
	b=fO(sMyString(0x31));
	gO(b,pGlobal->udg_rect229);
	gO(b,pGlobal->udg_rect230);
	gO(b,pGlobal->udg_rect231);
	b=fO(sMyString("25"));
	gO(b,pGlobal->udg_rect232);
	b=fO(sMyString("15"));
	gO(b,pGlobal->udg_rect233);
	gO(b,pGlobal->udg_rect234);
	gO(b,pGlobal->udg_rect235);
	b=fO(sMyString("22"));
	gO(b,pGlobal->udg_rect236);
	b=fO(sMyString(0x37));
	gO(b,pGlobal->udg_rect237);
	gO(b,pGlobal->udg_rect238);
	b=fO(sMyString("15"));
	gO(b,pGlobal->udg_rect239);
	gO(b,pGlobal->udg_rect240);
	gO(b,pGlobal->udg_rect241);
	gO(b,pGlobal->udg_rect242);
	gO(b,pGlobal->udg_rect243);
	gO(b,pGlobal->udg_rect244);
	b=fO(sMyString("19"));
	gO(b,pGlobal->udg_rect245);
	gO(b,pGlobal->udg_rect246);
	gO(b,pGlobal->udg_rect248);
	b=fO(sMyString(0x36));
	gO(b,pGlobal->udg_rect249);
	gO(b,pGlobal->udg_rect250);
	b=fO(sMyString("19"));
	gO(b,pGlobal->udg_rect251);
	gO(b,pGlobal->udg_rect252);
	gO(b,pGlobal->udg_rect253);
	gO(b,pGlobal->udg_rect254);
	gO(b,pGlobal->udg_rect255);
	b=fO(sMyString(0x36));
	gO(b,pGlobal->udg_rect256);
	gO(b,pGlobal->udg_rect257);
	b=fO(sMyString("21"));
	gO(b,pGlobal->udg_rect258);
	gO(b,pGlobal->udg_rect259);
	gO(b,pGlobal->udg_rect260);
	b=fO(sMyString("19"));
	gO(b,pGlobal->udg_rect262);
	gO(b,pGlobal->udg_rect263);
	gO(b,pGlobal->udg_rect264);
	gO(b,pGlobal->udg_rect265);
	gO(b,pGlobal->udg_rect266);
	b=fO(sMyString(0x36));
	gO(b,pGlobal->udg_rect267);
	gO(b,pGlobal->udg_rect268);
	b=fO(sMyString("16"));
	gO(b,pGlobal->udg_rect269);
	b=fO(sMyString("21"));
	gO(b,pGlobal->udg_rect270);
	gO(b,pGlobal->udg_rect271);
	gO(b,pGlobal->udg_rect272);
	gO(b,pGlobal->udg_rect273);
	b=fO(sMyString("19"));
	gO(b,pGlobal->udg_rect274);
	gO(b,pGlobal->udg_rect275);
	gO(b,pGlobal->udg_rect276);
	b=fO(sMyString(0x36));
	gO(b,pGlobal->udg_rect277);
	gO(b,pGlobal->udg_rect279);
	gO(b,pGlobal->udg_rect280);
	b=fO(sMyString("16"));
	gO(b,pGlobal->udg_rect281);
	gO(b,pGlobal->udg_rect282);
	gO(b,pGlobal->udg_rect283);
	b=fO(sMyString("21"));
	gO(b,pGlobal->udg_rect284);
	gO(b,pGlobal->udg_rect285);
	gO(b,pGlobal->udg_rect286);
	gO(b,pGlobal->udg_rect287);
	b=fO(sMyString("19"));
	gO(b,pGlobal->udg_rect288);
	b=fO(sMyString("16"));
	gO(b,pGlobal->udg_rect289);
	gO(b,pGlobal->udg_rect290);
	gO(b,pGlobal->udg_rect291);
	gO(b,pGlobal->udg_rect292);
	gO(b,pGlobal->udg_rect293);
	gO(b,pGlobal->udg_rect294);
	b=fO(sMyString("17"));
	gO(b,pGlobal->udg_rect295);
	gO(b,pGlobal->udg_rect296);
	b=fO(sMyString("16"));
	gO(b,pGlobal->udg_rect297);
	gO(b,pGlobal->udg_rect298);
	gO(b,pGlobal->udg_rect299);
	b=fO(sMyString(0x38));
	gO(b,pGlobal->udg_rect300);
	gO(b,pGlobal->udg_rect301);
	b=fO(sMyString("20"));
	gO(b,pGlobal->udg_rect302);
	gO(b,pGlobal->udg_rect303);
	b=fO(sMyString("17"));
	gO(b,pGlobal->udg_rect304);
	gO(b,pGlobal->udg_rect305);
	gO(b,pGlobal->udg_rect306);
	b=fO(sMyString(0x35));
	gO(b,pGlobal->udg_rect307);
	gO(b,pGlobal->udg_rect308);
	gO(b,pGlobal->udg_rect309);
	b=fO(sMyString(0x38));
	gO(b,pGlobal->udg_rect310);
	gO(b,pGlobal->udg_rect311);
	gO(b,pGlobal->udg_rect312);
	b=fO(sMyString("20"));
	gO(b,pGlobal->udg_rect313);
	gO(b,pGlobal->udg_rect314);
	gO(b,pGlobal->udg_rect315);
	b=fO(sMyString("18"));
	gO(b,pGlobal->udg_rect316);
	gO(b,pGlobal->udg_rect317);
	gO(b,pGlobal->udg_rect318);
	b=fO(sMyString("17"));
	gO(b,pGlobal->udg_rect319);
	gO(b,pGlobal->udg_rect320);
	gO(b,pGlobal->udg_rect321);
	gO(b,pGlobal->udg_rect322);
	gO(b,pGlobal->udg_rect323);
	b=fO(sMyString(0x35));
	gO(b,pGlobal->udg_rect326);
	gO(b,pGlobal->udg_rect327);
	gO(b,pGlobal->udg_rect328);
	gO(b,pGlobal->udg_rect329);
	b=fO(sMyString(0x38));
	gO(b,pGlobal->udg_rect330);
	gO(b,pGlobal->udg_rect331);
	gO(b,pGlobal->udg_rect332);
	b=fO(sMyString("20"));
	gO(b,pGlobal->udg_rect333);
	gO(b,pGlobal->udg_rect334);
	gO(b,pGlobal->udg_rect335);
	gO(b,pGlobal->udg_rect336);
	gO(b,pGlobal->udg_rect337);
	gO(b,pGlobal->udg_rect338);
	b=fO(sMyString("18"));
	gO(b,pGlobal->udg_rect339);
	gO(b,pGlobal->udg_rect340);
	gO(b,pGlobal->udg_rect341);
	gO(b,pGlobal->udg_rect342);
	b=fO(sMyString("17"));
	gO(b,pGlobal->udg_rect343);
	gO(b,pGlobal->udg_rect344);
	gO(b,pGlobal->udg_rect345);
	gO(b,pGlobal->udg_rect346);
	b=fO(sMyString(0x35));
	gO(b,pGlobal->udg_rect347);
	gO(b,pGlobal->udg_rect348);
	gO(b,pGlobal->udg_rect349);
	b=fO(sMyString(0x38));
	gO(b,pGlobal->udg_rect350);
	gO(b,pGlobal->udg_rect351);
	gO(b,pGlobal->udg_rect352);
	b=fO(sMyString("20"));
	gO(b,pGlobal->udg_rect353);
	gO(b,pGlobal->udg_rect354);
	gO(b,pGlobal->udg_rect355);
	gO(b,pGlobal->udg_rect356);
	gO(b,pGlobal->udg_rect357);
	gO(b,pGlobal->udg_rect358);
	b=fO(sMyString("18"));
	gO(b,pGlobal->udg_rect359);
	gO(b,pGlobal->udg_rect360);
	gO(b,pGlobal->udg_rect361);
	gO(b,pGlobal->udg_rect362);
	b=fO(sMyString("17"));
	gO(b,pGlobal->udg_rect363);
	gO(b,pGlobal->udg_rect364);
	b=fO(sMyString(0x35));
	gO(b,pGlobal->udg_rect365);
	gO(b,pGlobal->udg_rect366);
	gO(b,pGlobal->udg_rect367);
}

void FA()
{
	texttag t;
	t=CreateTextTag();
	SetTextTagText(t,sMyString("Dance|nPool"),.023);
	SetTextTagPos(t,GetRectCenterX(pGlobal->oo),GetRectCenterY(pGlobal->oo),0);
	SetTextTagColor(t,0xFF,0xFF,0xFF,0xFF);
	t=CreateTextTag();
	SetTextTagText(t,sMyString("Slayers|nLevel|nHere"),.023);
	SetTextTagPos(t,GetRectCenterX(pGlobal->ro),GetRectCenterY(pGlobal->ro),0);
	SetTextTagColor(t,0xFF,0xFF,0xFF,0xFF);
	t=NULL;
}

void gA()
{
	integer i=0;
	integer j;
	fogmodifier fm;
	boolean ally;
	while(true)
	{
		if ( i>0xB) break;
		fm=CreateFogModifierRect(Player(i),FOG_OF_WAR_FOGGED,GetWorldBounds(),true,false);
		FogModifierStart(fm);
		pGlobal->Va[pGlobal->J[i][0]][0]=i;
		if (GetPlayerSlotState(Player(i))==PLAYER_SLOT_STATE_PLAYING)
		{
			if (i>=0xA)
			{
				pGlobal->Ea[pGlobal->J[i][0]][0]=2;
				pGlobal->M=true;
			}
			else 
			{
				pGlobal->Ea[pGlobal->J[i][0]][0]=1;
				pGlobal->L=true;
			}
			pGlobal->Xa[pGlobal->J[i][0]][0]=1;
		}
		SetPlayerState(Player(i),PLAYER_STATE_GIVES_BOUNTY,1);
		if (pGlobal->Ea[pGlobal->J[i][0]][0]==1)
		{
			SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,0);
			SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_LUMBER,50);
			j=0;
			while(true)
			{
				if ( j>pGlobal->S) break;
				SetPlayerTechMaxAllowed(Player(i),pGlobal->Q[j][0],0);
				j=j+1;
			}
			pGlobal->Oa[pGlobal->J[i][0]][0]=CreateUnit(Player(i),bE(i),GetRectMinX(pGlobal->ao)+(GetRectMaxX(pGlobal->ao)-GetRectMinX(pGlobal->ao))*(i-i/ 5*5)/ 4,GetRectMaxY(pGlobal->ao)-(GetRectMaxY(pGlobal->ao)-GetRectMinY(pGlobal->ao))*(i/ 5),90);
			pGlobal->ca[pGlobal->J[i][0]][0]=1;
			if (fMyGetUnitName(pGlobal->Oa[pGlobal->J[i][0]][0])!=sMyString("Human") && StringCase(fMyGetUnitName(pGlobal->Oa[pGlobal->J[i][0]][0]),false)!=StringCase(GetPlayerName(Player(i)),false))
			{
				PauseUnit(pGlobal->Oa[pGlobal->J[i][0]][0],true);
			}
			if (fMyGetLocalPlayer()==Player(i))
			{
				ClearSelection();
				SelectUnit(pGlobal->Oa[pGlobal->J[i][0]][0],true);
			}
		}
		else 
		{
			SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,0);
			SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_LUMBER,0);
		}
		SetPlayerAbilityAvailable(Player(i),1093677141,false);
		SetPlayerTechMaxAllowed(Player(i),1749445735,1);
		SetPlayerTechMaxAllowed(Player(i),1747989040,1);
		SetPlayerTechMaxAllowed(Player(i),1848651825,3);
		SetPlayerTechMaxAllowed(Player(i),1747988554,2);
		SetPlayerTechMaxAllowed(Player(i),1752528689,48);
		SetPlayerTechMaxAllowed(Player(i),1747988535,0xC);
		SetPlayerTechMaxAllowed(Player(i),1747988545,8);
		SetPlayerTechMaxAllowed(Player(i),1747988555,6);
		SetPlayerTechMaxAllowed(Player(i),1747988564,6);
		SetPlayerTechMaxAllowed(Player(i),1750364016,21);
		SetPlayerTechMaxAllowed(Player(i),1865429043,21);
		SetPlayerTechMaxAllowed(Player(i),1747988529,0xC);
		SetPlayerTechMaxAllowed(Player(i),1747988528,0xC);
		SetPlayerTechMaxAllowed(Player(i),1747988821,1);
		SetPlayerTechMaxAllowed(Player(i),1749566036,1);
		SetPlayerTechMaxAllowed(Player(i),1865429047,4);
		i=i+1;
	}
	i=(0)-1;
	while(true)
	{
		i=i+1;
		if ( i>(0xB)) break;
		j=(0)-1;
		while(true)
		{
			j=j+1;
			if ( j>(0xB)) break;
			if (i!=j&& pGlobal->Ea[pGlobal->J[i][0]][0]==pGlobal->Ea[pGlobal->J[j][0]][0])
			{
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_PASSIVE,true);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_HELP_REQUEST,true);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_HELP_RESPONSE,true);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_XP,true);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_SPELLS,true);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_VISION,true);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_CONTROL,false);
				SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_ADVANCED_CONTROL,false);
			}
		}
	}
	PX(false);
}

void GA( boolean hA)
{
	quest q=CreateQuest();
	QuestSetTitle(q,pGlobal->dr);
	QuestSetDescription(q,pGlobal->fr);
	QuestSetIconPath(q,pGlobal->Dr);
	QuestSetRequired(q,hA);
	QuestSetDiscovered(q,true);
	QuestSetCompleted(q,false);
	q=NULL;
}

void HA()
{
	pGlobal->dr=sMyString("Instructions (Humans)");
	pGlobal->Dr=sMyString("ReplaceableTextures\\CommandButtons\\BTNPeasant.blp");
	pGlobal->fr=sMyString("How to Win|nKill all vampires. Killing vampires will give you precious gold.|n|nHow to get gold|nWait till 15 minutes|nCollect gold coins|nKill vampires big and small|n|n");
	GA(true);
	pGlobal->dr=sMyString("Instructions (Vampires)");
	pGlobal->Dr=sMyString("ReplaceableTextures\\CommandButtons\\BTNPeasant.blp");
	pGlobal->fr=sMyString("How to Win|nKill all Humans. Killed humans will turn to your team unless -nomini is on.|n|nHow to get wood|nWait till 15 minutes|nGet Urn of Dracula (gives gold too)");
	GA(true);
	pGlobal->dr=sMyString("Commands");
	pGlobal->Dr=sMyString("ReplaceableTextures\\WorldEditUI\\Editor-Random-Item.blp");
	pGlobal->fr=sMyString("-kick <color>|n-allow <color>|n-disallow <color>|n-show");
	GA(true);
	pGlobal->dr=sMyString("Credits");
	pGlobal->Dr=sMyString("ReplaceableTextures\\CommandButtons\\BTNAmbush.blp");
	pGlobal->fr=sMyString("Map developers:|nSkillet-Collide, Cheekything, Caesio, LordKintaro, d07.RiV, Littletiger, Davethebat");
	GA(false);
	pGlobal->dr=sMyString("More Credits");
	pGlobal->Dr=sMyString("ReplaceableTextures\\CommandButtons\\BTNAmbush.blp");
	pGlobal->fr=sMyString("We would like to thank everybody who has contributed to the development and testing of Vampirism Fire, as well as the rest of the community for their continued support.");
	GA(false);
	pGlobal->dr=sMyString("Blood?");
	pGlobal->Dr=sMyString("ReplaceableTextures\\CommandButtons\\BTNAmbush.blp");
	pGlobal->fr=sMyString("Blood spots can be defended through the use of feeding boxes but preferably Blood Boxes... however dont let them die to the vampires...");
	GA(false);
	pGlobal->dr=sMyString(0x02);
	pGlobal->Dr=sMyString(0x02);
	pGlobal->fr=sMyString(0x02);
	DestroyTimer(GetExpiredTimer());
}

void jA()
{
	timer t=CreateTimer();
	TimerStart(t,.0,false,& HA);
	t=NULL;
}

void JA()
{
	pGlobal->gr=(pGlobal->gr)+1;
	while(true)
	{
		pGlobal->gr=pGlobal->gr-1;
		if ( pGlobal->gr<(0)) break;
		bR(pGlobal->Fr[pGlobal->gr][0]);
		pGlobal->Fr[pGlobal->gr][0]=NULL;
	}
	DestroyTimer(GetExpiredTimer());
}

void kA( integer id)
{
	pGlobal->Fr[pGlobal->gr][0]=CreateUnit(Player(0xF),id,0xA28,6400,270);
	pGlobal->gr=pGlobal->gr+1;
}

void KA()
{
	timer t=CreateTimer();
	TimerStart(t,.0,false,& JA);
	t=NULL;
	kA(1429221445);
	kA(1160785969);
	kA(1160785970);
	kA(1095128646);
	kA(1429221443);
	kA(1429221442);
	kA(1429221451);
	kA(1429221444);
	kA(1429221433);
	kA(1429221431);
	kA(1429221432);
	kA(1429221441);
	kA(1213430093);
	kA(1211117900);
	Preloader(sMyString("scripts\\VampirismFire.pld"));
}

boolean lA()
{
	unit u=GetSoldUnit();
	integer i=0;
	integer j=0;
	while(true)
	{
		if ( i>pGlobal->S) break;
		if (GetUnitTypeId(u)==pGlobal->Q[i][0])
		{
			while(true)
			{
				if ( j>pGlobal->S) break;
				SetPlayerTechMaxAllowed(GetOwningPlayer(u),pGlobal->Q[j][0],0);
				j=j+1;
			}
			NX(u,pGlobal->no);
			SetHeroLevel(u,3,false);
			SetUnitVertexColor(u,32,0,0,0xE0);
			UnitAddItemById(u,1227895113);
			ShowUnit(u,false);
			pGlobal->Oa[(pGlobal->J[GetPlayerId((GetOwningPlayer(u)))][0])][0]=u;
		}
		i=i+1;
	}
	u=NULL;
	return  false;
}

void LA()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_SELL,NULL);
	TriggerAddCondition(eX,Condition(& lA));
	eX=NULL;
}

void mA()
{
	group g=CreateGroup();
	group d;
	unit u;
	unit v;
	integer p;
	GroupEnumUnitsInRect(g,pGlobal->Zx,NULL);
	while(true)
	{
		u=FirstOfGroup(g);
		if ( u==NULL) break;
		GroupRemoveUnit(g,u);
		p=GetPlayerId(GetOwningPlayer(u));
		if (pGlobal->Ea[pGlobal->J[p][0]][0]==1)
		{
			if (u==pGlobal->Oa[pGlobal->J[p][0]][0])
			{
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xA,kX(Player(p))+sMyString(" has been obliterated by the exploding portal"));
				pGlobal->Xa[pGlobal->J[p][0]][0]=2;
				pO(Player(p));
				d=CreateGroup();
				GroupEnumUnitsOfPlayer(d,Player(p),NULL);
				while(true)
				{
					v=FirstOfGroup(d);
					if ( v==NULL) break;
					GroupRemoveUnit(d,v);
					RemoveUnit(v);
				}
				DestroyGroup(d);
				SetPlayerName(Player(p),pGlobal->Ra[pGlobal->J[p][0]][0]+sMyString(" (Dead)"));
			}
			else 
			{
				JX(u);
			}
		}
	}
	DestroyGroup(g);
	PX(true);
	g=NULL;
	d=NULL;
	u=NULL;
	v=NULL;
}

void MA()
{
	integer i=0;
	integer eV=0;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Ea[pGlobal->J[i][0]][0]==2&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL)
		{
			eV=eV+1;
			ShowUnit(pGlobal->Oa[pGlobal->J[i][0]][0],true);
			if (fMyGetLocalPlayer()==Player(i))
			{
				ClearSelection();
				SelectUnit(pGlobal->Oa[pGlobal->J[i][0]][0],true);
			}
		}
		i=i+1;
	}
	if (eV==1)
	{
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==2&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL)
			{
				UnitAddItemById(pGlobal->Oa[pGlobal->J[i][0]][0],1937012592);
			}
			i=i+1;
		}
	}
	mA();
	eI();
}

void pA()
{
	integer i=0;
	integer j;
	integer r;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Ea[pGlobal->J[i][0]][0]==2&& pGlobal->Xa[pGlobal->J[i][0]][0]==1&& pGlobal->Oa[pGlobal->J[i][0]][0]==NULL)
		{
			r=GetRandomInt(0,pGlobal->S-1);
			pGlobal->Oa[pGlobal->J[i][0]][0]=CreateUnit(Player(i),pGlobal->Q[r][0],GetRectCenterX(pGlobal->no),GetRectCenterY(pGlobal->no),270);
			j=0;
			while(true)
			{
				if ( j>=pGlobal->S) break;
				SetPlayerTechMaxAllowed(Player(i),pGlobal->Q[j][0],0);
				j=j+1;
			}
			NX(pGlobal->Oa[pGlobal->J[i][0]][0],pGlobal->no);
			SetHeroLevel(pGlobal->Oa[pGlobal->J[i][0]][0],3,false);
			pGlobal->Ha[pGlobal->J[i][0]][0]=3;
			YR(pGlobal->Oa[pGlobal->J[i][0]][0]);
			UnitAddItemById(pGlobal->Oa[pGlobal->J[i][0]][0],1227895113);
			ShowUnit(pGlobal->Oa[pGlobal->J[i][0]][0],false);
		}
		i=i+1;
	}
}

void PA()
{
	pGlobal->Hr=pGlobal->Hr-1;
	if (pGlobal->Hr>0)
	{
		TimerStart(pGlobal->hr,pGlobal->Hr,false,& PA);
		PauseTimer(pGlobal->hr);
	}
	else 
	{
		DestroyTimerDialog(pGlobal->Gr);
		DestroyTimer(pGlobal->hr);
		pGlobal->Gr=NULL;
		pGlobal->hr=NULL;
		MA();
		PauseTimer(GetExpiredTimer());
		DestroyTimer(GetExpiredTimer());
	}
}

void qA()
{
	timer t=GetExpiredTimer();
	TimerStart(t,50.,false,& pA);
	pGlobal->Hr=55;
	pGlobal->hr=CreateTimer();
	TimerStart(pGlobal->hr,pGlobal->Hr,false,& PA);
	PauseTimer(pGlobal->hr);
	pGlobal->Gr=CreateTimerDialog(pGlobal->hr);
	TimerDialogSetTitle(pGlobal->Gr,sMyString("Vampires arrive"));
	TimerDialogSetTimeColor(pGlobal->Gr,0xFF,4,4,0xFF);
	TimerDialogDisplay(pGlobal->Gr,true);
	t=CreateTimer();
	TimerStart(t,1.,true,& PA);
	t=NULL;
}

void QA()
{
	timer t=CreateTimer();
	TimerStart(t,.01,false,& qA);
	t=NULL;
}

boolean sA()
{
	integer i;
	integer j;
	boolean SA;
	integer AO;
	integer LX;
	integer tA=0;
	integer TA=0xC;
	unit u;
	unit rc;
	pGlobal->K=pGlobal->K+1;
	AO=pGlobal->K/ TA;
	LX=AO*100;
	if (pGlobal->K==0xC)
	{
		i=0;
		while(true)
		{
			SetPlayerTechResearched(Player(i),1378889813,1);
			if ( i==0xB) break;
			i=i+1;
		}
	}
	if ((pGlobal->K==(pGlobal->K/ TA)*TA)&& pGlobal->K<60)
	{
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==1&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL && pGlobal->Xa[pGlobal->J[i][0]][0]==1)
			{
				if (AO==1)
				{
					lX(Player(i),2,0);
					DisplayTimedTextToPlayer(Player(i),0,0,0xA,sMyString("|cffffcc00You have survived for ")+fMyI2S(pGlobal->K)+sMyString(" minutes! All humans have now gained 2 gold!|r"));
				}
				DisplayTimedTextToPlayer(Player(i),0,0,0xA,sMyString("|cffff0022The Ancient Evils have acquired ")+fMyI2S(LX)+sMyString(" gold!|r"));
			}
			else if(pGlobal->Ea[pGlobal->J[i][0]][0]!=1&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL && pGlobal->Xa[pGlobal->J[i][0]][0]==1)
			{
				lX(Player(i),LX,tA);
				if (AO==1)
				{
					DisplayTimedTextToPlayer(Player(i),0,0,0xA,sMyString("|cffffcc00The Humans have acquired 2 gold! They can now all construct the <Human's Vault>|r"));
				}
				DisplayTimedTextToPlayer(Player(i),0,0,0xA,sMyString("|cffff0022You have acquired ")+fMyI2S(LX)+sMyString(" gold! Use it wisely...|r"));
			}
			i=i+1;
		}
	}
	i=0;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Ea[pGlobal->J[i][0]][0]!=1&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL && pGlobal->Xa[pGlobal->J[i][0]][0]==1)
		{
			j=0;
			SA=false;
			rc=oX(Player(i));
			while(true)
			{
				if ( j>=UnitInventorySize(pGlobal->Oa[pGlobal->J[i][0]][0])) break;
				if (UnitItemInSlot(pGlobal->Oa[pGlobal->J[i][0]][0],j)!=NULL && GetItemTypeId(UnitItemInSlot(pGlobal->Oa[pGlobal->J[i][0]][0],j))==1227894873)
				{
					SA=true;
				}
				if ( SA) break;
				j=j+1;
			}
			j=0;
			while(true)
			{
				if ( j>=UnitInventorySize(rc)) break;
				if (UnitItemInSlot(rc,j)!=NULL && GetItemTypeId(UnitItemInSlot(rc,j))==1227894873)
				{
					SA=true;
				}
				if ( SA) break;
				j=j+1;
			}
			if (SA)
			{
				if (pGlobal->f>1)
				{
					lX(Player(i),25*AO,0);
				}
				else 
				{
					lX(Player(i),35*AO,0);
				}
			}
		}
		i=i+1;
	}
	return  false;
}

void uA()
{
	trigger eX=dE();
	TriggerRegisterTimerEvent(eX,60,true);
	TriggerAddCondition(eX,Condition(& sA));
}

boolean UA()
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Ea[pGlobal->J[i][0]][0]==2)
		{
			if ((pGlobal->bv+TimerGetElapsed(pGlobal->Bv))-pGlobal->ba[pGlobal->J[i][0]][0]<90)
			{
				pGlobal->on[i][0]=pGlobal->on[i][0]+25;
			}
			if (pGlobal->Xa[pGlobal->J[i][0]][0]==1&& pGlobal->ha[pGlobal->J[i][0]][0]<pGlobal->on[i][0])
			{
				lX(Player(i),pGlobal->on[i][0]-pGlobal->ha[pGlobal->J[i][0]][0],0);
				pGlobal->ha[pGlobal->J[i][0]][0]=pGlobal->on[i][0];
			}
		}
		i=i+1;
	}
	return  false;
}

boolean wA()
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		if ((pGlobal->Ea[pGlobal->J[i][0]][0]==1 ||(pGlobal->bv+TimerGetElapsed(pGlobal->Bv))-pGlobal->ba[pGlobal->J[i][0]][0]<60)&& pGlobal->rn[i][0]<0xF)
		{
			pGlobal->rn[i][0]=pGlobal->rn[i][0]+1;
		}
		if (pGlobal->Ea[pGlobal->J[i][0]][0]!=1&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL && GetHeroLevel(pGlobal->Oa[pGlobal->J[i][0]][0])<pGlobal->rn[i][0])
		{
			SetHeroLevel(pGlobal->Oa[pGlobal->J[i][0]][0],pGlobal->rn[i][0],true);
		}
		i=i+1;
	}
	return  false;
}

void WA()
{
	integer i=0;
	trigger eX=dE();
	TriggerRegisterTimerEvent(eX,90.,true);
	TriggerAddCondition(eX,Condition(& UA));
	eX=dE();
	TriggerRegisterTimerEvent(eX,60.,true);
	TriggerAddCondition(eX,Condition(& wA));
	eX=NULL;
}

boolean yA()
{
	pGlobal->ba[(pGlobal->J[GetPlayerId((GetTriggerPlayer()))][0])][0]=(pGlobal->bv+TimerGetElapsed(pGlobal->Bv));
	return  false;
}

boolean YA()
{
	integer i=0;
	integer s=pGlobal->Ea[(pGlobal->J[GetPlayerId((GetTriggerPlayer()))][0])][0];
	while(true)
	{
		if ( i>0xB) break;
		if ((s==1 || pGlobal->Ea[pGlobal->J[i][0]][0]!=1)&& pGlobal->Xa[pGlobal->J[i][0]][0]==1&&(pGlobal->bv+TimerGetElapsed(pGlobal->Bv))-pGlobal->ba[pGlobal->J[i][0]][0]>60)
		{
			DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,0xA,kX(Player(i))+sMyString(" has been afk for ")+fE((pGlobal->bv+TimerGetElapsed(pGlobal->Bv))-pGlobal->ba[pGlobal->J[i][0]][0]));
		}
		i=i+1;
	}
	return  false;
}

void zA()
{
	trigger eX=CreateTrigger();
	HE(eX,EVENT_PLAYER_UNIT_ISSUED_ORDER,NULL);
	HE(eX,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,NULL);
	HE(eX,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,NULL);
	TriggerAddCondition(eX,Condition(& yA));
	eX=CreateTrigger();
	JE(eX,sMyString("-afk"),true);
	TriggerAddCondition(eX,Condition(& YA));
	eX=NULL;
}

boolean ZA()
{
	if (fMyGetLocalPlayer()==GetTriggerPlayer())
	{
		lO(5.);
	}
	return  false;
}

void vN()
{
	trigger eX=dE();
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-bases"),true);
		i=i+1;
	}
	TriggerAddCondition(eX,Condition(& ZA));
	eX=NULL;
}

boolean eN()
{
	if (fMyGetLocalPlayer()==GetTriggerPlayer())
	{
		ClearTextMessages();
	}
	return  false;
}

void xN()
{
	trigger eX=dE();
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-clear"),true);
		i=i+1;
	}
	TriggerAddCondition(eX,Condition(& eN));
	eX=NULL;
}

integer oN( integer n)
{
	if (n>=8)
	{
		return  n-3;
	}
	else if(n>=6)
	{
		return  n-2;
	}
	else if(n>=3)
	{
		return  n-1;
	}
	return  n;
}

void rN( player pK)
{
	integer p=GetPlayerId(pK);
	if (fMyGetLocalPlayer()==pK)
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xE10,sMyString("|cffff0000You have been removed from the game.|r"));
	}
	else 
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,60,kX(pK)+sMyString("|cffff0000 has been removed from the game.|r"));
	}
	RemovePlayer(pK,PLAYER_GAME_RESULT_DEFEAT);
	if (pGlobal->Ea[pGlobal->J[p][0]][0]==1)
	{
		if (pGlobal->Xa[pGlobal->J[p][0]][0]==1)
		{
			pGlobal->Xa[pGlobal->J[p][0]][0]=3;
			SetPlayerName(pK,pGlobal->Ra[pGlobal->J[p][0]][0]+sMyString(" (Kicked)"));
			MI(p);
		}
		else if(pGlobal->Xa[pGlobal->J[p][0]][0]==2)
		{
			pGlobal->Xa[pGlobal->J[p][0]][0]=3;
			SetPlayerName(pK,pGlobal->Ra[pGlobal->J[p][0]][0]+sMyString(" (Dead & Kicked)"));
		}
	}
	else if(pGlobal->Ea[pGlobal->J[p][0]][0]==3&& pGlobal->Xa[pGlobal->J[p][0]][0]==2)
	{
		pGlobal->Xa[pGlobal->J[p][0]][0]=3;
		SetPlayerName(pK,pGlobal->Ra[pGlobal->J[p][0]][0]+sMyString(" (Dead & Kicked)"));
	}
	PX(true);
}

void iN()
{
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		pGlobal->kr[i][0]=0;
		i=i+1;
	}
	pGlobal->jr=NULL;
	PauseTimer(pGlobal->Jr);
}

void aN()
{
	integer pL=GetPlayerId(fMyGetLocalPlayer());
	if (pGlobal->Ea[pGlobal->J[pL][0]][0]==1&& pGlobal->Xa[pGlobal->J[pL][0]][0]==1)
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xF,sMyString("|cffffcc00Votekick has expired without enough votes|r"));
	}
	iN();
}

boolean nN()
{
	integer r;
	integer p=GetPlayerId(GetTriggerPlayer());
	integer VN=0;
	integer EN=0;
	integer i=0;
	integer ZO;
	sMyString NA;
	integer pL=GetPlayerId(fMyGetLocalPlayer());
	if (GetEventPlayerChatString()==sMyString("-yes"))
	{
		r=1;
		NA=sMyString("yes\\");
	}
	else 
	{
		r=-1;
		NA=sMyString("no\\");
	}
	if (pGlobal->jr!=NULL)
	{
		ZO=pGlobal->kr[p][0];
		pGlobal->kr[p][0]=r;
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==1&& pGlobal->Xa[pGlobal->J[i][0]][0]==1)
			{
				if (pGlobal->kr[i][0]<0)
				{
					EN=EN+1;
				}
				else if(pGlobal->kr[i][0]>0)
				{
					VN=VN+1;
				}
			}
			i=i+1;
		}
		if (VN>=oN(pGlobal->D))
		{
			rN(pGlobal->jr);
			iN();
		}
		else if(pGlobal->D-EN<oN(pGlobal->D))
		{
			if (pGlobal->Ea[pGlobal->J[pL][0]][0]==1&& pGlobal->Xa[pGlobal->J[pL][0]][0]==1)
			{
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xF,sMyString("|cffffcc00Too many players voted against the kick|r"));
			}
			iN();
		}
		else 
		{
			if (pGlobal->Ea[pGlobal->J[pL][0]][0]==1&& pGlobal->Xa[pGlobal->J[pL][0]][0]==1)
			{
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,0xF,kX(GetTriggerPlayer())+sMyString("|cffffcc00 voted ")+NA+sMyString(". ")+fMyI2S(oN(pGlobal->D)-VN)+sMyString(" more votes are needed to pass|r"));
			}
		}
	}
	return  false;
}

boolean XN()
{
	integer i;
	sMyString s=GetEventPlayerChatString();
	player pK=MX(fMySubString(s,6,StringLength(s)));
	integer iK=GetPlayerId(pK);
	integer iT=GetPlayerId(GetTriggerPlayer());
	integer iL=GetPlayerId(fMyGetLocalPlayer());
	if (pK==NULL)
	{
		return  false;
	}
	if (pGlobal->Ea[pGlobal->J[iT][0]][0]==1&& pGlobal->Xa[pGlobal->J[iT][0]][0]==1&& pGlobal->Ea[pGlobal->J[iK][0]][0]==1&& pGlobal->Xa[pGlobal->J[iK][0]][0]!=3&& iT!=iK&& pGlobal->Ba[pGlobal->J[iK][0]][0]!=3)
	{
		if (pGlobal->jr!=NULL)
		{
			DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15.,sMyString("|cffff0000Votekick already in progress|r"));
		}
		else 
		{
			if (pGlobal->Ea[pGlobal->J[iL][0]][0]==1&& pGlobal->Xa[pGlobal->J[iL][0]][0]==1)
			{
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,60.,sMyString("|cffffcc00Votekick against player ")+kX(pK)+sMyString("|cffffcc00 has been initiated by ")+kX(Player(iT)));
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,60.,sMyString("|cffffcc00Type -yes or -no to vote for or against the kick. ")+fMyI2S(oN(pGlobal->D))+sMyString(" votes are needed to pass|r"));
			}
			pGlobal->jr=pK;
			TimerStart(pGlobal->Jr,60.,false,& aN);
			while(true)
			{
				if ( i>0xB) break;
				pGlobal->kr[i][0]=0;
				i=i+1;
			}
			pGlobal->kr[iT][0]=1;
		}
	}
	else if(pGlobal->Ea[pGlobal->J[iT][0]][0]==2&& pGlobal->Xa[pGlobal->J[iT][0]][0]==1&& pGlobal->Ea[pGlobal->J[iK][0]][0]==3&& pGlobal->Xa[pGlobal->J[iK][0]][0]==2&& iT!=iK&& pGlobal->Ba[pGlobal->J[iK][0]][0]!=3)
	{
		rN(pK);
	}
	return  false;
}

void ON()
{
	trigger eX=dE();
	trigger RN=dE();
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-kick "),false);
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-boot "),false);
		TriggerRegisterPlayerChatEvent(RN,Player(i),sMyString("-yes"),true);
		TriggerRegisterPlayerChatEvent(RN,Player(i),sMyString("-no"),true);
		i=i+1;
	}
	TriggerAddCondition(eX,Condition(& XN));
	TriggerAddCondition(RN,Condition(& nN));
}

boolean IN_2()
{
	integer p=GetPlayerId(GetTriggerPlayer());
	boolean AN=(GetEventPlayerChatString()==sMyString("-yesmini"));
	if (pGlobal->Ea[pGlobal->J[p][0]][0]!=1&& pGlobal->Aa[pGlobal->J[p][0]][0]!=AN)
	{
		if (AN)
		{
			DisplayTextToPlayer(Player(p),0,0,sMyString("|cffffcc00Humans you kill will now revive as your minions (cancel with -nomini)|r"));
		}
		else 
		{
			DisplayTextToPlayer(Player(p),0,0,sMyString("|cffffcc00Humans you kill will no longer revive as your minions (cancel with -yesmini)|r"));
		}
	}
	pGlobal->Aa[pGlobal->J[p][0]][0]=AN;
	return  false;
}

void NN()
{
	trigger eX=dE();
	integer i;
	i=(0)-1;
	while(true)
	{
		i=i+1;
		if ( i>(0xB)) break;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-nomini"),true);
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-yesmini"),true);
	}
	TriggerAddCondition(eX,Condition(& IN_2));
	eX=NULL;
}

sMyString bN( sMyString s)
{
	while(true)
	{
		if ( StringLength(s)==0) break;
		if ( fMySubString(s,0,1)!=sMyString(0x20)) break;
		s=fMySubString(s,1,StringLength(s));
	}
	while(true)
	{
		if ( StringLength(s)==0) break;
		if ( fMySubString(s,StringLength(s)-1,StringLength(s))!=sMyString(0x20)) break;
		s=fMySubString(s,0,StringLength(s)-1);
	}
	return  s;
}

integer BN( sMyString s)
{
	sMyString d=sMyString("0123456789");
	integer r=0;
	integer i=0;
	integer m;
	sMyString c;
	if (s==sMyString(0x02))
	{
		return -1;
	}
	while(true)
	{
		if ( i>=StringLength(s)) break;
		c=fMySubString(s,i,i+1);
		m=0;
		while(true)
		{
			if ( m>=0xA) break;
			if ( fMySubString(d,m,m+1)==c) break;
			m=m+1;
		}
		if (m<0xA)
		{
			r=r*0xA+m;
		}
		else if(c==sMyString(0x6B) || c==sMyString(0x4B))
		{
			if (i<StringLength(s)-1)
			{
				return -1;
			}
			r=r*0x3E8;
		}
		else 
		{
			return -1;
		}
		if (r>=0xF4240)
		{
			return  0xF4240;
		}
		i=i+1;
	}
	return  r;
}

void cN( sMyString s)
{
	integer i;
	pGlobal->Kr=NULL;
	pGlobal->lr=0;
	s=bN(s);
	i=StringLength(s)-1;
	while(true)
	{
		if ( i<0) break;
		if ( fMySubString(s,i,i+1)==sMyString(0x20)) break;
		i=i-1;
	}
	if (i<0)
	{
		return ;
	}
	pGlobal->lr=BN(fMySubString(s,i+1,StringLength(s)));
	if (pGlobal->lr>=0)
	{
		pGlobal->Kr=MX(bN(fMySubString(s,0,i)));
	}
}

boolean CN()
{
	sMyString s=GetEventPlayerChatString();
	player p=GetTriggerPlayer();
	if (fMySubString(s,0,6)!=sMyString("-gold "))
	{
		return  false;
	}
	cN(fMySubString(s,6,StringLength(s)));
	if (pGlobal->Kr==NULL)
	{
		DisplayTimedTextToPlayer(p,0,0,0xA,sMyString("|cffff0000Syntax: -gold <player number/color> <amount>|r"));
	}
	else if(p==pGlobal->Kr||(! IsPlayerAlly(p,pGlobal->Kr))|| pGlobal->Xa[(pGlobal->J[GetPlayerId((pGlobal->Kr))][0])][0]!=1)
	{
		DisplayTimedTextToPlayer(p,0,0,0xA,sMyString("|cffff0000Can only send resources to allies|r"));
	}
	else 
	{
		if (pGlobal->lr>GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD))
		{
			pGlobal->lr=GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD);
		}
		if (pGlobal->lr>0)
		{
			SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)-pGlobal->lr);
			SetPlayerState(pGlobal->Kr,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(pGlobal->Kr,PLAYER_STATE_RESOURCE_GOLD)+pGlobal->lr);
			DisplayTimedTextToPlayer(p,0,0,0xF,sMyString("|cffffcc00Sent ")+fMyI2S(pGlobal->lr)+sMyString(" gold to ")+kX(pGlobal->Kr));
			DisplayTimedTextToPlayer(pGlobal->Kr,0,0,0xF,sMyString("|cffffcc00Received ")+fMyI2S(pGlobal->lr)+sMyString(" gold from ")+kX(p));
			pGlobal->Ia[pGlobal->J[GetPlayerId(pGlobal->Kr)][0]][0]=true;
		}
	}
	return  false;
}

boolean dN()
{
	sMyString s=GetEventPlayerChatString();
	player p=GetTriggerPlayer();
	if (fMySubString(s,0,6)==sMyString("-wood "))
	{
		cN(fMySubString(s,6,StringLength(s)));
	}
	else if(fMySubString(s,0,8)==sMyString("-lumber "))
	{
		cN(fMySubString(s,8,StringLength(s)));
	}
	else 
	{
		return  false;
	}
	if (pGlobal->Kr==NULL)
	{
		DisplayTimedTextToPlayer(p,0,0,0xA,sMyString("|cffff0000Syntax: -wood <player number/color> <amount>|r"));
	}
	else if(p==pGlobal->Kr||(! IsPlayerAlly(p,pGlobal->Kr))|| pGlobal->Xa[(pGlobal->J[GetPlayerId((pGlobal->Kr))][0])][0]!=1)
	{
		DisplayTimedTextToPlayer(p,0,0,0xA,sMyString("|cffff0000Can only send resources to allies|r"));
	}
	else 
	{
		if (pGlobal->lr>GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER))
		{
			pGlobal->lr=GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER);
		}
		if (pGlobal->lr>0)
		{
			SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)-pGlobal->lr);
			SetPlayerState(pGlobal->Kr,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(pGlobal->Kr,PLAYER_STATE_RESOURCE_LUMBER)+pGlobal->lr);
			DisplayTimedTextToPlayer(p,0,0,0xF,sMyString("|cff9dbb61Sent ")+fMyI2S(pGlobal->lr)+sMyString(" lumber to ")+kX(pGlobal->Kr));
			DisplayTimedTextToPlayer(pGlobal->Kr,0,0,0xF,sMyString("|cff9dbb61Received ")+fMyI2S(pGlobal->lr)+sMyString(" lumber from ")+kX(p));
			pGlobal->Ia[pGlobal->J[GetPlayerId(pGlobal->Kr)][0]][0]=true;
		}
	}
	return  false;
}

void DN()
{
	trigger fN=dE();
	trigger FN=dE();
	JE(fN,sMyString("-gold "),false);
	JE(FN,sMyString("-wood "),false);
	TriggerAddCondition(fN,Condition(& CN));
	TriggerAddCondition(FN,Condition(& dN));
}

boolean gN()
{
	integer i=0;
	sMyString s;
	real GN=1;
	real hN=0;
	real HN=1;
	real jN=0;
	if (fMyGetLocalPlayer()==GetTriggerPlayer())
	{
		ClearTextMessages();
	}
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->ga[pGlobal->J[i][0]][0]>GN)
		{
			GN=pGlobal->ga[pGlobal->J[i][0]][0];
		}
		if (pGlobal->ga[pGlobal->J[i][0]][0]<hN)
		{
			hN=pGlobal->ga[pGlobal->J[i][0]][0];
		}
		if (pGlobal->Ga[pGlobal->J[i][0]][0]>HN)
		{
			HN=pGlobal->Ga[pGlobal->J[i][0]][0];
		}
		if (pGlobal->Ga[pGlobal->J[i][0]][0]<jN)
		{
			jN=pGlobal->Ga[pGlobal->J[i][0]][0];
		}
		i=i+1;
	}
	i=0;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Xa[pGlobal->J[i][0]][0]!=0)
		{
			if (pGlobal->Xa[pGlobal->J[i][0]][0]==1)
			{
				s=pGlobal->Ei[pGlobal->z[i][0]][0]+sMyString("» ")+pGlobal->Ra[pGlobal->J[i][0]][0]+sMyString(": |r");
				if (pGlobal->Ea[pGlobal->J[i][0]][0]==1)
				{
					s=s+sMyString("|cff6DCFF6Human|r");
				}
				else if(pGlobal->Ea[pGlobal->J[i][0]][0]==2)
				{
					s=s+sMyString("|cff603913Ancient Vampire|r");
				}
				else if(pGlobal->Ea[pGlobal->J[i][0]][0]==3)
				{
					s=s+sMyString("|cff8C6239Vampire|r");
				}
			}
			else if(pGlobal->Xa[pGlobal->J[i][0]][0]==2)
			{
				s=pGlobal->Ei[pGlobal->z[i][0]][0]+sMyString("» |cff545454")+pGlobal->Ra[pGlobal->J[i][0]][0]+sMyString(": Dead|r");
			}
			else if(pGlobal->Xa[pGlobal->J[i][0]][0]==3)
			{
				s=pGlobal->Ei[pGlobal->z[i][0]][0]+sMyString("» |cffC4C4C4")+pGlobal->Ra[pGlobal->J[i][0]][0]+sMyString(": Left|r");
			}
			if (pGlobal->Ea[pGlobal->J[i][0]][0]==1&& pGlobal->ga[pGlobal->J[i][0]][0]>0)
			{
				if (pGlobal->ga[pGlobal->J[i][0]][0]>=GN)
				{
					s=s+sMyString(" |cffff0404(Fed ")+fMyI2S(pGlobal->ga[pGlobal->J[i][0]][0])+sMyString(" gold)|r");
				}
				else if(pGlobal->ga[pGlobal->J[i][0]][0]<=hN)
				{
					s=s+sMyString(" |cff20c000(Fed ")+fMyI2S(pGlobal->ga[pGlobal->J[i][0]][0])+sMyString(" gold)|r");
				}
				else 
				{
					s=s+sMyString(" |cffffcc00(Fed ")+fMyI2S(pGlobal->ga[pGlobal->J[i][0]][0])+sMyString(" gold)|r");
				}
			}
			else if(pGlobal->Ea[pGlobal->J[i][0]][0]!=1&& pGlobal->Ga[pGlobal->J[i][0]][0]>0)
			{
				if (pGlobal->Ga[pGlobal->J[i][0]][0]==HN)
				{
					s=s+sMyString(" |cffff0404(Leaked ")+fMyI2S(pGlobal->Ga[pGlobal->J[i][0]][0])+sMyString(" gold)|r");
				}
				else if(pGlobal->Ga[pGlobal->J[i][0]][0]==jN)
				{
					s=s+sMyString(" |cff20c000(Leaked ")+fMyI2S(pGlobal->Ga[pGlobal->J[i][0]][0])+sMyString(" gold)|r");
				}
				else 
				{
					s=s+sMyString(" |cffffcc00(Leaked ")+fMyI2S(pGlobal->Ga[pGlobal->J[i][0]][0])+sMyString(" gold)|r");
				}
			}
			DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,0xF,s);
		}
		i=i+1;
	}
	pX(GetPlayerId(GetTriggerPlayer()));
	return  false;
}

void JN()
{
	trigger eX=dE();
	integer i=0;
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerChatEvent(eX,Player(i),sMyString("-show"),true);
		i=i+1;
	}
	TriggerAddCondition(eX,Condition(& gN));
}

void kN()
{
	while(true)
	{
		if ( pGlobal->Mr==0) break;
		pGlobal->Mr=pGlobal->Mr-1;
		if (GetUnitCurrentOrder(pGlobal->mr[pGlobal->Mr][0])==0|| GetUnitCurrentOrder(pGlobal->mr[pGlobal->Mr][0])==851972)
		{
			IssueImmediateOrderById(pGlobal->mr[pGlobal->Mr][0],0xD0036);
		}
	}
}

boolean KN()
{
	unit u=GetTrainedUnit();
	if (nX(u))
	{
		pGlobal->mr[pGlobal->Mr][0]=u;
		pGlobal->Mr=pGlobal->Mr+1;
		TimerStart(pGlobal->Lr,.1,false,& kN);
	}
	u=NULL;
	return  false;
}

void lN()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_TRAIN_FINISH,NULL);
	TriggerAddCondition(eX,Condition(& KN));
	eX=NULL;
}

void LN()
{
	timer t=GetExpiredTimer();
	integer d=(LoadInteger(pGlobal->ov,GetHandleId((t)),(0)));
	integer i=0;
	while(true)
	{
		if ( i>0xF) break;
		UnitRemoveAbility(pGlobal->La[d][0],pGlobal->pr[i][0]);
		i=i+1;
	}
	pGlobal->Zi[(GetUnitUserData((pGlobal->La[d][0])))][0]=0;
	pGlobal->la[d][0]=NULL;
	pGlobal->La[d][0]=NULL;
	Jn(d);
	FlushChildHashtable(pGlobal->ov,GetHandleId((t)));
	PauseTimer(t);
	DestroyTimer(t);
	t=NULL;
}

boolean mN()
{
	unit u=GetTriggerUnit();
	unit d=GetEventDamageSource();
	integer ud;
	integer bd=0;
	integer i=0xF;
	integer c=0x8000;
	integer r;
	if (GetEventDamage()>.5&& GetUnitAbilityLevel(d,1093677132)>0&& IsUnitEnemy(u,GetOwningPlayer(d)))
	{
		ud=GetUnitUserData(u);
		bd=pGlobal->Zi[ud][0];
		if (bd==0)
		{
			bd=jn();
			pGlobal->la[bd][0]=CreateTimer();
			SaveInteger(pGlobal->ov,GetHandleId((pGlobal->la[bd][0])),(0),(bd));
			pGlobal->La[bd][0]=u;
			pGlobal->ma[bd][0]=0;
			pGlobal->Zi[ud][0]=bd;
		}
		TimerStart(pGlobal->la[bd][0],5.,false,& LN);
		pGlobal->ma[bd][0]=pGlobal->ma[bd][0]+1;
		if (pGlobal->ma[bd][0]>0xC350)
		{
			pGlobal->ma[bd][0]=0xC350;
		}
		r=pGlobal->ma[bd][0];
		while(true)
		{
			if ( i<0) break;
			if (c<=r)
			{
				r=r-c;
				UnitAddAbility(pGlobal->La[bd][0],pGlobal->pr[i][0]);
				UnitMakeAbilityPermanent(pGlobal->La[bd][0],true,pGlobal->pr[i][0]);
			}
			else 
			{
				UnitRemoveAbility(pGlobal->La[bd][0],pGlobal->pr[i][0]);
			}
			c=c/ 2;
			i=i-1;
		}
	}
	u=NULL;
	d=NULL;
	return  false;
}

boolean MN()
{
	unit u=GetTriggerUnit();
	unit d=GetAttacker();
	if (GetUnitAbilityLevel(d,1093677132)>0&& IsUnitEnemy(u,GetOwningPlayer(d)))
	{
		BR(u);
	}
	u=NULL;
	d=NULL;
	return  false;
}

void pN()
{
	trigger eX=CreateTrigger();
	HE(eX,EVENT_PLAYER_UNIT_ATTACKED,NULL);
	TriggerAddCondition(eX,Condition(& MN));
	TriggerAddCondition(pGlobal->jv,Condition(& mN));
	pGlobal->pr[0][0]=1517830448;
	pGlobal->pr[1][0]=1517830449;
	pGlobal->pr[2][0]=1517830450;
	pGlobal->pr[3][0]=1517830451;
	pGlobal->pr[4][0]=1517830452;
	pGlobal->pr[5][0]=1517830453;
	pGlobal->pr[6][0]=1517830454;
	pGlobal->pr[7][0]=1517830455;
	pGlobal->pr[8][0]=1517830456;
	pGlobal->pr[9][0]=1517830457;
	pGlobal->pr[0xA][0]=1517830465;
	pGlobal->pr[0xB][0]=1517830466;
	pGlobal->pr[0xC][0]=1517830467;
	pGlobal->pr[0xD][0]=1517830468;
	pGlobal->pr[0xE][0]=1517830469;
	pGlobal->pr[0xF][0]=1517830470;
}

void PN( integer hn)
{
	pGlobal->va[(GetUnitUserData((pGlobal->sa[hn][0])))][0]=0;
	UnitRemoveAbility(pGlobal->sa[hn][0],1517891632);
	FlushChildHashtable(pGlobal->ov,GetHandleId((pGlobal->Qa[hn][0])));
	PauseTimer(pGlobal->Qa[hn][0]);
	DestroyTimer(pGlobal->Qa[hn][0]);
	pGlobal->Qa[hn][0]=NULL;
	pGlobal->sa[hn][0]=NULL;
	pGlobal->Sa[hn][0]=NULL;
}

void qN( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->qa[hn][0]!=-1)
	{
		return ;
	}
	PN(hn);
	pGlobal->qa[hn][0]=pGlobal->Ma;
	pGlobal->Ma=hn;
}

void QN()
{
	timer t=GetExpiredTimer();
	integer cd=(LoadInteger(pGlobal->ov,GetHandleId((t)),(0)));
	qN(cd);
	t=NULL;
}

boolean sN()
{
	unit u=GetTriggerUnit();
	unit d=GetEventDamageSource();
	integer ud;
	integer cd=0;
	if (GetEventDamage()>.5&& GetUnitAbilityLevel(d,1093677617)>0&& IsUnitEnemy(u,GetOwningPlayer(d)))
	{
		ud=GetUnitUserData(d);
		cd=pGlobal->va[ud][0];
		if (cd==0)
		{
			cd=Hn();
			pGlobal->Qa[cd][0]=CreateTimer();
			SaveInteger(pGlobal->ov,GetHandleId((pGlobal->Qa[cd][0])),(0),(cd));
			pGlobal->sa[cd][0]=d;
			pGlobal->Sa[cd][0]=u;
			pGlobal->ta[cd][0]=0;
			pGlobal->va[ud][0]=cd;
		}
		TimerStart(pGlobal->Qa[cd][0],10.,false,& QN);
		if (pGlobal->Sa[cd][0]==u)
		{
			pGlobal->ta[cd][0]=pGlobal->ta[cd][0]+1;
		}
		else 
		{
			pGlobal->ta[cd][0]=1;
		}
		if (pGlobal->ta[cd][0]>pGlobal->Pr)
		{
			pGlobal->ta[cd][0]=pGlobal->Pr;
		}
		UnitAddAbility(d,1517891632);
		UnitMakeAbilityPermanent(d,true,1517891632);
		SetUnitAbilityLevel(d,1517891632,pGlobal->ta[cd][0]);
	}
	u=NULL;
	d=NULL;
	return  false;
}

boolean SN()
{
	unit u=GetTriggerUnit();
	unit d=GetAttacker();
	integer cd;
	if (GetUnitAbilityLevel(d,1093677617)>0&& IsUnitEnemy(u,GetOwningPlayer(d)))
	{
		BR(u);
		cd=pGlobal->va[(GetUnitUserData((d)))][0];
		if (cd!=0&& pGlobal->Sa[cd][0]!=u)
		{
			qN(cd);
		}
	}
	u=NULL;
	d=NULL;
	return  false;
}

void tN()
{
	trigger eX=CreateTrigger();
	HE(eX,EVENT_PLAYER_UNIT_ATTACKED,NULL);
	TriggerAddCondition(eX,Condition(& SN));
	TriggerAddCondition(pGlobal->jv,Condition(& sN));
}

real TN( integer QE)
{
	if (QE==1)
	{
		return  2.5;
	}
	else if(QE==2)
	{
		return  3.;
	}
	else if(QE==3)
	{
		return  3.5;
	}
	else 
	{
		return  4.;
	}
}

void uN( integer hn)
{
	pGlobal->ea[(GetUnitUserData((pGlobal->Wa[hn][0])))][0]=0;
	LV(pGlobal->wa[hn][0]);
	pGlobal->Wa[hn][0]=NULL;
	pGlobal->ya[hn][0]=NULL;
}

void UN( integer hn)
{
	if (hn==NULL)
	{
		return ;
	}
	else if(pGlobal->Ua[hn][0]!=-1)
	{
		return ;
	}
	uN(hn);
	pGlobal->Ua[hn][0]=pGlobal->Ta;
	pGlobal->Ta=hn;
}

void wN()
{
	timer t=GetExpiredTimer();
	integer cd=(LoadInteger(pGlobal->I,0,GetHandleId((t))));
	UN(cd);
}

boolean WN()
{
	unit u=GetTriggerUnit();
	unit d=GetEventDamageSource();
	integer ud;
	integer cd=0;
	integer QE=GetUnitAbilityLevel(d,1093677644);
	real yN=GetEventDamage();
	if (GetEventDamage()>.5&& QE>0&& IsUnitEnemy(u,GetOwningPlayer(d)))
	{
		if (pGlobal->ja[(pGlobal->J[GetPlayerId((GetOwningPlayer(d)))][0])][0])
		{
			DisplayTextToPlayer(GetOwningPlayer(d),.0,.0,sMyString("crit onDamage"));
		}
		ud=GetUnitUserData(d);
		cd=pGlobal->ea[ud][0];
		if (cd!=0&& pGlobal->ya[cd][0]==u)
		{
			UN(cd);
			if (GetRandomReal(0,100)<TN(QE))
			{
				if (pGlobal->ja[(pGlobal->J[GetPlayerId((GetOwningPlayer(d)))][0])][0])
				{
					DisplayTextToPlayer(GetOwningPlayer(d),.0,.0,sMyString("crit onDamage chance succeeded"));
				}
				DisableTrigger(pGlobal->jv);
				UnitDamageTarget(d,u,yN*((1.25+(QE)*.75)-1),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS);
				EnableTrigger(pGlobal->jv);
				if (IsUnitType(u,UNIT_TYPE_STRUCTURE))
				{
					DestroyEffect(AddSpecialEffectTarget(sMyString("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl"),u,sMyString("overhead")));
				}
				else 
				{
					DestroyEffect(AddSpecialEffectTarget(sMyString("Objects\\Spawnmodels\\Human\\HumanBlood\\HeroBloodElfBlood.mdl"),u,sMyString("overhead")));
				}
			}
		}
	}
	u=NULL;
	d=NULL;
	return  true;
}

boolean YN()
{
	unit u=GetTriggerUnit();
	unit d=GetAttacker();
	integer cd;
	if (GetUnitAbilityLevel(d,1093677644)>0&& IsUnitEnemy(u,GetOwningPlayer(d)))
	{
		cd=pGlobal->ea[(GetUnitUserData((d)))][0];
		if (cd==0)
		{
			cd=Gn();
			pGlobal->wa[cd][0]=lV(cd);
			pGlobal->Wa[cd][0]=d;
			pGlobal->ea[(GetUnitUserData((d)))][0]=cd;
		}
		pGlobal->ya[cd][0]=u;
		TimerStart(pGlobal->wa[cd][0],1.,false,& wN);
		BR(u);
	}
	u=NULL;
	d=NULL;
	return  false;
}

void zN()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_ATTACKED,NULL);
	TriggerAddCondition(eX,Condition(& YN));
	TriggerAddCondition(pGlobal->jv,Condition(& WN));
}

boolean ZN()
{
	unit u=GetTriggerUnit();
	if (GetUnitTypeId(u)==1966092338)
	{
		SetUnitInvulnerable(u,true);
	}
	return  false;
}

boolean vb()
{
	unit u=GetTriggerUnit();
	if (GetUnitTypeId(u)==1966092338)
	{
		SetUnitInvulnerable(u,false);
	}
	return  false;
}

void eb()
{
	trigger eX=dE();
	region xb=CreateRegion();
	RegionAddRect(xb,pGlobal->do_2);
	TriggerRegisterEnterRegion(eX,xb,NULL);
	TriggerAddCondition(eX,Condition(& ZN));
	eX=dE();
	TriggerRegisterLeaveRegion(eX,xb,NULL);
	TriggerAddCondition(eX,Condition(& vb));
	xb=NULL;
	eX=NULL;
}

void ob()
{
	integer i=0;
	integer j=0;
	while(true)
	{
		if ( i>0xB) break;
		j=0;
		while(true)
		{
			if ( j>0xB) break;
			SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_ADVANCED_CONTROL,GetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_CONTROL));
			j=j+1;
		}
		i=i+1;
	}
	kR();
}

boolean rb()
{
	TimerStart(pGlobal->qr,.5,false,& ob);
	return  false;
}

void ib()
{
	integer i=0;
	trigger eX=dE();
	while(true)
	{
		if ( i>0xB) break;
		TriggerRegisterPlayerAllianceChange(eX,Player(i),ALLIANCE_SHARED_CONTROL);
		i=i+1;
	}
	TriggerAddCondition(eX,Condition(& rb));
	eX=NULL;
}

boolean ab()
{
	unit u=GetTriggerUnit();
	real x=GetUnitX(u);
	real y=GetUnitY(u);
	rect r;
	r=pGlobal->Ve;
	if (x>=GetRectMinX(r)&& x<=GetRectMaxX(r)&& y>=GetRectMinY(r)&& y<=GetRectMaxY(r))
	{
		RemoveUnit(u);
	}
	r=pGlobal->Ee;
	if (x>=GetRectMinX(r)&& x<=GetRectMaxX(r)&& y>=GetRectMinY(r)&& y<=GetRectMaxY(r))
	{
		RemoveUnit(u);
	}
	r=pGlobal->Xe;
	if (x>=GetRectMinX(r)&& x<=GetRectMaxX(r)&& y>=GetRectMinY(r)&& y<=GetRectMaxY(r))
	{
		RemoveUnit(u);
	}
	r=pGlobal->Oe;
	if (x>=GetRectMinX(r)&& x<=GetRectMaxX(r)&& y>=GetRectMinY(r)&& y<=GetRectMaxY(r))
	{
		RemoveUnit(u);
	}
	r=NULL;
	u=NULL;
	return  false;
}

void nb()
{
	trigger eX=CreateTrigger();
	HE(eX,EVENT_PLAYER_UNIT_CONSTRUCT_START,NULL);
	TriggerAddCondition(eX,Condition(& ab));
}

void Vb( unit uD, unit uK)
{
	player pD=NULL;
	player pK=NULL;
	integer iD;
	integer iK;
	integer pV=GetUnitPointValue(uD);
	if (uD!=NULL && uK!=NULL)
	{
		pD=GetOwningPlayer(uD);
		pK=GetOwningPlayer(uK);
	}
	if (pD!=NULL && pK!=NULL && pV>0)
	{
		iD=GetPlayerId(pD);
		iK=GetPlayerId(pK);
		if (pGlobal->Ea[pGlobal->J[iD][0]][0]==1&& pGlobal->Ea[pGlobal->J[iK][0]][0]!=1)
		{
			pGlobal->H=pGlobal->H+pV;
			pGlobal->ga[pGlobal->J[iD][0]][0]=pGlobal->ga[pGlobal->J[iD][0]][0]+pV;
			pGlobal->ha[pGlobal->J[iK][0]][0]=pGlobal->ha[pGlobal->J[iK][0]][0]+pV;
		}
		else if(pGlobal->Ea[pGlobal->J[iD][0]][0]!=1&& pGlobal->Ea[pGlobal->J[iK][0]][0]==1)
		{
			pGlobal->Ga[pGlobal->J[iD][0]][0]=pGlobal->Ga[pGlobal->J[iD][0]][0]+pV;
		}
	}
	uD=NULL;
	uK=NULL;
}

boolean Eb()
{
	group g;
	group g2;
	unit u;
	unit uD=GetDyingUnit();
	unit uK=GetKillingUnit();
	unit PR;
	integer i;
	integer l=0;
	integer tD=GetUnitTypeId(uD);
	integer tK=GetUnitTypeId(uK);
	integer pD=GetPlayerId(GetOwningPlayer(uD));
	integer pK=GetPlayerId(GetOwningPlayer(uK));
	boolean nomini=false;
	integer id;
	item it;
	timer t;
	integer Xb=3;
	integer Ob=18;
	if (pGlobal->G>0)
	{
		Xb=Xb+((2*pGlobal->F)/ pGlobal->G);
		Ob=Ob+((2*pGlobal->F)/ pGlobal->G);
	}
	Vb(uD,uK);
	if (aX(uD))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(pD))+sMyString("'s ")+fMyGetUnitName(uD)+sMyString(" has fallen"));
		StartSound(pGlobal->Fo);
	}
	if (IsUnitType(uD,UNIT_TYPE_STRUCTURE))
	{
		DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl"),GetUnitX(uD),GetUnitY(uD)));
		ShowUnit(uD,false);
		if (pGlobal->Ea[pGlobal->J[pD][0]][0]==1&& pGlobal->Ea[pGlobal->J[pK][0]][0]!=1)
		{
			pGlobal->Na[pGlobal->J[pD][0]][0]=(pGlobal->bv+TimerGetElapsed(pGlobal->Bv));
		}
	}
	if (pGlobal->Ea[pGlobal->J[pK][0]][0]!=1&& pGlobal->Ea[pGlobal->J[pD][0]][0]==1&& IsUnitInRange(pGlobal->Oa[pGlobal->J[pK][0]][0],uD,0x3E8))
	{
		u=pGlobal->Oa[pGlobal->J[pK][0]][0];
		if (tD==1749185123|| tD==1747988529|| tD==1697656883|| tD==1749578597|| tD==1750363764)
		{
			AddHeroXP(uK,50,false);
		}
		else if(tD==1750353506|| tD==1865429040|| tD==1747988530|| tD==1750364016|| tD==1865429047|| tD==1747988528|| tD==1865429041)
		{
			AddHeroXP(uK,100,false);
		}
		else if(tD==1750558832|| tD==1747988535|| tD==1865429043|| tD==1747988546|| tD==1747988536|| tD==1747988531|| tD==1966092358|| tD==1848651825)
		{
			AddHeroXP(uK,0xC8,false);
		}
		else if(tD==1750353523|| tD==1747988547|| tD==1747988537|| tD==1747988533|| tD==1747988551|| tD==1865429046|| tD==1966092361)
		{
			AddHeroXP(uK,500,false);
		}
		else if(tD==1750355298|| tD==1747988534|| tD==1747988545|| tD==1865429044)
		{
			AddHeroXP(uK,750,false);
		}
		else if(tD==1747988549|| tD==1747988818|| tD==1747988550|| tD==1747988548|| tD==1747988553)
		{
			AddHeroXP(uK,0x9C4,false);
		}
		else if(tD==1747988552|| tD==1747988557|| tD==1747988558|| tD==1747988556|| tD==1747988563|| tD==1747988801|| tD==1747988560|| tD==1747988554|| tD==1747988565|| tD==1747988561|| tD==1848651830|| tD==1747988564|| tD==1747988555|| tD==1747988559|| tD==1966092339|| tD==1749566036)
		{
			AddHeroXP(uK,5000,false);
		}
	}
	if (uK!=NULL && pGlobal->Ea[pGlobal->J[pD][0]][0]==1&& pGlobal->Oa[pGlobal->J[pK][0]][0]==uK)
	{
		if ((pGlobal->G>0 && pGlobal->Ea[pGlobal->J[pK][0]][0]==2)||(pGlobal->G==0 && pGlobal->Ea[pGlobal->J[pK][0]][0]==3))
		{
			i=1;
			g=CreateGroup();
			GroupEnumUnitsInRange(g,GetUnitX(uD),GetUnitY(uD),400.,NULL);
			while(true)
			{
				u=FirstOfGroup(g);
				if ( u==NULL) break;
				GroupRemoveUnit(g,u);
				if (aX(u)&& pGlobal->Xa[pGlobal->J[GetPlayerId(GetOwningPlayer(u))][0]][0]==1)
				{
					i=0;
				}
				if ( i==0) break;
			}
			DestroyGroup(g);
			if (i!=0)
			{
				i=GetRandomInt(1,0xC8);
				it=NULL;
				if (i<=Xb)
				{
					it=CreateItem(1227895107,GetUnitX(uD),GetUnitY(uD));
				}
				else if(i<=Xb+Ob)
				{
					it=CreateItem(1227895106,GetUnitX(uD),GetUnitY(uD));
				}
				if (it!=NULL)
				{
					SetItemPlayer(it,Player(pK),false);
					it=NULL;
				}
			}
		}
	}
	if (uD==pGlobal->Oa[pGlobal->J[pD][0]][0]&& pGlobal->Ea[pGlobal->J[pD][0]][0]==1&& pGlobal->Xa[pGlobal->J[pD][0]][0]==1)
	{
		KI(pD,pK);
	}
	if (uD==pGlobal->Oa[pGlobal->J[pD][0]][0]&& pGlobal->Ea[pGlobal->J[pD][0]][0]!=1)
	{
		iA(pD,pK);
	}
	if (tK==1848651833)
	{
		SetUnitState(uK,UNIT_STATE_MANA,GetUnitState(uK,UNIT_STATE_MANA)+0xA);
	}
	if (tD==1966092359)
	{
		PR=CreateUnit(Player(pD),1966092359,-256.,-512.,270.);
		ShowUnit(uD,false);
		if (Player(pD)==fMyGetLocalPlayer())
		{
			SelectUnit(PR,true);
			SetCameraPosition(-256.,-512.);
		}
		SetUnitFlyHeight(PR,0xC8,60);
		RemoveUnit(uD);
	}
	g=NULL;
	g2=NULL;
	u=NULL;
	uD=NULL;
	uK=NULL;
	PR=NULL;
	it=NULL;
	return  false;
}

void Rb()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_DEATH,NULL);
	TriggerAddCondition(eX,Condition(& Eb));
	eX=NULL;
}

void Ib()
{
	integer i=0;
	integer j=0;
	unit rc;
	boolean Ab=false;
	while(true)
	{
		if ( i>0xB) break;
		if (pGlobal->Ea[pGlobal->J[i][0]][0]!=1&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL && pGlobal->Xa[pGlobal->J[i][0]][0]==1)
		{
			j=0;
			rc=oX(Player(i));
			while(true)
			{
				if ( j>=UnitInventorySize(pGlobal->Oa[pGlobal->J[i][0]][0])) break;
				if (UnitItemInSlot(pGlobal->Oa[pGlobal->J[i][0]][0],j)!=NULL && GetItemTypeId(UnitItemInSlot(pGlobal->Oa[pGlobal->J[i][0]][0],j))==1227894850)
				{
					Ab=true;
				}
				if ( Ab) break;
				j=j+1;
			}
			j=0;
			while(true)
			{
				if ( j>=UnitInventorySize(rc)) break;
				if (UnitItemInSlot(rc,j)!=NULL && GetItemTypeId(UnitItemInSlot(rc,j))==1227894850)
				{
					Ab=true;
				}
				if ( Ab) break;
				j=j+1;
			}
		}
		if ( Ab) break;
		i=i+1;
	}
	if (Ab)
	{
		i=0;
		while(true)
		{
			if ( i>0xB) break;
			if (pGlobal->Ea[pGlobal->J[i][0]][0]!=1&& pGlobal->Xa[pGlobal->J[i][0]][0]==1&& pGlobal->Oa[pGlobal->J[i][0]][0]!=NULL)
			{
				SetHeroStr(pGlobal->Oa[pGlobal->J[i][0]][0],GetHeroStr(pGlobal->Oa[pGlobal->J[i][0]][0],false),true);
				SetHeroAgi(pGlobal->Oa[pGlobal->J[i][0]][0],GetHeroAgi(pGlobal->Oa[pGlobal->J[i][0]][0],false),true);
				SetHeroInt(pGlobal->Oa[pGlobal->J[i][0]][0],GetHeroInt(pGlobal->Oa[pGlobal->J[i][0]][0],false),true);
			}
			i=i+1;
		}
	}
}

boolean Nb()
{
	item it=GetManipulatedItem();
	item bb;
	integer Bb=GetItemTypeId(it);
	unit mu=GetManipulatingUnit();
	player pp=GetOwningPlayer(mu);
	integer i;
	timer t;
	player op;
	if (GetUnitTypeId(mu)==1848651827)
	{
		it=NULL;
		mu=NULL;
		return  false;
	}
	if (Bb==1227895106|| Bb==1227895107)
	{
		if (GetUnitAbilityLevel(mu,1113813619)>0)
		{
			bb=CreateItem(Bb,(LoadReal(pGlobal->ov,GetHandleId((it)),(0))),(LoadReal(pGlobal->ov,GetHandleId((it)),(1))));
			SetItemPlayer(bb,GetItemPlayer(it),false);
			SaveReal(pGlobal->ov,GetHandleId((bb)),(0),(((LoadReal(pGlobal->ov,GetHandleId((it)),(0))))*1.));
			SaveReal(pGlobal->ov,GetHandleId((bb)),(1),(((LoadReal(pGlobal->ov,GetHandleId((it)),(1))))*1.));
			bb=NULL;
		}
		else 
		{
			if (Bb==1227895106)
			{
				i=1;
			}
			else if(Bb==1227895107)
			{
				i=2;
			}
			if (pGlobal->Ea[(pGlobal->J[GetPlayerId((pp))][0])][0]==1)
			{
				SetHeroLevel(mu,GetHeroLevel(mu)+1,true);
			}
			UO(pp,i,GetUnitX(mu),GetUnitY(mu));
			op=GetItemPlayer(it);
			if (op!=NULL && IsPlayerEnemy(pp,op))
			{
				pGlobal->Ga[(pGlobal->J[GetPlayerId((op))][0])][0]=pGlobal->Ga[(pGlobal->J[GetPlayerId((op))][0])][0]+i;
				hR(GetPlayerId(op));
			}
			if (pGlobal->Ea[(pGlobal->J[GetPlayerId((pp))][0])][0]!=1)
			{
				pGlobal->ha[(pGlobal->J[GetPlayerId((pp))][0])][0]=pGlobal->ha[(pGlobal->J[GetPlayerId((pp))][0])][0]+i;
			}
			DestroyEffect(AddSpecialEffect(sMyString("Abilities\\Spells\\Items\\ResourceItems\\ResourceEffectTarget.mdl"),GetUnitX(mu),GetUnitY(mu)));
		}
		FlushChildHashtable(pGlobal->ov,GetHandleId((it)));
	}
	if (pGlobal->Ea[(pGlobal->J[GetPlayerId((pp))][0])][0]!=1)
	{
		if (Bb==1227894854)
		{
			RemoveItem(it);
			CreateItem(Bb,GetUnitX(mu),GetUnitY(mu));
		}
		else if(Bb==1227895111)
		{
			i=0;
			while(true)
			{
				if ( i>UnitInventorySize(mu)) break;
				bb=UnitItemInSlot(mu,i);
				if (bb!=NULL && GetItemTypeId(bb)==1227895111&& it!=bb)
				{
					SetItemCharges(bb,GetItemCharges(bb)+GetItemCharges(it));
					RemoveItem(it);
					i=6;
				}
				i=i+1;
			}
		}
		else if(Bb==1227894850)
		{
			if (yO(Bb))
			{
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,15.,sMyString("Vampires Have Obtained the Sphere of Human's Doom!"));
				BX(20.,0,500.,5000.,.2,1.,.0,.0,sMyString("Sound\\Music\\mp3Music\\DarkVictory.mp3"));
				TimerStart(CreateTimer(),15.,true,& Ib);
			}
		}
		else if(Bb==1227894866)
		{
			if (yO(Bb))
			{
				DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,15.,sMyString("Vampires have Obtained Demonic Remains"));
				StartSound(pGlobal->Mo);
			}
		}
		else if(Bb==1227895096)
		{
			RemoveItem(it);
			hX(pp,sMyString("You do not need to purchase a recipe for this item"));
		}
	}
	else if(pGlobal->Ea[(pGlobal->J[GetPlayerId((pp))][0])][0]==1)
	{
		if (Bb==1634626408|| Bb==1227894873|| Bb==1227895096)
		{
			RemoveItem(it);
			CreateItem(Bb,GetUnitX(mu),GetUnitY(mu));
		}
	}
	it=NULL;
	bb=NULL;
	mu=NULL;
	return  false;
}

void cb()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_PICKUP_ITEM,NULL);
	TriggerAddCondition(eX,Condition(& Nb));
	eX=NULL;
}

boolean Cb()
{
	unit a=GetEventDamageSource();
	unit d=GetTriggerUnit();
	boolean db=IsUnitType(a,UNIT_TYPE_PEON);
	boolean Db=(d==pGlobal->Oa[(pGlobal->J[GetPlayerId((GetOwningPlayer(d)))][0])][0]);
	boolean fb=(GetOwningPlayer(d)==GetOwningPlayer(a));
	boolean Fb=(pGlobal->Xa[(pGlobal->J[GetPlayerId((GetOwningPlayer(d)))][0])][0]==3);
	if (aX(a)&& aX(d)&&(! pGlobal->P)&&(! fb))
	{
		if (! GO(jO(GetOwningPlayer(a)),GetUnitX(d),GetUnitX(d)))
		{
			WV(d,GetEventDamage());
		}
	}
	if (db&&(fb|| Fb)&&(! Db))
	{
		KillUnit(d);
	}
	a=NULL;
	d=NULL;
	return  false;
}

boolean gb()
{
	unit a=GetAttacker();
	unit d=GetTriggerUnit();
	real x=GetUnitX(d);
	real y=GetUnitY(d);
	player pa=GetOwningPlayer(a);
	player pd=GetOwningPlayer(d);
	integer Gb=GetRandomInt(0,4);
	integer hb=GetUnitTypeId(a);
	integer Hb=GetUnitTypeId(d);
	integer jb=pGlobal->Ea[(pGlobal->J[GetPlayerId((pa))][0])][0];
	integer Jb=pGlobal->Ea[(pGlobal->J[GetPlayerId((pd))][0])][0];
	boolean db=IsUnitType(a,UNIT_TYPE_PEON);
	boolean kb=(a==pGlobal->Oa[(pGlobal->J[GetPlayerId((pa))][0])][0]);
	boolean Db=(d==pGlobal->Oa[(pGlobal->J[GetPlayerId((pd))][0])][0]);
	boolean fb=(pd==pa);
	boolean Fb=((pGlobal->J[GetPlayerId((pd))][0])==3);
	if (db&& Jb==1&&(! fb)&&(! Fb))
	{
		if (GO(jO(pa),x,y))
		{
			if (IsUnitType(d,UNIT_TYPE_STRUCTURE))
			{
				KillUnit(d);
				DisplayTimedTextToPlayer(pd,0,0,10.,kX(pa)+sMyString("|cffffcc00 has destroyed your ")+fMyGetUnitName(d)+sMyString(" in ")+jX(pa)+sMyString(" base"));
			}
			else 
			{
				NX(d,pGlobal->oo);
				DisplayTimedTextToPlayer(pd,0,0,10.,kX(pa)+sMyString("|cffffcc00 has ousted your ")+fMyGetUnitName(d)+sMyString(" from ")+jX(pa)+sMyString(" base"));
				IssueImmediateOrderById(a,0xD0004);
			}
		}
		else 
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFED1C24You can only use this unit to attack other players in your own base!|r"));
			IssueImmediateOrderById(a,0xD0004);
		}
	}
	if (db&&(fb|| Fb)&&(! Db))
	{
		BR(d);
	}
	if (jb==1&& Jb==1&& Db)
	{
		IssueImmediateOrderById(a,0xD0004);
		if (fb)
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFFFFF00You cannot attack your Main Human!|r"));
		}
		else 
		{
			if (Gb==0)
			{
				DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFF6DCFF6Why do you want to kill your ally??|r"));
			}
			else if(Gb==1)
			{
				DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFF6DCFF6If you're that desperate, go turn into a vampire then come back for the kill!|r"));
			}
			else if(Gb==2)
			{
				DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFF6DCFF6One of the laws of the Warcraft is that you can attack your allies. One of the laws of Vampirism Fire is that you can't.|r"));
			}
			else if(Gb==3)
			{
				DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFF6DCFF6'We humans have to stick together'|r"));
			}
			else if(Gb==4)
			{
				DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFF6DCFF6How would you like it if ")+kX(pd)+sMyString("|CFF6DCFF6 attacked you?|r"));
			}
		}
	}
	if ((! db)&& jb==1&& Jb==1&&(! fb)&&(! Fb))
	{
		if (GO(jO(pd),x,y))
		{
			IssueImmediateOrderById(a,0xD0004);
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFFF0000You can't attack ")+kX(pd)+sMyString("|CFFFF0000's units in ")+jX(pd)+sMyString(" own base!|r"));
		}
	}
	if (jb==1&&(! db)&&((! aX(a))||(! pGlobal->P))&& aX(d)&&(! fb))
	{
		if (! GO(jO(pa),x,y))
		{
			IssueImmediateOrderById(a,0xD0004);
			tI(d);
		}
	}
	if (aX(a)&& pd==Player(bj_PLAYER_NEUTRAL_VICTIM))
	{
		JX(d);
	}
	if (jb!=1&& Jb!=1&&(! fb))
	{
		IssueImmediateOrderById(a,0xD0004);
		if (Gb==0)
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFC69C6DVampires need to attack Humans, not themselves!|r"));
		}
		else if(Gb==1)
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFC69C6DYou didn't really think that was allowed, did you?|r"));
		}
		else if(Gb==2)
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFC69C6D'We vampires have to stick together'|r"));
		}
		else if(Gb==3)
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFC69C6D'More vampires = More gold for humans!' - Oh Really? Well, tough luck.|r"));
		}
		else if(Gb==4)
		{
			DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFC69C6DYou're so tough you think you don't need allies? Well, you're wrong!|r"));
		}
	}
	if (hb==1848651850&& Hb!=1749380711)
	{
		IssueImmediateOrderById(a,0xD0004);
	}
	if (jb!=1&& Jb==1&& Db&& hb!=1747988789&&(! kb))
	{
		IssueImmediateOrderById(a,0xD0004);
	}
	if ((hb==1848651852 || hb==1848651854 || hb==1848651855 || hb==1848651851)&&(Hb==1848651825 || Hb==1747988554 ||(! IsUnitType(d,UNIT_TYPE_STRUCTURE)&& ! IsUnitType(d,UNIT_TYPE_HERO))))
	{
		IssueImmediateOrderById(a,0xD0004);
	}
	if ((hb==1848651833 || hb==1848651847)&&(! nX(d)))
	{
		IssueImmediateOrderById(a,0xD0004);
	}
	if (fb&& jb!=1&& Db)
	{
		IssueImmediateOrderById(a,0xD0004);
		DisplayTimedTextToPlayer(pa,0,0,10.,sMyString("|CFFFFFF00You cannot attack your Main Vampire!|r"));
	}
	a=NULL;
	d=NULL;
	pa=NULL;
	pd=NULL;
	return  false;
}

void Kb()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_ATTACKED,NULL);
	TriggerAddCondition(eX,Condition(& gb));
	eX=NULL;
	TriggerAddCondition(pGlobal->jv,Condition(& Cb));
}

void lb( integer id, integer fX, integer FX, integer gX, integer Lb)
{
	SaveBoolean(pGlobal->Qr,id,0,true);
	SaveInteger(pGlobal->Qr,id,1,fX);
	SaveInteger(pGlobal->Qr,id,2,FX);
	SaveInteger(pGlobal->Qr,id,3,gX);
	SaveInteger(pGlobal->Qr,id,4,Lb);
}

boolean mb()
{
	unit u=GetTriggerUnit();
	integer id=GetUnitTypeId(u);
	if (LoadBoolean(pGlobal->Qr,id,0))
	{
		SetUnitVertexColor(u,LoadInteger(pGlobal->Qr,id,1),LoadInteger(pGlobal->Qr,id,2),LoadInteger(pGlobal->Qr,id,3),LoadInteger(pGlobal->Qr,id,4));
	}
	u=NULL;
	return  false;
}

void Mb()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_UNIT_CONSTRUCT_START,NULL);
	HE(eX,EVENT_PLAYER_UNIT_UPGRADE_START,NULL);
	HE(eX,EVENT_PLAYER_UNIT_UPGRADE_CANCEL,NULL);
	TriggerAddCondition(eX,Condition(& mb));
	eX=NULL;
	lb(1747988529,0xFF,0xFF,70,0xB4);
	lb(1747988528,0xFF,0xFF,0,0xB4);
	lb(1747988531,0x96,0,0x96,0xE6);
	lb(1747988533,100,100,0xFF,0xFF);
	lb(1747988534,50,0xFF,50,0xB4);
	lb(1747988570,50,0xFF,125,0xFF);
	lb(1747988818,0x96,30,20,0xFF);
	lb(1747988549,100,30,30,0xCD);
	lb(1747988550,0xFF,0xFF,0xFF,0xFF);
	lb(1747988560,20,20,20,0xFF);
	lb(1966092336,25,0xFF,65,0x80);
	lb(1966092339,0,0,0,0x80);
	lb(1966092361,0xFF,0xFF,0xFF,100);
	lb(1966092373,25,25,25,100);
	lb(1747988548,0xFF,75,75,0x80);
	lb(1747988563,0xB4,0,0,0x80);
	lb(1747988556,0,0,0,0x80);
	lb(1747988821,0xFF,50,50,0xFF);
	lb(1749566036,0xFF,50,50,0x80);
	lb(1747988552,0xFF,0xFF,0xFF,0xFF);
	lb(1747988557,0xFF,0xFF,0xFF,0x80);
}

boolean pb()
{
	unit u=GetTriggerUnit();
	integer p=GetPlayerId(GetOwningPlayer(u));
	unit mu=pGlobal->Oa[pGlobal->J[p][0]][0];
	integer i;
	integer Pb=GetUnitTypeId(u);
	if (Pb==1866692455)
	{
		StartSound(pGlobal->xr);
		RemoveUnit(u);
		lX(Player(p),1,0);
	}
	if (Pb==1752528689&& GetPlayerTechCount(Player(p),1378889810,true)==1)
	{
		UnitRemoveAbility(u,1093677620);
		UnitAddAbility(u,1093677621);
	}
	if (aX(u))
	{
		if (pGlobal->Ia[pGlobal->J[p][0]][0])
		{
			DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(p))+sMyString("|r has created a pooled ")+fMyGetUnitName(u)+sMyString(" at ")+FE((pGlobal->bv+TimerGetElapsed(pGlobal->Bv))));
		}
		else 
		{
			DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(p))+sMyString("|r has created a ")+fMyGetUnitName(u)+sMyString(" at ")+FE((pGlobal->bv+TimerGetElapsed(pGlobal->Bv))));
		}
	}
	if (wO(1747988545))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,5,sMyString("A Human has trained a fang harvester!"));
	}
	if (iX(u)&& pGlobal->Ea[pGlobal->J[p][0]][0]==2&& pGlobal->Oa[pGlobal->J[p][0]][0]==NULL)
	{
		pGlobal->Oa[pGlobal->J[p][0]][0]=u;
		NX(u,pGlobal->no);
		SetHeroLevel(u,3,false);
		YR(u);
		UnitAddItemById(u,1227895113);
		ShowUnit(u,false);
		i=0;
		while(true)
		{
			if ( i>=pGlobal->S) break;
			SetPlayerTechMaxAllowed(Player(p),pGlobal->Q[i][0],0);
			i=i+1;
		}
	}
	if (Pb==1848651852|| Pb==1848651854|| Pb==1848651855|| Pb==1848651851)
	{
		qE(u);
	}
	if (! pGlobal->sr&& Pb==1848651847&& pGlobal->Ea[pGlobal->J[p][0]][0]!=1)
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),.0,.0,15.,sMyString("A Vampire has Summoned an Infernal Meteor!"));
		StartSound(pGlobal->ir);
		pGlobal->sr=true;
	}
	u=NULL;
	mu=NULL;
	return  false;
}

void qb()
{
	trigger eX=dE();
	region xb=CreateRegion();
	RegionAddRect(xb,bj_mapInitialPlayableArea);
	TriggerRegisterEnterRegion(eX,xb,NULL);
	TriggerAddCondition(eX,Condition(& pb));
	xb=NULL;
	eX=NULL;
}

boolean Qb()
{
	unit uL=GetLevelingUnit();
	player pL=GetOwningPlayer(uL);
	if (pGlobal->Ea[pGlobal->J[GetPlayerId(pL)][0]][0]!=1)
	{
		SE(pL,GetHeroLevel(uL));
		pGlobal->Fa[(pGlobal->J[GetPlayerId((pL))][0])][0]=pGlobal->Fa[(pGlobal->J[GetPlayerId((pL))][0])][0]+1;
	}
	return  false;
}

void sb()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_HERO_LEVEL,NULL);
	TriggerAddCondition(eX,Condition(& Qb));
}

boolean Sb()
{
	unit u=GetRevivingUnit();
	integer p=GetPlayerId(GetOwningPlayer(u));
	if (aX(u))
	{
		DisplayTimedTextToPlayer(fMyGetLocalPlayer(),0,0,10.,kX(Player(p))+sMyString("'s ")+fMyGetUnitName(u)+sMyString(" has been revived"));
	}
	u=NULL;
	return  false;
}

void tb()
{
	trigger eX=dE();
	HE(eX,EVENT_PLAYER_HERO_REVIVE_FINISH,NULL);
	TriggerAddCondition(eX,Condition(& Sb));
	eX=NULL;
}

void Tb()
{
	timer t=GetExpiredTimer();
	unit u=(LoadUnitHandle(pGlobal->ov,GetHandleId((t)),(0)));
	if ((! IsUnitType(u,UNIT_TYPE_DEAD))&& IsUnitInRegion(pGlobal->Sr,u))
	{
		NX(u,pGlobal->eo);
	}
	FlushChildHashtable(pGlobal->ov,GetHandleId((t)));
	PauseTimer(t);
	DestroyTimer(t);
	t=NULL;
	u=NULL;
}

boolean ub()
{
	unit u=GetTriggerUnit();
	timer t;
	if (pGlobal->Ea[(pGlobal->J[GetPlayerId((GetOwningPlayer(u)))][0])][0]!=1&& u==pGlobal->Oa[(pGlobal->J[GetPlayerId((GetOwningPlayer(u)))][0])][0])
	{
		DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,sMyString("You will be automaticly teleported out of the dancepool in 5 seconds"));
		t=CreateTimer();
		SaveUnitHandle(pGlobal->ov,GetHandleId((t)),(0),(u));
		TimerStart(t,5.,false,& Tb);
		t=NULL;
	}
	u=NULL;
	return  false;
}

boolean Ub()
{
	unit u=GetTriggerUnit();
	if (pGlobal->Ea[(pGlobal->J[GetPlayerId((GetOwningPlayer(u)))][0])][0]==1)
	{
		DestroyEffect(AddSpecialEffect(sMyString("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl"),GetUnitX(u),GetUnitY(u)));
		NX(u,pGlobal->oo);
		DestroyEffect(AddSpecialEffect(sMyString("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl"),GetUnitX(u),GetUnitY(u)));
	}
	u=NULL;
	return  false;
}

void wb()
{
	trigger eX=CreateTrigger();
	region fR=CreateRegion();
	TriggerRegisterEnterRegion(eX,fR,NULL);
	TriggerAddCondition(eX,Condition(& Ub));
	eX=dE();
	pGlobal->Sr=CreateRegion();
	RegionAddRect(pGlobal->Sr,pGlobal->xo);
	TriggerRegisterEnterRegion(eX,pGlobal->Sr,NULL);
	TriggerAddCondition(eX,Condition(& ub));
	eX=NULL;
	fR=NULL;
}

boolean Wb()
{
	unit u=pGlobal->Oa[(pGlobal->J[GetPlayerId((GetTriggerPlayer()))][0])][0];
	integer id=GetResearched();
	integer ps;
	if (id==1378889797)
	{
		SetHeroStr(u,GetHeroStr(u,false),true);
	}
	else if(id==1378889795)
	{
		SetHeroAgi(u,GetHeroAgi(u,false),true);
	}
	else if(id==1378889796)
	{
		SetHeroInt(u,GetHeroInt(u,false),true);
	}
	else if(id==1378889799)
	{
		SetHeroStr(u,GetHeroStr(u,false),true);
		SetHeroAgi(u,GetHeroAgi(u,false),true);
		SetHeroInt(u,GetHeroInt(u,false),true);
	}
	else if(id==1378889800)
	{
		SetHeroStr(u,GetHeroStr(u,false),true);
		SetHeroAgi(u,GetHeroAgi(u,false),true);
		SetHeroInt(u,GetHeroInt(u,false),true);
	}
	else if(id==1378889801)
	{
		ps=(pGlobal->J[GetPlayerId((GetTriggerPlayer()))][0]);
		if (pGlobal->Ha[ps][0]<36)
		{
			UnitModifySkillPoints(u,1);
			pGlobal->Ha[ps][0]=pGlobal->Ha[ps][0]+1;
		}
		else 
		{
			lX(GetTriggerPlayer(),25,0);
			DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,5.,sMyString("You have no abilities left to learn, your gold has been refunded!"));
		}
	}
	u=NULL;
	return  false;
}

void yb()
{
	trigger eX=CreateTrigger();
	HE(eX,EVENT_PLAYER_UNIT_RESEARCH_FINISH,NULL);
	TriggerAddCondition(eX,Condition(& Wb));
	eX=NULL;
}

void InitCustomTeams()
{
	SetPlayerTeam(Player(0),0);
	SetPlayerTeam(Player(1),0);
	SetPlayerTeam(Player(2),0);
	SetPlayerTeam(Player(3),0);
	SetPlayerTeam(Player(4),0);
	SetPlayerTeam(Player(5),0);
	SetPlayerTeam(Player(6),0);
	SetPlayerTeam(Player(7),0);
	SetPlayerTeam(Player(8),0);
	SetPlayerTeam(Player(9),0);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(0),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(1),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(2),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(3),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(4),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(5),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(6),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(8),true);
	//SetPlayerAllianceStateAllyBJ(Player(7),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(8),Player(9),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(0),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(1),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(2),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(3),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(4),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(5),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(6),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(7),true);
	//SetPlayerAllianceStateAllyBJ(Player(9),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(0),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(1),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(2),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(3),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(4),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(5),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(6),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(8),true);
	//SetPlayerAllianceStateVisionBJ(Player(7),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(8),Player(9),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(0),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(1),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(2),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(3),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(4),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(5),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(6),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(7),true);
	//SetPlayerAllianceStateVisionBJ(Player(9),Player(8),true);
	SetPlayerTeam(Player(0xA),1);
	SetPlayerTeam(Player(0xB),1);
	//SetPlayerAllianceStateAllyBJ(Player(0xA),Player(0xB),true);
	//SetPlayerAllianceStateAllyBJ(Player(0xB),Player(0xA),true);
	//SetPlayerAllianceStateVisionBJ(Player(0xA),Player(0xB),true);
	//SetPlayerAllianceStateVisionBJ(Player(0xB),Player(0xA),true);
}

void fMainJass()
{
	weathereffect we;
	player p;
	unit u;
	integer unitID;
	trigger t;
	real YV;
	SetCameraBounds(-8192.+GetCameraMargin(CAMERA_MARGIN_LEFT),-8192.+GetCameraMargin(CAMERA_MARGIN_BOTTOM),8192.-GetCameraMargin(CAMERA_MARGIN_RIGHT),8192.-GetCameraMargin(CAMERA_MARGIN_TOP),-8192.+GetCameraMargin(CAMERA_MARGIN_LEFT),8192.-GetCameraMargin(CAMERA_MARGIN_TOP),8192.-GetCameraMargin(CAMERA_MARGIN_RIGHT),-8192.0+GetCameraMargin(CAMERA_MARGIN_BOTTOM));
	SetDayNightModels(sMyString("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl"),sMyString("Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl"));
	SetWaterBaseColor(0,0x80,0x80,0xFF);
	NewSoundEnvironment(sMyString("Default"));
	//SetAmbientDaySound(sMyString("LordaeronSummerDay"));
	//SetAmbientNightSound(sMyString("LordaeronSummerNight"));
	SetMapMusic(sMyString("Music"),true,0);
	pGlobal->Do=CreateSound(sMyString("Sound\\Music\\mp3Music\\PH1.mp3"),false,false,false,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Do,sMyString("PHMusic"));
	SetSoundDuration(pGlobal->Do,0x44BEE);
	SetSoundVolume(pGlobal->Do,0x7F);
	pGlobal->fo=CreateSound(sMyString("Sound\\Music\\mp3Music\\Credits.mp3"),false,false,false,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->fo,sMyString("CreditsMusic"));
	SetSoundDuration(pGlobal->fo,83017);
	pGlobal->Fo=CreateSound(sMyString("Units\\Demon\\HeroPitLord\\HPitLordWhat1.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->Fo,sMyString("HeroPitLordWhat"));
	SetSoundDuration(pGlobal->Fo,0xA97);
	pGlobal->go=CreateSound(sMyString("Units\\Demon\\HeroPitLord\\HPitLordYes1.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->go,sMyString("HeroPitLordYes"));
	SetSoundDuration(pGlobal->go,0x801);
	pGlobal->Go=CreateSound(sMyString("Units\\Demon\\HeroPitLord\\HPitLordYesAttack1.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->Go,sMyString("HeroPitLordYesAttack"));
	SetSoundDuration(pGlobal->Go,0x774);
	pGlobal->ho=CreateSound(sMyString("Doodads\\Cinematic\\Lightningbolt\\LightningBolt1.wav"),false,false,true,0xA,0xA,sMyString("SpellsEAX"));
	SetSoundParamsFromLabel(pGlobal->ho,sMyString("CinematicLightningBolt"));
	SetSoundDuration(pGlobal->ho,0xBB9);
	pGlobal->Ho=CreateSound(sMyString("Units\\Orc\\StasisTotem\\StasisTrapBirth.wav"),false,true,true,0xA,0xA,sMyString("SpellsEAX"));
	SetSoundParamsFromLabel(pGlobal->Ho,sMyString("StasisTotemBirth"));
	SetSoundDuration(pGlobal->Ho,0x929);
	pGlobal->jo=CreateSound(sMyString("Units\\Orc\\StasisTotem\\StasisTotem.wav"),false,true,true,0xA,0xA,sMyString("SpellsEAX"));
	SetSoundParamsFromLabel(pGlobal->jo,sMyString("StasisTotemDeath"));
	SetSoundDuration(pGlobal->jo,0x742);
	pGlobal->Jo=CreateSound(sMyString("Buildings\\Undead\\Ziggurat\\FrostTowerWhat1.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Jo,sMyString("FrostTowerWhat"));
	SetSoundDuration(pGlobal->Jo,4203);
	SetSoundChannel(pGlobal->Jo,7);
	SetSoundVolume(pGlobal->Jo,0x7F);
	SetSoundPitch(pGlobal->Jo,.1);
	pGlobal->ko=CreateSound(sMyString("Buildings\\Undead\\Ziggurat\\ZigguratUpgrade.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->ko,sMyString("ZigguratUpgradeWhat"));
	SetSoundDuration(pGlobal->ko,4203);
	SetSoundChannel(pGlobal->ko,7);
	SetSoundVolume(pGlobal->ko,0x7F);
	SetSoundPitch(pGlobal->ko,.1);
	pGlobal->Ko=CreateSound(sMyString("Buildings\\Undead\\Ziggurat\\ZigguratWhat.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Ko,sMyString("ZigguratWhat"));
	SetSoundDuration(pGlobal->Ko,4457);
	SetSoundChannel(pGlobal->Ko,7);
	SetSoundVolume(pGlobal->Ko,0x7F);
	SetSoundPitch(pGlobal->Ko,.1);
	pGlobal->lo=CreateSound(sMyString("Units\\Undead\\ObsidianStatue\\ObsidianAvengerPissed1.wav"),false,true,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->lo,sMyString("ObsidianDestroyerPissed"));
	SetSoundDuration(pGlobal->lo,0xBD0);
	SetSoundPitch(pGlobal->lo,.8);
	pGlobal->Lo=CreateSound(sMyString("Units\\Undead\\Varimathras\\VarimathrasReady1.wav"),false,false,false,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->Lo,sMyString("VarimathrasReady"));
	SetSoundDuration(pGlobal->Lo,0x84A);
	SetSoundPitch(pGlobal->Lo,1.1);
	pGlobal->mo=CreateSound(sMyString("Sound\\Buildings\\Undead\\UndeadBuildingBirth3.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->mo,sMyString("UndeadBuildingBirth3"));
	SetSoundDuration(pGlobal->mo,0xFF7);
	pGlobal->Mo=CreateSound(sMyString("Sound\\Music\\mp3Music\\Doom.mp3"),false,false,false,0xA,0xA,sMyString(0x02));
	SetSoundDuration(pGlobal->Mo,66125);
	SetSoundChannel(pGlobal->Mo,0);
	SetSoundVolume(pGlobal->Mo,0x7F);
	SetSoundPitch(pGlobal->Mo,1.);
	pGlobal->po=CreateSound(sMyString("Units\\Orc\\Hellscream\\GromPissed3.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->po,sMyString("GromPissed"));
	SetSoundDuration(pGlobal->po,5503);
	pGlobal->Po=CreateSound(sMyString("Units\\Orc\\SpiritWalker\\WhiteTaurenPissed6.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Po,sMyString("SpiritWalkerPissed"));
	SetSoundDuration(pGlobal->Po,0x3650);
	pGlobal->qo=CreateSound(sMyString("Units\\Other\\Rokhan\\RokhanPissed5.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->qo,sMyString("RokhanPissed"));
	SetSoundDuration(pGlobal->qo,7210);
	pGlobal->Qo=CreateSound(sMyString("Units\\Undead\\Acolyte\\AcolytePissed3.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->Qo,sMyString("AcolytePissed"));
	SetSoundDuration(pGlobal->Qo,0xE83);
	pGlobal->so=CreateSound(sMyString("Units\\Undead\\Acolyte\\AcolytePissed2.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->so,sMyString("AcolytePissed"));
	SetSoundDuration(pGlobal->so,0xA06);
	pGlobal->So=CreateSound(sMyString("Units\\Undead\\HeroDeathKnight\\DeathKnightPissed6.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->So,sMyString("HeroDeathKnightPissed"));
	SetSoundDuration(pGlobal->So,0xD39);
	pGlobal->to=CreateSound(sMyString("Units\\Undead\\Necromancer\\NecromancerPissed3.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->to,sMyString("NecromancerPissed"));
	SetSoundDuration(pGlobal->to,0x86A);
	pGlobal->To=CreateSound(sMyString("Units\\Undead\\Varimathras\\VarimathrasPissed8.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->To,sMyString("VarimathrasPissed"));
	SetSoundDuration(pGlobal->To,8906);
	pGlobal->uo=CreateSound(sMyString("Units\\Demon\\HeroPitLord\\HPitLordPissed5.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->uo,sMyString("HeroPitLordPissed"));
	SetSoundDuration(pGlobal->uo,0xA9EF);
	pGlobal->Uo=CreateSound(sMyString("Units\\Human\\BloodElfDragonHawk\\DragonHawkPissed8.wav"),false,false,true,0xA,0xA,sMyString("HeroAcksEAX"));
	SetSoundParamsFromLabel(pGlobal->Uo,sMyString("BloodElfDragonHawkPissed"));
	SetSoundDuration(pGlobal->Uo,0x275D);
	pGlobal->wo=CreateSound(sMyString("Units\\Human\\Knight\\KnightPissed1.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->wo,sMyString("KnightPissed"));
	SetSoundDuration(pGlobal->wo,0xE56);
	pGlobal->Wo=CreateSound(sMyString("Units\\Human\\Knight\\KnightPissed5.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Wo,sMyString("KnightPissed"));
	SetSoundDuration(pGlobal->Wo,0x8B5);
	pGlobal->yo=CreateSound(sMyString("Units\\Human\\MortarTeam\\MortarTeamPissed8.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->yo,sMyString("MortarTeamPissed"));
	SetSoundDuration(pGlobal->yo,0xEDA);
	pGlobal->Yo=CreateSound(sMyString("Units\\Human\\Peasant\\PeasantPissed1.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Yo,sMyString("PeasantPissed"));
	SetSoundDuration(pGlobal->Yo,0xD6D);
	pGlobal->zo=CreateSound(sMyString("Units\\Human\\Priest\\PriestPissed6.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->zo,sMyString("PriestPissed"));
	SetSoundDuration(pGlobal->zo,9323);
	pGlobal->Zo=CreateSound(sMyString("Units\\Human\\Rifleman\\RiflemanPissed5.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->Zo,sMyString("RiflemanPissed"));
	SetSoundDuration(pGlobal->Zo,4168);
	pGlobal->vr=CreateSound(sMyString("Units\\Human\\Peasant\\PeasantPissed2.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->vr,sMyString("PeasantPissed"));
	SetSoundDuration(pGlobal->vr,0xA8B);
	pGlobal->er=CreateSound(sMyString("Units\\Undead\\FrostWyrm\\FrostwyrmReady1.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->er,sMyString("FrostWyrmReady"));
	SetSoundDuration(pGlobal->er,0xFB1);
	SetSoundChannel(pGlobal->er,8);
	pGlobal->xr=CreateSound(sMyString("Abilities\\Spells\\Items\\ResourceItems\\ReceiveGold.wav"),false,false,true,0xA,0xA,sMyString("SpellsEAX"));
	SetSoundParamsFromLabel(pGlobal->xr,sMyString("ReceiveGold"));
	SetSoundDuration(pGlobal->xr,589);
	pGlobal->rr=CreateSound(sMyString("war3mapImported\\bfbp.mp3"),false,false,false,0xA,0xA,sMyString(0x02));
	SetSoundDuration(pGlobal->rr,0xF4E);
	SetSoundChannel(pGlobal->rr,0);
	SetSoundVolume(pGlobal->rr,0x7F);
	SetSoundPitch(pGlobal->rr,1.);
	pGlobal->ir=CreateSound(sMyString("Units\\Creeps\\HeroFlameLord\\HeroFirelordAttack2.wav"),false,false,true,0xA,0xA,sMyString("DefaultEAXON"));
	SetSoundParamsFromLabel(pGlobal->ir,sMyString("HeroFlameLordMissileLaunch"));
	SetSoundDuration(pGlobal->ir,0x568);
	SetSoundChannel(pGlobal->ir,0);
	pGlobal->Ve=Rect(7488.,2624.,8096.,2752.);
	pGlobal->Ee=Rect(-3136.,3776.,-3008.,4384.);
	pGlobal->Xe=Rect(7872.,-5952.,8000.,-5312.);
	pGlobal->Oe=Rect(-5056.,-5696.,-4416.,-5568.);
	pGlobal->Re=Rect(-8192.,6144.,-7424.,8192.);
	pGlobal->Ie=Rect(-7424.,7296.,-6016.,8192.);
	pGlobal->Ae=Rect(-6912.,6144.,-6240.,7296.);
	pGlobal->Ne=Rect(-8192.,5120.,-6144.,6016.);
	pGlobal->be=Rect(-6144.,6400.,-4608.,7296.);
	pGlobal->Be=Rect(-7296.,6016.,-7040.,7168.);
	pGlobal->ce=Rect(-6016.,7296.,-4736.,8192.);
	pGlobal->Ce=Rect(-6144.,4992.,-5120.,6400.);
	pGlobal->de=Rect(-4512.,6528.,-2304.,7552.);
	pGlobal->De=Rect(-4224.,5504.,-2560.,6528.);
	pGlobal->fe=Rect(-4608.,7680.,-1536.,8160.);
	pGlobal->Fe=Rect(-2176.,6400.,-1536.,7680.);
	pGlobal->ge=Rect(-2560.,5760.,-1536.,6400.);
	pGlobal->Ge=Rect(-1408.,6272.,1152.,8192.);
	pGlobal->he=Rect(1280.,7552.,3328.,8192.);
	pGlobal->He=Rect(1280.,4608.,2176.,7552.);
	pGlobal->je=Rect(3456.,5248.,4608.,8192.);
	pGlobal->Je=Rect(2176.,4352.,3456.,7424.);
	pGlobal->ke=Rect(4608.,5248.,5248.,8192.);
	pGlobal->Ke=Rect(5248.,7680.,8160.,8160.);
	pGlobal->le=Rect(7808.,4864.,8192.,7680.);
	pGlobal->Le=Rect(5248.,4608.,7680.,7552.);
	pGlobal->me=Rect(-8192.,3584.,-7168.,4992.);
	pGlobal->Me=Rect(-7168.,3968.,-6272.,4992.);
	pGlobal->pe=Rect(-3328.,3456.,-2304.,4608.);
	pGlobal->Pe=Rect(-2816.,1792.,-2304.,3456.);
	pGlobal->qe=Rect(7296.,1792.,8192.,2944.);
	pGlobal->Qe=Rect(-1920.,4608.,512.,5376.);
	pGlobal->se=Rect(-2304.,3552.,512.,4608.);
	pGlobal->Se=Rect(5632.,3072.,8192.,4608.);
	pGlobal->te=Rect(5632.,2304.,7296.,3072.);
	pGlobal->Te=Rect(-8192.,2176.,-6912.,3584.);
	pGlobal->ue=Rect(-8192.,896.,-6656.,2176.);
	pGlobal->Ue=Rect(-8192.,-128.,-6912.,896.);
	pGlobal->We=Rect(-4480.,2688.,-3584.,3456.);
	pGlobal->ye=Rect(-5504.,2688.,-4480.,4480.);
	pGlobal->Ye=Rect(-6144.,608.,-5504.,3584.);
	pGlobal->ze=Rect(-5504.,1536.,-3584.,2560.);
	pGlobal->Ze=Rect(-5504.,-256.,-3968.,1536.);
	pGlobal->vx=Rect(-2176.,1792.,896.,3456.);
	pGlobal->ex=Rect(-512.,1280.,384.,1792.);
	pGlobal->xx=Rect(4736.,640.,5120.,1664.);
	pGlobal->ox=Rect(3840.,-256.,4736.,2432.);
	pGlobal->rx=Rect(2432.,-128.,3840.,1984.);
	pGlobal->ix=Rect(4864.,-128.,5248.,512.);
	pGlobal->ax=Rect(5248.,-128.,6528.,1600.);
	pGlobal->nx=Rect(7296.,-128.,8192.,1792.);
	pGlobal->Vx=Rect(6784.,-1408.,8192.,-128.);
	pGlobal->Ex=Rect(7040.,128.,7296.,384.);
	pGlobal->Xx=Rect(-8192.,-3968.,-6784.,-1536.);
	pGlobal->Ox=Rect(-5888.,-2304.,-3840.,-512.);
	pGlobal->Rx=Rect(-3840.,-2048.,-3200.,-512.);
	pGlobal->Ix=Rect(-6272.,-4736.,-3456.,-2304.);
	pGlobal->Ax=Rect(-2432.,-2432.,-1152.,-1152.);
	pGlobal->Nx=Rect(-2944.,-3712.,-2432.,-2144.);
	pGlobal->bx=Rect(-2432.,-3968.,-1920.,-2432.);
	pGlobal->Bx=Rect(-2688.,-4736.,-1408.,-3968.);
	pGlobal->cx=Rect(-1792.,-3328.,-1152.,-2464.);
	pGlobal->Cx=Rect(-1152.,-3328.,-640.,-2912.);
	pGlobal->dx=Rect(-1792.,-3872.,-1408.,-3328.);
	pGlobal->Dx=Rect(-1408.,-4736.,.0,-3328.);
	pGlobal->fx=Rect(2176.,-3328.,4736.,-1024.);
	pGlobal->Fx=Rect(5376.,-2944.,6656.,-256.);
	pGlobal->gx=Rect(6656.,-2496.,8192.,-1536.);
	pGlobal->Gx=Rect(6656.,-2816.,7552.,-2496.);
	pGlobal->hx=Rect(-8192.,-6528.,-6784.,-4096.);
	pGlobal->Hx=Rect(-8192.,-8192.,-7168.,-6656.);
	pGlobal->jx=Rect(-7168.,-8192.,-5248.,-7168.);
	pGlobal->Jx=Rect(-6016.,-6528.,-5248.,-5376.);
	pGlobal->kx=Rect(-6400.,-7168.,-5248.,-6528.);
	pGlobal->Kx=Rect(-5248.,-8192.,-4096.,-7680.);
	pGlobal->lx=Rect(-5248.,-7552.,-4096.,-5376.);
	pGlobal->Lx=Rect(-4096.,-6656.,-3456.,-5376.);
	pGlobal->mx=Rect(6016.,-6144.,8192.,-5248.);
	pGlobal->Mx=Rect(-3328.,-6784.,-2048.,-5376.);
	pGlobal->px=Rect(-3968.,-8192.,-1792.,-6784.);
	pGlobal->Px=Rect(-1920.,-6784.,-256.,-5344.);
	pGlobal->qx=Rect(-256.,-7328.,1024.,-6016.);
	pGlobal->Qx=Rect(-1664.,-8192.,-256.,-6912.);
	pGlobal->sx=Rect(-256.,-8192.,1408.,-7424.);
	pGlobal->Sx=Rect(1152.,-7424.,1408.,-7040.);
	pGlobal->tx=Rect(640.,-5504.,1408.,-4224.);
	pGlobal->Tx=Rect(1408.,-5760.,3584.,-4352.);
	pGlobal->ux=Rect(1536.,-6016.,2048.,-5760.);
	pGlobal->Ux=Rect(5504.,-4224.,7552.,-2944.);
	pGlobal->wx=Rect(7552.,-4224.,8192.,-2560.);
	pGlobal->Wx=Rect(5120.,-5120.,8192.,-4224.);
	pGlobal->yx=Rect(1792.,-8192.,3488.,-6528.);
	pGlobal->Yx=Rect(3456.,-8192.,5632.,-7296.);
	pGlobal->zx=Rect(5760.,-8192.,8192.,-6144.);
	pGlobal->Zx=Rect(-1152.,-1440.,608.,256.);
	pGlobal->vo=Rect(512.,-2304.,896.,-1920.);
	pGlobal->eo=Rect(-4224.,4992.,-4096.,5376.);
	pGlobal->xo=Rect(-4992.,5760.,-4352.,6400.);
	pGlobal->oo=Rect(-4864.,5888.,-4512.,6208.);
	pGlobal->ro=Rect(3712.,3200.,4352.,3712.);
	pGlobal->io=Rect(3584.,3072.,4992.,3840.);
	pGlobal->ao=Rect(-672.,-1280.,160.,-992.);
	pGlobal->no=Rect(-448.,-672.,-64.,-288.);
	pGlobal->Vo=Rect(7488.,2624.,7616.,2752.);
	pGlobal->Eo=Rect(-3136.,3776.,-3008.,3904.);
	pGlobal->Xo=Rect(7872.,-5440.,8000.,-5312.);
	pGlobal->Oo=Rect(-4544.,-5696.,-4416.,-5568.);
	pGlobal->Ro=Rect(-3136.,3968.,-3008.,4192.);
	pGlobal->Io=Rect(7680.,2624.,7904.,2752.);
	pGlobal->Ao=Rect(-4864.,-5696.,-4608.,-5568.);
	pGlobal->No=Rect(7872.,-5760.,8000.,-5504.);
	pGlobal->bo=Rect(-3136.,4256.,-3008.,4384.);
	pGlobal->Bo=Rect(7968.,2624.,8096.,2752.);
	pGlobal->co=Rect(-5056.,-5696.,-4928.,-5568.);
	pGlobal->Co=Rect(7872.,-5952.,8000.,-5824.);
	pGlobal->do_2=Rect(-704.,-960.,192.,-32.);
	pGlobal->ro=Rect(4160.000000,3776.000000,4800.000000,4288.000000);
	pGlobal->oo=Rect(-4800.000000,5952.000000,-4288.000000,6336.000000);
	pGlobal->oo=Rect(-4800.000000,5952.000000,-4288.000000,6336.000000);
	pGlobal->udg_rect3=Rect(-8256.000000,7648.000000,-7776.000000,8128.000000);
	pGlobal->udg_rect4=Rect(-8256.000000,7136.000000,-7776.000000,7616.000000);
	pGlobal->udg_rect5=Rect(-8256.000000,6624.000000,-7776.000000,7104.000000);
	pGlobal->udg_rect6=Rect(-8256.000000,6112.000000,-7776.000000,6592.000000);
	pGlobal->udg_rect7=Rect(-8256.000000,4576.000000,-7776.000000,5056.000000);
	pGlobal->udg_rect8=Rect(-8256.000000,4064.000000,-7776.000000,4544.000000);
	pGlobal->udg_rect9=Rect(-8256.000000,2016.000000,-7776.000000,2496.000000);
	pGlobal->udg_rect10=Rect(-8256.000000,1504.000000,-7776.000000,1984.000000);
	pGlobal->udg_rect11=Rect(-8256.000000,992.000000,-7776.000000,1472.000000);
	pGlobal->udg_rect12=Rect(-8256.000000,480.000000,-7776.000000,960.000000);
	pGlobal->udg_rect13=Rect(-8256.000000,-32.000000,-7776.000000,448.000000);
	pGlobal->udg_rect14=Rect(-8256.000000,-544.000000,-7776.000000,-64.000000);
	pGlobal->udg_rect15=Rect(-8256.000000,-2080.000000,-7776.000000,-1600.000000);
	pGlobal->udg_rect16=Rect(-8256.000000,-2592.000000,-7776.000000,-2112.000000);
	pGlobal->udg_rect17=Rect(-8256.000000,-3104.000000,-7776.000000,-2624.000000);
	pGlobal->udg_rect18=Rect(-8256.000000,-3616.000000,-7776.000000,-3136.000000);
	pGlobal->udg_rect19=Rect(-8256.000000,-4640.000000,-7776.000000,-4160.000000);
	pGlobal->udg_rect20=Rect(-8256.000000,-5152.000000,-7776.000000,-4672.000000);
	pGlobal->udg_rect21=Rect(-8256.000000,-5664.000000,-7776.000000,-5184.000000);
	pGlobal->udg_rect22=Rect(-8256.000000,-6176.000000,-7776.000000,-5696.000000);
	pGlobal->udg_rect23=Rect(-8256.000000,-6688.000000,-7776.000000,-6208.000000);
	pGlobal->udg_rect24=Rect(-8256.000000,-7200.000000,-7776.000000,-6720.000000);
	pGlobal->udg_rect25=Rect(-8256.000000,-7712.000000,-7776.000000,-7232.000000);
	pGlobal->udg_rect26=Rect(-8256.000000,-8224.000000,-7776.000000,-7744.000000);
	pGlobal->udg_rect27=Rect(-7744.000000,7648.000000,-7264.000000,8128.000000);
	pGlobal->udg_rect28=Rect(-7744.000000,7136.000000,-7264.000000,7616.000000);
	pGlobal->udg_rect29=Rect(-7744.000000,6624.000000,-7264.000000,7104.000000);
	pGlobal->udg_rect30=Rect(-7744.000000,6112.000000,-7264.000000,6592.000000);
	pGlobal->udg_rect31=Rect(-7744.000000,4064.000000,-7264.000000,4544.000000);
	pGlobal->udg_rect31=Rect(-7744.000000,4064.000000,-7264.000000,4544.000000);
	pGlobal->udg_rect31=Rect(-7744.000000,4064.000000,-7264.000000,4544.000000);
	pGlobal->udg_rect34=Rect(-7744.000000,3552.000000,-7264.000000,4032.000000);
	pGlobal->udg_rect35=Rect(-7744.000000,2528.000000,-7264.000000,3008.000000);
	pGlobal->udg_rect35=Rect(-7744.000000,2528.000000,-7264.000000,3008.000000);
	pGlobal->udg_rect37=Rect(-7744.000000,2016.000000,-7264.000000,2496.000000);
	pGlobal->udg_rect38=Rect(-7744.000000,1504.000000,-7264.000000,1984.000000);
	pGlobal->udg_rect39=Rect(-7744.000000,992.000000,-7264.000000,1472.000000);
	pGlobal->udg_rect40=Rect(-7744.000000,480.000000,-7264.000000,960.000000);
	pGlobal->udg_rect41=Rect(-7744.000000,-32.000000,-7264.000000,448.000000);
	pGlobal->udg_rect42=Rect(-7744.000000,-544.000000,-7264.000000,-64.000000);
	pGlobal->udg_rect43=Rect(-7744.000000,-2080.000000,-7264.000000,-1600.000000);
	pGlobal->udg_rect44=Rect(-7744.000000,-2592.000000,-7264.000000,-2112.000000);
	pGlobal->udg_rect45=Rect(-7744.000000,-3104.000000,-7264.000000,-2624.000000);
	pGlobal->udg_rect46=Rect(-7744.000000,-3616.000000,-7264.000000,-3136.000000);
	pGlobal->udg_rect47=Rect(-7744.000000,-5152.000000,-7264.000000,-4672.000000);
	pGlobal->udg_rect48=Rect(-7744.000000,-5664.000000,-7264.000000,-5184.000000);
	pGlobal->udg_rect49=Rect(-7744.000000,-6176.000000,-7264.000000,-5696.000000);
	pGlobal->udg_rect50=Rect(-7744.000000,-6688.000000,-7264.000000,-6208.000000);
	pGlobal->udg_rect50=Rect(-7744.000000,-6688.000000,-7264.000000,-6208.000000);
	pGlobal->udg_rect50=Rect(-7744.000000,-6688.000000,-7264.000000,-6208.000000);
	pGlobal->udg_rect53=Rect(-7744.000000,-7200.000000,-7264.000000,-6720.000000);
	pGlobal->udg_rect54=Rect(-7744.000000,-7712.000000,-7264.000000,-7232.000000);
	pGlobal->udg_rect55=Rect(-7744.000000,-8224.000000,-7264.000000,-7744.000000);
	pGlobal->udg_rect56=Rect(-7232.000000,7648.000000,-6752.000000,8128.000000);
	pGlobal->udg_rect56=Rect(-7232.000000,7648.000000,-6752.000000,8128.000000);
	pGlobal->udg_rect58=Rect(-7232.000000,7136.000000,-6752.000000,7616.000000);
	pGlobal->udg_rect59=Rect(-7232.000000,6624.000000,-6752.000000,7104.000000);
	pGlobal->udg_rect60=Rect(-7232.000000,6112.000000,-6752.000000,6592.000000);
	pGlobal->udg_rect61=Rect(-7232.000000,4064.000000,-6752.000000,4544.000000);
	pGlobal->udg_rect62=Rect(-7232.000000,3552.000000,-6752.000000,4032.000000);
	pGlobal->udg_rect63=Rect(-7232.000000,2528.000000,-6752.000000,3008.000000);
	pGlobal->udg_rect64=Rect(-7232.000000,2016.000000,-6752.000000,2496.000000);
	pGlobal->udg_rect65=Rect(-7232.000000,1504.000000,-6752.000000,1984.000000);
	pGlobal->udg_rect66=Rect(-7232.000000,992.000000,-6752.000000,1472.000000);
	pGlobal->udg_rect67=Rect(-7232.000000,480.000000,-6752.000000,960.000000);
	pGlobal->udg_rect68=Rect(-7232.000000,-32.000000,-6752.000000,448.000000);
	pGlobal->udg_rect69=Rect(-7232.000000,-3104.000000,-6752.000000,-2624.000000);
	pGlobal->udg_rect70=Rect(-7232.000000,-3616.000000,-6752.000000,-3136.000000);
	pGlobal->udg_rect71=Rect(-7232.000000,-5152.000000,-6752.000000,-4672.000000);
	pGlobal->udg_rect72=Rect(-7232.000000,-5664.000000,-6752.000000,-5184.000000);
	pGlobal->udg_rect73=Rect(-7232.000000,-7200.000000,-6752.000000,-6720.000000);
	pGlobal->udg_rect74=Rect(-7232.000000,-7712.000000,-6752.000000,-7232.000000);
	pGlobal->udg_rect75=Rect(-7232.000000,-8224.000000,-6752.000000,-7744.000000);
	pGlobal->udg_rect76=Rect(-6720.000000,4064.000000,-6240.000000,4544.000000);
	pGlobal->udg_rect77=Rect(-6720.000000,992.000000,-6240.000000,1472.000000);
	pGlobal->udg_rect78=Rect(-6720.000000,480.000000,-6240.000000,960.000000);
	pGlobal->udg_rect79=Rect(-6720.000000,-7200.000000,-6240.000000,-6720.000000);
	pGlobal->udg_rect80=Rect(-6720.000000,-7712.000000,-6240.000000,-7232.000000);
	pGlobal->udg_rect81=Rect(-6720.000000,-8224.000000,-6240.000000,-7744.000000);
	pGlobal->udg_rect82=Rect(-6208.000000,1504.000000,-5728.000000,1984.000000);
	pGlobal->udg_rect83=Rect(-6208.000000,992.000000,-5728.000000,1472.000000);
	pGlobal->udg_rect83=Rect(-6208.000000,992.000000,-5728.000000,1472.000000);
	pGlobal->udg_rect85=Rect(-6208.000000,480.000000,-5728.000000,960.000000);
	pGlobal->udg_rect86=Rect(-6208.000000,-2592.000000,-5728.000000,-2112.000000);
	pGlobal->udg_rect87=Rect(-6208.000000,-7200.000000,-5728.000000,-6720.000000);
	pGlobal->udg_rect87=Rect(-6208.000000,-7200.000000,-5728.000000,-6720.000000);
	pGlobal->udg_rect87=Rect(-6208.000000,-7200.000000,-5728.000000,-6720.000000);
	pGlobal->udg_rect90=Rect(-6208.000000,-7712.000000,-5728.000000,-7232.000000);
	pGlobal->udg_rect91=Rect(-6208.000000,-8224.000000,-5728.000000,-7744.000000);
	pGlobal->udg_rect92=Rect(-5696.000000,2016.000000,-5216.000000,2496.000000);
	pGlobal->udg_rect93=Rect(-5696.000000,1504.000000,-5216.000000,1984.000000);
	pGlobal->udg_rect94=Rect(-5696.000000,992.000000,-5216.000000,1472.000000);
	pGlobal->udg_rect95=Rect(-5696.000000,480.000000,-5216.000000,960.000000);
	pGlobal->udg_rect96=Rect(-5696.000000,-1056.000000,-5216.000000,-576.000000);
	pGlobal->udg_rect97=Rect(-5696.000000,-1568.000000,-5216.000000,-1088.000000);
	pGlobal->udg_rect98=Rect(-5696.000000,-2592.000000,-5216.000000,-2112.000000);
	pGlobal->udg_rect99=Rect(-5696.000000,-3104.000000,-5216.000000,-2624.000000);
	pGlobal->udg_rect100=Rect(-5696.000000,-3616.000000,-5216.000000,-3136.000000);
	pGlobal->udg_rect100=Rect(-5696.000000,-3616.000000,-5216.000000,-3136.000000);
	pGlobal->udg_rect102=Rect(-5696.000000,-4128.000000,-5216.000000,-3648.000000);
	pGlobal->udg_rect103=Rect(-5696.000000,-4640.000000,-5216.000000,-4160.000000);
	pGlobal->udg_rect104=Rect(-5696.000000,-7200.000000,-5216.000000,-6720.000000);
	pGlobal->udg_rect105=Rect(-5696.000000,-7712.000000,-5216.000000,-7232.000000);
	pGlobal->udg_rect106=Rect(-5696.000000,-8224.000000,-5216.000000,-7744.000000);
	pGlobal->udg_rect107=Rect(-5184.000000,7648.000000,-4704.000000,8128.000000);
	pGlobal->udg_rect108=Rect(-5184.000000,7136.000000,-4704.000000,7616.000000);
	pGlobal->udg_rect109=Rect(-5184.000000,2016.000000,-4704.000000,2496.000000);
	pGlobal->udg_rect110=Rect(-5184.000000,1504.000000,-4704.000000,1984.000000);
	pGlobal->udg_rect111=Rect(-5184.000000,992.000000,-4704.000000,1472.000000);
	pGlobal->udg_rect112=Rect(-5184.000000,480.000000,-4704.000000,960.000000);
	pGlobal->udg_rect113=Rect(-5184.000000,-1056.000000,-4704.000000,-576.000000);
	pGlobal->udg_rect114=Rect(-5184.000000,-1568.000000,-4704.000000,-1088.000000);
	pGlobal->udg_rect115=Rect(-5184.000000,-2080.000000,-4704.000000,-1600.000000);
	pGlobal->udg_rect116=Rect(-5184.000000,-3104.000000,-4704.000000,-2624.000000);
	pGlobal->udg_rect117=Rect(-5184.000000,-3616.000000,-4704.000000,-3136.000000);
	pGlobal->udg_rect118=Rect(-5184.000000,-4128.000000,-4704.000000,-3648.000000);
	pGlobal->udg_rect119=Rect(-5184.000000,-4640.000000,-4704.000000,-4160.000000);
	pGlobal->udg_rect120=Rect(-5184.000000,-7712.000000,-4704.000000,-7232.000000);
	pGlobal->udg_rect121=Rect(-5184.000000,-8224.000000,-4704.000000,-7744.000000);
	pGlobal->udg_rect122=Rect(-4672.000000,7648.000000,-4192.000000,8128.000000);
	pGlobal->udg_rect123=Rect(-4672.000000,7136.000000,-4192.000000,7616.000000);
	pGlobal->udg_rect124=Rect(-4672.000000,2016.000000,-4192.000000,2496.000000);
	pGlobal->udg_rect125=Rect(-4672.000000,1504.000000,-4192.000000,1984.000000);
	pGlobal->udg_rect126=Rect(-4672.000000,992.000000,-4192.000000,1472.000000);
	pGlobal->udg_rect127=Rect(-4672.000000,480.000000,-4192.000000,960.000000);
	pGlobal->udg_rect128=Rect(-4672.000000,-1056.000000,-4192.000000,-576.000000);
	pGlobal->udg_rect129=Rect(-4672.000000,-1568.000000,-4192.000000,-1088.000000);
	pGlobal->udg_rect130=Rect(-4672.000000,-2080.000000,-4192.000000,-1600.000000);
	pGlobal->udg_rect131=Rect(-4672.000000,-3104.000000,-4192.000000,-2624.000000);
	pGlobal->udg_rect132=Rect(-4672.000000,-3616.000000,-4192.000000,-3136.000000);
	pGlobal->udg_rect133=Rect(-4672.000000,-7200.000000,-4192.000000,-6720.000000);
	pGlobal->udg_rect134=Rect(-4672.000000,-7712.000000,-4192.000000,-7232.000000);
	pGlobal->udg_rect135=Rect(-4672.000000,-8224.000000,-4192.000000,-7744.000000);
	pGlobal->udg_rect136=Rect(-4160.000000,7648.000000,-3680.000000,8128.000000);
	pGlobal->udg_rect137=Rect(-4160.000000,7136.000000,-3680.000000,7616.000000);
	pGlobal->udg_rect138=Rect(-4160.000000,-1056.000000,-3680.000000,-576.000000);
	pGlobal->udg_rect139=Rect(-4160.000000,-3104.000000,-3680.000000,-2624.000000);
	pGlobal->udg_rect140=Rect(-4160.000000,-3616.000000,-3680.000000,-3136.000000);
	pGlobal->udg_rect141=Rect(-3648.000000,7648.000000,-3168.000000,8128.000000);
	pGlobal->udg_rect142=Rect(-3648.000000,7136.000000,-3168.000000,7616.000000);
	pGlobal->udg_rect143=Rect(-3648.000000,-3104.000000,-3168.000000,-2624.000000);
	pGlobal->udg_rect144=Rect(-3648.000000,-3616.000000,-3168.000000,-3136.000000);
	pGlobal->udg_rect145=Rect(-3136.000000,7648.000000,-2656.000000,8128.000000);
	pGlobal->udg_rect146=Rect(-3136.000000,7136.000000,-2656.000000,7616.000000);
	pGlobal->udg_rect147=Rect(-3136.000000,-7712.000000,-2656.000000,-7232.000000);
	pGlobal->udg_rect148=Rect(-3136.000000,-8224.000000,-2656.000000,-7744.000000);
	pGlobal->udg_rect149=Rect(-2624.000000,7648.000000,-2144.000000,8128.000000);
	pGlobal->udg_rect150=Rect(-2624.000000,-6688.000000,-2144.000000,-6208.000000);
	pGlobal->udg_rect151=Rect(-2624.000000,-7200.000000,-2144.000000,-6720.000000);
	pGlobal->udg_rect152=Rect(-2624.000000,-7712.000000,-2144.000000,-7232.000000);
	pGlobal->udg_rect153=Rect(-2624.000000,-8224.000000,-2144.000000,-7744.000000);
	pGlobal->udg_rect154=Rect(-2112.000000,3552.000000,-1632.000000,4032.000000);
	pGlobal->udg_rect155=Rect(-2112.000000,3040.000000,-1632.000000,3520.000000);
	pGlobal->udg_rect156=Rect(-2112.000000,2528.000000,-1632.000000,3008.000000);
	pGlobal->udg_rect157=Rect(-2112.000000,2016.000000,-1632.000000,2496.000000);
	pGlobal->udg_rect158=Rect(-2112.000000,-6688.000000,-1632.000000,-6208.000000);
	pGlobal->udg_rect159=Rect(-2112.000000,-7200.000000,-1632.000000,-6720.000000);
	pGlobal->udg_rect160=Rect(-2112.000000,-7712.000000,-1632.000000,-7232.000000);
	pGlobal->udg_rect161=Rect(-2112.000000,-8224.000000,-1632.000000,-7744.000000);
	pGlobal->udg_rect162=Rect(-1600.000000,5088.000000,-1120.000000,5568.000000);
	pGlobal->udg_rect163=Rect(-1600.000000,4576.000000,-1120.000000,5056.000000);
	pGlobal->udg_rect164=Rect(-1600.000000,4064.000000,-1120.000000,4544.000000);
	pGlobal->udg_rect165=Rect(-1600.000000,3552.000000,-1120.000000,4032.000000);
	pGlobal->udg_rect166=Rect(-1600.000000,3040.000000,-1120.000000,3520.000000);
	pGlobal->udg_rect167=Rect(-1600.000000,2528.000000,-1120.000000,3008.000000);
	pGlobal->udg_rect168=Rect(-1600.000000,2016.000000,-1120.000000,2496.000000);
	pGlobal->udg_rect169=Rect(-1600.000000,-6688.000000,-1120.000000,-6208.000000);
	pGlobal->udg_rect170=Rect(-1600.000000,-7200.000000,-1120.000000,-6720.000000);
	pGlobal->udg_rect171=Rect(-1600.000000,-7712.000000,-1120.000000,-7232.000000);
	pGlobal->udg_rect172=Rect(-1600.000000,-8224.000000,-1120.000000,-7744.000000);
	pGlobal->udg_rect173=Rect(-1088.000000,7648.000000,-608.000000,8128.000000);
	pGlobal->udg_rect174=Rect(-1088.000000,5088.000000,-608.000000,5568.000000);
	pGlobal->udg_rect175=Rect(-1088.000000,4576.000000,-608.000000,5056.000000);
	pGlobal->udg_rect176=Rect(-1088.000000,4064.000000,-608.000000,4544.000000);
	pGlobal->udg_rect177=Rect(-1088.000000,3552.000000,-608.000000,4032.000000);
	pGlobal->udg_rect178=Rect(-1088.000000,3040.000000,-608.000000,3520.000000);
	pGlobal->udg_rect179=Rect(-1088.000000,2528.000000,-608.000000,3008.000000);
	pGlobal->udg_rect180=Rect(-1088.000000,2016.000000,-608.000000,2496.000000);
	pGlobal->udg_rect181=Rect(-1088.000000,-7200.000000,-608.000000,-6720.000000);
	pGlobal->udg_rect182=Rect(-1088.000000,-7712.000000,-608.000000,-7232.000000);
	pGlobal->udg_rect183=Rect(-1088.000000,-8224.000000,-608.000000,-7744.000000);
	pGlobal->udg_rect184=Rect(-576.000000,7648.000000,-96.000000,8128.000000);
	pGlobal->udg_rect185=Rect(-576.000000,7136.000000,-96.000000,7616.000000);
	pGlobal->udg_rect185=Rect(-576.000000,7136.000000,-96.000000,7616.000000);
	pGlobal->udg_rect185=Rect(-576.000000,7136.000000,-96.000000,7616.000000);
	pGlobal->udg_rect188=Rect(-576.000000,6624.000000,-96.000000,7104.000000);
	pGlobal->udg_rect189=Rect(-576.000000,6112.000000,-96.000000,6592.000000);
	pGlobal->udg_rect190=Rect(-576.000000,5088.000000,-96.000000,5568.000000);
	pGlobal->udg_rect190=Rect(-576.000000,5088.000000,-96.000000,5568.000000);
	pGlobal->udg_rect192=Rect(-576.000000,4576.000000,-96.000000,5056.000000);
	pGlobal->udg_rect193=Rect(-576.000000,4064.000000,-96.000000,4544.000000);
	pGlobal->udg_rect194=Rect(-576.000000,3552.000000,-96.000000,4032.000000);
	pGlobal->udg_rect195=Rect(-576.000000,3040.000000,-96.000000,3520.000000);
	pGlobal->udg_rect196=Rect(-576.000000,2528.000000,-96.000000,3008.000000);
	pGlobal->udg_rect197=Rect(-576.000000,2016.000000,-96.000000,2496.000000);
	pGlobal->udg_rect198=Rect(-576.000000,-6176.000000,-96.000000,-5696.000000);
	pGlobal->udg_rect199=Rect(-576.000000,-6688.000000,-96.000000,-6208.000000);
	pGlobal->udg_rect200=Rect(-576.000000,-7200.000000,-96.000000,-6720.000000);
	pGlobal->udg_rect201=Rect(-576.000000,-7712.000000,-96.000000,-7232.000000);
	pGlobal->udg_rect202=Rect(-576.000000,-8224.000000,-96.000000,-7744.000000);
	pGlobal->udg_rect203=Rect(-64.000000,7648.000000,416.000000,8128.000000);
	pGlobal->udg_rect204=Rect(-64.000000,7136.000000,416.000000,7616.000000);
	pGlobal->udg_rect205=Rect(-64.000000,6624.000000,416.000000,7104.000000);
	pGlobal->udg_rect206=Rect(-64.000000,6112.000000,416.000000,6592.000000);
	pGlobal->udg_rect207=Rect(-64.000000,5088.000000,416.000000,5568.000000);
	pGlobal->udg_rect208=Rect(-64.000000,4576.000000,416.000000,5056.000000);
	pGlobal->udg_rect209=Rect(-64.000000,4064.000000,416.000000,4544.000000);
	pGlobal->udg_rect210=Rect(-64.000000,3552.000000,416.000000,4032.000000);
	pGlobal->udg_rect211=Rect(-64.000000,3040.000000,416.000000,3520.000000);
	pGlobal->udg_rect212=Rect(-64.000000,2528.000000,416.000000,3008.000000);
	pGlobal->udg_rect213=Rect(-64.000000,2016.000000,416.000000,2496.000000);
	pGlobal->udg_rect213=Rect(-64.000000,2016.000000,416.000000,2496.000000);
	pGlobal->udg_rect213=Rect(-64.000000,2016.000000,416.000000,2496.000000);
	pGlobal->udg_rect216=Rect(-64.000000,-6176.000000,416.000000,-5696.000000);
	pGlobal->udg_rect217=Rect(-64.000000,-6688.000000,416.000000,-6208.000000);
	pGlobal->udg_rect218=Rect(-64.000000,-7200.000000,416.000000,-6720.000000);
	pGlobal->udg_rect219=Rect(-64.000000,-7712.000000,416.000000,-7232.000000);
	pGlobal->udg_rect220=Rect(-64.000000,-8224.000000,416.000000,-7744.000000);
	pGlobal->udg_rect221=Rect(448.000000,7648.000000,928.000000,8128.000000);
	pGlobal->udg_rect222=Rect(448.000000,7136.000000,928.000000,7616.000000);
	pGlobal->udg_rect223=Rect(448.000000,6624.000000,928.000000,7104.000000);
	pGlobal->udg_rect224=Rect(448.000000,6112.000000,928.000000,6592.000000);
	pGlobal->udg_rect225=Rect(448.000000,5088.000000,928.000000,5568.000000);
	pGlobal->udg_rect226=Rect(448.000000,4576.000000,928.000000,5056.000000);
	pGlobal->udg_rect227=Rect(448.000000,4064.000000,928.000000,4544.000000);
	pGlobal->udg_rect228=Rect(448.000000,3552.000000,928.000000,4032.000000);
	pGlobal->udg_rect229=Rect(448.000000,3040.000000,928.000000,3520.000000);
	pGlobal->udg_rect230=Rect(448.000000,2528.000000,928.000000,3008.000000);
	pGlobal->udg_rect231=Rect(448.000000,2016.000000,928.000000,2496.000000);
	pGlobal->udg_rect232=Rect(448.000000,-6688.000000,928.000000,-6208.000000);
	pGlobal->udg_rect233=Rect(448.000000,-7200.000000,928.000000,-6720.000000);
	pGlobal->udg_rect234=Rect(448.000000,-7712.000000,928.000000,-7232.000000);
	pGlobal->udg_rect235=Rect(448.000000,-8224.000000,928.000000,-7744.000000);
	pGlobal->udg_rect236=Rect(960.000000,6112.000000,1440.000000,6592.000000);
	pGlobal->udg_rect237=Rect(960.000000,4064.000000,1440.000000,4544.000000);
	pGlobal->udg_rect238=Rect(960.000000,3552.000000,1440.000000,4032.000000);
	pGlobal->udg_rect239=Rect(960.000000,-7200.000000,1440.000000,-6720.000000);
	pGlobal->udg_rect240=Rect(960.000000,-7712.000000,1440.000000,-7232.000000);
	pGlobal->udg_rect241=Rect(960.000000,-8224.000000,1440.000000,-7744.000000);
	pGlobal->udg_rect242=Rect(1472.000000,-7200.000000,1952.000000,-6720.000000);
	pGlobal->udg_rect243=Rect(1472.000000,-7712.000000,1952.000000,-7232.000000);
	pGlobal->udg_rect244=Rect(1472.000000,-8224.000000,1952.000000,-7744.000000);
	pGlobal->udg_rect245=Rect(2496.000000,-2080.000000,2976.000000,-1600.000000);
	pGlobal->udg_rect246=Rect(2496.000000,-2592.000000,2976.000000,-2112.000000);
	pGlobal->udg_rect246=Rect(2496.000000,-2592.000000,2976.000000,-2112.000000);
	pGlobal->udg_rect248=Rect(2496.000000,-3104.000000,2976.000000,-2624.000000);
	pGlobal->udg_rect249=Rect(2496.000000,-5664.000000,2976.000000,-5184.000000);
	pGlobal->udg_rect250=Rect(2496.000000,-6176.000000,2976.000000,-5696.000000);
	pGlobal->udg_rect251=Rect(3008.000000,-1568.000000,3488.000000,-1088.000000);
	pGlobal->udg_rect252=Rect(3008.000000,-2080.000000,3488.000000,-1600.000000);
	pGlobal->udg_rect253=Rect(3008.000000,-2592.000000,3488.000000,-2112.000000);
	pGlobal->udg_rect254=Rect(3008.000000,-3104.000000,3488.000000,-2624.000000);
	pGlobal->udg_rect255=Rect(3008.000000,-3616.000000,3488.000000,-3136.000000);
	pGlobal->udg_rect256=Rect(3008.000000,-5664.000000,3488.000000,-5184.000000);
	pGlobal->udg_rect257=Rect(3008.000000,-6176.000000,3488.000000,-5696.000000);
	pGlobal->udg_rect258=Rect(3520.000000,6624.000000,4000.000000,7104.000000);
	pGlobal->udg_rect259=Rect(3520.000000,6112.000000,4000.000000,6592.000000);
	pGlobal->udg_rect260=Rect(3520.000000,5600.000000,4000.000000,6080.000000);
	pGlobal->udg_rect260=Rect(3520.000000,5600.000000,4000.000000,6080.000000);
	pGlobal->udg_rect262=Rect(3520.000000,-1568.000000,4000.000000,-1088.000000);
	pGlobal->udg_rect263=Rect(3520.000000,-2080.000000,4000.000000,-1600.000000);
	pGlobal->udg_rect264=Rect(3520.000000,-2592.000000,4000.000000,-2112.000000);
	pGlobal->udg_rect265=Rect(3520.000000,-3104.000000,4000.000000,-2624.000000);
	pGlobal->udg_rect266=Rect(3520.000000,-3616.000000,4000.000000,-3136.000000);
	pGlobal->udg_rect267=Rect(3520.000000,-5664.000000,4000.000000,-5184.000000);
	pGlobal->udg_rect268=Rect(3520.000000,-6176.000000,4000.000000,-5696.000000);
	pGlobal->udg_rect269=Rect(3520.000000,-8224.000000,4000.000000,-7744.000000);
	pGlobal->udg_rect270=Rect(4032.000000,7136.000000,4512.000000,7616.000000);
	pGlobal->udg_rect271=Rect(4032.000000,6624.000000,4512.000000,7104.000000);
	pGlobal->udg_rect272=Rect(4032.000000,6112.000000,4512.000000,6592.000000);
	pGlobal->udg_rect273=Rect(4032.000000,5600.000000,4512.000000,6080.000000);
	pGlobal->udg_rect274=Rect(4032.000000,-2080.000000,4512.000000,-1600.000000);
	pGlobal->udg_rect275=Rect(4032.000000,-2592.000000,4512.000000,-2112.000000);
	pGlobal->udg_rect276=Rect(4032.000000,-3104.000000,4512.000000,-2624.000000);
	pGlobal->udg_rect277=Rect(4032.000000,-5664.000000,4512.000000,-5184.000000);
	pGlobal->udg_rect277=Rect(4032.000000,-5664.000000,4512.000000,-5184.000000);
	pGlobal->udg_rect279=Rect(4032.000000,-6176.000000,4512.000000,-5696.000000);
	pGlobal->udg_rect280=Rect(4032.000000,-6688.000000,4512.000000,-6208.000000);
	pGlobal->udg_rect281=Rect(4032.000000,-7200.000000,4512.000000,-6720.000000);
	pGlobal->udg_rect282=Rect(4032.000000,-7712.000000,4512.000000,-7232.000000);
	pGlobal->udg_rect283=Rect(4032.000000,-8224.000000,4512.000000,-7744.000000);
	pGlobal->udg_rect284=Rect(4544.000000,7136.000000,5024.000000,7616.000000);
	pGlobal->udg_rect285=Rect(4544.000000,6624.000000,5024.000000,7104.000000);
	pGlobal->udg_rect286=Rect(4544.000000,6112.000000,5024.000000,6592.000000);
	pGlobal->udg_rect287=Rect(4544.000000,5600.000000,5024.000000,6080.000000);
	pGlobal->udg_rect288=Rect(4544.000000,-2592.000000,5024.000000,-2112.000000);
	pGlobal->udg_rect289=Rect(4544.000000,-7200.000000,5024.000000,-6720.000000);
	pGlobal->udg_rect290=Rect(4544.000000,-7712.000000,5024.000000,-7232.000000);
	pGlobal->udg_rect291=Rect(4544.000000,-8224.000000,5024.000000,-7744.000000);
	pGlobal->udg_rect292=Rect(5056.000000,-7200.000000,5536.000000,-6720.000000);
	pGlobal->udg_rect293=Rect(5056.000000,-7712.000000,5536.000000,-7232.000000);
	pGlobal->udg_rect294=Rect(5056.000000,-8224.000000,5536.000000,-7744.000000);
	pGlobal->udg_rect295=Rect(5568.000000,-3616.000000,6048.000000,-3136.000000);
	pGlobal->udg_rect296=Rect(5568.000000,-4128.000000,6048.000000,-3648.000000);
	pGlobal->udg_rect297=Rect(5568.000000,-7200.000000,6048.000000,-6720.000000);
	pGlobal->udg_rect298=Rect(5568.000000,-7712.000000,6048.000000,-7232.000000);
	pGlobal->udg_rect299=Rect(5568.000000,-8224.000000,6048.000000,-7744.000000);
	pGlobal->udg_rect300=Rect(6080.000000,7648.000000,6560.000000,8128.000000);
	pGlobal->udg_rect301=Rect(6080.000000,7136.000000,6560.000000,7616.000000);
	pGlobal->udg_rect302=Rect(6080.000000,-32.000000,6560.000000,448.000000);
	pGlobal->udg_rect303=Rect(6080.000000,-544.000000,6560.000000,-64.000000);
	pGlobal->udg_rect304=Rect(6080.000000,-3104.000000,6560.000000,-2624.000000);
	pGlobal->udg_rect305=Rect(6080.000000,-3616.000000,6560.000000,-3136.000000);
	pGlobal->udg_rect306=Rect(6080.000000,-4128.000000,6560.000000,-3648.000000);
	pGlobal->udg_rect307=Rect(6080.000000,-7200.000000,6560.000000,-6720.000000);
	pGlobal->udg_rect308=Rect(6080.000000,-7712.000000,6560.000000,-7232.000000);
	pGlobal->udg_rect309=Rect(6080.000000,-8224.000000,6560.000000,-7744.000000);
	pGlobal->udg_rect310=Rect(6592.000000,7648.000000,7072.000000,8128.000000);
	pGlobal->udg_rect311=Rect(6592.000000,7136.000000,7072.000000,7616.000000);
	pGlobal->udg_rect312=Rect(6592.000000,6624.000000,7072.000000,7104.000000);
	pGlobal->udg_rect313=Rect(6592.000000,-32.000000,7072.000000,448.000000);
	pGlobal->udg_rect314=Rect(6592.000000,-544.000000,7072.000000,-64.000000);
	pGlobal->udg_rect315=Rect(6592.000000,-1056.000000,7072.000000,-576.000000);
	pGlobal->udg_rect316=Rect(6592.000000,-1568.000000,7072.000000,-1088.000000);
	pGlobal->udg_rect317=Rect(6592.000000,-2080.000000,7072.000000,-1600.000000);
	pGlobal->udg_rect318=Rect(6592.000000,-2592.000000,7072.000000,-2112.000000);
	pGlobal->udg_rect319=Rect(6592.000000,-3104.000000,7072.000000,-2624.000000);
	pGlobal->udg_rect320=Rect(6592.000000,-3616.000000,7072.000000,-3136.000000);
	pGlobal->udg_rect321=Rect(6592.000000,-4128.000000,7072.000000,-3648.000000);
	pGlobal->udg_rect322=Rect(6592.000000,-4640.000000,7072.000000,-4160.000000);
	pGlobal->udg_rect323=Rect(6592.000000,-5152.000000,7072.000000,-4672.000000);
	pGlobal->udg_rect323=Rect(6592.000000,-5152.000000,7072.000000,-4672.000000);
	pGlobal->udg_rect323=Rect(6592.000000,-5152.000000,7072.000000,-4672.000000);
	pGlobal->udg_rect326=Rect(6592.000000,-6688.000000,7072.000000,-6208.000000);
	pGlobal->udg_rect327=Rect(6592.000000,-7200.000000,7072.000000,-6720.000000);
	pGlobal->udg_rect328=Rect(6592.000000,-7712.000000,7072.000000,-7232.000000);
	pGlobal->udg_rect329=Rect(6592.000000,-8224.000000,7072.000000,-7744.000000);
	pGlobal->udg_rect330=Rect(7104.000000,7648.000000,7584.000000,8128.000000);
	pGlobal->udg_rect331=Rect(7104.000000,7136.000000,7584.000000,7616.000000);
	pGlobal->udg_rect332=Rect(7104.000000,6624.000000,7584.000000,7104.000000);
	pGlobal->udg_rect333=Rect(7104.000000,1504.000000,7584.000000,1984.000000);
	pGlobal->udg_rect334=Rect(7104.000000,992.000000,7584.000000,1472.000000);
	pGlobal->udg_rect335=Rect(7104.000000,480.000000,7584.000000,960.000000);
	pGlobal->udg_rect336=Rect(7104.000000,-32.000000,7584.000000,448.000000);
	pGlobal->udg_rect337=Rect(7104.000000,-544.000000,7584.000000,-64.000000);
	pGlobal->udg_rect338=Rect(7104.000000,-1056.000000,7584.000000,-576.000000);
	pGlobal->udg_rect339=Rect(7104.000000,-1568.000000,7584.000000,-1088.000000);
	pGlobal->udg_rect340=Rect(7104.000000,-2080.000000,7584.000000,-1600.000000);
	pGlobal->udg_rect341=Rect(7104.000000,-2592.000000,7584.000000,-2112.000000);
	pGlobal->udg_rect342=Rect(7104.000000,-3104.000000,7584.000000,-2624.000000);
	pGlobal->udg_rect343=Rect(7104.000000,-3616.000000,7584.000000,-3136.000000);
	pGlobal->udg_rect344=Rect(7104.000000,-4128.000000,7584.000000,-3648.000000);
	pGlobal->udg_rect345=Rect(7104.000000,-4640.000000,7584.000000,-4160.000000);
	pGlobal->udg_rect346=Rect(7104.000000,-5152.000000,7584.000000,-4672.000000);
	pGlobal->udg_rect347=Rect(7104.000000,-7200.000000,7584.000000,-6720.000000);
	pGlobal->udg_rect348=Rect(7104.000000,-7712.000000,7584.000000,-7232.000000);
	pGlobal->udg_rect349=Rect(7104.000000,-8224.000000,7584.000000,-7744.000000);
	pGlobal->udg_rect350=Rect(7616.000000,7648.000000,8096.000000,8128.000000);
	pGlobal->udg_rect351=Rect(7616.000000,7136.000000,8096.000000,7616.000000);
	pGlobal->udg_rect352=Rect(7616.000000,6624.000000,8096.000000,7104.000000);
	pGlobal->udg_rect353=Rect(7616.000000,1504.000000,8096.000000,1984.000000);
	pGlobal->udg_rect354=Rect(7616.000000,992.000000,8096.000000,1472.000000);
	pGlobal->udg_rect355=Rect(7616.000000,480.000000,8096.000000,960.000000);
	pGlobal->udg_rect356=Rect(7616.000000,-32.000000,8096.000000,448.000000);
	pGlobal->udg_rect357=Rect(7616.000000,-544.000000,8096.000000,-64.000000);
	pGlobal->udg_rect358=Rect(7616.000000,-1056.000000,8096.000000,-576.000000);
	pGlobal->udg_rect359=Rect(7616.000000,-1568.000000,8096.000000,-1088.000000);
	pGlobal->udg_rect360=Rect(7616.000000,-2080.000000,8096.000000,-1600.000000);
	pGlobal->udg_rect361=Rect(7616.000000,-2592.000000,8096.000000,-2112.000000);
	pGlobal->udg_rect362=Rect(7616.000000,-3104.000000,8096.000000,-2624.000000);
	pGlobal->udg_rect363=Rect(7616.000000,-3616.000000,8096.000000,-3136.000000);
	pGlobal->udg_rect364=Rect(7616.000000,-4128.000000,8096.000000,-3648.000000);
	pGlobal->udg_rect365=Rect(7616.000000,-7200.000000,8096.000000,-6720.000000);
	pGlobal->udg_rect366=Rect(7616.000000,-7712.000000,8096.000000,-7232.000000);
	pGlobal->udg_rect367=Rect(7616.000000,-8224.000000,8096.000000,-7744.000000);
	we=AddWeatherEffect(pGlobal->vo,1380739186);
	EnableWeatherEffect(we,true);
	p=Player(PLAYER_NEUTRAL_PASSIVE);
	u=CreateUnit(p,1848651828,768.,384.,270.);
	u=CreateUnit(p,1848651849,-512.,512.,270.);
	u=CreateUnit(p,1848651845,.0,512.,270.);
	u=CreateUnit(p,1848651824,-256.,512.,270.);
	u=CreateUnit(p,1848651831,320.,448.,270.);
	u=CreateUnit(p,1848651826,448.,448.,270.);
	u=CreateUnit(p,1749183588,-7488.000000,4544.000000,270.);
	u=CreateUnit(p,1749183588,-7360.000000,4544.000000,270.);
	u=CreateUnit(p,1749183588,-7616.000000,2880.000000,270.);
	u=CreateUnit(p,1749183588,-7232.000000,-6336.000000,270.);
	u=CreateUnit(p,1749183588,-7232.000000,-6464.000000,270.);
	u=CreateUnit(p,1749183588,-6720.000000,8000.000000,270.);
	u=CreateUnit(p,1749183588,-6080.000000,1344.000000,270.);
	u=CreateUnit(p,1749183588,-5952.000000,-6720.000000,270.);
	u=CreateUnit(p,1749183588,-5824.000000,-6720.000000,270.);
	u=CreateUnit(p,1749183588,-5568.000000,-3264.000000,270.);
	u=CreateUnit(p,1749183588,-448.000000,7488.000000,270.);
	u=CreateUnit(p,1749183588,-448.000000,7360.000000,270.);
	u=CreateUnit(p,1749183588,-320.000000,5568.000000,270.);
	u=CreateUnit(p,1749183588,192.000000,2112.000000,270.);
	u=CreateUnit(p,1749183588,320.000000,2112.000000,270.);
	u=CreateUnit(p,1749183588,2624.000000,-2240.000000,270.);
	u=CreateUnit(p,1749183588,3776.000000,5696.000000,270.);
	u=CreateUnit(p,1749183588,4288.000000,-5184.000000,270.);
	u=CreateUnit(p,1749183588,6720.000000,-4800.000000,270.);
	u=CreateUnit(p,1749183588,6720.000000,-4928.000000,270.);
	u=CreateUnit(p,1848651846,768.,-2048.,270.);
	u=CreateUnit(p,1848651848,832.,64.,270.);
	u=CreateUnit(p,1984984113,-1536.,128.,270.);
	SetUnitColor(u,ConvertPlayerColor(0xC));
	u=CreateUnit(p,1984984114,-1536.,384.,270.);
	SetUnitColor(u,ConvertPlayerColor(0xC));
	u=CreateUnit(p,1848651841,832.,-64.,270.);
	p=Player(0xA);
	u=CreateUnit(p,1985176940,-1728.,192.,270.);
	p=Player(0xB);
	u=CreateUnit(p,1985176940,-1728.,320.,270.);
	p=Player(PLAYER_NEUTRAL_PASSIVE);
	u=CreateUnit(p,1747988824,3747.8,3363.9,76.2);
	u=CreateUnit(p,1747988824,3744.2,3442.8,76.2);
	u=CreateUnit(p,1747988824,3833.4,3368.4,76.2);
	u=CreateUnit(p,1747988824,3824.8,3460.6,76.2);
	u=CreateUnit(p,1747988824,3911.5,3455.6,76.2);
	u=CreateUnit(p,1747988824,4220.8,3522.3,76.2);
	u=CreateUnit(p,1747988824,3979.9,3452.2,76.2);
	u=CreateUnit(p,1747988824,3968.3,3533.,76.2);
	u=CreateUnit(p,1747988824,4054.3,3455.6,76.2);
	u=CreateUnit(p,1747988824,4221.8,3398.4,76.2);
	u=CreateUnit(p,1747988824,4140.6,3453.9,76.2);
	//InitBlizzard();
	fMyExecuteFunc(sMyString("Yb"));
	fMyExecuteFunc(sMyString("jasshelper__initstructs437536"));
	fMyExecuteFunc(sMyString("utils__init"));
	fMyExecuteFunc(sMyString("memread__init"));
	fMyExecuteFunc(sMyString("buffer___init"));
	fMyExecuteFunc(sMyString("memvars___init"));
	fMyExecuteFunc(sMyString("memory__init"));
	fMyExecuteFunc(sMyString("bitwise___init"));
//call	TimerStart(CreateTimer(),2,false,& Loader___init);
}

void config()
{
	SetMapName(sMyString("|cffff1122Vampirism Fire v5.10b[1]|r"));
	SetMapDescription(sMyString("Visit us at http://fire.vampirism.eu/"));
	SetPlayers(0xC);
	SetTeams(0xC);
	SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER);
	DefineStartLocation(0,-256.,-1472.);
	DefineStartLocation(1,-256.,-1472.);
	DefineStartLocation(2,-256.,-1472.);
	DefineStartLocation(3,-256.,-1472.);
	DefineStartLocation(4,-256.,-1472.);
	DefineStartLocation(5,-256.,-1472.);
	DefineStartLocation(6,-256.,-1472.);
	DefineStartLocation(7,-256.,-1472.);
	DefineStartLocation(8,-256.,-1472.);
	DefineStartLocation(9,-256.,-1472.);
	DefineStartLocation(0xA,-256.,-1472.);
	DefineStartLocation(0xB,-256.,-1472.);
	SetPlayerStartLocation(Player(0),0);
	ForcePlayerStartLocation(Player(0),0);
	SetPlayerColor(Player(0),ConvertPlayerColor(0));
	SetPlayerRacePreference(Player(0),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(0),false);
	SetPlayerController(Player(0),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(1),1);
	ForcePlayerStartLocation(Player(1),1);
	SetPlayerColor(Player(1),ConvertPlayerColor(1));
	SetPlayerRacePreference(Player(1),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(1),false);
	SetPlayerController(Player(1),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(2),2);
	ForcePlayerStartLocation(Player(2),2);
	SetPlayerColor(Player(2),ConvertPlayerColor(2));
	SetPlayerRacePreference(Player(2),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(2),false);
	SetPlayerController(Player(2),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(3),3);
	ForcePlayerStartLocation(Player(3),3);
	SetPlayerColor(Player(3),ConvertPlayerColor(3));
	SetPlayerRacePreference(Player(3),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(3),false);
	SetPlayerController(Player(3),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(4),4);
	ForcePlayerStartLocation(Player(4),4);
	SetPlayerColor(Player(4),ConvertPlayerColor(4));
	SetPlayerRacePreference(Player(4),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(4),false);
	SetPlayerController(Player(4),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(5),5);
	ForcePlayerStartLocation(Player(5),5);
	SetPlayerColor(Player(5),ConvertPlayerColor(5));
	SetPlayerRacePreference(Player(5),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(5),false);
	SetPlayerController(Player(5),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(6),6);
	ForcePlayerStartLocation(Player(6),6);
	SetPlayerColor(Player(6),ConvertPlayerColor(6));
	SetPlayerRacePreference(Player(6),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(6),false);
	SetPlayerController(Player(6),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(7),7);
	ForcePlayerStartLocation(Player(7),7);
	SetPlayerColor(Player(7),ConvertPlayerColor(7));
	SetPlayerRacePreference(Player(7),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(7),false);
	SetPlayerController(Player(7),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(8),8);
	ForcePlayerStartLocation(Player(8),8);
	SetPlayerColor(Player(8),ConvertPlayerColor(8));
	SetPlayerRacePreference(Player(8),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(8),false);
	SetPlayerController(Player(8),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(9),9);
	ForcePlayerStartLocation(Player(9),9);
	SetPlayerColor(Player(9),ConvertPlayerColor(9));
	SetPlayerRacePreference(Player(9),RACE_PREF_HUMAN);
	SetPlayerRaceSelectable(Player(9),false);
	SetPlayerController(Player(9),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(0xA),0xA);
	ForcePlayerStartLocation(Player(0xA),0xA);
	SetPlayerColor(Player(0xA),ConvertPlayerColor(0xA));
	SetPlayerRacePreference(Player(0xA),RACE_PREF_UNDEAD);
	SetPlayerRaceSelectable(Player(0xA),false);
	SetPlayerController(Player(0xA),MAP_CONTROL_USER);
	SetPlayerStartLocation(Player(0xB),0xB);
	ForcePlayerStartLocation(Player(0xB),0xB);
	SetPlayerColor(Player(0xB),ConvertPlayerColor(0xB));
	SetPlayerRacePreference(Player(0xB),RACE_PREF_UNDEAD);
	SetPlayerRaceSelectable(Player(0xB),false);
	SetPlayerController(Player(0xB),MAP_CONTROL_USER);
	InitCustomTeams();
	SetStartLocPrioCount(0,9);
	SetStartLocPrio(0,0,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,1,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,2,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,3,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,4,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(1,0xA);
	SetStartLocPrio(1,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,1,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,2,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,3,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,4,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(1,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(2,0xA);
	SetStartLocPrio(2,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,2,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,3,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,4,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(2,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(3,0xA);
	SetStartLocPrio(3,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,3,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,4,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(3,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(4,0xA);
	SetStartLocPrio(4,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,4,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(4,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(5,0xA);
	SetStartLocPrio(5,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,4,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(5,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(6,0xA);
	SetStartLocPrio(6,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,4,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,5,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(6,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(7,0xA);
	SetStartLocPrio(7,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,4,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,5,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,6,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(7,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(8,0xA);
	SetStartLocPrio(8,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,4,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,5,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,6,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,7,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(8,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(9,0xA);
	SetStartLocPrio(9,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,4,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,5,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,6,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,7,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,8,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(9,9,0xA,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(0xA,9);
	SetStartLocPrio(0xA,0,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,1,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,2,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,3,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,4,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,5,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,6,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,7,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xA,8,9,MAP_LOC_PRIO_HIGH);
	SetStartLocPrioCount(0xB,0xA);
	SetStartLocPrio(0xB,0,0,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,1,1,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,2,2,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,3,3,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,4,4,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,5,5,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,6,6,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,7,7,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,8,8,MAP_LOC_PRIO_HIGH);
	SetStartLocPrio(0xB,9,9,MAP_LOC_PRIO_HIGH);
}

boolean zb()
{
	integer hn=pGlobal->Fn;
	pGlobal->ea[(GetUnitUserData((pGlobal->Wa[hn][0])))][0]=0;
	LV(pGlobal->wa[hn][0]);
	pGlobal->Wa[hn][0]=NULL;
	pGlobal->ya[hn][0]=NULL;
	return  true;
}

boolean Zb()
{
	integer hn=pGlobal->Fn;
	pGlobal->va[(GetUnitUserData((pGlobal->sa[hn][0])))][0]=0;
	UnitRemoveAbility(pGlobal->sa[hn][0],1517891632);
	FlushChildHashtable(pGlobal->ov,GetHandleId((pGlobal->Qa[hn][0])));
	PauseTimer(pGlobal->Qa[hn][0]);
	DestroyTimer(pGlobal->Qa[hn][0]);
	pGlobal->Qa[hn][0]=NULL;
	pGlobal->sa[hn][0]=NULL;
	pGlobal->Sa[hn][0]=NULL;
	return  true;
}

boolean vB()
{
	integer hn=Yn();
	pGlobal->zr[hn][0]=true;
	pGlobal->bn=hn;
	return  true;
}

boolean eB()
{
	pGlobal->bn=VV(pGlobal->Fn,pGlobal->cn,pGlobal->Cn);
	return  true;
}

boolean xB()
{
	pGlobal->bn=EV(pGlobal->Fn,pGlobal->cn);
	return  true;
}

boolean oB()
{
	Tn((pGlobal->Fn),(pGlobal->cn),0);
	return  true;
}

boolean rB()
{
	pGlobal->gn=XV(pGlobal->Fn,pGlobal->cn,pGlobal->Cn);
	return  true;
}

boolean iB()
{
	integer vV=pGlobal->Cn;
	integer eV=pGlobal->dn;
	integer xV=pGlobal->Dn;
	boolean oV=pGlobal->fn;
	integer BV=rV();
	integer i;
	if (pGlobal->X<eV)
	{
		i=pGlobal->X;
		while(true)
		{
			if ( i>eV) break;
			pGlobal->E[i][0]=2*pGlobal->E[i-1][0];
			i=i+1;
		}
		pGlobal->X=eV;
	}
	pGlobal->Zr[BV][0]=eV;
	pGlobal->ei[BV][0]=xV;
	pGlobal->vi[BV][0]=vV;
	pGlobal->xi[BV][0]=oV;
	if (xV!=0)
	{
		pGlobal->Wr[BV][0]=-pGlobal->E[eV][0];
	}
	else 
	{
		pGlobal->Wr[BV][0]=0;
	}
	pGlobal->yr[BV][0]=pGlobal->E[eV][0]-1;
	pGlobal->bn=BV;
	return  true;
}

boolean aB()
{
	pGlobal->bn=OV(pGlobal->Fn,pGlobal->cn,pGlobal->Cn);
	return  true;
}

boolean nB()
{
	pGlobal->bn=RV(pGlobal->Fn,pGlobal->cn);
	return  true;
}

boolean VB()
{
	IV(pGlobal->Fn,pGlobal->cn);
	return  true;
}

boolean EB()
{
	pGlobal->gn=AV(pGlobal->Fn,pGlobal->cn,pGlobal->Cn);
	return  true;
}

boolean XB()
{
	NV(pGlobal->cn,pGlobal->Cn);
	return  true;
}

boolean OB()
{
	pGlobal->bn=cV(pGlobal->cn,pGlobal->Cn,pGlobal->dn);
	return  true;
}

boolean RB()
{
	pGlobal->bn=DV(pGlobal->cn,pGlobal->Cn);
	return  true;
}

boolean IB()
{
	integer i=0;
	integer o=-1;
	boolean oops=false;
	if (pGlobal->B)
	{
		return  true;
	}
	else 
	{
		pGlobal->B=true;
	}
	pGlobal->I=InitHashtable();
	while(true)
	{
		if ((i==256)) break;
		pGlobal->Ya[i][0]=CreateTimer();
		SaveInteger(pGlobal->I,0,GetHandleId((pGlobal->Ya[i][0])),(pGlobal->N));
		i=i+1;
	}
	pGlobal->A=256;
	return  true;
}

boolean AB()
{
	nE(GetOwningPlayer(GetSpellTargetUnit()),GetSpellTargetUnit(),1093677398,sMyString("bloodlust"));
	return  true;
}

boolean NB()
{
	nE(GetOwningPlayer(GetSpellTargetUnit()),GetSpellTargetUnit(),1093677364,sMyString("bloodlust"));
	return  true;
}

boolean bB()
{
	integer p=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit()));
	if (pGlobal->ca[pGlobal->J[p][0]][0]==1)
	{
		pGlobal->ca[pGlobal->J[p][0]][0]=2;
	}
	else 
	{
		pGlobal->ca[pGlobal->J[p][0]][0]=1;
	}
	return  true;
}

boolean BB()
{
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl"),GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit())));
	RemoveUnit(GetSpellAbilityUnit());
	return  true;
}

boolean cB()
{
	unit u=GetSpellAbilityUnit();
	TimerStart(lV(IE(u)),.5,false,& IX);
	u=NULL;
	return  true;
}

boolean CB()
{
	unit uC=GetSpellAbilityUnit();
	unit uT=GetSpellTargetUnit();
	unit uR;
	player pC=GetOwningPlayer(uC);
	boolean SX=false;
	if (uT==NULL)
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(pC,sMyString("You must target a friendly unit!"));
	}
	else 
	{
		GroupEnumUnitsInRange(pGlobal->rv,GetUnitX(uT),GetUnitY(uT),0x96,NULL);
		uR=FirstOfGroup(pGlobal->rv);
		while(true)
		{
			if ( uR==NULL) break;
			GroupRemoveUnit(pGlobal->rv,uR);
			if (IsUnitType(uR,UNIT_TYPE_STRUCTURE)&& pGlobal->Ea[pGlobal->J[GetPlayerId(GetOwningPlayer(uR))][0]][0]==1)
			{
				SX=true;
			}
			uR=FirstOfGroup(pGlobal->rv);
		}
		if (SX)
		{
			IssueImmediateOrderById(uC,0xD0004);
			hX(pC,sMyString("You are trying to teleport too close to a human building!"));
		}
	}
	uC=NULL;
	uT=NULL;
	return  true;
}

boolean dB()
{
	unit u=GetSpellAbilityUnit();
	unit UX=(LoadUnitHandle(pGlobal->ov,GetHandleId((u)),(2)));
	unit wX;
	FlushChildHashtable(pGlobal->ov,GetHandleId((u)));
	ShowUnit(u,false);
	ShowUnit(UX,false);
	wX=CreateUnit(GetOwningPlayer(u),1750364771,GetUnitX(u),GetUnitY(u),GetUnitFacing(u));
	if (IsUnitSelected(u,GetOwningPlayer(u)))
	{
		if (fMyGetLocalPlayer()==GetOwningPlayer(u))
		{
			SelectUnit(wX,true);
		}
	}
	RemoveUnit(u);
	RemoveUnit(UX);
	UX=NULL;
	wX=NULL;
	u=NULL;
	return  true;
}

boolean DB()
{
	TimerStart(lV(AE(GetSpellAbilityUnit(),AddSpecialEffectTarget(sMyString("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl"),GetSpellAbilityUnit(),sMyString("origin")))),10.,false,& yX);
	return  true;
}

boolean fB()
{
	unit uC=GetSpellAbilityUnit();
	real x=GetSpellTargetX();
	real y=GetSpellTargetY();
	rect r=pGlobal->io;
	player pC=GetOwningPlayer(uC);
	if (x>=GetRectMinX(r)&& x<=GetRectMaxX(r)&& y>=GetRectMinY(r)&& y<=GetRectMaxY(r))
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(pC,sMyString("You cannot place Vampire Traps in the Slayer Pool!"));
	}
	uC=NULL;
	return  true;
}

boolean FB()
{
	unit uC=GetSpellAbilityUnit();
	unit qV;
	player pC=GetOwningPlayer(uC);
	SaveReal(pGlobal->ov,GetHandleId((uC)),(2),((GetSpellTargetX())*1.));
	SaveReal(pGlobal->ov,GetHandleId((uC)),(3),((GetSpellTargetY())*1.));
	TimerStart(lV(IE(uC)),5.,false,& ZX);
	uC=NULL;
	qV=NULL;
	return  true;
}

boolean gB()
{
	unit uT=GetSpellTargetUnit();
	unit u;
	GroupEnumUnitsInRange(pGlobal->rv,GetUnitX(uT),GetUnitY(uT),200.,NULL);
	u=FirstOfGroup(pGlobal->rv);
	while(true)
	{
		if ( u==NULL) break;
		GroupRemoveUnit(pGlobal->rv,u);
		if (rX(u))
		{
			if (GetUnitAbilityLevel(u,1111977572)>0)
			{
				if (pGlobal->ja[(pGlobal->J[GetPlayerId((GetOwningPlayer(GetSpellAbilityUnit())))][0])][0])
				{
					DisplayTextToPlayer(GetOwningPlayer(GetSpellAbilityUnit()),.0,.0,sMyString("placing grounded resistance buff on ")+fMyGetUnitName(u));
				}
				UnitAddAbility(u,1095200356);
				UnitMakeAbilityPermanent(u,true,1095200356);
				TimerStart(lV(IE(u)),.0,false,& nO);
			}
			else if(GetUnitAbilityLevel(u,1111977572)==0)
			{
				if (pGlobal->ja[(pGlobal->J[GetPlayerId((GetOwningPlayer(GetSpellAbilityUnit())))][0])][0])
				{
					DisplayTextToPlayer(GetOwningPlayer(GetSpellAbilityUnit()),.0,.0,fMyGetUnitName(u)+sMyString(" was grounded"));
				}
				UnitAddAbility(u,1094874470);
				UnitMakeAbilityPermanent(u,true,1094874470);
				TimerStart(lV(IE(u)),8.,false,& VO);
			}
		}
		u=FirstOfGroup(pGlobal->rv);
	}
	uT=NULL;
	return  true;
}

boolean GB()
{
	unit uC=GetSpellAbilityUnit();
	if (iX(GetSpellTargetUnit()))
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(GetOwningPlayer(uC),sMyString("You cannot cyclone vampires!"));
	}
	uC=NULL;
	return  true;
}

boolean hB()
{
	unit uC=GetSpellAbilityUnit();
	ShowUnit(uC,false);
	RemoveUnit(uC);
	uC=NULL;
	return  true;
}

boolean HB()
{
	unit uC=GetSpellAbilityUnit();
	unit PR=CreateUnit(GetOwningPlayer(uC),1966092359,GetUnitX(uC),GetUnitY(uC),GetUnitFacing(uC));
	integer p=GetPlayerId(GetOwningPlayer(uC));
	integer i;
	boolean qR;
	SetPlayerName(Player(p),pGlobal->Ra[pGlobal->J[p][0]][0]);
	pGlobal->Ea[pGlobal->J[p][0]][0]=3;
	i=0;
	while(true)
	{
		if ((i>0xB)) break;
		if (i!=p)
		{
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_CONTROL,false);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_ADVANCED_CONTROL,false);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_CONTROL,false);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_ADVANCED_CONTROL,false);
			qR=(pGlobal->Ea[pGlobal->J[i][0]][0]!=1);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_PASSIVE,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_HELP_REQUEST,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_HELP_RESPONSE,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_XP,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_SPELLS,qR);
			SetPlayerAlliance(Player(i),Player(p),ALLIANCE_SHARED_VISION,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_PASSIVE,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_HELP_REQUEST,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_HELP_RESPONSE,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_XP,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_SPELLS,qR);
			SetPlayerAlliance(Player(p),Player(i),ALLIANCE_SHARED_VISION,qR);
		}
		i=i+1;
	}
	ShowUnit(uC,false);
	if (fMyGetLocalPlayer()==GetOwningPlayer(uC))
	{
		SetCameraPosition(GetUnitX(uC),GetUnitY(uC));
		SelectUnit(PR,true);
	}
	SetUnitFlyHeight(PR,0xC8,60);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathSmall\\UDeathSmall.mdl"),GetUnitX(uC),GetUnitY(uC)));
	RemoveUnit(uC);
	uC=NULL;
	PR=NULL;
	return  true;
}

boolean jB()
{
	unit u=GetSpellAbilityUnit();
	integer BE=GetPlayerId(GetOwningPlayer(u));
	if (pGlobal->Za[BE][0]==0)
	{
		IssueImmediateOrderById(u,0xD0004);
		hX(Player(BE),sMyString("Blinking failed because your Sphere of Doom hasn't charged enough yet!"));
	}
	else 
	{
		pGlobal->Za[BE][0]=pGlobal->Za[BE][0]-1;
		if (pGlobal->Za[BE][0]==0)
		{
			TimerDialogSetTitle(pGlobal->en[BE][0],sMyString("Sphere Recharging (0)"));
		}
		if (!(pGlobal->vn[BE][0]))
		{
			WR(BE);
		}
	}
	u=NULL;
	return  true;
}

boolean JB()
{
	unit uC=GetSpellAbilityUnit();
	UnitRemoveAbility(uC,1093677873);
	UnitAddAbility(uC,1093677107);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	uC=NULL;
	return  true;
}

boolean kB()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& EI);
	uC=NULL;
	return  true;
}

boolean KB()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& XI);
	uC=NULL;
	return  true;
}

boolean lB()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& OI);
	uC=NULL;
	return  true;
}

boolean LB()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& II);
	uC=NULL;
	return  true;
}

boolean mB()
{
	unit uC=GetSpellAbilityUnit();
	PauseUnit(uC,true);
	DestroyEffect(AddSpecialEffect(sMyString("Objects\\Spawnmodels\\Undead\\UDeathMedium\\UDeath.mdl"),GetUnitX(uC),GetUnitY(uC)));
	TimerStart(lV(IE(uC)),2.,false,& AI);
	uC=NULL;
	return  true;
}

boolean MB()
{
	unit uC=GetSpellAbilityUnit();
	integer b=hO(GetUnitX(uC),GetUnitY(uC));
	if (b!=0 && pGlobal->Ki[b][0]!=NULL)
	{
		if (GetOwningPlayer(uC)!=pGlobal->Ki[b][0]&& pGlobal->xn[GetPlayerId(pGlobal->Ki[b][0])][0])
		{
			IssueImmediateOrderById(uC,0xD0004);
			hX(GetOwningPlayer(uC),kX(pGlobal->Ki[b][0])+sMyString(" does not want you to use Building Protection in ")+jX(pGlobal->Ki[b][0])+sMyString(" base!"));
		}
	}
	uC=NULL;
	return  true;
}

boolean pB()
{
	destructable d=GetSpellTargetDestructable();
	unit u=GetSpellAbilityUnit();
	integer b=hO(GetDestructableX(d),GetDestructableY(d));
	if (b==0 || MO(b,GetOwningPlayer(u)))
	{
		KillDestructable(d);
	}
	else 
	{
		DisplayTextToPlayer(GetOwningPlayer(u),.0,.0,kX(pGlobal->Ki[b][0])+sMyString(" has claimed this base!"));
		SetUnitX(u,GetRectCenterX(pGlobal->oo));
		SetUnitY(u,GetRectCenterY(pGlobal->oo));
	}
	d=NULL;
	u=NULL;
	return  true;
}

boolean PB()
{
	real x=GetSpellTargetX();
	real y=GetSpellTargetY();
	SetRect(pGlobal->iv,x-pGlobal->Tv,y-pGlobal->Tv,x+pGlobal->Tv,y+pGlobal->Tv);
	pGlobal->uv=x;
	pGlobal->Uv=y;
	EnumDestructablesInRect(pGlobal->iv,NULL,& CI);
	return  true;
}

boolean qB()
{
	unit uC=GetSpellAbilityUnit();
	if (IsPointBlighted(GetUnitX(uC),GetUnitY(uC))==false)
	{
		IssueImmediateOrderById(uC,0xD0004);
		hX(GetOwningPlayer(uC),sMyString("You must be on blight to turn!"));
		return  true;
	}
	UnitAddAbility(uC,1097625443);
	SetUnitFlyHeight(uC,20,60);
	TimerStart(lV(IE(uC)),3.,false,& xA);
	uC=NULL;
	return  true;
}

void Yb()
{
	pGlobal->Rn=CreateTrigger();
	TriggerAddCondition(pGlobal->Rn,Condition(& zb));
	pGlobal->On=CreateTrigger();
	TriggerAddCondition(pGlobal->On,Condition(& Zb));
	pGlobal->En=CreateTrigger();
	TriggerAddCondition(pGlobal->En,Condition(& vB));
	pGlobal->in[2][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->in[2][0],Condition(& eB));
	TriggerAddAction(pGlobal->in[2][0],& eB);
	pGlobal->an[2][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->an[2][0],Condition(& xB));
	TriggerAddAction(pGlobal->an[2][0],& xB);
	pGlobal->nn[2][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->nn[2][0],Condition(& oB));
	TriggerAddAction(pGlobal->nn[2][0],& oB);
	pGlobal->Vn[2][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->Vn[2][0],Condition(& rB));
	TriggerAddAction(pGlobal->Vn[2][0],& rB);
	pGlobal->wr[2][0]=NULL;
	pGlobal->wr[3][0]=NULL;
	pGlobal->Xn=CreateTrigger();
	TriggerAddCondition(pGlobal->Xn,Condition(& iB));
	pGlobal->in[3][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->in[3][0],Condition(& aB));
	TriggerAddAction(pGlobal->in[3][0],& aB);
	pGlobal->an[3][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->an[3][0],Condition(& nB));
	TriggerAddAction(pGlobal->an[3][0],& nB);
	pGlobal->nn[3][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->nn[3][0],Condition(& VB));
	TriggerAddAction(pGlobal->nn[3][0],& VB);
	pGlobal->Vn[3][0]=CreateTrigger();
	TriggerAddCondition(pGlobal->Vn[3][0],Condition(& EB));
	TriggerAddAction(pGlobal->Vn[3][0],& EB);
	pGlobal->An[1][0]=CreateTrigger();
	TriggerAddAction(pGlobal->An[1][0],& XB);
	TriggerAddCondition(pGlobal->An[1][0],Condition(& XB));
	pGlobal->Nn[1][0]=CreateTrigger();
	TriggerAddAction(pGlobal->Nn[1][0],& OB);
	TriggerAddCondition(pGlobal->Nn[1][0],Condition(& OB));
	pGlobal->Bn[1][0]=CreateTrigger();
	TriggerAddAction(pGlobal->Bn[1][0],& RB);
	TriggerAddCondition(pGlobal->Bn[1][0],Condition(& RB));
	pGlobal->In[1][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[1][0],& IB);
	TriggerAddCondition(pGlobal->In[1][0],Condition(& IB));
	pGlobal->In[2][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[2][0],& AB);
	TriggerAddCondition(pGlobal->In[2][0],Condition(& AB));
	pGlobal->In[3][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[3][0],& NB);
	TriggerAddCondition(pGlobal->In[3][0],Condition(& NB));
	pGlobal->In[4][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[4][0],& bB);
	TriggerAddCondition(pGlobal->In[4][0],Condition(& bB));
	pGlobal->In[5][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[5][0],& BB);
	TriggerAddCondition(pGlobal->In[5][0],Condition(& BB));
	pGlobal->In[6][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[6][0],& cB);
	TriggerAddCondition(pGlobal->In[6][0],Condition(& cB));
	pGlobal->In[7][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[7][0],& CB);
	TriggerAddCondition(pGlobal->In[7][0],Condition(& CB));
	pGlobal->In[8][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[8][0],& dB);
	TriggerAddCondition(pGlobal->In[8][0],Condition(& dB));
	pGlobal->In[9][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[9][0],& DB);
	TriggerAddCondition(pGlobal->In[9][0],Condition(& DB));
	pGlobal->In[0xA][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[0xA][0],& fB);
	TriggerAddCondition(pGlobal->In[0xA][0],Condition(& fB));
	pGlobal->In[0xB][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[0xB][0],& FB);
	TriggerAddCondition(pGlobal->In[0xB][0],Condition(& FB));
	pGlobal->In[0xC][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[0xC][0],& gB);
	TriggerAddCondition(pGlobal->In[0xC][0],Condition(& gB));
	pGlobal->In[0xD][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[0xD][0],& GB);
	TriggerAddCondition(pGlobal->In[0xD][0],Condition(& GB));
	pGlobal->In[0xE][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[0xE][0],& hB);
	TriggerAddCondition(pGlobal->In[0xE][0],Condition(& hB));
	pGlobal->In[0xF][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[0xF][0],& HB);
	TriggerAddCondition(pGlobal->In[0xF][0],Condition(& HB));
	pGlobal->In[16][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[16][0],& jB);
	TriggerAddCondition(pGlobal->In[16][0],Condition(& jB));
	pGlobal->In[17][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[17][0],& JB);
	TriggerAddCondition(pGlobal->In[17][0],Condition(& JB));
	pGlobal->In[18][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[18][0],& kB);
	TriggerAddCondition(pGlobal->In[18][0],Condition(& kB));
	pGlobal->In[19][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[19][0],& KB);
	TriggerAddCondition(pGlobal->In[19][0],Condition(& KB));
	pGlobal->In[20][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[20][0],& lB);
	TriggerAddCondition(pGlobal->In[20][0],Condition(& lB));
	pGlobal->In[21][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[21][0],& LB);
	TriggerAddCondition(pGlobal->In[21][0],Condition(& LB));
	pGlobal->In[22][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[22][0],& mB);
	TriggerAddCondition(pGlobal->In[22][0],Condition(& mB));
	pGlobal->In[23][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[23][0],& MB);
	TriggerAddCondition(pGlobal->In[23][0],Condition(& MB));
	pGlobal->In[24][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[24][0],& pB);
	TriggerAddCondition(pGlobal->In[24][0],Condition(& pB));
	pGlobal->In[25][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[25][0],& PB);
	TriggerAddCondition(pGlobal->In[25][0],Condition(& PB));
	pGlobal->In[26][0]=CreateTrigger();
	TriggerAddAction(pGlobal->In[26][0],& qB);
	TriggerAddCondition(pGlobal->In[26][0],Condition(& qB));
	fMyExecuteFunc(sMyString("fV"));
	fMyExecuteFunc(sMyString("FV"));
	fMyExecuteFunc(sMyString("mV"));
	fMyExecuteFunc(sMyString("UV"));
	fMyExecuteFunc(sMyString("rE"));
	fMyExecuteFunc(sMyString("EE"));
	fMyExecuteFunc(sMyString("CE"));
	fMyExecuteFunc(sMyString("PE"));
	fMyExecuteFunc(sMyString("TE"));
	fMyExecuteFunc(sMyString("WE"));
	fMyExecuteFunc(sMyString("vX"));
	fMyExecuteFunc(sMyString("XX"));
	fMyExecuteFunc(sMyString("OX"));
	fMyExecuteFunc(sMyString("RX"));
	fMyExecuteFunc(sMyString("AX"));
	fMyExecuteFunc(sMyString("sX"));
	fMyExecuteFunc(sMyString("tX"));
	fMyExecuteFunc(sMyString("uX"));
	fMyExecuteFunc(sMyString("WX"));
	fMyExecuteFunc(sMyString("YX"));
	fMyExecuteFunc(sMyString("zX"));
	fMyExecuteFunc(sMyString("vO"));
	fMyExecuteFunc(sMyString("rO"));
	fMyExecuteFunc(sMyString("aO"));
	fMyExecuteFunc(sMyString("EO"));
	fMyExecuteFunc(sMyString("XO"));
	fMyExecuteFunc(sMyString("RO"));
	fMyExecuteFunc(sMyString("CO"));
	fMyExecuteFunc(sMyString("DO"));
	fMyExecuteFunc(sMyString("SO"));
	fMyExecuteFunc(sMyString("xR"));
	fMyExecuteFunc(sMyString("AR"));
	fMyExecuteFunc(sMyString("DR"));
	fMyExecuteFunc(sMyString("pR"));
	fMyExecuteFunc(sMyString("QR"));
	fMyExecuteFunc(sMyString("yR"));
	fMyExecuteFunc(sMyString("VI"));
	fMyExecuteFunc(sMyString("NI"));
	fMyExecuteFunc(sMyString("cI"));
	fMyExecuteFunc(sMyString("dI"));
	fMyExecuteFunc(sMyString("gI"));
	fMyExecuteFunc(sMyString("QI"));
	fMyExecuteFunc(sMyString("WI"));
	fMyExecuteFunc(sMyString("rA"));
	fMyExecuteFunc(sMyString("DA"));
	fMyExecuteFunc(sMyString("fA"));
	fMyExecuteFunc(sMyString("FA"));
	fMyExecuteFunc(sMyString("gA"));
	fMyExecuteFunc(sMyString("jA"));
	fMyExecuteFunc(sMyString("KA"));
	fMyExecuteFunc(sMyString("LA"));
	fMyExecuteFunc(sMyString("QA"));
	fMyExecuteFunc(sMyString("uA"));
	fMyExecuteFunc(sMyString("WA"));
	fMyExecuteFunc(sMyString("zA"));
	fMyExecuteFunc(sMyString("vN"));
	fMyExecuteFunc(sMyString("xN"));
	fMyExecuteFunc(sMyString("ON"));
	fMyExecuteFunc(sMyString("NN"));
	fMyExecuteFunc(sMyString("DN"));
	fMyExecuteFunc(sMyString("JN"));
	fMyExecuteFunc(sMyString("lN"));
	fMyExecuteFunc(sMyString("pN"));
	fMyExecuteFunc(sMyString("tN"));
	fMyExecuteFunc(sMyString("zN"));
	fMyExecuteFunc(sMyString("eb"));
	fMyExecuteFunc(sMyString("ib"));
	fMyExecuteFunc(sMyString("nb"));
	fMyExecuteFunc(sMyString("Rb"));
	fMyExecuteFunc(sMyString("cb"));
	fMyExecuteFunc(sMyString("Kb"));
	fMyExecuteFunc(sMyString("Mb"));
	fMyExecuteFunc(sMyString("qb"));
	fMyExecuteFunc(sMyString("sb"));
	fMyExecuteFunc(sMyString("tb"));
	fMyExecuteFunc(sMyString("wb"));
	fMyExecuteFunc(sMyString("yb"));
}

bool fFuncsInit()
{
	SaveInteger(vHT_Ex,0,fMyStringHash("typecast___Typecast1"),(integer)&typecast___Typecast1);
	SaveInteger(vHT_Ex,0,fMyStringHash("typecast___Typecast2"),(integer)&typecast___Typecast2);
	SaveInteger(vHT_Ex,0,fMyStringHash("typecast___Typecast3"),(integer)&typecast___Typecast3);
	SaveInteger(vHT_Ex,0,fMyStringHash("utils__init_hex"),(integer)&utils__init_hex);
	SaveInteger(vHT_Ex,0,fMyStringHash("utils__InitChars"),(integer)&utils__InitChars);
	SaveInteger(vHT_Ex,0,fMyStringHash("utils__init"),(integer)&utils__init);
	SaveInteger(vHT_Ex,0,fMyStringHash("utils_uninit"),(integer)&utils_uninit);
	SaveInteger(vHT_Ex,0,fMyStringHash("memread__FakeArray"),(integer)&memread__FakeArray);
	SaveInteger(vHT_Ex,0,fMyStringHash("memread__init"),(integer)&memread__init);
	SaveInteger(vHT_Ex,0,fMyStringHash("s__Buffer_Magic"),(integer)&s__Buffer_Magic);
	SaveInteger(vHT_Ex,0,fMyStringHash("buffer___init"),(integer)&buffer___init);
	SaveInteger(vHT_Ex,0,fMyStringHash("memvars___Init_1_26a"),(integer)&memvars___Init_1_26a);
	SaveInteger(vHT_Ex,0,fMyStringHash("memvars___Init_1_27a"),(integer)&memvars___Init_1_27a);
	SaveInteger(vHT_Ex,0,fMyStringHash("memvars___CheckGameVersion"),(integer)&memvars___CheckGameVersion);
	SaveInteger(vHT_Ex,0,fMyStringHash("memvars___PreparePrivateArray"),(integer)&memvars___PreparePrivateArray);
	SaveInteger(vHT_Ex,0,fMyStringHash("memvars___magic"),(integer)&memvars___magic);
	SaveInteger(vHT_Ex,0,fMyStringHash("memvars___init"),(integer)&memvars___init);
	SaveInteger(vHT_Ex,0,fMyStringHash("memory__read_this"),(integer)&memory__read_this);
	SaveInteger(vHT_Ex,0,fMyStringHash("s__Memory_magic"),(integer)&s__Memory_magic);
	SaveInteger(vHT_Ex,0,fMyStringHash("memory__hack_array"),(integer)&memory__hack_array);
	SaveInteger(vHT_Ex,0,fMyStringHash("memory__init"),(integer)&memory__init);
	SaveInteger(vHT_Ex,0,fMyStringHash("memory_uninit"),(integer)&memory_uninit);
	SaveInteger(vHT_Ex,0,fMyStringHash("bitwise___init"),(integer)&bitwise___init);
	SaveInteger(vHT_Ex,0,fMyStringHash("private__FindNativeExecutor"),(integer)&private__FindNativeExecutor);
	SaveInteger(vHT_Ex,0,fMyStringHash("PrepareCode"),(integer)&PrepareCode);
	SaveInteger(vHT_Ex,0,fMyStringHash("PrepareStrings"),(integer)&PrepareStrings);
	SaveInteger(vHT_Ex,0,fMyStringHash("LoadDll"),(integer)&LoadDll);
	SaveInteger(vHT_Ex,0,fMyStringHash("Loader___init"),(integer)&Loader___init);
	SaveInteger(vHT_Ex,0,fMyStringHash("jasshelper__initstructs437536"),(integer)&jasshelper__initstructs437536);
	SaveInteger(vHT_Ex,0,fMyStringHash("BonusMod__Setup"),(integer)&BonusMod__Setup);
	SaveInteger(vHT_Ex,0,fMyStringHash("fV"),(integer)&fV);
	SaveInteger(vHT_Ex,0,fMyStringHash("FV"),(integer)&FV);
	SaveInteger(vHT_Ex,0,fMyStringHash("mV"),(integer)&mV);
	SaveInteger(vHT_Ex,0,fMyStringHash("UV"),(integer)&UV);
	SaveInteger(vHT_Ex,0,fMyStringHash("wV"),(integer)&wV);
	SaveInteger(vHT_Ex,0,fMyStringHash("rE"),(integer)&rE);
	SaveInteger(vHT_Ex,0,fMyStringHash("iE"),(integer)&iE);
	SaveInteger(vHT_Ex,0,fMyStringHash("EE"),(integer)&EE);
	SaveInteger(vHT_Ex,0,fMyStringHash("CE"),(integer)&CE);
	SaveInteger(vHT_Ex,0,fMyStringHash("DE"),(integer)&DE);
	SaveInteger(vHT_Ex,0,fMyStringHash("PE"),(integer)&PE);
	SaveInteger(vHT_Ex,0,fMyStringHash("TE"),(integer)&TE);
	SaveInteger(vHT_Ex,0,fMyStringHash("uE"),(integer)&uE);
	SaveInteger(vHT_Ex,0,fMyStringHash("WE"),(integer)&WE);
	SaveInteger(vHT_Ex,0,fMyStringHash("yE"),(integer)&yE);
	SaveInteger(vHT_Ex,0,fMyStringHash("YE"),(integer)&YE);
	SaveInteger(vHT_Ex,0,fMyStringHash("ZE"),(integer)&ZE);
	SaveInteger(vHT_Ex,0,fMyStringHash("vX"),(integer)&vX);
	SaveInteger(vHT_Ex,0,fMyStringHash("VX"),(integer)&VX);
	SaveInteger(vHT_Ex,0,fMyStringHash("EX"),(integer)&EX);
	SaveInteger(vHT_Ex,0,fMyStringHash("bloodlust__onBloodlust"),(integer)&bloodlust__onBloodlust);
	SaveInteger(vHT_Ex,0,fMyStringHash("bloodlust__onLol"),(integer)&bloodlust__onLol);
	SaveInteger(vHT_Ex,0,fMyStringHash("XX"),(integer)&XX);
	SaveInteger(vHT_Ex,0,fMyStringHash("changeGender___onChangeGender"),(integer)&changeGender___onChangeGender);
	SaveInteger(vHT_Ex,0,fMyStringHash("OX"),(integer)&OX);
	SaveInteger(vHT_Ex,0,fMyStringHash("detonate___onDetonate"),(integer)&detonate___onDetonate);
	SaveInteger(vHT_Ex,0,fMyStringHash("RX"),(integer)&RX);
	SaveInteger(vHT_Ex,0,fMyStringHash("IX"),(integer)&IX);
	SaveInteger(vHT_Ex,0,fMyStringHash("infernalMeteorExplode__onMeteorExplode"),(integer)&infernalMeteorExplode__onMeteorExplode);
	SaveInteger(vHT_Ex,0,fMyStringHash("AX"),(integer)&AX);
	SaveInteger(vHT_Ex,0,fMyStringHash("bX"),(integer)&bX);
	SaveInteger(vHT_Ex,0,fMyStringHash("QX"),(integer)&QX);
	SaveInteger(vHT_Ex,0,fMyStringHash("sX"),(integer)&sX);
	SaveInteger(vHT_Ex,0,fMyStringHash("rodTeleport__onTeleport"),(integer)&rodTeleport__onTeleport);
	SaveInteger(vHT_Ex,0,fMyStringHash("tX"),(integer)&tX);
	SaveInteger(vHT_Ex,0,fMyStringHash("uX"),(integer)&uX);
	SaveInteger(vHT_Ex,0,fMyStringHash("stopResearch__onStopResearch"),(integer)&stopResearch__onStopResearch);
	SaveInteger(vHT_Ex,0,fMyStringHash("WX"),(integer)&WX);
	SaveInteger(vHT_Ex,0,fMyStringHash("yX"),(integer)&yX);
	SaveInteger(vHT_Ex,0,fMyStringHash("vampireRecall___onRecall"),(integer)&vampireRecall___onRecall);
	SaveInteger(vHT_Ex,0,fMyStringHash("YX"),(integer)&YX);
	SaveInteger(vHT_Ex,0,fMyStringHash("vampireTrap__onTrap"),(integer)&vampireTrap__onTrap);
	SaveInteger(vHT_Ex,0,fMyStringHash("zX"),(integer)&zX);
	SaveInteger(vHT_Ex,0,fMyStringHash("ZX"),(integer)&ZX);
	SaveInteger(vHT_Ex,0,fMyStringHash("volcanicStrike___onVolcanicStrike"),(integer)&volcanicStrike___onVolcanicStrike);
	SaveInteger(vHT_Ex,0,fMyStringHash("vO"),(integer)&vO);
	SaveInteger(vHT_Ex,0,fMyStringHash("rO"),(integer)&rO);
	SaveInteger(vHT_Ex,0,fMyStringHash("aO"),(integer)&aO);
	SaveInteger(vHT_Ex,0,fMyStringHash("nO"),(integer)&nO);
	SaveInteger(vHT_Ex,0,fMyStringHash("VO"),(integer)&VO);
	SaveInteger(vHT_Ex,0,fMyStringHash("chainOfDeath__onChainEffect"),(integer)&chainOfDeath__onChainEffect);
	SaveInteger(vHT_Ex,0,fMyStringHash("EO"),(integer)&EO);
	SaveInteger(vHT_Ex,0,fMyStringHash("cyclone__onCyclone"),(integer)&cyclone__onCyclone);
	SaveInteger(vHT_Ex,0,fMyStringHash("XO"),(integer)&XO);
	SaveInteger(vHT_Ex,0,fMyStringHash("RO"),(integer)&RO);
	SaveInteger(vHT_Ex,0,fMyStringHash("IO"),(integer)&IO);
	SaveInteger(vHT_Ex,0,fMyStringHash("NO"),(integer)&NO);
	SaveInteger(vHT_Ex,0,fMyStringHash("bO"),(integer)&bO);
	SaveInteger(vHT_Ex,0,fMyStringHash("BO"),(integer)&BO);
	SaveInteger(vHT_Ex,0,fMyStringHash("cO"),(integer)&cO);
	SaveInteger(vHT_Ex,0,fMyStringHash("CO"),(integer)&CO);
	SaveInteger(vHT_Ex,0,fMyStringHash("DO"),(integer)&DO);
	SaveInteger(vHT_Ex,0,fMyStringHash("QO"),(integer)&QO);
	SaveInteger(vHT_Ex,0,fMyStringHash("SO"),(integer)&SO);
	SaveInteger(vHT_Ex,0,fMyStringHash("xR"),(integer)&xR);
	SaveInteger(vHT_Ex,0,fMyStringHash("oR"),(integer)&oR);
	SaveInteger(vHT_Ex,0,fMyStringHash("AR"),(integer)&AR);
	SaveInteger(vHT_Ex,0,fMyStringHash("dR"),(integer)&dR);
	SaveInteger(vHT_Ex,0,fMyStringHash("DR"),(integer)&DR);
	SaveInteger(vHT_Ex,0,fMyStringHash("JR"),(integer)&JR);
	SaveInteger(vHT_Ex,0,fMyStringHash("kR"),(integer)&kR);
	SaveInteger(vHT_Ex,0,fMyStringHash("MR"),(integer)&MR);
	SaveInteger(vHT_Ex,0,fMyStringHash("pR"),(integer)&pR);
	SaveInteger(vHT_Ex,0,fMyStringHash("observe___onObserveHuman"),(integer)&observe___onObserveHuman);
	SaveInteger(vHT_Ex,0,fMyStringHash("observe___onObserveVampire"),(integer)&observe___onObserveVampire);
	SaveInteger(vHT_Ex,0,fMyStringHash("QR"),(integer)&QR);
	SaveInteger(vHT_Ex,0,fMyStringHash("wR"),(integer)&wR);
	SaveInteger(vHT_Ex,0,fMyStringHash("sphereOfDoom___onSphereBlink"),(integer)&sphereOfDoom___onSphereBlink);
	SaveInteger(vHT_Ex,0,fMyStringHash("yR"),(integer)&yR);
	SaveInteger(vHT_Ex,0,fMyStringHash("vI"),(integer)&vI);
	SaveInteger(vHT_Ex,0,fMyStringHash("eI"),(integer)&eI);
	SaveInteger(vHT_Ex,0,fMyStringHash("xI"),(integer)&xI);
	SaveInteger(vHT_Ex,0,fMyStringHash("oI"),(integer)&oI);
	SaveInteger(vHT_Ex,0,fMyStringHash("rI"),(integer)&rI);
	SaveInteger(vHT_Ex,0,fMyStringHash("iI"),(integer)&iI);
	SaveInteger(vHT_Ex,0,fMyStringHash("aI"),(integer)&aI);
	SaveInteger(vHT_Ex,0,fMyStringHash("nI"),(integer)&nI);
	SaveInteger(vHT_Ex,0,fMyStringHash("VI"),(integer)&VI);
	SaveInteger(vHT_Ex,0,fMyStringHash("upgradeInfernal__onUpgradeInvisibleInfernal"),(integer)&upgradeInfernal__onUpgradeInvisibleInfernal);
	SaveInteger(vHT_Ex,0,fMyStringHash("EI"),(integer)&EI);
	SaveInteger(vHT_Ex,0,fMyStringHash("upgradeInfernal__onUpgradeRangedInfernal"),(integer)&upgradeInfernal__onUpgradeRangedInfernal);
	SaveInteger(vHT_Ex,0,fMyStringHash("XI"),(integer)&XI);
	SaveInteger(vHT_Ex,0,fMyStringHash("upgradeInfernal__onUpgradeCorruptedInfernal"),(integer)&upgradeInfernal__onUpgradeCorruptedInfernal);
	SaveInteger(vHT_Ex,0,fMyStringHash("OI"),(integer)&OI);
	SaveInteger(vHT_Ex,0,fMyStringHash("upgradeInfernal__onUpgradeFrozenInfernal"),(integer)&upgradeInfernal__onUpgradeFrozenInfernal);
	SaveInteger(vHT_Ex,0,fMyStringHash("RI"),(integer)&RI);
	SaveInteger(vHT_Ex,0,fMyStringHash("II"),(integer)&II);
	SaveInteger(vHT_Ex,0,fMyStringHash("upgradeInfernal__onUpgradeVolcanicInfernal"),(integer)&upgradeInfernal__onUpgradeVolcanicInfernal);
	SaveInteger(vHT_Ex,0,fMyStringHash("AI"),(integer)&AI);
	SaveInteger(vHT_Ex,0,fMyStringHash("upgradeInfernal__onUpgradeInfernalMeteor"),(integer)&upgradeInfernal__onUpgradeInfernalMeteor);
	SaveInteger(vHT_Ex,0,fMyStringHash("NI"),(integer)&NI);
	SaveInteger(vHT_Ex,0,fMyStringHash("buildingProtection___onBuildingProtection"),(integer)&buildingProtection___onBuildingProtection);
	SaveInteger(vHT_Ex,0,fMyStringHash("cI"),(integer)&cI);
	SaveInteger(vHT_Ex,0,fMyStringHash("chopTree__onChopTree"),(integer)&chopTree__onChopTree);
	SaveInteger(vHT_Ex,0,fMyStringHash("CI"),(integer)&CI);
	SaveInteger(vHT_Ex,0,fMyStringHash("chopTree__onRegrowTree"),(integer)&chopTree__onRegrowTree);
	SaveInteger(vHT_Ex,0,fMyStringHash("dI"),(integer)&dI);
	SaveInteger(vHT_Ex,0,fMyStringHash("DI"),(integer)&DI);
	SaveInteger(vHT_Ex,0,fMyStringHash("gI"),(integer)&gI);
	SaveInteger(vHT_Ex,0,fMyStringHash("GI"),(integer)&GI);
	SaveInteger(vHT_Ex,0,fMyStringHash("hI"),(integer)&hI);
	SaveInteger(vHT_Ex,0,fMyStringHash("HI"),(integer)&HI);
	SaveInteger(vHT_Ex,0,fMyStringHash("kI"),(integer)&kI);
	SaveInteger(vHT_Ex,0,fMyStringHash("mI"),(integer)&mI);
	SaveInteger(vHT_Ex,0,fMyStringHash("pI"),(integer)&pI);
	SaveInteger(vHT_Ex,0,fMyStringHash("PI"),(integer)&PI);
	SaveInteger(vHT_Ex,0,fMyStringHash("QI"),(integer)&QI);
	SaveInteger(vHT_Ex,0,fMyStringHash("sI"),(integer)&sI);
	SaveInteger(vHT_Ex,0,fMyStringHash("uI"),(integer)&uI);
	SaveInteger(vHT_Ex,0,fMyStringHash("WI"),(integer)&WI);
	SaveInteger(vHT_Ex,0,fMyStringHash("xA"),(integer)&xA);
	SaveInteger(vHT_Ex,0,fMyStringHash("turnMinion___onTurnMinion"),(integer)&turnMinion___onTurnMinion);
	SaveInteger(vHT_Ex,0,fMyStringHash("rA"),(integer)&rA);
	SaveInteger(vHT_Ex,0,fMyStringHash("CA"),(integer)&CA);
	SaveInteger(vHT_Ex,0,fMyStringHash("DA"),(integer)&DA);
	SaveInteger(vHT_Ex,0,fMyStringHash("fA"),(integer)&fA);
	SaveInteger(vHT_Ex,0,fMyStringHash("FA"),(integer)&FA);
	SaveInteger(vHT_Ex,0,fMyStringHash("gA"),(integer)&gA);
	SaveInteger(vHT_Ex,0,fMyStringHash("HA"),(integer)&HA);
	SaveInteger(vHT_Ex,0,fMyStringHash("jA"),(integer)&jA);
	SaveInteger(vHT_Ex,0,fMyStringHash("JA"),(integer)&JA);
	SaveInteger(vHT_Ex,0,fMyStringHash("KA"),(integer)&KA);
	SaveInteger(vHT_Ex,0,fMyStringHash("LA"),(integer)&LA);
	SaveInteger(vHT_Ex,0,fMyStringHash("mA"),(integer)&mA);
	SaveInteger(vHT_Ex,0,fMyStringHash("MA"),(integer)&MA);
	SaveInteger(vHT_Ex,0,fMyStringHash("pA"),(integer)&pA);
	SaveInteger(vHT_Ex,0,fMyStringHash("PA"),(integer)&PA);
	SaveInteger(vHT_Ex,0,fMyStringHash("qA"),(integer)&qA);
	SaveInteger(vHT_Ex,0,fMyStringHash("QA"),(integer)&QA);
	SaveInteger(vHT_Ex,0,fMyStringHash("uA"),(integer)&uA);
	SaveInteger(vHT_Ex,0,fMyStringHash("WA"),(integer)&WA);
	SaveInteger(vHT_Ex,0,fMyStringHash("zA"),(integer)&zA);
	SaveInteger(vHT_Ex,0,fMyStringHash("vN"),(integer)&vN);
	SaveInteger(vHT_Ex,0,fMyStringHash("xN"),(integer)&xN);
	SaveInteger(vHT_Ex,0,fMyStringHash("iN"),(integer)&iN);
	SaveInteger(vHT_Ex,0,fMyStringHash("aN"),(integer)&aN);
	SaveInteger(vHT_Ex,0,fMyStringHash("ON"),(integer)&ON);
	SaveInteger(vHT_Ex,0,fMyStringHash("NN"),(integer)&NN);
	SaveInteger(vHT_Ex,0,fMyStringHash("DN"),(integer)&DN);
	SaveInteger(vHT_Ex,0,fMyStringHash("JN"),(integer)&JN);
	SaveInteger(vHT_Ex,0,fMyStringHash("kN"),(integer)&kN);
	SaveInteger(vHT_Ex,0,fMyStringHash("lN"),(integer)&lN);
	SaveInteger(vHT_Ex,0,fMyStringHash("LN"),(integer)&LN);
	SaveInteger(vHT_Ex,0,fMyStringHash("pN"),(integer)&pN);
	SaveInteger(vHT_Ex,0,fMyStringHash("QN"),(integer)&QN);
	SaveInteger(vHT_Ex,0,fMyStringHash("tN"),(integer)&tN);
	SaveInteger(vHT_Ex,0,fMyStringHash("wN"),(integer)&wN);
	SaveInteger(vHT_Ex,0,fMyStringHash("zN"),(integer)&zN);
	SaveInteger(vHT_Ex,0,fMyStringHash("eb"),(integer)&eb);
	SaveInteger(vHT_Ex,0,fMyStringHash("ob"),(integer)&ob);
	SaveInteger(vHT_Ex,0,fMyStringHash("ib"),(integer)&ib);
	SaveInteger(vHT_Ex,0,fMyStringHash("nb"),(integer)&nb);
	SaveInteger(vHT_Ex,0,fMyStringHash("Rb"),(integer)&Rb);
	SaveInteger(vHT_Ex,0,fMyStringHash("Ib"),(integer)&Ib);
	SaveInteger(vHT_Ex,0,fMyStringHash("cb"),(integer)&cb);
	SaveInteger(vHT_Ex,0,fMyStringHash("Kb"),(integer)&Kb);
	SaveInteger(vHT_Ex,0,fMyStringHash("Mb"),(integer)&Mb);
	SaveInteger(vHT_Ex,0,fMyStringHash("qb"),(integer)&qb);
	SaveInteger(vHT_Ex,0,fMyStringHash("sb"),(integer)&sb);
	SaveInteger(vHT_Ex,0,fMyStringHash("tb"),(integer)&tb);
	SaveInteger(vHT_Ex,0,fMyStringHash("Tb"),(integer)&Tb);
	SaveInteger(vHT_Ex,0,fMyStringHash("wb"),(integer)&wb);
	SaveInteger(vHT_Ex,0,fMyStringHash("yb"),(integer)&yb);
	SaveInteger(vHT_Ex,0,fMyStringHash("InitCustomTeams"),(integer)&InitCustomTeams);
	SaveInteger(vHT_Ex,0,fMyStringHash("fMainJass"),(integer)&fMainJass);
	SaveInteger(vHT_Ex,0,fMyStringHash("config"),(integer)&config);
	SaveInteger(vHT_Ex,0,fMyStringHash("Yb"),(integer)&Yb);
	return TRUE;
}

