Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by AnnieRuru

  1. [12/Feb 00:55][Error]: buildin_delitem2: failed to delete 1 items (AID=200xxxx item_id=20717).
    [12/Feb 00:55][Debug]: Source (NPC): Identifier at prontera (147,174)

    it clearly says this happens from identifier npc script at prontera map

     

    ok most Identifier script scatter on the board gives something like this

    prontera,150,185,5	script	test	1_F_MARIA,{
    	getinventorylist;
    	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
    		if ( !@inventorylist_identify[.@i] ) {
    			delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
    			getitem @inventorylist_id[.@i],1;
    		}
    	}
    }

    which is true for most of the time, because monsters drop unidentified items without refine, no cards

    but this instance script you showed, drops refined and enchanted equipment,

    	makeitem2 .@d_item,1,'map_name$,.@x,.@y,0,.@refine,0,0,.@en_name_2,.@en_name_3,.@en_name_4;

    and this custom Identifier script will fail to delete the item (as error shown)
    perhaps should change the identifier script accordingly like this

    prontera,150,185,5	script	test	1_F_MARIA,{
    	getinventorylist;
    	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
    		if ( !@inventorylist_identify[.@i] ) {
    			delitem2 @inventorylist_id[.@i], 1, 0, @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i];
    			getitem2 @inventorylist_id[.@i], 1, 1, @inventorylist_refine[.@i], 0, @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i];
    		}
    	}
    }

     

    • Upvote 1
  2. AI sux at using knockback, trust me
    human eyes can visualize an area, but bots can only read coordinate in numbers
    even if you calculate the range from the tank/leader, it still has some other problems like
    1. obstacles in the area
    2. walls that prevent knockback
    3. position of the healer/tank cause the party out of formation
    4. direction of the knockback
    -> a good knockback can use on monsters with high HP to delay "this monster meant to kill later"
    -> a bad knockback can push the monsters inside the party formation and immediately kills your healer

     

    if my memory serve me right, I would go for brandish spear,
    I still remember brandish spear can knockback the mobs and potentially lose less HP while tanking mobs, whereas bowling bash just

    after some testing yeah, bowling bash seems better choice in rathena

    https://forums.warpportal.com/index.php?/topic/83889-bowling-bash-or-brandish-spear/
    https://oldforums.irowiki.org/index.php?topic=16731.0

  3. why so complicated ?

     src/map/pc.cpp | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/src/map/pc.cpp b/src/map/pc.cpp
    index 5aace7ecb..f13aa90c3 100755
    --- a/src/map/pc.cpp
    +++ b/src/map/pc.cpp
    @@ -4595,6 +4595,9 @@ char pc_additem(struct map_session_data *sd,struct item *item,int amount,e_log_p
     		if (!itemdb_isstackable2(id) || id->flag.guid)
     			sd->inventory.u.items_inventory[i].unique_id = item->unique_id ? item->unique_id : pc_generate_unique_id(sd);
     
    +		if ( item->nameid == 717 )
    +			sd->inventory.u.items_inventory[i].favorite = 1;
    +
     		clif_additem(sd,i,amount,0);
     	}
     

    any character pick up, gets a blue_gemstone(717), is automatically put into favorite tab

  4. 6 hours ago, Seravy said:

    Thanks, was able to make characters talk. The one I found in script didn't work well though, but party_send_message did. Finding it was a bit of a pain though.

    why not ?

     src/map/pc.cpp | 8 ++++++++
     src/map/pc.hpp | 1 +
     2 files changed, 9 insertions(+)
    
    diff --git a/src/map/pc.cpp b/src/map/pc.cpp
    index 5aace7ecb..e7145e110 100755
    --- a/src/map/pc.cpp
    +++ b/src/map/pc.cpp
    @@ -1356,6 +1356,8 @@ bool pc_authok(struct map_session_data *sd, uint32 login_id2, time_t expiration_
     
     	// Request all registries (auth is considered completed whence they arrive)
     	intif_request_registry(sd,7);
    +
    +	sd->spam_help = (int)time(NULL);
     	return true;
     }
     
    @@ -7637,6 +7639,12 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
     
     	if(battle_config.prevent_logout_trigger&PLT_DAMAGE)
     		sd->canlog_tick = gettick();
    +
    +	if ( pc_readparam( sd, SP_HP ) * 100 / pc_readparam( sd, SP_MAXHP ) < 25 && sd->spam_help + 10 <= (int)time(NULL) ) {
    +		clif_disp_overhead( &sd->bl, "I need Healing !!" );
    +		clif_emotion( &sd->bl, ET_HELP );
    +		sd->spam_help = (int)time(NULL);
    +	}
     }
     
     TIMER_FUNC(pc_close_npc_timer){
    diff --git a/src/map/pc.hpp b/src/map/pc.hpp
    index ea5465bc8..78bf4a009 100644
    --- a/src/map/pc.hpp
    +++ b/src/map/pc.hpp
    @@ -730,6 +730,7 @@ struct map_session_data {
     	uint32* hatEffectIDs;
     	uint8 hatEffectCount;
     #endif
    +	int spam_help;
     };
     
     extern struct eri *pc_sc_display_ers; /// Player's SC display table

     

    6 hours ago, Seravy said:

    Wait, homunculus AI is no longer a thing? That's sad... well I guess I can do the same for homunculus, but there has to be some sort of existing AI for them somewhere, right? Otherwise they'd just never do anything at all... so I'll need to replace/improve that one I guess? We'll see once I reach the alchemist class...

    I tested on older client, it still works, newer client no longer working

    google search "homunculus AI download", you can find some custom AI

     

    for the dispel, no idea, this skill is mostly use for PvP only, rarely use on PvM
    don't even care about Assuptio on monster ... because we don't cast dispel on monsters hahaha
    what a waste of yellow gemstone ...

  5. 9 minutes ago, utofaery said:

    4. wait a second what is "isi" ???

    as in "Malay" language??? for content??? or it means???

    /*==========================================
     * Added built-in functions
     *------------------------------------------*/
    static void add_buildin_func(void)
    {
    	int i;
    	for( i = 0; buildin_func[i].func; i++ )
    	{
    		// arg must follow the pattern: (v|s|i|r|l)*\?*\*?
    		// 'v' - value (either string or int or reference)
    		// 's' - string
    		// 'i' - int
    		// 'r' - reference (of a variable)
    		// 'l' - label
    		// '?' - one optional parameter
    		// '*' - unknown number of optional parameters

     

    no idea what to say, its part of source modification

  6. 46 minutes ago, Elysium said:

    Could you convert this plugin to rAthena please? instead of Hercules.

    BUILDIN_FUNC(messagecolor) {
    	struct block_list *bl = map_id2bl( script_getnum(st,2) );
    	if (!bl) {
    		ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2));
    		return SCRIPT_CMD_FAILURE;
    	}
    	clif_messagecolor( bl, script_getnum(st,4), script_getstr(st,3), true, AREA);
    	return SCRIPT_CMD_SUCCESS;
    }
    BUILDIN_DEF(messagecolor,"isi"),

     

    Remember the reason why it doesn't work on players, because "@fontcolor" uses a trick to disguise player as monster
    https://github.com/HerculesWS/Hercules/issues/1217
    https://github.com/HerculesWS/Hercules/issues/1930

    apparently rAthena "@fontcolor" is broken

  7. I vaguely remember we discuss about *dispbottom2 and *message2 custom script command during my stay on hercules
    http://herc.ws/board/topic/3899-suggestion-displaybottom-message-colors/?do=findComment&amp;comment=25468


    answer is yes, it just not implemented
    look at the npctalk inside script.cpp, it default to color_table[COLOR_WHITE], this value is hard-coded

    BUILDIN_FUNC(npctalk)
    {
    	struct npc_data* nd = NULL;
    	const char* str = script_getstr(st,2);
    
    	if (script_hasdata(st, 3) && strlen(script_getstr(st,3)) > 0)
    		nd = npc_name2id(script_getstr(st, 3));
    	else
    		nd = (struct npc_data *)map_id2bl(st->oid);
    
    	if (nd != NULL) {
    		send_target target = AREA;
    		char message[CHAT_SIZE_MAX];
    
    		if (script_hasdata(st, 4)) {
    			switch(script_getnum(st, 4)) {
    				case BC_ALL:	target = ALL_CLIENT;	break;
    				case BC_MAP:	target = ALL_SAMEMAP;	break;
    				case BC_SELF:	target = SELF;			break;
    				case BC_AREA:
    				default:		target = AREA;			break;
    			}
    		}
    		safesnprintf(message, sizeof(message), "%s", str);
    		if (target != SELF)
    			clif_messagecolor(&nd->bl, color_table[COLOR_WHITE], message, false, target);
    		else {
    			TBL_PC *sd = map_id2sd(st->rid);
    			if (sd == NULL)
    				return SCRIPT_CMD_FAILURE;
    			clif_messagecolor_target(&nd->bl, color_table[COLOR_WHITE], message, false, target, sd);
    		}
    	}
    	return SCRIPT_CMD_SUCCESS;
    }

     

    so I play around again with it, Hercules plugin of course,

    #include "common/hercules.h"
    #include "map/clif.h"
    #include "map/script.h"
    #include "common/HPMDataCheck.h"
    
    HPExport struct hplugin_info pinfo = {
    	"messagecolor",
    	SERVER_TYPE_MAP,
    	"0.1",
    	HPM_VERSION,
    };
    
    BUILDIN(messagecolor) {
    	struct block_list *bl = map->id2bl( script_getnum(st,2) );
    	if (!bl) {
    		ShowWarning("buildin_messagecolor: Error in finding object GID %d!\n", script_getnum(st,2));
    		return false;
    	}
    	clif->messagecolor( bl, script_getnum(st,4), script_getstr(st,3) );
    	return true;
    }
    
    HPExport void plugin_init (void) {
    	addScriptCommand( "messagecolor", "isi", messagecolor );
    }
    prontera,155,185,5	script	kjsdhfksjf	1_F_MARIA,{
    //	messagecolor getcharid(3), "asdfasdf", C_BLUE; <-- doesn't work
    	messagecolor getnpcid(), "asdfasdf", C_BLUE;
    	messagecolor getnpcid(), "asdfasdf", C_RED;
    	messagecolor getnpcid(), "asdfasdf", C_YELLOW;
    	messagecolor getnpcid(), "asdfasdf", C_PINK;
    	messagecolor getnpcid(), "asdfasdf", C_PURPLE;
    	messagecolor getnpcid(), "asdfasdf", C_ORANGE;
    	end;
    }

    screen2019Hercules027.jpg

     

     

    2. forget the whisper feature, that thing is from the past
    everyone use *bindatcmd now

    https://github.com/rathena/rathena/blob/master/doc/whisper_sys.txt

  8. 1. most of the time, if it doesn't mention any limit, it will be INT, means 2147483648 ... although might need some serious test to test the limit

    2. no, getarraysize doesn't support look up to another npc

    npc variable .var can be done with

    getarg( X, getarraysize( getvariableofnpc( .var, <npc name> ) ) )

    scope variable .@var cannot retrieve like that, as it run per script state

     

     

    4 hours ago, utofaery said:

    callfunc ("F_arraysize", getvariableofnpc(.@narray, npc 1);

    .@narray is a scope variable, server throw error

    prontera,155,185,5	script	khfksjhf	1_F_MARIA,{
    	.@a = 1;
    	dispbottom getvariableofnpc( .@a, strnpcinfo(0) ) +"";
    	end;
    }
    [Error]: buildin_getvariableofnpc: invalid scope (not npc variable)
    [Debug]: Data: variable name='.@a' index=0
    [Debug]: Source (NPC): khfksjhf at prontera (155,185)

     

  9. just test again ... I see this script already has this line ...

    OnInit:
    	setbattleflag "min_npc_vendchat_distance", 0;

     

    theoretically, just make the script like this ... should work on rathena

    //===== rAthena Script =====================================
    //= Vendor Control
    //===== By: ================================================
    //= Original by Emistry
    //= Rewrite by AnnieRuru
    //===== Current Version: ===================================
    //= 2.1r
    //===== Compatible With: ===================================
    //= rAthena 2019-2-10
    //===== Description: =======================================
    //= Vendors only vend on certain coordinate, looks tidy :P
    //===== Topic ==============================================
    //= https://rathena.org/board/topic/117737-error-vendinghelp/
    //===== Additional Comments: ===============================
    //= Revert back to use warp
    //==========================================================
    
    prontera,156,178,4	script	Vending Helper	4_F_JPN2,{
    	mes "["+ strnpcinfo(NPC_NAME_VISIBLE) +"]";
    	if ( !getskilllv( "MC_VENDING" ) ) {
    		mes "You dont have ^0055FFVending Skill^000000.";
    		close;
    	}
    	mes "Select a slot and start vending.";
    	while ( true ) {
    		.@menu$ = .@currentpage ? "Previous Page:" : ":";
    		.@pageindex = .@currentpage * .slotperpage;
    		for ( .@i = 0; .@i < .slotperpage && .@pageindex + .@i < .count; ++.@i ) {
    			if ( !getmapxy( .@map$, .@x, .@y, BL_NPC, "#vend_slot"+( .@pageindex + .@i ) ) && getareausers( .map$, .@x, .@y, .@x, .@y ) )
    				.@menu$ += "Slot No."+( .@pageindex + .@i +1 )+" - ^FF0000[Unavailable]^000000:";
    			else
    				.@menu$ += "Slot No."+( .@pageindex + .@i +1 )+" - ^00CC00[Available]^000000:";
    		}
    		if ( .@currentpage != .maxpage )
    			.@menu$ = .@menu$ + "Next Page";
    		.@pick = select( .@menu$ ) -1;
    		if ( !.@pick )
    			{ --.@currentpage; }
    		else if ( .@pick == .slotperpage +1 )
    			{ ++.@currentpage; }
    		else
    			break;
    	}
    	.@s =  .@currentpage * .slotperpage + .@pick -1 ;
    	if ( !getmapxy( .@map$, .@x, .@y, BL_NPC, "#vend_slot"+ .@s ) && getareausers( .map$, .@x, .@y, .@x, .@y ) ) {
    		mes " ";
    		mes "This slot is ^FF0000[UnAvailable]^000000.";
    		close;
    	}
    	warp .@map$, .@x, .@y;
    	hideonnpc "#vend_slot"+ .@s;
    	donpcevent "#vend_slot"+ .@s +"::OnCheckAvailable";
    	end;
    OnInit:
    	setbattleflag "min_npc_vendchat_distance", 0;
    //	======================= Configuration HERE =============================
    	.map$ = "prontera"; // map
    	setarray .@x, 150,153,156,159,162; // x coordinates
    	setarray .@y, 175,172,169,166,163,160,157,154,151,148,145,142,139,136,133; // y coordinates
    	.slotperpage = 20; // display how many slots per page (prevent making the menu too long)
    
    	freeloop true;
    	setcell .map$, 0,0, 500,500, cell_novending, true;
    	.@x_size = getarraysize( .@x );
    	.@y_size = getarraysize( .@y );
    	for ( .@i = 0; .@i < .@y_size; ++.@i ) {
    		for ( .@j = 0; .@j < .@x_size; ++.@j ) {
    			if ( checkcell( .map$, .@x[.@j], .@y[.@i], cell_chkpass ) ) {
    				movenpc "#vend_slot"+ .count, .@x[.@j], .@y[.@i];
    				setcell .map$, .@x[.@j], .@y[.@i], .@x[.@j], .@y[.@i], cell_novending, false;
    				if ( getareausers( .map$, .@x[.@j], .@y[.@i], .@x[.@j], .@y[.@i] ) ) {
    					hideonnpc "#vend_slot"+ .count;
    					donpcevent "#vend_slot"+ .count +"::OnCheckAvailable";
    				}
    				++.count;
    			}
    		}
    	}
    	.maxpage = .count / .slotperpage + ( .count % .slotperpage > 0 ) -1;
    //	debugmes "Vendor NPC needed -> "+ .count;
    	end;
    }
    
    -	script	vend_slot	FAKE_NPC,{
    	mes "[Vending Slot]";
    	if ( !getskilllv( "MC_VENDING" ) ) {
    		mes "You dont have ^0055FFVending Skill^000000.";
    		close;
    	}
    	getmapxy .@map$, .@x, .@y, BL_NPC;
    	if ( getareausers( .@map$, .@x, .@y, .@x, .@y ) ) {
    		mes "Someone already using this slot";
    		close;
    	}
    //	unitwalk getcharid(3), .@x, .@y;
    	warp strcharinfo(3), .@x, .@y;
    	mes "Spot : ^777777Available^000000";
    	mes "^0055FF[ Vending Area Rules ]^000000";
    	mes "^FF0000 ~ Use proper Shop Name.^000000";
    	mes "^777777Player who failed to follow these rules will be punished.^000000";
    	hideonnpc strnpcinfo(0);
    	donpcevent strnpcinfo(0)+"::OnCheckAvailable";
    	close;
    OnCheckAvailable:
    	sleep 10000;
    	getmapxy .@map$, .@x, .@y, BL_NPC;
    	while ( getareausers( .@map$, .@x, .@y, .@x, .@y ) )
    		sleep 10000;
    	hideoffnpc strnpcinfo(0);
    	end;
    }
    
    // Add more if needed.
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot0	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot1	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot2	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot3	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot4	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot5	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot6	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot7	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot8	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot9	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot10	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot11	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot12	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot13	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot14	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot15	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot16	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot17	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot18	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot19	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot20	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot21	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot22	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot23	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot24	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot25	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot26	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot27	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot28	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot29	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot30	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot31	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot32	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot33	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot34	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot35	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot36	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot37	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot38	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot39	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot40	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot41	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot42	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot43	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot44	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot45	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot46	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot47	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot48	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot49	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot50	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot51	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot52	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot53	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot54	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot55	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot56	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot57	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot58	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot59	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot60	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot61	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot62	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot63	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot64	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot65	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot66	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot67	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot68	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot69	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot70	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot71	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot72	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot73	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot74	4_BULLETIN_BOARD2
    prontera,0,0,4	duplicate(vend_slot)	#vend_slot75	4_BULLETIN_BOARD2

    screen2019rAthena011.jpg

  10. let's see .. pc_job_can_entermap function check has

    1. atcommand.c ... "@warp" atcommand ...
    2. npc.c .... WARPNPC ....

    prontera,150,185,5	warp2	sadfasdfsdf	2,2,guild_vs2,50,50

    3. script.c ... *warpparty/*warpguild script command ... and of course *jobcanentermap script command
    4. skill.c ... emergency recall ... UNT_WARP_WAITING (acolyte's warp portal skill) ...  UNT_CALLFAMILY ....

    weird, doesn't check on summon spouse

     

    "@reloadpcdb" can reload job_noenter_map.txt file

     

    ok but still it doesn't make sense to apply in this topic ...
    topic starter says all jobs CANNOT access to any map EXCEPT new_1-1

    your 1 line code actually means novice can't enter new_1-1, doing opposite of what topic starter says

    also, using just zone 1 isn't actually work ... my novice can't warp into any map, but can enter pvp map ... LOL

    Example:

    script:

    prontera,155,185,5	script	ksjdfhsdjfh	WARPNPC,2,2,{
    	if ( jobcanentermap("guild_vs2") )
    		warp "guild_vs2", 50,50;
    	end;
    }
    //guild_vs2	mapflag	pvp
    guild_vs1	mapflag	pvp
    
    prontera,150,185,5	warp2	sadfasdfsdf	2,2,guild_vs2,50,50

    db\re\job_noenter_map.txt

    JOB_NOVICE,1,100

    arch_bishop job cannot enter woe:te map ... ok check

    novice cannot warp payon, prontera, guild_vs2 ... check ...
    but can warp into guild_vs1 map !! because its pvp on there

     

    EDIT: hmm ... maybe if apply all the zones ... 8191 ?
    hmm ... doesn't really work, pc_job_can_entermap doesn't check on "@go" atcommand ... still can bypass ...

    damn just use OnPCLoadMapEvent already ...

  11. 4 hours ago, Seravy said:

    -Is there a procedure I can call if I want a character to say something in public or party chat? It would be nice if the AI could give a warning if a character is low on SP or overweight.

    if the player received too much damage (from battle.c or status.c ... dunno where you want it)
    do /hp emotion or /help emotion .... I mean "/help" emotion ... stupid forum conversion ... I hate IPB4
    or perform unittalk script command ... by now you should understand how to copy part of the code from src/map/script.cppas

     

    4 hours ago, Seravy said:

    And something for the future but might as well ask in advance, what procedure do I call to equip different arrows? The AI can already tell what enemy is weak or strong against which element, so might as well take advantage of that for the hunter class as well. I haven't yet tried but I'm guessing it's won't be the same call as using a consumable item.

    LOL this was just asked in this topic
    https://rathena.org/board/topic/118155-caseclosed-gunslinger-target-traps-browedit-group-edit-key-and-storage-command/?do=findComment&amp;comment=357268

    yes there is *equip script command, just use them

    btw if you can also make "@homunattack" or something like that would be cool, since we can't install custom AI anymore
    https://rathena.org/board/topic/118141-q-mercenaries-autoattack-and-clones-aspd-bonuses/?do=findComment&amp;comment=357133y

     

  12. 41 minutes ago, utofaery said:

    I wonder there is a line of this:


    donpcevent "::OnSetup";

    could it actually meant this???
    donpcevent "vend_slot::OnSetup";

    https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6456-L6458

    -	script	asdf	FAKE_NPC,{
    OnInit:
    	bindatcmd "asdf", strnpcinfo(0)+"::Onaaa";
    	end;
    Onaaa:
    	donpcevent "::OnDOALL";
    	end;
    OnDOALL:
    	if ( !getstrlen( strnpcinfo(2) ) ) end;
    	npctalk "lalala";
    	end;
    }
    prontera,150,185,5	duplicate(asdf)	asdf#1	1_F_MARIA
    prontera,152,185,5	duplicate(asdf)	asdf#2	1_F_MARIA
    prontera,154,185,5	duplicate(asdf)	asdf#3	1_F_MARIA
    prontera,156,185,5	duplicate(asdf)	asdf#4	1_F_MARIA
    prontera,158,185,5	duplicate(asdf)	asdf#5	1_F_MARIA

     

  13. 18 hours ago, n0tttt said:

    db/import/job_noenter_map.txt

    
    JOB_NOVICE,1,100

    Something like this?

    if I understand this correctly, *jobcanentermap script command works together with db/re/job_noenter_map.txt
    the script command only return 0 or 1, depends on the setting from job_noenter_map.txt

    in other words, just a simple

    if ( Class == Job_Novice ) return 0;

    do the same thing as the script command

    it doesn't warp out the players, kick or anything ... just return value 0 or 1

    wrong info ...

  14. prontera,157,180,5	script	test item_reward#3	2_VENDING_MACHINE1,{
    	if ( !countitem(.itemuse) ) {
    		mes "A "+ getitemname(.itemuse) +" is needed to use this machine";
    		close;
    	}
    	delitem .itemuse, 1;
    	.@r = rand(.totalchance);
    	for ( .@i = 0; ( .@r -= .itemchance[.@i] ) >= 0; ++.@i );
    	getitem .itemid[.@i], 1;
    	end;
    OnInit:
    	.itemuse = 7539; // poring coin
    	setarray .itemid, 501,502,503,504,505,506,507,508,509;
    	setarray .itemchance, 10,10,10,10,3,10,10,10,10;
    	for ( .@i = 0; .itemid[.@i]; ++.@i )
    		.totalchance += .itemchance[.@i];
    	end;
    }

     

    btw this script is call "lotti girl"
    https://rathena.org/board/search/?&amp;q=lotti&amp;search_and_or=and&amp;sortby=relevancy
    a lot of results return from it

    • Upvote 1
  15. 3 hours ago, utofaery said:

    For the topic starter script why don't you make it automated give all castle that are owned and then mes all the castle with what was given???
    say if in high rate server or highly cooperative guild may be has 7 castle then the guild master would have to talk seven times to that npc to collect all the chest drop???
    so why not automate it ?

    On one of the web links contained:
    wahahaha .... seriously ... nowadays people make overly complicated scripts 
    then why not simplified the process and automate it by talking once and collect all castle's chest drop?

    sry, forum rules
    if you want to ask for another feature in somebody else's topic, better open your own topic

    1 question = 1 answer = 1 script

    so don't complicate the topic

  16. just want to repost the link

    prontera,146,197,5	script	WoE Reward	1288,{
    	mes "^000088[Emperium]^000000";
    	mes "Greetings, adventurer!";
    	mes "Do you want to redeem your guild reward for last session War of Emperium?";
    	next;
    	mes "^000088[Emperium]^000000";
    	mes "Please select your castle.";
    	next;
    	if ( agitcheck() ) goto L_woeon;
    	menu
    		"Neuschwanstein",L_aldeg_cas01,
    		"Hohenschwangau",L_aldeg_cas02,
    		"Nuenberg",L_aldeg_cas03,
    	//	"Wuerzburg",L_aldeg_cas04,
    	//	"Rothenburg",L_aldeg_cas05,
    		"Repherion",L_gefg_cas01,
    		"Eeyolbriggar",L_gefg_cas02,
    		"Yesnelph",L_gefg_cas03,
    		"Bergel",L_gefg_cas04,
    	//	"Mersetzdeitz",L_gefg_cas05,
    		"Bright Arbor",L_payg_cas01,
    		"Scarlet Palace",L_payg_cas02,
    		"Holy Shadow",L_payg_cas03,
    		"Sacred Altar",L_payg_cas04,
    	//	"Bamboo Grove Hill",L_payg_cas05,
    		"Kriemhild",L_prtg_cas01,
    		"Swanhild",L_prtg_cas02,
    		"Fadhgridh",L_prtg_cas03,
    		"Skoegul",L_prtg_cas04;
    	//	"Gondul",L_prtg_cas05;
    L_aldeg_cas01:
    	if ( getcastledata( "aldeg_cas01", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[1] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[1], 1;
    	close;
    L_aldeg_cas02:
    	if ( getcastledata( "aldeg_cas02", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[2] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[2], 1;
    	close;
    L_aldeg_cas03:
    	if ( getcastledata( "aldeg_cas03", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[3] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[3], 1;
    	close;
    L_aldeg_cas04:
    	if ( getcastledata( "aldeg_cas04", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[4] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(7539,300) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 7539, 300;
    	set $castle_claimed[4], 1;
    	close;
    L_aldeg_cas05:
    	if ( getcastledata( "aldeg_cas05", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[5] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	mes "receiving the reward for this castle";
    	getitem 7539, 300;
    	set $castle_claimed[5], 1;
    	close;
    L_gefg_cas01:
    	if ( getcastledata( "gefg_cas01", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[6] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[6], 1;
    	close;
    L_gefg_cas02:
    	if ( getcastledata( "gefg_cas02", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[7] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[7], 1;
    	close;
    L_gefg_cas03:
    	if ( getcastledata( "gefg_cas03", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[8] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[8], 1;
    	close;
    L_gefg_cas04:
    	if ( getcastledata( "gefg_cas04", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[9] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[9], 1;
    	close;
    L_gefg_cas05:
    	if ( getcastledata( "gefg_cas05", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[10] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 7539, 300;
    	set $castle_claimed[10], 1;
    	close;
    L_payg_cas01:
    	if ( getcastledata( "payg_cas01", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[11] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[11], 1;
    	close;
    L_payg_cas02:
    	if ( getcastledata( "payg_cas02", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[12] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[12], 1;
    	close;
    L_payg_cas03:
    	if ( getcastledata( "payg_cas03", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[13] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[13], 1;
    	close;
    L_payg_cas04:
    	if ( getcastledata( "payg_cas04", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[14] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[14], 1;
    	close;
    L_payg_cas05:
    	if ( getcastledata( "payg_cas05", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[15] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	mes "receiving the reward for this castle";
    	getitem 7539, 300;
    	set $castle_claimed[15], 1;
    	close;
    L_prtg_cas01:
    	if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[16] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "[Emperium]";
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[16], 1;
    	close;
    L_prtg_cas02:
    	if ( getcastledata( "prtg_cas02", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[17] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[17], 1;
    	close;
    L_prtg_cas03:
    	if ( getcastledata( "prtg_cas03", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[18] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "[Emperium]";
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[18], 1;
    	close;
    L_prtg_cas04:
    	if ( getcastledata( "prtg_cas04", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[19] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 21069,100;
    	set $castle_claimed[19], 1;
    	close;
    L_prtg_cas05:
    	if ( getcastledata( "prtg_cas05", 1) != getcharid(2) ) goto L_not_owner;
    	if ( $castle_claimed[20] ) goto L_claimed;
    	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
    	if ( checkweight(21069,100) == 0 ) goto L_CheckWeight;
    	mes "receiving the reward for this castle";
    	getitem 7539, 300;
    	set $castle_claimed[20], 1;
    	close;
    L_woeon:
    	mes "^000088[Emperium]^000000";
    	mes "A war is currently in progress.";
    	mes "If your guild owned a castle ask your guild master to see me to claim the reward.";
    	close;
    L_not_owner:
    	mes "^000088[Emperium]^000000";
    	mes "Your guild failed to take this castle.";
    	mes "If your guild owned a castle ask your guild master to claim reward from me.";
    	close;
    L_claimed:
    	mes "^000088[Emperium]^000000";
    	mes "Your guild already received the reward for this castle.";
    	close;
    L_not_gm:
    	mes "^000088[Emperium]^000000";
    	mes "Ask your guild master to see me.";
    	close;
    L_CheckWeight:
    	mes "Please check your weight!";
    	close;
    OnAgitEnd:
    	set $castle_claimed[1], 0; // everytime woe ends the variable resets
    	set $castle_claimed[2], 0;
    	set $castle_claimed[3], 0;
    	set $castle_claimed[4], 0;
    	set $castle_claimed[5], 0;
    	set $castle_claimed[6], 0;
    	set $castle_claimed[7], 0;
    	set $castle_claimed[8], 0;
    	set $castle_claimed[9], 0;
    	set $castle_claimed[10], 0;
    	set $castle_claimed[11], 0;
    	set $castle_claimed[12], 0;
    	set $castle_claimed[13], 0;
    	set $castle_claimed[14], 0;
    	set $castle_claimed[15], 0;
    	set $castle_claimed[16], 0;
    	set $castle_claimed[17], 0;
    	set $castle_claimed[18], 0;
    	set $castle_claimed[19], 0;
    	set $castle_claimed[20], 0;
    	end;
    }

    ok so for the topic starter

    function	script	F_MesItemInfo	{
    	.@item = getarg(0);
    	.@itemname$ = getitemname(.@item);
    	if (.@itemname$ == "null")
    		.@itemname$ = "Unknown Item";
    	if (PACKETVER >= 20150729)
    		return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", .@itemname$, .@item);
    	else if (PACKETVER >= 20130130)
    		return sprintf("<ITEMLINK>%s<INFO>%d</INFO></ITEMLINK>", .@itemname$, .@item);
    	else
    		return .@itemname$;
    }
    
    prontera,146,197,5	script	WoE Reward	1288,{
    	mes "^000088[Emperium]^000000";
    	mes "Greetings, adventurer!";
    	mes "Do you want to redeem your guild reward for last session War of Emperium?";
    	next;
    	mes "^000088[Emperium]^000000";
    	if ( agitcheck() ) {
    		mes "A war is currently in progress.";
    		mes "If your guild owned a castle ask your guild master to see me to claim the reward.";
    		close;
    	}
    	mes "Please select your castle.";
    	next;
    	.@s = select(.menu$) -1;
    	mes "^000088[Emperium]^000000";
    	if ( getcastledata( .castle$[.@s], CD_GUILD_ID ) != getcharid(2) ) {
    		mes "Your guild failed to take this castle.";
    		close;
    	}
    	.@ip$ = getcharip();
    	.@i = inarray( $ip_claimed$, .@ip$ );
    	if ( .@i >= 0 ) {
    		mes "You have claimed the reward";
    		close;
    	}
    	if ( !checkweight(1201,1) ) {
    		mes "Please check your weight!";
    		close;
    	}
    	$ip_claimed$[ getarraysize($ip_claimed$) ] = .@ip$;
    	.@itemid = .itemid[ rand(.itemsize) ];
    	mes "You have obtain "+ F_MesItemInfo(.@itemid);
    	getitem .@itemid, 1;
    	end;
    OnAgitEnd:
    	deletearray $ip_claimed$;
    	end;
    OnInit:
    	setarray .castle$[0],
    		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
    		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
    		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
    		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
    		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
    		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    	for ( .@i = 0; .@i < 30; ++.@i )
    		.menu$ += getcastlename(.castle$[.@i])+":";
    
    //	SQL query to fetch castle's treasure chest drop
    	for ( .@i = 1; .@i <= 9; ++.@i )
    		.@query$[.@i -1] = "select drop"+ .@i +"id from mob_db_re where id >= 1324 and id <= 1363";
    	.itemsize = query_sql( implode( .@query$, " union " ), .itemid );
    	end;
    }

     

  17. no reward to the GMs, and no reward to auto-traders, AND if possible no reward to idle players *checkidle()

    // F_ShuffleNumbers( <start num>, <last num>, <output array>{, <count>} );
    function	script	F_ShuffleNumbers	{
    	deletearray getarg(2);
    	.@static = getarg(0);
    	.@range = getarg(1) +1 - .@static;
    	.@count = getarg(3, .@range);
    	if (.@range <= 0 || .@count <= 0)
    		return 0;
    	if (.@count > .@range)
    		.@count = .@range;
    	for (.@i = 0; .@i < .@range; ++.@i)
    		.@temparray[.@i] = .@i;
    	for (.@i = 0; .@i < .@count; ++.@i) {
    		.@rand = rand(.@range);
    		set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static;
    		.@temparray[.@rand] = .@temparray[--.@range];
    	}
    	return .@count;
    }
    
    -	script	sjdfkhsf	FAKE_NPC,{
    OnInit:
    	.itemid = 501;
    	.amount = 10;
    //	bindatcmd "test", strnpcinfo(0)+"::OnDebug", 99, 100;
    	end;
    OnMinute00:
    	if ( gettime(DT_HOUR) % 2 ) end;
    //OnDebug:
    	.@size = getunits( BL_PC, .@aid );
    	F_ShuffleNumbers( 0, .@size -1, .@r );
    	for ( .@i = 0; .@i < .@size; ++.@i ) {
    		attachrid .@aid[.@r[.@i]];
    		if ( getgmlevel() < 60 && ( checkvending() & (2|4) ) == 0 ) {
    //		if ( getgmlevel() < 60 && ( checkvending() & (2|4) ) == 0 && checkidle() < 60 ) {
    			announce strcharinfo(0) +" won the Lucky Draw !!",bc_all;
    			mail getcharid(0), "Lucky Draw", "Prize", "Here is the Lucky Draw Prize", 0, .itemid, .amount;
    			break;
    		}
    	}
    	end;
    }

     

    • Upvote 1
  18. this script is no longer possible with the dynamic_mobs option on, which most server will left it on
    https://rathena.org/board/topic/118033-mobs-on-server-start/?do=findComment&amp;comment=356654

    the reason is because the MVP spawned on the map use boss_monster syntax
    https://github.com/rathena/rathena/blob/26720f041a3cd0edbaa975bfc70345a30e9bf706/doc/script_commands.txt#L186sd

     


    ok here's the explanation,

    No.1 You have to understand what is dynamic_mob configuration

    https://rathena.org/board/topic/117852-i-got-error-when-applying-custom-commands/?do=findComment&amp;comment=356255a
    tested with "@mapmoblist prt_fild07", you'll notice if there are no players in the map, it return empty
    but the moment you "@rura prt_fild07", warp into the map, it start to populate the map with monsters, and "@mapmoblist" will return something
    yup, if you go back to prontera, "@reloadscript" and "@mapmoblist prt_fild07" again, it will be empty again, because dynamic_mob is at play here

    in other words, if you actually just use *mobcount or *getmapunits to search for a monster on the map not yet populated, it will return empty

    this can be bypass by spawn with a *monster script command .... it just ...

    No.2 monster spawned by boss_monster syntax cannot replicate with *monster script command

    monster spawned by *monster script command can bypass the dynamic mob,
    but there are no script command available yet that can simulate with boss_monster syntax
    this has been suggested on hercules -> https://github.com/HerculesWS/Hercules/issues/1839

    in other words, if you want the MVP can search by Convex Mirror and also can search by a script command, currently not available
    it was available on eathena because both dynamic_mob and convex mirror wasn't implement yet, back then

    there are a few methods that I can think of to solve this issue, either
    1. implement the suggestion to have *boss_monster script command
    2. disable dynamic mob (not recommended)
    3. apply this patch -> https://rathena.org/board/topic/88722-dynamic-mobs-not-respawn-mvp-very-small-mod/

    • Upvote 1
  19. just forget it,
    like I said, the method that add value, multiply, subtract, multiply again ... all developers has been do like this since ancient time eathena
    the addition/subtraction and multiply/division should supposedly split into 2 different function
    we put all the formula into 1 single function, that's why produce this kind of result

    this *bug* exist on all *athena emulator, hercules also affected
    that's why malufett wish to redesign this system, but he never complete it

  20. I didn't get a crash, but got a nullpo

    --- nullpo info --------------------------------------------
    d:\ragnarok\rathena\src\map\instance.cpp:377: in func `instance_create'

     

    yeah, very common mistakes, rathena has to add a line in db\re\instance_db.txt

    50,Temple of Demon God,7200,300,1@eom,102,16

    then it work fine

     

    that's why rathena instance is currently being rewritten

×
×
  • Create New...