Lazarus1988 8 Posted August 10, 2016 Share Posted August 10, 2016 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) 1 Link to comment Share on other sites More sharing options...
Denis 1477 Posted August 10, 2016 Share Posted August 10, 2016 You can either use source to do that either use quest with affect.add_collect(x,x,x) Link to comment Share on other sites More sharing options...
Lazarus1988 8 Posted August 10, 2016 Author Share Posted August 10, 2016 I tested it with quest, it works, but definetly I see bug with jumping HP... (Like this bonus after loading character or mounting on horse itself reloads) Link to comment Share on other sites More sharing options...
Denis 1477 Posted August 10, 2016 Share Posted August 10, 2016 How did you do the quest then? Link to comment Share on other sites More sharing options...
Lazarus1988 8 Posted August 10, 2016 Author Share Posted August 10, 2016 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 More sharing options...
VegaS 1101 Posted August 13, 2016 Share Posted August 13, 2016 #re Link to comment Share on other sites More sharing options...
VegaS 1101 Posted August 16, 2016 Share Posted August 16, 2016 [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]) 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now