Jump to content

butasro

Members
  • Content Count

    33
  • Joined

  • Last visited

Posts posted by butasro


  1. Hey there good sir. I actually rewrote that script and made it into a totally different script. If you're interested you can message me or add me on Skype: itzmichaelmorici

     

    I rewrote it into instancing, there is Random Item Farming, Bloody Branch Farming, Dead Branch, Gold, and Oridicon/Elunium farming. One thing that is wrong with this script too is AoE is abusable, in mine it is fixed.

     

    Also since it is instanced, each player gets their own room to farm in! Can easily set how many minutes/hours until they can Farm again, as well as set the % rate at which they obtain the items.

     

    PS: there is rAthena and Hercules edition of it =P @@butasro

     

    Example screenshot:

     

    Tktx026.jpg

    is this free or not? ^^



  2. prontera,152,192,3    script    Farm Zone    954,{
    function    RandomizeItem;

    while( 1 ){
    mes "How can i help you ?";
    switch( select( "Information:Farm Items" )){
    case 1:
        mes "This is a Farm Zone.";
        mes "You are able to Hunt Monster inside this Room.";
        mes "Every Monster will award you random items.";
        next;
        mes "But there is some Condition..";
        mes "You can only go in ^FF0000once every "+.RoomCleanMin+" minutes for 1 times.^000000";
        mes "And Maximum of ^FF0000"+.MaxPlayers+" Players per "+.RoomCleanMin+" Minutes.^000000";
        mes "Maximum Hunting Limit ^FF0000"+.MaxItemLimit+"^000000";
        next;
        mes "There will be a ^FF0000Room Cleaning^000000 from time to time...";
        mes "All players will be kicked out, it is your bad luck if you meet this.";
        mes "Delay will still apply even though you just go in for 1 Seconds..";
        next;
        break;

    case 2:

        if( #HuntRoomDelay > gettimetick(2) ){
            set .last,#HuntRoomDelay - gettimetick(2);
            set .@min,  .last % ( 24 * 3600 ) % 3600 / (60);
            mes "Wait for ^FF0000"+.@min+" Minutes^000000.";
            close;
        }else if( getarraysize( .Hunter ) >= .MaxPlayers ){
            mes "Currently the Room is Full. Please try again later.";
            close;
        }else{
            warp .Map$,0,0;
            set .Hunter[getarraysize( .Hunter )],strcharinfo(0);
            set #HuntRoomDelay,gettimetick(2) + ( .DelayMin * 60 );
            set #FarmHunt,0;
            end;
            }
        }
    }

    OnInit:
    // Maximum Player can join per X Minutes.
    set .MaxPlayers,3;
    // Adding X Minutes of Delay before can go in again.
    set .DelayMin,1;
    // Maximum Hunt Limit per round inside the Zone.
    set .MaxItemLimit,100;
    // Map that will be used in those Zone.
    set .Map$,"guild_vs5";
    // Clear Map Every X Minutes.
    set .RoomCleanMin,15;
    // Mapflag Initialization
    //setmapflag .Map$,mf_nogo;
    setmapflag .Map$,mf_nomobloot;
    setmapflag .Map$,mf_nomvploot;
    setmapflag .Map$,mf_nowarpto;
    setmapflag .Map$,mf_nochat;
    setmapflag .Map$,mf_novending;
    setmapflag .Map$,mf_nocommand,60;
    setmapflag .Map$,mf_nogo;
    setmapflag .Map$,mf_nojobexp;
    setmapflag .Map$,mf_nobaseexp;

    while( 1 ){
        killmonster .Map$,"All";
        mapwarp .Map$,"prontera",154,212;
        monster .Map$, 0, 0,"[ Farm Zone ] Resident", 1750, 80, strnpcinfo(0)+"::OnNormalKill";        
        monster .Map$, 0, 0,"[ Farm Zone ] Guardian", 1565,  5, strnpcinfo(0)+"::OnBossKill";
        
        deletearray .Hunter,getarraysize( .Hunter );
        announce "[ Farm Zone ] : Farming Zone has been Cleaned up, another 5 Players may go in now.",bc_blue;
        sleep ( .RoomCleanMin * 60000 );
        mapannounce .Map$,"[ Farm Zone ] : Room Clean Up now...All Users will be warped Out.",0;
        killmonster .Map$,"All";
        sleep 3000;
        }
    end;

    OnNormalKill:
    RandomizeItem( 0,rand(1,3) );
    monster .Map$,0,0,"--ja--",-1,1,strnpcinfo(0)+"::OnNormalKill";
    end;

    OnBossKill:
    RandomizeItem( 1,rand(1,4) );
     monster .Map$,0,0,"--ja--",-3,1,strnpcinfo(0)+"::OnBossKill";
    end;

    // Function that used to Generate Random Items

    function    RandomizeItem    {
    set #FarmHunt,#FarmHunt + getarg(1);

    // Normal Monster in Zone Drops Lists
    if( getarg(0) == 0 ) setarray .ItemList[0],607,12016,673;
    // Normal Boss in Zone Drops Lists
    if( getarg(0) == 1 ) setarray .ItemList[0],14536,7608,607,673;

    for( set .@i,1; .@i <= getarg(1); set .@i,.@i + 1 ){
        getitem .ItemList[ rand( getarraysize( .ItemList ) ) ],1;
        }
    deletearray .ItemList,getarraysize( .ItemList );
    dispbottom "[ Farm Zone ] : Farmed "+#FarmHunt+" / "+.MaxItemLimit+" Items";
    if( #FarmHunt >= .MaxItemLimit ){
        message strcharinfo(0),"Limit Reach , you may join again later.";
        sleep2 2000;
        warp "prontera",154,212;
        }
    return;
    }
        
    }
        
        
        
      


  3.  

     

     

     

     

     

    @@butasro explain it so that we can make a script

    Probably he means, delete all entries of specific character

     

    However I feel, this kind of thing should be atcommand but rather be scriptcommand for safety reasons.

    Like deleting the whole character 

     

    for example : @charwipe dastgir, then all entries in dbase would be deleted? something like that?

    sorry i mean, rivert back the character to lvl 1 all stats and skill will be gone, and stats point, it will rivert as new character, something like that

    Hmm, give us the whole info

    Only the Characters?

    How about Inventory Items? Storage Items? Cart Items? it will wipe or stay the same?

     

    just the skillpoint statpoint joblevel baselevel of specific character, ,

    example :

    @charwipe butasro

    then your char will become novice and blvl & jlvl will turn into 1 right?

     

    Edit : give me 10mins to make the script

    Thanks Master ^^


  4.  

     

     

     

    @@butasro explain it so that we can make a script

    Probably he means, delete all entries of specific character

     

    However I feel, this kind of thing should be atcommand but rather be scriptcommand for safety reasons.

    Like deleting the whole character 

     

    for example : @charwipe dastgir, then all entries in dbase would be deleted? something like that?

    sorry i mean, rivert back the character to lvl 1 all stats and skill will be gone, and stats point, it will rivert as new character, something like that

    Hmm, give us the whole info

    Only the Characters?

    How about Inventory Items? Storage Items? Cart Items? it will wipe or stay the same?

     

    just the skillpoint statpoint joblevel baselevel of specific character, ,


  5.  

     

    @@butasro explain it so that we can make a script

    Probably he means, delete all entries of specific character

     

    However I feel, this kind of thing should be atcommand but rather be scriptcommand for safety reasons.

    Like deleting the whole character 

     

    for example : @charwipe dastgir, then all entries in dbase would be deleted? something like that?

    sorry i mean, rivert back the character to lvl 1 all stats and skill will be gone, and stats point, it will rivert as new character, something like that


  6. any one can convert this or tried this here in herc?


    //===== eAthena Script =======================================
    //= Royal Rumble Event
    //===== By: ==================================================
    //= Masao
    //===== Current Version: =====================================
    //= 2.0
    //===== Compatible With: =====================================
    //= Any Athena Version
    //===== Description: =========================================
    //= Starts an little PvP Event when a total of 10 Players
    //= have Signed Up. After that every 30 seconds
    //= a new Player will be warped onto the PvP Map until
    //= all 10 Players have been warped.
    //===== Additional Comments: =================================
    //= Version 1.0 [Masao]
    //= Verison 1.1 added GM Control Panel & Autostart [Masao]
    //= Version 2.0 complete re-script [Masao]
    //============================================================
    prontera,182,207,4    script    Royal Rumble    946,{

        set .@n$,"[Royal Rumble]";

        if (getgmlevel() >= 40) goto L_GMCP;

        mes .@n$;
        mes "Hello "+strcharinfo(0)+",";
        mes "I'm the Royal Rumble NPC, you can Sign Up here for the Royal Rumble Event!";
        mes "";
        mes "So, would you like to Sign Up?";
        next;
        menu "Yes, please!",-,"Royal Rumble?!",L_R,"No, thanks.",L_E;
        
        if(.rrp == 10)
        {
            mes .@n$;
            mes "I'm sorry but the Event already begun!";
            close;
        }
        set .@myaid, getcharid(3);
        for ( set .@i, 1; .@i <= .rrp; set .@i, .@i +1 )
            if ( .rra[.@i] == .@myaid ) break;
        if ( .@i > .rrp ) {
            set .rrp,.rrp+1;
            set .rra[.rrp],getcharid(3);
        }
        set @rre,1;
        set @rre2,1;
        if(.rrp < 10)
        {
            mes .@n$;
            mes "Allright, you have been signed up. As soon as the Event begins you'll see an Broadcast.";
            close;
        }
        mes .@n$;
        mes "Allright, you have been signed up. The Event begins now!";
        close2;
        initnpctimer;
        disablenpc "Royal Rumble";
        announce "The Royal Rumble Event begins now! The first 2 players will now be warped into the Royal Rumble Arena!",bc_all;
        end;

    L_R:
        mes .@n$;
        mes "The Rules are very easy!";
        mes "Just Sign Up to the Game and then wait until a total of 10 Players have Signed Up, as soon as this happens the Game will start.";
        mes "When the Event starts 2 Players will be warped onto an PvP Map, then they fight each other, the loser get warped out and the Winner stays.";
        mes "And after the first 2 Players have been warped in, every 30 Seconds a new Player will be warped onto the Map.";
        mes "As soon as the last player is killed on the Map the Game will end and the last survivor is the Winner!";
        mes "And that's all, have Fun and good Luck!";
        close;

    L_E:
        mes .@n$;
        mes "Ok, bye.";
        close;

    L_GMCP:
        mes .@n$;
        mes "Hello "+strcharinfo(0)+",";
        mes "what can i do for you?";
        switch(select("Start Event!:End Event.:Set Prize:Cancel")) {
            case 1:
                next;
                mes .@n$;
                mes "Allright, the Event starts now!";
                close2;
                enablenpc "Royal Rumble";
                for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
                {
                    if(attachrid(.rra[.@i])){
                        if (@rre == 1) {
                            set @rre,0;
                            set @rre2,0;
                            detachrid;
                        }
                    }
                }
                set .rrp,0;
                deletearray .rra[0],128;
                mapwarp "guild_vs3","prontera",155,185;
                announce "The Royal Rumble Event is Open now!",bc_all;
                end;
            case 2:
                next;
                mes .@n$;
                mes "Allright, the Event ends now!";
                close2;
                disablenpc "Royal Rumble";
                for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
                {
                    if(attachrid(.rra[.@i])){
                        if (@rre == 1) {
                            set @rre,0;
                            set @rre2,0;
                            detachrid;
                        }
                    }
                }
                set .rrp,0;
                deletearray .rra[0],128;
                mapwarp "guild_vs3","prontera",155,185;
                announce "The Royal Rumble Event has been ended by an GM!",bc_all;
                end;
            case 3:
                next;
                mes .@n$;
                mes "The current Prize is "+getitemname($rr_id)+", would you like to change it?";
                switch(select("No:Yes")) {
                    case 1:
                        next;
                        mes .@n$;
                        mes "Ok, bye.";
                        close;
                    case 2:
                        next;
                        mes .@n$;
                        mes "Ok, then please insert now the new Item ID";
                        input $rr_id;
                        next;
                        mes .@n$;
                        mes "And now the Amount please.";
                        input $rr_amount;
                        next;
                        mes .@n$;
                        mes "Allright, so the Prize now is ^008000"+$rr_amount+" "+getitemname($rr_id)+"^000000";
                        close;
                }
            case 4:
                next;
                mes .@n$;
                mes "Ok, bye";
                close;
        }

    OnPCDieEvent:
        getmapxy .@m$,.@x,.@y,0;
        if(.@m$ == "guild_vs3")
        {
            for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
            {
                if(attachrid(.rra[.@i])){
                    if (@rre == 1) {
                        set @rre,0;
                        warp "prontera",155,185;
                    }
                    detachrid;
                }
            }
            set .rrp,.rrp-1;
        }
        end;

    OnPCLogoutEvent:
        getmapxy .@m$,.@x,.@y,0;
        if(.@m$ == "guild_vs3")
        {
            for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
            {
                if(attachrid(.rra[.@i])){
                    if (@rre == 1) {
                        set @rre,0;
                        save "prontera",155,185;
                    }
                    detachrid;
                }
            }
            set .rrp,.rrp-1;
        }
        end;

    OnPCKillEvent:
        getmapxy .@m$,.@x,.@y,0;
        if(.@m$ == "guild_vs3")
        {
            if(.rrp <= 1)
            {
                for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
                {
                    if(attachrid(.rra[.@i])){
                        if (@rre == 1)
                        {
                            dispbottom "Congratulations "+strcharinfo(0)+"!";
                            dispbottom "You won the Royal Rumble Event!";
                            dispbottom "Here is your Prize, and see you next time!";
                            getitem $rr_id,$rr_amount;
                            set @rre,0;
                            warp "prontera",155,185;
                        }
                        detachrid;
                        announce strcharinfo(0)+" won this Game of Royal Rumble! Congratulations!",bc_all;
                    }
                }
                deletearray .rra[0],128;
            }
        }
        end;

    OnTimer1000:
        for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre2 == 1) {
                    set @rre2,0;
                    warpchar "guild_vs3",0,0,.rra[.@i];
                }
                end;
            }
        }
        end;
    OnTimer1100:
        for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre2 == 1) {
                    set @ree2,0;
                    warpchar "guild_vs3",0,0,.rra[.@i];
                }
                end;
            }
        }
        end;
    OnTimer30000:
    OnTimer60000:
    OnTimer90000:
    OnTimer120000:
    OnTimer150000:
    OnTimer180000:
    OnTimer210000:
    OnTimer240000:
    OnTimer270000:
    OnTimer300000:
        for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre2 == 1) {
                    set @rre2,0;
                    warpchar "guild_vs3",0,0,.rra[.@i];
                }
                end;
            }
        }
        end;

    OnClock0108:
    OnClock0808:
    OnClock1208:
    OnClock1608:
    OnClock2008:
    OnClock0008:
        enablenpc "Royal Rumble";
        for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre == 1) {
                    set @rre,0;
                    set @rre2,0;
                }
                detachrid;
            }
        }
        set .rrp,0;
        deletearray .rra[0],128;
        mapwarp "guild_vs3","prontera",155,185;
        announce "The Royal Rumble Event starts now! You have 3 Minutes to Sign Up!",bc_all;
        end;
        
    OnClock0403:
    OnClock0803:
    OnClock1203:
    OnClock1603:
    OnClock2003:
    OnClock0003:
        if(.rrp < 10)
        {
            disablenpc "Royal Rumble";
            announce "The Royal Rumble Event is closed now! Since there were not 10 Players the Event will not take place.",bc_all;
            for(set .@i,1;.@i<=.rrp;set .@i,.@i+1)
            {
                if(attachrid(.rra[.@i])){
                    if (@rre == 1) {
                        set @rre,0;
                        set @rre2,0;
                    }
                    detachrid;
                }
            }
            set .rrp,0;
            deletearray .rra[0],128;
        }
        end;

    OnInit:
        disablenpc "Royal Rumble";
        end;
    }

    //============== Mapflags ====================
    //guild_vs3    mapflag    nogo
    guild_vs3    mapflag    pvp_noguild
    guild_vs3    mapflag    pvp_noparty
    guild_vs3    mapflag    nobranch
    guild_vs3    mapflag    nomemo
    guild_vs3    mapflag    nopenalty
    guild_vs3    mapflag    noreturn
    guild_vs3    mapflag    noteleport
    guild_vs3    mapflag    nowarp
    guild_vs3    mapflag    nowarpto
    guild_vs3    mapflag    noicewall
     


  7.  

    yep, my bad.

    change this:

     

    bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
     

     

    to this:

     

    bindatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
     

    Thanks it worked ^^ woo!

     

     

    yep, my bad.

    change this:

     

    bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
     

     

    to this:

     

    bindatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
     

    Thanks it worked ^^ woo!


  8. unknown command T_T

    -    script    BGMCOMMAND    FAKE_NPC,{
    OnInit:
    bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
    setarray .musicName$[0], "1", "2", "3"; //add yours
    end;

    OnStartBGM:
        
        if(.@atcmd_parameters$[0] == "")
        {
            message strcharinfo(0), "BGM failed: invalid music name";
            end;
        }
        
        freeloop(1);
        for(.i = 0; .i < getarraysize(.musicName$); .i++)
        {
            if(.@atcmd_parameters$[0] == .musicName$[.i]){
                playbgmall .@atcmd_parameters$[0];
                message strcharinfo(0), "BGM: Played - " + .@atcmd_parameters$[0];
                end;
            }
        }
        freeloop(0);
        message strcharinfo(0), "BGM failed: invalid music name";
        end;
    }


  9. What exactly doesn't work? Did you make sure to add the SQL table and remove the SQL table part between the */ and /*? The ID of the NPC "757" needs to be changed as well.

    yes sir i already added the script in my SQL table, when i click the npc, no response ,, ok ill change the 757 to any npc listing?

     

    still not working, can you give me a script that works or sample that works? that you edited? please?


  10. ok ill try thanks for the info's masters ^^ Godspeed

    // Load the following SQL Table in your Server before use the NPC
        
    /*
        
    CREATE TABLE IF NOT EXISTS `E-Inquiry` (
        `ID` bigint(20) unsigned NOT NULL auto_increment,
        `Sender_ID` int(11) unsigned NOT NULL default '0',
        `Sender_Name` varchar(30) NOT NULL default '',
        `Title` text,
        `Message` text,
        `Status` tinyint(2) NOT NULL default '0',
        `Inquiry_Time` datetime NOT NULL default '0000-00-00 00:00:00',
        `Reply` text,
        `Reply_Time` datetime NOT NULL default '0000-00-00 00:00:00',
        `Reply_Name` varchar(30) NOT NULL default '',
        PRIMARY KEY  (`ID`)
    ) ENGINE=MyISAM;
    
    */
    
    -    script    E-Inquiry    FAKE_NPC,{  // <------ i already change, and i add tables on my database, any changes
                                        //         that i need to change?
    OnStartMenu:
    mes "Do you having problems and wish to inform GM Staffs about this ?";
    next;
    switch( select( "View Messages",
                    "Write Messages",
                    ( getgmlevel() < .GMLevel )?"":"^FF0000[ GM ]^000000 Manage Messages" )){
    
    Case 1:
        do{
            mes "What types of Messages you would like to View ?";
            for( set .@i,0; .@i < 3; set .@i,.@i + 1 )
                set .@Found[.@i],query_sql("SELECT `ID` FROM `E-Inquiry` WHERE `Status` = "+.@i+" AND `Sender_ID`='"+getcharid(3)+"'",.@ID );
    
            set .@Msg,select("^FF0000Un-Replied Messanges [ ^FF0000"+.@Found[0]+"^000000 ]",
                            "^0000FFReplied Messages^000000 [ ^FF0000"+.@Found[1]+"^000000 ]",
                            "Archieved Messages [ ^FF0000"+.@Found[2]+"^000000 ]" ) - 1;
            set .@Replied,query_sql(" SELECT `ID`,`Title`,`Message`,`Inquiry_Time`,`Reply`,`Reply_Time`,`Reply_Name` FROM `E-Inquiry` WHERE `Status`= "+.@Msg+" AND `Sender_ID`='"+getcharid(3)+"' ",.@ID, .@Title$,.@Message$,.@Time$,.@Reply$,.@ReplyTime$,.@ReplyName$ );
            if( !.@Replied ){
                mes "You didnt have Messages to read.";
                next;
            }else{
                set .@Menu$,"";
                for( set .@i,0; .@i < .@Replied; set .@i,.@i + 1 )
                    set .@Menu$,.@Menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+.@Title$[.@i]+":";
                next;
                set .@Select,select( .@Menu$ ) - 1;
                mes "^00FF00____________________________^000000";
                mes "^FF0000Date :^000000 : "+.@Time$[.@Select];
                mes "^FF0000Title^000000 : "+.@Title$[.@Select];
                mes "^00FF00____________________________^000000";
                mes "^FF0000Messages^000000 : "+.@Message$[.@Select];
                mes "^00FF00____________________________^000000";
                if( .@Msg > 0 ){
                    mes "^0000FFReply from ^FF0000"+.@ReplyName$[.@Select]+" ^000000 : "+.@Reply$[.@Select];
                    mes "^00FF00____________________________^000000";
                    mes "^0000FFTime ^000000 : "+.@ReplyTime$[.@Select];
                }
                next;
                set .@MsgOpt1,select("View Other Messages",( .@Msg == 1 )?"Move to Archieve":"","Delete Message" );
                switch( .@MsgOpt1 ){
                    Case 2:
                        query_sql("UPDATE `E-Inquiry` SET `Status` = 2 WHERE `ID` = "+.@ID[.@Select]+" ");
                        mes "Message has been moved to Archieve.";
                        break;
                    Case 3:
                        query_sql("DELETE FROM `E-Inquiry` WHERE `ID` = "+.@ID[.@Select]+" ");
                        mes "Message has been DELETED.";
                        break;
                    default:
                        break;
                }
            }
        }while( .@MsgOpt1 < 3 );
        break;
    
    Case 2:
        mes "^00FF00____________________________^000000";
        mes "^FF0000NOTES :^000000 All the Messages will be recorded for future references, so please do not abuse this. Otherwise action will be taken on you";
        do{
            next;
            mes "^00FF00____________________________^000000";
            mes "^FF0000Title^000000 : "+.@Title$;
            mes "^00FF00____________________________^000000";
            mes "^FF0000Messages^000000 : "+.@Message$;
            mes "^00FF00____________________________^000000";
        
            next;
            set .@Select,select(( .@Title$ == "" )?"[ ^FF0000Incomplete^000000 ] Title":"[ ^0000FFCompleted^000000 ] Title",
                                ( .@Message$ == "" )?"[ ^FF0000Incomplete^000000 ] Message":"[^0000FFCompleted^000000 ] Title",
                                ( .@Title$ == "" || .@Message$ == "" )?"":"^FF0000SEND MESSAGE^000000" );
        
            switch( .@Select ){
                Case 1:
                    mes "Enter a Title for your Problems";
                    input .@Title$;
                    break;
                Case 2:
                    mes "Briefly explain what's your Problem";
                    set .@i,0;
                    do{
                        input getd(".@Message"+.@i+"$");
                        set .@Message$,.@Message$ + getd(".@Message"+.@i+"$")+" ";
                        set .@Continue,select("Complete:Continue Messages");
                    }while( .@Continue == 2 );
                    break;
                default:
                    mes "Your message has been sent.";
                    query_sql( "INSERT INTO `E-Inquiry` ( `Sender_ID`,`Sender_Name`,`Title`,`Message`,`Status`,`Inquiry_Time` ) VALUES ( "+getcharid(3)+",'"+escape_sql(strcharinfo(0))+"','"+escape_sql(.@Title$)+"','"+escape_sql(.@Message$)+"',0,'"+gettimestr("%Y-%m-%d %H:%M:%S",21)+"' ) ");
                    break;
            }
        }while( .@Select != 3 );
        break;
        
    Case 3:
        do{
        mes "Alright, what next ?";
        next;
        for( set .@i,0; .@i < 3; set .@i,.@i + 1 )
            set .@Found[.@i],query_sql("SELECT `ID` FROM `E-Inquiry` WHERE `Status` = "+.@i+"",.@ID );
    
        set .@Types,select("^FF0000View All Unread Messanges [ ^FF0000"+.@Found[0]+"^000000 ]",
                            "View All Replied Messages^000000 [ ^FF0000"+.@Found[1]+"^000000 ]",
                            "View All Archieved Messages [ ^FF0000"+.@Found[2]+"^000000 ]" ) - 1;
    
        set .@ManageMSG,query_sql(" SELECT `ID`,`Sender_Name`,`Title`,`Message`,`Inquiry_Time`,`Reply`,`Reply_Time`,`Reply_Name` FROM `E-Inquiry` WHERE `Status`= "+.@Types+" LIMIT 127",.@ID,.@Sender$, .@Title$,.@Message$,.@Time$,.@Reply$,.@ReplyTime$,.@ReplyName$ );
            if( !.@ManageMSG ){
                mes "You didnt have Messages to read.";
                next;
            }else{
                set .@Menu$,"";
                    for( set .@i,0; .@i < .@ManageMSG; set .@i,.@i + 1 )
                    set .@Menu$,.@Menu$ +"^FF0000[ "+( .@i+1 )+". ]^0000FF "+.@Title$[.@i]+":";
                next;
                set .@Select,select( .@Menu$ ) - 1;
                mes "^00FF00____________________________^000000";
                mes "^FF0000Date :^000000 : "+.@Time$[.@Select];
                mes "^FF0000Aurthor :^000000 : "+.@Sender$[.@Select];
                mes "^FF0000Title^000000 : "+.@Title$[.@Select];
                mes "^00FF00____________________________^000000";
                mes "^FF0000Messages^000000 : "+.@Message$[.@Select];
                mes "^00FF00____________________________^000000";
                if( .@Types > 0 ){
                    mes "^0000FFReply from ^FF0000"+.@ReplyName$[.@Select]+" ^000000 : "+.@Reply$[.@Select];
                    mes "^00FF00____________________________^000000";
                    mes "^0000FFTIme ^000000 : "+.@ReplyTime$[.@Select];
                }
                next;
                set .@MsgOpt1,select( ( .@Types == 2 )?"":"Reply Message","View Other Messages","Delete Message" );
                switch( .@MsgOpt1 ){
                    Case 1:
                        set .@i,0;
                        do{
                            input getd(".@Reply"+.@i+"$");
                            set .@Reply$,.@Reply$ + getd(".@Reply"+.@i+"$")+" ";
                            set .@Continue,select("Complete:Continue Messages");
                        }while( .@Continue == 2 );
                        
                        query_sql("UPDATE `E-Inquiry` SET `Status` = 1,`Reply`='"+escape_sql(.@Reply$)+"',`Reply_Name`='"+escape_sql(strcharinfo(0))+"',`Reply_Time`='"+gettimestr("%Y-%m-%d %H:%M:%S",21)+"' WHERE `ID` = "+.@ID[.@Select]+" ");    
                        message strcharinfo(0),"Reply has been sent.";
                        break;
                    Case 3:
                        query_sql("DELETE FROM `E-Inquiry` WHERE `ID` = "+.@ID[.@Select]+" ");
                        mes "Message has been Deleted.";
                    default:
                        break;
                }
            }
        }while( .@MsgOpt1 != 1 );
        break;
    }
    close;
    
    OnInit:
    // Min. GM Level to Read / Manage Messages.
    set .GMLevel,80;
    end;
    
    OnPCLoginEvent:
    if( getgmlevel() < .GMLevel ){
        set .@Replied,query_sql("SELECT `ID` FROM `E-Inquiry` WHERE `Status` = 1 AND `Sender_ID`='"+getcharid(3)+"'",.@ID );
        if( .@Replied )
            message strcharinfo(0),"You have "+.@Replied+" Replied Messages from GM Team.";
    }else{
        set .@Unread,query_sql("SELECT `ID` FROM `E-Inquiry` WHERE `Status` = 0 ",.@ID );
        if( .@Unread )
            message strcharinfo(0),"GM Team received "+.@Unread+" New Message from Players.";
    }
    if( .@Replied || .@Unread ){
        if( select("Read the Messages:Cancel") == 2 ) close;
            goto OnStartMenu;
    }
    end;
    
    }
    
    // Main NPC
    prontera,171,182,5    script    E-Inquiry#Main    757,{
        doevent "E-Inquiry::OnStartMenu";
    }
        
    // Duplicates NPC
    // prontera,155,181,5    duplicate(E-Inquiry#Main)    E-Inquiry#1    757
    // prontera,155,182,5    duplicate(E-Inquiry#Main)    E-Inquiry#2    757
    // prontera,155,183,5    duplicate(E-Inquiry#Main)    E-Inquiry#3    757

     

     

    Yup it should work. Just keep in mind you'll need to add the NPC Constant instead of the ID and change -1 to FAKE_NPC especially since our recent update: http://herc.ws/board/topic/11703-2015-12-31-fake-npc-and-the-npc-view-id-1/?p=68705

    sir still not working i change -1 to FAKE_NPC


  11. got error in this

        // remember the card id to insert
        nameid = sd->status.inventory[idx_card].nameid;
        int csc;//add this declaration
        
        for(i=0;i<sd->inventory_data[idx_equip]->slot;i++){        if(nameid == sd->status.inventory[idx_equip].card)            csc++;    }    if(csc>=4)        return 0;
     

×
×
  • Create New...

Important Information

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