Jump to content
  • 0
Sign in to follow this  
Celes

How to convert this script to hercules?

Question

 

brasilis,104,333,5    script    Monster Raid    119,{
 
    mes "[Raider]";
    mes "The Raid Room consists of different monsters you can fight.";
    mes " ";
    mes "For harder room, I suggest to create a party to make it more successful.";
    select(.menu$);
    warp getd(".room"+(@menu-1)+"$[1]"),0,0;
    end;
 
OnNPCKillEvent:
//OnMobDeath:
    for(set .@p,0;getarraysize(getd(".room"+.@p+"$"));set(.@p,.@p+1))
        if( playerattached() ) {
            if( getd(".room"+.@p+"$[1]") == strcharinfo(3) ) {
                monster strcharinfo(3),0,0,"--ja--",killedrid,1/*,"Training Room::OnMobDeath"*/;
                break;
            }
        }
    end;
    
Oninit:
//Configuration
//                  #   Room Name                                ,  Map         ,  MobLvlRngLow ,  MobLvlRngHigh,  #SpawnMobs,  Mobs Limit(MAX 128),   Optional Search String    ;
    setarray .room0$, "Novice Room %s~%s (<mob>,<mob>...)"     ,  "06guild_01",  "0"          ,  "10"         ,  "30"      ,  "128"              ,   "`iName` LIKE '%Por%'"    ; // Would make a novice poring room.
    setarray .room1$, "Beginner Room %s~%s (<mob>,<mob>...)"   ,  "06guild_02",  "11"         ,  "20"         ,  "1"       ,  "128"              ,   ""                        ;
    setarray .room2$, "Adept Room %s~%s (<mob>,<mob>...)"      ,  "06guild_03",  "21"         ,  "30"         ,  "2"       ,  "128"              ,   ""                        ;
    setarray .room3$, "Advanced Room %s~%s (<mob>,<mob>...)"   ,  "06guild_04",  "31"         ,  "40"         ,  "2"       ,  "128"              ,   ""                        ;
    setarray .room4$, "Experts Room %s~%s (<mob>,<mob>...)"    ,  "06guild_05",  "41"         ,  "50"         ,  "2"       ,  "128"              ,   ""                        ;
    setarray .room5$, "Veterans Room %s~%s (<mob>,<mob>...)"   ,  "06guild_06",  "51"         ,  "60"         ,  "2"       ,  "128"              ,   ""                        ;
    setarray .room6$, "MVP Room %s~%s (<mob>,<mob>...)"        ,  "06guild_07",  "61"         ,  "70"         ,  "2"       ,  "128"              ,   ""                        ;
    setarray .room7$, "Like a Boss Room %s~%s (<mob>,<mob>...)",  "06guild_08",  "71"         ,  "98"         ,  "1"       ,  "128"              ,   ""                        ;
    
    
    set .srch$, "<mob>"; //String searched and replaced with mob name in the Room Name Feild.
    set .mvps, 1; //Mvps Summoned or not? 0=Off 1=On
//End
 
    for(set(.@a,0);getarraysize(getd(".room"+.@a+"$"));set(.@a,.@a+1)) {
        set .rmn$, ".room"+.@a+"$";
        set .nam$, ".name"+.@a+"$";
        set .mid$, ".id"+.@a;
        
        set .rrm$, getd(.rmn$+"[0]");
        set .map$, getd(.rmn$+"[1]");
        set .lrl$, getd(.rmn$+"[2]");
        set .lrh$, getd(.rmn$+"[3]");
        set .nsms, atoi(getd(.rmn$+"[4]"));
        set .mlim, atoi(getd(.rmn$+"[5]"));
        set .ops$, getd(.rmn$+"[6]");
        
        set .length, countstr(getd(.rmn$+"[0]"), .srch$);
        set .lengt, countstr(getd(.rmn$+"[0]"), "%s");
        if(.lengt>1) set .mes$[.@a], sprintf(.rrm$,.lrl$,.lrh$);
        
        set .len, query_sql("SELECT `ID`,`iName` FROM `mob_db` WHERE `LV` > "+.lrl$+" AND `LV` < "+.lrh$+" "+((.ops$!="")?"AND "+.ops$+" ":"")+((!.mvps)?"AND `MEXP` <= 0 ":"")+"ORDER BY RAND() LIMIT "+((.mlim>128)?128:.mlim )+";",.id,.name$);
        set .lens, getarraysize(.name$);
        
        copyarray getd(.nam$+"[0]"), .name$, .lens;
        copyarray getd(.mid$+"[0]"), .id, .lens;
        deletearray .name$;
        deletearray .id;
        
        while(.@i++<=.length )
        if(.@i<=.lens) set .mes$[.@a], replacestr(.mes$[.@a], .srch$, getd(.nam$+"["+(.@i-1)+"]"), 1, 1);
        set .@i,0;
        
        for(set(.@h,0);.@h<.lens;set(.@h,.@h+1)) {
            monster .map$,0,0,"--ja--",getd(.mid$+"["+.@h+"]"),.nsms/*,"Training Room::OnMobDeath"*/;
        }
    }
    
    set .menu$, implode(.mes$,":");
}
 
 
 

 

 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.