Jump to content

Zarbony

Members
  • Content Count

    15
  • Joined

  • Last visited

Posts posted by Zarbony


  1. 8 hours ago, ThyroDree said:

    Hi! I just tried this~ itemshower configure works

    but itemshower trigger isn't

    I got this error

     

    [Debug]: mapindex_name2id: Map "" not found in index list! [Error]: makeitem: creating map on unexistent map ''! [Debug]: Source (NPC): showerdrop (invisible/not on a map)

    
    
    [Debug]: mapindex_name2id: Map "" not found in index list!
    [Error]: makeitem: creating map on unexistent map ''!
    [Debug]: Source (NPC): showerdrop (invisible/not on a map)

     

    Oh, found the error, thats why i told you to fix some issues :X

    just replace 

     

    .@map$ with .@mapname$ then it should work :X

     

    -	script	Sample	-1,{
    	OnInit:
    	bindatcmd "itemshower",strnpcinfo(0)+"::OnShower",99; //Fires The Configurated ItemShower
    	bindatcmd "itmshoconf",strnpcinfo(0)+"::OnShowerC",99; //For Configurating the ItemShower
    		end;
    
    	OnShowerC:
    		mes("Hey There, What would you do?");
    		switch(select("Change Item ID","Change Shower amount","Change Item Quantity","Nothing, Boy!")){
    			case 1:
    					mes("Type in the Item ID!");
    					input .itemidIS;
    					next;
    					mes("The Item with the ID "+.itemidIS+" would "+getitemname(.itemidIS)+" is this correct?");
    					if(select("Yep!","Nope!")==1)close();
    						set .itemidIS,0;
    						close();
    			case 2:
    					mes("Type in the Shower amount!");
    					input .amount;
    					next;
    					mes("The Item Shower will rain about "+.amount+" is this correct?");
    					if(select("Yep!","Nope!")==2)close();
    						set .amount,.amount+1;
    						close();
    			case 3:
    					mes("Type in the Item Quantity every Item will Appear!");
    					input .quantityIS;
    					next;
    					mes("The Item Shower will drop every time "+.quantityIS+" items is this correct?");
    					if(select("Yep!","Nope!")==1)close();
    						set .quantityIS,0;
    						close();
    			case 4:
    				mes("Come back again if you need my help!Boy!");
    				close();
    				}
    		end;
    
    	OnShower:
    	getmapxy(.@mapname$,.@mapx,.@mapy, UNITTYPE_PC, strcharinfo(0));
               	for(set .@i,0; .@i<.amount; .@i++){
                    .@r = rand (1,7);
    				if(.@r == 1){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy;
    						sleep2 50;
                   } else if(.@r == 2){             
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy;
    						sleep2 50;
                   } else if(.@r == 3){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy-1;
    						sleep2 50;
                  } else if(.@r == 4){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
    						sleep2 50;
                  } else if(.@r == 5){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy;
    						sleep2 50;
                  } else if(.@r == 6){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy+1;
    						sleep2 50;
                  } else if(.@r == 7){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
    						sleep2 50;
                        }
                  end;
    		}
    		end;
                                            
    }

     


  2. Hey, i think this will work like that...
    Just an Freestyle Script in this Forum Code snippet :D
    I hope it will work, this is my Fast Solution,

    you can Improve this by Callfuncs to Config everything by typing the command once.

    so you can Configure the Itemshower with the command itmshoconf

    and let it rain with the command itemshower

     

    the Items will Rain Around the Player Who use the command, so it isnt bind on an map.

     

    The Command is only useable for GroupId 99 and Above so normal players wont see this in their command list :D

     

    and in the Itemshower theres everytime an 1,7 random chance on whish place around the player who use the command the item will appear.

     

    Please Test it before u use it and fix some errors :D
     

    -	script	Sample	-1,{
    	OnInit:
    	bindatcmd "itemshower",strnpcinfo(0)+"::OnShower",99; //Fires The Configurated ItemShower
    	bindatcmd "itmshoconf",strnpcinfo(0)+"::OnShowerC",99; //For Configurating the ItemShower
    		end;
    
    	OnShowerC:
    		mes("Hey There, What would you do?");
    		switch(select("Change Item ID","Change Shower amount","Change Item Quantity","Nothing, Boy!")){
    			case 1:
    					mes("Type in the Item ID!");
    					input .itemidIS;
    					next;
    					mes("The Item with the ID "+.itemidIS+" would "+getitemname(.itemidIS)+" is this correct?");
    					if(select("Yep!","Nope!")==1)close();
    						set .itemidIS,0;
    						close();
    			case 2:
    					mes("Type in the Shower amount!");
    					input .amount;
    					next;
    					mes("The Item Shower will rain about "+.amount+" is this correct?");
    					if(select("Yep!","Nope!")==2)close();
    						set .amount,.amount+1;
    						close();
    			case 3:
    					mes("Type in the Item Quantity every Item will Appear!");
    					input .quantityIS;
    					next;
    					mes("The Item Shower will drop every time "+.quantityIS+" items is this correct?");
    					if(select("Yep!","Nope!")==1)close();
    						set .quantityIS,0;
    						close();
    			case 4:
    				mes("Come back again if you need my help!Boy!");
    				close();
    				}
    		end;
    
    	OnShower:
    	getmapxy(.@map$,.@mapx,.@mapy, UNITTYPE_PC, strcharinfo(0));
               	for(set .@i,0; .@i<.amount; .@i++){
                    .@r = rand (1,7);
    				if(.@r == 1){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy;
    						sleep2 50;
                   } else if(.@r == 2){             
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy;
    						sleep2 50;
                   } else if(.@r == 3){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx-1,.@mapy-1;
    						sleep2 50;
                  } else if(.@r == 4){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
    						sleep2 50;
                  } else if(.@r == 5){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy;
    						sleep2 50;
                  } else if(.@r == 6){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx+1,.@mapy+1;
    						sleep2 50;
                  } else if(.@r == 7){
    						makeitem .itemidIS,.quantityIS,.@mapname$,.@mapx,.@mapy+1;
    						sleep2 50;
                        }
                  end;
    		}
    		end;
                                            
    }

     


  3. Hey there, since the last Update ive got errors in Timestamp Plugin:

    chat-timestamp.c In function 'clif_wis_message_pre' :

    chat-timestamp.c:160:8: error: too few arguments to function 'map->nich2sd' 

    ssd = map->nick2sd(nick);

     

    How does i can fix this one?

    Could you please update the Plugin?

     


  4. Ive seen someone but i used only the basics.

    this is the first time i used this operators and calculators.

    Thats why i need help.

    If i can fix this by myself i dont ask this question...

    ErrorPw.PNG.85063cdd166acdcce61aa761c13b1647.PNG

     

    Heres my next try but it will show the next error.

    I used the function in Deprecated Notice

    This one:

    # from the Hercules root folder:
    find npc db -type f -exec sed -i -r 's/pow\((.+),[ ]*(.+)\)/((\1) ** (\2))/g' {} +

     

     

     

     


  5. Hey, it is this Script:

    Spoiler


    
    -	shop	F_EMISTRY	-1,512:100
    // pvpwait,72,87,5	script	Badge Exchanger#12	757,{
    
    prontera,155,171,5	script	asmplwrwojirdh	4_F_KAFRA9,{
    function ShopSettings;
    function ValidateCost;
    function CurrencyInfo;
    function ClearData;
    function ValueConvert;
    function ErrorNotice;
    
    mes "Hi";
    next;
    set @menu,select( "Open Shop" );
    
    ClearData();
    ShopSettings( @menu );
    npcshopitem "F_EMISTRY",512,100;
    npcshopdelitem "F_EMISTRY",512;
    for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)
    	npcshopadditem "F_EMISTRY",@ItemLists[.@i],@ItemCost[.@i];
    	mes "^FF0000Information:^000000";
    	mes "----------------------------";
    	CurrencyInfo( @Currency$ );
    	mes "----------------------------";
    	callshop "F_EMISTRY",1;
    	npcshopattach "F_EMISTRY";
    end;
    
    
    function	ShopSettings	{
    	switch( getarg(0) ){
    		case 1:
    			// Currency [ Item ID / Variable Name ]
    			set @Currency$,"29996";
    			// Item ID Lists
    			setarray @ItemLists[0],6153,7227;
    			// Item Price
    			setarray @ItemCost[0],100,1;
    			break;
    			// case 4,5,6.....etc...
    		default:
    			ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." );
    			close;
    	}
    	
    	
    	if( @Currency$ == "" )
    		ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." );
    	if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) || getarraysize( @ItemLists ) != getarraysize( @ItemCost ) )
    		ErrorNotice( "Missing or Extra Value of Item or Cost Settings in Menu "+@menu+" ." );
    		return;
    	}
    
    	function	ErrorNotice	{
    		mes "^FF0000ERROR^000000 - "+getarg(0);
    		mes "----------------------------";
    		mes "Inform this Message to ^0000FFGame Staffs^000000 immediately.";
    		close;
    	}
    
    	function	CurrencyInfo	{
    	if( getitemname( atoi( getarg(0) ) ) != "null" )
    	{
    		mes "Required : ^FF0000"+getitemname( atoi( getarg(0) ) )+"^000000";
    		mes "Total : ^0000FF"+ValueConvert( countitem( atoi( getarg(0) ) ) )+"^000000";
    	}
    	return;
    }
    
    	function	ValidateCost	{
    	if( getitemname( atoi( getarg(0) ) ) != "null" )
    	{
    		if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return 1;
    		}else{
    			if( getd( getarg(0) ) < getarg(1) ) return 1;
    		}
    	return 0;
    }
    
    	function ClearData	{
    		set @Currency$,"";
    		set @TotalCost,0;
    		deletearray @bought_nameid[0],getarraysize( @bought_nameid );
    		deletearray @bought_quantity[0],getarraysize( @bought_quantity );
    		deletearray @ItemLists[0],getarraysize( @ItemLists );
    		deletearray @ItemCost[0],getarraysize( @ItemCost );
    		return;
    	}
    
    	function	ValueConvert	{
    		set .@num, atoi(""+getarg(0));
    		if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
    		set .@l, getstrlen(""+.@num);
    		for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 )
    		{
    			set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
    				if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
    		}
    		return .@num$;
    	}
    
    OnBuyItem:
    	ShopSettings( @menu );
    	for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
    		for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1)
    			if( @ItemLists[@j] == @bought_nameid[@i] ) {
    			//set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] );
    
    				set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] );
    				set .@item_weight,getiteminfo( @bought_nameid[@i],6 );
    				set .@total_item_weight,( .@item_weight * @bought_quantity[@i] );
    				set .@total_weight,( .@total_weight + .@total_item_weight );
    			}
    	if( .@total_weight > ( MaxWeight - Weight )) {
    		mes "You can take that much.";
    		close;
    	}
    
    	mes "^FF0000Billing List:^000000";
    	mes "----------------------------";
    	for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )
    			mes "^FF0000"+@bought_quantity[@i]+" x ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
    	mes "----------------------------";
    	// if (!checkweight2(@bought_nameid,@bought_quantity)) {
    		// next;
    		// mes "^FF0000You are currently over-weighted.^000000";
    		// mes "^FF0000Please store some items before you do purchases.^000000";
    		// close;
    	// }else{
    		// goto L_getpassed;
    	// }	
    L_getpassed:
    	if( getitemname( atoi( @Currency$ ) ) != "null" ) {
    		mes "Total : ^0000FF"+ValueConvert( @TotalCost )+" x "+getitemname( atoi( @Currency$ ) )+"^000000";
    	}
    	next;
    	if( ValidateCost( @Currency$,@TotalCost ) ){
    		if( getitemname( atoi( @Currency$ ) ) != "null" ) {
    			mes "Insufficient ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000";
    		}
    	} else {
    		if( select( "- ^0000FFPurchase^000000:- Cancel" ) == 1 ) {
    			if( getitemname( atoi( @Currency$ ) ) != "null" )
    				delitem atoi( @Currency$ ),@TotalCost;
    			else {
    				set getd( @Currency$ ),getd( @Currency$ ) - @TotalCost;
    			}
    			for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
    				getitem @bought_nameid[@i],@bought_quantity[@i];
    			dispbottom( "[Notice] Purchased "+getarraysize( @bought_nameid )+" Items.", 0xFF6600 );
    			//dispbottom( "- "+ @bought_quantity[@i] +" x "+ getitemname( @bought_nameid[@i] ) +"", 0xFF6600 );
    			mes "Please come back, if you want to shopping again.";
    		}
    	}
    	ClearData();
    	close;
    }


     

    Ive tested the 10 ^(.@i+1) and the NPC Stuck.

    if i use 10 ** .@i+1 it works but the value is wrong, now i know why this happen.

    How i can fix this Script so that it will Work?

    Thank you


  6. Hey there, i use the Shop System whish i found here in herc.

    If i Use this System, the server says that "pow" will be removed in future und is deprecated.

    How i can fix it without getting issues in NPC Text and Function?

    function	ValueConvert	{
    	set .@num, atoi(""+getarg(0));
    	if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
    	set .@l, getstrlen(""+.@num);
    	for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
    		set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
    			if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
    	}
    	return .@num$;
    }

    I changed the pow(10,.@i+1) to (10 ** .@i+1) but this got me some issues when i buy some Items from the NPC and the Item Count in text is wrong.

    If i use the Pow(10,.@i+1) then it works but the console says deprecated.

    How i can fix this?

     

     


  7. Oh sorry, i used the wrong Server :D

    This is because my Server is in the Switching process :X

    So here is what i have in my itemdb.h:

    Quote

    #ifndef MAX_ITEMDB
    #define MAX_ITEMDB 0xFFFF
    #endif

    #ifndef MAX_ITEM_ID
    #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
    #define MAX_ITEM_ID 0x20000
    #else
    #define MAX_ITEM_ID 0xFFFF
    #endif
    #endif

     

    Line 72-78:

    #if MAX_ITEM_ID < MAX_ITEMDB
    #error "MAX_ITEM_ID must be bigger or same with MAX_ITEMDB"
    #endif
    #if MAX_ITEM_ID > 0xFFFF && PACKETVER_MAIN_NUM < 20181121 && PACKETVER_RE_NUM < 20180704 && PACKETVER_ZERO_NUM < 20181114
    #error "For clients before 20181121 Main and 20180704 RE and 20181114 zero, MAX_ITEM_ID must be smaller than 0x10000"
    #endif

     

    And here one of my Converted Items from rAthena to herc:

    {
        Id:40000
        AegisName: "Purple_Gift"
        Name: "Purple Gift"
        Type: 3
        Sell: 5000000
        Weight: 1000
        ShowDropEffect: true
        DropEffectMode: 4
    },
     


     

     


  8. Umm i just checked the doc file and in my Opinion, you use one { and } more than you need, so the Option cant be allign.

    Just remove it , and the script should watch like this:

     

    option_drop_group_db: (
    
    	ValkRandom: (
    		{
    			Rate: 5000
    			CLASS_DAMAGE_BOSS_TARGET: 5,                // 5% más de daño a MvPS
    			CLASS_DAMAGE_BOSS_TARGET: [6, 8]          // 6 ~ 8% más de daño a MvPS
    			CLASS_DAMAGE_BOSS_TARGET: [9, 15, 1000]    // 9 ~ 15% más de daño a MvPS
    		},
    		{
    			Rate: 2500
    			CLASS_DAMAGE_BOSS_TARGET: 25,                // 25% más de daño a MvPS
    		}
    	),
    	TEST2: (
    		{
    			Rate: 5000
    			VAR_MAXHPPERCENT: 5,                // 5% MAXHP
    			VAR_MAXHPPERCENT: [6, 8]          // 6 ~ 8% MAXHP
    			VAR_MAXHPPERCENT: [9, 15, 1000]    // 9 ~ 15% MAXHP
    		},
    		{
    			Rate: 2500
    			RACE_TOLERACE_HUMAN: 25,                // 25% resistencia Demi-Human
    		}
    	)
    
    )

     

    I think this will work, but i havent tested it yet...

    I hope it will do its job now :D

     


  9. Hey there, i see this is an Old Topic but i will explain my Solution for this :P

    I wrote an NPC who asked the Player whish Language the player will use at his first Login (even if they are an old player and dont set an variable)

    the player choose an option and got the var #langset,1. and #lang.

    if the player hasnt set anything, he dont got the var #langset and OnPCLoginEvent detect this one so the Player will ask.

    if the player choose one, the #lang var will set 0 or 1(Different Languages, 0 is the default one)

    and the npc detect this while i use:

    mes(!#lang)?"Hey there i am the Default Language!:Hey there i am the Second Language!";

    Mes scriptcommand - (var)? "If the var is triggered:if the var isnt triggered";

    this works fine for me :)

     

    Sorry for my bad english :X


  10. Hey There,

    i Just want to Change my rAthena Server to herc, i build up an Testserver and while i setting up everything, i noticed something is missing.

    some of my Players got VIP benefits from VIP System on rAthena but there isnt an system like that in herc yet.

    Maybe it would helpful if cash shop could fully load from an SQL DB...

    I dont got the knowledge to write this plugin right now.

×
×
  • Create New...

Important Information

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