Jump to content

Hyroshima

Members
  • Posts

    163
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Hyroshima

  1. I would like to share what happened to me, after trying to save the account_id in <New NPC hidden name> the map-server ended up crashing, I tried in several ways to understand what was happening, until testing the problem was in the name hidden that I was trying to save, until I went to the src code and verified that the limit for the name was being used NAME_LENGTH which has a small limit instead of NPC_NAME_LENGTH, after making the change it worked as it should.

    strangely it should point out the error with a very long name but it didn't happen and it crashed.

  2. I analyzed the situation and arrived at the following solution, instead of creating a loop instance for each player, I made a single loop, you must add the callfunc as it is in the comment at the beginning, so the players will have their accid and charid saved, the script will monitor their flee, when there is a change and pass the check within the delay, the script will unequip the item and equip it thus giving the new bMaxSP

     

    /*
    	add in item_db:
    	
    	EquipScript: |
               callfunc "ItemSCset",1;
        UnEquipScript: |
               callfunc "ItemSCset",2;
    */
    
    //Main Script
    //== by Hyroshima
    //==
    -	script	ItemSCcontrol	FAKE_NPC,{
    OnInit:
    
    	//Delay check in sec
    	set .@dSec,5;
    	
    	//ItemID
    	set .@item,2501;
    
    	freeloop(1);
    	while(1)
    	{
    		if(getarraysize($ItemSCaccountid))
    		{
    			for(set .@i,getarraysize($ItemSCaccountid)-1; .@i>-1; set .@i,.@i-1)
    			{
    				if(isloggedin($ItemSCaccountid[.@i],$ItemSCcharid[.@i]))
    				{
    					attachrid($ItemSCaccountid[.@i]);
    					if(readparam(bFlee) != ItemSCflee)
    					{
    						for(set .@x,0; .@x<14; set .@x,.@x+1)
    							if(getequipid(.@x) == .@item){ set .@slot,.@x; break; }
    						unequip .@slot;
    						equip .@item;
    						set ItemSCflee,readparam(bFlee);
    					}
    					detachrid;
    				}
    			}
    		}
    	
    		sleep (.@dSec*1000);
    	}
    	freeloop(0);
    	
    end;
    }
    
    //Function Script
    //==
    function	script	ItemSCset	{
    
    	if(getarg(0) == 1)
    	{
    		setarray $ItemSCaccountid[getarraysize($ItemSCaccountid)],getcharid(3);
    		setarray $ItemSCcharid[getarraysize($ItemSCcharid)],getcharid(0);
    		set ItemSCflee,readparam(bFlee);
    	}
    	else
    	{
    		deletearray $ItemSCaccountid[inarray($ItemSCaccountid[0],getcharid(3))],1;
    		deletearray $ItemSCcharid[inarray($ItemSCcharid[0],getcharid(0))],1;
    		set ItemSCflee,0;
    	}
    
    return;
    }

     

    • Love 1
  3. 5 hours ago, dckk said:

    Hi, as the title reads I'm looking for a way to loop an item script while it's equipped.

    I've been researching about this but I can't seem to find docs about it or examples, which I'd definitely need since my scripting experience is very limited. 

    At the moment what I'd like to do is a simple script: { 1 bonus bFlee,15; bonus bMaxSP,readparam(bFlee); }

    My problem is that as I just found out, item scripts only check parameters on equip/player reload and that would make this item very abusable since one could just equip FLEE gear, wear it and then swap it off while keeping the bonus. 

    To avoid that (and also to make usable a lot more item scripts I have planned) I'd need to know how to make loop every couple seconds so the bonus is recalculated as the parameter changes.

    Any pointers will be greatly appreciated, and if a way to loop does exist I'd be very thankful for an example. 

     

    hello, I don't understand very well, could you simulate a situation so that I can set up an example for you?

  4. 10 hours ago, WhiteEagle said:

    Sure sure.^^
    Here an excample: We have 999 Silvervines and I buy 99 pieces.
    Unbenannt.PNG.01d7a885f2964a50c356f1778c201ed8.PNG

    So just 900 Silvervines are left for the whole server.
    But my wish is that the 99 pieces are removed only for me and not for the whole server.
    So everyone has the "own" stack in the shop.
    Unbenannt2.PNG.52ac4eac60b5b9069571330bcba1c202.PNG

    unfortunately I can't help you, I went to look at how the barter is working in rathena and it's a separate system that can't be manipulated via npc script.   ;/

    in this case it will be necessary to modify the src where I do not have a good knowledge ;/

  5. 6 hours ago, XILeonIX said:

    Sem título.png

     

    replace this:

    dispbottom "You've spent one minute in WoE and gained a WoE point."
    dispbottom "Total points earned: +woepoints;

    that is why:

    dispbottom "You've spent one minute in WoE and gained a WoE point.";
    dispbottom "Total points earned: "+woepoints;


     

    • Upvote 1
  6. //===== Hercules Script ===========================================
    //= King of Emperium Hill
    //===== By: =======================================================
    //= AnnieRuru
    //===== Current Version: ==========================================
    //= 1.2
    //===== Compatible With: ==========================================
    //= hercules & rathena 2018-04-08
    //===== Description: ==============================================
    //= defends the emperium in the middle of the map until times up
    //===== Topic =====================================================
    //= http://hercules.ws/board/topic/4495-gvg-king-of-emperium-hill/
    //===== Additional Comments: ======================================
    //= Finally there is a topic for this !
    //=================================================================
    
    -	script	KoE	FAKE_NPC,{
    OnInit:
    	hideonnpc "The King#KoE";
    	disablenpc "Exit#KoE";
    	bindatcmd "koe", strnpcinfo(0)+"::OnCommand", 99,100;
    	end;
    OnCommand:
    	if ( compare( .@atcmd_parameters$, "on" ) ) goto L_start;
    	else if ( compare( .@atcmd_parameters$, "off" ) ) goto L_end;
    	else {
    		dispbottom "type - '@koe on' to start the event";
    		dispbottom "type - '@koe off' to end the event";
    	}
    	end;
    L_start:
    OnSun2000: // everyday 8pm starts
    	if ( .start ) end;
    	gvgon "koe";
    	announce "The King of Emperium Hill has begun!", bc_all;
    	.start = true;
    	hideoffnpc "The King#KoE";
    	disablenpc "Exit#KoE";
    	$koegid = 0;
    	donpcevent "::OnRevKoE";
    	maprespawnguildid "koe", $koegid, 3;
    	killmonster "koe", "KoE::OnEmpDead";
    	monster "koe",49,49, "EMPERIUM", 1288, 1, "KoE::OnEmpDead";
    	end;
    L_end:
    OnSun2100: // everyday 8:30pm ends
    	gvgoff "koe";
    	announce "The King of Emperium Hill is over!", bc_all;
    	.start = 0;
    	enablenpc "Exit#KoE";
    	disablenpc "The King#KoE";
    	killmonster "koe", "KoE::OnEmpDead";
    	maprespawnguildid "koe", $koegid, 2; // uncomment this line to kick non-owner off the map when event ends
    	end;
    OnEmpDead:
    	$koegid = getcharid(2);
    	announce "The current King of Emperium Hill is the ["+ strcharinfo(2) +"] guild.", bc_all;
    	donpcevent "::OnRevKoE";
    	maprespawnguildid "koe", $koegid, 2;
    	killmonster "koe", "KoE::OnEmpDead";
    	sleep 500;
    	if ( .start )
    		monster "koe",50,50, "EMPERIUM", 1288, 1, "KoE::OnEmpDead";
    	end;
    }
    
    // KoE Entrance
    prontera,155,191,4	script	The King#KoE	1_M_MERCHANT,{
    	mes "[The King]";
    	if ( !getcharid(2) ) {
    		mes "You must have a guild to participate in the ^FF0000King of Emperium Hill Tournament^000000.";
    		close;
    	}
    	mes "Hello.";
    	mes "Would you like to participate in the ^FF0000King of Emperium Hill Tournament^000000?";
    	if ( select ( "Yes", "No" ) == 2 ) close;
    	if ( !getvariableofnpc( .start, "KoE" ) ) close;
    	switch( rand(1,4) ){
    	case 1:	warp "koe", 14, 17; end;
    	case 2:	warp "koe", 14, 84; end;
    	case 3:	warp "koe", 85, 84; end;
    	case 4:	warp "koe", 85, 16; end;
    	}
    }
    
    // KoE Exit
    koe,49,56,5	script	Exit#KoE	1_M_BARD,{
    	mes "[Exit]";
    	mes "See ya.";
    	close2;
    	warp "Save",0,0;
    	if ( getcharid(2) == $koegid )
    		getitem 7539, 1; // configure prize here - Poring Coin
    	end;
    }
    
    // Flags
    koe,25,74,5	script	King of Emperium Hill#1::koe_flag	GUILD_FLAG,{
    	if ( !$koegid ) end;
    	mes "[King of Emperium Hill]";
    	mes "The Current King of Emperium Hill is the ["+ getguildname($koegid) +"] guild.";
    	close;
    OnInit: // Uncomment this line to make the emblem stay after @reloadscript
    OnRevKoE:
    	flagemblem $koegid;
    	end;
    }
    koe,39,40,3	duplicate(koe_flag)	King of Emperium Hill#2	GUILD_FLAG
    koe,39,59,1	duplicate(koe_flag)	King of Emperium Hill#3	GUILD_FLAG
    koe,60,59,7	duplicate(koe_flag)	King of Emperium Hill#4	GUILD_FLAG
    koe,60,40,5	duplicate(koe_flag)	King of Emperium Hill#5	GUILD_FLAG
    koe,74,74,3	duplicate(koe_flag)	King of Emperium Hill#6	GUILD_FLAG
    koe,75,24,1	duplicate(koe_flag)	King of Emperium Hill#7	GUILD_FLAG
    koe,26,24,7	duplicate(koe_flag)	King of Emperium Hill#8	GUILD_FLAG
    
    koe	mapflag	nobranch
    koe	mapflag	nomemo
    koe	mapflag	nopenalty
    koe	mapflag	noreturn
    koe	mapflag	nosave	SavePoint
    koe	mapflag	noteleport
    //koe	mapflag	gvg_noparty
    koe	mapflag	nowarp
    koe	mapflag	nowarpto
    koe	mapflag	guildlock
    koe	mapflag	noicewall

    Use ex: prontera,150,177,5    duplicate(The King#KoE)    test    1_M_MERCHANT  for duplicate npc

     

    • Like 1
  7. 1 hour ago, M a p l e said:

    You need to have a refined +7 weapon to be able to use.

     

    the use of the blacksmith's blessing is not working in the current revision, they have not yet corrected it.

    if you are using the previous version of @refineui it's ok but the current one no

     

  8.  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;
    }

     

  9. @Edit:
    the problem is in the client, in other versions above this is not working: 2018-09-19aRagexe

     

    @Up
    Here a practical example


    code teste:
     

    prontera,155,178,3	script	testeeee	1039,{end;
    OnInit:
    	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 2000;
    	}
    	freeloop(0);
    end;
    }

     

  10. Hello again, i downloaded the latest version of the rA to do some tests and I realized that when using the sprite_id of a mob on an npc no longer the sword but the standard npc chat balloon:

     

    screenSirius088.jpg.18a5f7214bbe902ec9cc0333937e2875.jpg.092ea551def9035349e033cc5ce940ba.jpg  <- any sprite mob or npc now stay the balloon

    screenSirius089.jpg.5c3e928267b07c611b74ce52da0311bc.jpg.53528bc44018cc38ece7fc3a7b326c84.jpg  <- the old way when using mob sprite looked like this

     

    on a system that i'm doing on the older emulator (r16311) it works correctly, but in the current one it doesn't work because i use npcwalkto and as you know it bug the sprite if used as npc, so i make a transition from npc to mob sprite to don't let the sprite bug to happen.

    if anyone knows which commit contains the information about this change that has become the default it would help a lot.

    Thank you very much!!

  11. 14169,F_Blessing_10_Scroll_Box,Blessing 10 Scroll Box,18,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(BaseLevel >= 50){ getitem 12215,10; } else{ getitem 14169,1; } },{},{}

    .

  12. 1 hour ago, AsurielRO said:

    Thank you for this, just a suggestion maybe its good if you add a client side modification for ongoing quest so that players can monitor how many item left needed to collect.

    It would be interesting, but would need a src mod to count when the player simply brought or took the item in storage, in a simple way it would only work when killing mobs.
    but if i add a @quest command to show the information in the chat?

     

    if I'm not mistaken there is a src mod that calls an event every time an item goes to the inventory.

  13. Quest Point System


    [PT-BR]

    O sistema consiste em da 1 quest/missão ao player, o jogador que a fizer ganhará 1 Ponto de Quest, esses pontos o player porá usar para trocar por custons ou algo de seu interesse, as quest são sorteadas de forma aleatória dentre as dificuldades, e os Admins/GMs podem adicionar itens de quest in-game assim como podem editar também.

     

    Obs:  Mais em baixo deixarei uns videos relacionado ao sistema, o script tem algumas alterações se comparado com os videos mas nada de mais.

    Obs2: Caso alguém encontre algum bug ou queira da sugestões fique a vontade, farei assim que puder.

     

    [ENG]

    The system consists of 1 quest to the player, the player who makes it complete earn 1 Quest Point, and these points you can use to exchange for custom or something of interest to you, the quests are random, and the Admins / GMs can add quest items in-game like this you can edit too.

     

    Note: Below I will leave some videos related to the system, the script has some changes compared to the videos but nothing major.

    Note2: The translation is not very good, but I believe can understand it, you can make suggestions for me to make the improvement.

     

     

    Videos:

     

     


     

    • Upvote 1
    • Love 1
  14. invés de usar o arroba vc usa o hashtag #comando

    ex: 

     #blvl nome_do_player level  (depois do comando vem o nome do player depois o valor, não tenho certeza mas se o nome do player tiver espaço vc precisa por dentro de aspas duplas ficando assim: #blvl "nome do player" level ) assim vc muda o level do player

    e assim para os outros comandos tbm, #job player job_id
    #zeny player valor
     

    • Like 1
×
×
  • Create New...