Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by AnnieRuru

  1. this can be done rather easily by using battleground script commands<--no need to worry about party creation

    I wont call this script hard either

    just 1 thing curious

    how to you define the 'winning team' ?

    losing team lost all the members by dead ? all 5 party members are killed ?

    then isn't it becomes a simple simple 5 vs 5 team pvp ?

    cause I thought 'Capture the Flag' has something to do with bring the flag to home base ...

  2. play a hat game

    - has ticket ( will consume the ticket )

    --- pick a quest for random headgear 31000~31050

    ----- if yes generate 3 set of requirement out of 100 of these ( out of preset 100 requirements, only 3 of them is needed to complete the quest )

    i. collect 100 jellopies

    ii. collect 20 apples

    iii. collect 25 sticky web

    iv. collect .....

    - if completed the player will get the headgear

    so ...

    if the player consume 1 ticket, the script generate 1 random quest pick from item ID range 31000~31050 <-- need to save 1 player variable

    and pick 3 requirements out of preset 100 <-- need to save another 3 player variables, or use some kind of algoritm to compress into 1 <-- hardest part

    I guess the player can give up this quest and let the script generate another by consuming another ticket item

    let me tell you

    this script is heavily relies on algorithm

    especially comparing player saved variable storing the item requirement to the preset script item requirements <-- need comparison on 2 dimensions

    I was thinking of using this, but not sure what else goes with it.

    set .rand, rand(1,100);

    since you stuck on this stage

    means you don't even has a slightest clue how to create an array and doing comparison with while-loop ....

    you have a long long way to go if you want to make this even look possible ...

    PS: pls level up your technique before approaching this level of script ....

    you are current level 20 trying to beat a level 80 boss /swt

    anyways

    step 1.

    try to script how to store a player variable with 1 random number

    step 2

    show me a script that you can store multiple player variables with 3 out of 100 generated numbers

    step 3 .... next time ... AFTER you impressed me enough

    • Upvote 1
  3. on one of the post on eathena

    addslot doesnt work with the getitemslots script command or am i doing it wrong? heres how i am checking it if(getitemslots(EQI_HEAD_TOP)==1)

    replace

    if ( getitemslot( EQI_HEAD_TOP ) == 1 ) { < statement > }

    into

    getinventorylist;
    for ( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i +1 ) {
    if ( @inventorylist_equip[.@i] == 256 ) {
    < statement >
    }
    }

    EdIted

    Loc: Equipment's placement. Values are:

    2^8 256 = Upper Headgear

    ========================

    EDITED 2:

    OK screwed it up

    getinventorylist doesn't check the amount of slots that item has

    it can only check AFTER the player has inserted the card though

    so ... nope, still need a serious *getitemslot2 ....

    work around adding @inventorylist_slots in *getinventorylist script command sound possible but isn't practical at all

    as the command was needed in item database script

    • Upvote 1
  4. your

    do {
    < all >
    if ( getgmlevel() > x ) ....
    < higher gm level >
    } while ( getgmlevel() > x )

    my usual method

    while (1) {
    < all >
    if ( getgmlevel() < x ) close;
    < higher gm level >
    }

    it seems you got yourself a sifu on your side ....

    curious ... I'm still guessing who is it ... /hmm

    ==================================================

    nope,

    OnInit:
    OnSun0001:
    do{
    setarray .Monster[0],rand(1001,2380),100;
    }while( getmonsterinfo( .Monster[0],0 ) == "null" );
    set .eventID, rand(2000000000); // <-- add this
    set .GMLevel,60;
    end;

    and change this

    if( #MOBID != .Monster[0] ){
    set #MOBID,.Monster[0];
    set #AMOUNT,0;
    }

    into this

    if ( #MOTW_ID != .eventID )
    set #AMOUNT, 0;

    get rid of the #MOBID entirely, its not needed

    because the topic starter said if it somehow random back into same mob ID

    <-- today .Monster[0] is Isis and tomorow .Monster[0] is Isis again

    using if( #MOBID != .Monster[0] ) comparison will not work in this case

    if you think there's in 1/2000000000 chances that will get same event ID

    also can do it by increasing counter,

    set .eventID, .eventID +1;

    PS: I wonder is eventID++ works currently

    • Upvote 1
  5. I don't know where the original topic is

    but a wild guess from me what this snippet does is

    add an item slot only to a single player <-- cause it need player attached

    but the getitemslot script command is search into itemdb database

    so the snippet provide there has no problem with it

    but you probably need another custom made script command like *getitemslot2 to purposely fulfill this condition <-- EDITED

    I had a hunch thinking that *getinventorylist might do the trick

  6. You just cant fix it emistry XD

    LOL ????

    *laugh out secretly in the corner*

    if (getpartymembercount(getcharid(1)) == 3 && getpartycount(getcharid(1)) == 3){

    rathena doesn't have getpartymembercount or getpartycount script command

    probably need to ask for any source modification the author has ... I guess

    or I guess its some purposely made prank to make you not able to fix it .... hmmm ......

    if that's the author intention I don feel like fixing this script

    <-- is anybody able to find this in script release ?

    if yes I'll try fix, if no I'll not

  7. under battle_calc_damage function in battle.c

    before the ending line return damage;

    add if ( battle_getcurrentskill(src) == LK_SPIRALPIERCE && damage > 50000 ) damage = 50000;

    didn't test though

  8. I know a little bit about src modification

    and compare a little ... latest 16815 and mine -> 14801 <-- works great

    the source code for BUILDIN_FUNC(showevent) and clif_quest_show_event doesn't show any different

    my instinct tells me this is client side fault ... something like recent hexed client changed the packet handling

    however I guess its safe for you to post this in rathena bug report section to get some insight from developers

    if this is truly a packet change,

    developers should fix this with #if PACKETVER >= 20120410 ... .something

    I'm still downloading latest client so I can't get much info for now

    ======================================

    there is a gurantee workaround this problem by doing @refresh

    prontera,157,175,5    script    guild redeem    100,{
       showevent 1, 0;
       sleep2 2000;
       getmapxy .@map$, .@x, .@y, 0;
       warp .@map$, .@x, .@y;
    }

  9. it can only be countered by setting another variable, like #WeeklyKillID

    example,

    when a new week started and monster ID changed,

    set $@WeeklyKilllID, rand(2000000000);

    and do a check on player inside OnNPCKillEvent after initial if... check

    if ( $@WeeklyKillID != #WeeklyKillID ) {

    set #WeeklyKill, 0; set #WeeklyKillID, $@WeeklyKillID;

    }

    since this is Emistry's script, I believe he should be able to do something like this

  10. only gm can access this:

    How does this work?",PPE_HowTo, "Host this Event",PPE_Host;

    and non gm can access this:

    "Join Event Now",PPE_Join,"Claim my reward",PPE_claim;

    if ( getgmlevel() >= 60 )
      menu "How does this work?",PPE_HowTo,"Host this Event",PPE_Host;
    else
      menu "Join Event Now",PPE_Join,"Claim my reward",PPE_claim;

    change that line

    menu "How does this work?",PPE_HowTo,"Host this Event",PPE_Host,"Join Event Now",PPE_Join.....,"Nevermind",PPE_nvm;

    into that

    pretty straight forward

    EDIT !!! who and why moderator move this simple question topic into script request o.O

  11. After doing some experiments... this is what showevent did to me :

    showevent 0,0; = give yellow bubble with "!" mark and Quest.

    showevent 1,0; = give yellow bubble with "?" mark and Quest.

    showevent 2,0; = give orange bubble with "!" mark and Job.

    showevent 3,0; = give orange bubble with "?" mark and Job.

    showevent 4,0; = give green bubble with "!" mark and Event.

    showevent 5,0; = give green bubble with "?" mark and Event.

    you know ... I'm still using this outdated server revision 14801 and what I get is

    showevent 1,0; = give yellow bubble with "!" mark and Quest.

    ....

    showevent 6,0; = give green bubble with "?" mark and Event.

    which is everything +1,

    and showevent 0,0; works fine to remove the bubble on my 14801 revision

    anyway have you guys tried showevent -1,0; ?

    in theory it should work .... if not please wait 1~2 more days till I download finish the latest kro+sak renewal client, still downloading atm

  12. prontera,157,175,5	script	guild redeem	100,{
    for ( set .@i, 0; .@i < .guild_size; set .@i, .@i +1 ) {
    	if ( strcharinfo(2) == .guild_name$ ) {
    		if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
    			for ( set .@i, 0; .@i < .item_size; set .@i, .@i +2 )
    				getitem .item[ .@i ], .item[ .@i +1 ];
    			mes "you received the items";
    			close;
    		}
    		mes "you are not guild master";
    		close;
    	}
    }
    for ( set .@i, 1; .@i < .guild_size -1; set .@i, .@i +1 )
    	set .@str$, .@str$ +", ^0000FF"+ .guild_name$[.@i] +"^000000";
    mes "sorry, only ^0000FF"+ .guild_name$[0] +"^000000"+ .@str$ +" and ^0000FF"+ .guild_name$[ .guild_size -1 ] +"^000000 can redeem prize from me";
    close;
    
    OnInit:
    setarray .guild_name$,
    	"LordOfDeath",
    	"ArmyOfHeaven",
    	"JackFrozen ";
    setarray .item,
    	18601, 5,
    	18603, 5,
    	18509, 5,
    	18508, 5,
    	18599, 5;
    
    set .guild_size, getarraysize( .guild_name$ ); // don't touch these 2
    set .item_size, getarraysize( .item );
    end;
    }

    pretty simple script if you know how to work your way in arrays

    EDIT:

    oh f*** up, I messed up about this is not a script request section and made a working script instead

    oh well, currently I'm in script frenzy mode anyways, to polish up my scripting techniques atm

  13. can you please at least post a database side item_db script, ( how the item provoke the script )

    so I have a general idea how to start on the npc side

    even a psuedo-code item_db side is sufficient

    =======

    let me guess,

    so there are 2 items ?

    in order to use apple juice(531), I need to collect apple juice scroll(32000 ... some random create item)

    then once I got the apple juice scroll and look for this npc, this npc will show the recipe to make apple juice ?

  14. your request kinda make me reminds of my mission board script, that were highly demanded to be convert to SQL version

    anyway

    /*
    create table item_recipe_custom (
    id smallint not null primary key auto_increment,
    item_id smallint(6) unique,
    value1 smallint(6) not null default '0',
    amount1 smallint(6) not null default '0',
    value2 smallint(6) not null default '0',
    amount2 smallint(6) not null default '0',
    value3 smallint(6) not null default '0',
    amount3 smallint(6) not null default '0',
    value4 smallint(6) not null default '0',
    amount4 smallint(6) not null default '0',
    value5 smallint(6) not null default '0',
    amount5 smallint(6) not null default '0',
    value6 smallint(6) not null default '0',
    amount6 smallint(6) not null default '0',
    value7 smallint(6) not null default '0',
    amount7 smallint(6) not null default '0',
    value8 smallint(6) not null default '0',
    amount8 smallint(6) not null default '0',
    value9 smallint(6) not null default '0',
    amount9 smallint(6) not null default '0',
    value10 smallint(6) not null default '0',
    amount10 smallint(6) not null default '0'
    ) engine = innodb;
    */
    prontera,157,175,5	script	item_recipe_make	100,{
    set item_recipe_custom0, 0;
    set .@nb, query_sql( "select * from item_recipe_custom", .@id, .@item_id, .@v1, .@a1, .@v2, .@a2, .@v3, .@a3, .@v4, .@a4, .@v5, .@a5, .@v6, .@a6, .@v7, .@a7, .@v8, .@a8, .@v9, .@a9, .@v0, .@a0 );
    if ( .@nb == -1 ) {
    	mes "the table is not set";
    	close;
    }
    if ( .@nb == 0 ) {
    	mes "current list is empty";
    	close;
    }
    mes "select an item to make";
    next;
    set .@menu$, getitemname( .@item_id );
    for( set .@i, 1; .@i < .@nb; set .@i, .@i +1 )
    	set .@menu$, .@menu$ +":"+ getitemname( .@item_id[ .@i ] );
    set .@s, select( .@menu$ ) -1 ;
    if ( getd( "item_recipe_custom"+ ( .@id[ .@s ] / 31 ) ) & pow( 2, .@id[ .@s ] % 31 ) ) {
    	mes "you've learned how to make this item and used them";
    	close;
    }
    mes "to make ^ff0000"+ getitemname( .@item_id[ .@s ] );
    mes "^000000you need the following items:^0000ff";
    set .@i, 1;
    while ( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) {
    	mes getd( ".@a"+ .@i +"["+ .@s +"]" ) +"x "+ getitemname( getd( ".@v"+ .@i +"["+ .@s +"]" ) );
    	set .@i, .@i +1;
    }
    next;
    select "learn it";
    set .@i, 1;
    while ( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) {
    	if ( countitem( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) < getd( ".@a"+ .@i +"["+ .@s +"]" ) ) {
    		mes "you don't have enough "+ getitemname( getd( ".@v"+ .@i +"["+ .@s +"]" ) );
    		close;
    	}
    	set .@i, .@i +1;
    }
    set .@i, 1;
    while ( getd( ".@v"+ .@i +"["+ .@s +"]" ) ) {
    	delitem getd( ".@v"+ .@i +"["+ .@s +"]" ), getd( ".@a"+ .@i +"["+ .@s +"]" );
    	set .@i, .@i +1;
    }
    setd "item_recipe_custom"+( .@id[ .@s ] /31 ), getd( "item_recipe_custom"+( .@id[ .@s ] /31 ) ) | pow( 2, .@id[ .@s ] % 31 );
    mes "you've learned how to make "+ getitemname( .@item_id[ .@s ] );
    close;
    }

    pls let me spam abit

    WTF and WTF the hell with me used 2 hours and 30 mins to make this simple script

    I need to continue make more script at the moment to improve myself yet

    • Upvote 1
×
×
  • Create New...