Jump to content

Patskie

Community Contributors
  • Content Count

    366
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Patskie

  1. Probably an absurd answer : his while loop is much slightly faster than your for loop in terms of execution time
  2. https://code.google.com/p/fluxcp-ra/source/browse/branches/fluxcp-1.0/data/npc/DonationNPC.txt?spec=svn1070&r=1070
  3. getinventorylist;for( set .@i,0; .@i < @inventorylist_count; set .@i, .@i + 1 ) { if ( @inventorylist_identify[.@i] == 1 ) continue; delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0; getitem @inventorylist_id[.@i],1;}if ( !getbrokenid(1) ) close;atcommand "@repairall"; Add this
  4. prontera,150,150,0 script Sample 100,{ query_sql "SELECT DISTINCT(`account_id`) FROM `char` WHERE `online` = '1'",.@aid; for ( .@i = 0; .@i < getarraysize(.@aid); .@i++ ) { if ( attachrid( .@aid[.@i] ) ) { if ( strcharinfo(3) == "prontera" ) cutin "kafra_07", 2; } } for ( .@x = 3; .@x > 0; .@x-- ) { announce "Count down : " +.@x,0; sleep 1000; } for ( .@y = 0; .@y < getarraysize(.@aid); .@y++ ) { if ( attachrid( .@aid[.@y] ) ) { if ( strcharinfo(3) == "prontera" ) cutin "", 255; } } end;} Like this?
  5. The delitem command is triggered when the item is not null otherwise it does nothing. though i can say a do while loop is a better approach
  6. https://github.com/HerculesWS/Hercules/blob/master/npc/custom/card_remover.txt
  7. prontera,150,150,0 script Sample 100,{ if ( !countitem( 7539 ) ) { mes "You need 1 " +getitemname( 7539 )+ " in order to talk to me"; close; } if ( select( "Here have my " +getitemname( 7539 )+ ":Nevermind" ) - 1 ) close; .@r = rand(501, 700); if ( getitemname( .@r ) != "null" ) { delitem 7539, 1; getitem .@r, 1; } close;}
  8. Patskie

    [Question]

    The warning trigger when someone talk to npc and the player is far away from that npc.
  9. delitem 501, .@input; // replace 501 to POD item id. getitem 501, .@input; // replace 501 to poring coin item id.
  10. Do you use existing vip script? If so, show us
  11. set $@rate,.@frate[rand(getarraysize(.@frate))];
  12. if ( !Class && BaseLevel < 14 ) { // not allowed show some message or end the script }
  13. Speechless! Did i really just saw 4 billion @_@ <3
  14. Search sometimes http://herc.ws/board/topic/3665-hwsage-soul-link-modification/#entry24613. Regarding the LOV for SG. Someone release it. Have a look instead of waiting for an answer.
  15. Patskie

    countitem loop

    Players will only be attached to the npc whenever they talk to it or when the script execute certain labels or by using addrid or attachrid. In your case you put this line on OnInit label : .@player_name$ = "[^FF0000"+strcharinfo(0)+"^000000]"; Which means that when the script was loaded by the server it will assign the name of a player on the variable .@player_name$ ( in which case by default and by loaded i believe no player is currently talking to that npc ) Regarding the wrong case error. Maybe it was included in your other scripts. I am certain that the error does not belong to the script you are talking about in this topic. I just modified your script. Kindly test this one and tell me if it works : prontera,155,150,3 script TEST_NPC1 99,{ .@player_name$ = "[^FF0000"+strcharinfo(0)+"^000000]"; // No requirements for( .@i = 0; .@i < getarraysize(.qitem); .@i++ ) { if ( countitem( .qitem[.@i] ) < .qamt ) { // Dialogue if player does NOT have the required items already mes .npc_name$; mes "dialogue hereeeee."; mes "More hereeeee"; next; mes .@player_name$; mes "PC dialogue here"; next; if(select("Yes, please.:No, thank you.") == 2) { mes .npc_name$; mes "leaving message here"; close; } mes .npc_name$; mes "more dialogue"; next; mes .npc_name$; mes "Come back with:"; // List items for(.@i = 0; .@i < getarraysize(.qitem); .@i++) mes "^FF0000"+ .qamt +"x - "+ getitemname(.qitem[.@i]) +"^000000"; mes "...and I will give you the item."; close; } } // Has requirements mes .npc_name$; mes "congrats dialogue for gather items."; for( .@i = 0; .@i < getarraysize(.qitem); .@i++ ) delitem .qitem[.@i],.qamt; getitem .pitem,.pamt; close;OnInit: // Configuration // General .npc_name$ = "[^008800NPC_NAME^000000]"; // NPC's dialogue name // Items .pitem = 901; // Prize item for completing the quest .pamt = 1; // Prize item amount setarray .qitem[0], 501, 502, 503; .qamt = 1; // Quest item amount end;}
  16. Line 3069 : if(sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_STAR) { sd->right_weapon.addrace[RC_BOSS] += 100; sd->left_weapon.addrace[RC_BOSS] += 100; sd->right_weapon.addele[ELE_HOLY] += 100; sd->left_weapon.addele[ELE_HOLY] += 100;} Line 4821 : if(sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_STAR) flee2 += 10;
  17. What is your preference damage? Reduce how many %? or what?
  18. I have tried this and works fine on my test server. You can check it : src/map/status.c : Add ( Line 4212 ) : if(sc->data[SC_SOULLINK] && (sc->data[SC_SOULLINK]->val2 == SL_WIZARD || sc->data[SC_SOULLINK]->val2 == SL_SAGE)) vit += ((TBL_PC*)bl)->status.int_ / 5; Add ( Line 5564 ) : if(sc->data[SC_SOULLINK] && (sc->data[SC_SOULLINK]->val2 == SL_WIZARD || sc->data[SC_SOULLINK]->val2 == SL_SAGE)) maxhp += ((TBL_PC*)bl)->status.base_level * 200;
  19. Just want to say have a happy happy new year everyone!

    1. cJei

      cJei

      Happy New Year! :D

  20. That command is already existing here https://github.com/HerculesWS/Hercules/blob/master/npc/other/Global_Functions.txt#L311 They are telling you that you might include another function same with that on any of your custom scripts ( duplicate ).
  21. same with this http://herc.ws/board/topic/3692-freebies-but-not-npc/ isn't it?
  22. Try : itemid,itemname,.........{ callfunc("Freebies",2357,2524,2115,2421); },{},{} /* callfunc( "Freebies",itemid{,itemid} ); */function script Freebies { for ( .@i = 0; .@i < getargcount(); .@i++ ) getitem getarg(.@i), 1; return;}
  23. That was around 2005-2006? can't recall lol
  24. Same with you. But seriously? 100 PHP for 5 hours? isn't that time 50 PHP is for 8 hours? hmm. around 300 PHP is 1 month i guess?
×
×
  • Create New...

Important Information

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