Jump to content

Mabuhay

Members
  • Posts

    446
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by Mabuhay

  1. If I am right, the item_db VIEW ID column should be WEAPON ID not the view id of the weapon.

    The rest is correct.

    View: For normal items, defines a replacement view-sprite for the item (eg:
          Making apples look like apple juice). The special case are weapons
          and ammo where this value indicates the weapon-class of the item.
    
    	For weapons, the types are:
    		0: bare fist
    		1: Daggers
    		2: One-handed swords
    		3: Two-handed swords
    		4: One-handed spears
    		5: Two-handed spears
    		6: One-handed axes
    		7: Two-handed axes
    		8: Maces
    		9: Unused
    		10: Staves
    		11: Bows
    		12: Knuckles
    		13: Musical Instruments
    		14: Whips
    		15: Books
    		16: Katars
    		17: Revolvers
    		18: Rifles
    		19: Gatling guns
    		20: Shotguns
    		21: Grenade launchers
    		22: Fuuma Shurikens
    		23: Two-handed staves
    		24: Max Type
    		25: Dual-wield Daggers
    		26: Dual-wield Swords
    		27: Dual-wield Axes
    		28: Dagger + Sword
    		29: Dagger + Axe
    		30: Sword + Axe

     

  2. // -----------------------------------------------------------
    //  Quest items -- do NOT use a reward item more than once!
    //	Add(<shop ID>,<reward ID>,<reward amount>,
    //	    <Zeny cost>,<point cost>,
    //	    <required item ID>,<required item amount>{,...});
    // -----------------------------------------------------------
    // -----------------------------------------------------------
    //  Points variable -- optional quest requirement.
    //	setarray .Points$[0],"<variable name>","<display name>";
    // -----------------------------------------------------------
    
    	setarray .Points$[0],
    		"#CASHPOINTS", "Cash Points";

     

  3. VP accounts are by default group_id 5 (if I am not mistaken) found in login table.

     

     

    Not tested.

    -	script	VIP_Checker	-1,{
    OnCheck:
    	if(!(.@nb = query_sql(SELECT `account_id` FROM `login` WHERE `group_id` = '5'", .@aid))) {
    		dispbottom "No data found.";
    		end;
    	}
    	dispbottom "VIP Account ID list :";
    	for ( .@i = 0; .@i < .@nb; .@i++ )
    		dispbottom (.@i+1) +". Account ID : "+ .@aid[.@i];
    	dispbottom "Total of "+.@nb +" Active VIP account(s).";
    	end;
    OnInit:
    	bindatcmd "checkvip", strnpcinfo(0)+"::OnCheck", 60, 60; // @checkvip to list active vip accounts
    }

     

  4. *getlook(<type>{,<char_id>})
    
    This function will return the number for the current character look value
    specified by type. See 'setlook' for valid look types.
    
    This can be used to make a certain script behave differently for characters
    dressed in black.
    @var = getlook(LOCATION);

     

    Try using setlook instead of changelook

  5. 11 hours ago, FelipeMartins said:

    It's for a creation of an instance, i just want to make simple clones of the same map, because i will create houses using this map. 

     

     

     

     

    
    //===== rAthena Script =======================================
    //= Sample: Instancing
    //===== By: ==================================================
    //= Euphy
    //===== Last Updated: ========================================
    //= 20140129
    //===== Description: ========================================= 
    //= Contains elements of a basic instance script.
    //============================================================
    
    // Before running this script, add the entry below to
    // 'db/(pre-)re/instance_db.txt':
    // 100,Abyss Lake Instance,3600,300,abyss_03,160,155
    
    // Instance Creation
    //============================================================
    prontera,150,170,6	script	Sample Instance2	101,{
    	// id = 100
    	.@instance2$ = "Guild Point_01";
    	
    	if (instance_id()) {  // ignore the console debug message (harmless)
    		mes "[Sample Instance]";
    		mes "You are already part of an instance.";
    		next;
    		switch(select("Enter Instance.:Cancel.")) {
    		case 1:
    			break;
    		case 2:
    			mes "[Sample Instance]";
    			mes "You don't want to try again?";
    			emotion ET_CRY;
    			close;
    		}
    	} else {
    		mes "[Sample Instance]";
    		mes "Would you like to try the sample instance in Abyss Lake 3?";
    		next;
    		switch(select("Create Instance.:Cancel.")) {
    		case 1:
    			.@create2 = instance_create(.@instance2$);
    			if (.@create2 < 0) {
    				mes "[Sample Instance]";
    				switch (.@create2) {
    					case -1: mes "ERROR: Invalid type."; break;
    					case -2: mes "ERROR: Party not found."; break;
    					case -3: mes "ERROR: Instance already exists."; break;
    					case -4: mes "ERROR: No free instances."; break;
    				}
    				mes " ";
    				mes "Instance creation ^FF0000failed^000000.";
    				emotion ET_HUK;
    				close;
    			}
    			mes "[Sample Instance]";
    			mes "Instance created.";
    			mes " ";
    			mes "Now entering the instance...";
    			next;
    			break;
    		case 2:
    			mes "[Sample Instance]";
    			mes "Okay. Maybe next time!";
    			close;
    		}
    	}
    
    	.@enter2 = instance_enter(.@instance2$);
    	if (.@enter2 != 0) {
    		mes "[Sample Instance]";
    		switch (.@enter2) {
    			case 1: mes "ERROR: Party not found."; break;
    			case 2: mes "ERROR: Party does not have an instance."; break;
    			case 3: mes "ERROR: Unknown error."; break;
    		}
    		mes " ";
    		mes "Instance entry ^FF0000failed^000000.";
    		emotion ET_HUK;
    		close;
    	}
    	close;
    }
    
    // Instance Scripts
    //============================================================
    support,12,86,6	script	Instance NPC#start2	101,{
    	mes "[Instance NPC]";
    	mes "Are you ready to begin?";
    	next;
    	switch(select("Yes.:No.")) {
    	case 1:
    		mes "[Instance NPC]";
    		mes "Good luck.";
    		close2;
    		donpcevent instance_npcname("#ins_abyss03_mobs2")+"::OnEnable";
    		delwaitingroom;
    		disablenpc instance_npcname(strnpcinfo(0));
    		end;
    	case 2:
    		mes "[Instance NPC]";
    		mes "Take your time.";
    		close;
    	}
    	end;
    
    OnInit:  // hide the NPC on the normal map
    	disablenpc strnpcinfo(0);
    	end;
    OnInstanceInit:  // initialize the NPC when the instance is created
    	disablenpc instance_npcname("abysslakedunwarp004");  // disable original warp portal (currently buggy)
    	waitingroom "Click here to start!",0;
    	end;
    }
    
    support,0,0,0	script	#ins_abyss03_mobs2	-1,{
    	end;
    OnEnable:
    	initnpctimer;
    	end;
    OnTimer1000:  //strnpcinfo(4) will retrieve the instanced map name
    	mapannounce strnpcinfo(4),"Instance NPC: The Abyss Lake instance has begun.",bc_all;
    	end;
    OnTimer4000:
    	mapannounce strnpcinfo(4),"Instance NPC: Smash the Treasure Chest in the center of the map for a prize.",bc_all;
    	end;
    OnTimer5000:
    	stopnpctimer;
    
    	// spawn mobs
    	.@map2$        = instance_mapname("support");
    	.@label2$      = instance_npcname(strnpcinfo(0))+"::OnMyMobDead";
    	.@label_boss2$ = instance_npcname(strnpcinfo(0))+"::OnMyBossDead";
    	monster .@map2$,0,0,"Huge Poring",1002,20,.@label2$,2;
    	monster .@map2$,0,0,"Huge Drops",1113,15,.@label2$,2;
    	monster .@map2$,0,0,"Huge Poporing",1031,10,.@label2$,2;
    	monster .@map2$,0,0,"Huge Marin",1242,10,.@label2$,2;
    	monster .@map2$,0,0,"Tiny Zombie",1015,30,.@label2$,1;
    	monster .@map2$,0,0,"Huge Mime Monkey",1585,2,.@label2$,2;
    	monster .@map2$,86,74,"Treasure Chest",1732,1,.@label_boss2$,2;
    	end;
    OnMyMobDead:  // normal mobs
    	dispbottom "What am I doing? I should be attacking the Treasure Chest!";
    	viewpoint 0,97,102,0,0xFF0000;
    	switch (rand(6)) {  // for fun (: 
    		case 0: sc_start SC_STONE,5000,0; break;
    		case 1: sc_start SC_FREEZE,5000,0; break;
    		case 2: sc_start SC_STUN,5000,0; break;
    		case 3: sc_start SC_SLEEP,5000,0; break;
    		case 4: sc_start SC_CONFUSION,5000,0; break;
    		case 5: sc_start SC_BLIND,5000,0; break;
    	}
    	end;
    OnMyBossDead:  // treasure chest
    	specialeffect2 EF_MVP;
    	getitem 512,1; //Apple
    
    	// trigger other events
    	.@map2$   = instance_mapname("support");
    	.@label2$ = instance_npcname(strnpcinfo(0))+"::OnMyMobDead";
    	killmonster .@map2$,.@label2$;
    	mapannounce .@map2$,"Instance NPC: Good work! Please speak to me as soon as possible.",bc_all;
    	donpcevent instance_npcname("Instance NPC#finish2")+"::OnEnable";
    	end;
    }
    
    support,67,78,4	script	Instance NPC#finish2	101,{
    	mes "[Instance NPC]";
    	mes "Congratulations! You've finished the instance.";
    	mes "I'll send you back to town now.";
    	emotion ET_BEST;
    	close2;
    	warp "prontera",156,191;
    	instance_destroy();
    	end;
    
    OnInit:
    	disablenpc strnpcinfo(0);
    	end;
    OnInstanceInit:
    	disablenpc instance_npcname(strnpcinfo(0));
    	end;
    OnEnable:
    	enablenpc instance_npcname(strnpcinfo(0));
    	specialeffect EF_HIDING;
    	end;
    }
    
    support,66,86,0	script	#ins_abyss03_warp2	45,5,5,{
    	end;
    OnTouch:
    	mes "Are you sure you want to leave?";
    	next;
    	switch(select("Leave.:Stay.")) {
    	case 1:
    		warp "prontera",156,191;
    		break;
    	case 2:
    		warp strnpcinfo(4),160,155;
    		break;
    	}
    	close;
    OnInit:
    	disablenpc strnpcinfo(0);
    	end;
    }

     

     

     

     

    LET ME EXPLAIN, I NEED 109 maps cloned.

    I understand you need copies of the map. But I hope you also understand how instance script works. It is basically the thing you'll need to work with... As I told you, everything you'll need to know is found on the script sample and if you want to expand more knowledge, check your doc/script_commands.txt and proceed to instancing part.. If you still don't understand, try posting on script request section in the forum and wait for someone who might be able to give you what you need instead of learning how to make a proper instance script..

     

    EDIT:
    While I was lurking at rathena's git. I found this https://github.com/rathena/rathena/pull/5112

    Not sure if already stable or ready for use but you can try it yourself.

  6. If you only read the script carefully, you should be able to do make as much duplicates as you want without duplicating the whole script.

    // Shop NPCs -- supplying no argument displays entire menu.
    //	callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
    //============================================================
    prt_in,32,114,5	script	Tier 1 Quest#1	998,{ callfunc "qshop"; }

     

    If you want the npc to load only SHOP ID 1, you should do something like :

    map,x,y,f	script	Tier 1 Quest#1	998,{ callfunc "qshop", 1; } // Shows SHOP ID 1 only

     

    Then for more examples:

    map,x,y,f	script	Tier 2 Quest#1	998,{ callfunc "qshop", 1, 2; } // Shows SHOP ID 1 and 2
    map,x,y,f	script	Tier 3 Quest#1	998,{ callfunc "qshop", 1, 3; } // Shows SHOP ID 1 and 3
    .....

     

    And so on...

     

    • Love 1
  7. Execute this script command (Samples on how to use it is provided) (Source : doc/script_commands.txt).

    *getpartymember <party id>{,<type>{,<array_variable>}};
    
    This command will find all members of a specified party and returns their names
    (or character id or account id depending on the value of "type") into an array
    of temporary global variables. There's actually quite a few commands like this
    which will fill a special variable with data upon execution and not do anything
    else.
    
    Upon executing this,
    
    $@partymembername$[] is a global temporary string array which contains all the
                         names of these party members
                         (only set when type is 0 or not specified)
    
    $@partymembercid[]   is a global temporary number array which contains the
                         character id of these party members.
                         (only set when type is 1)
    
    $@partymemberaid[]   is a global temporary number array which contains the
                         account id of these party members.
                         (only set when type is 2)
    
    $@partymembercount   is the number of party members that were found.
    
    The party members will (apparently) be found regardless of whether they are
    online or offline. Note that the names come in no particular order.
    
    Be sure to use $@partymembercount to go through this array, and not
    'getarraysize', because it is not cleared between runs of 'getpartymember'. If
    someone with 7 party members invokes this script, the array would have 7
    elements. But if another person calls up the NPC, and he has a party of 5, the
    server will not clear the array for you, overwriting the values instead. So in
    addition to returning the 5 member names, the 6th and 7th elements from the last
    call remain, and you will get 5+2 members, of which the last 2 don't belong to
    the new guy's party. $@partymembercount will always contain the correct number,
    (5) unlike 'getarraysize()' which will return 7 in this case.
    
    If 'array_variable' is set, the result will be stored to that variable instead
    using global variable.
    
    Example 1: list party member names
    
    	// get the party member names
    	getpartymember getcharid(1),0;
    
    	// It's a good idea to copy the global temporary $@partymember*****
    	// variables to your own scope variables because if you have pauses in this
    	// script (sleep, sleep2, next, close2, input, menu, select, or prompt),
    	// another player could click this NPC, trigger 'getpartymember', and
    	// overwrite the $@partymember***** variables.
    	.@count = $@partymembercount;
    	copyarray .@name$[0], $@partymembername$[0], $@partymembercount;
    
    	// list the party member names
    	for (.@i = 0; .@i < .@count; .@i++)
    		mes (.@i +1) + ". ^0000FF" + .@name$[.@i] + "^000000";
    	close;
    
    
    Example 2: check party count (with a 'next' pause), before warping to event
    
    	.register_num = 5; // How many party members are required?
    
    	// get the charID and accountID of character's party members
    	getpartymember getcharid(1), 1;
    	getpartymember getcharid(1), 2;
    
    	if ( $@partymembercount != .register_num ) {
    		mes "Please form a party of " + .register_num + " to continue";
    		close;
    	}
    
    	// loop through both and use 'isloggedin' to count online party members
    	for ( .@i = 0; .@i < $@partymembercount; .@i++ )
    		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
    			.@count_online++;
    
    	// We search accountID & charID because a single party can have multiple
    	// characters from the same account. Without searching through the charID,
    	// if a player has 2 characters from the same account inside the party but
    	// only 1 char online, it would count their online char twice.
    
    	if ( .@count_online != .register_num ) {
    		mes "All your party members must be online to continue";
    		close;
    	}
    
    	// copy the array to prevent players cheating the system
    	copyarray .@partymembercid, $@partymembercid, .register_num;
    
    	mes "Are you ready ?";
    	next; // careful here
    	select("Yes");
    
    	// When a script hits a next, menu, sleep or input that pauses the script,
    	// players can invite or /leave and make changes in their party. To prevent
    	// this, we call getpartymember again and compare with the original values.
    
    	getpartymember getcharid(1), 1;
    	if ( $@partymembercount != .register_num ) {
    		mes "You've made changes to your party !";
    		close;
    	}
    	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    		if ( .@partymembercid[.@i] != $@partymembercid[.@i] ) {
    			mes "You've made changes to your party !";
    			close;
    		}
    	}
    
    	// Finally, it's safe to start the event!
    	warpparty "event_map", 0,0, getcharid(1);
    1. Count the players on the party.
    2. Store into temp variable (or not if you prefer to)
    3. Add the arguments 
    4. That should be it.

     

    Gold_Room_Script_Download

    • Like 1
  8. Why are you doing that?
     

    ---------------------------------------
    
    *vip_status(<type>,{"<character name>"})
    
    Returns various information about a player's VIP status.
    
    Valid types:
     VIP_STATUS_ACTIVE - VIP status: true if the player is a VIP or false if not
     VIP_STATUS_EXPIRE - VIP expire timestamp if the player is VIP or 0 if not
     VIP_STATUS_REMAINING - VIP time remaining in seconds
    
    NOTE: This command is only available if the VIP System is enabled.
    
    ---------------------------------------
    
    *vip_time <time>,{"<character name>"};
    
    Changes a player's VIP time (in minutes). A positive value will increase time, and a
    negative value will decrease time.
    
    NOTE: This command is only available if the VIP System is enabled.
    
    ---------------------------------------

    Use these script commands.

  9. Change all char-bound variables to account-bound.

    Variables
    ---------
    
    The meat of every programming language is variables - places where you store
    data.
    
    In the rAthena scripting language, variable names are not case sensitive.
    
    Variables are divided into and uniquely identified by the combination of:
    prefix  - determines the scope and extent (or lifetime) of the variable
    name    - an identifier consisting of '_' and alphanumeric characters
    postfix - determines the type of the variable: integer or string
    
    Scope can be:
    global    - global to all servers
    local     - local to the server
    account   - attached to the account of the character identified by RID
    character - attached to the character identified by RID
    npc       - attached to the NPC
    scope     - attached to the scope of the instance
    
    Extent can be:
    permanent - They still exist when the server resets.
    temporary - They cease to exist when the server resets.
    
    Prefix: scope and extent
    nothing  - A permanent variable attached to the character, the default variable
               type. They are stored by char-server in the `char_reg_num` and
               `char_reg_str`.
    "@"      - A temporary variable attached to the character.
               SVN versions before 2094 revision and RC5 version will also treat
               'l' as a temporary variable prefix, so beware of having variable
               names starting with 'l' if you want full backward compatibility.
    "$"      - A global permanent variable.
               They are stored by map-server in database table `mapreg`.
    "$@"     - A global temporary variable.
               This is important for scripts which are called with no RID
               attached, that is, not triggered by a specific character object.
    "."      - A NPC variable.
               They exist in the NPC and disappear when the server restarts or the
               NPC is reloaded. Can be accessed from inside the NPC or by calling
               'getvariableofnpc'. Function objects can also have .variables which
               are accessible from inside the function, however 'getvariableofnpc'
               does NOT work on function objects.
    ".@"     - A scope variable.
               They are unique to the instance and scope. Each instance has its
               own scope that ends when the script ends. Calling a function with
               callsub/callfunc starts a new scope, returning from the function
               ends it. When a scope ends, its variables are converted to values
               ('return .@var;' returns a value, not a reference).
    "'"      - An instance variable.
               These are used with the instancing system and are unique to each
               instance type. Can be accessed from inside the instance or by calling
               'getvariableofinstance'.
    "#"      - A permanent local account variable.
               They are stored by char-server in the `acc_reg_num` table and
               `acc_reg_str`.
    "##"     - A permanent global account variable stored by the login server.
               They are stored in the `global_acc_reg_num` table and
    		   `global_acc_reg_str`.
               The only difference you will note from normal # variables is when
               you have multiple char-servers connected to the same login server.
               The # variables are unique to each char-server, while the ## variables
               are shared by all these char-servers.
    
    Postfix: integer or string
    nothing - integer variable, can store positive and negative numbers, but only
              whole numbers (so don't expect to do any fractional math)
    '$'     - string variable, can store text
    
    Examples:
      name  - permanent character integer variable
      name$ - permanent character string variable
     @name  - temporary character integer variable
     @name$ - temporary character string variable
     $name  - permanent global integer variable
     $name$ - permanent global string variable
    $@name  - temporary global integer variable
    $@name$ - temporary global string variable
     .name  - NPC integer variable
     .name$ - NPC string variable
    .@name  - scope integer variable
    .@name$ - scope string variable
     'name  - instance integer variable
     'name$ - instance string variable
     #name  - permanent local account integer variable
     #name$ - permanent local account string variable
    ##name  - permanent global account integer variable
    ##name$ - permanent global account string variable

     

  10. 2 minutes ago, FelipeMartins said:

    how to do it?

    
    *instance_mapname("<map name>"{,<instance id>})
    
    Returns the unique name of the instanced map. If no instance ID is specified,
    the instance the script is attached to is used. If the script is not attached to
    an instance, the instance of the currently attached player is used (if it is a
    character, party, guild or clan mode). If it is not owned by anyone, no player needs
    to be attached. If that fails, the command returns an empty string instead.

    I sow this command, but how to use it? There is no examples in the documentation.

     

     

     

     

    You can start learning how to instance here:

    https://github.com/rathena/rathena/blob/master/doc/sample/instancing.txt

     

    • Upvote 1
×
×
  • Create New...