Jump to content

Hyroshima

Members
  • Posts

    189
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by Hyroshima

  1. I haven't tested it, but I hope it's the way you asked.


    you define the cooldown in:

    set .@cooldown,60; //time in minute

     

    the changes I made for you to understand
     

    ~1 before
    
    if ( strcharinfo(3) == strnpcinfo(4))
      .@online++;
    
    ~ afeter
      
    if ( strcharinfo(3) == strnpcinfo(4) && RoomCD < gettimetick(2)) .@online++; else set .@CDnicks$,.@CDnicks$+strcharinfo(0)+", ";
    
    
    ~2 before
    
    else if ( .party_id ) {
     mes "[MvP Ladder Warper]";
     mes "I'm sorry, but a party is currently playing the game. Please standby until the party is finished.";
     mes "Thank you.";
     close;
    }
    
    ~ afeter
    
    else if ( .@CDnicks$ != "" ) {
     mes "[MvP Ladder Warper]";
     mes "There are players in your group with active cooldown!";
     mes "^FF0000"+.@CDnicks$+"^000000";
     close;
    }
    
    ~3 before
      
     Zeny -= .register_cost;
     announce "The party ["+ strcharinfo(1) +"] has started the MvP ladder game.", bc_all;
     set .party_id, getcharid(1);
     set .@time_enter, gettimetick(2);
    
    ~ afeter
    
     Zeny -= .register_cost;
     announce "The party ["+ strcharinfo(1) +"] has started the MvP ladder game.", bc_all;
     set .party_id, getcharid(1);
     set .@time_enter, gettimetick(2);
     set .@cooldown,60; //time in minute
    
    ~4 before
    
     announce "You have "+ .timeout +" minutes to complete "+ .totalround +" rounds.", bc_self;
     .@name$[.@c] = strcharinfo(0);
     .@c++;
    
    ~ afeter
    
     announce "You have "+ .timeout +" minutes to complete "+ .totalround +" rounds.", bc_self;
     .@name$[.@c] = strcharinfo(0);
     RoomCD = gettimetick(2)+(60*.@cooldown);
     .@c++;

    mvp_ladder.txt

  2. I was using this mod from the normal goddameit on windows (vs), but when I tried to compile in linux he accused the lack of a windows library: WINSOCK2.H

    would it be possible to convert the ping.c code for linux centos and maintain the same functionality?

    ping.c

    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif
    
    #include <WINSOCK2.H>
    #define DEF_BUF_SIZE 1024  
    #define IP_HEADER_SIZE 20  
    #define ICMP_HEADER_SIZE 12    
    typedef struct _ICMP_HEADER  
    {  	
    	BYTE bType;
    	BYTE bCode;
    	USHORT nCheckSum;
    	USHORT nId;
    	USHORT nSequence;
    	UINT nTimeStamp;
    }ICMP_HEADER, *PICMP_HEADER;    
    USHORT GetCheckSum(LPBYTE lpBuff, DWORD dwSize)
    {
    	DWORD dwCheckSum = 0;
    	USHORT* lpWord = (USHORT*)lpBuff;  
    	while(dwSize > 1)  	
    	{  		
    		dwCheckSum += *lpWord++;
    		dwSize -= 2;
    	}  	
    	if(dwSize ==1)  	
    		dwCheckSum += *((LPBYTE)lpBuff);
    	dwCheckSum = (dwCheckSum >> 16) + (dwCheckSum & 0XFFFF);
    	return (USHORT)(~dwCheckSum);  
    }    
    BOOL Ping(char* lpDestIP, int *nRet_, int *nTime_)
    {
    	int nTime = 0;
    	int ret = 0;
    	char ICMPPack[ICMP_HEADER_SIZE] = {0};
    	char szRcvBuff[DEF_BUF_SIZE] = {0};
    	int i = 0;
    	int nRet = 0;
    	int nLen = 0;
    	int nError = 0;
    	SOCKET s;
    	PICMP_HEADER pRcvHeader;
    	SOCKADDR_IN SourceSockAddr;
    	SOCKADDR_IN DestSockAddr;
    	PICMP_HEADER pICMPHeader;
    	DestSockAddr.sin_family = AF_INET;
    	DestSockAddr.sin_addr.S_un.S_addr = inet_addr(lpDestIP);
    	DestSockAddr.sin_port = htons(0);
    	pICMPHeader = (PICMP_HEADER)ICMPPack;  
    	pICMPHeader->bType = 8;
    	pICMPHeader->bCode = 0;
    	pICMPHeader->nId = (USHORT)GetCurrentProcessId();
    	pICMPHeader->nCheckSum = 0;
    	pICMPHeader->nTimeStamp = 0;
    	s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
    	nTime = 1000;
    	ret = setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*)&nTime, sizeof(nTime));
    	for(i=0; i <1; i++)  	
    	{  		
    	pICMPHeader->nCheckSum = 0;
    		pICMPHeader->nSequence = i;
    		pICMPHeader->nTimeStamp = GetTickCount();
    		pICMPHeader->nCheckSum = GetCheckSum((LPBYTE)(ICMPPack), ICMP_HEADER_SIZE);
    		nRet = sendto(s, ICMPPack, ICMP_HEADER_SIZE, 0, (SOCKADDR*)&DestSockAddr, sizeof(DestSockAddr)); 
    		if(nRet == SOCKET_ERROR)
    		{ 
    			return FALSE;
    		}  		
    		nLen = sizeof(SOCKADDR_IN);
    		if(nRet == SOCKET_ERROR)
    		{
    			return FALSE;
    		}
    		nRet = recvfrom(s, szRcvBuff,DEF_BUF_SIZE,0,(SOCKADDR*)&SourceSockAddr,&nLen);
    		if(nRet == SOCKET_ERROR)
    		{
    			return FALSE;
    		}
    		pRcvHeader = (PICMP_HEADER)(szRcvBuff + IP_HEADER_SIZE);
    		nTime = GetTickCount() - pRcvHeader->nTimeStamp;
    		//printf("Return Message: %s bytes=%d time=%dms\n", inet_ntoa(SourceSockAddr.sin_addr), nRet, nTime);
    		*nRet_ = nRet;
    		*nTime_ = nTime;
    	}
    	return TRUE;
    }

     

  3. 20 minutes ago, Surefirer said:

    Hello, I have a custom instance, when the player disconnect or logout the game, when they log in again, I want the character back to the instance map, so they can continue enjoy the game, however it only allow re-enter the instance map once. hope you understand, if not I will try explain more detail.

    in this case warp will not work since it is an instance, it would have to be instance_enter, or am i mistaken?
    I will make a model and send it here...

  4. Hello again ?,  would it be possible to determine an item of ammunition type not to be consumed?

    the idea would be similar to consumable items but without removing the item from the inventory (item type 11).
    I know can disable consumption in arrow_decrement, but the idea would be not to affect this system, but by creating an item that is not consumed of the type etc/arrow.

     

    since already thank you very much, by Hyro~

  5. 7 hours ago, Ichigo said:

    Hi.
    Is there any way that a monster can only be seen and attacked by a single user?
    Basically it is exclusive for him.
    I want to make a quest that you have to kill a mob, but that no other player can kill it without needing to restrict entry to the map.
    Thank you.

    ever thought of doing using instance? it can be a solution if I'm not mistaken.

  6. I don't remember it working like that, see the examples I made below.

    1º exp:

    -	script	duplbl	-1,{
    
    OnPCLoginEvent:
      
    	announce "Test dupe run msg",bc_all;
    	end;
    }

    screenrAthena030.jpg.8408390aac326504753645dc91d85597.jpg

     

    2º exp:

    -	script	duplbl::dupelbl	-1,{
    
    OnPCLoginEvent:
    
    	announce "Test dupe run msg",bc_all;
    	end;
    }
    prontera,155,155,1	duplicate(dupelbl)	duplbl#1	-1

    screenrAthena029.jpg.ab34ec02488a0ff8b3d86b1e66421473.jpg

     

    Shouldn't duplicate load the label or should it? 

    OnPCLogoutEvent:
    OnPCLoadMapEvent:

    same result

×
×
  • Create New...