Jump to content

Elysium

Members
  • Posts

    164
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Elysium

  1. Just now, Poring King said:

    Well to be honest it happen to me before when im trying to make a multiple server  . Same thing happen to me and i solve it thru port that's why i suggest to double check it 

    Thanks for your tips, i'll just wait for another answers. 👍

  2. Hi, does anyone experiencing this technical issues before? I'm currently running for a Test Server under OVH.

    Everytime i login it automatically disconnected that's all and its weird.

    Centos 7 4GB RAM 80 SSD

    There was no errors or something it's running fine both char,login and map-server.
    I'm currently using MySQL 5.6+ since i'm using an Old Emulator. And there was no errors when IMPORTING those database.

    Thank you!

     

    DC.PNG

  3. Hello, i know this is really common questions asking for Refiner something like this but first i tried to search via forum but i couldn't find any exact what i want.
    So my request is an NPC refines a specific ITEMS ONLY.
    Example:

    	setarray [email protected]_loc[0],EQI_HAND_L, EQI_HAND_R;
    	setarray [email protected]_id[0], 1201, 1202, 1203;
    	[email protected]_req_id = 512;

    Each refine cost is x 1 the higher refinement the higher is cost example: + 4 and your going to upgrade for + 5 you need to pay x5 too.
    Thank you!

  4. 2 minutes ago, AnnieRuru said:
    BUILDIN_FUNC(messagecolor) {
    	struct block_list *bl = map_id2bl( script_getnum(st,2) );
    	if (!bl) {
    		ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2));
    		return SCRIPT_CMD_FAILURE;
    	}
    	clif_messagecolor( bl, script_getnum(st,4), script_getstr(st,3), true, AREA);
    	return SCRIPT_CMD_SUCCESS;
    }
    BUILDIN_DEF(messagecolor,"isi"),

     

    Remember the reason why it doesn't work on players, because "@fontcolor" uses a trick to disguise player as monster
    https://github.com/HerculesWS/Hercules/issues/1217
    https://github.com/HerculesWS/Hercules/issues/1930

    Thank you Ma'dam! i'll test it

  5. 9 minutes ago, AnnieRuru said:

    I vaguely remember we discuss about *dispbottom2 and *message2 custom script command during my stay on hercules
    http://herc.ws/board/topic/3899-suggestion-displaybottom-message-colors/?do=findComment&comment=25468


    answer is yes, it just not implemented
    look at the npctalk inside script.cpp, it default to color_table[COLOR_WHITE], this value is hard-coded

    BUILDIN_FUNC(npctalk)
    {
    	struct npc_data* nd = NULL;
    	const char* str = script_getstr(st,2);
    
    	if (script_hasdata(st, 3) && strlen(script_getstr(st,3)) > 0)
    		nd = npc_name2id(script_getstr(st, 3));
    	else
    		nd = (struct npc_data *)map_id2bl(st->oid);
    
    	if (nd != NULL) {
    		send_target target = AREA;
    		char message[CHAT_SIZE_MAX];
    
    		if (script_hasdata(st, 4)) {
    			switch(script_getnum(st, 4)) {
    				case BC_ALL:	target = ALL_CLIENT;	break;
    				case BC_MAP:	target = ALL_SAMEMAP;	break;
    				case BC_SELF:	target = SELF;			break;
    				case BC_AREA:
    				default:		target = AREA;			break;
    			}
    		}
    		safesnprintf(message, sizeof(message), "%s", str);
    		if (target != SELF)
    			clif_messagecolor(&nd->bl, color_table[COLOR_WHITE], message, false, target);
    		else {
    			TBL_PC *sd = map_id2sd(st->rid);
    			if (sd == NULL)
    				return SCRIPT_CMD_FAILURE;
    			clif_messagecolor_target(&nd->bl, color_table[COLOR_WHITE], message, false, target, sd);
    		}
    	}
    	return SCRIPT_CMD_SUCCESS;
    }

     

    so I play around again with it, Hercules plugin of course,

    #include "common/hercules.h"
    #include "map/clif.h"
    #include "map/script.h"
    #include "common/HPMDataCheck.h"
    
    HPExport struct hplugin_info pinfo = {
    	"messagecolor",
    	SERVER_TYPE_MAP,
    	"0.1",
    	HPM_VERSION,
    };
    
    BUILDIN(messagecolor) {
    	struct block_list *bl = map->id2bl( script_getnum(st,2) );
    	if (!bl) {
    		ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2));
    		return false;
    	}
    	clif->messagecolor( bl, script_getnum(st,4), script_getstr(st,3) );
    	return true;
    }
    
    HPExport void plugin_init (void) {
    	addScriptCommand( "messagecolor", "isi", messagecolor );
    }
    prontera,155,185,5	script	kjsdhfksjf	1_F_MARIA,{
    //	messagecolor getcharid(3), "asdfasdf", C_BLUE; <-- doesn't work
    	messagecolor getnpcid(), "asdfasdf", C_BLUE;
    	messagecolor getnpcid(), "asdfasdf", C_RED;
    	messagecolor getnpcid(), "asdfasdf", C_YELLOW;
    	messagecolor getnpcid(), "asdfasdf", C_PINK;
    	messagecolor getnpcid(), "asdfasdf", C_PURPLE;
    	messagecolor getnpcid(), "asdfasdf", C_ORANGE;
    	end;
    }

    screen2019Hercules027.jpg

     

     

    2. forget the whisper feature, that thing is from the past
    everyone use *bindatcmd now

    https://github.com/rathena/rathena/blob/master/doc/whisper_sys.txt

    Could you convert this plugin to rAthena please? instead of Hercules.

  6. Hi, i was wondering what's wrong with the script? i tested it a couple of times somethings going that i couldn't figure it out can i have some a little assistance on the script please.
    Problem: variable .GlobalMessage doesn't show up properly looks like it announces a random items instead of only 1 .set

    prontera,164,173,3	script	Ticket Gambling	562,{
    	mes .n$;
    	for( .@j = 0; .@j < getarraysize(.item); .@j++ ) {
    		mes .qnt[.@j] +"x "+ Itemlink(.item[.@j ]) +"";
        }
    	next;
    	mes .n$;
    	mes "Would you like to insert a Ticket now?";
    	next;
    	if( select("- Insert Ticket:- Cancel") == 2 ) {
    		mes .n$;
    		mes " ";
    		close;
    	}
    	if( countitem(7608) >= 1 ) {
    		mes .n$;
    		mes "^0000FF*You insert the Promotion Ticket into the Machine slot and watch as she pulls the Ticket automatically*^000000";
    		next;
    		mes .n$;
    		mes "This is great! This will be very useful.";
    		delitem 7608,1;
    		for( .@i = 0; .@i < getarraysize(.item); .@i++ ) {
    			if( rand(1,100) <= .chance[.@i] ) {
    				if( .item[.@i] == .GlobalMessage ) {
    			}
    			getitem .item[.@i],.qnt[.@i];
    			.@reward = 1;
    			mes ""+.qnt[.@i]+" x "+Itemlink(.item[.@i])+"";
    			end;
    		}
    	}
    	if( !.@reward ) {
    		.@i = rand(getarraysize(.item));
    		if( .item[.@i] == .GlobalMessage ) {
    			announce "Player "+ strcharinfo(0) +" obtaining "+ .qnt[.@i] +" x "+ getitemname(.item[.@i]) +".",0;
    		}
    		getitem .item[.@i], .qnt[.@i];
    		end;
    	}
    	else {
    		mes "You must have ^008800Premium Ticket^000000 to receive one of the items.";
    		close;
    	}
    }
    
    OnInit:
    	.n$ = "[ Ticket Gambling ]";
    	// Array of items, quantity and chance.
    	// Chance 1 = 0.01
    	setarray .item[0],		30029,	12412,	12915,	12903,	12904,	12908,	12905,	12906,	12907,	12912,	13858,	13588,	12210,	12709,	12710,	13718,	13750,	13756,	13714,	13711,	7608; 
    	setarray .qnt[0],		1,		1,		1,		1,		1,		1,		1,		1,		1,		1,		1,		5,		1,		1,		1,		20,		5,		1,		1,		1,		1;
    	setarray .chance[0], 	50,		1,		1,		1,		1,		1,		1,		1,		1,		1,		1,		1,		1,		3,		3,		3,		3,		5,		5,		10,		10;
    
    	// Send a Global Message to everyone online when win item with id
    	.GlobalMessage = 7608;
    	end;
    }

     

  7. On 3/14/2018 at 4:03 AM, Sehrentos said:

    Thank you for this share.

    I would suggest more loot options like:

    - Reward all near the boss and not just single party.

    - Selective where leader can select what item to who.

    And maby multiple events at once, but not in same map.

    Update: From 2.4 into 2.7 version

    Minor text changes.

    Added WorldBossRadar event NPC to monitor World Boss HP.

     - World Boss HP will increase or decrease by 1.5 mil per each player in 20 cell range and is updated every 10 seconds.

    Added timeout timer to clear expired event monster.

    Added loot mode 1 give one reward to one random party member.

    Added loot modes 4-5 give all/one rewards to all nearby players and their party members.

    Added loot modes 6-7 give all/one rewards to all nearby players.

    Removed Treasure Chest monster and added Treasure Chest NPC's.

    Added multiple events at once, but not in the same map.

    Added loot modes 8-9 give all/one rewards to all players in same map.

    Added double exp and drop rates for 1 hour after boss is killed event. Can be disabled.

    TODO: Loot modes select party members.

    I will try to update this if i forgot to add something.

    Your the best! :D waiting for the TODO to make it complete

    • Like 1
  8. 3 hours ago, Sehrentos said:

    Thank you for this share.

    I would suggest more loot options like:

    - Reward all near the boss and not just single party.

    - Selective where leader can select what item to who.

    And maby multiple events at once, but not in same map.

    Waiting on that update :D

    • Like 2
  9. 47 minutes ago, Jey said:

    Good suggestion @Santafe .

    I'd like to have these kind of atcommands for all status changes in future, for debugging purposes. But that'd need some code refactorizations i think :/

    I think more efficient is doing source modification I think?

  10. 35 minutes ago, Alayne said:

    Here you are. Can't test it right now, but this should more or less be what you're expecting.

    Finally I've made it entirely, as it was easier for me to handle it through array.

    resistantInfos.txt

    If somebody have better ideas than that, you're to go ^^

    You just have to fill pos array, I'm currently only checking Armor and a wrong value of Head. Fill with EQI_ARMOR, EQI_WEAPON...and so on.

    Does not work?
     

    -	script	Resist Manager::alarm	-1,{
        end;
    	
    OnAtcommand:	
    	setarray .@resistsValues[0], 0, 0, 0, 0, 0, 0, 0, 0, 0;
    	setarray .@resistsType$[0], "Fire", "Water", "Wind", "Earth", "Holy", "Dark", "Ghost", "Poison", "Neutral";
    	
    	//ARMOR
    	setarray .@equipPos[0], EQI_ARMOR, EQI_HEAD;
    	freeloop 1;
    	for( .@r = 0; .@r < getarraysize(.@resistsValues); .@r++ ) {
    		for( .@p = 0; .@p < getarraysize(.@equipPos); .@p++ ) {
    			.@id = getequipid(.@pos);
    			
    			//get equip resists
    			.@resistsValues[.@r] += callsub("OnGetResist", .@r, .@id);
    			
    			//now, check cards coumpounded
    			for( .@i = 0; .@i < 4; .@i++ ) {
    				.@id = getequipcardid(.@pos, .@i);
    				if(.@id > 0) {
    					.@resistsValues[.@r] += callsub("OnGetResist", .@r, .@id);
    				}
    			}
    		}
    	}
    	freeloop 0;
    	dispbottom "-------------------Resist Values-------------------";
    	for( .@r = 0; .@r < getarraysize(.@resistsValues); .@r++ ) {
    		dispbottom "	~" + .@resistsType$[.@r] + " --> " + .@resistsValues[.@r];
    	}
    	end;
    	
    OnGetResist:
    	query_sql("SELECT `script` FROM `item_db` WHERE `id` = " + getarg(1), .@result$);
    	if(getarraysize(.@result$) > 0) {
    		.@script$ = .@result$[0];
    		.@seekStr$ = "bonus2 bSubEle,Ele_";
    		switch(getarg(0)) {
    			case 0:
    				.@seekStr$ += "Fire",
    				break;
    			case 1:
    				.@seekStr$ += "Water",
    				break;
    			case 2:
    				.@seekStr$ += "Wind",
    				break;
    			case 3:
    				.@seekStr$ += "Earth",
    				break;
    			case 4:
    				.@seekStr$ += "Holy",
    				break;
    			case 5:
    				.@seekStr$ += "Dark",
    				break;
    			case 6:
    				.@seekStr$ += "Ghost",
    				break;
    			case 7:
    				.@seekStr$ += "Poison",
    				break;
    			case 8:
    				.@seekStr$ += "Neutral",
    				break;
    		}
    		if(compare(.@script$, .@seekStr$) == 1) {
    			explode(.@dest$, .@script$, .@seekStr$);
    			if(getarraysize(.@seekStr$) > 1)
    			{
    				.@valueAfter$ = .@seekStr$[1];
    				explode(.@values$, .@valueAfter$, ";");
    				if(getarraysize(.@values$) > 1) {
    					.@realValue = atoi(.@values$[0]);
    				}
    			}
    		}
    	}
    	return .@realValue;
    	
    OnInit:
    	bindatcmd "resistlist",strnpcinfo(3) + "::OnAtcommand";
    	end;
    }


     

    Capture.PNG

  11. 2 hours ago, Jey said:

    Hey Judas,

    I had the same idea (for WoE statistics) some time ago. And I solved it by just incrementing character variables at the specific src positions:

      src git:(master)  grep -nr "WoE Statistik"
    map/intif.c:286:	if( agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1);// [Jey] WoE Statistik
    map/unit.c:400:	if( bl->type == BL_PC && (agit_flag || agit2_flag) ) pc_setglobalreg(sd,add_str("woestat_walked"), pc_readglobalreg(sd,add_str("woestat_walked"))+1);// [Jey] WoE Statistik
    map/unit.c:1911:		if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_skilluse"), pc_readglobalreg(sd,add_str("woestat_skilluse"))+1);// [Jey] WoE Statistik
    map/clif.c:10760:	if( agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1); // [Jey] WoE Statistik
    map/clif.c:11047:	if(agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1); // [Jey] WoE Statistik
    map/pc.c:5060:	if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_potuse"), pc_readglobalreg(sd,add_str("woestat_potuse"))+1); // [Jey] WoE Statistik
    map/pc.c:5449:		if( sd->vars_ok && (agit_flag || agit2_flag) ) pc_setglobalreg(sd,add_str("woestat_warpcount"), pc_readglobalreg(sd,add_str("woestat_warpcount"))+1);// [Jey] WoE Statistik
    map/pc.c:7586:	// [Jey] WoE Statistik
    map/pc.c:8418:	if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_itemheal"), pc_readglobalreg(sd,add_str("woestat_itemheal"))+hp);// [Jey] WoE Statistik
    map/party.c:938:	if(agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1);// [Jey] WoE Statistik
    map/skill.c:564:	if( sd != NULL && map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_heal"), pc_readglobalreg(sd,add_str("woestat_heal"))+heal);// [Jey] WoE Statistik
    map/skill.c:2584:				if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_broken"), pc_readglobalreg(sd,add_str("woestat_broken"))+1);// [Jey] WoE Statistik
    map/skill.c:8564:			if( sd != NULL && map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_heal"), pc_readglobalreg(sd,add_str("woestat_heal"))+hp);// [Jey] WoE Statistik
    map/skill.c:8754:				if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !dstsd->state.autotrade && !pc_isdead(dstsd) && pc_readglobalreg(dstsd,add_str("nowoe")) == 0) {// [Jey] WoE Statistik
    map/guild.c:1049:	if( agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1);// [Jey] WoE Statistik

    And a NPC which showed the player stats and resets them on ever woe start:

    prontera,218,87,5	script	WoE Statistik	833,{
    OnWhisperGlobal:
    	callfunc "CheckWoEStatReset";
    	mes "Deine letzte WoE Statistik:";
    	mes "Kills: "+woestat_kills;
    	mes "Tode: "+woestat_deaths;
    	if( woestat_deaths > 0 )
    		mes "KDA: "+callfunc("GetPercentage",(woestat_kills*100)/woestat_deaths);
    	else
    		mes "KDA: Perfekt";
    	mes "Maximale Killcombo: "+woestat_killcombo;
    	mes "Heilung gewirkt: "+callfunc("ThousandPoints",woestat_heal);
    	mes "Itemheilung gewirkt: "+callfunc("ThousandPoints",woestat_itemheal);
    	mes "Schaden: "+callfunc("ThousandPoints",woestat_dmgdealt);
    	mes "Schaden erlitten: "+callfunc("ThousandPoints",woestat_tanked);
    	mes "Skills genutzt: "+callfunc("ThousandPoints",woestat_skilluse);
    	mes "Potions genutzt: "+callfunc("ThousandPoints",woestat_potuse);
    	mes "Zerbrochene Rüstung: "+woestat_broken;
    	mes "Chat Kommunikation: "+callfunc("ThousandPoints",woestat_chat);
    	mes "Strecke zurückgelegt: "+callfunc("ThousandPoints",woestat_walked);
    	mes "Höchste AFK-Zeit in Sek.: "+callfunc("ThousandPoints",woestat_idle);
    	mes "Emps gebrochen: "+woestat_empbreak;
    	mes "Gewarpt: "+callfunc("ThousandPoints",woestat_warpcount);
    	close;
    }
    //if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,"woestat_heal", pc_readglobalreg(sd,"woestat_heal")+heal);
    
    //if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,"woestat_chat", pc_readglobalreg(sd,"woestat_chat")+1);
    //if( agit_flag || agit2_flag ) pc_setglobalreg(sd,"woestat_chat", pc_readglobalreg(sd,"woestat_chat")+1);
    // return pc_setpos((TBL_PC*)bl, map_id2index(m), x, y, type);
    function	script	CheckWoEStatReset	{
    	if( playerattached() &&  woestat_id != $LastWoEID )
    	{
    		set woestat_id,$LastWoEID; //Day of the Year
    		woestat_kills = 0;
    		woestat_deaths = 0;
    		woestat_killcombo = 0;
    		woestat_killcombo_tmp = 0;
    		woestat_heal = 0;
    		woestat_itemheal = 0;
    		woestat_dmgdealt = 0;
    		woestat_tanked = 0;
    		woestat_skilluse = 0;
    		woestat_potuse = 0;
    		woestat_broken = 0;
    		woestat_chat = 0;
    		woestat_walked = 0;
    		woestat_idle = 0;
    		woestat_empbreak = 0;
    		woestat_warpcount = 0;
    	}
    	return;
    }
    
    -	script	WoEStats	-1,{
    	end;
    OnAgitStart:
    OnAgitStart2:
    OnAgitNStartBE:
    OnAgitNStartTE:
    	initnpctimer;
    	$LastWoEID++;
    	addrid(0);
    OnPCLoginEvent:
    	callfunc "CheckWoEStatReset";
    	end;
    
    OnPCKillEvent:
    	if( callfunc("onActiveGuildCastle") )
    	{
    		woestat_kills++;
    		woestat_killcombo_tmp++;
    		if( woestat_killcombo_tmp > woestat_killcombo ) set woestat_killcombo,woestat_killcombo_tmp;
    	}
    	end;
    
    OnPCDieEvent:
    	if( callfunc("onActiveGuildCastle") )
    	{
    		woestat_deaths++;
    		woestat_killcombo_tmp = 0;
    	}
    	end;
    
    OnAgitEnd:
    OnAgitEnd2:
    OnAgitNEndBE:
    OnAgitNEndTE:
    	stopnpctimer;
    
    OnTimer30000: //Alle 30 Sekunden Idletimecheck (Relativ ungenau, aber egal.)
    	addrid(0);
    	set .@idle,checkidle();
    	if( .@idle > woestat_idle ) set woestat_idle,.@idle;
    	end;
    }

    It likely isn't the best approach, but at least it worked fine

     

    To answer your question properly:

    1. Simple OnPCKillEvent script.
    2. SRC edit by comparing the character variable
    3. same as 2.
    4. SRC edit incrementing the character variable

    Jey can you share the full script of this? that would be appreciated.

×
×
  • Create New...

Important Information

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