Jump to content
  • 0

System MVP save resPawn


AsiaGenius

Question


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   17
  • Joined:  01/23/14
  • Last Seen:  

Hello people, I do not speak English!

 

Well, I was looking for a way to save the respawn mpv, so that if the server had an accidental fall, crash or something, the time of mvp save respawn. I thought I'd create some global variable, but I believe I have to interact with the file that invokes the monsters ... does anyone have any idea to help? I am willing to share the system with the community, because I know that many server administrators would love preserve respawn!

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1187
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

On 12/27/2014 at 10:12 AM, jawbreaker said:

 

 

im adding optional reward  example, 1 coin on Baphomet, 2 coins for Darklord kill.  i will be posting later.

@jawbreaker

Are you have update for this npc, like player could check is the npc still alive or dead.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Well as long as the spawn timers are set in the mob scripts there's nothing you can do...the only way would be replacing them with a script that would spawn those monsters in their respective maps with a 'OnClock' label or something like that and have their death times tracked by a script as well.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  317
  • Reputation:   63
  • Joined:  11/13/11
  • Last Seen:  

I believe this is more of a Scripting Support, so I'll move your topic accordingly.

As per your problem, there's a good chance our Scripting Moderators would be able to help you with it.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   17
  • Joined:  01/23/14
  • Last Seen:  

Yes! ThankI was basically thinking of a script that save ums reaspawn in global variables! Thus the MVP respawn is save if the server restarted!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

//===== Hercules Script ======================================
//= MVP Spawn Timer
//===== By: ==================================================
//= jawbreaker
//===== Current Version: =====================================
//= 1.1
//===== Description: =========================================
//= Control MVP Spawn with script. MVP will not respawn on server start or reload using flag.
//===== Additional Comments: =================================
//= 1.0 Remove/Comment all MVP spawn at npc/pre-re/mobs/dungeons/ or /fields.  
//= 1.1 Initialize TimeStamp when not set to all MVP
           Fixed typo on MVP_Map array.
//============================================================

-    script    MVPTimer    -1,{
OnInit:
    // Mvp ids
    setarray $MVP_ID[0],1511,1785,1785,1785,1785,1785,1039,1272,1272,1719,
                        1046,1046,1389,1112,1115,1115,1418,1252,1768,1086,
                        1885,1832,1734,1688,1373,1147,1147,1059,1150,1087,
                        1087,1190,1038,1157,1159,1623,1492,1251,1583,1312,
                        1751,1685,1630;
    // Mvp maps
    setarray $MVP_Maps$[0],"moc_pryd06","ra_fild02","ra_fild03","ra_fild04","ve_fild01","ve_fild02","prt_maze03","gl_chyard","gld_dun04","abyss_03",
                        "gef_dun02","gld_dun02","gef_dun01","treasure02","gld_dun01","pay_fild11","gon_dun03","xmas_fild01","ra_san05","prt_sewb4",
                        "mosk_dun03","thor_v03","kh_dun02","ayo_dun02","niflheim","gld_dun03","anthell02","mjolnir_04","pay_dun04","gef_fild02",
                        "gef_fild14","gef_fild10","moc_pryd04","in_sphinx5","moc_fild15","ein_dun02","ama_dun03","xmas_dun02","beach_dun","tur_dun04",
                        "odin_tem03","jupe_core","lou_dun03";

    // Respawn time (minutes)
    setarray $MVP_Time[0],60,240,180,300,180,360,120,60,480,180,
                        120,480,60,120,480,120,94,120,300,60,
                        120,660,120,420,91,480,120,120,60,1440,
                        60,120,60,60,120,125,91,60,300,60,
                        480,120,117;
    
    // Respawn only undead MVP's on server start or reload                    
    for( set .@i,0; .@i < getarraysize($MVP_ID); set .@i, .@i+1 )
    {
        // check whether MPV is alive or $MVP_Status variable is not yet set.  
        // 1 - Dead, 2 - Alive
        if ( $MVP_Status[.@i] == 2 || $MVP_Status[.@i] == 0 || $MVP_TimeStamp[.@i] == 0  ) {  
            monster $MVP_maps$[.@i],0,0,"--ja--",$MVP_ID[.@i],1;
            set $MVP_Status[.@i], 2;
        } else { // don't respawn MVP and wait for next spawn time
            set $MVP_Status[.@i], 1;
        }    
    }                    
    initnpctimer;
    OnTimer60000: // Check every 1 minute
        for( set .@i,0; .@i < getarraysize($MVP_ID); set .@i, .@i+1 )
        {
            set .@time, $MVP_Time[.@i]*60; // Conversion to seconds so we can use gettimetick
            if( ($MVP_TimeStamp[.@i] + .@time) <= gettimetick(2) && $MVP_Status[.@i] == 1 ) {
                monster $MVP_Maps$[.@i],0,0,"--ja--",$MVP_ID[.@i],1;
                // Defines last respawn
                set $MVP_TimeStamp[.@i], gettimetick(2);
                set $MVP_Status[.@i], 2;
            }
        }
        setnpctimer 0;
        end;
    
    OnNPCKillEvent:
        if( getmonsterinfo(killedrid, MOB_MVPEXP) > 0 ) // process only MVP Monsters
            for( set .@i,0; .@i < getarraysize($MVP_ID); set .@i, .@i+1 )
            {
                if( (killedrid == $MVP_ID[.@i]) && (strcharinfo(3) == $MVP_Maps$[.@i])) {
                    set $MVP_Status[.@i],1; // set flag  mvp has died
                    set $MVP_TimeStamp[.@i], gettimetick(2); // set mpv death time
                }    
            }
        end;
}

I made this just today.  Please report any problem :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   17
  • Joined:  01/23/14
  • Last Seen:  

:o :o :o thnsk! I will check!


Just one last question. The tombs of MVP not appear in this script mode.

Edited by falkatrua
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

hey! Script work perfect! Just one last question. The tombs of MVP not appear in this script mode.

There's currently no script command to spawn a boss monster with a tomb. (It wouldn't be a bad idea to create one, though...)
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   17
  • Joined:  01/23/14
  • Last Seen:  

//===== Hercules Script ======================================
//= MVP Spawn Timer
//===== By: ==================================================
//= jawbreaker
//===== Current Version: =====================================
//= 1.1
//===== Description: =========================================
//= Control MVP Spawn with script. MVP will not respawn on server start or reload using flag.
//===== Additional Comments: =================================
//= 1.0 Remove/Comment all MVP spawn at npc/pre-re/mobs/dungeons/ or /fields.  
//= 1.1 Initialize TimeStamp when not set to all MVP
           Fixed typo on MVP_Map array.
//============================================================

-    script    MVPTimer    -1,{
OnInit:
    // Mvp ids
    setarray $MVP_ID[0],1511,1785,1785,1785,1785,1785,1039,1272,1272,1719,
                        1046,1046,1389,1112,1115,1115,1418,1252,1768,1086,
                        1885,1832,1734,1688,1373,1147,1147,1059,1150,1087,
                        1087,1190,1038,1157,1159,1623,1492,1251,1583,1312,
                        1751,1685,1630;
    // Mvp maps
    setarray $MVP_Maps$[0],"moc_pryd06","ra_fild02","ra_fild03","ra_fild04","ve_fild01","ve_fild02","prt_maze03","gl_chyard","gld_dun04","abyss_03",
                        "gef_dun02","gld_dun02","gef_dun01","treasure02","gld_dun01","pay_fild11","gon_dun03","xmas_fild01","ra_san05","prt_sewb4",
                        "mosk_dun03","thor_v03","kh_dun02","ayo_dun02","niflheim","gld_dun03","anthell02","mjolnir_04","pay_dun04","gef_fild02",
                        "gef_fild14","gef_fild10","moc_pryd04","in_sphinx5","moc_fild15","ein_dun02","ama_dun03","xmas_dun02","beach_dun","tur_dun04",
                        "odin_tem03","jupe_core","lou_dun03";

    // Respawn time (minutes)
    setarray $MVP_Time[0],60,240,180,300,180,360,120,60,480,180,
                        120,480,60,120,480,120,94,120,300,60,
                        120,660,120,420,91,480,120,120,60,1440,
                        60,120,60,60,120,125,91,60,300,60,
                        480,120,117;
    
    // Respawn only undead MVP's on server start or reload                    
    for( set .@i,0; .@i < getarraysize($MVP_ID); set .@i, .@i+1 )
    {
        // check whether MPV is alive or $MVP_Status variable is not yet set.  
        // 1 - Dead, 2 - Alive
        if ( $MVP_Status[.@i] == 2 || $MVP_Status[.@i] == 0 || $MVP_TimeStamp[.@i] == 0  ) {  
            monster $MVP_maps$[.@i],0,0,"--ja--",$MVP_ID[.@i],1;
            set $MVP_Status[.@i], 2;
        } else { // don't respawn MVP and wait for next spawn time
            set $MVP_Status[.@i], 1;
        }    
    }                    
    initnpctimer;
    OnTimer60000: // Check every 1 minute
        for( set .@i,0; .@i < getarraysize($MVP_ID); set .@i, .@i+1 )
        {
            set .@time, $MVP_Time[.@i]*60; // Conversion to seconds so we can use gettimetick
            if( ($MVP_TimeStamp[.@i] + .@time) <= gettimetick(2) && $MVP_Status[.@i] == 1 ) {
                monster $MVP_Maps$[.@i],0,0,"--ja--",$MVP_ID[.@i],1;
                // Defines last respawn
                set $MVP_TimeStamp[.@i], gettimetick(2);
                set $MVP_Status[.@i], 2;
            }
        }
        setnpctimer 0;
        end;
    
    OnNPCKillEvent:
        if( getmonsterinfo(killedrid, MOB_MVPEXP) > 0 ) // process only MVP Monsters
            for( set .@i,0; .@i < getarraysize($MVP_ID); set .@i, .@i+1 )
            {
                if( (killedrid == $MVP_ID[.@i]) && (strcharinfo(3) == $MVP_Maps$[.@i])) {
                    set $MVP_Status[.@i],1; // set flag  mvp has died
                    set $MVP_TimeStamp[.@i], gettimetick(2); // set mpv death time
                }    
            }
        end;
}

I made this just today.  Please report any problem :D

 

 

 

You script not respawn MVP after Dead! Pls Help!

I solved! Change

initnpctimer 

To

startnpctimer

thanks

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

I solved! Change

initnpctimer 

To

startnpctimer

thanks

 

 

 

im adding optional reward  example, 1 coin on Baphomet, 2 coins for Darklord kill.  i will be posting later.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...