Jump to content

bWolfie

Members
  • Content Count

    848
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by bWolfie


  1. Hello, I am trying to create a piece of code using a plugin which will return 0;

    I started by creating my struct player_data, which contain state my_state, intended to be set and red as ssd->state.my_state (1st code box)

    I set my_state using an atcommand and it seems to set ok. But when I'm trying to bring it up in the following code (2nd code box), ssd->state.my_state is returning 0 even though I am sure it is really set to 1 after using my atcommand.

    Looking for help thank you.

    struct player_data {
    	struct {
    		unsigned short my_state : 1;
    	} state;
    }
    if (target && target->type == BL_PC) {
    	struct map_session_data *sd = BL_CAST(BL_PC, target);
    	if (sd) {
    		struct player_data *ssd;
    		if (!(ssd = getFromMSD(sd, 0))) {
    			CREATE(ssd, struct player_data, 1);
    			addToMSD(sd, ssd, 0, true);
    		}
    		if (ssd && ssd->state.my_state == 1)
    			return 0;
    	}
    }

     


  2. You need to edit status icon for SI_WEIGHTOVER50. Use Dastgir's guide to help you: http://herc.ws/board/topic/7526-guide-adding-new-status-icons/

    Edit msgstringtable.txt to have it display the amount you want. Just ctrl+f it.
    HP/SP will not be restored when your carried weight is over 50% of the Weight Limit.#
    You can't use Skills or Attack while your carried weight is over 90% of your Weight Limit.#

    If you want a custom message for an item you can use the dispbottom() script command.

     


  3. Yes. The file is db/produce_db.txt. Just search 'AM_PHARMACY' and you will find the area you need.

    However, it is not enough to give ranking points. That would require source editing.
    To make your custom item give ranking points, first open src/map/itemdb.h and add a constant for your custom Item ID.

    enum item_itemid {
        ITEMID_MYCUSTOMITEM            = 29001,
    }
    

    Then open src/map/skill.c and need to include your constant to not 'continue'.

    Find:

    				if (rnd()%10000 < make_per || qty == 1) { //Success
    					tmp_item.amount++;
    					if(nameid < ITEMID_RED_SLIM_POTION || nameid > ITEMID_WHITE_SLIM_POTION)
    						continue;

    Below it, change so it like this:

    				if (rnd()%10000 < make_per || qty == 1) { //Success
    					tmp_item.amount++;
    					if((nameid < ITEMID_RED_SLIM_POTION || nameid > ITEMID_WHITE_SLIM_POTION) && nameid != ITEMID_MYCUSTOMITEM)
    						continue;

     


  4. How about this? It should store every non-bound item in a new array .@ID[]

    	getinventorylist();
    	for (.@i = 0; .@i < @inventorylist_count; .@i++) {
    		/* Filter only items that is not bound */
    		if (!@inventorylist_bound[.@i]){
    			.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], @inventorylist_bound[.@i]);
    			.@menu$ += sprintf("%s %s:", @itemname2_info$, .@itemname$);
    			.@ID[.@j] = @inventorylist_id[.@i];
    			.@j++;
    		}
    	}
    	.@menu$ += "Cancel";
    	.@s = select(.@menu$) -1;
    	if (.@s == .@j)
    		close;
    	
    	/* Now display ItemID of selected inventory */
    	mesf("You have selected %d", .@ID[.@s]);  // this did not return correct info because it reads [.@s] index from getinventorylist but not the filtered menu.

     


  5. In git use the command git log -1 and it should give you some input. below is a sample, bold/italic is my commit no.

    commit f0ac93031a951bde7e014693803003e63c5bafd9 (HEAD -> master)

    If possible better to port old custom stuff into a new Hercules. Files often have cross-dependencies, so it likely cannot just be straight imported.


  6. 1 hour ago, estoudegreve said:

    no bots please! hehe

    this is client which dont really have anything to do with bots. lots of people have mice with GUI which lets them program keystrokes into clicks and even automation. GUI means even the newbest of newbs can bot (dont need to learn AHK, which is even newb)


  7. my suggestion start over and import all your old content to fresh hercules and follow improved practices, so then you can simply
    git add remote origin Merge https://github.com/HerculesWS/Hercules.git
    git fetch Merge
    git merge Merge/master
    ...resolve any conflicts (shud be not many if any)

    and voila you up to date with hercules

    plugins, item_db2 and mob_db2 help immensely with this. it will take a long time to import ur stuff, but it is worth it in my opinion.

×
×
  • Create New...

Important Information

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