Páginas

quinta-feira, 11 de fevereiro de 2010

Script para treinar com Rotworm

Este script é bem simples, com ele você treina com Rotworm ( ou outro bicho pre-configurado ).

Const
NumberOfMonsters = 3 /// Numero de monstros pra trocar arma
StrongWeapon = 3324 /// ID da arma FORTE
WearWeapon = 3304 /// ID da arma FRACA

function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;


function CountMonstersBesideYou:Integer;
begin
Result := 0;
UpdateWorld;
for i := 0 to creatures.Count -1 do
begin
if i >= Creatures.Count then break
for x := -1 to 1 do
begin
if x >= 2 then break
for y := -1 to 1 do
begin
if y > 1 then break;
if Creatures.Creature[i].NPC then
if (Creatures.Creature[i].x = Self.X +x) and (Creatures.Creature[i].y = Self.y + y) and (Creatures.Creature[i].Z = Self.Z) then
Result := Result + 1;
end;
end;
end;
end;

while not terminated do
begin
UpdateWorld;
if CountMonstersBesideYou >= NumberOfMonsters then
begin
if Self.RightHand.ID <> StrongWeapon then
begin
Boots := GetItemFromOpenBackpack(StrongWeapon);
if Boots <> nil then
Boots.MoveToBody(Self.RightHand,0);
else Self.Displaytext('Strong Weapon werent found in open backpack!');
end;
end;
if CountMonstersBesideYou < NumberOfMonsters then
begin
if Self.RightHand.ID <> WearWeapon then
begin
Boots := GetItemFromOpenBackpack(WearWeapon);
if Boots <> nil then
Boots.MoveToBody(Self.RightHand,0);
else Self.Displaytext('Wear Weapon werent found in open backpack!');
end;
end;
End;

Script para Não atacar Summons

Com este Script ele não ataca os monstros indicados na lista, assim ele não ataca os summons dos mostros que você não quiser.

Const
Name=['Dwarf Guard', 'Dwarf Soldier', 'Dwarf']; // nome dos monstros
SwitchAt=30; // the % of the current attacked monster

function GetPlace(st:string):integer;
var
x:integer;
begin
Result:=1000;
for x:=Low(Name) To High(Name) do
begin
if Name[x]=st then
Result:=x;
end;
end;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function IsCreatureBesideYou(c: TCreature): boolean;
begin
UpdateWorld;
Result := False;
if (abs(c.X-self.X) <= 1) and (abs(c.Y-self.Y) <= 1) then begin
if c.Z = self.Z then begin
Result := True;
end;
end;
end;

var
x:integer;
b:boolean;
begin
while not terminated do
begin
b:=false;
updateworld;
If (Self.Attacking<>0) then
begin
Creature:=GetCreatureByID(Self.Attacking);
if Creature<>nil then
if SwitchAt
begin
for x := 0 to Creatures.Count - 1 do
begin
updateworld;
if b then break;
if x >= Creatures.Count then Break;
if Creatures.Creature[x].NPC then
if Creatures.Creature[x].z=self.z then
if Creatures.Creature[x].Name<>self.name then
if Creatures.Creature[x].Attacking = false then
if IsCreatureBesideYou(Creatures.Creature[x]) then
if GetPlace(Creature.Name)>GetPlace(Creatures.Creature[x].Name) then
begin
sleep(100);
updateworld;
Creatures.Creature[x].attacking:=true;
B:=true;
end;
end;
end;
end;
Sleep(100);
end;
end;

Script para usar Exori em X Monstro

Com este Script você solta EXORI ( ou outro magia que você configurar ) em determinado monstro que você escolher na lista.

const
MonsterName = ['
Enlightened Of The Cult','Nightmare']// Coloca os monstros aqui
Attack_Spell = '
Exori Gran' // Magia a ser usada
Min_Mana =
350 // Se a mana for abaixo disso, não usa a magia
Min_Monster_HP =
0 // life do monstro menos disso não usa
Max_Monster_HP =
100 //life do monstro a mais, nao usa spell
Range =
1 //quantos sqm de distancia, para usar magia
var
x: Integer;
Creature:TCreature;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function GetCreatureByName(Name: string): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Name = Name then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function IsCreatureAttackable(c: TCreature): boolean;
begin
UpdateWorld;
Result := False;
if (c.Z = self.Z) and (abs(c.X-self.X) <= Range) and (abs(c.Y-self.Y) <= Range) and (c.outfit<>0) and (c.Health >= Min_Monster_HP) and (c.Health <= Max_Monster_HP) then
begin
Result := True;
end;
end;

while not Terminated do
begin
UpdateWorld;
Creature := GetCreatureByID(Self.Attacking);
if (Self.Mana >= Min_Mana) and (Creature <> nil) then
for i := low(monstername) to high(monstername) do
begin
if (MonsterName[i] = Creature.Name) and (IsCreatureAttackable(Creature)) then
begin
Self.Say(Attack_Spell);
sleep(2000);
end;
end;
sleep(100);
end;

Script Para Atacar X Monstro Primeiro

Script para atacar X monstro primeiro, não esqueça de configurar o monstro que você deseja que ele ataque primeiro.

Const
MonsterList = ['Blood Crab']//Nome do Mosntro a atacar primeiro

function GetCreatureByName: TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Z = Self.Z then
for i := low(MonsterList) to high(monsterlist) do
if Creatures.Creature[x].Name = MonsterList[i] then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

While not terminated do
begin
UpdateWorld;
C := GetCreatureByName;
if C <> nil then
if not self.attacking then
C.Attacking := true;
sleep(100);
end;

Script para por Spear da Backpack para Mão

Script para colocar Spears da Backpack para a mão, muito bom para paladins que caçam em area aonde os monstros dropem spears.
Quando não tiver mais Spears ele coloca automaticamente um weapon em sua mão.

Const
SmallStoneID = 3277
BackupWeaponID = 1781

function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;

begin
while not Terminated do
begin
UpdateWorld;
if Self.LeftHand.ID <> SmallStoneID then
begin
Weapon := GetItemFromOpenBackpack(SmallStoneID);
if Weapon <> nil then
begin
Weapon.MoveToBody(Self.LeftHand,0);
Sleep(1000);
end;
else
begin
if Self.LeftHand.ID <> BackupWeaponID then
begin
Weapon := GetItemFromOpenBackpack(BackupWeaponID);
if Weapon <> nil then
begin
Weapon.MoveToBody(Self.LeftHand,0);
Sleep(1000);
end;
end;
Self.DisplayText('Spears not found')
end;
end;
Sleep(500);
end;
end;

Script para ignorar X Monstro

Com este script você ira ignorar o monstro pre-estabelecido na lista.

Const
MonsterList = ['Rabbit', 'Seagull', 'Monk'];   //Lista de Monstro que não deseja Atacar
var x : integer;
Looting:boolean;

function Attacking : boolean;
var x : integer;
begin
Result := False;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Attacking then
begin
Result := True;
Exit;
end;
end;
end;

function IsAttackable(Name: String): Boolean;
var
x: integer;
begin
Result := False;
for x := Low(MonsterList) to High(MonsterList) do
begin
if Name = MonsterList[x] then
begin
Result := True;
Break;
end;
end;
end;

function PlayerOnScreen : Boolean;
var
x: integer;
begin
Result := False;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].z=self.z then
if Creatures.Creature[x].Name<>Self.Name then
if not Creatures.Creature[x].NPC then
begin
Result :=true;
Exit;
end;
end;
end;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;


function FindClosest : integer;
var i, l, closest_num, closest_range, last_closest_range : integer;
begin
if not attacking then
begin
closest_num := -1;
last_closest_range := 5000;
for i := 0 to Creatures.Count - 1 do
if (Creatures.Creature[i].Z = Self.Z) then
if (Creatures.Creature[i].NPC = true) then
if (IsAttackable(Creatures.Creature[i].Name) = False) then
begin
closest_range := Round(Sqrt(Sqr(Self.X - Creatures.Creature[i].X)) + Sqr(Self.Y - Creatures.Creature[i].Y));
if (closest_range < last_closest_range) then
begin
last_closest_range := closest_range;
closest_num := i;
end;
end;
Result := closest_num;
Exit;
end;
end;

var found, Bla,y : integer;
begin
updateworld;
Bla:=Self.Containers.Count;
Looting:=false;
while not terminated do
begin
UpdateWorld;
if Self.Containers.Count>Bla then begin D:=Self.Containers.Count; Looting:=true; end;
if (Looting=true) then
begin
updateworld;
Z:=self.x;
y:=self.y;
Self.DisplayText('Looting');
repeat
sleep(200);
updateworld;
until (Z<>Self.x) or (y<>self.y);
Looting:=false;
Self.DisplayText('Finished looting');
end;
updateworld;
found := FindClosest;
if (found <> -1) then
if (attacking=false) and (PlayerOnScreen=false) and (Looting=false) then
Creatures.Creature[found].Attacking := true;
Sleep(1000);
end;
end;

Script para Trocar de Arma

Este script troca de arma dependo do bicho no qual você ataca.
É preciso configurar o bicho e as armas que você quer atacar.

Const
MonsterList1 = ['Ghoul']
MonsterList2 = ['Fire Elemental']
Weapon1_ID = 651 //Id da arma para usar nos montro selecionados em MosterList1
Weapon2_ID = 3350 //
Id da arma para usar nos montro selecionados em MosterList2
Weapon3_ID = 8090 //Id da arma para usar nos monstros nao selecionados

function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function GetCreatureByName(Name: string): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Name = Name then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function IsCreatureVisible(Name: string): boolean;
var
x: integer;
begin
Result := False;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Name = Name then
begin
if Creatures.Creature[x].Visible then
begin
Result := True;
Exit;
end;
end;
end;
end;

while not terminated do
begin
Continue := 0;
UpdateWorld;
Creature := GetCreatureByID(Self.Attacking);
if Creature <> nil then
begin
for i := low(MonsterList1) to high(MonsterList1) do
begin
if MonsterList1[i] = Creature.Name then
Continue := 1;
end;
if Continue then
begin
Weapon := GetItemFromOpenBackpack(Weapon1_ID);
if Self.RightHand.ID <> Weapon1_ID then
begin
if Weapon = nil then
self.DisplayText('Weapon1 wasnt found in open backpack!');
else
Weapon.MoveToBody(Self.RightHand,0);
end;
end;
else
begin
for m := low(MonsterList2) to high(MonsterList2) do
begin
if MonsterList2[m] = Creature.Name then
Continue := 1;
end;
if Continue then
begin
Weapon := GetItemFromOpenBackpack(Weapon2_ID);
if Self.RightHand.ID <> Weapon2_ID then
begin
if Weapon = nil then
self.DisplayText('Weapon2 wasnt found in open backpack!');
else
Weapon.MoveToBody(Self.RightHand,0);
end;
end;
else
if Self.RightHand.ID <> Weapon3_ID then
begin
Weapon := GetItemFromOpenBackpack(Weapon3_ID);
if Weapon <> nil then
Weapon.MoveToBody(Self.RightHand,0);
else Self.DisplayText('Weapon3 wasnt found in opened backpack!');
end;
end;
end;
sleep(100);
end;