Jump to content

Recommended Posts

Posted

Advance Punching Bag with DPS counter + Parameter Settings


Hi guys, 

Its been a while since I left and came back. Here is my latest release for now for the community :
 

 

In addition to setting the dummy's parameters, you can also simulate a monster's stat by adding the MOB ID.

You will need to put your mob_db/mob_db_re sql tables in-order for the script to retrieve the mob's information.

Since this is a free release, compatibility is your responsibility.
If there are any bugs/issues, just post on the support page and not thru my DMs.


Credits goes to @Secrets DPS counter script. I was using that script and modified to make this script possible.

 

Hope this small contribution would be a great help!

 

- pajodex

 

Thanks to @_Terra for sharing the fix on clif_send error.

 


  • Submitter
  • Submitted
    03/14/23
  • Category
  • Video
    https://www.youtube.com/watch?v=RoLhYx-Iny8
  • Content Author
    pajodex, secrets

 

  • Upvote 2
Posted

at map server showing like this, is it ok?

Quote

[Error]: clif_send: Unrecognized type 251
[Error]: clif_send: Unrecognized type 251
[Error]: clif_send: Unrecognized type 124
[Error]: clif_send: Unrecognized type 124
[Error]: clif_send: Unrecognized type 252
[Error]: clif_send: Unrecognized type 252

 

Posted
4 hours ago, hendra814 said:

at map server showing like this, is it ok?

 

I didnt encounter this yet. clif_send should be something related to sending a messege. perhaps npctalk is causing this.. have you tried on a clean server file?

Posted

@pajodex

I also encounter the same everytime the npctalk its giving clif_send error

Also im using txt for mob and not in sql, the script tries to query from sql instead of mob_db.yml

Posted (edited)
57 minutes ago, rmon said:

@pajodex

I also encounter the same everytime the npctalk its giving clif_send error

Also im using txt for mob and not in sql, the script tries to query from sql instead of mob_db.yml

Like as I said, try it on a clean server file. If error still occurs, it is something to do with npctalk...if error is not there, means you added something that modified clif send causing this error.

also, I clearly stated in the description to enable (run the query) sql.. otherwise it wont work.. You dont need to enable sql mob data or something...

Apparently I cannot see any script commands to fetch the element level of the mob aside from sql. If there is any other ways, please do let me know and I will adjust the script accordingly.

Edited by pajodex
Posted (edited)
On 3/22/2023 at 11:54 PM, pajodex said:

Like as I said, try it on a clean server file. If error still occurs, it is something to do with npctalk...if error is not there, means you added something that modified clif send causing this error.

also, I clearly stated in the description to enable (run the query) sql.. otherwise it wont work.. You dont need to enable sql mob data or something...

Apparently I cannot see any script commands to fetch the element level of the mob aside from sql. If there is any other ways, please do let me know and I will adjust the script accordingly.

already tried only with 1 this custom script, it's ok like @pajodex information

but when enable again another custome script (ex. hunting mission at custom folder) it's show the error.

But when i tried restart all servers, the error are gone.

So i don't know what's the problem.

 

Edit: happening again when i start all server with same configuration.

Edited by hendra814
Posted (edited)
12 hours ago, pajodex said:

@hendra814 You are using lastest clean server files right? No modifications? If this is still happening, this could be a src problem.

Yes, lastest clean server with this script, hunting mission, reset npc, universal rent ,and warper at npc custom folder.

Edited by hendra814
Posted

this might be something to be reported in rathena github... but since this is less likely to be problem from the script, I will leave it be.

  • 9 months later...
Posted
On 1/16/2024 at 10:02 AM, _Terra said:

To solve clif_send error just edit this line:
 

specialeffect EF_HEAL, .gid[.@dupid];

to

 

specialeffect EF_HEAL;

 

not solve the issue, even using new script advance punching bag still happen.

 

image.png.9508ea0aa35907693ac0c24f3b03108d.png

  • 1 month later...
Posted
On 1/16/2024 at 11:02 AM, _Terra said:

To solve clif_send error just edit this line:
 

specialeffect EF_HEAL, .gid[.@dupid];

to

 

specialeffect EF_HEAL;

 

This solved my problem

  • Upvote 1
Posted (edited)
On 2/29/2024 at 12:03 PM, Ice Bear said:

This solved my problem

This is the actual fix, I just found out today but @_Terraseemed to see it first. Version 1.2 is out, waiting for admin approval. Also some fix on selecting the first option on size, race, element type is fixed.

Edited by pajodex
  • Like 1
Posted
18 hours ago, pajodex said:

This is the actual fix, I just found out today but @_Terraseemed to see it first. Version 1.2 is out, waiting for admin approval. Also some fix on selecting the first option on size, race, element type is fixed.

please share too in this thread, i check still version 1.1 in the download section.

Posted

I think its only a typo on my part as I was in a game while uploading this file. So, I didn't really mind minor stuffs. The file itself should be v1.2

  • 3 weeks later...
Posted
On 3/8/2024 at 2:26 PM, pajodex said:

I think its only a typo on my part as I was in a game while uploading this file. So, I didn't really mind minor stuffs. The file itself should be v1.2

thanks, already test it, now the error warning not showing in map server.

  • Upvote 1
  • 1 month later...
Posted

is there anyone encounter the same thing as mine? when i click the npc with normal character nothing happens in option menu but the dummy target will spawn another 1 and if you spam the click it will add more. how to fix this problem

  • 5 months later...
  • 2 weeks later...
Posted

Hi Everyone,


I have a script, which keeps on reconfiguring the mapflag

OnBlessingDeactivate:
    for (.@i = 1; .@i < getarraysize(.battleFlag$); .@i++)
        setbattleflag(.battleFlag$[.@i],.defaultRate[.@i]);
    setbattleflag(.battleFlag$[0],.defaultRate[0],true);

I notice that everytime it triggers, the punching bag will keep on announcing the same in infinite loop

image.png.1d5c1b192b86d8595e4a0c388111a676.png

  • 2 weeks later...
  • 3 weeks later...
Posted
// Advance Punching Bag with Parameter settings
// by pajodex
// Video preview : https://www.youtube.com/watch?v=RoLhYx-Iny8

vip_lounge,120,234,4	script	Mudar Atributos#0	858,{
function get_size_name;
function get_race_name;
function get_ele_name;
	ignoretimeout 1;
	mes "Informações atuais do saco de pancadas:";
	.@dupid = atoi(strnpcinfo(2));
	getunitdata .gid[.@dupid], .@data;
	mes "Tamanho: "+ get_size_name(.@data[UMOB_SIZE]);
	mes "Nível: "+ .@data[UMOB_LEVEL];
	mes "Raça: "+ get_race_name(.@data[UMOB_RACE]);
	mes "Elemento: "+ get_ele_name(.@data[UMOB_ELETYPE]) +" Nv. "+ .@data[UMOB_ELELEVEL];
	mes "Status:";
	mes "=======================";
	mes "STR: "+ .@data[UMOB_STR] +"    AGI: "+ .@data[UMOB_AGI] +"    VIT: "+ .@data[UMOB_VIT];
	mes "INT: "+ .@data[UMOB_INT] +"    DEX: "+ .@data[UMOB_DEX] +"    LUK: "+ .@data[UMOB_LUK];
	mes "Defesa: "+ .@data[UMOB_DEF] +"    Defesa Mágica: "+ .@data[UMOB_MDEF];
	next;
	if ( select("> Configurar Parâmetros:Cancelar") == 2 ) {
		mes "Até mais.";
		close;
	}
	do {
		mes "Selecione o parâmetro que deseja alterar.";
		next;
		switch(select("> Tamanho [ ^ff0000"+(.@size_select ? get_size_name(.@UMOB_SIZE):get_size_name(.UMOB_SIZE))+"^000000 ]:> Nível [ ^ff0000"+(.@UMOB_LEVEL ? .@UMOB_LEVEL:.UMOB_LEVEL)+"^000000 ]:> Raça [ ^ff0000"+(.@race_select ? get_race_name(.@UMOB_RACE):get_race_name(.UMOB_RACE))+"^000000 ]:> Elemento [ ^ff0000"+(.@ele_select ? get_ele_name(.@UMOB_ELETYPE):get_ele_name(.UMOB_ELETYPE))+" Nv "+(.@UMOB_ELELEVEL ? .@UMOB_ELELEVEL:.UMOB_ELELEVEL)+"^000000 ]:> Status:> Inserir ID do Monstro [ ^ff0000"+(.val ? getmonsterinfo(.val, MOB_NAME) : "Dummy")+"^000000 ]:^0000ffConcluir^000000")) {
		case 1:
			.@UMOB_SIZE = select("- Pequeno:- Médio:- Grande")-1;
			set .@size_select, true;
			break;
		case 2:
			mes "Insira o nível (1-"+.maxlv+"):";
			next;
			input .@UMOB_LEVEL, 1, .maxlv;
			break;
		case 3:
			.@UMOB_RACE = select("- Amorfo:- Morto-vivo:- Bruto:- Planta:- Inseto:- Peixe:- Demônio:- Humanóide:- Anjo:- Dragão:- Jogador") - 1;
			set .@race_select, true;
			break;
		case 4:
			mes "Selecione o elemento:";
			next;
			.@UMOB_ELETYPE = select("- Neutro:- Água:- Terra:- Fogo:- Vento:- Veneno:- Sagrado:- Sombrio:- Fantasma:- Morto-vivo") - 1;
			set .@ele_select, true;
			mes "Selecione o nível do elemento:";
			next;
			.@UMOB_ELELEVEL = select("Nv 1:Nv 2:Nv 3:Nv 4");
			break;
		case 5:
			mes "Selecione:";
			next;
			switch(select("> STR [ ^ff0000"+(.@UMOB_STR ? .@UMOB_STR:.UMOB_STR)+"^000000 ]:> AGI [ ^ff0000"+(.@UMOB_AGI ? .@UMOB_AGI:.UMOB_AGI)+"^000000 ]:> VIT [ ^ff0000"+(.@UMOB_VIT ? .@UMOB_VIT:.UMOB_VIT)+"^000000 ]:> INT [ ^ff0000"+(.@UMOB_INT ? .@UMOB_INT:.UMOB_INT)+"^000000 ]:> DEX [ ^ff0000"+(.@UMOB_DEX ? .@UMOB_DEX:.UMOB_DEX)+"^000000 ]:> LUK [ ^ff0000"+(.@UMOB_LUK ? .@UMOB_LUK:.UMOB_LUK)+"^000000 ]:> DEF [ ^ff0000"+(.@UMOB_DEF ? .@UMOB_DEF:.UMOB_DEF)+"^000000 ]:> MDEF [ ^ff0000"+(.@UMOB_MDEF ? .@UMOB_MDEF:.UMOB_MDEF)+"^000000 ]")) {
				case 1: .@data$ = "STR"; break;
				case 2: .@data$ = "AGI"; break;
				case 3: .@data$ = "VIT"; break;
				case 4: .@data$ = "INT"; break;
				case 5: .@data$ = "DEX"; break;
				case 6: .@data$ = "LUK"; break;
				case 7: .@data$ = "DEF"; break;
				case 8: .@data$ = "MDEF"; break;
			}
			mes "Insira o valor (1-"+.max_stat+"):";
			next;
			input .val, 1, .max_stat;
			setd ".@UMOB_"+.@data$, .val;
			break;
		case 6:
			mes "Insira o ID do monstro para simulação:";
			next;
			input .val;
			if ( (.@name_english$ = getmonsterinfo(.val, MOB_NAME)) == "null" ) {
				mes "Não foi possível encontrar o ID do monstro "+.val+" na base de dados!";
				next;
				break;
			}
			query_sql("SELECT `element_level` FROM `"+(checkre(0) ? "mob_db_re":"mob_db")+"` WHERE `id` = '"+.val+"'", .UMOB_ELELEVEL);
			.UMOB_LEVEL = getmonsterinfo(.val, MOB_LV);
			.UMOB_SIZE = getmonsterinfo(.val, MOB_SIZE);
			.UMOB_RACE = getmonsterinfo(.val, MOB_RACE);
			.UMOB_ELETYPE = getmonsterinfo(.val, MOB_ELEMENT);
			.UMOB_DEF = getmonsterinfo(.val, MOB_DEF);
			.UMOB_MDEF = getmonsterinfo(.val, MOB_MDEF);
			.UMOB_STR = getmonsterinfo(.val, MOB_STR);
			.UMOB_AGI = getmonsterinfo(.val, MOB_AGI);
			.UMOB_VIT = getmonsterinfo(.val, MOB_VIT);
			.UMOB_INT = getmonsterinfo(.val, MOB_INT);
			.UMOB_DEX = getmonsterinfo(.val, MOB_DEX);
			.UMOB_LUK = getmonsterinfo(.val, MOB_LUK);
			mes "Dados do monstro '"+.@name_english$+" ("+.val+")' aplicados ao saco de pancadas.";
			next;
			break;
		default: // Finalizar
			.@done = true;
			break;
		}
	} while ( !.@done );
	mes "Reveja as configurações antes de invocar:";
	mes "Tamanho: " + get_size_name((.@size_select ? .@UMOB_SIZE : .UMOB_SIZE));
	mes "Nível: " + (.@UMOB_LEVEL ? .@UMOB_LEVEL : .UMOB_LEVEL);
	mes "Raça: " + get_race_name((.@race_select ? .@UMOB_RACE : .UMOB_RACE));
	mes "Elemento: " + get_ele_name((.@ele_select ? .@UMOB_ELETYPE : .UMOB_ELETYPE)) + " Nv. " + (.@UMOB_ELELEVEL ? .@UMOB_ELELEVEL : .UMOB_ELELEVEL);
	mes "Status:";
	mes "=======================";
	mes "STR: " + (.@UMOB_STR ? .@UMOB_STR : .UMOB_STR) + "    AGI: " + (.@UMOB_AGI ? .@UMOB_AGI : .UMOB_AGI) + "    VIT: " + (.@UMOB_VIT ? .@UMOB_VIT : .UMOB_VIT);
	mes "INT: " + (.@UMOB_INT ? .@UMOB_INT : .UMOB_INT) + "    DEX: " + (.@UMOB_DEX ? .@UMOB_DEX : .UMOB_DEX) + "    LUK: " + (.@UMOB_LUK ? .@UMOB_LUK : .UMOB_LUK);
	mes "Defesa: " + (.@UMOB_DEF ? .@UMOB_DEF : .UMOB_DEF) + "    Defesa Mágica: " + (.@UMOB_MDEF ? .@UMOB_MDEF : .UMOB_MDEF);
	next;

	if (select("> Finalizar!:> Cancelar") == 2) close;

	mes "Feito!";
	close2;

	// Aplica os valores configurados
	.UMOB_SIZE = (.@size_select) ? .@UMOB_SIZE : .UMOB_SIZE;
	.UMOB_LEVEL = (.@UMOB_LEVEL) ? .@UMOB_LEVEL : .UMOB_LEVEL;
	.UMOB_RACE = (.@race_select) ? .@UMOB_RACE : .UMOB_RACE;
	.UMOB_ELETYPE = (.@ele_select) ? .@UMOB_ELETYPE : .UMOB_ELETYPE;
	.UMOB_ELELEVEL = (.@UMOB_ELELEVEL) ? .@UMOB_ELELEVEL : .UMOB_ELELEVEL;
	.UMOB_STR = (.@UMOB_STR) ? .@UMOB_STR : .UMOB_STR;
	.UMOB_AGI = (.@UMOB_AGI) ? .@UMOB_AGI : .UMOB_AGI;
	.UMOB_VIT = (.@UMOB_VIT) ? .@UMOB_VIT : .UMOB_VIT;
	.UMOB_INT = (.@UMOB_INT) ? .@UMOB_INT : .UMOB_INT;
	.UMOB_DEX = (.@UMOB_DEX) ? .@UMOB_DEX : .UMOB_DEX;
	.UMOB_LUK = (.@UMOB_LUK) ? .@UMOB_LUK : .UMOB_LUK;
	.UMOB_DEF = (.@UMOB_DEF) ? .@UMOB_DEF : .UMOB_DEF;
	.UMOB_MDEF = (.@UMOB_MDEF) ? .@UMOB_MDEF : .UMOB_MDEF;

	// Remove o monstro anterior e invoca o novo com os parâmetros configurados
	killmonster strnpcinfo(4), strnpcinfo(0) + "::OnMyMobDead";
	donpcevent strnpcinfo(0) + "::OnMyMobDead";
	end;

OnInit:
	// Configurações padrão no início
	.maxlv = 99; // Nível máximo permitido
	.max_stat = 999; // Status máximo permitido
	.UMOB_MAXHP = 2000000000; // HP máximo (não alterar sem entender o impacto)

	.UMOB_SIZE = 1;
	.UMOB_LEVEL = 10;
	.UMOB_RACE = 3;
	.UMOB_ELETYPE = 1;
	.UMOB_ELELEVEL = 1;
	.UMOB_STR = 5;
	.UMOB_AGI = 5;
	.UMOB_VIT = 5;
	.UMOB_INT = 5;
	.UMOB_DEX = 5;
	.UMOB_LUK = 5;
	.UMOB_DEF = 10;
	.UMOB_MDEF = 10;

OnMyMobDead:
	// Reinvoca o monstro ao morrer
	getunitdata(getnpcid(0), .@d);
	if(getmonsterinfo(.val, MOB_NAME) == "null"){set .val, 0;}
	monster strnpcinfo(4), .@d[UNPC_X]-1, .@d[UNPC_Y]+1, (.val ? getmonsterinfo(.val, MOB_NAME) : "Dummy"), (!checkre(0)) ? 1905 : 2411, 1, strnpcinfo(0) + "::OnMyMobDead",0;
	.@dupid = atoi(strnpcinfo(2));
	.gid[.@dupid] = $@mobid[0];
	.mhp[.@dupid] = .UMOB_MAXHP;
	setunitdata .gid[.@dupid], UMOB_MODE, .@d[UMOB_MODE] | 0x4000000 | 0x0200000; // Define imunidade a status especiais
	setunitdata .gid[.@dupid], UMOB_MAXHP, .UMOB_MAXHP;
	setunitdata .gid[.@dupid], UMOB_SIZE, .UMOB_SIZE;
	setunitdata .gid[.@dupid], UMOB_LEVEL, .UMOB_LEVEL;
	setunitdata .gid[.@dupid], UMOB_RACE, .UMOB_RACE;
	setunitdata .gid[.@dupid], UMOB_ELETYPE, .UMOB_ELETYPE;
	setunitdata .gid[.@dupid], UMOB_ELELEVEL, .UMOB_ELELEVEL;
	setunitdata .gid[.@dupid], UMOB_STR, .UMOB_STR;
	setunitdata .gid[.@dupid], UMOB_AGI, .UMOB_AGI;
	setunitdata .gid[.@dupid], UMOB_VIT, .UMOB_VIT;
	setunitdata .gid[.@dupid], UMOB_INT, .UMOB_INT;
	setunitdata .gid[.@dupid], UMOB_DEX, .UMOB_DEX;
	setunitdata .gid[.@dupid], UMOB_LUK, .UMOB_LUK;
	setunitdata .gid[.@dupid], UMOB_DEF, .UMOB_DEF;
	setunitdata .gid[.@dupid], UMOB_MDEF, .UMOB_MDEF;
	setunitdata .gid[.@dupid], UMOB_CLASS, (.val ? .val : 1905);
	initnpctimer;
	end;

OnTimer5000:
	// Atualiza as informações do saco de pancadas a cada 5 segundos
	.@dupid = atoi(strnpcinfo(2));
	if (unitexists(.gid[.@dupid])) {
		getunitdata(.gid[.@dupid], .@d);
		.@diff = (.mhp[.@dupid] - .@d[UMOB_HP]);
		if (.@diff > 0) {
			npctalk "Dummy: Recebi " + F_InsertComma(.@diff / 5) + " DPS nos últimos 5 segundos.";
			setunitdata .gid[.@dupid], UMOB_HP, .mhp[.@dupid];
			specialeffect EF_HEAL;
		}
	}
	initnpctimer;

	function	get_size_name	{
		switch ( getarg(0) ) {
			case 0 : .val$ = "Pequeno"; break;
			case 1 : .val$ = "Médio"; break;
			case 2 : .val$ = "Grande"; break;
		}
		return .val$;
	}
	
	function	get_race_name	{
		switch ( getarg(0) ) {
			case 0: .val$ = "Amorfo"; break;
			case 1: .val$ = "Morto-Vivo"; break;
			case 2: .val$ = "Bruto"; break;
			case 3: .val$ = "Planta"; break;
			case 4: .val$ = "Inseto"; break;
			case 5: .val$ = "Peixe"; break;
			case 6: .val$ = "Demônio"; break;
			case 7: .val$ = "Humanóide"; break;
			case 8: .val$ = "Anjo"; break;
			case 9: .val$ = "Dragão"; break;
			case 10: .val$ = "Jogador"; break;
		}
		return .val$;
	}
	
	function	get_ele_name	{
		switch ( getarg(0) ) {
			case 0: .val$ = "Neutro"; break;
			case 1: .val$ = "Água"; break;
			case 2: .val$ = "Terra"; break;
			case 3: .val$ = "Fogo"; break;
			case 4: .val$ = "Vento"; break;
			case 5: .val$ = "Veneno"; break;
			case 6: .val$ = "Sagrado"; break;
			case 7: .val$ = "Sombrio"; break;
			case 8: .val$ = "Fantasma"; break;
			case 9: .val$ = "Morto-Vivo"; break;
		}
		return .val$;
	}
}
vip_lounge,110,234,4	duplicate(Mudar Atributos#0)	Mudar Atributos#1	858
vip_lounge,110,245,4	duplicate(Mudar Atributos#0)	Mudar Atributos#2	858
vip_lounge,120,245,4	duplicate(Mudar Atributos#0)	Mudar Atributos#3	858

 

Venho compartilhar as mudanças que eu realizei no NPC,
 

poderia incluir em alguma próxima atualização 😄

 

- Quando seleciona o id do mob, o Punching Bag fica com o nome e sprite do mob.
- Realizei uma correção onde não pegava todos atributos do mob(No meu amulador).

- Realizei a tradução para pt-br.

 

Muito obrigado pelo código, ficou muito bom!!!

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...