Jump to content

ATAG

Active Member
  • Posts

    236
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by ATAG

  1.  

    if (bMonsterChatType != MONSTER_CHAT_WAIT)

       return;

      if (IsGuardNPC())

      {

       if (number(0, 6))

        return;

      }

      else

      {

       if (number(0, 30))

        return;

      }

      snprintf(sbuf, sizeof(sbuf), "(locale.monster_chat[%i] and locale.monster_chat[%i][number(1, table.getn(locale.monster_chat[%i]))] or '')", GetRaceNum(), GetRaceNum(), GetRaceNum());

     

    it's called in every 5 seconds as i see.

  2. SVN_VERSION = somestring

    ...

    $(OBJDIR)/version.o: version.cpp
        @$(CC) $(CFLAGS) -D__SVN_VERSION__="$(SVN_VERSION)" -c $< -o $@
        @echo compile $<

     

    And version.cpp:

    #include <stdio.h>
    
    void WriteVersion()
    {
    #ifndef __WIN32__
    	FILE* fp = fopen("VERSION.txt", "w");
    
    	if (fp)
    	{
    		fprintf(fp, "game revision: %sn", __SVN_VERSION__);
    		fclose(fp);
    	}
    #endif
    }
    • Love 1
  3. Much easier to do it with quest (taken from event_easter.quest)

    when login or enter begin
    	local mapIndex = pc.get_map_index()
    	if mapIndex == 1 or mapIndex == 21 or mapIndex == 41 then
    		local mobid = 30129
    		if (game.get_event_flag("rabbit_helper") > 0) then
    		-- spawn rabbit if he is not there
    			if find_npc_by_vnum(mobid) == 0 then
    				if mapIndex == 1 then
    					mymob_vids[1] = mob.spawn(mobid, 591, 472, 1, 1, 1))
    				elseif mapIndex == 21 then
    					mymob_vids[21] = mob.spawn(mobid, 517, 742, 1, 1, 1))
    				elseif mapIndex == 41 then
    					mymob_vids[41] mob.spawn(mobid, 306, 828, 1, 1, 1))
    				end
    			end
    		else
    		--purge rabbit if he is there
    			if find_npc_by_vnum(mobid) == 1 then
    				if mapIndex == 1 then
    					local npc = npc.select(mymob_vids[1])
    					npc.purge()
    				elseif mapIndex == 21 then
    					local npc = npc.select(mymob_vids[21])
    					npc.purge()
    				elseif mapIndex == 41 then
    					local npc = npc.select(mymob_vids[41])
    					npc.purge()
    				end
    			end
    		end
    	end
    end

    Add this to questlib.lua:

    mymob_vids = {}

    You HAVE to implement the npc.select function: http://metin2dev.org/board/topic/921-some-function-from-imerlib-game/

    • Love 2
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.