Jump to content

Forshaken

Members
  • Posts

    148
  • Joined

  • Last visited

Posts posted by Forshaken

  1. t

    4 hours ago, Dolphin86 said:

    as title, when i click on my npc at 1st time it was working as it should, but when i click it on the 2nd time i got this delay

      Hide contents

    image.thumb.png.bdcb2b54bbea9fb52d12d3a30257fb5c.png

    script:

      Hide contents
    neko_isle,71,122,6	script	Green Tree	659,{
    
    	if(Pick == 1) goto Pick1;
    	if(Pick == 2) goto Pick2;
    	if(Pick == 3) goto Pick3;
    	else {
    		getitem 512, 1;
    		set Pick,1;
    		close;
    		}
    
    	Pick1:
    		if (gettimetick(2) > #COOLDOWN_PICK) {
    		#COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds.
    		getitem 512, 1;
    		set Pick,2;
    		}
    		
    	Pick2:
    		if (gettimetick(2) > #COOLDOWN_PICK) {
    		#COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds.
    		getitem 512, 1;
    		set Pick,3;
    		}
    	Pick3:
    		if (gettimetick(2) > #COOLDOWN_PICK) {
    		#COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds.
    		getitem 512, 1;
    		set Pick,0;
    		}
    		
    	mes "Need to wait "+(#COOLDOWN_PICK - gettimetick(2))+" seconds.";
    	close;
    	}

     

    also i plan to make duplicate of this which each npc will give different items

    try to put end; function on each Pick# function

  2. 2 hours ago, jamesandrew said:
    //===== rAthena Script =============================================
    //= Punching Bag NPC
    //===== By: ========================================================
    //= Secretdataz
    //===== Current Version: ===========================================
    //= 0.2
    //===== Changelog: =================================================
    //= 0.1 Initial commit
    //= 0.2 Add MD_KNOCKBACK_IMMUNE
    //===== Compatible With: ===========================================
    //= rAthena Project
    //===== Additional Comments: =======================================
    //= When duplicating this NPC. Only use NUMBER after the # [secret]
    //==================================================================
    prontera,160,184,0	script	PunchingBag#0	844,{
    	end;
    	
    OnMyMobDead:
    OnInit:
    	getunitdata(getnpcid(0), .@d);
    	monster strnpcinfo(4),.@d[UNPC_X],.@d[UNPC_Y],"Punching Bag",1313,1,strnpcinfo(0)+"::OnMyMobDead";
    	.@dupid = atoi(strnpcinfo(2));
    	.gid[.@dupid] = $@mobid[0];
    	.mhp[.@dupid] = strmobinfo(4,2411);
    	setunitdata .gid[.@dupid],UMOB_MODE,.@d[UMOB_MODE]|0x4000000|0x0200000; // Set MD_STATUS_IMMUNE (0x4000000) because EDP/burn/%MHP based status can skew the DPS counter so much.
    	initnpctimer;
    	end;
    	
    OnTimer5000:
    	.@dupid = atoi(strnpcinfo(2));
    	if(unitexists(.gid[.@dupid])){
    		getunitdata(.gid[.@dupid],.@d);
    		.@diff = (.mhp[.@dupid] - .@d[UMOB_HP]);
    		if(.@diff > 0){
    			npctalk "Punching Bag : I've taken " + (.@diff/5) + " DPS in last 5 seconds.";
    			setunitdata .gid[.@dupid],UMOB_HP,.mhp[.@dupid];
    			specialeffect EF_HEAL;
    			setmapflag( "prontera",mf_monster_noteleport );
    		}
    	}
    	initnpctimer;
    }
    
    //prontera,224,78,0	duplicate(PunchingBag#0)	PunchingBag#1	844
    //prontera,224,66,0	duplicate(PunchingBag#0)	PunchingBag#2	844
    //prontera,215,66,0	duplicate(PunchingBag#0)	PunchingBag#3	844
    //Welgaia,182,143,0	duplicate(PunchingBag#0)	PunchingBag#4	844
    //Welgaia,157,143,0	duplicate(PunchingBag#0)	PunchingBag#5	844
    //Welgaia,132,143,0	duplicate(PunchingBag#0)	PunchingBag#6	844
    
    // Mapflag
    prontera	mapflag	monster_noteleport


    I use edited Mobster (changed max HP) as dummy

      Hide contents
    - Id: 1313
        AegisName: MOBSTER
        Name: Mobster
        Level: 61
        Hp: 79910000
        BaseExp: 4424
        JobExp: 1688
        Attack: 910
        Attack2: 1128
        Defense: 41
        MagicDefense: 37
        Str: 76
        Agi: 46
        Vit: 20
        Int: 35
        Dex: 76
        Luk: 55
        AttackRange: 1
        SkillRange: 10
        ChaseRange: 12
        Size: Medium
        Race: Demihuman
        Element: Neutral
        ElementLevel: 1
        WalkSpeed: 250
        AttackDelay: 1100
        AttackMotion: 560
        DamageMotion: 580
        Ai: 21
        Drops:
          - Item: Poison_Knife
            Rate: 3
          - Item: Blue_Jewel
            Rate: 4559
          - Item: Ring_
            Rate: 1
          - Item: Red_Gemstone
            Rate: 600
          - Item: Zargon
            Rate: 2500
          - Item: Panacea
            Rate: 450
          - Item: Blue_Potion
            Rate: 60
          - Item: Mobster_Card
            Rate: 1
            StealProtected: true

     

    npctalk is not working

    change this

     

    .mhp[.@dupid] = strmobinfo(4,2411); to 
    .mhp[.@dupid] = strmobinfo(4,1313);
    • Upvote 1
  3. 3 hours ago, luizinhomt said:

    that's exactly my friend

    You can just make a script for it bro

    -    script    at_pk    -1,{
    OnInit:
        bindatcmd "pk",strnpcinfo(3)+"::OnDo",0,99;
        end;
    OnDo:
      if(!pk_mode){
         atcommand "@pk";
         set pk_mode,1;
         hateffect,HATEFF_ID,TRUE;
      }else{
         atcommand "@pk";
         set pk_mode,0;
         hateffect,HATEFF_ID,FALSE;
      }
    end;

    OnPCLogoutEvent:
       if(pk_mode){
         atcommand "@pk";
         set pk_mode,0;
         hateffect,HATEFF_ID,FALSE;
       }
    end;
    }

  4. 19 hours ago, K i n G said:

    Thank you for replying,

    I need the ' / ' command not the ' @ ' command 😞

    or if you just want to remove it for normal player's perspective just follow the code below

     

    /// Amount of currently online players, reply to /w /who (ZC_USER_COUNT).
    /// 00c2 <count>.L
    void clif_user_count(map_session_data* sd, int count)
    {
    + if(sd->group_id >= 1) { // you can adjust the group id here
           int fd = sd->fd;

           WFIFOHEAD(fd,packet_len(0xc2));
           WFIFOW(fd,0) = 0xc2;
           WFIFOL(fd,2) = count;
           WFIFOSET(fd,packet_len(0xc2));
    + }
    }
     

  5. Just now, Forshaken said:

    oh my bad, go to clif.cpp and find 

    /// Amount of currently online players, reply to /w /who (ZC_USER_COUNT).
    /// 00c2 <count>.L
    void clif_user_count(map_session_data* sd, int count)
    {
        int fd = sd->fd;

        WFIFOHEAD(fd,packet_len(0xc2));
        WFIFOW(fd,0) = 0xc2;
        WFIFOL(fd,2) = count;
        WFIFOSET(fd,packet_len(0xc2));
    }

    Change to 

     

    /// Amount of currently online players, reply to /w /who (ZC_USER_COUNT).
    /// 00c2 <count>.L
    void clif_user_count(map_session_data* sd, int count)
    {
    /*
        int fd = sd->fd;

        WFIFOHEAD(fd,packet_len(0xc2));
        WFIFOW(fd,0) = 0xc2;
        WFIFOL(fd,2) = count;
        WFIFOSET(fd,packet_len(0xc2));
    */
    }

    dont forget to compile after applying the changes

  6. 1 hour ago, K i n G said:

    Thank you for replying,

    I need the ' / ' command not the ' @ ' command 😞

    oh my bad, go to clif.cpp and find 

    /// Amount of currently online players, reply to /w /who (ZC_USER_COUNT).
    /// 00c2 <count>.L
    void clif_user_count(map_session_data* sd, int count)
    {
        int fd = sd->fd;

        WFIFOHEAD(fd,packet_len(0xc2));
        WFIFOW(fd,0) = 0xc2;
        WFIFOL(fd,2) = count;
        WFIFOSET(fd,packet_len(0xc2));
    }

    Change to 

     

    /// Amount of currently online players, reply to /w /who (ZC_USER_COUNT).
    /// 00c2 <count>.L
    void clif_user_count(map_session_data* sd, int count)
    {
    /*
        int fd = sd->fd;

        WFIFOHEAD(fd,packet_len(0xc2));
        WFIFOW(fd,0) = 0xc2;
        WFIFOL(fd,2) = count;
        WFIFOSET(fd,packet_len(0xc2));
    */
    }

  7. On 8/21/2023 at 7:45 AM, luizinhomt said:

    Good night everyone, I have pk mode on my server. wanted when the player activates @modpk automatically a custom aura was displayed on him as a hateffect and when deactivated the aura disappears automatically. thank you all

    what you mean is when player activates his pk mode and aura will be attached on him/her?

  8. On 6/26/2023 at 9:07 AM, Louis T Steinhil said:

    Good day! Does this still work? I've encountered different structure on map.cpp. It was supposed to be like this but

     

    diff --git a/src/map/map.cpp b/src/map/map.cpp
    index 735bfc678..10537d75e 100644
    --- a/src/map/map.cpp
    +++ b/src/map/map.cpp
    @@ -2088,6 +2088,9 @@ int map_quit(struct map_session_data *sd) {
     		status_change_end(&sd->bl, SC_AUTOTRADE, INVALID_TIMER);
     		status_change_end(&sd->bl, SC_SPURT, INVALID_TIMER);
     		status_change_end(&sd->bl, SC_BERSERK, INVALID_TIMER);
    +#ifdef FORGOTTEN_SKILLS
    +		status_change_end(&sd->bl, SC_FURY2, INVALID_TIMER);
    +#endif
     		status_change_end(&sd->bl, SC__BLOODYLUST, INVALID_TIMER);
     		status_change_end(&sd->bl, SC_TRICKDEAD, INVALID_TIMER);
     		status_change_end(&sd->bl, SC_LEADERSHIP, INVALID_TIMER);

     

    it's different now.

     

    /*==========================================
     * Standard call when a player connection is closed.
     *------------------------------------------*/
    int map_quit(map_session_data *sd) {
    	int i;
    
    	if (sd->state.keepshop == false) { // Close vending/buyingstore
    		if (sd->state.vending)
    			vending_closevending(sd);
    		else if (sd->state.buyingstore)
    			buyingstore_close(sd);
    	}
    
    	if(!sd->state.active) { //Removing a player that is not active.
    		struct auth_node *node = chrif_search(sd->status.account_id);
    		if (node && node->char_id == sd->status.char_id &&
    			node->state != ST_LOGOUT)
    			//Except when logging out, clear the auth-connect data immediately.
    			chrif_auth_delete(node->account_id, node->char_id, node->state);
    		//Non-active players should not have loaded any data yet (or it was cleared already) so no additional cleanups are needed.
    		return 0;
    	}
    
    	if (sd->expiration_tid != INVALID_TIMER)
    		delete_timer(sd->expiration_tid, pc_expiration_timer);
    
    	if (sd->npc_timer_id != INVALID_TIMER) //Cancel the event timer.
    		npc_timerevent_quit(sd);
    
    	if (sd->autotrade_tid != INVALID_TIMER)
    		delete_timer(sd->autotrade_tid, pc_autotrade_timer);
    
    	if (sd->npc_id)
    		npc_event_dequeue(sd);
    
    	if (sd->bg_id)
    		bg_team_leave(sd, true, true);
    
    	if (sd->bg_queue_id > 0)
    		bg_queue_leave(sd, false);
    
    	if( sd->status.clan_id )
    		clan_member_left(sd);
    
    	pc_itemcd_do(sd,false);
    
    	npc_script_event(sd, NPCE_LOGOUT);
    
    	//Unit_free handles clearing the player related data,
    	//map_quit handles extra specific data which is related to quitting normally
    	//(changing map-servers invokes unit_free but bypasses map_quit)
    	if( sd->sc.count ) {
    		for (const auto &it : status_db) {
    			std::bitset<SCF_MAX> &flag = it.second->flag;
    
    			//No need to save infinite status
    			if (flag[SCF_NOSAVEINFINITE] && sd->sc.getSCE(it.first) && sd->sc.getSCE(it.first)->val4 > 0) {
    				status_change_end(&sd->bl, static_cast<sc_type>(it.first));
    				continue;
    			}
    
    			//Status that are not saved
    			if (flag[SCF_NOSAVE]) {
    				status_change_end(&sd->bl, static_cast<sc_type>(it.first));
    				continue;
    			}
    			//Removes status by config
    			if (battle_config.debuff_on_logout&1 && flag[SCF_DEBUFF] || //Removes debuffs
    				(battle_config.debuff_on_logout&2 && !(flag[SCF_DEBUFF]))) //Removes buffs
    			{
    				status_change_end(&sd->bl, static_cast<sc_type>(it.first));
    				continue;
    			}
    		}
    	}
    
    	for (i = 0; i < EQI_MAX; i++) {
    		if (sd->equip_index[i] >= 0)
    			if (pc_isequip(sd,sd->equip_index[i]))
    				pc_unequipitem(sd,sd->equip_index[i],2);
    	}
    
    	// Return loot to owner
    	if( sd->pd ) pet_lootitem_drop(sd->pd, sd);
    
    	if (sd->ed) // Remove effects here rather than unit_remove_map_pc so we don't clear on Teleport/map change.
    		elemental_clean_effect(sd->ed);
    
    	if (sd->state.permanent_speed == 1) sd->state.permanent_speed = 0; // Remove lock so speed is set back to normal at login.
    
    	struct map_data *mapdata = map_getmapdata(sd->bl.m);
    
    	if( mapdata->instance_id > 0 )
    		instance_delusers(mapdata->instance_id);
    
    	unit_remove_map_pc(sd,CLR_RESPAWN);
    
    	if (sd->state.vending)
    		idb_remove(vending_getdb(), sd->status.char_id);
    
    	if (sd->state.buyingstore)
    		idb_remove(buyingstore_getdb(), sd->status.char_id);
    
    	pc_damage_log_clear(sd,0);
    	party_booking_delete(sd); // Party Booking [Spiria]
    	pc_makesavestatus(sd);
    	pc_clean_skilltree(sd);
    	pc_crimson_marker_clear(sd);
    	pc_macro_detector_disconnect(*sd);
    	chrif_save(sd, CSAVE_QUIT|CSAVE_INVENTORY|CSAVE_CART);
    	unit_free_pc(sd);
    	return 0;
    }

     

    yes cause latest rev is now using status.yml

  9. On 8/24/2023 at 12:22 AM, Eichi said:

    Hello, guys i'm trying create an sc_custom for ignore attack cursor, i have tried to add:

     

    ((mapdata->flag[MF_NOLOCKON] || mapdata_flag_vs(mapdata) || (sd && sd->sc.data[SC_MYCUSTOM_BUFF]) || (sd && sd->duel_group > 0))

     

    In clif.cpp file, but have not worked, can anyone help me?

     

    Thanks in advance!

    which rA rev are you using?
     

  10. On 8/22/2023 at 4:33 PM, micosanityyy said:

    Anyone has a fix when cancelling vending while on the choosing currency option, the vend will still open using unknown item as currency? I'm using the latest version of this. The solution I found for previous versions are causing server crash. Thanks!

    can you please elaborate your problem?

  11. On 5/10/2023 at 7:29 AM, BabaVoss said:
    -	script	agibase	-1,{
    
    OnPCLoginEvent:
    	if (readparam(bAgi)>=150) 
    	bonus bDelayRate,-90;
    	end;
    }

    Good day, Can someone help me make this script work. I tried, OnPCLoginEvent and OnPCCalcStatEvent. it doesnt work, im not sure what is the problem.

    Basically what i want to do is, when a user has atleast 150 Agi, they will have a bonus effect.

    disclaimer, yes i know about agibase settings on config. But i wanted to use "kiel card" delay instead.  Thank you in advance!

     

    you can put your condition on Kiel Card instead.

×
×
  • Create New...