Jump to content

Danilo89

Inactive Member
  • Posts

    11
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Danilo89

  1. 8 hours ago, Esculpe said:

    Hello there. Basically everything that you need to create something like this is pretty simple actually.

         - pc.get_race() -> will return the value: 1 for warrior, 2 for sura, 3 for ninja, 4 for shaman and 5 for lycan (I might be wrong, please test it and then correct me)

         - pc.give_item2(ITEM_VNUM, QUANTITY) -> gives the item to the current player

    Once you give a look at the already existing quests that you can find all over the internet, LUA is super easy to learn and execute... If you have any other questions, I think I can help you.

    Thanks for the reply, as soon as I try I'll tell you something

  2. 48 minutes ago, TMP4 said:

    He meant you should open existing quests and check their code, see how they work, and write your own quest by the information you gathered.
    The problem with your topic is that it's not a question & answer and while it's like a 3 minute job, if we do it for you, you'll never learn it.

    I suggest to check main & sub quests. Like subquest_01.quest ending you have to talk with an npc, and if you have an item, you'll get a reward. Basicly you need to extend it to check not 1 but 5 items (just add 'and' after pc.count_item(30130) >= 1) and you probably want to check the player's class for the armor, you'll find an example for that in give_basic_weapon.quest for example. Good luck 🙂

    Thanks for the reply, as soon as I try I'll tell you how it went.

     

  3.  

    5 hours ago, Sonitex said:

    questlua_global.cpp

    
    	int _spawn_mob_in_map(lua_State* L)
    	{
    		if (false == lua_isnumber(L, 1) || false == lua_isnumber(L, 2) || false == lua_isnumber(L, 3) 
    			|| false == lua_isnumber(L, 4) || false == lua_isnumber(L, 5) || false == lua_isboolean(L, 6))
    		{
    			lua_pushnumber(L, 0);
    			return 1;
    		}
    
    		const DWORD dwVnum = static_cast<DWORD>(lua_tonumber(L, 1));
    		const size_t count = MINMAX(1, static_cast<size_t>(lua_tonumber(L, 2)), 10);
    		const long lMapIndex = static_cast<long>(lua_tonumber(L, 3));
    		const long lX = static_cast<long>(lua_tonumber(L, 4));
    		const long lY = static_cast<long>(lua_tonumber(L, 5));
    		const bool isAggresive = static_cast<bool>(lua_toboolean(L, 6));
    
    		size_t SpawnCount = 0;
    
    		const CMob* pMonster = CMobManager::instance().Get(dwVnum);
    
    		if (NULL != pMonster)
    		{
    			const LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();
    
    			for (size_t i = 0; i < count; ++i)
    			{
    				const LPCHARACTER pSpawnMonster = CHARACTER_MANAGER::instance().SpawnMob(dwVnum,
    					lMapIndex,
    					lX,
    					lY,
    					0,
    					true,
    					-1,
    					pMonster->m_table.bType == CHAR_TYPE_STONE,
    					isAggresive);
    
    				if (NULL != pSpawnMonster)
    				{
    					++SpawnCount;
    				}
    			}
    
    			sys_log(0, "QUEST Spawn Monster: VNUM(%u) COUNT(%u) isAggresive(%b)", dwVnum, SpawnCount, isAggresive);
    		}
    
    		lua_pushnumber(L, SpawnCount);
    
    		return 1;
    	}
    
    	{	"spawn_mob_in_map",					_spawn_mob_in_map						},

     

    Quest part:

    
    local coordinates = 
    {
    	{8892, 14464}, 
    	{8835, 14276}, 
    	{8639, 14224}, 
    	{8570, 14292}, 
    	{8671, 14465}, 
    	{8825, 14688}, 
    	{8796, 14787}
    }
    
    local n = math.random(1, 7)	
    
    -- Vnum Count MapIndex X Y IsAggressive
    -- Also add did this function to quest_functions file
    spawn_mob_in_map(VNUM, COUNT, MAP_INDEX, coordinates[n][1], coordinates[n][2], false)

     

    Try this :) 

    nothing to do I can not do it are a real disaster!

  4. 2 hours ago, Sonitex said:

    questlua_global.cpp

    
    	int _spawn_mob_in_map(lua_State* L)
    	{
    		if (false == lua_isnumber(L, 1) || false == lua_isnumber(L, 2) || false == lua_isnumber(L, 3) 
    			|| false == lua_isnumber(L, 4) || false == lua_isnumber(L, 5) || false == lua_isboolean(L, 6))
    		{
    			lua_pushnumber(L, 0);
    			return 1;
    		}
    
    		const DWORD dwVnum = static_cast<DWORD>(lua_tonumber(L, 1));
    		const size_t count = MINMAX(1, static_cast<size_t>(lua_tonumber(L, 2)), 10);
    		const long lMapIndex = static_cast<long>(lua_tonumber(L, 3));
    		const long lX = static_cast<long>(lua_tonumber(L, 4));
    		const long lY = static_cast<long>(lua_tonumber(L, 5));
    		const bool isAggresive = static_cast<bool>(lua_toboolean(L, 6));
    
    		size_t SpawnCount = 0;
    
    		const CMob* pMonster = CMobManager::instance().Get(dwVnum);
    
    		if (NULL != pMonster)
    		{
    			const LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();
    
    			for (size_t i = 0; i < count; ++i)
    			{
    				const LPCHARACTER pSpawnMonster = CHARACTER_MANAGER::instance().SpawnMob(dwVnum,
    					lMapIndex,
    					lX,
    					lY,
    					0,
    					true,
    					-1,
    					pMonster->m_table.bType == CHAR_TYPE_STONE,
    					isAggresive);
    
    				if (NULL != pSpawnMonster)
    				{
    					++SpawnCount;
    				}
    			}
    
    			sys_log(0, "QUEST Spawn Monster: VNUM(%u) COUNT(%u) isAggresive(%b)", dwVnum, SpawnCount, isAggresive);
    		}
    
    		lua_pushnumber(L, SpawnCount);
    
    		return 1;
    	}
    
    	{	"spawn_mob_in_map",					_spawn_mob_in_map						},

     

    Quest part:

    
    local coordinates = 
    {
    	{8892, 14464}, 
    	{8835, 14276}, 
    	{8639, 14224}, 
    	{8570, 14292}, 
    	{8671, 14465}, 
    	{8825, 14688}, 
    	{8796, 14787}
    }
    
    local n = math.random(1, 7)	
    
    -- Vnum Count MapIndex X Y IsAggressive
    -- Also add did this function to quest_functions file
    spawn_mob_in_map(VNUM, COUNT, MAP_INDEX, coordinates[n][1], coordinates[n][2], false)

     

    Try this :) 

    ok thx for now i try

  5. it is the Temple of Ochao normal map, I would like that monster to change position once killed the coordinates are the ones I put in the first post.

    29 minutes ago, Sonitex said:

    Heya, is it a dungeon instance or just a normal map?

    it is the Temple of Ochao normal map, I would like that monster to change position once killed the coordinates are the ones I put in the first post.

  6. Hi everyone, I am fixing the ochao temple and I have problems with the (Guardian En-Tai vnum: 6405). I need help with a quest that makes me randomly spawn in various areas of the map the coordinates I have already taken here: 

    local coordinates = {{8892, 14464}, {8835, 14276}, {8639, 14224}, {8570, 14292}, {8671, 14465}, {8825, 14688}, {8796, 14787}} can you help me please?

  7. Hi everyone, I need a lot of help in this quest.
    I state that I'm not good.
    then I would like that at the first login he is given a chest in this case it is 56000 and that when I use it it gives me all those things is it possible?

     

            when 56000.use begin--Baule dei War
                    pc . give_item2 ( "14005" , 1 )     -- Bracciale
                    pc . give_item2 ( "15005" , 1 )     -- Scarpe
                    pc . give_item2 ( "16005" , 1 )        -- Collana
                    pc . give_item2 ( "17005" , 1 )     -- Orecchini
                    pc . give_item2 ( "27003" , 1 )        -- Pozione Rossa
                    pc . give_item2 ( "27006" , 1 )     -- Pozione Blu
                    pc . give_item2 ( "72702" , 1 )     -- Scarpe del vento+
                    pc . give_item2 ( "50052" , 1 )     -- chiama cavallo 
                    pc . give_item2 ( "52006" , 1 )        -- Sigillo Cinghiale Selvaggio 7g 3% FCM
                    pc . give_item2 ( "53025" , 1 )        -- Baby Leopardo 7g
                    pc . give_item2 ( "70057" , 1 )     -- Mantello del Coraggio 
                    pc . give_item2 ( "70058" , 1 )        -- Anello del Teletrasporto
                    pc . give_item2 ( "50187" , 1 )
                    if pc . job == 0 then                 ---**************************---X WAR
                    pc . give_item2 ( "15" , 1 )         -- Spada+5
                    pc . give_item2 ( "11205" , 1 )     -- Corazza del Monaco+5
                    pc . give_item2 ( "13005" , 1 )     -- Scudo da Battaglia+5
                    pc . give_item2 ( "12205" , 1 )     -- Elmo Tradizionale+5
                    elseif pc . job == 1 then             ---**************************---X NINJA
                    pc . give_item2 ( "1005" , 1 )         -- Pugnale+5
                    pc . give_item2 ( "11405" , 1 )     -- Abito Azzurro+5
                    pc . give_item2 ( "13005" , 1 )     -- Scudo da Battaglia+5
                    pc . give_item2 ( "12345" , 1 )     -- Cappuccio in Pelle+5
                    pc . give_item2 ( "15" , 1 )         -- Spada+5
                    elseif pc . job == 2 then             ---**************************---X SURA
                    pc . give_item2 ( "15" , 1 )         -- Spada+5
                    pc . give_item2 ( "11605" , 1 )     -- Corazza Requiem
                    pc . give_item2 ( "12485" , 1 )     -- Elmo Insanguinato+5
                    pc . give_item2 ( "13005" , 1 )     -- Scudo da Battaglia+5
                    elseif pc . job == 3 then             ---**************************---X SHAMY
                    pc . give_item2 ( "7005" , 1 )         -- Ventaglio+5
                    pc . give_item2 ( "5005" , 1 )         -- Campana di Rame+5
                    pc . give_item2 ( "13005" , 1 )     -- Scudo da Battaglia+5
                    pc . give_item2 ( "12625" , 1 )     -- Cappello del Monaco
                    pc . give_item2 ( "11805" , 1 )        -- Vestito Porpora+5
                    item.equip()
                    pc.set_skill_level(122, 2)  -- Combo a Livello 2
                    pc.set_skill_level(131, 10) -- Chiama Cavallo
                    horse.set_level(11)         -- Livello del Cavallo
                    pc.remove_item(56000, 1)
                end

     

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