Jump to content

Shisui

Former Staff
  • Posts

    977
  • Joined

  • Last visited

  • Days Won

    15
  • Feedback

    0%

Posts posted by Shisui

  1. That npc usually spawns by doing /xmas_boom.

    Use /eclipse for night mode.

    			if (name == "xmas_boom")
    			{
    				if (value && !prev_value)
    				{
    					SpawnEventHelper(true);
    				}
    				else if (!value && prev_value)
    				{
    					SpawnEventHelper(false);
    				}
    			}
    Spoiler
    
    	void SpawnEventHelper(bool spawn)
    	{
    		if ( spawn == true )
    		{
    			// ¾øÀ¸¸é ¸¸µé¾îÁØ´Ù
    			struct SNPCSellFireworkPosition
    			{
    				long lMapIndex;
    				int x;
    				int y;
    			} positions[] = {
    				{  1,	615,	618 },
    				{  3,	500,	625 },
    				{ 21,	598,	665 },
    				{ 23,	476,	360 },
    				{ 41,	318,	629 },
    				{ 43,	478,	375 },
    				{ 0,	0,	0   },
    			};
    
    			SNPCSellFireworkPosition* p = positions;
    			while (p->lMapIndex)
    			{
    				if (map_allow_find(p->lMapIndex))
    				{
    					PIXEL_POSITION posBase;
    					if (!SECTREE_MANAGER::instance().GetMapBasePositionByMapIndex(p->lMapIndex, posBase))
    					{
    						sys_err("cannot get map base position %d", p->lMapIndex);
    						p++;
    						continue;
    					}
    
    					CHARACTER_MANAGER::instance().SpawnMob(
    							MOB_XMAS_FIRWORK_SELLER_VNUM, p->lMapIndex, posBase.x + p->x * 100, posBase.y + p->y * 100, 0, false, -1);
    				}
    				p++;
    			}
    		}
    		else
    		{
    			CharacterVectorInteractor i;
    
    			// ÀÖÀ¸¸é Áö¿öÁØ´Ù
    			if (CHARACTER_MANAGER::instance().GetCharactersByRaceNum(MOB_XMAS_FIRWORK_SELLER_VNUM, i))
    			{
    				CharacterVectorInteractor::iterator it = i.begin();
    
    				while (it != i.end())
    					M2_DESTROY_CHARACTER(*it++);
    			}
    		}
    	}

     

    
     
     
    • Love 1
×
×
  • 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.