Jump to content

jurelmetal

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by jurelmetal

  1. You can try using Haruka's suggestion:

    On 5/8/2020 at 3:48 PM, Haruka Mayumi said:

    you can use addrid(0); then cutin the image when the event starts. however. if someone used refresh or teleport. the cutin will just be removed anyway. not a good idea.. although you can use addtimer to prompt the cutin everysecond. but still. not recommended.

    Not sure how it behaves for players that are already attached to an NPC at the moment of trigger, though.

  2. If I understand your request correctly, and since the section you want to show the cutin in is being executed as part of a OnMinuteXX event label, the NPC is not attached to any players at that point, so it's not possible to show a cutin.

  3. On a quick glance, it seems your PVP Warper is causing the issue, as it subscribes to the OnPCDieEvent label without checking the map first.

    The label will trigger your NPC every time a player dies (any player, anywhere) and warp them to their save point every two deaths.

    To solve it, simply check if the map where they died is a PVP map first, the same way the PVP ladder script is doing it.

    Fixed PVP Warper:

    prontera,163,186,5	script	PVP Warper	860,{
    	if (getmercinfo(0)) {
    			mes "Mercenary aren't allowed in pvp.";
    			close;
    		}
    	for (.@i = 0; .@i < .map_size; .@i++)
    		.@menu$ = .@menu$ + .map_name$[.@i] + "("+getmapusers(.map$[.@i])+" user(s))" + ":";
    	.@i = select(.@menu$) - 1;
    	mapannounce .map$[.@i], strcharinfo(0)+ " has entered this PVP room.", bc_map;
    	warp .map$[.@i], 0, 0;
    	end;
    	
    OnPCDieEvent:
      // Check if user died on PvP map:
      .@pvpmap = 0;
      for (.@i = 0; .@i < .map_size; .@i++) {
        if (.map$[.@i] == strcharinfo(3)) { 
          .@pvpmap = 1; // If current map is in the pvp maps array, it is a PvP map
        }
      }
      if (.@pvpmap) {
      	set @Die,@Die + 1;
      	if( @Die % 2 == 0 ) warp "SavePoint",0,0;
      }
      end;
    
    OnPCKillEvent:
    	if( strcharinfo(3) == "guild_vs3" )
    		announce strcharinfo(0)+" has killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".",0;
    	end;
    	
    	OnInit:
    		setarray .map_name$,
    			"PVPROOM";
    		setarray .map$, 
    			"guild_vs3";
    		.map_size = getarraysize(.map_name$);
    		waitingroom "PvP Warper",0;
    		end;
    }

     

     

  4. Fixed script:

    -	script	Monster_Drop	-1,{
    OnNPCKillEvent:
    //if(getgmlevel()>50) end;
    
    // MVP DROP
    if ( getmonsterinfo( killedrid, 22 ) ) {
    set #daily_mvp,#daily_mvp + 1;
    	for ( .@i = 0; .@i < getarraysize( .items ); .@i += 4 ) {
    		if ( rand( 100 ) < .items[ .@i +  3 ] ) {
    			.@quantity = rand(.items[.@i + 1], .items[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)
    			getitem .items[.@i], .@quantity;
    			//announce strcharinfo(0)+" got "+getitemname( .items[ .@i ] )+" x"+.@quantity+" from "+getmonsterinfo(killedrid, 0)+"!!",bc_all,0xFFFFFF;
            }
        }
    }
    // NORMAL MOB DROPS
    else {
    	for ( .@i = 0; .@i < getarraysize( .mobitem ); .@i += 4 ) {
    		if ( rand( 100 ) < .mobitem[ .@i +  3 ] ) {
    			.@quantity = rand(.mobitem[.@i + 1], .mobitem[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)
    			getitem .mobitem[.@i], .@quantity; 
            }
        }
    }
    end;
    
    OnInit:
    // Random amount 6240,rand(1,3),1,
    // MVP ITEMS	<item id>,<min_amount>,<max_amount>,<chance>
    //setarray .items[0],673,5,10,675,1,1,7859,20,5;
    setarray .items[0],
      673,5,5,10,
      675,1,1,1,
      7859,10,20,10;
    
    // MOB ITEMS	<item id>,<min_amount>,<max_amount>,<chance>
    //setarray .mobitem[0],7859,rand(1,10),5;
    setarray .mobitem[0],
      7859,1,5,5;
    end;
    
    } // END OF SCRIPT

    This way you should be able to add items to the arrays at the end without trouble. I don't have a setup to test right away but will post update if I find any issue.

  5. You are executing the rand() at OnInit, so it only runs when the server starts.

    You should store both min and max amounts in the array, and run the rand() inside the OnNPCKillEvent label with those stored values to get the effect you want:

    At OnInit:

    setarray .mobitem[0],7859,1,10,5; // sets 1 as the minimum amount and 10 as the max

    At OnNPCKillEvent:

    // ... your code ...
    getitem .items[.@i], rand(.items[.@i + 1], .items[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)

    Also remember to modify your loop so that it adds 4 instead of 3 to .@i on each iteration.

×
×
  • Create New...