Jump to content

Recommended Posts

I'd like to make potion (like Red Potion) but not classic red potion increasing regeneration hp, but to increase max hp of player who drinks it.

I created MySQL Query to make such potion for an hour HP is increased by 10.000:

INSERT INTO `item_proto` VALUES ('80212', 'Health Book', 0x4B7369EA6761205A64726F776961, '3', '3', '0', '1', '237952', '20', '128', '', '1000000', '5', '0', '0', '0', '15', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '3600', '10000', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');

 

the think is... HP is not increasing, my question is, what went wrong? (Game 34k unstripped)

  • Metin2 Dev 1
Link to comment
Share on other sites

	        when 80212.use begin
	            if get_time() < pc.getqf("book_use") then
                syschat("Effect of this book is still active, please try again later")
              
            else
	            affect.add_collect(apply.MAX_HP, 10000, 3600)
            pc.setqf("book_use", get_time() + 3600)
            pc.remove_item(80212, 1)
	
        end
	end
	

Link to comment
Share on other sites

[File: char_item.cpp]

//Search:

							case UNIQUE_ITEM_WHITE_FLAG:
								ForgetMyAttacker();
								item->SetCount(item->GetCount()-1);
								break;

//Add after:

		case 80212:
			{
				/****************
				* POINT_MAX_HP - name bonus
				* 10000 - value bonus
				* 1 - 1 hours bonus is valid, and in an hour you can use the again this book
				*/	
				quest::PC* pPC = quest::CQuestManager::instance().GetPC(GetPlayerID());
              
				int pSetting[] = {POINT_MAX_HP, 10000, 1};
				int pLastTime = pPC->GetFlag("book_use.last_use_time");

				if (get_global_time() - pLastTime < pSetting[2] *60*60)
				{
					ChatPacket(CHAT_TYPE_INFO, "Effect of this book is still active, please try again later!");
					return false;
				}
									
				AddAffect(AFFECT_BOOK, pSetting[0], pSetting[1], 0, pSetting[2] *60*60, 0, true);
				item->SetCount(item->GetCount() -1);
				pPC->SetFlag("book_use.last_use_time", get_global_time());
			}
			break;		

[File: affect.h]

//Search:

	AFFECT_HOLLY_STONE_POWER = 303,

//Add bellow:

	AFFECT_BOOK,

 

 

// Sorry, now i see you are on 34k, try with this.

			local reward = {
				{MAX_HP, 10000, 1*60*60}
			}	
				affect.add_collect(reward[1], reward[2], reward[3])
  • Love 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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