Jump to content

Emistry

Forum Moderator
  • Posts

    10015
  • Joined

  • Days Won

    405

Posts posted by Emistry

  1. find

    for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
    	if(countitem(.@Items[.@i]))set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" [1]":"")+":";

    and replace with

    for (.@i = 0; .@i < getarraysize(.@Items); .@i++) {
    	if (countitem(.@Items[.@i]))
    		.@menu$ = .@menu$ + getitemname(.@Items[.@i]) + ((.@k)?" [1]":"");
    	.@menu$ = .@menu$ + ":";
    }
  2. -	script	atcmd_example	-1,{
    OnInit:
    	bindatcmd "aura",strnpcinfo(3) + "::OnAtcommand";
    	end;
        
    OnAtcommand:
        if (.@atcmd_parameters$ == "on") {
            // your script command to turn on aura
            end;
        } 
        if (.@atcmd_parameters$ == "off") {
            // your script command to turn off aura
            end;
        }
        dispbottom "Invalid " + .@atcmd_command$ + ". Usage: " + .@atcmd_command$ + " <on|off>";
    	end;
    }

     

  3. everything that run after addrid will be repeatedly executed for each attached players.

    in your case, after your player obtained 10ea of item 7227, then each of this players, trigger the "Main" event again, and give each other another 10ea of 7227 and repeat endlessly.

     

    If you wish to trigger it every 5 seconds, you can do it this way.

    -   script  Sample  -1,{
        OnTimer5000:
            donpcevent strnpcinfo(3)+"::OnReward";
        OnInit:
            initnpctimer;
            end;
    
        OnReward:
            addrid(5, 0, "prontera");
            getitem 7227, 10;
            end;
    }

     

  4. delete the rental items, then recreate a brand new rental items with the remaining rental duration from previous items

    *rentitem2 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>};
    *rentitem2 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account_id>};
    *rentitem3 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
    *rentitem3 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
    *rentitem4 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};
    *rentitem4 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account_id>};

     

    may use these to count for rental items

    *rentalcountitem(<item id>{,<accountID>})
    *rentalcountitem("<item name>"{,<accountID>})
    
    This function will return the number of rental items for the specified item ID that the
    invoking character has in the inventory.
    
    ---------------------------------------
    
    *rentalcountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>})
    *rentalcountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<accountID>})
    *rentalcountitem3(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>})
    *rentalcountitem3("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>})
    *rentalcountitem4(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>})
    *rentalcountitem4("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<grade>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<accountID>})

     

    May use these to retrieve the remaining rental duration

    *getinventorylist {<char_id>};
    
    This command sets a bunch of arrays with a complete list of whatever the
    invoking character has in their inventory, including all the data needed to
    recreate these items perfectly if they are destroyed. Here's what you get:
    
    @inventorylist_expire[]            - expire time (Unix time stamp). 0 means never expires.

     

  5. 3 rewards.

    .RewardList = 1; // include only reward 1
    .RewardList = 1|2; // include only reward 1 and 2
    .RewardList = 1|4; // include only reward 1 and 3
    .RewardList = 2|4; // include only reward 1 and 3
    .RewardList = 2|4; // include only reward 2 and 3
    .RewardList = 4; // include only reward 3

     

    • Upvote 1
  6. getinventorylist;
    for (.@i = 0; .@i < @inventorylist_count; .@i++) {
    	if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE) == IT_CARD)
    		.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]);
    	.@menu$ = .@menu$ + ":";
    }
    .@i = select(.@menu$) - 1;
    mes "Your selected card = " + getitemname(@inventorylist_id[.@i]);

    you can also do this this way.

    • Love 1
  7. -	script	vip_group_free	-1,{
    	OnSetVIP:
    		#TEMP_GROUP_V  = gettimetick(2) + (7 * 24 * 60 * 60);//time in seconds
    	OnPCLoginEvent:
    		if (#TEMP_GROUP_V > gettimetick(2)) {
    			if (getgroupid() == 0) {
    				query_sql("UPDATE `login` SET `group_id` = 5 WHERE `account_id` = "+getcharid(3));
    				atcommand "@adjgroupid 5";
    			} 
    			.@second = #TEMP_GROUP_V - gettimetick(2);
    			addtimer (.@second * 1000), strnpcinfo(3)+"::OnExpire";
    			dispbottom "Seu VIP expira em: "+gettimestr("%Y-%m/%d %H:%M:%S",21,#TEMP_GROUP_V);
    		}
    		end;
    		
    	OnExpire:
    		if (getgroupid() == 5) 
    			query_sql("UPDATE `login` SET `group_id` = 0 WHERE `account_id` = "+getcharid(3));
    		atcommand "@adjgroupid 0";
    		end;
    }	

    something like this ?

     

    perhaps just use the built-in VIP system ? conf\login_athena.conf

    // Which group (ID) will be denoted as the VIP group?
    // Default: 5
    vip_group: 5

     

  8. prontera,164,169,3	script	Daily Supply#1	647,{
    	if (Weight >= (MaxWeight / 2) || !checkweight(1201,1)) {
    		dispbottom "Please free some space from your inventory to get the Daily Supplies.";
    		end;
    	}
    
    	.@unique_id$ = "" + get_unique_id(); // <--- Your way to accecss the unique ID info
    
    	if (#DailySupply == .today_date || inarray($today_unique_id$, .@unique_id$) != -1) {
    		dispbottom "Daily Supply can only be claimed once per day. Resets at 12am.";
    		end;
    	}
    
    	#DailySupply = .today_date;
    	$today_unique_id$[getarraysize($today_unique_id$)] = .@unique_id$;
    
    	getitembound 11503,100,Bound_Account;
    	getitembound 11504,50,Bound_Account;
    	end;
    
    OnHour00:
    	deletearray $today_unique_id$;
    OnInit:
    	.today_date = atoi(gettimestr("%Y%m%d", 21));
    	end;
    }

    something like this

    • MVP 1
  9. also can try using npc script if you want.

    -	script	getmapmob_main	-1,{
      OnInit:
    	  bindatcmd "getmapmob", strnpcinfo(3) + "::OnAtcommand";
    	  end;
    
    	OnAtcommand:
    		.@map$ = strcharinfo(3);
    		if (.@atcmd_numparameters) {
    			if (getmapusers(.@atcmd_parameters$) == -1) {
    				dispbottom "Invalid map " + .@atcmd_parameters$+".";
    				end;
    			}
    			.@map$ = .@atcmd_parameters$;
    		}
    		.@size = getmapunits(BL_MOB, .@map$);
    		for (.@i = 0; .@i < .@size; .@i++) {
    			getunitdata .@array[.@i], .@array;
    			if (!.@mobcount[.@array[UMOB_CLASS]]) {
    				.@mob_id[.@mob_id_size] = .@array[UMOB_CLASS];
    				.@mob_id_size++;
    			}
    			.@mob[.@array[UMOB_CLASS]]++;
    		}
    		dispbottom "Found "+ .@mob_id_size + " monsters at " + strcharinfo(3);
    		for (.@i = .@mob_id_size - 1; .@i >= 0; .@i--) {
    			if (getmonsterinfo(.@mob_id[.@i], MOB_MVPEXP) > 0)
    				continue;
    			dispbottom sprintf(" %s[%d] : %d", getmonsterinfo(.@mob_id[.@i], MOB_NAME), .@mob_id[.@i], .@mob[.@mob_id[.@i]]);
    			deletearray .@mob_id[.@i], 1;
    			.@mob_id_size--;
    		}
    		dispbottom "Found "+ .@mob_id_size + " normal monsters at " + strcharinfo(3);
    		for (.@i = 0; .@i < .@mob_id_size; .@i++) {
    			dispbottom sprintf(" %s[%d] : %d", getmonsterinfo(.@mob_id[.@i], MOB_NAME), .@mob_id[.@i], .@mob[.@mob_id[.@i]]);
    		}
    		end;
    }

    but this may cause performance issue, use at your own risk.

  10. prontera,155,181,5	script	Sample	757,{
    	mes "How can I help you?";
    	if (select("I wish to change my name.", "Cancel") == 1) {
    		logmes "["+getcharid(3)+"/"+getcharid(0)+"] '"+strcharinfo(0)+"' has requested to change name.";
    		CharRename = 1;
    		mes "You may log out now, and select the name change feature.";
    	}
    	close;
    }

    you should see the log once you enabled logging.

    talk to npc and select change name, log off the character and rename it through the game client.

    • Upvote 1
  11. prontera,150,150,5	script	HourTimer	111,{
    	.time = gettimetick(2) + 4800; // 1 hours 20 minutes from current time
    	end;
    
    OnTimer1000:
    	delwaitingroom;
    	if (.time > gettimetick(2))
    		waitingroom ""+gettimestr( "%H:%M:%S %p", 15, .time), 0;
    OnInit:
    	initnpctimer;
    	end;
    }

    something like this.

    just set the duration when you want it to start.

    .time = gettimetick(2) + 4800;

     

×
×
  • Create New...