Const WeaponID = 3302 // Enter the strong weapon ID, In your case, dragon lance.... function GetCreatureByID(IID:integer):TCreature; begin Result := nil; updateworld; for G:= 0 to Creatures.count -1 do begin If Creatures.Creature[G].ID = IID then Result := Creatures.Creature[G]; end; end; function GetItemFromOpenBackpack(ID: integer): TItem; var x: integer; 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; procedure event_attacked(ID:string); Var Creature:TCreature; R,L,DLance:TItem; Container:TContainer; begin Creature := GetCreatureByID(ID); if Creature <> nil then if Self.RightHand.ID <> WeaponID then begin UpdateWorld; Container := Self.Containers.Container[0]; DLance:= GetItemFromOpenBackpack(WeaponID); if DLance <> nil then DLance.MoveToBody(Self.RightHand, 0); Self.Offensive; Creature.Attacking := True; end; end; While not terminated do begin UpdateWorld; ProcessEvents; Sleep(100); end;
Bem Vindo
![]() |
|
| Guest Message © 2010 DevFuse | |
Page 1 of 1
X Arma se for atacado por PK
#1
Posted 30 July 2010 - 09:53 AM
Share this topic:
Page 1 of 1

Help

Sign In »
Register Now!










