Jump to content

Angeluz

Members
  • Posts

    109
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Angeluz

  1. try with this

     

    -	script	KillMon2Cash	-1,{
    OnNPCKillEvent:
    .@gettimetick = gettimetick(2);
    if (rand(100) < 1 && .@gettimetick > @delay) {
    	getitem 50001,1;
    	@delay = .@gettimetick + 60; // 60 seconds
    }
    end;
    
    OnInit:
    	bindatcmd "check", "KillMon2Cash::OnCheckTime";
    	end;
    	
    OnCheckTime:
      	if (( @delay - gettimetick(2)) <=0 )
    		message strcharinfo(0),"Your next drop is ready!";
      	else
      		message strcharinfo(0),"Next drop in "+ ( @delay - gettimetick(2) ) + " seconds.";
    	end;
    }

     

    • Love 1
  2. 3 hours ago, WillJocker said:

    time error ?

    image.thumb.png.8334c029bcfc64cade0679118d78bfae.png

    my bad

     

    -	script	KillMon2Cash	-1,{
    OnNPCKillEvent:
    .@gettimetick = gettimetick(2);
    if (rand(100) < 1 && .@gettimetick > @delay) {
    	getitem 50001,1;
    	@delay = .@gettimetick + 60; // 60 seconds
    }
    end;
    
    OnInit:
    	bindatcmd "check", "KillMon2Cash::OnCheckTime";
    	end;
    	
    OnCheckTime:
    	message strcharinfo(0),"Next drop in "+ ( @delay - gettimetick(2) ) + " seconds.";
    	end;
    }

     

    • Love 1
  3. On 1/22/2023 at 7:49 PM, Enoch said:

    no error code but it doesnt work after  they can talk to the npc even they reach max lvl, i mean they can make another character and max lvl and claim again

    Do you want it to be a unique prize per server? Or do you want to have them charge it once per account? That is, if two Ministrels reach the maximum level, will it only be given to one? Or that if I arrive with a minister and then with an archbishop, I can't collect it with the archbishop?

     

    i change it to sniper and creator 99/60
    i take it first with creator
    image.png.b456edfb561bee6f51a14df1ae5c3054.png

    then i change to sniper in same account, with new account and dont let me


    image.png.aa139981308365f045a220a8541a45e5.png

     

    if you already take the price before start doesnt work you need to start from scratch

  4. maybe something like that

     

    -	script	KillMon2Cash	-1,{
    OnNPCKillEvent:
    .@gettimetick = gettimetick(2);
    if (rand(100) < 1 && .@gettimetick > @delay) {
    	getitem 50001,1;
    	@delay = .@gettimetick + 60; // 60 seconds
    }
    end;
    
    OnInit:
    	bindatcmd "check", "KillMon2Cash::OnCheckTime";
    	end;
    	
    OnCheckTime:
    	message strcharinfo(0),"Next drop in "+ ( @delay - .@gettimetick ) + " seconds.";
    	end;
    }

     

  5. 1 hour ago, AinsLord said:

    image.png.49db91d228c088b315a83a8ac9de7185.png

    here is the warnings ive encountered it doesnt stop the compiling however i buggers me seeing this

    is there any way to remove this?

    this is just warning dont worry

    1 hour ago, AinsLord said:

    Bump in to this post

    In addition when i try to start the server this error shows

    image.png.5e9ffb6afef57fc4a559698d2d6d5b8e.png

    but in my old rathena git i can start the server without this kind of error?

    what seems to be the problem

    #TIA

    Maybe u did a bad update

  6. Try with this

    freya,218,220,6	script	Max Level	4_LGTSCIENCE,{
        set .@gm_level, 99; // GM level required to set the reward
        set .@maxbase, 175;
        set .@maxjob, 60;
        set .@defaultreward, 39997;
        setarray .@rewardablejobs[0], Job_Rune_Knight_T, Job_Genetic_T, Job_Guillotine_Cross_T, Job_Minstrel_T, Job_Mechanic_T, Job_Royal_Guard_T, Job_Wanderer_T, Job_Ranger_T, Job_Sura_T, Job_Arch_Bishop_T, Job_Shadow_Chaser_T, Job_Sorcerer_T, Job_Warlock_T, Job_Kagerou, Job_Oboro;
        
        Begin:
        mes "[ ^FF7700Race to Max Level^000000 ]";
        mes "Hello, " + ((getgmlevel() >= .@gm_level) ? "master! What do you want to do today?" : "are you here for your reward?");
        next;
        switch(select(((getgmlevel() >= .@gm_level) ? "Set Reward:Restart Race" : ":") + ":YES Please!:What is the Reward?:Who was rewarded?:Cancel")) {
            case 1:
                goto SetReward;
            case 2:
                goto RestartRace;
            case 3:
                goto GetReward;
            case 4:
                goto ExplainRace;
            case 5:
                goto ShowRewarded;
            default:
                end;
        }
        
        SetReward:
            mes "[ ^FF7700Race to Max Level^000000 ]";
            if ($reward == 0)
                set $reward, .@defaultreward;
            mes "The reward is " + getitemname($reward) + " (ID: " + $reward + ").";
            mes "Do you want to change it?";
            next;
            if (select("Yes:No") == 1) {
                mes "[ ^FF7700Race to Max Level^000000 ]";
                mes "Please enter the new reward item ID.";
                input .@rewardid;            
                next;
                mes "[ ^FF7700Race to Max Level^000000 ]";
                mes "Set " + getitemname(.@rewardid) + " as the reward?";
                if(select("Yes:No") == 1) {
                    set $reward, .@rewardid;
                }
            }
            goto Begin;
        
        RestartRace:
            mes "[ ^FF7700Race to Max Level^000000 ]";
            mes "Are you sure you want to restart the race?";
            next;
            if (select("Yes:No") == 1) {
                for (.@i = 0; .@i < getarraysize(.@rewardablejobs); .@i++) {
                    set $rewarded$[.@rewardablejobs[.@i]], "";
                }
                announce "The Race to Max Level has begun! Claim a reward once you reach " + .@maxbase + " base and job " + .@maxjob + " !!", bc_all;
            }
            goto Begin;
        
        GetReward:
            mes "Let's see... " + strcharinfo(0) + ", huh?";
            
            set .@competitioner, 0;
            for (.@i = 0; .@i < getarraysize(.@rewardablejobs); .@i++) {
                if (Class == .@rewardablejobs[.@i]) {
                    set .@competitioner, 1;
                    if (BaseLevel < .@maxbase || JobLevel < .@maxjob) {
                        mes "I'm sorry, but you still need to level a bit more.";
                    } else if ($rewarded$[Class] == strcharinfo(0) || getd("$MaxLevel" + get_unique_id() + "") == 1) {
                        mes "You have already claimed your reward.";
                    } else if ($rewarded$[Class] != "") {
                        mes "Too late!";
                        mes "The reward for " + jobname(Class) + " was already claimed by " + $rewarded$[Class] + ".";
                    } else goto GiveReward;
                }
            }
            if (.@competitioner == 0)
                mes "You need to change your job.";
            close;
        
        GiveReward:
            set $rewarded$[Class], strcharinfo(0);
            next;
            mes "[ ^FF7700Race to Max Level^000000 ]";
            mes "Congratulations! You were the first " + jobname(Class) + " to reach " + .@maxbase + " base and " + .@maxjob + " class!";
            getitem $reward, 1;
    		setd "$MaxLevel" + get_unique_id() + "",1;
            announce strcharinfo(0) + " ~ " + jobname(Class) + " ~ Has Reached Max. Level and Received " + getitemname($reward) + "!", bc_all;
            close;
        
        ExplainRace:
            mes "[ ^FF7700Race to Max Level^000000 ]";
            mes "Yes! When you reach the maximum level for your class, talk to me and you'll be rewarded with a special item.";
            next;
            goto Begin;
            
        ShowRewarded:
            mes "[ ^FF7700Race to Max Level^000000 ]";
            for (.@i = 0; .@i < getarraysize(.@rewardablejobs); .@i++) {
                mes jobname(.@rewardablejobs[.@i]) + ": " + (($rewarded$[.@rewardablejobs[.@i]] != "") ? $rewarded$[.@rewardablejobs[.@i]] : "^ff0000Nobody^000000");
            }
            next;
            goto Begin;
        OnInit:
            while (1) {
                showscript " Race to 175 Winners! ";
                sleep 1000;
            }
            end;
    }

    I recommend you to use the code boxes next time

    • Upvote 1
  7. Hi,

    Is it possible to remove the following window?

    image.png.cca9c192fd31c766be0578c7d0c04d03.png

    I want to make it so that when all people are found they don't have to confirm, but enter automatically.

    I have tried to get my hands on these functions but I have not been able to get it to work, any ideas?
    https://github.com/rathena/rathena/blob/master/src/map/battleground.cpp#L1213
     

    Spoiler
    /**
     * Join multiple players onto the same side of a Battleground
     * @param name: Battleground name
     * @param sd: Player who requested to join the battlegrounds
     * @param list: Contains all players including the player who requested to join
     */
    void bg_queue_join_multi(const char *name, map_session_data *sd, std::vector <map_session_data *> list)
    {
    	if (!sd) {
    		ShowError("bg_queue_join_multi: Tried to join non-existent player\n.");
    		return;
    	}
    
    	std::shared_ptr<s_battleground_type> bg = bg_search_name(name);
    
    	if (!bg) {
    		ShowWarning("bq_queue_join_multi: Could not find battleground \"%s\" requested by %s (AID: %d / CID: %d)\n", name, sd->status.name, sd->status.account_id, sd->status.char_id);
    		return;
    	}
    
    	if (!bg_queue_check_joinable(bg, sd, name)){
    		return;
    	}
    
    	for (const auto &queue : bg_queues) {
    		if (queue->id != bg->id || queue->state == QUEUE_STATE_SETUP_DELAY || queue->state == QUEUE_STATE_ENDED)
    			continue;
    
    		// Make sure there's enough space on one side to join as a party/guild in this queue
    		if (queue->teama_members.size() + list.size() > bg->max_players && queue->teamb_members.size() + list.size() > bg->max_players) {
    			break;
    		}
    
    		bool r = rnd() % 2 != 0;
    		std::vector<map_session_data *> *team = r ? &queue->teamb_members : &queue->teama_members;
    
    		if (queue->state == QUEUE_STATE_ACTIVE) {
    			// If one team has lesser members try to balance (on an active BG)
    			if (r && queue->teama_members.size() < queue->teamb_members.size())
    				team = &queue->teama_members;
    			else if (!r && queue->teamb_members.size() < queue->teama_members.size())
    				team = &queue->teamb_members;
    		} else {
    			// If the designated team is full, put the player into the other team
    			if (team->size() + list.size() > bg->required_players)
    				team = r ? &queue->teama_members : &queue->teamb_members;
    		}
    
    		while (!list.empty() && team->size() < bg->max_players) {
    			map_session_data *sd2 = list.back();
    
    			list.pop_back();
    
    			if (!sd2 || sd2->bg_queue_id > 0)
    				continue;
    
    			if (!bg_queue_check_joinable(bg, sd2, name))
    				continue;
    
    			sd2->bg_queue_id = queue->queue_id;
    			team->push_back(sd2);
    			clif_bg_queue_apply_result(BG_APPLY_ACCEPT, name, sd2);
    			clif_bg_queue_apply_notify(name, sd2);
    		}
    
    		if (queue->state == QUEUE_STATE_ACTIVE) { // Battleground is already active
    			for (auto &pl_sd : *team) {
    				if (queue->map->mapindex == pl_sd->mapindex)
    					continue;
    
    				pc_set_bg_queue_timer(pl_sd);
    				clif_bg_queue_lobby_notify(name, pl_sd);
    			}
    		} else if (queue->state == QUEUE_STATE_SETUP && queue->teamb_members.size() >= bg->required_players && queue->teama_members.size() >= bg->required_players) // Enough players have joined
    			bg_queue_on_ready(name, queue);
    
    		return;
    	}
    
    	// Something went wrong, sends reconnect and then reapply message to client.
    	clif_bg_queue_apply_result(BG_APPLY_RECONNECT, name, sd);
    }

     

    https://github.com/rathena/rathena/blob/master/src/map/battleground.cpp#L1370

    Spoiler
    /**
     * Send packets to all clients in queue to notify them that the battleground is ready to be joined
     * @param name: Battleground name
     * @param queue: Battleground queue
     * @return True on success or false otherwise
     */
    bool bg_queue_on_ready(const char *name, std::shared_ptr<s_battleground_queue> queue)
    {
    	std::shared_ptr<s_battleground_type> bg = battleground_db.find(queue->id);
    
    	if (!bg) {
    		ShowError("bg_queue_on_ready: Couldn't find battleground ID %d in battlegrounds database.\n", queue->id);
    		return false;
    	}
    
    	if (queue->teama_members.size() < queue->required_players || queue->teamb_members.size() < queue->required_players)
    		return false; // Return players to the queue and stop reapplying the timer
    
    	bool map_reserved = false;
    
    	for (auto &map : bg->maps) {
    		if (!map.isReserved) {
    			map.isReserved = true;
    			map_reserved = true;
    			queue->map = &map;
    			break;
    		}
    	}
    
    	if (!map_reserved) { // All the battleground maps are reserved. Set a timer to check for an open battleground every 10 seconds.
    		queue->tid_requeue = add_timer(gettick() + 10000, bg_on_ready_loopback, 0, (intptr_t)queue->queue_id);
    		return false;
    	}
    
    	queue->state = QUEUE_STATE_SETUP_DELAY;
    	queue->tid_expire = add_timer(gettick() + 20000, bg_on_ready_expire, 0, (intptr_t)queue->queue_id);
    
    	for (const auto &sd : queue->teama_members)
    		clif_bg_queue_lobby_notify(name, sd);
    
    	for (const auto &sd : queue->teamb_members)
    		clif_bg_queue_lobby_notify(name, sd);
    
    	return true;
    }

     

     

    https://github.com/rathena/rathena/blob/master/src/map/clif.cpp#L18550

    Spoiler
    /// Battleground is ready to be joined, send a window asking for players to accept or decline.
    /// 0x8df <battleground name>.24B <lobby name>.24B (ZC_NOTIFY_LOBBY_ADMISSION)
    void clif_bg_queue_lobby_notify(const char *name, map_session_data *sd)
    {
    	nullpo_retv(sd);
    
    	int fd = sd->fd;
    
    	WFIFOHEAD(fd, packet_len(0x8df));
    	WFIFOW(fd,0) = 0x8df;
    	safestrncpy(WFIFOCP(fd,2), name, NAME_LENGTH);
    	safestrncpy(WFIFOCP(fd,2+NAME_LENGTH), name, NAME_LENGTH);
    	WFIFOSET(fd, packet_len(0x8df));
    }

     

     

  8. try with:

    https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L4531
     

    *changebase <job ID number>{,<account ID>};
    
    This command will change a character's appearance to that of the specified job
    class. Nothing but appearance will change.
    
    The command will run for the invoking character unless an account ID is given.
    
    	changebase Job_Novice; // Changes player to Novice sprite.
    	changebase Class; // Changes player back to default sprite.

     

    https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L963
     

    OnPCLoadMapEvent:
    
    This special label triggers when a player steps in a map marked with the
    'loadevent' mapflag and attaches its RID. The fact that this label requires a
    mapflag for it to work is because, otherwise, it'd be server-wide and trigger
    every time a player would change maps. Imagine the server load with 1,000 players
    (oh the pain...)

     

    • Like 1
  9. 53 minutes ago, iconrag said:
    		case 4:
    			if(!getcharid(2)){
    				mes "you don't have guild";
    				close;
    			}
    			if(!guild_has_permission(GUILD_PERM_STORAGE)){
    				mes "you don't have permission for the guild storage";
    				close;
    			}
    			query_sql("SELECT `time`,`name`,`nameid`,`amount` FROM `guild_storage_log` WHERE `guild_id` = '" + getcharid(2) + "' order by `id` ASC", .@time$ ,.@name$,.@item_id,.@amount);
    			if(!.@item_id){
    				mes "there is no log yet";
    				close;
    			}
    			dispbottom "=========================================================",0xFFD64F;
    			dispbottom "===================== Guild Storage Log =======================",0xFFD64F;
    			dispbottom "=========================================================",0xFFD64F;
    			for(.@i=0;.@i<getarraysize(.@item_id);.@i++)
    				dispbottom .@time$[.@i] + " Player[" + .@name$[.@i] + "] Item Name[" + getitemname(.@item_id[.@i]) + "] Item Amount[" + .@amount[.@i] + "]",((.@amount[.@i] > 0)?0x03c6fc:0xFF0000);
    			dispbottom "=========================================================",0xFFD64F;


    Hello guys, Need help
    i want to make this Guild Storage Logs show 30 last Logs Only
    can someone help me ?
    thanks

    try with this

    		case 4:
    			if(!getcharid(2)){
    				mes "you don't have guild";
    				close;
    			}
    			if(!guild_has_permission(GUILD_PERM_STORAGE)){
    				mes "you don't have permission for the guild storage";
    				close;
    			}
    			query_sql("SELECT `time`,`name`,`nameid`,`amount` FROM `guild_storage_log` WHERE `guild_id` = '" + getcharid(2) + "' order by `id` ASC", .@time$ ,.@name$,.@item_id,.@amount);
    			if(!.@item_id){
    				mes "there is no log yet";
    				close;
    			}
    			dispbottom "=========================================================",0xFFD64F;
    			dispbottom "===================== Guild Storage Log =======================",0xFFD64F;
    			dispbottom "=========================================================",0xFFD64F;
    +			if( getarraysize(.@item_id) > 30 )
    +				set .@aux, 30;
    +			else
    +				set .@aux, getarraysize(.@item_id);
    -			for(.@i=0;.@i<getarraysize(.@item_id) ;.@i++)
    +			for(.@i=0;.@i<.@aux ;.@i++)
    				dispbottom .@time$[.@i] + " Player[" + .@name$[.@i] + "] Item Name[" + getitemname(.@item_id[.@i]) + "] Item Amount[" + .@amount[.@i] + "]",((.@amount[.@i] > 0)?0x03c6fc:0xFF0000);
    			dispbottom "=========================================================",0xFFD64F;

     

  10. On 10/6/2022 at 9:37 AM, Zarchiel said:

    How do I solve this error friend, only this one appears.

    Imagem

    in src/map/battleground.cpp
     

    @@ -1146,12 +1146,14 @@ void bg_team_getitem(int bg_id, int nameid, int amount)
    {
    	std::shared_ptr<s_battleground_data> bg;
    	struct map_session_data *sd;
    -	struct item_data *id;
    	struct item it;
    	int get_amount, j, flag;
    
    	std::shared_ptr<s_battleground_data> bgd = util::umap_find(bg_team_db, bg_id);
    -	if (amount < 1 || bgd == NULL || (id = itemdb_exists(nameid)) == NULL)
    +	
    +	std::shared_ptr<item_data> id = item_db.find(nameid);
    +	
    +	if (amount < 1 || bgd == NULL || id == nullptr )
    		return;
    	if( battle_config.bg_reward_rates != 100 )
    		amount = amount * battle_config.bg_reward_rates / 100;
    @ -1199,12 +1201,13 @@ bg_result (0 Won | 1 Tie | 2 Lost)
    void bg_team_rewards(int bg_id, int nameid, int amount, int kafrapoints, int quest_id, const char *var, int add_value, int bg_arena, int bg_result)
    {
    	struct map_session_data *sd;
    -	struct item_data *id;
    	struct item it;
    	int j, flag, get_amount;
    
    	std::shared_ptr<s_battleground_data> bgd = util::umap_find(bg_team_db, bg_id);
    -	if (amount < 1 || bgd == NULL || (id = itemdb_exists(nameid)) == NULL)
    +	std::shared_ptr<item_data> id = item_db.find(nameid);
    +	
    +	if (amount < 1 || bgd == NULL || id == nullptr)
    		return;
    
    	if( battle_config.bg_reward_rates != 100 )

     

    in src/map/script.cpp

    @@ -21458,7 +21458,7 @@ BUILDIN_FUNC(bg_logincount)
    enum e_result_validate_emblem {	// Used as Result for clif_validate_emblem
    	EMBVALIDATE_SUCCESS = 0,
    	EMBVALIDATE_ERR_RAW_FILEFORMAT,	// Invalid File Format (Error in zlib/decompression or malformed BMP header)
    -	EMBVALIDATE_ERR_TRANSPARENCY	// uploaded emblem does not met the requirements of battle_config.emblem_transparency_limit
    +	EMBVALIDATE_ERR_TRANSPARENCY	// uploaded emblem does not met the requirements of inter_config.emblem_transparency_limit
    };
    static enum e_result_validate_emblem clif_validate_emblem(const uint8* emblem, unsigned long emblem_len)
    {
    @ -21473,7 +21473,7 @@ static enum e_result_validate_emblem clif_validate_emblem(const uint8* emblem, u
    		))
    		return EMBVALIDATE_ERR_RAW_FILEFORMAT;
    	*/
    -	if (battle_config.emblem_transparency_limit != 100) {
    +	if (inter_config.emblem_transparency_limit != 100) {
    		int i, transcount = 1, tmp[3];
    		for (i = offset; i < buf_len - 1; i++) {
    			int j = i % 3;
    @ -21481,7 +21481,7 @@ static enum e_result_validate_emblem clif_validate_emblem(const uint8* emblem, u
    			if (j == 2 && (tmp[0] == 0xFFFF00FF) && (tmp[1] == 0xFFFF00) && (tmp[2] == 0xFF00FFFF)) //if pixel is transparent
    				transcount++;
    		}
    -		if (((transcount * 300) / (buf_len - offset)) > battle_config.emblem_transparency_limit) //convert in % to chk
    +		if (((transcount * 300) / (buf_len - offset)) > inter_config.emblem_transparency_limit) //convert in % to chk
    			return EMBVALIDATE_ERR_TRANSPARENCY;
    	}

     

  11. Try this

    prontera,143,173,5	script	Level Reset	757,{
    	if (BaseLevel < 255||JobLevel < 120 ) {
    		mes "You need to be at least level 255 and Job level 120.";
    	}
    	if (RESET_COUNT >= 20 )
    	{
    		mes "I'm sorry, but you can't use this npc again";
    		close;
    	}
    	else if (select("Reset", "cancel") == 1) {
    		resetlvl 1;
    		RESET_COUNT++;
    		StatusPoint += (RESET_COUNT * 10); // free 10 status point per reset.
    		
    		if (RESET_COUNT && RESET_COUNT % 10 == 0) {
    			getitem 512, 10; // every 10 reset get apple.
    		}
    	}
    	end;
    }

     

    • Upvote 1
×
×
  • Create New...