Jump to content

kronobr

Members
  • Posts

    71
  • Joined

  • Last visited

Posts posted by kronobr

  1. On 4/12/2020 at 3:21 AM, Patskie said:

    Add below item script on all of your "eating items" 

    
    501,Red_Potion,Red Potion,0,10,,70,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 100,100; HUNGERPOINTS += 8; if (getstatus(SC_SLOWDOWN)) {sc_end SC_SLOWDOWN;} },{},{}

    Then use below script. It will reduce hunger points every 15 minutes. So 8 hunger points from the pots means 2 hours.

    
    -	script	HungerGames	-1,{
    	OnMinute15:
    	OnMinute30:
    	OnMinute45:
    	OnMinute60:
    		addrid(0);
    		if (!HUNGERPOINTS) {
    			sc_start SC_SLOWDOWN, INFINITE_TICK, 100, 10000, SCSTART_NOAVOID;
    			Hp = 1;
                Sp = 0;
    		} else {
    			HUNGERPOINTS--;
    			dispbottom "Your hunger points have been reduced. Hunger points total : " + HUNGERPOINTS;
    		}
    		end;
    }

     

    @Patskie A little help? is working 100% but I would like to have a maximum hungerpoint limit. Thanks

  2. //===== rAthena Script =======================================
    //= saders hunting quest
    //===== By: ==================================================
    //= Sader1992
    //https://rathena.org/board/profile/30766-sader1992/
    //===== Current Version: =====================================
    //= 4.2
    //===== Compatible With: ===================================== 
    //= rAthena Project
    //https://rathena.org/board/files/file/3579-saders-hunting-quest/
    //https://github.com/sader1992/sader_scripts
    //===== Description: =========================================
    //============================================================
    //============================================================
    prontera,158,187,4	script	Trabalhos Simples	667,{
    	if(.accharlimit ==0){.@time_needed = #s_timeq - gettimetick(2);}else{.@time_needed = s_timeq - gettimetick(2);}
    	if(.@time_needed > 0 && sader_quest == 0) {
    		mes "You can only do the quest once every "+.s_timeqf+" hours.";
    		.@hours   = .@time_needed / 60 / 60;
    		.@minutes = (.@time_needed % (60 * 60)) / 60;
    		.@seconds = .@time_needed % 60;
    		mes "Please come back in " + sprintf("%02d:%02d:%02d", .@hours, .@minutes, .@seconds) + " hours." ;
    		//next;
    		if(.shopEnabled !=0){
    			switch(select(""+"shop"+":"+"close"+"")){
    						Case 1: callsub Q_shop;
    						Case 2: close;
    					}
    		}else{
    			close;
    		}
    		close;
    	}else{
    	if(!sader_quest){set sader_quest,0;}
    	if(sader_quest != 0 ){ callsub have_sq;}
    	if(sader_quest == 0 && quest_done == 0){ callsub need_sq;}
    	if(quest_done != 0){callsub done_sq;}
    	}
    Q_easy:
    	if (BaseLevel < .qs_elevel[0] || BaseLevel > .qs_elevel[1]){
    		mes "Your level is too low or too high.";
    		mes "   ";
    		mes "Minimum level "+.qs_elevel[0]+".";
    		mes "Maximum level "+.qs_elevel[1]+".";
    		close;
    	}
    	mes " plz kill "+ easycmon +" from " + strmobinfo( 1,easymon) +".";
    	set sader_quest,1;
    	set monster_count,0;
    	close;
    end;		
    Q_normal:
    	if (BaseLevel < .qs_nlevel[0] || BaseLevel > .qs_nlevel[1]){
    		mes "Your level is too low or too high.";
    		mes "   ";
    		mes "Minimum level "+.qs_nlevel[0]+".";
    		mes "Maximum level "+.qs_nlevel[1]+".";
    		close;
    	}
    	mes " plz kill "+ normalcmon +" from " + strmobinfo( 1,normalmon) +".";
    	set sader_quest,2;
    	set monster_count,0;
    	close;
    end;
    Q_hard:
    	if (BaseLevel < .qs_hlevel[0] || BaseLevel > .qs_hlevel[1]){
    		mes "Your level is too low or too high.";
    		mes "   ";
    		mes "Minimum level "+.qs_hlevel[0]+".";
    		mes "Maximum level "+.qs_hlevel[1]+".";
    		close;
    	}
    	mes " plz kill "+ hardcmon +" from " + strmobinfo( 1,hardmon) +".";
    	set sader_quest,3;
    	set monster_count,0;
    	close;
    end;
    Q_indeterminate:
    	if (BaseLevel < .qs_ilevel[0] || BaseLevel > .qs_ilevel[1]){
    		mes "Your level is too low or too high.";
    		mes "   ";
    		mes "Minimum level "+.qs_ilevel[0]+".";
    		mes "Maximum level "+.qs_ilevel[1]+".";
    		close;
    	}
    	mes " plz kill "+ indeterminatecmon +" from " + strmobinfo( 1,indeterminatemon) +".";
    	set sader_quest,4;
    	set monster_count,0;
    	close;
    end;
    Q_shop:
    	mes "You have ^00F9FF" + #SdM_PQ + "^000000 sader quest points.";
    	callshop "sader q s",1;
    end;
    OnNPCKillEvent:
    if(sader_quest != 0){
    	if( killedrid == easymon ){
    		if(monster_count < easycmon){
    			monster_count++;
    			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,easymon) +".";
    			if(monster_count >= easycmon){
    				dispbottom "Your quest is done";
    				set quest_done,1;
    				set sader_quest,0;
    				if(.complete_without_npc == 1){
    					set quest_done,0;
    					set #SdM_PQ,#SdM_PQ + .easy_points;
    					callsub sader_q_eitem;
    				}
    			}
    		}
    	}else if( killedrid == normalmon ){
    		if(monster_count < normalcmon){
    			monster_count++;
    			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,normalmon) +".";
    			if(monster_count >= normalcmon){
    				dispbottom "Your quest is done";
    				set quest_done,2;
    				set sader_quest,0;
    				if(.complete_without_npc == 1){
    					set quest_done,0;
    					set #SdM_PQ,#SdM_PQ + .normal_points;
    					callsub sader_q_nitem;
    				}
    			}
    		}
    	}else if( killedrid == hardmon ){
    		if(monster_count < hardcmon){
    			monster_count++;
    			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,hardmon) +".";
    			if(monster_count >= hardcmon){
    				dispbottom "Your quest is done";
    				set quest_done,3;
    				set sader_quest,0;
    				if(.complete_without_npc == 1){
    					set quest_done,0;
    					set #SdM_PQ,#SdM_PQ + .hard_points;
    					callsub sader_q_hitem;
    				}
    			}
    		}
    	}else if( killedrid == indeterminatemon ){
    		if(monster_count < indeterminatecmon){
    			monster_count++;
    			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,indeterminatemon) +".";
    			if(monster_count >= indeterminatecmon){
    				dispbottom "Your quest is done";
    				set quest_done,4;
    				set sader_quest,0;
    				if(.complete_without_npc == 1){
    					set quest_done,0;
    					set #SdM_PQ,#SdM_PQ + .indeterminate_points;
    					callsub sader_q_iitem;
    				}
    			}
    		}
    	}
    }
    end;
    have_sq:	
    		mes "hi, how can i hep you ?";
    		if(sader_quest == 1) {mes " plz kill "+ easycmon +" from " + strmobinfo( 1,easymon) +".";
    		mes "you have killed "+monster_count+" "+ strmobinfo( 1,easymon) +".";}
    		if(sader_quest == 2) {mes " plz kill "+ normalcmon +" from " + strmobinfo( 1,normalmon) +".";
    		mes "you have killed "+monster_count+" " + strmobinfo( 1,normalmon) +".";}
    		if(sader_quest == 3) {mes " plz kill "+ hardcmon +" from " + strmobinfo( 1,hardmon) +".";
    		mes "you have killed "+monster_count+" " + strmobinfo( 1,hardmon) +".";}
    		if(sader_quest == 4) {mes " plz kill "+ indeterminatecmon +" from " + strmobinfo( 1,indeterminatemon) +".";
    		mes "you have killed "+monster_count+" " + strmobinfo( 1,indeterminatemon) +".";}
    		next;
    		if(.shopEnabled !=0){
    			switch(select(""+"shop"+":"+"Cansel the Quest"+":"+"close"+"")){
    						Case 1: callsub Q_shop;
    						Case 2:	mes "are you sure ?";
    						switch(select(""+"yes"+":"+"no"+"")){
    							Case 1:
    							mes "AS YOU WISH";
    							set sader_quest,0;
    							if(.accharlimit ==0){#s_timeq = gettimetick(2) + (.s_timeqf * 3600);}else{s_timeq = gettimetick(2) + (.s_timeqf * 3600);}
    							close;
    							Case 2: close;
    						}
    						Case 3: close;
    			}
    		}else{
    			switch(select(""+"Cansel the Quest"+":"+"close"+"")){
    						Case 1: mes "are you sure ?";
    						switch(select(""+"yes"+":"+"no"+"")){
    							Case 1:
    							mes "AS YOU WISH";
    							set sader_quest,0;
    							if(.accharlimit ==0){#s_timeq = gettimetick(2) + (.s_timeqf * 3600);}else{s_timeq = gettimetick(2) + (.s_timeqf * 3600);}
    							close;
    							Case 2: close;
    						}
    						Case 3: close;
    			}
    		}
    end;
    need_sq:
    	easymon = .easy[rand(getarraysize(.easy))];
    	easycmon = .easyc[rand(getarraysize(.easyc))];
    	normalmon = .normal[rand(getarraysize(.normal))];
    	normalcmon = .normalc[rand(getarraysize(.normalc))];
    	hardmon = .hard[rand(getarraysize(.hard))];
    	hardcmon = .hardc[rand(getarraysize(.hardc))];
    	indeterminatemon = .indeterminate[rand(getarraysize(.indeterminate))];
    	indeterminatecmon = .indeterminatec[rand(getarraysize(.indeterminatec))];
    			mes "hello";
    			mes "i will give you a task";
    			mes "to kill some monsters";
    			mes "can you help us ?";
    			next;
    				if(.shopEnabled !=0){
    					switch(select(""+"easy difficulty"+":"+"normal difficulty"+":"+"hard difficulty"+":"+"indeterminate difficulty"+":"+"shop"+":"+"close"+"")){
    						Case 1: callsub Q_easy;
    						Case 2: callsub Q_normal;
    						Case 3: callsub Q_hard;
    						Case 4: callsub Q_indeterminate;
    						Case 5: callsub Q_shop;
    						Case 6: close;
    					}
    				}else{
    					switch(select(""+"easy difficulty"+":"+"normal difficulty"+":"+"hard difficulty"+":"+"indeterminate difficulty"+":"+"close"+"")){
    						Case 1: callsub Q_easy;
    						Case 2: callsub Q_normal;
    						Case 3: callsub Q_hard;
    						Case 4: callsub Q_indeterminate;
    						Case 5: close;
    					}
    				}
    end;
    done_sq:
    	mes "Thank you for helping me .";
    	set monster_count,0;
    	set sader_quest,0;
    	if(.accharlimit ==0){#s_timeq = gettimetick(2) + (.s_timeqf * 3600);}else{s_timeq = gettimetick(2) + (.s_timeqf * 3600);}
    		if(quest_done == 1){set #SdM_PQ,#SdM_PQ + .easy_points; set quest_done,0; callsub sader_q_eitem;}
    		else if(quest_done == 2){set #SdM_PQ,#SdM_PQ + .normal_points; set quest_done,0; callsub sader_q_nitem;}
    		else if(quest_done == 3){set #SdM_PQ,#SdM_PQ + .hard_points; set quest_done,0; callsub sader_q_hitem;}
    		else if(quest_done == 4){set #SdM_PQ,#SdM_PQ + .indeterminate_points; set quest_done,0; callsub sader_q_iitem;}
    	
    	close;
    end;
    sader_q_eitem: //item rewards leave it empty if you don't want it you can add item exp etc
    	//getitem 501,20;//item_id,amount
    //	getexp 1000,1000;//base,job
    	//for easy mode
    end;
    sader_q_nitem: //item rewards leave it empty if you don't want it you can add item exp etc
    	//for normal mode
    //getexp 10000,10000;//base,job
    end;
    sader_q_hitem: //item rewards leave it empty if you don't want it you can add item exp etc
    	//for hard mode
    //getexp 50000,50000;//base,job
    end;
    sader_q_iitem: //item rewards leave it empty if you don't want it you can add item exp etc
    	//for indeterminate mode
    //getexp 200000,200000;//base,job
    end;
    //============================================================
    //========================| Config |==========================
    //============================================================	
    OnInit:
    	////v2.0 update
    	setarray .easy,1002,1015,1063;	//Easy Mode Monsters ID (you can add as many as you want IDs ID,ID,ID,ID;)
    	setarray .easyc,10,12;	//Easy Mode Monsters Count((Random)) (you can add as many as you want Numbers Number,Number,Number,Number;)
    	setarray .normal,1170,1620,1036,1155;	//Normal Mode Monsters ID (you can add as many as you want IDs ID,ID,ID,ID;)
    	setarray .normalc,12,15,16;	//Normal Mode Monsters Count((Random)) (you can add as many as you want Numbers Number,Number,Number,Number;)
    	setarray .hard,1377,1384,1298,1154,1376;	//Hard Mode Monsters ID (you can add as many as you want IDs ID,ID,ID,ID;)
    	setarray .hardc,15,20,24;	// Hard Mode Monsters Count((Random)) (you can add as many as you want Numbers Number,Number,Number,Number;)
    	setarray .indeterminate,1735,1865,1867;	//Indeterminate Mode Monsters ID (you can add as many as you want IDs ID,ID,ID,ID;)
    	setarray .indeterminatec,60,70,80;	// Indeterminate Mode Monsters Count((Random)) (you can add as many as you want Numbers Number,Number,Number,Number;)
    	.complete_without_npc = 0;	//if you want to complete the quest without the npc set it to 1
    	.easy_points = 9;	//the point rewards for easy mode
    	.normal_points = 16;	//the point rewards for normal mode
    	.hard_points = 35;	//the point rewards for hard mode
    	.indeterminate_points = 70;	//the point rewards for indeterminate mode
    	.s_timeqf = 2;	//quest daley in hr
    	////v3.0 update
    	.accharlimit = 0;	// 0 = once per account , 1 = once pet character
    	////v4.1 update
    	.shopEnabled = 1;	// 0 = Disable shop , 1 = Enable shop
    	////v4.2 update
    	setarray .qs_elevel,1,175;	//the Minimum level and the Maximum level for easy mode quest (minimum,maximum)
    	setarray .qs_nlevel,20,175;	//the Minimum level and the Maximum level for normal mode quest (minimum,maximum)
    	setarray .qs_hlevel,60,175;	//the Minimum level and the Maximum level for hard mode quest (minimum,maximum)
    	setarray .qs_ilevel,80,175;	//the Minimum level and the Maximum level for indeterminate mode quest (minimum,maximum)
    	////
    	setarray .sader_q_shop[0],603,18,7517,18; // rewards in the shop <item_id>,<prise>,<item_id>,<prise>,<item_id>,<prise>;
    	npcshopdelitem "sader q s",512;
    	for (.@i = 0; .@i < getarraysize(.sader_q_shop); .@i += 2)
    		npcshopadditem "sader q s", .sader_q_shop[.@i], .sader_q_shop[.@i+1];
    	end;
    }
    -	pointshop	sader q s	-1,#SdM_PQ,512:1; //set the items you need in your shop

    Hello, can someone give a support to tell the kill to those who have the quest if they are partying? this npc only counts the individual kill

    thanks

  3. brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{
    
    OnPCDieEvent:
    //	message strcharinfo(0),"Game Over";
    	atcommand "@dropall -1"+strcharinfo(0);
    	addtimer 50000, strnpcinfo(3) + "::OnCharDelete";
    	end;
    
    OnCharDelete:
    	if (Hp > 2) end; {
    //	set .@deadplayer,getcharid(0);
    	atcommand "@kick "+strcharinfo(0);
    	set .@deadplayer,getcharid(0);
    	set .@j, getarraysize( .char_delete$ );
    	for (.@i = 0; .@i < .@j; .@i++) {
    		query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
    	}
    	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
    //	end;
    
    	
    OnInit:
    setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
    end;
    
    	}
    }

    Now works, but  how to prevent if the player logs out or clicks to revive at the save point?

  4. // can someone help for only the Jobs of my choice can use this Npc?
    this npc started for harvesting, but i adapted it and now it works as mining.

    
    ===== rAthena Script =======================================
    //= Item Harvest Event
    //=========================  by: =============================
    //= pajodex
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= rAthena Project (pajodex)
    //===== Description: =========================================
    /*
    
    Automated event that runs every 30 mins. Players will enter via
    'item harvest farmer' NPC in prontera. Plants will be spawn on
    the event map. Each plant will give random items.
    
    Enjoy!
    
    */
    //=====******** Note ********=================================
    //= if you find bugs or problem, please do tell DM me at
    //= Discord (pajodex#1328) or rAthena (pajodex) 
    //= open for suggestions
    //===== Additional Comments: =================================
    /* 
        1.0 - Initial release
    */
    //=============================================================
    prontera,150,180,6    script    Item Harvest Farmer    100,{
        if($@Event == 0) {
        mes "A mineiração começa a cada 30 mins.";
        close;
        }
        else if($@Event == 1) {
        mes "O evento está começando, quer participar?";
        if(select("Yes:No") == 2) close;
            mes "Good luck!";
            close2;
            warp "pvp_n_1-2",0,0;
            end;
        }
        else {
        mes "A mineiração já começou, entre na próxima";
        close;
        }
        end;
    
    OnInit:
        waitingroom "Mineração de Ores",0;
        end;
    }
    
    pvp_n_1-2,0,0,0    script    #plant_spawner    -1,{
    OnMinute00: // Runs every 30 mins
    OnMinute30: // Runs every 30 mins
    OnEventStart:
        if($@Event != 0) end;
        pvpoff .map$;
        mapwarp .map$,"prontera",150,190,0;
        killmonsterall .map$;
        $@Event = 1;
            announce "[Mineração] : In 5 mins, será a hora de minerar!",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
                sleep 2000;
            announce "[Mineração] : Vá para o minerador para começar a minerar em breve",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
                sleep 60000;
            announce "[Mineração] : 4 mins ",0;
                sleep 2000;
            announce "[Mineração] : Vá para o minerador to join",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
                sleep 60000;
            announce "[Mineração] : 3 mins ",0;
                sleep 2000;
            announce "[Mineração] : Vá para o minerador to join",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
                sleep 60000;
            announce "[Mineração] : 2 mins ",0;
                sleep 2000;
            announce "[Mineração] : Vá para o minerador para começar a minerar em breve",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
                sleep 60000;
            announce "[Mineração] : 1 min ",0;
                sleep 2000;
            announce "[Mineração] : Vá para o minerador para começar a minerar em breve",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
                sleep 60000;
            announce "[Mineração] : Hora de mineração!",0;
            mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            $@Event = 2;
                sleep 2000;
            mapannounce .map$, "Você tem 2 minutos para minerar!",1,0x00FF00;
                sleep 2000;
            mapannounce .map$, "Cada minério vai te dar um Ore aleatório",1,0x00FF00;
                sleep 2000;
            mapannounce .map$, "Vamos começar! Goodluck!",1,0x00FF00;
            .@num = getmapusers(.map$);
            monster .map$,0,0,"Stone",1908,.@num * 10,strnpcinfo(0)+"::OnKillPlants";
            initnpctimer;
            end;
            
        OnTimer120000:
            stopnpctimer;
            $@Event = 0;
            announce "[Item Harvest Event] : A mineração acabou! Til' next time!",0;
            killmonsterall .map$;
            sleep 5000;
            mapwarp .map$,"prontera",150,190,0;
            end;
            
        OnKillPlants:
            .@i = rand(getarraysize(.item_drop));
            getitem .item_drop[.@i], 1;
                if(.warp_) warp "prontera",150,190;
            end;
        
    OnInit:
        // set items
        setarray .item_drop,984,999,722,723,984;
        
        // set map
        .map$ = "pvp_n_1-2";
        
        // warp players out when already killed a plant (1 = on || 0 = off)
        .warp_ = 0; 
        
        // use @itemharvest to activate event.
        bindatcmd "itemharvest",strnpcinfo(3)+"::OnEventStart",0,60;
    
        
        setarray .mapflag,
            mf_nowarp,    mf_nowarpto,        mf_nosave,
            mf_nomemo,    mf_noteleport,        mf_nopenalty,
            mf_noreturn,    mf_nobranch,        mf_nomobloot,
            mf_nomvploot,    MF_NOZENYPENALTY,    MF_NOTRADE,
            MF_NOCOMMAND,    mf_noskill;
            
        for(.@i = 0; .@i < getarraysize(.map$); .@i++){
            for ( .@f = 0; .@f < .@size; .@f++ )
                setmapflag .map$[.@i], .mapflag[.@f];
            }
            
        end;
    
    }

  5. 14 hours ago, Patskie said:
    
    brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{
    
    OnPCDieEvent:
    	message strcharinfo(0),"Game Over";
    	atcommand "@dropall 0"+strcharinfo(0);
    	addtimer 60000, strnpcinfo(3) + "::OnCharDelete";
    	end;
    
    OnCharDelete:
    	if (Hp) end;
    	set .@deadplayer,getcharid(0);
    	set .@j, getarraysize( .char_delete$ );
    	for (.@i = 0; .@i < .@j; .@i++) {
    		query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
    	}
    	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
    	end;
    
    OnInit:
    	setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
    	end;

    This will delete the character after 1 minute when they die. But they can bypass the timer if they logout

    thanks a lot.. only the first part worked. There is no error, but the delete part did not run.

     

     

  6. 6 hours ago, Patskie said:
    
    setarray .s_exclude_jobs[0], Job_Champion, Job_Professor, Job_Stalker;

     

    Above jobs will not receive rewards. You can add/remove any as per your desire*

     

    works fine, thanks a lot.

     

  7. 15 minutes ago, Patskie said:

    Under OnInit label put below

    
    setarray .s_exclude_jobs[0], Job_Champion, Job_Professor, Job_Stalker;

    and then change below

    
    callsub Hourly_Rewads;

    to 

    
    if (inarray(.s_exclude_jobs, Class) == -1)
    	callsub Hourly_Rewads;

     

    Thanks i will test. as I understand it, do I need to specify which JOBs will not receive, excluding everyone in the case? and leaving only what I want off the list?

  8. Hi, im using Saders Hourly Rewards and i would like to limit this reward to limit by Job, only for jobs that I want them to receive.

    someone can help?
     

    //===== rAthena Script =======================================
    //= saders Hourly Rewards
    //===== By: ==================================================
    //= Sader1992
    //https://rathena.org/board/profile/30766-sader1992/
    //===== Current Version: =====================================
    //= 1.2
    //===== Compatible With: ===================================== 
    //= rAthena Project
    //https://rathena.org/board/files/file/3647-saders-hourly-rewards/
    //https://github.com/sader1992/sader_scripts
    //===== Description: =========================================
    //==== all the configuration are in the last
    //==== support gepard / ip / or without them
    //==== if you use ip/gepard sql will be used for that
    //==== can add minimem level to get the rewards
    //==== can change the time
    //==== can ban the vending from the rewards (it will reset after relogin)
    //==== can add rewards else then variable
    //==== there is a shop npc for the variable
    //==== you can make it only for vip
    //==== can ban idle players for X time from the Hourly Rewards
    //==== player can ban his char from getting the reward by @HourlyBan (it will reset after relogin)
    //============================================================
    //==== please send me a message if you find error
    //==== if you like my work maybe consider support me at paypal
    //==== [email protected]
    //============================================================
    //==== 1.1 FIX Critical issue with gepard/ip and compatibility with my other scripts
    //==== 1.2 FIX GrPard Variable
    //============================================================
    -	script	sader_Hourly_Rewards	-1,{
    
    OnHourlyRewards:
    		if(#Hourly_Ban){
    			message strcharinfo(0),"[Hourly Rewards]: You did ban this char from the Hourly Rewards , Relogin to change that .";
    			addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    			end;
    		}
    		if(.s_idle){
    			if(checkidle() > .s_idle_time){
    				message strcharinfo(0),"[Hourly Rewards]: No Hourly Rewards for IDLE Players!.";
    				addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    				end;
    			}
    		}
    		if(.s_vip){
    			if(!vip_status(VIP_STATUS_ACTIVE)){
    				message strcharinfo(0),"[Hourly Rewards]: if you are a VIP you will get Hourly Rewards!.";
    				addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    				end;
    			}
    		}
    		if(BaseLevel < .s_hourly_level){
    			message strcharinfo(0),"[Hourly Rewards]: if you are level "+.s_hourly_level+" and more you will get Hourly Rewards!.";
    			addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    			end;
    		}
    		if(.s_vinding){
    			if(checkvending() & .s_vinding){
    				message strcharinfo(0),"[Hourly Rewards]: No Hourly Rewards for Venders , Relogin to change that .";
    				if(.s_GePard_ip){
    				query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
    				}
    				#Hourly_Rewads_Check = 0;
    				#Hourly_Ban = 1;
    				addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    				end;
    			}
    		}
    		#Hourly_Rewads_Check += 1;
    		if(.s_GePard_ip == 1){
    			query_sql("SELECT `last_unique_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", .@s_last_unique_id$);
    			query_logsql("SELECT value FROM `sader_variables_log` WHERE unique_id = '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_GePard);
    			if(.@s_GePard >= #Hourly_Rewads_Check){
    				message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this PC";
    				#Hourly_Rewads_Check -= 1;
    				addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    				end;
    			}
    			if(.@s_GePard == 0){
    				query_logsql("INSERT INTO `sader_variables_log` (`unique_id`,`ip`,`variable`,`index`,`value`, `account_id`, `char_id`, `char_name`) VALUES ('"+.@s_last_unique_id$+"', '"+getcharip()+"', '#Hourly_Rewads_Check', '0', '"+#Hourly_Rewads_Check+"', '"+getcharid(3)+"', '"+getcharid(0)+"', '"+strcharinfo(0)+"')");
    			}
    			query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `unique_id`= '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'");
    		}else if(.s_GePard_ip == 2){
    			query_logsql("SELECT value FROM `sader_variables_log` WHERE ip = '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_ip);
    			if(.@s_ip >= #Hourly_Rewads_Check){
    				message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this IP";
    				#Hourly_Rewads_Check -= 1;
    				addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    				end;
    			}
    			if(.@s_ip == 0){
    				query_logsql("INSERT INTO `sader_variables_log` (`unique_id`,`ip`,`variable`,`index`,`value`, `account_id`, `char_id`, `char_name`) VALUES ('"+.@s_last_unique_id$+"', '"+getcharip()+"', '#Hourly_Rewads_Check', '0', '"+#Hourly_Rewads_Check+"', '"+getcharid(3)+"', '"+getcharid(0)+"', '"+strcharinfo(0)+"')");
    			}
    			query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `ip`= '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'");
    		}
    		message strcharinfo(0),"[Hourly Rewards]: you Gain your Reward.";
    		callsub Hourly_Rewads;
    		addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    end;
    
    OnHourlyBan:
    	if(!#Hourly_Ban){
    		message strcharinfo(0),"[Hourly Rewards]: You did ban this char from the Hourly Rewards , Relogin to change that .";
    		if(.s_GePard_ip){
    		query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
    		}
    		#Hourly_Rewads_Check = 0;
    		#Hourly_Ban = 1;
    		addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    	}
    end;
    
    OnUnHourlyBan:
    	#Hourly_Ban = 0;
    end;
    OnPCLogoutEvent:
    	if(.s_GePard_ip){
    	query_logsql("delete from `sader_variables_log` where `variable` = '#Hourly_Rewads_Check' AND `account_id`= '"+getcharid(3)+"'");
    	}
    	if(#Hourly_Ban == 1){
    		#Hourly_Ban = 0;
    	}
    	#Hourly_Rewads_Check = 0;
    end;
    
    OnPCLoginEvent:
    	addtimer .s_time, strnpcinfo(3)+"::OnHourlyRewards";
    end;
    
    OnInit:
    	.s_idle = 0; //	ban hourly rewards from idle players ? 0 no / 1 yes {if player didn't move for x time he wont get hourly reward}  , DEFAULT = 0
    	.s_idle_time = 1800; //	this the time for idle in secend  , DEFAULT = 1800 (30 min)
    	.s_vip = 0; //	1 = only for VIP / 0 = for everyone  , DEFAULT = 0
    	.s_time = 3600000; //	1000 = 1 secend | 60000 = 1 min | 3600000 = 1 houre  , DEFAULT = 3600000 (1 hr)
    	.s_hourly_level = 0; //	Minimam level to get the Houerly rewards / 0 = no minimem level  , DEFAULT 0
    	.s_GePard_ip = 0; //	0 = no Gepard / 1 = Gepard / 2 = IP  , DEFAULT 0
    	.s_vinding = 7; //	DEFAULT 7 / 0 = will give the reward even if vending / 1 = no normal vending / 2 = no @autotrade / 4 = no buyingstore | Example: if you want to ban normal vend and buying store you add the numbers 1+4=5
    	query_logsql("CREATE TABLE IF NOT EXISTS `sader_variables_log` (`unique_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT  '0',`ip` VARCHAR(100) NOT NULL,`variable` VARCHAR(32) NOT NULL, `index` INT NOT NULL, `value` INT NOT NULL,`account_id` INT NOT NULL,`char_id` INT NOT NULL,`char_name` VARCHAR(30) NOT NULL) ENGINE=MyISAM");
    	bindatcmd("UnHourlyBan",strnpcinfo(3)+"::OnUnHourlyBan",99,99);
    	bindatcmd("HourlyBan",strnpcinfo(3)+"::OnHourlyBan",0,99);
    end;
    
    Hourly_Rewads:
    	//put the Hourly Rewards here
    	#HourlyRewards += 1;
    	//getitem 905,1; //	if you want to add items as reward you can add them here like that
    	//getexp 10000,5000; //	if you wanna add exp as reward add them here like that
    	//if(#Hourly_Rewads_Check == 5){getitem 905,1;} //	like this you can add reward for Xhr and this reward will be given for that X in this example 5 mean that the player did pass 5hr
    	//if(#Hourly_Rewads_Check >= 5){getitem 905,1;} //	like this you can add reward for Xhr and this reward will be given for that X in this example 5 mean that the player did pass 5hr or more
    return;
    }
    prontera,151,171,5	pointshop	Hourly Rewards Shop	667,#HourlyRewards,901:1,902:10,903:15,904:1,905:200
    //<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>,<ITEM_ID>:<PRICE>

     

  9. 3 hours ago, Start_ said:
    
    nude;
    atcommand "@dropall";
    atcommand "@clearinventory";
    atcommand "@job 0";
    atcommand "@lvup -999";
    atcommand "@joblvup -999";
    atcommand "@reset";
    StatusPoint = 48;
    SkillPoint = 0;
    Zeny = 0;

    I always use this lines of code.

    Thanks for the tip, but I want it to be a way before the character is deleted, that there is a time that someone can relive it, and if that happens, it won't be deleted.

  10. 14 minutes ago, Kreustoo said:

    Hello,
    Just an idea easier to put in place, jail it and make no trade on the jail map? That way they even can "save there beloved character".

    I've tried to do it the way you suggested, it even works, but it's not what I'm looking for, I wanted a way to enhance the skill Revive when a character dies, adapting a time x in this script, or some other idea if you have.

  11. I would like to add time, (x) minutes before the character is deleted, and check if he is alive or if he has more than 1 hp, if he is alive suspend the delete char action

    Thanks
     

    brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{
    
    OnPCDieEvent:
    	set .@deadplayer,getcharid(0);
    	message strcharinfo(0),"Game Over";
    	atcommand "@dropall 0"+strcharinfo(0);
    	set .@j, getarraysize( .char_delete$ );
    	for (.@i = 0; .@i < .@j; .@i++) {
        query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
    	}
    	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
    	end;
    	
    OnInit:
    setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
    end;

     

  12. Would it be possible for an npc to modify the name of the item like the one that puts our name on the item, but instead I can put what I want to write?

    thanks. if anyone can help doing it i appreciate it.

  13. 8 hours ago, Patskie said:

    Add below item script on all of your "eating items" 

    
    501,Red_Potion,Red Potion,0,10,,70,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 100,100; HUNGERPOINTS += 8; if (getstatus(SC_SLOWDOWN)) {sc_end SC_SLOWDOWN;} },{},{}

    Then use below script. It will reduce hunger points every 15 minutes. So 8 hunger points from the pots means 2 hours.

    
    -	script	HungerGames	-1,{
    	OnMinute15:
    	OnMinute30:
    	OnMinute45:
    	OnMinute60:
    		addrid(0);
    		if (!HUNGERPOINTS) {
    			sc_start SC_SLOWDOWN, INFINITE_TICK, 100, 10000, SCSTART_NOAVOID;
    			Hp = 1;
                Sp = 0;
    		} else {
    			HUNGERPOINTS--;
    			dispbottom "Your hunger points have been reduced. Hunger points total : " + HUNGERPOINTS;
    		}
    		end;
    }

     

    it worked, but there are many items of food rs. I'm already using it, in case nobody suggests something more practical. but already thank you very much. if the person uses several red potions, will this HUNGRY value accumulate? if it accumulates, it loses some sense.

    would you like it to be every 5 minutes, the Ontime function wouldn't work?

    23 minutes ago, Emistry said:

    read this line

    that's what you requested...

    sorry, i wanted to say i would like a simple hunger system.

  14. 8 hours ago, Emistry said:

    try this

    
    -	script	sample	-1,{
    	OnUpdate:
    		if (HUNGER_VALUE > 0) {
    			HUNGER_VALUE -= 10; // reduce by 10 every time.
    			dispbottom "<SYSTEM> Hunger : "+HUNGER_VALUE;
    			
    			if (HUNGER_VALUE <= 0)
    				recalculatestat;
    		}
    	OnPCLoginEvent:
    		addtimer (60 * 60000), strnpcinfo(3)+"::OnUpdate"; // check every 60 minutes.
    		end;
    		
    	OnPCStatCalcEvent:
    		if (HUNGER_VALUE <= 0) {
    			bonus bMaxHPrate, -100;
    			bonus bMaxSPrate, -100;
    			bonus bSpeedRate,-100;
    		}
    		end;
    }

     

    My characters simply got 1 maximum health, I think it didn't work. any idea? thanks

  15. On 4/9/2020 at 9:40 PM, Akkarin said:

    If you look at script_commands.txt this can be easily acheived.

    Use a timer with OnPCLoginEvent and decrease the value of a variable you want to use to store the hunger level of your character. Add an if-statement to check if hunger has reached zero and then apply minus heal values to the player.

    Have you had a go at trying this yourself?

    I apologize, I haven't seen your answer before. So I tried for the forum referring to my native language. I don't know much about programming. for me it is difficult, even though it seems to be easy with your explanation.

  16. Hi, someone can help to make a Hunger player, they have to eat to keep it from going down, if hunger bar goes down to 0, some sort of handicap could happen to them, like 0 mana and 1 hp and slowed down until they eat again.  or something like that.

    thanks

  17. 9 minutes ago, Zell said:

    Like the title say, this is a script commands.... not a atcommand
     

    
    prontera,150,150,5	Script	FakePlayer	90,{
    	.@monster_gid = fakeplayer( "prontera", 152, 152, "blabla", 0, 0, 1, 2, 0, 0, 1, 2, 3, 0, 1 );
        mes "Congrats, I summoned the monster with id " + .@monster_gid;
        close;
    }
    
    

    OMG THANKS HEHE

    for each fake player do i need an npc? @Zell
    image.png.4016204fb351206bdfc83bb45a42429b.png
    i think is a bug, all porings become a ''blbla'' 

  18. I compiled and it was all ok, but in the game is giving unknown command. Could you give a complete example of how to use the command?

    @Zell I added yes to DEF, compiled without any errors, still giving unknown command. I will put my custom script down

    script.inc script_def.inc

    @Zell can you put here your script.cpp modified?  Thanks a lot

    the picture did not open

    image.png.a55f693eca79119b11549a6820e76794.png
    Compiled everything ok, but it goes on like this. @Zell

×
×
  • Create New...