User Tag List

Results 1 to 4 of 4

Thread: Custom command for displayed respawn timers

  1. #1
    Lurking Member
    Join Date
    Aug 2016
    Posts
    2
    XP
    22
    Level
    1
    Thanks
    1
    Thanked 1 Time in 1 Post

    Custom command for displayed respawn timers

    Hey.

    I was wondering if someone could help me out with a little script for a custom command on a 3.3.5a trinity server. The command is supposed to display remaining respawntime for a creature to respawn in the players chat. Would be neat if someone here could help me out

  2. The Following User Says Thank You to Jeremiassen1 For This Useful Post:


  3. #2
    Foufos
    Join Date
    May 2014
    Posts
    55
    XP
    250,768
    Level
    112
    Thanks
    7
    Thanked 2 Times in 2 Posts
    i think if u do .npc info it displays the respawn time

  4. #3
    Moderator <span style='color: #FF1493'><span class='glow_000000'>Vitrex</span></span>'s Avatar

    Join Date
    Sep 2013
    Location
    Vilnius , Lithuania
    Posts
    1,049
    XP
    1,000,667
    Level
    174
    Thanks
    283
    Thanked 137 Times in 97 Posts
    Quote Originally Posted by Djundead View Post
    i think if u do .npc info it displays the respawn time
    https://www.reaper-x.com/2009/01/01/...e-gm-commands/

    Syntax: .npc info Display a list of details for the selected creature.
    The list includes:
    – GUID, Faction, NPC flags, Entry ID, Model ID,
    – Level,
    – Health (current/maximum),
    – Field flags, dynamic flags, faction template,
    – Position information,
    – and the creature type, e.g. if the creature is a vendor.
    What exactly help do you need? don't know where to start or stucked somewhere ?
    Achievements:
    Shopper Got a Sticky! 1 year registered Member Level XL Level C Referrer
    Awards:
    Raffle Winner Donator Member of Staff Pot Head
    I won't create anything for you, i can only guide you to right direction.
    Don't forget to read rules before posting.
    Forum Rules
    Need and assistance with your issue? use this section to ask for assistance !
    -----
    My Portfolio
    Wanna learn PHP ? check out my One-Page project


  5. The Following User Says Thank You to Vitrex For This Useful Post:


  6. #4
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,497
    XP
    20,134,837
    Level
    500
    Thanks
    1,092
    Thanked 333 Times in 213 Posts
    these would be the 4 lines I would look at in \src\server\scripts\Commands\cs_npc.cpp in `static bool HandleNpcInfoCommand(ChatHandler* handler, char const* /*args*/)`
    :
    Code:
    
            Creature* target = handler->getSelectedCreature();
    
            int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
    
            if (curRespawnDelay < 0)
                curRespawnDelay = 0;
    
    create pointer called `target` for creature , and get respawn timer left and set to 0 if it math's out to a negative integer.

    probably these 2 lines too:
    Code:
    
            std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
            std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true);
    
    so you can post `respawn timer` and `respawn timer left`.

    Code:
    
            handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
    
    I added this idea to the EmuDevs Community Premium System --> http://emudevs.com/showthread.php/57...Premium-System
    Last edited by slp13at420; 08-27-2016 at 03:56 PM.
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  7. The Following User Says Thank You to slp13at420 For This Useful Post:


Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Posting Permissions

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