Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
[Help me] Looter - Page 2
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: [Help me] Looter

  1. #11
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [Help me] Looter

    Quote Originally Posted by julinhopiupiu
    not to create another topic, anyone have any idea how to open the dead bodies for me?
    Send a use-packet on the XYZ of the dead creature

  2. #12
    Senior Member
    Join Date
    Aug 2010
    Posts
    532

    RE: [Help me] Looter

    I tried to get the dead creature position but I failed.

    The problem is when it's checking if the creature hpbar, when it send a creature.Attack() it execute the CreatureLocation()

    It's something like this:

    [code=csharp]foreach (Tibia.Objects.Creature creature in C.BattleList.GetCreatures())
    {
    if (P.TargetId == creature.Id)
    {
    if (!creature.IsSelf())
    {
    if (creature.HPBar == 0)
    {

    Looting = true;
    int bodyX = creature.X;
    int bodyY = creature.Y;
    int bodyZ = creature.Z;
    Location bodyloc;
    bodyloc = new Location(Convert.ToInt16(bodyX), Convert.ToInt16(bodyY), Convert.ToInt16(bodyZ));
    Thread.Sleep(1100);
    Tile bodyloc2 = C.Map.GetTile(bodyloc);
    Item deadbody = bodyloc2.Items.FirstOrDefault(Dead => Dead.GetFlag(DatItem.Flag.IsCorpse));
    C.Map.GetTile(bodyloc).Items.Last().OpenAsContaine r(Convert.ToByte(C.Map.GetTile(bodyloc).Objects.La st().StackOrder));[/code]

    Somebody help me xD

  3. #13
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [Help me] Looter

    You're calling a method that only returns visible creatures:
    [code=c#]
    public IEnumerable<Creature> GetCreatures()
    {
    for (uint i = Addresses.BattleList.Start; i < Addresses.BattleList.End; i += Addresses.BattleList.StepCreatures)
    {
    if (client.Memory.ReadByte(i + Addresses.Creature.DistanceIsVisible) == 1)
    yield return new Creature(client, i);
    }
    }
    [/code]

    Write your own method or edit this one to return all creatures

  4. #14

    RE: [Help me] Looter

    To open corpses you have to use the proxy or the hookproxy.
    Both are bugged :S

  5. #15
    Senior Member
    Join Date
    Aug 2010
    Posts
    532

    RE: [Help me] Looter

    @Alkamenes

    There is a way to open dead bodies without proxy, I saw some examples and ideas here on forum, so its possible but not so easy.

    @Blaster

    Where should I use this code?

    Is it a 'new function' to work on my GetCreatures() on this line?:

    foreach (Tibia.Objects.Creature creature in C.BattleList.GetCreatures())

    If not where should add it?

    Thank you again.

  6. #16
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [Help me] Looter

    I'd recommend that you learn how TibiaAPI works before using it, as the code I posted is from the TibiaAPI source

    Read the code that I posted and edit it to fit your needs

  7. #17
    Senior Member
    Join Date
    Aug 2010
    Posts
    532

    RE: [Help me] Looter

    Ohhh, now I see, it's a TibiaAPI function, I was on my job when I saw your post and I though that you made it.

    If I change it to .DistanceHPBar should work? I'm not sure how to get a monster that is dead.

  8. #18
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [Help me] Looter

    using DistanceHPBar == 0 would return all dead creatures, so make sure you find your creature as there will be more than one

  9. #19
    Senior Member
    Join Date
    Aug 2010
    Posts
    532

    RE: [Help me] Looter

    That's the problem, get the creature that I'm attacking then get his dead body, because if I check my TargetID if I kill one creature it will attack another one, this way it will ignore the dead body.

    I"m not sure how to get the creature that I"m attacking then get his dead body.

  10. #20
    Senior Member
    Join Date
    Jan 2008
    Location
    Cambridge, England
    Posts
    725

    RE: [Help me] Looter

    Experiment before asking.

    Simple method of working it out:

    Create a combobox or listbox, and a button. In the button event draw the list located at c.Inventory.Containers() into the listbox, then make another listbox / button and draw the contents of each backpack to the listbox according to which button you press.

    You can then work out exactly how the inventory system is calculated and where to get the ids etc...[hr]
    Quote Originally Posted by maozao
    That's the problem, get the creature that I'm attacking then get his dead body, because if I check my TargetID if I kill one creature it will attack another one, this way it will ignore the dead body.

    I"m not sure how to get the creature that I"m attacking then get his dead body.
    Ok heres a breif explaination of this, in VB.Net though. Sorry I don't do C# etc...

    Set a timer.

    [code=vbnet]Public Sub(ByVal e as Sender, ~~~) Handles Timer1.Tick
    If p.Target Is Nothing Then '' If the target doesn't exist do this
    '' Nothing
    Else '' Else do the following
    Dim x as Creature '' Declare that x is a Creature (located from TibiaAPI - Tibia.Objects
    x = p.Target '' Give x the value of the target your character currently has.
    Dim y as Location '' declare that y is a Location from Tibia.Properties
    y = x.Location '' Declare that y is the location of the creature we declared to be x
    End If '' End if statement
    End Sub[/code] '' End the sub

    Something like that, and you've got the location of your last dead creatures corpse. Then it's just a case of sending the "use" command to the tile location, and vualah! It should open up the container and you can then use the c.Inventory.GetItems commands to move the items dependant upon their Id and location. I also advise that for the looting to backpacks you use the BP ID's, but for the looting from backpacks use the container name. That way you can do like Dead Rotworm instead of container 3...

    So that you know there is no way of identifying the creature Id a corpse came from after you've killed it. The cid is removed completely from the game at that point.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •