Jump to content

xeijvro

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by xeijvro

  1. 34 minutes ago, Chaos92 said:

    ive changed some codes, the result should be like this

    image.png.cfc28d78ba3e0094084afaa33851bbf3.png

    //===== rAthena Script =======================================
    //= Gold PC Bonus NPC
    //===== Description: =========================================
    //= NPC that can be spawned via the Gold PC Timer Button.
    //===== Changelog: ===========================================
    //= 1.0 Initial release [Lemongrass]
    //= 1.1 Replay version [eppc0330]
    //= 1.2 Translation of the replay version [Lemongrass]
    //= 1.3 Cleanup of NPC logic [Lemongrass]
    //= 1.4 Added replay version of buff NPC [eppc0330]
    //============================================================
    
    prontera,155,168,3	script	Goldpoint Manager::GOLDPCCAFE	4_F_02,{
        // ID:AMOUNT:PRICE
        setarray .items$[1],
            "14003:5:3", // World_Tour_Ticket 1
            "13607:1:15",  // K_Secret_Key 1
            "23919:11:100",// K_Secret_Key 11
            "23919:33:300";// K_Secret_Key 33
    
        mes "[Goldpoint Manager]";
        mes "You currently have ^0000ff"+Goldpc_Points+"^000000 points.";
        mes "What reward do you want?";
        next;
    
        .@menu$ = "View current points";
    
        for(.@i = 1; .@i < getarraysize(.items$); .@i++) {
            explode(.@array$, .items$[.@i], ":");
            .@itemid = atoi(.@array$[0]);
            .@cost = atoi(.@array$[2]);
            .@menu$ += ":" + getitemname(.@itemid) + " (" + .@cost + " points)";
            if( Goldpc_Points < .@cost ){
                .@menu$ += " ^ff0000(not enough points)^000000";
            }
        }
    
        .@s = select(.@menu$)-1;
    
        if(.@s == 0) {
            mes "[Goldpoint Manager]";
            mes "You currently have ^0000ff"+Goldpc_Points+"^000000 points.";
            close;
        }
    
        explode(.@array$, .items$[.@s], ":");
        .@itemid = atoi(.@array$[0]);
        .@amount = atoi(.@array$[1]);
        .@cost = atoi(.@array$[2]);
    
        if(Goldpc_Points < .@cost) {
            mes "[Goldpoint Manager]";
            mes "You have ^0000ff"+Goldpc_Points+"^000000 points remaining.";
            mes "You cannot get the prize with this amount of points.";
            close;
        }
    
        mes "[Goldpoint Manager]";
        mes "You chose the "+.@cost+" points gift. We will reward you immediately.";
        Goldpc_Points -= .@cost;
        getitem .@itemid,.@amount;
        mes "You have ^0000ff"+Goldpc_Points+"^000000 points remaining.";
        close;
    }

     

    Works like a charm thanks! 

  2. 8 minutes ago, Chaos92 said:

    didnt show your script ? should have option there.

    //===== rAthena Script =======================================
    //= Gold PC Bonus NPC
    //===== Description: =========================================
    //= NPC that can be spawned via the Gold PC Timer Button.
    //===== Changelog: ===========================================
    //= 1.0 Initial release [Lemongrass]
    //= 1.1 Replay version [eppc0330]
    //= 1.2 Translation of the replay version [Lemongrass]
    //= 1.3 Cleanup of NPC logic [Lemongrass]
    //= 1.4 Added replay version of buff NPC [eppc0330]
    //============================================================

    prontera,0,0,0    script    Goldpoint Manager::GOLDPCCAFE    4_F_02,{
        // ID:AMOUNT:PRICE
        setarray .items$[1],
            "14003:5:3", // World_Tour_Ticket 1
            "13607:1:15",  // K_Secret_Key 1
            "23919:11:100",// K_Secret_Key 11
            "23919:33:300";// K_Secret_Key 33

        mes "[Goldpoint Manager]";
        mes "You currently have ^0000ff"+Goldpc_Points+"^000000 points.";
        mes "What reward do you want?";
        next;

        .@menu$ = "View current points";

        for(.@i = 1; .@i < getarraysize(.items$); .@i++) {
            explode(.@array$, .items$[.@i], ":");
            .@cost = atoi(.@array$[2]);
            .@menu$ += ":" + .@cost + " points gift";
            if( Goldpc_Points < .@cost ){
                .@menu$ += " ^ff0000(not enough points)^000000";
            }
        }

        .@s = select(.@menu$)-1;

        if(.@s == 0) {
            mes "[Goldpoint Manager]";
            mes "You currently have ^0000ff"+Goldpc_Points+"^000000 points.";
            close;
        }

        explode(.@array$, .items$[.@s], ":");
        .@itemid = atoi(.@array$[0]);
        .@amount = atoi(.@array$[1]);
        .@cost = atoi(.@array$[2]);

        if(Goldpc_Points < .@cost) {
            mes "[Goldpoint Manager]";
            mes "You have ^0000ff"+Goldpc_Points+"^000000 points remaining.";
            mes "You cannot get the prize with this amount of points.";
            close;
        }

        mes "[Goldpoint Manager]";
        mes "You chose the "+.@cost+" points gift. We will reward you immediately.";
        Goldpc_Points -= .@cost;
        getitem .@itemid,.@amount;
        mes "You have ^0000ff"+Goldpc_Points+"^000000 points remaining.";
        close;
    }

  3. Here is the script i am using

     

     

    //===== rAthena Script =======================================
    //= Gold PC Bonus NPC
    //===== Description: =========================================
    //= NPC that can be spawned via the Gold PC Timer Button.
    //===== Changelog: ===========================================
    //= 1.0 Initial release [Lemongrass]
    //= 1.1 Replay version [eppc0330]
    //= 1.2 Translation of the replay version [Lemongrass]
    //= 1.3 Cleanup of NPC logic [Lemongrass]
    //= 1.4 Added replay version of buff NPC [eppc0330]
    //============================================================

    prontera,0,0,0    script    Goldpoint Manager::GOLDPCCAFE    4_F_02,{
        // ID:AMOUNT:PRICE
        setarray .items$[1],
            "14003:5:3", // World_Tour_Ticket 1
            "13607:1:15",  // K_Secret_Key 1
            "23919:11:100",// K_Secret_Key 11
            "23919:33:300";// K_Secret_Key 33

        mes "[Goldpoint Manager]";
        mes "You currently have ^0000ff"+Goldpc_Points+"^000000 points.";
        mes "What reward do you want?";
        next;

        .@menu$ = "View current points";

        for(.@i = 1; .@i < getarraysize(.items$); .@i++) {
            explode(.@array$, .items$[.@i], ":");
            .@cost = atoi(.@array$[2]);
            .@menu$ += ":" + .@cost + " points gift";
            if( Goldpc_Points < .@cost ){
                .@menu$ += " ^ff0000(not enough points)^000000";
            }
        }

        .@s = select(.@menu$)-1;

        if(.@s == 0) {
            mes "[Goldpoint Manager]";
            mes "You currently have ^0000ff"+Goldpc_Points+"^000000 points.";
            close;
        }

        explode(.@array$, .items$[.@s], ":");
        .@itemid = atoi(.@array$[0]);
        .@amount = atoi(.@array$[1]);
        .@cost = atoi(.@array$[2]);

        if(Goldpc_Points < .@cost) {
            mes "[Goldpoint Manager]";
            mes "You have ^0000ff"+Goldpc_Points+"^000000 points remaining.";
            mes "You cannot get the prize with this amount of points.";
            close;
        }

        mes "[Goldpoint Manager]";
        mes "You chose the "+.@cost+" points gift. We will reward you immediately.";
        Goldpc_Points -= .@cost;
        getitem .@itemid,.@amount;
        mes "You have ^0000ff"+Goldpc_Points+"^000000 points remaining.";
        close;
    }

  4. On 8/7/2023 at 12:01 AM, Winterfox said:

    That is good to hear. I already finished my version of the script I did out of curiosity, the only thing missing is a fitting map. 

    can u share ur script to me? and i'll see if i have a fitting map and share it to u also

     

  5. On 8/27/2023 at 6:19 PM, Harvin said:

    untested, but you can try this.

    prontera,155,155,3	script	TESTSTE	92,{
    	if (.user)
    	{
    		mes rid2name(.user) +" is currently per-using my service, please try again later.";
    		close;
    	}
    	.user = getcharid(3);
    	addtimer 10, strnpcinfo(0) +"::OnReleaseUser";
    	mes "Generating new code for you..";
    	freeloop(true);
    	do
    	{
    		.@new_coupon$ = "";
    		copyarray .@coupon_code$[0], .coupon_code$[0], .coupon_code_size;
    		.@coupons = query_sql("SELECT `transaction_code` FROM `transaction_tbl` WHERE 1", .@coupons$);
    		for (.@i = 0; .@i < .code_length;.@i++)
    		{
    			.@s = getarraysize(.@coupon_code$);
    			.@r = rand(.@s);
    			.@new_coupon$ += .@coupon_code$[.@r];
    			deletearray .@coupon_code$[.@r], 1;
    		}
    		if (.@coupons < 1)
    			break;
    		if (inarray(.@coupons$, .@new_coupon$) == -1)
    			break;
    	} while (1);
    	freeloop(false);
    	clear;
    	query_sql("INSERT INTO `transaction_tbl` (transaction_code) VALUES ('" +  escape_sql(.@new_coupon$) + "')");
    	mes "New Coupon Code: "+ .@new_coupon$;
    	close;
    
    OnPCLogoutEvent:
    	if (.user != getcharid(3))
    		end;
    OnReleaseUser:
    	.user = 0;
    	end;
    
    OnInit:
    	.code_length = 6;
    
    	setarray .coupon_code$[0],
    		"A","B","C","D","E","F","G","H","I","J","K","L",
    		"M","N","O","P","Q","R","S","T","U","V","W","X",
    		"Y","Z","0","1","2","3","4","5","6","7","8","9";
    
    	.coupon_code_size = getarraysize(.coupon_code$);
    	end;
    }

     

    Can i have sa sql file with this?

  6. Sorry if i dont know if im at the right or wrong section of the forum but this is the bug sometimes the gstorage suddenly becomes 0/0 

     

    This bug happened after i enable vip system. i try to disable vip system in core.hpp but there is error shown on recompiling after i put comment on

     /// Uncomment to enable VIP system.

    //#define VIP_ENABLE

     

    Can someone help me ?  Its really frustrating because in able to fix this they need to break guild and create a new guild all bounded items are left in gstorage ?

    bug.png

  7. 15 hours ago, furry said:

    @Zeiyan @BeWan hi  do you have a full script for every class?
    like this this:

    0FFFFFFF = all jobs right?

    i need for 

    Lord Knight =?
    paladin =?

    master smith =?

    creator =?

    sniper =?

    clown =?

    gypsy =?

    high priest =? 

    monk =?

    sinx =?

    stalker = ?

    high wiz =?

    prof =?

     

    thankyou in advance guys!

     

     

     

    (S.) Novice         (2^00): 0x00000001
    Swordman            (2^01): 0x00000002
    Mage                (2^02): 0x00000004
    Archer              (2^03): 0x00000008
    Acolyte             (2^04): 0x00000010
    Merchant            (2^05): 0x00000020
    Thief               (2^06): 0x00000040
    Knight              (2^07): 0x00000080
    Priest              (2^08): 0x00000100
    Wizard              (2^09): 0x00000200
    Blacksmith          (2^10): 0x00000400
    Hunter              (2^11): 0x00000800
    Assassin            (2^12): 0x00001000
    Unused              (2^13): 0x00002000
    Crusader            (2^14): 0x00004000
    Monk                (2^15): 0x00008000
    Sage                (2^16): 0x00010000
    Rogue               (2^17): 0x00020000
    Alchemist           (2^18): 0x00040000
    Bard/Dancer         (2^19): 0x00080000
    Unused              (2^20): 0x00100000
    Taekwon             (2^21): 0x00200000
    StarGladiator       (2^22): 0x00400000
    Soul Linker         (2^23): 0x00800000
    Gunslinger          (2^24): 0x01000000
    Ninja               (2^25): 0x02000000
    Gangsi              (2^26): 0x04000000
    Death Knight        (2^27): 0x08000000
    Dark Collector      (2^28): 0x10000000
    Kagerou/Oboro       (2^29): 0x20000000
    Rebellion           (2^30): 0x40000000
    Some other commonly used values:
    All Classes               : 0xFFFFFFFF
    Every Job Except Novice   : 0xFFFFFFFE
  8. Hello im using this script that i modified. i can hit the treasure and use skills to break it until someone have taken it as its posession

    We cannot hit it and single target skills doesnt work on it. only aoe skills Help to fix this bug ?

    Here is the script 

    function    script    F_ShuffleNumbers    {
        deletearray getarg(2);
        .@static = getarg(0);
        .@range = getarg(1) +1 - .@static;
        .@count = getarg(3, .@range);
        if (.@range <= 0 || .@count <= 0)
            return 0;
        if (.@count > .@range)
            .@count = .@range;
        for (.@i = 0; .@i < .@range; ++.@i)
            .@temparray[.@i] = .@i;
        for (.@i = 0; .@i < .@count; ++.@i) {
            .@rand = rand(.@range);
            set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static;
            .@temparray[.@rand] = .@temparray[--.@range];
        }
        return .@count;
    }
    
    que_moon,165,38,0    script    Treasure Defense    1902,{
        .@name$ = strcharinfo(0);
        .@minplayer2start = getvariableofnpc(.minplayer2start, "fortress#bg"); 
        .@start = getvariableofnpc(.start, "fortress#bg"); 
        if(.@start == 1) {
            mes "Sorry, event is on-going.";
            close;
        }
        mes "Do you want to join the queue?";
        next;
        while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i;
        if ( .@i < .size ) {
            mes "You already join the queue.";
            close;
        }
        select "join";
        mes "you have to stay to this map to be qualified";
        close2;
        .aid[ .size++ ] = getcharid(3);
        for ( .@i = 0; .@i < .size; ++.@i ) {
            if ( !isloggedin( .aid[.@i] ) ) {
                deletearray .aid[.@i], 1;
                --.@i;
                --.size;
            }
            else {
                attachrid .aid[.@i];
                if ( strcharinfo(3) != strnpcinfo(4) ) {
                    deletearray .aid[.@i], 1;
                    --.@i;
                    --.size;
                }
            }
        }
        detachrid;
        if ( .size == .@minplayer2start * 2 ) {
            copyarray getvariableofnpc( .aid_, "fortress#bg" ), .aid, .size;
            donpcevent "fortress#bg::OnStart";
            deletearray .aid;
            .size = 0;
        }
        else
            announce .@name$ +" has  joined Treasure Defense needs "+ .size +"/"+ .@minplayer2start * 2 +" to start.", bc_npc | bc_area;
        end;
    
    }
    
    bat_c01,0,0,0    script    fortress#bg    100,{
    OnInit:
        // =============
        // Game Settings
        // =============
        
        // Minimum players per team to start
        // default : 5 ( 5v5 )
        .minplayer2start = 2;
        
        // Event duration in minutes..
        // default : 5 mins
        .duration = 5; 
        
        // Reward settings
        setarray .rwd[0],
            682, 5,    // win team reward
            7227, 15;        // lose team reward
        
        end;
        
    OnStart:
        .start = 1;
        .red = bg_create ( strnpcinfo(4), 58, 123, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDie" );
        .blue =  bg_create ( strnpcinfo(4), 141, 60, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDie" ); 
        callfunc "F_ShuffleNumbers", 0, .minplayer2start *2 -1, .@r;
        for ( .@i = 0; .@i < .minplayer2start * 2; ++.@i ) {
            attachrid .aid_[.@r[.@i]];
            bg_join ( .@i % 2 )? .red : .blue;
        }
        detachrid;
        sleep 1000;
        announce "announce game mechanics", bc_npc | bc_map | bc_blue;
        sleep 1000;
        announce "Longest Defense on their tresure will be the Winner", bc_npc | bc_map | bc_blue;
        sleep 1000;
        announce "Start battle!", bc_npc | bc_map | bc_blue;
        
        bg_monster 0, "bat_c01", 99, 92, "Main Treasure", 1902, strnpcinfo(3)+"::OnEmpDown";
        
        sleep .duration * 60000;
        
            
        if(.owner)
            callsub L_reward, (.owner == .red) ? .red : .blue, (.owner == .red) ? .blue : .red, (.owner == .red) ? "Red" : "Blue";
        else
            announce "Battle ended up with a tie!", bc_npc | bc_map | bc_blue;
        .owner = .start = 0;
        bg_destroy .red;
        bg_destroy .blue;
        mapwarp strnpcinfo(4),"prontera",150,180,0;
        end;
        
    L_reward:
        announce getarg(2) +" team has won!", bc_npc | bc_map | bc_blue;
        bg_get_data getarg(0), 1;
        for ( .@i = 0; .@i < $@arenamemberscount; ++.@i )
            getitem .rwd[0],.rwd[1], $@arenamembers[.@i];
        sleep 1;
        bg_get_data getarg(1), 1;
        for ( .@i = 0; .@i < $@arenamemberscount; ++.@i )
            getitem .rwd[2],.rwd[3], $@arenamembers[.@i];
        return;
        
    OnEmpDown:
        .owner = getcharid(4);
        announce ((getcharid(4) == .red) ? "Red": "Blue") +" team has gained control over the Main Treasure!", bc_npc | bc_map | bc_blue;
        bg_warp .red, strnpcinfo(4), 58, 123;
        bg_warp .blue, strnpcinfo(4), 141, 60;
        bg_monster .owner, "bat_c01", 99, 92, "Main Tresure", (getcharid(4) == .red) ? 1902 : 1903, strnpcinfo(3)+"::OnEmpDown";
        setnpcdisplay("#mainfort", "Main Tresure", (getcharid(4) == .red) ? 1902 : 1903 );
        end;
        
        
    OnRedQuit: callsub L_Quit, .red, "Red";
    OnBlueQuit: callsub L_Quit, .blue, "Blue";
    L_Quit:
        if ( bg_get_data( getarg(0), 0 ) ) end;
        announce "All "+ getarg(2) +" team members has Quit!", bc_npc | bc_map | bc_blue;
        sleep 1000;
        callsub L_reward, ( getarg(0) == .red ) ? .red : .blue, ( getarg(0) == .red ) ? .blue : .red, ( getarg(0) == .red ) ? "Red" : "Blue";
        awake instance_npcname( strnpcinfo(0) );
        end;
    
    OnRedDie:
    OnBlueDie:
        sleep2 1250;
        percentheal 100, 100;
        end;
    
    }
    
    bat_c01,99,92,0    script    #mainfort    -1,5,5,{
    end;
    OnTouch:
        getmapxy(.@mapname$, .@mapx, .@mapy, BL_NPC, strnpcinfo(3));
        setarray .@n_mapx[0], .@mapx-5, .@mapx+5;
        setarray .@n_mapy[0], .@mapy-5, .@mapy+5;
        
        @ontouch = 1;
        .@owner = getvariableofnpc( .owner, "fortress#bg" );
        
        while ( @ontouch && strcharinfo(3) == strnpcinfo(4) ) {
        if( .@owner != getcharid(4) ) {
            if ( Hp > 1 )
                percentheal -10, 0;
            else
                percentheal -100, 0;
            specialeffect2 49;
        } 
        else if ( .@owner == getcharid(4) ) {
            if ( Hp != MaxHP ) 
                specialeffect2 EF_HEAL;
            percentheal 10, 10;        
        }          
        sleep2 1000;
            getmapxy(@mapname$, @mapx, @mapy, BL_PC);
            if ( @mapx < .@n_mapx[0] || @mapx > .@n_mapx[1] || @mapy < .@n_mapy[0] || @mapy > .@n_mapy[1]) {
                @ontouch = 0;
            }
        }
        end;    
    }
    
    bat_c01,55,126,0    script    #redminifort    1915,5,5,{
    end;
    OnTouch:
        getmapxy(.@mapname$, .@mapx, .@mapy, BL_NPC, strnpcinfo(3));
        setarray .@n_mapx[0], .@mapx-5, .@mapx+5;
        setarray .@n_mapy[0], .@mapy-5, .@mapy+5;
        
        .@owner = getvariableofnpc( .red, "fortress#bg" );
        @ontouch = 1;
        
        while ( @ontouch && strcharinfo(3) == strnpcinfo(4) ) {
        if ( .@owner != getcharid(4) ) {
            if ( Hp > 10 )
                percentheal rand(-20,-40), 0;
            else
                percentheal -100, 0;
            specialeffect2 49;
        } else {
            if( HP != MaxHP )
                specialeffect2 EF_HEAL;
            percentheal 10, 10;
        }
        sleep2 1000;
            getmapxy(@mapname$, @mapx, @mapy, BL_PC);
            if ( @mapx < .@n_mapx[0] || @mapx > .@n_mapx[1] || @mapy < .@n_mapy[0] || @mapy > .@n_mapy[1]) {
                @ontouch = 0;
            }
        }
        end;    
    }
    
    bat_c01,144,57,0    script    #blueminifort    1914,5,5,{
    end;
    OnTouch:
        getmapxy(.@mapname$, .@mapx, .@mapy, BL_NPC, strnpcinfo(3));
        setarray .@n_mapx[0], .@mapx-5, .@mapx+5;
        setarray .@n_mapy[0], .@mapy-5, .@mapy+5;
        
        .@owner = getvariableofnpc( .blue, "fortress#bg" );
        @ontouch = 1;
        
        while ( @ontouch && strcharinfo(3) == strnpcinfo(4) ) {
        if ( .@owner != getcharid(4) ) {
            if ( Hp > 10 )
                percentheal rand(-20,-40), 0;
            else
                percentheal -100, 0;
            specialeffect2 49;
        } else {
            if( HP != MaxHP )
                specialeffect2 EF_HEAL;
            percentheal 10, 10;
        }
        sleep2 1000;
            getmapxy(@mapname$, @mapx, @mapy, BL_PC);
            if ( @mapx < .@n_mapx[0] || @mapx > .@n_mapx[1] || @mapy < .@n_mapy[0] || @mapy > .@n_mapy[1]) {
                @ontouch = 0;
            }
        }
        end;    
    }
    
    bat_c01    mapflag    battleground
    bat_c01    mapflag    nosave    SavePoint
    bat_c01    mapflag    nowarp
    bat_c01    mapflag    nowarpto
    bat_c01    mapflag    noteleport
    bat_c01    mapflag    nomemo
    bat_c01    mapflag    nopenalty
    bat_c01    mapflag    nobranch
    bat_c01    mapflag    noicewall
  9. Hello im using @claim and @code command this is the script. I want is to be able to just use by 1 IP because it can claim again and again 1 code for all players and just 1 per IP

     

    Here is the script 

     

     

    -    script    promoclaim    -1,{


    OnInit:
        bindatcmd "claim",strnpcinfo(3)+"::OnClaim";
        bindatcmd "code",strnpcinfo(3)+"::OnEditCode";
        end;
        
    OnClaim:
        // if ( getgmlevel() ) end;
        mes "^FF0000 Enter the Promo Code.";
        input .@pc$;
        close2;
        
        query_sql "SELECT `nameid`, `amount` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pc$) + "'", .@item, .@amt;
        
        if ( !.@item ) 
            dispbottom "Either invalid code or the code is already Expired";
        else {
            getitem .@item, .@amt;
            dispbottom "Promotional code successfully redeemed.";
            //query_sql "DELETE FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pc$) + "'";
            query_logsql "INSERT INTO `rewardlogs` VALUES ( '" + getcharid(3) + "', '" + escape_sql(.@pc$) + "', NOW() )";
        }
        
        end;
        
    OnEditCode:
        if ( getgmlevel() < 99 ) end;
        set .@choice$, "Setup a new promotional code:View existing codes:Delete exisiting codes:Cancel";
        setarray .@length, 4,10; // <min>,<max>
        
        switch ( select( .@choice$ ) ) {
            case 1:
                    input .@pcode$;
                    if ( getstrlen( .@pcode$ ) < .@length[0] || getstrlen( .@pcode$ ) > .@length[1] ) {
                            dispbottom "Codes must not be less than " +.@length[0]+ " and must be greater than " +.@length[1]+ ".";
                            end;
                    }
                    mes "You have entered ^FF0000"+.@pcode$+"^000000 as the code.";
                    mes "Are you sure?";
                    if ( select("Yes:No, thanks") - 1 ) end;
                    query_sql "SELECT `code` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pcode$) + "'", .@pcode_exists;
                    if ( .@pcode_exists ) {
                            dispbottom "Sorry, that code already exist.";
                            end;
                    }
                    mes "Please set a reward for the players who has entered the code.";
                    input .@reward;
                    next;
                    if ( !.@reward || getitemname(.@reward) == "null" ) {
                            dispbottom "Sorry, that is an invalid item id.";
                            end;
                    }
                    set .@iname$, getitemname(.@reward);
                    mes "Item number ^FF0000"+.@reward+"^000000";
                    mes "is equivalent to ^FF0000"+.@iname$+"^000000.";
                    mes "Are you sure?";
                    next;
                    if ( select("Yes:No, thanks") - 1 ) end;
                    mes "How many ^FF0000"+.@iname$+"^000000.?";
                    input .@amount;
                    next;
                    if ( !.@amount ) {
                        dispbottom "Sorry, that is an invalid amount number.";
                        end;
                    }
                    mes "Are you sure?";
                    next;
                    if ( select("Yes:No, thanks") - 1 ) end;
                    query_sql "INSERT INTO `reward_codes` VALUES ( '" + escape_sql(.@pcode$) + "', '" + .@reward + "', '" + escape_sql(.@iname$) + "', '" + .@amount + "', NOW() )";
                    dispbottom "Done creating code!";
                    break;
            case 2:
                    set .@nb, query_sql("SELECT code, item_name, amount FROM `reward_codes` ORDER BY time_created DESC LIMIT 20", .@code$, .@nid$, .@amount);    
                    if ( !.@nb ) {
                        dispbottom "No exisiting codes.";
                        end;
                    }
                    dispbottom "=============================================";
                    dispbottom "==============  EXISITING CODES  ==============";
                    dispbottom "=============================================";
                    for(set .@i,0; .@i < .@nb; set .@i,.@i+1)
                    dispbottom ""+.@code$[.@i]+" (  Reward: "+.@amount[.@i]+" "+.@nid$[.@i]+" ) ";
                    dispbottom "=============================================";
                    break;
            case 3:
                    input .@dcode$;
                    query_sql "SELECT `code` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@dcode$) + "'", .@dcode_exists;
                    if ( !.@dcode_exists ) {
                        dispbottom "Promotional code not found.";
                        end;
                    }
                    mes "Would you like to delete that code?";
                    next;
                    if ( select("Yes:No, thanks") - 1 ) end;
                    query_sql "DELETE FROM `reward_codes` WHERE `code` = '" + escape_sql(.@dcode$) + "'";
                    break;
            case 4: close; break;
            default: break;
        }
        end;
    }
     

  10. script you can set if its 3v3 5v5 7v7 random team Blue team and Red team Battleground effect but you need to randomize the players to be putted if it is in red or blue and it is automated every 3hours and the event should be race to 3 points or can be edited according to our preferences and to have a point the other team must be wiped out

    If vip player receive more rewards

    If normal player receive default rewards

     if the player dies until its last member they will respawn in the side of the map. the map is bat_c01 and and with barricade in each corner automatic to drop after 10 seconds when the event start. all outside buffs must be removed / debuff

×
×
  • Create New...