Jump to content

Z3R0

Members
  • Posts

    615
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Z3R0

  1. Update: I managed to get the video for the Request done, however, it was my first run through of the script and probably a little "whacky" took over an hour to go through the entire script and really get in detail what it did. Now that I have been through it once, I am going to end up redoing the walkthrough without all the uhm's and searching, because I know where it's all at... 

    Tonight hopefully more things will be updated. I apologize for the wait, however I want to make sure it's clean and understandable. Hopefully I will get time tonight to fix up these videos.

    Thanks

  2. Follow the same thing for blacklist...

    OnInit:
    		.blacklist$ = "501,502,503,504,505";
    		.onmaps$ = "prontera,geffen,morocc";

    then on...

    OnPCDieEvent:
    		if (countitem(7773) >= 1) end;
    		if (BaseLevel < 40) end;
                               
            // Will halt the rest of the script if they are not on a map that is allowed
            if (!compare("," + .onmaps$ + ",", "," + strcharinfo(3) + ",")) end;
                               
    		// ....

     

    • Like 1
  3. Welcome Everyone!

    Some of you may remember my old video series NPC Scripting 4 Dummies... Unfortunately, due to pesronal issues, I had to take a step back from rAthena and RO in general and I was out of touch with everything. MANY MANY MANY Things have changed, so I am going to be completely re-doing the series!

    I have begun production on Chapter 1 and should have that complete by the end of the weekend, and soon Chapter 2 will be released.

    Simply subscribe and you will know when new videos are added!

    Here is the channel and I will post here when new updates are released! Last time, I embedded every video, which I may do again, but for simplicity sake, just go to the channel!

    Right now, there are very limited videos, but there will be LOTS more to come!

    NPC Scripting 4 Dummies (YouTube Channel)

    Please keep in mind, this is still a work in progress and will take time.

    Chapter 1: The Basics - Complete

    Chapter 2: Variables - In Progress

    Chapter 3: Debugging 

    Chapter 4: Basic Menu System

    Chapter 5: Math & Logic

    Chapter 7: Player Input

    Chapter 8: Loops

    Chapter 9: Arrays

    Chapter 10: Dynamic Menu System

    Chapter 11: Functions

    Chapter 12: Events

    Chapter 13: Instances

    Chapter 14: To Be Determined...

    • Upvote 7
    • MVP 1
    • Like 1
  4. What's with the semi-colon within the sql statement? I don't think that needs to be there... Also, the sql key isn't goign to be #day_event ... it already knows it's an account variable beacuse it's in the acc_reg_num table... the variable is just "day_event"

     

     

  5. Would it be a specific +10 item = a specific reward?

     

     

    prontera,158,173,4	script	ItemExchanger	88,{
    
    	mes("Welcome!");
    	mes("I can trade certain +10 items with other items hehe :D");
    	
    	// Clear Inventory List Information
    	ClearGetInventoryList();
    
    	getinventorylist;
    
    	set(.@counter, 0);
    	set(.@menu$, "");
    
    	// First we loop through all available exchange items
    	for(.@i = 0; .@i < getarraysize(.exchange_items); .@i++) {
    		// Now we check if it exists in the inventory
    		.@index = array_find(@inventorylist_id, .exchange_items[.@i]);
    
    		if (.@index >= 0) {
    			// Item was found :D
    			// Now we need to check and make sure that it is a PLUS 10 item
    			if (@inventorylist_refine[.@i] >= 10) {
    				// We have verified that it's +10 or more and we will add it to our menu and psuedo array
    				set(.@exchangeable_items[.@counter], .@index);
    				set(.@exchangeable_refine[.@counter], @inventorylist_refine[.@i]);		
    				set(.@rewardable_items[.@counter], .@i);
    				set(.@rewardable_amount[.@counter], .@i);
    				.@menu$ += (.@menu$ == "" ? "" : ":") + "+" + @inventorylist_refine[.@i] + " " + getitemname(@inventorylist_id[.@i]);
    				.@counter++;
    			}
    		}
    	}
    
    	// Now we show them the trade menu
    	set .@choice, select(.@menu$) - 1; // We subtract 1 to get an array index point
    	
    	mes("You have chosen to trade +" + .@exchangeable_refine[.@choice] + " " + getitemname(.@excangeable_items[.@choice]));
    	mes("You will receive " + .@rewardable_amount[.@choice] + "x " + getitemname(.@rewardable_items[.@choice]));
    	
    	if (select("Yes, Trade:Nevermind") == 1) {
    		mes("Thanks, Come back soon!");	
    		close;
    	}
    
    	// They opted to trade, let's do it!
    	delitem @inventorylist_id[.@exchangeable_items[.@choice]], 1;
    	getitem .@rewardable_items[.@choice], .@rewardable_amount[.@choice];
    
    	mes("Here you go"!);
    	close;
    
    	OnInit:
    		setarray(.exchange_items, 1201, 1202, 1203); // 3 Knives (0 slot, 1 slot, 2 slot)
    		setarray(.reward_items, 501, 502, 503); // Red Potion, Orange Potion, Yellow Potion
    		setarray(.reward_amount, 1, 5, 10); // Amount to return 
    		end;
    
    }
    
    function	script	ClearGetInventoryList	{
    	deletearray(@inventorylist_id);
    	deletearray(@inventorylist_amount);
    	deletearray(@inventorylist_equip);
    	deletearray(@inventorylist_refine);
    	deletearray(@inventorylist_identify);
    	deletearray(@inventorylist_attribute);
    	deletearray(@inventorylist_card1);
    	deletearray(@inventorylist_card2);
    	deletearray(@inventorylist_card3);
    	deletearray(@inventorylist_card4);
    	deletearray(@inventorylist_expire);
    	deletearray(@inventorylist_bound);
    	set(@inventorylist_count, 0);
    
    	return;
    }

    Untested

  6. prontera,158,173,4	script	CoinExchanger	88,{
    
    	mes("Welcome");
    	mes("Please give me your coins...");
    
    	// Check Inventory for Coins
    	getinventorylist;
    
    	freeloop(true);
    	.@counter = 0;
    	for(.@coin_index = 0; .@coin_index < getarraysize(.exchange_ids); .@coin_index++) {
    		for(.@i = 0; .@i < @inventorylist_count; .@i++) {
    
    			if (@inventorylist_id[.@i] == .exchange_ids[.@coin_index]) {
    				if (@inventorylist_amount[.@i] >= .exchange_amount[.@coin_index]) {
    					set(.@menu_coin_index[.@counter], .@coin_index);
    					set(.@menu$, .@menu$ + ( .@menu$ == "" ? "" : ":" ) + getitemname(.exchange_ids[.@coin_index]) + "(" + @inventorylist_amount[.@i] + ")");
    					.@counter++;
    				}
    			}
    		}
    	}
    	freeloop(false);
    
    	if (.@menu$ == "") {
    		next;
    		mes("You do not have any coins!");
    		close;
    	}
    
    	// Display Option to Show them choices and how many coins they have...
    	set .@choice, select(.@menu$) - 1; // Subtract 1 to get Array Index
    	set .@index, .@menu_coin_index[.@choice];
    
    	// dispbottom("You have chosen to use " + getitemname(.exchange_ids[.@index]) );
    	// dispbottom("Progress bar Duration is: " + .exchange_duration[.@index] + " seconds.");
    
    	mes("Goodluck");
    	close2;
    
    	progressbar("00FF00", .exchange_duration[.@index]); // Start the Progressbar
    
    	// On Progress Bar Completion... let's see what we do here...
    	delitem(.exchange_ids[.@index], .exchange_amount[.@index]);
    	freeloop(true);
    	for(.@i = 0; .@i < getarraysize(.available_items); .@i++) {
    		.@random = rand(1, 100);
    		if (.@random <= .available_chance[.@i]) { // GET THE ITEM
    			mes "Here you go";
    			getitem(.available_items[.@i], .available_amount[.@i]);
    			if (.available_chance[.@i] <= .announce_level_chance) {
    				announce(strcharinfo(0) + " just scored " + getitemname(.available_items[.@index]), bc_all, C_YELLOW);
    			}
    			close;
    		}
    	}
    	freeloop(false);
    
    	mes("You got the default prize...");
    	getitem(.default_item, .default_amount);
    	close;
    
    	OnInit:
    		setarray(.exchange_ids, 673, 675, 671, 677);
    		setarray(.exchange_amount, 1, 1, 1, 1);
    		setarray(.exchange_duration, 10, 8, 5, 2); // # of seconds to progressbar...
    
    		setarray(.available_items, 501, 502, 503, 504);
    		setarray(.available_amount, 1, 1, 1, 1);
    		setarray(.available_chance, 50, 40, 30, 10); // % of 100
    
    		set(.announce_level_chance, 10); // Will only display announce if they get item 504... since it's the only one with 10 chance or lower
    
    		set(.default_item, 501);
    		set(.default_amount, 1);
    		end;
    
    }

    This should work

  7. What are u confused about it looks pretty straight forward

     

    // Untested
    
    -	script	PartyExp	-1,{
    
    	OnPartyExpKilled:
    		// Clear the Server Party Variables
    		set($ @ partymembercount, 0);
    		deletearray($ @ partymemberaid, getarraysize( $ @partymemberaid));
    		
    		// Get the Corresponding Party Information
    		getpartymember(getcharid(1));
    
    		// Loop Through Party Members
    		for(.@i = 0; .@i < $ @ partymembercount; .@i++) {
    
    			// Attach the player id
    			attachrid($ @ partymemberaid[.@i]);
    
    			set(BaseExp, BaseExp + 1000); // Give Base Exp
    			set(JobExp, JobExp + 1000); // Give Job Exp
    
    			getitem(501,1); // Give Item
    
    			// Unattach Player from the Script
    			detachrid;
    			
    		}
    
    		announce("Wootzers! You Done It!", bc_map, C_YELLOW);
    		end;	
    		
    }

     

    • Upvote 1
×
×
  • Create New...