Solved Can't move corpses

Discussion in 'Support' started by Nottinghster, May 5, 2013.

  1. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    Hello OTlanders!!

    Well, I'm havin' some problems, already try to fix it but I really don't where is the problem...

    Explaining:

    When I kill a monster, I can't move the corpse for some seconds, here's the gif

    [​IMG]

    Note: Version 7.72

    ------------ EDIT ------------

    Problem fixed, thanks to Assassina Mutante
     

    Attached Files:

    Last edited: May 8, 2013
    Slave Ots likes this.
  2. Best Answer:
    Post #16 by Nottinghster, Nov 19, 2018
  3. Tryller

    Tryller Member

    Joined:
    Nov 22, 2010
    Messages:
    199
    Likes Received:
    12
    Best Answers:
    0
    You cant move because it has an exhaust for checking corpse owner you can move after 30 seconds
     
  4. Evan

    Evan A splendid one to behold Premium User

    Joined:
    May 6, 2009
    Messages:
    7,011
    Likes Received:
    951
    Best Answers:
    0
    I thought it was 10 seconds. Anyways, yeah, this came in the 7.8 update when they introduced private loot.
    This is perfectly normal. It looks like you took a later version of TFS and changed the Tibia version to 7.72.
     
    Slave Ots likes this.
  5. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    @Evan

    This isn't normal in version 7.72, (check my signature), I know that was introduced in version 7.8, but when I rewroted my sources, I get that, and now I don't remember where to remove it, already checked some things, but can't found it !!!

    And I'm not using a later version of TFS, I'm using OTServ_SVN 0.6.3
     
  6. Evil Puncker

    Evil Puncker I'd rather kiss a rattlesnake

    Joined:
    May 30, 2009
    Messages:
    5,366
    Likes Received:
    1,596
    Best Answers:
    2
    items.xml
     
    Slave Ots likes this.
  7. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    Items.xml ???

    But what, already checked !!!
     
  8. Nothxbye

    Nothxbye Well-Known Member

    Joined:
    Jan 22, 2012
    Messages:
    1,106
    Likes Received:
    157
    Best Answers:
    0
    Ctrl + f and search for "RET_NOTMOVEABLE" you will find for like 4 lines with it.
    Disable some lines and you will slowly find your problem.
     
  9. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    Nothxbye

    Well, I've searched for RET_NOTMOVEABLE, but I didn't deleted/commented the lines, I'll do this ...
    Thanks !!!
     
  10. Slave Ots

    Slave Ots LUA Newbie™

    Joined:
    Jan 19, 2012
    Messages:
    114
    Likes Received:
    35
    Best Answers:
    0
    done???
    or you still not able to push it???
     
    Evil Puncker likes this.
  11. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    Not yet ....

    - - - Updated - - -

    Problem fixed, thanks to Assassina Mutante
     
  12. TTyr

    TTyr New Member

    Joined:
    Nov 18, 2016
    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Where are the solution? I need this too
     
  13. gudan garam

    gudan garam Active Member

    Joined:
    Feb 13, 2011
    Messages:
    273
    Likes Received:
    79
    Best Answers:
    10
    Every monster has different corpses, if you open a monster's xml file, there is an "corpse id" or something like that, that is the first corpse it will generate when it dies, that corpse isn't moveable and has usually a duration of 10 seconds, then it decays to another corpse with the same sprite but moveable.

    Just change the id of the corpse on the monster's xml to that second corpse he decays to. Thats it.

    Example:

    amazon.xml (monster)
    Code (Lua):
    1. <?xml version="1.0" encoding="ISO-8859-1"?>
    2. <monster name="Amazon" nameDescription="an amazon" race="blood" experience="60" speed="180" manacost="390">
    3.     <health now="110" max="110" />
    4.     <look type="137" head="113" body="120" legs="114" feet="132" corpse="20323" />
    5. ....
    corpse="20323"


    items.xml:
    First corpse (the one in the xml) this is not moveable:

    Code (Text):
    1. <item id="20323" article="a" name="dead amazon">
    2.         <attribute key="containerSize" value="20" />
    3.         <attribute key="decayTo" value="20324" />
    4.         <attribute key="duration" value="10" />
    5.         <attribute key="corpseType" value="blood" />
    6.         <attribute key="fluidSource" value="blood" />
    7.     </item>

    It decays to the item id 20324 after 10 seconds, that item 20324 has the same sprite, but is moveable.

    Change the corpse="20323" to corpse="20324" in the amazon.xml
     
  14. waqmaz

    waqmaz Member

    Joined:
    Jun 17, 2015
    Messages:
    202
    Likes Received:
    9
    Best Answers:
    0
    hey how did you fix the problem? why didnt you post the solution?
     
  15. gudan garam

    gudan garam Active Member

    Joined:
    Feb 13, 2011
    Messages:
    273
    Likes Received:
    79
    Best Answers:
    10
    I literally posted the solution. What :eek:
     
  16. waqmaz

    waqmaz Member

    Joined:
    Jun 17, 2015
    Messages:
    202
    Likes Received:
    9
    Best Answers:
    0
    rat png.png
    I am sorry, but your solution doesn't work. You can move only first corpse (2013), but if it is decayed, then you can not move the next one (2014). Look for the example of rat:

    This is the id of main corpse, which should be set in monsters/rat.xml:
    Code (Text):
    1. <item id="5964" article="a" name="dead rat">
    2.     <attribute key="weight" value="6300" />
    3.     <attribute key="containerSize" value="5" />
    4.     <attribute key="decayTo" value="2815" />
    5.     <attribute key="duration" value="10" />
    6.     <attribute key="corpseType" value="blood" />
    7.     <attribute key="fluidSource" value="blood" />
    8. </item>
    But I do not want it, because I have to wait 10 seconds to move the monster. So following your solution, I changed the id of the monster to moveable one - 2813:
    Code (Text):
    1. <item id="2813" article="a" name="dead rat">
    2.     <attribute key="weight" value="6300" />
    3.     <attribute key="containerSize" value="5" />
    4.     <attribute key="decayTo" value="2814" />
    5.     <attribute key="duration" value="10" />
    6.     <attribute key="corpseType" value="blood" />
    7.     <attribute key="fluidSource" value="blood" />
    8. </item>
    9.  
    It decays to id 2814, but id 2814 is unmoveable (can not push it):
    Code (Text):
    1. <item id="2814" article="a" name="dead rat">
    2.     <attribute key="weight" value="4400" />
    3.     <attribute key="containerSize" value="5" />
    4.     <attribute key="decayTo" value="2815" />
    5.     <attribute key="duration" value="10" />
    6.     <attribute key="corpseType" value="blood" />
    7. </item>
    Id 2814 decays to 2815 which is moveable again.
    Code (Text):
    1. <item id="2815" article="a" name="dead rat">
    2.     <attribute key="weight" value="3000" />
    3.     <attribute key="decayTo" value="0" />
    4.     <attribute key="duration" value="10" />
    5. </item>
    It looks like every SECOND corpse is unmoveable. Second corpse here has id 2814. I have to remove it somehow from source, but I do not know where. Also I would like to know, which lines of source I have to delete, to remove 10 second unmoveable and unopenable corpses from game.
    I think I am slowly getting it:
    I am going to compile and post if it's working.
    /edit its not
     
    Last edited: Nov 19, 2018
  17. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    Best Answer
    HERE'S THE SOLUTION THAT I'VE MADE TO MY PROJECT

    You will be able to use a preprocessor definition, if you want to use corpse owner or not...

    PS: DO NOT FORGET TO COMPILE WITH PREPROCESSOR "__SHOULD_USE_CORPSEOWNER__" IF YOU WANT TO USE CORPSE OWNER

    In monster.h

    Replace this:
    Code (Text):
    1. virtual uint16_t getLookCorpse() const { return mType->lookCorpse; }
    For this (this is the real solution, thanks to Assassina Mutante):
    Code (Text):
    1.  
    2.     #ifdef __SHOULD_USE_CORPSEOWNER__
    3.         virtual uint16_t getLookCorpse() const { return mType->lookCorpse; }
    4.     #else
    5.         virtual uint16_t getLookCorpse() const { // Remove corpse owner
    6.         const ItemType& itemtype = Item::items[mType->lookCorpse];
    7.             if (itemtype.decayTo != 0) {
    8.                 return itemtype.decayTo;
    9.                 return mType->lookCorpse;
    10.             }
    11.         }
    12.     #endif
    13.  

    In actions.cpp, replace this:
    Code (Text):
    1.  
    2.         if(container->getCorpseOwner() != 0 && !player->canOpenCorpse(container->getCorpseOwner())){
    3.             return RET_YOUARENOTTHEOWNER;
    4.         }
    For this:
    Code (Text):
    1.  
    2.         #ifdef __SHOULD_USE_CORPSEOWNER__
    3.         if(container->getCorpseOwner() != 0 && !player->canOpenCorpse(container->getCorpseOwner())){
    4.             return RET_YOUARENOTTHEOWNER;
    5.         }
    6.         #endif
    7.  
    In item.h, replace this:
    Code (Text):
    1.  
    2.     void setCorpseOwner(uint32_t _corpseOwner) {setIntAttr(ATTR_ITEM_CORPSEOWNER, _corpseOwner);}
    3.     uint32_t getCorpseOwner() {return (uint32_t)getIntAttr(ATTR_ITEM_CORPSEOWNER);}
    4.  


    For this:
    Code (Text):
    1.  
    2.     #ifdef __SHOULD_USE_CORPSEOWNER__
    3.     void setCorpseOwner(uint32_t _corpseOwner) {setIntAttr(ATTR_ITEM_CORPSEOWNER, _corpseOwner);}
    4.     uint32_t getCorpseOwner() {return (uint32_t)getIntAttr(ATTR_ITEM_CORPSEOWNER);}
    5.     #endif
    6.  
    In monster.cpp, replace this:
    Code (Text):
    1.  
    2.             if(corpseOwner != NULL){
    3.                 corpse->setCorpseOwner(corpseOwner->getID());
    4.             }
    5.  
    For this:
    Code (Text):
    1.  
    2.             #ifdef __SHOULD_USE_CORPSEOWNER__
    3.             if(corpseOwner != NULL){
    4.                 corpse->setCorpseOwner(corpseOwner->getID());
    5.             }
    6.             #endif
    7.  
    Still in monster.cpp replace all that function:
    Code (Text):
    1.  
    2. void Monster::dropLoot(Container* corpse)
    For this:
    Code (Text):
    1.  
    2. void Monster::dropLoot(Container* corpse)
    3. {
    4.     #ifdef __SHOULD_USE_CORPSEOWNER__
    5.         if(corpse && lootDrop){
    6.             Player* killer = g_game.getPlayerByID(corpse->getCorpseOwner());
    7.             if(!killer || killer->getStaminaMinutes() > 840)
    8.                 mType->createLoot(corpse);
    9.             if(killer)
    10.                 killer->broadcastLoot(this, corpse->getContainer());
    11.         }
    12.     #else
    13.         if(corpse && lootDrop){
    14.             mType->createLoot(corpse);
    15.         }
    16.     #endif
    17. }
    18.  
     
    adric21 likes this.
  18. waqmaz

    waqmaz Member

    Joined:
    Jun 17, 2015
    Messages:
    202
    Likes Received:
    9
    Best Answers:
    0
    Thank you for sharing with us your script, but this is not what I need. The solution you gave us, I already did to my server.
    The problem is that I am starting to believe that 10 first seconds of unmoveable corpse is client side... For the hell, can not find it in the server ot there are mixed ids.

    Any knowledge about that?

    edit: what i've noticed:
    If I use for example a corpse of sheep as a second corpse and black sheep as a third corpse, sheeps are moveable. WTF. now I am totally confused. Rats don't work, sheeps work.
     
    Last edited: Nov 19, 2018
  19. waqmaz

    waqmaz Member

    Joined:
    Jun 17, 2015
    Messages:
    202
    Likes Received:
    9
    Best Answers:
    0
    Finally got it! I had to write my own corpse system with own generated corpse onkill and own generated random chance for a loot on array onkill as well... but now i have to do 500 monsters more! I am so happy! :)

    - doesnt work
    item transformed is not moveable
     
    Last edited: Nov 21, 2018
  20. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,452
    Likes Received:
    320
    Best Answers:
    3
    Dude, the code that I've posted, do exactly what you need, just test it ;)
     
  21. waqmaz

    waqmaz Member

    Joined:
    Jun 17, 2015
    Messages:
    202
    Likes Received:
    9
    Best Answers:
    0
    It makes items openable and without owner i already have done it to the server. i need to remove waiting time after the monster has just been killed i can not push the corpse
     

Share This Page

Loading...