Jump to content

agamanaros

Members
  • Posts

    46
  • Joined

  • Last visited

Posts posted by agamanaros

  1. 13 hours ago, Kins said:

    Okay, I've got a solution in place, and I'll share it here. I think a better solution is probably possible, and I think this might be an actual bug that should be discussed with rAthena devs.

    I thought similarly about the "propagation" when I noticed it seemed like the status effect of Defender was indeed being applied properly (had icon), but some of the effects of it were not being applied. I confirmed that when I cast Devotion on a target while I have Defender active (in both cases of it being the first devotion cast, and a recast) the target _will_ get the defender status icon, _will_ walk slow, but _will not_ get the damage reduction and _will not_ get the ASPD reduction. When Defender is recast, the damage reduction and aspd reduction are properly applied (I ran some tests with level 1 Defender for the ASPD check). The fact that some effects are being applied is what makes me think this is bug-level. If it was all or nothing, I could think "expected behaviour".

    So, this meant the target is properly being devoted, but is not getting the effects properly. So I dug a little deeper. I tried to find where the effects of Defender are applied.

    I think the place that the devotion target loses ASPD is also in status.cpp:

    if (sc->getSCE(SC_DEFENDER))
        bonus -= sc->getSCE(SC_DEFENDER)->val4 / 10;

    Since it doesn't work, maybe val4 probably isn't populated correctly.

    There's another ASPD related bit lower:

    if(sc->getSCE(SC_DEFENDER))
        aspd_rate += sc->getSCE(SC_DEFENDER)->val4;

    Also relying on val4.

    There's a damage related bit using val2 in battle.cpp:

    damage -= damage * tsc->getSCE(SC_DEFENDER)->val2 / 100;

    I think the place that the devotion target loses speed is in status.cpp:

    if( sc->getSCE(SC_DEFENDER) )
        speed = max(speed, 200);

    Note it does not rely on val2/val3/val4 from the status and is working as it should be.

    But when you cast Devotion, the status_change_start call is setting them to 0 (or in the case of val4, (type2 == SC_REFLECTSHIELD ? 1 : 0) for some reason). val2 is being passed as 0 but it's used as the damage reduction variable, val3 is being passed as 0 which is fine since it's deprecated for defender afaik, and I'm not sure what's happening with val4 but that should be the ASPD reduction factor.

    status_change_start(d_bl, bl, type2, 10000, d_sc->getSCE(type2)->val1, 0, 0, (type2 == SC_REFLECTSHIELD ? 1 : 0), skill_get_time(status_db.getSkill(type2),d_sc->getSCE(type2)->val1), SCSTART_NOAVOID);

    When you cast Defender, you can see these values being properly passed:

    case SC_DEFENDER:
                if (!(flag&SCSTART_NOAVOID)) {
                    val2 = 5 + 15*val1; // Damage reduction
                    val3 = 0; // Unused, previously speed adjustment
                    val4 = 250 - 50*val1; // Aspd adjustment
    
                    if (sd) {
                        map_session_data *tsd;
                        int32 i;
                        for (i = 0; i < MAX_DEVOTION; i++) { // See if there are devoted characters, and pass the status to them. [Skotlex]
                            if (sd->devotion[i] && (tsd = map_id2sd(sd->devotion[i])))
                                status_change_start(src,&tsd->bl,type,10000,val1,val2,val3,val4,tick,SCSTART_NOAVOID);
                        }
                    }
                }

     

    Now, for the solution I've just put in place. It's working, but I think there are probably better solutions. You can revert all of your SC_DEVOTION code from the first post back to it's original state, and just modify the status_change_start call to:

    status_change_start(d_bl, bl, type2, 10000, d_sc->getSCE(type2)->val1, (type2 == SC_DEFENDER ? d_sc->getSCE(type2)->val2:0), (type2 == SC_DEFENDER ? d_sc->getSCE(type2)->val3:0), (type2 == SC_REFLECTSHIELD ? 1 : (type2 == SC_DEFENDER ? d_sc->getSCE(type2)->val4:0)), skill_get_time(status_db.getSkill(type2),d_sc->getSCE(type2)->val1), SCSTART_NOAVOID);


    From here, I think it would also be good to know how val1/val2/val3/val4 are being used by the other status' to be sure they aren't being broken somehow as well. Since I didn't take the time to understand how SC_AUTOGUARD, SC_REFLECTSHIELD and SC_ENDURE are working, I've just separated the DEFENDER portion from those to fix it separately. It might actually be possible to do something like this, instead:

    status_change_start(d_bl, bl, type2, 10000, d_sc->getSCE(type2)->val1, d_sc->getSCE(type2)->val2, d_sc->getSCE(type2)->val3,d_sc->getSCE(type2)->val4, skill_get_time(status_db.getSkill(type2),d_sc->getSCE(type2)->val1), SCSTART_NOAVOID);

    (Also please note the last argument I changed to give icons for all the passed status', but you can use

    (type2 == SC_DEFENDER) ? SCSTART_NOAVOID : SCSTART_NOAVOID|SCSTART_NOICON

    if you'd like).

    I got it to work now sir, thank you @kins

  2. 3 hours ago, Kins said:

    I'm going to be looking into this too as I also want to fix it for my server. This behaviour surprised me when I found out about it. I'm not sure if it's vanilla or not.

    I looked into it for a little, but I couldn't understand why even when using the same code from the SC_DEFENDER section where it is properly applying Defender wasn't working when ported into the SC_DEVOTION section. If I remember correctly, they had the icon but not the damage reduction effect but I would have to re-test to be 100% certain on that.

    Thanks for sharing your observations! Initially, I encountered the same issue where SC_DEFENDER wasn’t inherited by the party member on the first cast of Devotion. The Paladin needed to manually recast Defender for the buff to apply properly.

    Through further testing, I noticed another peculiar behavior: when spamming Devotion, the Defender icon appears on the party member, but the damage reduction effect doesn’t trigger. Instead of reduced damage, the party member takes 100% damage, suggesting that the effect itself isn't being properly inherited, only the visual status icon.

    My current exploration has led me to suspect that there's a deeper issue with how SC_DEFENDER is initialized or propagated through Devotion. It might require a forced recalculation or proper flag handling to ensure that both the icon and effects apply consistently.

     

  3. Hello everyone,

    I'm currently working on a custom fix for an issue with the Devotion skill and its interaction with Defender on my private server. After numerous tests, I've run into a roadblock that I can't seem to resolve.

    The problem is that on the first cast of Devotion while Defender is active, the party member receiving Devotion does not inherit the Defender buff. For the buff to apply, I need to deactivate and reactivate Defender after casting Devotion. This behavior is inconsistent and problematic during gameplay, particularly when the party member is dispelled by Clown or Professor. Even if I recast Devotion immediately, Defender is not inherited until I toggle it off and on again.

    Here are the key tests I've performed:

    1. Initial Devotion with Defender Active: The party member does not receive the Defender buff on the first cast.
    2. Toggling Defender Off and On: After manually toggling Defender, the party member successfully inherits the buff.
    3. Post-Dispel Scenario: If the party member is dispelled, reapplying Devotion alone does not reinstate Defender; I need to recast Defender first.

    I have tried integrating various code adjustments, including forced status updates and reapplications, but the issue persists.

    If anyone has encountered a similar problem or has suggestions on how to ensure Defender properly inherits on the first Devotion cast, I would greatly appreciate the assistance.

    Thanks in advance for your help!

    Here is my status.cpp BEFORE:

    		case SC_DEVOTION:
    		{
    			struct block_list *d_bl;
    			struct status_change *d_sc;
    
    			if( (d_bl = map_id2bl(val1)) && (d_sc = status_get_sc(d_bl)) && d_sc->count ) { // Inherits Status From Source
    				const enum sc_type types[] = { SC_AUTOGUARD, SC_DEFENDER, SC_REFLECTSHIELD, SC_ENDURE };
    				int i = (map_flag_gvg2(bl->m) || map_getmapflag(bl->m, MF_BATTLEGROUND))?2:3;
    				while( i >= 0 ) {
    					enum sc_type type2 = types[i];
    					if( d_sc->data[type2] )
    						status_change_start(d_bl, bl, type2, 10000, d_sc->data[type2]->val1, 0, 0, (type2 == SC_REFLECTSHIELD ? 1 : 0), skill_get_time(status_sc2skill(type2),d_sc->data[type2]->val1), (type2 == SC_DEFENDER) ? SCSTART_NOAVOID : SCSTART_NOAVOID|SCSTART_NOICON);
    					i--;
    				}
    			}
    			break;
    		}

     

    And my status.cpp AFTER:

    		case SC_DEVOTION:
    		{
    		    struct block_list *d_bl;
    		    struct status_change *d_sc;
    
    		    // Get the devotion target (party member) and their status change structure
    		    if ((d_bl = map_id2bl(val1)) && (d_sc = status_get_sc(d_bl)) && d_sc->count) {
    		        struct status_change *src_sc = status_get_sc(bl); // Paladin's status changes
    		        if (src_sc) {
    		            // Check if Paladin has Defender active
    		            if (src_sc->data[SC_DEFENDER]) {
    		                // Get the level of Paladin's Defender
    		                int defender_level = src_sc->data[SC_DEFENDER]->val1;
    
    		                // Check if the devoted target already has Defender
    		                if (!d_sc->data[SC_DEFENDER]) {
    		                    // Apply Defender to the devotion target on the first cast
    		                    status_change_start(
    		                        d_bl, bl, SC_DEFENDER, 10000, defender_level, 0, 0, 0,
    		                        skill_get_time(status_sc2skill(SC_DEFENDER), defender_level),
    		                        SCSTART_NOAVOID
    		                    );
    		                } else {
    		                    // If target already has Defender, update the timer and level
    		                    struct status_change_entry *sce = d_sc->data[SC_DEFENDER];
    		                    if (sce->timer != INVALID_TIMER) {
    		                        // If the timer is active, update the Defender level and reset the timer
    		                        delete_timer(sce->timer, status_change_timer);
    		                    }
    		                    sce->val1 = defender_level;  // Update Defender level
    		                    sce->timer = add_timer(
    		                        gettick() + skill_get_time(status_sc2skill(SC_DEFENDER), defender_level),
    		                        status_change_timer,
    		                        d_bl->id, SC_DEFENDER
    		                    );
    		                }
    		            }
    
    		            // Check and apply other buffs (Autoguard, Reflectshield, Endure)
    		            const enum sc_type types[] = { SC_AUTOGUARD, SC_REFLECTSHIELD, SC_ENDURE };
    		            int i = 0;
    
    		            while (i < sizeof(types)/sizeof(types[0])) {
    		                enum sc_type type = types[i];
    
    		                if (src_sc->data[type]) {
    		                    struct status_change_entry *sce = src_sc->data[type];
    		                    int level = sce->val1;  // Get the level of the buff
    
    		                    // Check if the target already has the status
    		                    if (!d_sc->data[type]) {
    		                        // Apply the status to the target (1st time cast)
    		                        status_change_start(
    		                            d_bl, bl, type, 10000, level, 0, 0, (type == SC_REFLECTSHIELD ? 1 : 0),
    		                            skill_get_time(status_sc2skill(type), level),
    		                            SCSTART_NOAVOID
    		                        );
    		                    } else {
    		                        // Update the status on target (for all buffs except Defender)
    		                        struct status_change_entry *target_sce = d_sc->data[type];
    		                        target_sce->val1 = level;
    		                        if (target_sce->timer != INVALID_TIMER) {
    		                            delete_timer(target_sce->timer, status_change_timer);
    		                        }
    		                        target_sce->timer = add_timer(
    		                            gettick() + skill_get_time(status_sc2skill(type), level),
    		                            status_change_timer,
    		                            d_bl->id, type
    		                        );
    		                    }
    		                }
    		                i++;
    		            }
    		        }
    		    }
    		    break;
    		}

     

  4. Hello everyone,

    I'm currently working on a custom fix for an issue with the Devotion skill and its interaction with Defender on my private server. After numerous tests, I've run into a roadblock that I can't seem to resolve.

    The problem is that on the first cast of Devotion while Defender is active, the party member receiving Devotion does not inherit the Defender buff. For the buff to apply, I need to deactivate and reactivate Defender after casting Devotion. This behavior is inconsistent and problematic during gameplay, particularly when the party member is dispelled by Clown or Professor. Even if I recast Devotion immediately, Defender is not inherited until I toggle it off and on again.

    Here are the key tests I've performed:

    1. Initial Devotion with Defender Active: The party member does not receive the Defender buff on the first cast.
    2. Toggling Defender Off and On: After manually toggling Defender, the party member successfully inherits the buff.
    3. Post-Dispel Scenario: If the party member is dispelled, reapplying Devotion alone does not reinstate Defender; I need to recast Defender first.

    I have tried integrating various code adjustments, including forced status updates and reapplications, but the issue persists.

    If anyone has encountered a similar problem or has suggestions on how to ensure Defender properly inherits on the first Devotion cast, I would greatly appreciate the assistance.

    Thanks in advance for your help!

     

    This is my status.cpp BEFORE:

    		case SC_DEVOTION:
    		{
    			struct block_list *d_bl;
    			struct status_change *d_sc;
    
    			if( (d_bl = map_id2bl(val1)) && (d_sc = status_get_sc(d_bl)) && d_sc->count ) { // Inherits Status From Source
    				const enum sc_type types[] = { SC_AUTOGUARD, SC_DEFENDER, SC_REFLECTSHIELD, SC_ENDURE };
    				int i = (map_flag_gvg2(bl->m) || map_getmapflag(bl->m, MF_BATTLEGROUND))?2:3;
    				while( i >= 0 ) {
    					enum sc_type type2 = types[i];
    					if( d_sc->data[type2] )
    						status_change_start(d_bl, bl, type2, 10000, d_sc->data[type2]->val1, 0, 0, (type2 == SC_REFLECTSHIELD ? 1 : 0), skill_get_time(status_sc2skill(type2),d_sc->data[type2]->val1), (type2 == SC_DEFENDER) ? SCSTART_NOAVOID : SCSTART_NOAVOID|SCSTART_NOICON);
    					i--;
    				}
    			}
    			break;
    		}

     

     

    And this is my status.cpp AFTER:

    		case SC_DEVOTION:
    		{
    		    struct block_list *d_bl;
    		    struct status_change *d_sc;
    
    		    // Get the devotion target (party member) and their status change structure
    		    if ((d_bl = map_id2bl(val1)) && (d_sc = status_get_sc(d_bl)) && d_sc->count) {
    		        struct status_change *src_sc = status_get_sc(bl); // Paladin's status changes
    		        if (src_sc) {
    		            // Check if Paladin has Defender active
    		            if (src_sc->data[SC_DEFENDER]) {
    		                // Get the level of Paladin's Defender
    		                int defender_level = src_sc->data[SC_DEFENDER]->val1;
    
    		                // Check if the devoted target already has Defender
    		                if (!d_sc->data[SC_DEFENDER]) {
    		                    // Apply Defender to the devotion target on the first cast
    		                    status_change_start(
    		                        d_bl, bl, SC_DEFENDER, 10000, defender_level, 0, 0, 0,
    		                        skill_get_time(status_sc2skill(SC_DEFENDER), defender_level),
    		                        SCSTART_NOAVOID
    		                    );
    		                } else {
    		                    // If target already has Defender, update the timer and level
    		                    struct status_change_entry *sce = d_sc->data[SC_DEFENDER];
    		                    if (sce->timer != INVALID_TIMER) {
    		                        // If the timer is active, update the Defender level and reset the timer
    		                        delete_timer(sce->timer, status_change_timer);
    		                    }
    		                    sce->val1 = defender_level;  // Update Defender level
    		                    sce->timer = add_timer(
    		                        gettick() + skill_get_time(status_sc2skill(SC_DEFENDER), defender_level),
    		                        status_change_timer,
    		                        d_bl->id, SC_DEFENDER
    		                    );
    		                }
    		            }
    
    		            // Check and apply other buffs (Autoguard, Reflectshield, Endure)
    		            const enum sc_type types[] = { SC_AUTOGUARD, SC_REFLECTSHIELD, SC_ENDURE };
    		            int i = 0;
    
    		            while (i < sizeof(types)/sizeof(types[0])) {
    		                enum sc_type type = types[i];
    
    		                if (src_sc->data[type]) {
    		                    struct status_change_entry *sce = src_sc->data[type];
    		                    int level = sce->val1;  // Get the level of the buff
    
    		                    // Check if the target already has the status
    		                    if (!d_sc->data[type]) {
    		                        // Apply the status to the target (1st time cast)
    		                        status_change_start(
    		                            d_bl, bl, type, 10000, level, 0, 0, (type == SC_REFLECTSHIELD ? 1 : 0),
    		                            skill_get_time(status_sc2skill(type), level),
    		                            SCSTART_NOAVOID
    		                        );
    		                    } else {
    		                        // Update the status on target (for all buffs except Defender)
    		                        struct status_change_entry *target_sce = d_sc->data[type];
    		                        target_sce->val1 = level;
    		                        if (target_sce->timer != INVALID_TIMER) {
    		                            delete_timer(target_sce->timer, status_change_timer);
    		                        }
    		                        target_sce->timer = add_timer(
    		                            gettick() + skill_get_time(status_sc2skill(type), level),
    		                            status_change_timer,
    		                            d_bl->id, type
    		                        );
    		                    }
    		                }
    		                i++;
    		            }
    		        }
    		    }
    		    break;
    		}

     

  5. 10 minutes ago, Chaos92 said:

    old equipments having restructure for a quite long time ago.

    why not you use the refiner that rathena has right now ?

    https://github.com/rathena/rathena/blob/master/npc/re/merchants/hd_refiner.txt

    Hi sir, really appreciate you responding to my query. I'am trying to implement rathena official hd_refiner script however Im having hard time adjusting the refine limit from +7~+9 I need it to be +4~+10.

  6. Good day! Im seeking for your kindest assistance regarding my refine NPC. I'm using a refine NPC I just got of from rathena. As you can you in the image below. Im using a refine script from the link below. It works fine but the npc is reading the equip position wrong. Thank you and more power!

    //=====================================================================================
    // Refine from +5 to +10
    //=====================================================================================
    skycity,127,240,5	script	HD Refiner	826,{
    callfunc	"refinenew2","Safety Upgrade",0;
    OnInit:
    waitingroom " HD Refiner",0;
    end;
    }
    
    //============================================================
    //= To allow auto safe refining/multiple refining set the
    //= second argument to '1' in the function call.
    //============================================================
    function	script	refinenew2	{
    
    set .@features,getarg(1);
    mes "[" + getarg(0) + "]";
    mes "I'm Bestri brother.";
    mes "I can refine all kinds of weapons, armor and equipment, so let me";
    mes "know what you want me to refine.";
    next;
    
    setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
    set .@menu$,"";
    for( set .@i,1; .@i <= 7; set .@i,.@i+1 )
    {
    if( getequipisequiped(.@i) )
    set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
    
    set .@menu$, .@menu$ + ":";
    }
    set .@part,select(.@menu$);
    if(!getequipisequiped(.@part)) {
    mes "[" + getarg(0) + "]";
    mes "You're not wearing";
    mes "anything there that";
    mes "I can refine.";
    close;
    }
    //Check if the item is refinable...
    if(!getequipisenableref(.@part)) {
    mes "[" + getarg(0) + "]";
    mes "I don't think I can";
    mes "refine this item at all...";
    close;
    }
    //Check to see if the items is between +5 and +10
    if(getequiprefinerycnt(.@part) >= 10) {
    mes "[" + getarg(0) + "]";
    mes "I can't refine this";
    mes "any more. This is as";
    mes "refined as it gets!";
    close;
    }
    if(getequiprefinerycnt(.@part) <= 3) {
    mes "[" + getarg(0) + "]";
    mes "I can't refine this yet.";
    mes "Upgrade it to ^0000FFatleast +4^000000";
    mes "before you bring it to me.";
    close;
    }
    set .@refineitemid, getequipid(.@part); // save id of the item
    set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
    switch(getequipweaponlv(.@part)){
    case 0: //Refine Armor
    set .@price,20000;
    set .@material,30205;
    set .@safe,4;
    break;
    case 1: //Refine Level 1 Weapon
    set .@price,20000;
    set .@material,30205;
    set .@safe,7;
    break;
    case 2: //Refine Level 2 Weapon
    set .@price,20000;
    set .@material,30205;
    set .@safe,6;
    break;
    case 3: //Refine Level 3 Weapon
    set .@price,20000;
    set .@material,30205;
    set .@safe,5;
    break;
    case 4: //Refine Level 4 Weapon
    set .@price,20000;
    set .@material,30205;
    set .@safe,4;
    break;
    case 5: //Refine other stuff?
    set .@price,20000;
    set .@material,30205;
    set .@safe,4;
    break;
    }
    if(.@features != 1) {
    mes "[" + getarg(0) + "]";
    mes "To refine this I need";
    mes "one ^003366"+getitemname(.@material)+"^000000 and";
    mes "a service fee of " + .@price + " Zeny.";
    mes "Do you really wish to continue?";
    next;
    if(select("Yes:No") == 2){
    mes "[" + getarg(0) + "]";
    mes "Yeah...";
    mes "There's no need to";
    mes "rush. Take your time.";
    close;
    }
    if(getequippercentrefinery(.@part) < 100) {
    mes "[" + getarg(0) + "]";
    mes "Oh no! If I continue to";
    mes "refine this, there's a risk it could";
    mes "be ^FF0000downgraded by 1 levels!^000000";
    mes "Do you still want to refine?";
    next;
    if(select("Yes:No") == 2){
    mes "[" + getarg(0) + "]";
    mes "I completely agree...";
    mes "I might be a great refiner, but sometimes even I make mistakes.";
    close;
    }
    }
    if((countitem(.@material) < 1) || (Zeny < .@price)) {
    mes "[" + getarg(0) + "]";
    mes "You don't seem to have";
    mes "enough Zeny or "+getitemname(.@material)+"...";
    mes "Go get some more. I'll be";
    mes "here all day if you need me.";
    close;
    }
    set Zeny,Zeny-.@price;
    delitem .@material,1;
    if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
    mes "[" + getarg(0) + "]";
    mes "Look here... you don't have any Items on...";
    close;
    }
    if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
    mes "[" + getarg(0) + "]";
    mes "Wait a second...";
    mes "Do you think I'm stupid?!";
    mes "You switched the item while I wasn't looking! Get out of here!";
    close;
    }
    if(getequippercentrefinery(.@part) <= rand(100)) {
    //getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part)-1,0,getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
    downrefitem .@part;
    mes "[" + getarg(0) + "]";
    set .@emo,rand(1,5);
    if (.@emo == 1) {
    } else {
    }
    set .@lose,rand(1,2);
    if (.@lose == 1) {
    mes "OH! MY GOD!";
    mes "Damn it! Not again!";
    mes "I'm terribly sorry, but you know practice does make perfect.";
    mes "Um, right? Heh heh...";
    } else {
    mes "Crap!";
    mes "It couldn't take";
    mes "much more tempering!";
    mes "Sorry about this...";
    }
    close;
    }
    mes "["+getarg(0)+"]";
    successrefitem .@part;
    set .@win,rand(1,3);
    if (.@win == 1) {
    mes "Perfect!";
    mes "Heh heh!";
    mes "Once again,";
    mes "flawless work";
    mes "from the master~";
    } else if(.@win == 2) {
    mes "Success...!";
    mes "Yet again, my amazing";
    mes "talent truly dazzles";
    mes "and shines today.";
    } else {
    mes "Heh heh!";
    mes "I'm all done.";
    mes "No doubt, my work is";
    mes "to your satisfaction.";
    mes "Sheer, utter perfection~";
    }
    }
    // New Refining Functions ========================
    mes "[" + getarg(0) + "]";
    mes "I can refine this to the limit or a desired number of times... it's your choice...";
    next;
    switch(select("I'll decide how many times.","I've changed my mind...")) {
    case 1:
    mes "[" + getarg(0) + "]";
    mes "So how many times would you like me to refine your item?";
    next;
    input .@refinecnt;
    set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
    if (.@refinecnt < 1 || .@refinecheck > 20) {
    mes "[" + getarg(0) + "]";
    mes "I can't refine this item that many times.";
    close;
    }
    if(.@refinecheck > .@safe) {
    set .@refinecheck,.@refinecheck - .@safe;
    mes "[" + getarg(0) + "]";
    mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be ^FF0000downgraded by 1 levels^000000 if i fail... is that ok?";
    next;
    if(select("Yes...","No...") == 2){
    mes "[" + getarg(0) + "]";
    mes "You said so..Hmm so be it...";
    close;
    }
    }
    break;
    case 2:
    mes "[" + getarg(0) + "]";
    mes "You said so..Hmm so be it...";
    close;
    }
    set .@fullprice,.@price * .@refinecnt;
    mes "[" + getarg(0) + "]";
    mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
    next;
    if(select("Yes","No...") == 2){
    mes "[" + getarg(0) + "]";
    mes "You said so..Hmm so be it...";
    close;
    }
    if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
    mes "[" + getarg(0) + "]";
    mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
    close;
    }
    set Zeny,Zeny - .@fullprice;
    delitem .@material,.@refinecnt;
    while(.@refinecnt){
    if (getequipisequiped(.@part) == 0) {
    mes "[" + getarg(0) + "]";
    mes "Look here... you don't have any Items on...";
    close;
    }
    if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
    mes "[" + getarg(0) + "]";
    mes "Clan... No, but Did you imagine I could be so stupid !?!";
    mes "You have changed it...";
    mes "Go out before I stun you with my Hammer!!!";
    close;
    }
    mes "Clang, clang!!!";
    if(getequippercentrefinery(.@part) <= rand(100)) {
    //getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part)-1,0,getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
    downrefitem .@part;
    mes "[" + getarg(0) + "]";
    mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
    set .@refinecnt,.@refinecnt - 1;
    if(.@refinecnt == 0) close;
    mes "Here's the unused Zeny and Material back...";
    getitem .@material,.@refinecnt;
    set .@fullprice,.@refinecnt * .@price;
    set Zeny,Zeny + .@fullprice;
    close;
    }
    successrefitem .@part;
    set .@refinecnt,.@refinecnt - 1;
    next;
    }
    mes "[" + getarg(0) + "]";
    mes "All finished... Come again soon.";
    close;
    }
    
    //
    // NORMAL REFINER
    ///
    skycity,131,240,5	script	Normal Refiner	826,{
    	callfunc "refinemain","Hollgrehenn",1;
    	end;
    	OnInit:
    		waitingroom " Normal Refiner",0;
    	end;
    }

    image.png.715e03ed86166e4c243e3fb97d308a9b.pngimage.png.8820df930e0aef8a34e39519402aad4c.png

  7. Hi Good day, I am posting this hoping someone could help me updating my goldroom script. I'm trying to add timer of 8 hours daily limit in my gold room and was able to do so, however if I logout and try to re-enter the npc, Npc rejects. script is posted below,

    Thank you and more power.

     

    skycity,117,217,6	script	Piso Dungeon	540,{
    mes "[Piso Dungeon]";
    mes "You only have 8 hours per day to farm inside my dungeon";
    next;
    mes "Do you want to go inside?";
    if( select("Enter Piso Dungeon:Cancel") == 1 )
    	if( #Daily == gettime(5)|| query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 0 )
    		next;
    		mes "You've already consumed your 8 hours today. Pleace come back tomorrow.";
    	else{
    		mes "[Piso Dungeon]";
    		mes "Please be reminded that all card effects are disabled in this map.";
    		next;
    		set #Daily,gettime(5);
    		addtimer 28800000,strnpcinfo(0)+"::OnTimeLimit";
    		atcommand "@alootid reset";
    		atcommand "@alootid +35405";
    		atcommand "@autostore 15";
    		warp "ba_lib",160,6;
    	}
    close;
    
    OnTimeLimit:
    	message strcharinfo(0),"Time's Up.";
    	sleep2 3000;
    	warp "SavePoint",0,0;
    	end;
    
    OnInit:
    waitingroom " Piso Dungeon",0;
    end;
    	
    }

     

  8. Already resolved this problem on my end. Code is inserted below.

    Thank you

    //===== rAthena Script =======================================
    //= Disguise Event
    //===== By: ==================================================
    //= GmOcean
    //===== Current Version: =====================================
    //= 5.1
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= Guess a monster name correctly for prizes.
    //= 
    //= NOTE: Requires PCRE library installed.
    //===== Additional Comments: =================================
    //= 5.0 Last update by GmOcean.
    //= 5.1 Cleaned and standardized, mostly. [Euphy]
    //============================================================
    
    skycity,184,210,4	script	Disguise Event	795,{
    
    	// Currently set to run every two hours.
    	// To change times, edit the OnClock labels below.
    
    	set .@GMLevel,60;	// GM level required to access NPC.
    	set .@n$,"[^0000FFDisguise NPC^000000]";
    
    	if (getgmlevel()>=.@GMLevel) {
    		mes .@n$;
    		mes "Select an option.";
    		next;
    		switch(select("Turn ON/OFF Event:Event Settings")) {
    		case 1:
    			mes .@n$;
    			if (.EventON) {
    				mes "The Event is currently: [^0000FFON^000000]";
    				mes "Would you like to turn it OFF?";
    			} else {
    				mes "The Event is currently: [^FF0000OFF^000000]";
    				mes "Would you like to turn it ON?";
    			}
    			if(select("Yes:No")==2) close;
    			if (.EventON) {
    				set .EventON,0; set .Timer,0;
    				setnpctimer 0; stopnpctimer;
    				announce "A GM has decided to turn the Disguise Event off. As a result no further prizes will be given.",bc_map | bc_blue;
    //				deletepset 1;
    				setnpcdisplay "Disguise Event",795;
    				close;
    			}
    			set .EventON,1; set .Timer,1; setnpctimer 0; initnpctimer;
    			set .ResetCounter,.ResetCounter+1;
    			announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue;
    			announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    			close;
    		case 2:
    			mes .@n$;
    			mes "Pick a setting to modify.";
    			next;
    			switch(select("Monster Display:Number of Rounds:Prize Settings")) {
    			case 1:
    				setarray .@r$[0],"Disguise as all monsters.","Disguise as MVPs only.";
    				mes .@n$;
    				mes "Choose a disguise rule.";
    				next;
    				set .Rule, select(implode(.@r$,":"));
    				mes .@n$;
    				mes "The Disguise Rule has been set:";
    				mes "  > ^0055FF"+.@r$[.Rule-1]+"^000000";
    				close;
    			case 2:
    				mes .@n$;
    				mes "Input the number of rounds you want the event to last.";
    				mes "Current number: [^0000FF"+.Rounds+"^000000]";
    				next;
    				input .@Rounds;
    				set .Rounds,.@Rounds;
    				mes .@n$;
    				mes "The number of rounds has been changed to "+.Rounds+".";
    				close;
    			case 3:
    				mes .@n$;
    				mes "Input the Item ID of the prize given each round.";
    				mes "Current item: [^0000FF"+getitemname(.Prize)+"^000000] (ID #"+.Prize+")";
    				next;
    				input .@Prize;
    				mes .@n$;
    				if (getitemname(.@Prize)=="" || getitemname(.@Prize)=="null") {
    					mes "That item does not exist. Please try again.";
    					close;
    				}
    				set .Prize,.@Prize;
    				mes "Input the amount to be given.";
    				next;
    				input .@amount;
    				mes .@n$;
    				if (.@amount<=0 || .@amount>=10000) {
    					mes "That amount is invalid. Using default amount of 1.";
    					set .@amount,1;
    					next;
    					mes .@n$;
    				}
    				set .PrizeAmt,.@amount;
    				mes "The Prize has been changed successfully.";
    				mes "Prize: "+.PrizeAmt+"x [^0000FF"+getitemname(.Prize)+"^000000]";
    				close;
    			}
    		}
    	}
    	if (.EventON) end;
    	mes .@n$;
    	mes "Welcome.";
    	mes "How may I be of assistance?";
    	if(select("Information:Nothing, just passing through.")==2) close;
    	next;
    	mes .@n$;
    	mes "This event is quite simple.";
    	mes "At the start of the event, I will";
    	mes "disguise myself as a random";
    	mes "monster. You have to shout";
    	mes "that monster's name out loud.";
    	next;
    	mes "If you are correct, you will receive";
    	mes "a prize. If not, keep trying!";
    	mes "That's all that there is to this event.";
    	close;
    
    OnInit:
    	set .EventON,0;
    	set .Wait,0;
    	set .Winner,0;
    	set .ResetCounter,0;
    	set .Rounds,10;
    	set .Prize1,7539;
    	set .PrizeAmt1,3;
    	set .Prize2,35405;
    	set .PrizeAmt2,1;
    	set .Rule,1;
    	setarray .MVP[0],1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373,
    	                  1389,1399,1418,1492,1502,1511,1583,1623,1630,1646,1647,1648,1649,1650,1651,1658,1685,1688,
    				   1708,1719,1734,1751,1768,1779,1785,1802,1832,1871,1874,1885,1917,1980,2022,2068,2087,2131,
    				   2156,2165;
    	set .BlackList$, "1003,1006,1017,1021,1022,1027,1043,1075,1136,1137,1168," + 
    	    "1171,1172,1173,1181,1187,1210,1217,1218,1222,1223,1224,1225,1226,1227,1228," + 
    	    "1233,1284,1407,1411,1414,1495,1501,1900,1996,2000,2001,2002,2003,2004," + 
    	    "2005,2006,2007,2011,2012,2025,2028,2029,2030,2031,2032,2033,2034,2035," + 
    	    "2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049," + 
    	    "2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063," + 
    	    "2064,2065,2066,2067,2075,2076,2077,2078,2079,2080,2081,2083,2084,2085," + 
    	    "2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099," + 
    	    "2100,2101,2012,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113," + 
    	    "2114,2115,2116,2117,2118,2119,2120,2121,2123,2124,2125,1496,";
    	end;
    OnMinute40:
    	set .ResetCounter,.ResetCounter+1;
    	set .EventON,1;
    	set .Timer,1;
    	set .Wait,1;
    	announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	setnpctimer 0;
    	initnpctimer;
    	end;
    OnTimer10000:
    	if (.Timer || .Change) end;
    	set .Wait,0;
    	goto iDisguise;
    	end;
    OnTimer30000:
    	if (.Timer) end;
    	set .Change,0;
    	setnpcdisplay "Disguise Event",795;
    	npctalk "Disguise Event : You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
    	specialeffect EF_DETECT2;
    	set $MonsterName$,"";
    //	deletepset 1;
    	stopnpctimer;
    	setnpctimer 0;
    	set .RoundCount,.RoundCount+1;
    	if (.RoundCount>=.Rounds) {
    		setnpcdisplay "Disguise Event",795;
    		set .RoundCount,0; set .Change,0; set .EventON,0;
    		setnpctimer 0; stopnpctimer;
    		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
    		end;
    	}
    	initnpctimer;
    	end;
    OnTimer60000:
    	if (.Timer!=1) end;
    	announce "The Disguise Event will begin in 2 minutes.",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	end;
    OnTimer120000:
    	if (.Timer!=1) end;
    	announce "The Disguise Event will begin 1 minute.",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	end;
    OnTimer180000:
    	if (.Timer!=1) end;
    	announce "The Disguise Event has begun!",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	set .Timer,0; stopnpctimer;
    	setnpctimer 0; initnpctimer;
    iDisguise:
    	if (.Rule==1) {
    		set .Winner,0;
    		set .Monster,1000+rand(1,995);
    		if (compare(","+.BlackList$+"," , ","+.Monster+",")) goto iDisguise;
    		if (.Monster==.LastMonster) goto iDisguise;
    		set .LastMonster,.Monster;
    		set $MonsterName$,getmonsterinfo(.Monster,0);
    	}
    	if (.Rule==2) {
    		set .Winner,0;
    		set .Monster,rand(49);
    		set $MonsterName$,getmonsterinfo(.MVP[.Monster],0);
    	}
    //	deletepset 1;
    	defpattern 1,"([^:]+):.\\s*"+$MonsterName$+".*", "iCorrect";
    	activatepset 1;
    	if (.Rule==1) setnpcdisplay "Disguise Event",.Monster;
    	if (.Rule==2) setnpcdisplay "Disguise Event",.MVP[.Monster];
    	set .Change,1;
    	setnpctimer 0;
    	end;
    iCorrect:
    	if (.Winner) {
    		dispbottom "Someone has already won this round.";
    		end;
    	}
    	set .Winner,1;
    	set .RoundCount,.RoundCount+1;
    //	deletepset 1;
    	activatepset 1;
    	getitem .Prize1,.PrizeAmt1;
    	getitem .Prize2,.PrizeAmt2;
    	announce strcharinfo(0)+" is correct! I was disguised as: "+$MonsterName$+"",bc_map | bc_blue;
    	if (.RoundCount>=.Rounds) {
    		setnpcdisplay "Disguise Event",795;
    		set .RoundCount,0; set .Change,0; set .EventON,0;
    		setnpctimer 0; stopnpctimer;
    		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
    		end;
    	}
    	setnpcdisplay "Disguise Event",795;
    	set .Change,0;
    	setnpctimer 0;
    	end;
    }

     

  9. Good day!

    I am seeking for your assistance regarding my gold room. If anyone can help me implementing strict 1 ip per person inside the goldroom. My script is inserted below. Thank you very much.

    skycity,117,217,6	script	Piso Dungeon	540,{
    mes "[Piso Dungeon]";
    mes "Do you want to enter my Piso Dungeon?";
    menu "Ok",-,"No thanks.",L_No;
    mes "Awesome!";
    next;
    mes "I wish you all the luck! Happy Hunting!";
    atcommand "@alootid reset";
    atcommand "@alootid +35405";
    atcommand "@autostore 15";
    warp "ba_lib",0,0;
    close;
    
    L_No:
    close;
    
    OnInit:
    waitingroom " Piso Dungeon",0;
    end;
    
    }
    
    
    //============Spawns=================
    
    ba_lib,0,0,0,0	monster	Dark Jose Rizal	3020,100,3600000 // Dokebi with drop
    ba_lib,0,0,0,0	monster	Dark Jose Rizal	3021,500,600000 // Dokebi without drop
    ba_lib,0,0,0,0	monster	Dark Jose Rizal	3021,500,600000 // Dokebi without drop
    
    // Exit
    ba_lib,160,3,0	warp	phptotown#1	1,1,skycity,149,259
    
    //mapflags
    ba_lib.gat	mapflag	nobranch
    ba_lib.gat	mapflag	noicewall
    ba_lib.gat	mapflag	noreturn
    ba_lib.gat	mapflag	nosave
    ba_lib.gat	mapflag	noskill
    ba_lib.gat	mapflag	noteleport
    ba_lib.gat	mapflag	nowarp
    ba_lib.gat	mapflag	nowarpto

     

  10. Good day!

     

    I would like to seek for your assistance regarding with hourly disguise. I was hoping if its possible to set 2 .prize and .prizeamount. I tried doing some revisions in the script but so far no luck.
    Script is inserted below.
    Thank you ?

     

    //===== rAthena Script =======================================
    //= Disguise Event
    //===== By: ==================================================
    //= GmOcean
    //===== Current Version: =====================================
    //= 5.1
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= Guess a monster name correctly for prizes.
    //= 
    //= NOTE: Requires PCRE library installed.
    //===== Additional Comments: =================================
    //= 5.0 Last update by GmOcean.
    //= 5.1 Cleaned and standardized, mostly. [Euphy]
    //============================================================
    
    skycity,184,210,4	script	Disguise Event	795,{
    
    	// Currently set to run every two hours.
    	// To change times, edit the OnClock labels below.
    
    	set .@GMLevel,60;	// GM level required to access NPC.
    	set .@n$,"[^0000FFDisguise NPC^000000]";
    
    	if (getgmlevel()>=.@GMLevel) {
    		mes .@n$;
    		mes "Select an option.";
    		next;
    		switch(select("Turn ON/OFF Event:Event Settings")) {
    		case 1:
    			mes .@n$;
    			if (.EventON) {
    				mes "The Event is currently: [^0000FFON^000000]";
    				mes "Would you like to turn it OFF?";
    			} else {
    				mes "The Event is currently: [^FF0000OFF^000000]";
    				mes "Would you like to turn it ON?";
    			}
    			if(select("Yes:No")==2) close;
    			if (.EventON) {
    				set .EventON,0; set .Timer,0;
    				setnpctimer 0; stopnpctimer;
    				announce "A GM has decided to turn the Disguise Event off. As a result no further prizes will be given.",bc_map | bc_blue;
    //				deletepset 1;
    				setnpcdisplay "Disguise Event",795;
    				close;
    			}
    			set .EventON,1; set .Timer,1; setnpctimer 0; initnpctimer;
    			set .ResetCounter,.ResetCounter+1;
    			announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue;
    			announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    			close;
    		case 2:
    			mes .@n$;
    			mes "Pick a setting to modify.";
    			next;
    			switch(select("Monster Display:Number of Rounds:Prize Settings")) {
    			case 1:
    				setarray .@r$[0],"Disguise as all monsters.","Disguise as MVPs only.";
    				mes .@n$;
    				mes "Choose a disguise rule.";
    				next;
    				set .Rule, select(implode(.@r$,":"));
    				mes .@n$;
    				mes "The Disguise Rule has been set:";
    				mes "  > ^0055FF"+.@r$[.Rule-1]+"^000000";
    				close;
    			case 2:
    				mes .@n$;
    				mes "Input the number of rounds you want the event to last.";
    				mes "Current number: [^0000FF"+.Rounds+"^000000]";
    				next;
    				input .@Rounds;
    				set .Rounds,.@Rounds;
    				mes .@n$;
    				mes "The number of rounds has been changed to "+.Rounds+".";
    				close;
    			case 3:
    				mes .@n$;
    				mes "Input the Item ID of the prize given each round.";
    				mes "Current item: [^0000FF"+getitemname(.Prize)+"^000000] (ID #"+.Prize+")";
    				next;
    				input .@Prize;
    				mes .@n$;
    				if (getitemname(.@Prize)=="" || getitemname(.@Prize)=="null") {
    					mes "That item does not exist. Please try again.";
    					close;
    				}
    				set .Prize,.@Prize;
    				mes "Input the amount to be given.";
    				next;
    				input .@amount;
    				mes .@n$;
    				if (.@amount<=0 || .@amount>=10000) {
    					mes "That amount is invalid. Using default amount of 1.";
    					set .@amount,1;
    					next;
    					mes .@n$;
    				}
    				set .PrizeAmt,.@amount;
    				mes "The Prize has been changed successfully.";
    				mes "Prize: "+.PrizeAmt+"x [^0000FF"+getitemname(.Prize)+"^000000]";
    				close;
    			}
    		}
    	}
    	if (.EventON) end;
    	mes .@n$;
    	mes "Welcome.";
    	mes "How may I be of assistance?";
    	if(select("Information:Nothing, just passing through.")==2) close;
    	next;
    	mes .@n$;
    	mes "This event is quite simple.";
    	mes "At the start of the event, I will";
    	mes "disguise myself as a random";
    	mes "monster. You have to shout";
    	mes "that monster's name out loud.";
    	next;
    	mes "If you are correct, you will receive";
    	mes "a prize. If not, keep trying!";
    	mes "That's all that there is to this event.";
    	close;
    
    OnInit:
    	set .EventON,0;
    	set .Wait,0;
    	set .Winner,0;
    	set .ResetCounter,0;
    	set .Rounds,10;
    	set .Prize,7539;
    	set .PrizeAmt,3;
    	set .Rule,1;
    	setarray .MVP[0],1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373,
    	                  1389,1399,1418,1492,1502,1511,1583,1623,1630,1646,1647,1648,1649,1650,1651,1658,1685,1688,
    				   1708,1719,1734,1751,1768,1779,1785,1802,1832,1871,1874,1885,1917,1980,2022,2068,2087,2131,
    				   2156,2165;
    	set .BlackList$, "1003,1006,1017,1021,1022,1027,1043,1075,1136,1137,1168," + 
    	    "1171,1172,1173,1181,1187,1210,1217,1218,1222,1223,1224,1225,1226,1227,1228," + 
    	    "1233,1284,1407,1411,1414,1495,1501,1900,1996,2000,2001,2002,2003,2004," + 
    	    "2005,2006,2007,2011,2012,2025,2028,2029,2030,2031,2032,2033,2034,2035," + 
    	    "2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049," + 
    	    "2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063," + 
    	    "2064,2065,2066,2067,2075,2076,2077,2078,2079,2080,2081,2083,2084,2085," + 
    	    "2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099," + 
    	    "2100,2101,2012,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113," + 
    	    "2114,2115,2116,2117,2118,2119,2120,2121,2123,2124,2125,1496,";
    	end;
    OnMinute40:
    	set .ResetCounter,.ResetCounter+1;
    	set .EventON,1;
    	set .Timer,1;
    	set .Wait,1;
    	announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	setnpctimer 0;
    	initnpctimer;
    	end;
    OnTimer10000:
    	if (.Timer || .Change) end;
    	set .Wait,0;
    	goto iDisguise;
    	end;
    OnTimer30000:
    	if (.Timer) end;
    	set .Change,0;
    	setnpcdisplay "Disguise Event",795;
    	npctalk "Disguise Event : You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
    	specialeffect EF_DETECT2;
    	set $MonsterName$,"";
    //	deletepset 1;
    	stopnpctimer;
    	setnpctimer 0;
    	set .RoundCount,.RoundCount+1;
    	if (.RoundCount>=.Rounds) {
    		setnpcdisplay "Disguise Event",795;
    		set .RoundCount,0; set .Change,0; set .EventON,0;
    		setnpctimer 0; stopnpctimer;
    		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
    		end;
    	}
    	initnpctimer;
    	end;
    OnTimer60000:
    	if (.Timer!=1) end;
    	announce "The Disguise Event will begin in 2 minutes.",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	end;
    OnTimer120000:
    	if (.Timer!=1) end;
    	announce "The Disguise Event will begin 1 minute.",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	end;
    OnTimer180000:
    	if (.Timer!=1) end;
    	announce "The Disguise Event has begun!",bc_all | bc_blue;
    	announce "The Event is being held in Sky City (skycity 184 210).",bc_all | bc_blue;
    	set .Timer,0; stopnpctimer;
    	setnpctimer 0; initnpctimer;
    iDisguise:
    	if (.Rule==1) {
    		set .Winner,0;
    		set .Monster,1000+rand(1,995);
    		if (compare(","+.BlackList$+"," , ","+.Monster+",")) goto iDisguise;
    		if (.Monster==.LastMonster) goto iDisguise;
    		set .LastMonster,.Monster;
    		set $MonsterName$,getmonsterinfo(.Monster,0);
    	}
    	if (.Rule==2) {
    		set .Winner,0;
    		set .Monster,rand(49);
    		set $MonsterName$,getmonsterinfo(.MVP[.Monster],0);
    	}
    //	deletepset 1;
    	defpattern 1,"([^:]+):.\\s*"+$MonsterName$+".*", "iCorrect";
    	activatepset 1;
    	if (.Rule==1) setnpcdisplay "Disguise Event",.Monster;
    	if (.Rule==2) setnpcdisplay "Disguise Event",.MVP[.Monster];
    	set .Change,1;
    	setnpctimer 0;
    	end;
    iCorrect:
    	if (.Winner) {
    		dispbottom "Someone has already won this round.";
    		end;
    	}
    	set .Winner,1;
    	set .RoundCount,.RoundCount+1;
    //	deletepset 1;
    	activatepset 1;
    	getitem .Prize,.PrizeAmt;
    	announce strcharinfo(0)+" is correct! I was disguised as: "+$MonsterName$+"",bc_map | bc_blue;
    	if (.RoundCount>=.Rounds) {
    		setnpcdisplay "Disguise Event",795;
    		set .RoundCount,0; set .Change,0; set .EventON,0;
    		setnpctimer 0; stopnpctimer;
    		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
    		end;
    	}
    	setnpcdisplay "Disguise Event",795;
    	set .Change,0;
    	setnpctimer 0;
    	end;
    }

     

  11. On 8/11/2020 at 11:36 PM, Poring King said:

    Try this

     

    
    //Simple HG Hiding by crazyarashi
    
    -	script	Invisible	-1,{
    OnAtCommand:
    	.@npc$ = "["+ strnpcinfo(1) +"]";
    	mes .@npc$;
    	mes "Hello, "+strcharinfo(0);
    	mes "Which headgear do you want to hide?";	
    	next;
    	setarray .@hgmenu$, "Top Headgear", "Middle Headgear", "Lower Headgear";
    	.@menu$ = implode(.@hgmenu$, ":");
    		.@i = select( .@menu$ ) - 1;
    				.@equip = getequipid(.location$[.@i]);
    				if( .@equip != getequipid(.location$[.@i])) {
    				mes .@npc$;
    				mes "You're not wearing any headgear";
    				close;
    		} else {
    				atcommand "@"+ .looks$[.@i];
    				dispbottom .@hgmenu$[.@i] +" is now hidden";
    				end;
    				}
    OnInit:
    	setarray .location$, "EQI_HEAD_TOP", "EQI_HEAD_MID", "EQI_HEAD_LOW";
    	setarray .looks$, "changelook 1 0", "changelook 2 0", "changelook 3 0";
    	bindatcmd "hidehg",strnpcinfo(0)+"::OnAtCommand";
    
    }

     

    Hi Sir @Poring King,I tried your script and it works perfectly however Im just wondering if its possible that instead of choosing which headgear to disable, once @hidehg is called all of the headgear views will be 0?

    Thank you sir and more power!

  12. On 5/1/2020 at 7:21 PM, BigBurrito said:

    You want to disable all of them? or just some? 
    If all of them you can try by script..
     

    
    -	script	CheckWoEHat	-1,{
    end;
    
    OnPCLoadMapEvent:
    if(getmapflag(strcharinfo(3),mf_gvg_castle)) //// For Castle Maps
      {
      changelook LOOK_HEAD_TOP,0;
      changelook LOOK_HEAD_MID,0;
      changelook LOOK_HEAD_BOTTOM,0;
      end;
      }
    ///////////////// Change to normal when transfering to regular map.
    changelook LOOK_HEAD_TOP,getlook(LOOK_HEAD_TOP);
    changelook LOOK_HEAD_MID,getlook(LOOK_HEAD_MID);
    changelook LOOK_HEAD_BOTTOM,getlook(LOOK_HEAD_BOTTOM);
    end;
    
    }

    Now if you have for only certain IDs you'll need to add an array and do a loop to check if their sprite ID match with your array.. 
    You can also add for this to only work when WoE is ON with if (!agitcheck()) {end;}

    Hi @BigBurrito, Your script works fine however, I'm wondering if its possible to keep this script running while still inside the woe map? Please check the video to fully understand my query.

    Thank you and more power!

    2021-02-15 00-49-17.mkv

  13. 18 hours ago, Hyroshima said:

    Try like this:

    
    35815,Auto_Attack_Floater,Auto Attack Floater,5,20,,150,,6,,1,0xFFFFFFFF,63,2,2048,,1,1,4249,{},{ set @CloseW,0; callfunc "autojump"; },{ set @CloseW,1; }
    
    function	script	autojump	{
    
    	freeloop(1);
    	while(!@CloseW)
    	{
    		warp strcharinfo(3),0,0;
    		sleep2 10000;
    	}
    	freeloop(0); 
    
    end;
    }

    Hi Sir, The script worked perfectly! I would like to seek anyone's opinion about my problem. And my apologies if Im in the wrong section however, Im not sure if the problem is on the script or sprite. So the problem all started when, I tried installing @autoattack feature in my server however upon checking when using @autoattack and @jump at the same time it shows a sprite error. However, If I use a GM account in a GM suit it doesn't show any errors when using @autoattack and @jump at the same time. I tried literally all jobs if any jobs work but all we're having the same error. I even tried making a custom item/costume that has a GM Suit(GM Suit Costume), And still it shows the same error.

    I included a video of my problem below. I could really need a help right now. Thank you! ^^ 

     

    2020-11-20 04-43-39.mkv

    2020-11-20 04-45-35.mkv

    2020-11-20 04-56-16.mkv

  14. Good day!

    I would like to seek anyone's opinion about my problem. And my apologies if Im in the wrong section however, Im not sure if the problem is on the script or sprite. So the problem all started when, I tried installing @autoattack feature in my server however upon checking when using @autoattack and @jump at the same time it shows a sprite error. However, If I use a GM account in a GM suit it doesn't show any errors when using @autoattack and @jump at the same time. I tried literally all jobs if any jobs work but all we're having the same error. I even tried making a custom item/costume that has a GM Suit(GM Suit Costume), And still it shows the same error.

    I included a video of my problem below. I could really need a help right now. Thank you! ^^ 

     

    2020-11-20 04-45-35.mkv
    020-11-20 04-56-16.mkv
    2020-11-20 04-43-39.mkv

  15. Good day!

    I would like to seek anyone's opinion about my problem. I tried installing @autoattack feature in my server however upon checking when using @autoattack and @jump at the same time it shows a sprite error. However, If I use a GM account in a GM suit it doesn't show any errors when using @autoattack and @jump at the same time. I tried literally all jobs if any jobs work but all we're having the same error. I even tried making a custom item/costume that has a GM Suit(GM Suit Costume), And still it shows the same error.

    I included a video of my problem below. I could really need a help right now. Thank you! ^^ 

    2020-11-20 04-43-39.mkv
    2020-11-20 04-45-35.mkv
    2020-11-20 04-56-16.mkv

  16. Good day,

    I'd like to know if its possible to loop a script function called by item script. And script will run a loop while item is equipped?

    I'm trying to make a simple function script that would do @jump every 10 seconds while item 35815 is equipped.

    function    script    autojump    {
    OnInit:
    while(1) {
    warp strcharinfo(3),0,0;
    }
    end;
    }

    35815,Auto_Attack_Floater,Auto Attack Floater,5,20,,150,,6,,1,0xFFFFFFFF,63,2,2048,,1,1,4249,{},{ callfunc "autojump"; },{ callfunc "autojump"; }

    Thank you and more power!

  17. Hi!

     I was able to make cell_pk work however I'd like to know if there's way for an npc script that would display a message to the character when he/she goes in/or in that specific cell?

    here's my script below,

    -    script    FreePKZone    -1,{
    OnInit:
        setcell "prontera", 185, 161, 193, 169, cell_pk, 1;
        end;
    }

    Thank you and more power to us all!

  18. On 5/29/2014 at 3:49 PM, Kichi said:

    change to:

     

    
    		case BL_PC:
    		{
    			struct map_session_data *sd;
    			struct map_session_data *sds;
    			if( t_bl == s_bl ) break;
    			sd = BL_CAST(BL_PC, t_bl);
    			sds = BL_CAST(BL_PC, s_bl);
    			if( sd->state.monster_ignore && flag&BCT_ENEMY )
    				return 0; // Global inminuty only to Attacks
    			if( sd->status.karma && s_bl->type == BL_PC && ((TBL_PC*)s_bl)->status.karma )
    				state |= BCT_ENEMY; // Characters with bad karma may fight amongst them
    			if( sds->state.killable && sd->state.killable ) {
    				state |= BCT_ENEMY; // Everything can kill it
    				strip_enemy = 0;
    			}
    			break;
    		}

    untested

    Hi sir I would like to know if its possible to convert this mod to the latest git. I tried using your mod however it doesn't work in the latest git.

    Thank you and more power!

    .image.png.6491bcd26e3a2d80be883c8a9628be54.png

     

  19. Good day,

    I would like to ask if it possible to create an that would let the players request a song that can be pulled out from youtube? The thought would be like players will talk to the npc and type in a title of the song then the npc will search that song in youtube and will play it in prontera/maintown. Thank you and more power!

  20. Good day!

    I'm posting this message to seek for anyone's

    assistance regarding my npc script.

    I'm trying to do a OnClock Trigger however for whatever reason its not triggering. There's no error in maps and the more weird thing is if I use OnMinute to trigger npc to show and hide it works.

     

     

  21. 12 minutes ago, agamanaros said:

    Is it possible sir to add like a 2 seconds delay time once the progress bar is complete before it executes the script again? Then adding setpcblock PCBLOCK_MOVE while progressbar is still casting? so they'll have time to move before the progressbar recast again? Thanks sir!

    I tried adding mes " "; before the end; however that doesn't seem to do the trick. ?

     

  22. 4 hours ago, LearningRO said:

    actually you can use setpcblock PCBLOCK_MOVE,True; when talk to npc
    and then add setpcblock PCBLOCK_MOVE,False; when finish

    but You must disable autofishing when fail to use this

    Is it possible sir to add like a 2 seconds delay time once the progress bar is complete before it executes the script again? Then adding setpcblock PCBLOCK_MOVE while progressbar is still casting? so they'll have time to move before the progressbar recast again? Thanks sir!

×
×
  • Create New...