Jump to content

Hyroshima

Members
  • Content Count

    47
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Hyroshima


  1. Baron of Cards


    By deliver with noble items to the baron he will allow you to try your luck in your card game, being able to get cards mini-boss, mvps or common.

    Important: I was unable to upload the illustration images (always returns error -200), they are just images to use in cutin, here directly from my domain: (3mb):
    https://hyroshima.com/files/Card_illust.zip

    VirusTotal Rash: 59bd666490e2258c62c367200d3079d36a05f6e67349d5331a6f8987d36a65ca

    OBS: It is necessary to add the functions to manipulate arrays and found here: 

     

    https://www.youtube.com/watch?v=BIfQYpXqsPg


     


  2. It's not a big deal but I'm providing a utility that I made because I hadn't found anything that did this, basically you pass 2 guild IDs to check if they are allies, 1 for true and 0 for false.

     

    script.c

    /*
    //Hyroshima *guild_ally(guild_id1,guild_id2)
    //=
    PARAM 1 (guild1)
    PARAM 2 (guild2)
    RETURN 0= false, 1= true
    */
    static BUILDIN(guild_ally)
    {
        int guild1,guild2 = 0;
    
    	if(script_getnum(st,2) == script_getnum(st,3))
    	{
    		ShowError("buildin_guild_ally: guild_id1(%d) cannot be equal to guild_id2(%d).\n",script_getnum(st,2),script_getnum(st,3));
    		script_pushint(st,0);
    		return true;
    	}
    	
    	guild1 = script_getnum(st,2);
    	guild2 = script_getnum(st,3);
    	
    	if(guild->search(guild1) == NULL)
    	{
    		ShowError("buildin_guild_ally: Guild does not exist (guild_id1: %d).\n",guild1);
    		script_pushint(st,0);
    		return true;
    	}
    	if(guild->search(guild2) == NULL)
    	{
    		ShowError("buildin_guild_ally: Guild does not exist (guild_id2: %d).\n",guild2);
    		script_pushint(st,0);
    		return true;
    	}
    
    	script_pushint(st,guild->isallied(guild1,guild2));
        return true;
    }

     

    BUILDIN_DEF(guild_ally,"ii"),

     

     


  3. //Add a call function in item
    // callfunc "Boxx";
    
    function	script	Boxx	{
    
    	//Item ID
    	//==
    	setarray .@ItemID[0],1108,2104,5011,2301,2404;
    	setarray .@itemRF[0],  10,  10,  10,   7,  10;
    
    	//check if you still have an item with a refine lower than 10
    	//==
    	for(set .@i,0; .@i<getarraysize(.@ItemID); set .@i,.@i+1)
    		if((getd("eqi_"+.@ItemID[.@i])-1) < .@itemRF[.@i]) setarray .@equips[getarraysize(.@equips)],.@ItemID[.@i];
    	
    	//All max refined
    	//==
    	if(!getarraysize(.@equips)){ dispbottom "Bye bye."; end; }
    	
    	set .@idx,rand(getarraysize(.@equips));
    	set .@slot,getiteminfo(.@equips[.@idx],ITEMINFO_LOC);
    	
    	switch(.@slot)
    	{
    		case 2: set .@slot,EQI_HAND_R; break;
    		case 16: set .@slot,EQI_ARMOR; break;
    		case 32: set .@slot,EQI_HAND_L; break;
    		case 64: set .@slot,EQI_SHOES; break;
    		case 256: set .@slot,EQI_HEAD_TOP; break;
    	}	
    
    	if(getd("eqi_"+.@equips[.@idx]))
    	{		
    		if(!countitem(.@equips[.@idx])){ dispbottom "Item not found "+getitemname(.@equips[.@idx])+"!"; end; }
    		if(getequipid(.@slot) != .@equips[.@idx]) equip .@equips[.@idx];
    
    		successrefitem .@slot;
    		setd "eqi_"+.@equips[.@idx],getd("eqi_"+.@equips[.@idx])+1;
    	}
    	else
    	{ setd "eqi_"+.@equips[.@idx],1; getitem .@equips[.@idx],1; }
    	
    end;
    }

    I haven't tested it, check if it will work as you wanted.


  4. I made this model as you explained how it works.

     

    //Add a call function in item
    // callfunc "Boxx";
    
    function	script	Boxx	{
    
    	//Item ID
    	//==
    	setarray .@ItemID[0],1108,2104,5011,2301,2404;
    
    	//check if you still have an item with a refine lower than 10
    	//==
    	for(set .@i,0; .@i<getarraysize(.@ItemID); set .@i,.@i+1)
    		if((getd("eqi_"+.@ItemID[.@i])-1) < 10) setarray .@equips[getarraysize(.@equips)],.@ItemID[.@i];
    	
    	//All refined +10
    	//==
    	if(!getarraysize(.@equips)){ dispbottom "Bye bye."; end; }
    	
    	set .@idx,rand(getarraysize(.@equips));
    	set .@slot,getiteminfo(.@equips[.@idx],ITEMINFO_LOC);
    	
    	switch(.@slot)
    	{
    		case 2: set .@slot,EQI_HAND_R; break;
    		case 16: set .@slot,EQI_ARMOR; break;
    		case 32: set .@slot,EQI_HAND_L; break;
    		case 64: set .@slot,EQI_SHOES; break;
    		case 256: set .@slot,EQI_HEAD_TOP; break;
    	}	
    
    	if(getd("eqi_"+.@equips[.@idx]))
    	{		
    		if(!countitem(.@equips[.@idx])){ dispbottom "Item not found "+getitemname(.@equips[.@idx])+"!"; end; }
    		if(getequipid(.@slot) != .@equips[.@idx]) equip .@equips[.@idx];
    
    		successrefitem .@slot;
    		setd "eqi_"+.@equips[.@idx],getd("eqi_"+.@equips[.@idx])+1;
    	}
    	else
    	{ setd "eqi_"+.@equips[.@idx],1; getitem .@equips[.@idx],1; }
    	
    end;
    }

     


  5. Sorry but it's still a little confusing for me to understand.

    let's do it like this, tell me what you want the script to do, so that instead of looking for a solution for this model you mentioned, I can create one without using your base.

    🙂

    without using codes, just place an order xD


  6. 5 hours ago, Kian said:

    Alguém poderia me ajudar em um npc que somente Alquimista e evoluções usa-se e que teleporte para o mapa alquimista1 31 172

    seria isso?

    prontera,151,169,5	script	Alquimista Teleport	113,{
    
    	if(Class == 5 || Class == 18 ||  Class == 4019)
    	{
    		dispbottom "class: "+Class+"";
    		mes "Você pode ser teleportado.";
    		next;
    		warp "prontera",150,150;
    		end;
    	}
    	mes "Somente Alquimistas podem usar esse npc.";
    	close;
    }

     


  7. I made this function for a friend and it can be useful in general. 

    basically allows you to add wait time for something in npc, you can put different times in the same npc using the reference names.

    a utility to put in Global_Functions

     

    //== Function F_SetNpcCD ================================
    // Add cooldown to access specific functions of a pc but not limited
    //==
    // callfunc "F_SetNpcCD","reference_name",time_in_seconds{,cooldown type};
    // Examples:
    //    callfunc("F_SetNpcCD","name_example0",45)		// Adds 45 second cooldown at player level
    //    callfunc("F_SetNpcCD","name_example1",85,1)	// Adds 1 minute 25 second cooldown at player level
    //    callfunc("F_SetNpcCD","name_example2",120,2)	// Adds 2-minute cooldown at account level
    function	script	F_SetNpcCD	{
    	set .@var$,(countstr(getarg(0)," ")?replacestr(getarg(0)," ","_"):getarg(0));
    	set .@time,getarg(1);
    	set .@type,getarg(2,0);
    	setd(""+(.@type==2?"#":"")+""+.@var$+"_time",gettimetick(2)+.@time);
    return;
    }
    
    //== Function F_GetNpcCD ================================
    // Check npc access cooldown
    //==
    // callfunc "F_GetNpcCD","name_example"{,cooldown type};
    // Examples:
    //    callfunc("F_GetNpcCD","name_example0")	// returns "NPC Cooldown: 00H:00M:45s (player)"
    //    callfunc("F_GetNpcCD","name_example1",1)	// returns "NPC Cooldown: 00H:01M:25s (player)"
    //    callfunc("F_GetNpcCD","name_example2",2)	// returns "NPC Cooldown: 00H:02M:00s (account)"
    function	script	F_GetNpcCD	{
    	set .@var$,(countstr(getarg(0)," ")?replacestr(getarg(0)," ","_"):getarg(0));
    	set .@type,getarg(1,0);
    	
    	if(gettimetick(2) < getd(""+(.@type==2?"#":"")+""+.@var$+"_time"))
    	{
    		set .@ts,getd(""+(.@type==2?"#":"")+""+.@var$+"_time")-gettimetick(2);
    		set .@h,.@ts/3600;
    		set .@m,(.@ts%3600)/60;
    		set .@s,.@ts%60;
    		dispbottom "NPC Cooldown: "+(.@h<10?"0"+.@h:.@h)+"H:"+(.@m<10?"0"+.@m:.@m)+"M:"+(.@s<10?"0"+.@s:.@s)+"s ("+(.@type==2?"account":"player")+")";
    		end;
    	}
    return;
    }

     


  8. 2 hours ago, KeiKun said:

    It's not really a bug on current Hercules, even if i use a clean pre-re Hercules like here:

     

     

    it looks fine, try to update your hercules.

     

    EDIT:
    just in case you're wondering... image shows me using @monster 1001 5 then proceed with @killmonster shows there that 5 monster dropped the cards as expected

    I think you didn't see when I said that I tested both in an old and current revision and both present the same result.

    the information is there, if anyone is willing to check the consistency or not, it doesn't matter.


  9. 1 hour ago, KeiKun said:

     

    Drops: { Scorpion_Card: 10000 }

    
    
     

    Unable to reproduce the item not dropping twice, even though rates are maxed... 10000 = 100%

    apparently the problem is happening with rates at 1x (100) and the mob_db drop at 10000 (100%).

    I found there on git in edits 2 related problem, a friend who has an older revision that doesn't have the current formula doesn't have this problem.

    I did the same test in rA and it is normal without this problem.
    my friend's is like this (because it's a previous review it's normal):

    if (src) {
      //Drops affected by luk as a fixed increase [Valaris]
      if (battle_config.drops_by_luk)
        drop_rate += status_get_luk(src)*battle_config.drops_by_luk/100;
      //Drops affected by luk as a % increase [Skotlex]
      if (battle_config.drops_by_luk2)
        drop_rate += (int)(0.5+drop_rate*status_get_luk(src)*battle_config.drops_by_luk2/10000.);
    }

    and the current one is like this:

    if (src != NULL) {
      //Drops affected by luk as a fixed increase [Valaris]
      if (battle_config.drops_by_luk)
        drop_rate += status_get_luk(src) * battle_config.drops_by_luk / 100;
    
      //Drops affected by luk as a % increase [Skotlex]
      if (battle_config.drops_by_luk2)
        drop_rate += (int)(0.5 + drop_rate * status_get_luk(src) * battle_config.drops_by_luk2 / 10000.);

     

    and now it has this part:

    if (sd != NULL) {
      int drop_rate_bonus = 100;
    
      // When PK Mode is enabled, increase item drop rate bonus of each items by 25% when there is a 20 level difference between the player and the monster.[KeiKun]
      if (battle_config.pk_mode && (md->level - sd->status.base_level >= 20))
        drop_rate_bonus += 25; // flat 25% bonus 
    
      drop_rate_bonus += sd->dropaddrace[md->status.race] + (is_boss(src) ? sd->dropaddrace[RC_BOSS] : sd->dropaddrace[RC_NONBOSS]); // bonus2 bDropAddRace[KeiKun]
    
      if (sd->sc.data[SC_CASH_RECEIVEITEM] != NULL) // Increase drop rate if user has SC_CASH_RECEIVEITEM
        drop_rate_bonus += sd->sc.data[SC_CASH_RECEIVEITEM]->val1;
    
      if (sd->sc.data[SC_OVERLAPEXPUP] != NULL)
        drop_rate_bonus += sd->sc.data[SC_OVERLAPEXPUP]->val2;
    
      drop_rate = (int)(0.5 + drop_rate * drop_rate_bonus / 100.);
    
      // Limit drop rate, default: 90%
      drop_rate = min(drop_rate, 9000);
    }
    }

     

    I'm just reporting it and seeing if it's really a problem because I encountered this while doing a script and I wasn't getting the result I should have.

     

    https://github.com/HerculesWS/Hercules/pull/3083

    https://github.com/HerculesWS/Hercules/pull/2983
     


  10. Hi guys, maybe I'm doing something wrong that I haven't noticed yet.

    the issue is that I didn't change the drop rates, I just went there on mob_db (mob_id 1101) and changed the item rate to 10000 (100%), so the item should drop whenever I kill mob 1101 correct? As I show in the video this does not happen.

    I tested it in a review (19792) and in the current one and both present this result.

    tested on renewal and pre-renewal both with same result.

    https://streamable.com/r539vo

    apparently it is correct as per this: https://github.com/HerculesWS/Hercules/pull/2970/commits/6f7680b47bcffaf6613f72b462f545e11d40957d

     

     


  11. On 5/13/2021 at 6:23 PM, Nakano15 said:

    I had quite a surprise, when I found out that switch only works for integer variables, and not for string.

    Someone knows if there's an alternative command that allows me to do that?

    You can turn the string into a number and then use the switch, give an example of how you would like to use that i make an example model.


  12. Hey guys.

     

    So, for some time I was creating an instance with interactive npcs, that walk around the map to give more immersion in the story.

    I was using a client 2018, so I tried it on a newer client in 2020 and it didn't work, so I went looking for where it was working to try to resolve it.

     

    maximum client that is working: 2019-05-08cRagexe  (any client after that does not work.)

     

    I did the test on both rA and Hercules, i got the same result as shown in the video below.  (Left does not work & Right work!)
    I am a few days trying to see if I can solve it but I have not succeeded so far.

     

    code used for testing:

    prontera,155,178,3	script	testeeee	1039,{
    
    
    	sleep 1500;
    	setarray .@x[0],151,155,158,155;
    	setarray .@y[0],175,173,175,178;
    	freeloop(1);
    	while(true)
    	{		
    		npcwalkto .@x[.@i],.@y[.@i];
    		set .@i,(.@i >= getarraysize(.@x) ? 0:.@i+1);
    		sleep 2500;
    	}
    	freeloop(0);
    	
    end;
    }


     

     

     


  13. I was using this mod from the normal goddameit on windows (vs), but when I tried to compile in linux he accused the lack of a windows library: WINSOCK2.H

    would it be possible to convert the ping.c code for linux centos and maintain the same functionality?

     

    ping.c

    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif
    
    #include <WINSOCK2.H>
    #define DEF_BUF_SIZE 1024  
    #define IP_HEADER_SIZE 20  
    #define ICMP_HEADER_SIZE 12    
    typedef struct _ICMP_HEADER  
    {  	
    	BYTE bType;
    	BYTE bCode;
    	USHORT nCheckSum;
    	USHORT nId;
    	USHORT nSequence;
    	UINT nTimeStamp;
    }ICMP_HEADER, *PICMP_HEADER;    
    USHORT GetCheckSum(LPBYTE lpBuff, DWORD dwSize)
    {
    	DWORD dwCheckSum = 0;
    	USHORT* lpWord = (USHORT*)lpBuff;  
    	while(dwSize > 1)  	
    	{  		
    		dwCheckSum += *lpWord++;
    		dwSize -= 2;
    	}  	
    	if(dwSize ==1)  	
    		dwCheckSum += *((LPBYTE)lpBuff);
    	dwCheckSum = (dwCheckSum >> 16) + (dwCheckSum & 0XFFFF);
    	return (USHORT)(~dwCheckSum);  
    }    
    BOOL Ping(char* lpDestIP, int *nRet_, int *nTime_)
    {
    	int nTime = 0;
    	int ret = 0;
    	char ICMPPack[ICMP_HEADER_SIZE] = {0};
    	char szRcvBuff[DEF_BUF_SIZE] = {0};
    	int i = 0;
    	int nRet = 0;
    	int nLen = 0;
    	int nError = 0;
    	SOCKET s;
    	PICMP_HEADER pRcvHeader;
    	SOCKADDR_IN SourceSockAddr;
    	SOCKADDR_IN DestSockAddr;
    	PICMP_HEADER pICMPHeader;
    	DestSockAddr.sin_family = AF_INET;
    	DestSockAddr.sin_addr.S_un.S_addr = inet_addr(lpDestIP);
    	DestSockAddr.sin_port = htons(0);
    	pICMPHeader = (PICMP_HEADER)ICMPPack;  
    	pICMPHeader->bType = 8;
    	pICMPHeader->bCode = 0;
    	pICMPHeader->nId = (USHORT)GetCurrentProcessId();
    	pICMPHeader->nCheckSum = 0;
    	pICMPHeader->nTimeStamp = 0;
    	s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
    	nTime = 1000;
    	ret = setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*)&nTime, sizeof(nTime));
    	for(i=0; i <1; i++)  	
    	{  		
    	pICMPHeader->nCheckSum = 0;
    		pICMPHeader->nSequence = i;
    		pICMPHeader->nTimeStamp = GetTickCount();
    		pICMPHeader->nCheckSum = GetCheckSum((LPBYTE)(ICMPPack), ICMP_HEADER_SIZE);
    		nRet = sendto(s, ICMPPack, ICMP_HEADER_SIZE, 0, (SOCKADDR*)&DestSockAddr, sizeof(DestSockAddr)); 
    		if(nRet == SOCKET_ERROR)
    		{ 
    			return FALSE;
    		}  		
    		nLen = sizeof(SOCKADDR_IN);
    		if(nRet == SOCKET_ERROR)
    		{
    			return FALSE;
    		}
    		nRet = recvfrom(s, szRcvBuff,DEF_BUF_SIZE,0,(SOCKADDR*)&SourceSockAddr,&nLen);
    		if(nRet == SOCKET_ERROR)
    		{
    			return FALSE;
    		}
    		pRcvHeader = (PICMP_HEADER)(szRcvBuff + IP_HEADER_SIZE);
    		nTime = GetTickCount() - pRcvHeader->nTimeStamp;
    		//printf("Return Message: %s bytes=%d time=%dms\n", inet_ntoa(SourceSockAddr.sin_addr), nRet, nTime);
    		*nRet_ = nRet;
    		*nTime_ = nTime;
    	}
    	return TRUE;
    }

     

    original link: https://rathena.org/board/files/file/2770-ping-ip-address/


  14. 13 hours ago, 4144 said:

    Open externalsettings_LANG.lub or externalsettings_LANG_sak.lub in text editor, here LANG is your language what you configured

    And replace Doram = true to Doram = false

     

    looool thank you very much, i had no idea of this method.

     


  15. try this way:

    -	trader	Shop1	FAKE_NPC,{
    
    OnInit:
    	tradertype(NST_BARTER);
    	sellitem White_Herb, 100, Red_Potion, 2;
    	sellitem Blue_Herb, 200, Orange_Potion, 3;
    	end;
    }
    
    -	trader	Shop2	FAKE_NPC,{
    
    OnInit:
    	tradertype(NST_BARTER);
    	sellitem Green_Herb, 100, Red_Potion, 4;
    	sellitem White_Herb, 100, Orange_Potion, 1;
    	end;
    }
    
    -	trader	Shop3	FAKE_NPC,{
    
    OnInit:
    	tradertype(NST_BARTER);
    	sellitem Apple, -1, Orange_Potion, 1;
    	sellitem Praetorian_Shield, 100, Berserk_Potion, 10;
    	end;
    }
    
    
    prontera,159,284,4	trader	Barter Shop	4_M_KID1,{
    
    	mes "Select the shop for open!";
    	switch(select("Shop 1:Shop 2:Shop 3"))
    	{
    		case 1: close2; openshop "Shop1"; break;				
    		case 2: close2; openshop "Shop2"; break;
    		case 3: close2; openshop "Shop3"; break;
    	}
    	end;
    }

     


  16. I did it in the following way, I hope it helps.

    prontera,161,181,5	script	Test Code	112,{
    
    	//delete arrays permanent in npc
    	deletearray .resultn[0],getarraysize(.resultn);
    	deletearray .result$[0],getarraysize(.result$);
    
    	for(set .@i,1; .@i<=3; set .@i,.@i+1)
    	{		
    		switch(.@i)
    		{	
    			//arrays temporary
    			case 1:	setarray .@arrayn[1],1,2,3,4,5;			setarray .@array$[1],"a","b","c","d","e";		break;
    			case 2:	setarray .@arrayn[1],6,7,8,9,10,11;		setarray .@array$[1],"f","g","h","i","j","k";	break;
    			case 3:	setarray .@arrayn[1],12,13,14,15;		setarray .@array$[1],"l","m","n","o";			break;
    		}
    		
    		//Save values
    		setarray .resultn[.@i],.@arrayn[rand(1,getarraysize(.@arrayn)-1)];
    		setarray .result$[.@i],.@array$[rand(1,getarraysize(.@array$)-1)];
    		
    		//show values
    		dispbottom ".resultn value["+.@i+"]: "+.resultn[.@i];
    		dispbottom ".result$ value["+.@i+"]: "+.result$[.@i]+"";
    		
    		//delete array temporary
    		deletearray .@arrayn[0],getarraysize(.@arrayn);
    		deletearray .@array$[0],getarraysize(.@array$);
    	}
    	end;
    }

     


  17. 3 hours ago, 4144 said:

    at first you need grf/data and other files from zero client (files from other kro clients will not works)

    Then download exe what you like from here http://nemo.herc.ws/downloads/

    At bottom of page with your client exe you can see instructions how build hercules.

     

    Nemo patches you can use recommended. Yes some will fail with errors and this is fine.

     

    thanks for replying, i already downloaded the ro zero client, i haven't chosen a hexed yet because I don't know which one would be recommended (stable).


  18. Hello, I would like to know what is needed so that I can set up a client that works with hexeds re_zero, i tried in several ways using nemo (4144) diff more happen a lot of errors.

     

    I searched the forum but nothing that could give me a light.

    RO Zero hexed version: ?
    Packet MMO: ?

    if not asking too much I just wanted an instruction on what I really need to do that I manage.

    Since already thank you very much by Hyro~ ^^


  19. On 7/29/2019 at 6:29 AM, bWolfie said:

    Hyroshima wants to use a callfunc() every time a skill is used.

    E.g. player uses skill 'Magnum Break', every time it occurs callfunc("F_Test") happens.

    I added a custom skill and that skill will call the function I created ... but I had to pass some parameters, because each custom skill would perform a different action within the function!

    The solution I had was to create separate files just to call the function with the params for each custom skill.

    solved~

    ty all!

     



     

×
×
  • Create New...

Important Information

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