Jump to content

caanmasu

Banned
  • Posts

    90
  • Joined

  • Last visited

  • Feedback

    0%

2 Followers

About caanmasu

Core X

  • BAN_NOTICE
    Yes

Informations

  • Gender
    Male

Recent Profile Visitors

969 profile views

caanmasu's Achievements

Community Regular

Community Regular (8/16)

  • Very Popular Rare
  • Conversation Starter
  • Collaborator
  • First Post
  • Dedicated

Recent Badges

411

Reputation

  1. I did this quest a while ago item_proto.txt vnum 70038 item_type ITEM_QUEST or 18 auto_cape.quest define VNUM_CAPE 70038 quest auto_cape begin state start begin function capeAction() pc.aggregate_monster() pc.changegold(-1000) end when VNUM_CAPE.use begin if pc.getqf("wait_time") < get_time() then if item.get_socket(0) == 0 then item.set_socket(0, 1) pc.setqf("wait_time", get_time()+3) pc.setqf("cell_item", item.get_cell()) auto_cape.capeAction() loop_timer("lt_autocape", 3) else item.set_socket(0, 0) cleartimer("lt_autocape") end else syschat("Espera un momento") end end when lt_autocape.timer begin auto_cape.capeAction() end when login begin if item.select_cell(pc.getqf("cell_item")) then if item.vnum == VNUM_CAPE and item.get_socket(0) == 1 then auto_cape.capeAction() loop_timer("lt_autocape", 3) end end end when die begin if item.select_cell(pc.getqf("cell_item")) then if item.vnum == VNUM_CAPE and item.get_socket(0) == 1 then item.set_socket(0, 0) cleartimer("lt_autocape") end end end end end Activate/Deactivate slot: root/constInfo.py def IS_AUTO_POTION_HP(itemVnum): if 72723 <= itemVnum and 72726 >= itemVnum: return 1 elif itemVnum >= 76021 and itemVnum <= 76022: return 1 elif itemVnum == 79012: return 1 #ADD THIS elif itemVnum == 70038: return 1 # return 0
  2. Solution: Find: state information begin Add below: when login or levelup with not (pc.level >=30 and pc.level <=40) begin clear_letter() restart_quest() end
  3. @ Rakancito Hey, calm down. Take things easy. Look, I did the Tower of Sung Ma dungeon with Lua. Specifically, I did it on April 4 and 5 of last year. If you want to continue with that project we could do something together. Write me. My language is Spanish but I can translate in English.
  4. Check match between locale/xx and db Navicat Database common, table locale, mKey LOCALE In my case: mValue is "germany", then my path is locale/germany Ok?
  5. @Denizeri24 o.O share it please
  6. Hi You must keep in mind that the fast loading is one thing and the backgroundless image is another, even if they come from the same system. This time I will tell you how to make the backgroundless image at login. I can't share you the playersettingmodule by binary because all the "systems" are premium. 1. Remove the stuff related to the loading image and loading bar: 2. Change the script path Let's begin. root/introloading.py 1. class LoadingWindow(ui.ScriptWindow): def __init__(self, stream): print "NEW LOADING WINDOW -------------------------------------------------------------------------------" ui.Window.__init__(self) net.SetPhaseWindow(net.PHASE_WINDOW_LOAD, self) self.stream=stream #self.loadingImage=0 #comment this line #self.loadingGage=0 #comment this line self.errMsg=0 self.update=0 self.playerX=0 self.playerY=0 self.loadStepList=[] 2. def Open(self): print "OPEN LOADING WINDOW -------------------------------------------------------------------------------" #app.HideCursor() try: pyScrLoader = ui.PythonScriptLoader() if localeInfo.IsYMIR() or localeInfo.IsWE_KOREA() or localeInfo.IsCANADA() or localeInfo.IsBRAZIL() or localeInfo.IsEUROPE() or localeInfo.IsJAPAN(): #pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "LoadingWindow.py") #comment this line. This path is locale/common/ui pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "NewLoadingWindow.py") #add this line else: pyScrLoader.LoadScriptFile(self, "UIScript/LoadingWindow.py") except: import exception exception.Abort("LodingWindow.Open - LoadScriptFile Error") try: #self.loadingImage=self.GetChild("BackGround") #comment this line self.errMsg=self.GetChild("ErrorMessage") #self.loadingGage=self.GetChild("FullGage") #comment this line except: import exception exception.Abort("LodingWindow.Open - LoadScriptFile Error") 3. def Close(self): print "---------------------------------------------------------------------------- CLOSE LOADING WINDOW" app.SetFrameSkip(1) self.loadStepList=[] #self.loadingImage=0 #comment this line #self.loadingGage=0 #comment this line self.errMsg=0 self.ClearDictionary() self.Hide() 4. #comment this method #def __SetProgress(self, p): # if self.loadingGage: # self.loadingGage.SetPercentage(2+98*p/100, 100) 5. (98, ui.__mem_func__(self.__LoadGuildBuilding)), # END_OF_GUILD_BUILDING (100, ui.__mem_func__(self.__StartGame)), ] if app.ENABLE_WOLFMAN_CHARACTER: self.loadStepList+=[(100, ui.__mem_func__(self.__LoadWolfman)),] #self.__SetProgress(0) #comment this line #self.__SetNext(self.__LoadMap) def OnUpdate(self): 5. self.loadStepList.pop(0) #self.__SetProgress(progress) #comment this line def __InitData(self): playerSettingModule.LoadGameData("INIT") Finally, we are going to remove the transparency of the loading window. Every time the client changes phase, for example, from the character change phase to the login phase, the window will be completely black because the alpha value (transparency) is equal to 1. We must change the value to 0. root/uiphasecurtain.py def OnUpdate(self): if 0 != self.event: self.curAlpha += self.speed if self.curAlpha >= 1.0: #change value to 0.0 self.curAlpha = 1.0 #change value to 0.0 event=self.event self.event = 0 if -1 != self.args: event(self.args) else: event() Put newloadingwindow.py in locale/common/ui, then put images in d:/ymir work/ui/game/new_loading/ Files: [Hidden Content]
  7. Range min: att_speed Range max: mov_speed att_speed < mov_speed If you put range [110-109] get error Solution: set range 109-110 Remember: if you put 109 - 120, for example, it'll respawn groups random from 109 to 120 idx
  8. Hi Bug fix by me Before fix: [Hidden Content] After fix: [Hidden Content] Fix: char_state.cpp Comment this line: f.m_pkChrFind->AddAffect(AFFECT_WAR_FLAG, POINT_MOV_SPEED, 50 - f.m_pkChrFind->GetPoint(POINT_MOV_SPEED), 0, INFINITE_AFFECT_DURATION, 0, false); Add below: f.m_pkChrFind->UpdatePacket(); Like this: if (!pMap->GetTeamIndex(GetPoint(POINT_STAT), idx)) return; f.m_pkChrFind->AddAffect(AFFECT_WAR_FLAG, POINT_NONE, GetPoint(POINT_STAT), idx == 0 ? AFF_WAR_FLAG1 : AFF_WAR_FLAG2, INFINITE_AFFECT_DURATION, 0, false); //f.m_pkChrFind->AddAffect(AFFECT_WAR_FLAG, POINT_MOV_SPEED, 50 - f.m_pkChrFind->GetPoint(POINT_MOV_SPEED), 0, INFINITE_AFFECT_DURATION, 0, false); //fix f.m_pkChrFind->UpdatePacket(); //fix pMap->RemoveFlag(idx); char.cpp Find: case POINT_MOV_SPEED: min_limit = 0; if (IsPC()) limit = 200; else limit = 250; Add below: if (FindAffect(AFFECT_WAR_FLAG)) limit = 50; Like this: case POINT_MOV_SPEED: min_limit = 0; if (IsPC()) limit = 200; else limit = 250; if (FindAffect(AFFECT_WAR_FLAG)) limit = 50; break;
  9. Write to my Discord: caanmasu If something is wrong, I will fix it
  10. I make this code (NO TESTED) as guide. This may be the beginning of what you want to do. Does not include the observer mode part. cmd_gm.cpp ACMD(do_start_arena) { char arg1[256], arg2[256]; two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)); if (!*arg1 && !*arg2) { ch->ChatPacket(CHAT_TYPE_INFO, "Usage: start_arena <name1> <name2>"); return; } LPCHARACTER ch1 = CHARACTER_MANAGER::instance().FindPC(arg1); LPCHARACTER ch2 = CHARACTER_MANAGER::instance().FindPC(arg2); if (!ch1 || !ch2) { ch->ChatPacket(CHAT_TYPE_INFO, "At least one player is offline."); return; } if ( CArenaManager::instance().IsMember(ch1->GetMapIndex(), ch1->GetPlayerID()) != MEMBER_NO || CArenaManager::instance().IsMember(ch2->GetMapIndex(), ch2->GetPlayerID()) != MEMBER_NO ) { ch->ChatPacket(CHAT_TYPE_INFO, "At least one player is on arena."); return; } if (!(ch1->GetArena()) || ch1->GetArenaObserverMode()) { if (CArenaManager::instance().IsMember(ch1->GetMapIndex(), ch1->GetPlayerID()) == MEMBER_DUELIST) { ch->ChatPacket(CHAT_TYPE_INFO, "At least one player is on arena."); return; } } if (!(ch2->GetArena()) || ch2->GetArenaObserverMode()) { if (CArenaManager::instance().IsMember(ch2->GetMapIndex(), ch2->GetPlayerID()) == MEMBER_DUELIST) { ch->ChatPacket(CHAT_TYPE_INFO, "At least one player is on arena."); return; } } if (ch1->IsHorseRiding()) { ch1->StopRiding(); ch1->HorseSummon(false); } if (ch2->IsHorseRiding()) { ch2->StopRiding(); ch2->HorseSummon(false); } if (!(CArenaManager::instance().StartDuel(ch1, ch2, 3))) { ch->ChatPacket(CHAT_TYPE_INFO, "An error has occurred"); return; } }
  11. Hi Demostration: [Hidden Content] Important: Do these tests without people in the game. Inputs: You must enter the average and the desired skill. The cycle ends when a greater or equal average or skill has been found. If you just want to find average, enter the value of your average, and an unlikely skill value. If you just want to find skill, enter the value of your skill, and an average improbable value. Example: I just want to find 60 on average: Average input: 60 Skill input: 100 I just want to find 28 skill: Average input: 100 Skill input: 28 I want to find 60 average or 28 skill: Average input: 60 Skill input: 28 Implementation: questlua_global.cpp 1. Add anywhere: ALUA(_skill_mean) //return success, skill, mean, switches { if( !lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)) //skill, mean, switches return 0; int skill_need = lua_tonumber(L, 1); int mean_need = lua_tonumber(L, 2); int count = lua_tonumber(L, 3); int switches = 0; int new_skill = 0; int new_mean = 0; for (int i = 0; i < count; i++) { int iSkillBonus = MINMAX(-30, (int) (gauss_random(0, 5) + 0.5f), 30); int iNormalHitBonus = 0; if (abs(iSkillBonus) <= 20) iNormalHitBonus = -2 * iSkillBonus + abs(number(-8, 8) + number(-8, 8)) + number(1, 4); else iNormalHitBonus = -2 * iSkillBonus + number(1, 5); switches = i+1; new_skill = iSkillBonus; new_mean = iNormalHitBonus; if (iSkillBonus >= skill_need || iNormalHitBonus >= mean_need) { lua_pushboolean(L, true); lua_pushnumber(L, new_skill); lua_pushnumber(L, new_mean); lua_pushnumber(L, switches); return 4; } } lua_pushboolean(L, false); lua_pushnumber(L, new_skill); lua_pushnumber(L, new_mean); lua_pushnumber(L, switches); return 4; } 2. Above of: { NULL, NULL } Add: { "get_skill_mean", _skill_mean }, meanskill_simulator.quest quest meanskill_simulator begin state start begin when letter with pc.is_gm() begin send_letter("Mean Skill simulator") end when button or info begin meanskill_simulator.dialog() while true do if select("Again", "Close") == 2 then return end meanskill_simulator.dialog() end end function dialog() local max_switches = 1000000 say("Mean:") local mean = tonumber(input()) say("Skill:") local skill = tonumber(input()) local success, new_skill, new_mean, switches = get_skill_mean(skill, mean, max_switches) if success then say(" Success: ") else say("Fail: ") end say("Mean: "..new_mean) say("Skill: "..new_skill) say("Switches: "..numtomoney(switches)) end end end
  12. Hi This feature allows you to make an arena with a player from the target, not just from the NPC. The position of where they start the battle is also saved so that they return to the same place and not always next to Yu-Hwan. The code communicates quest/lua with client (python), and server (C++) with quest. GIF: [Hidden Content] Feature created by Camilo (caanmasu) [Hidden Content] This feature allows you to make an arena with a player from the target, not just from the NPC. The position of where they start the battle is also saved so that they return to the same place and not always next to Yu-Hwan. The code communicates quest/lua with Python, and server (C++) with quest. Clientside root: constinfo.py ENABLE_ARENA_MANAGER_TARGET = True if ENABLE_ARENA_MANAGER_TARGET: QUEST_arena_manager_INDEX = 0 QUEST_arena_manager_TARGET = 0 game.py 1: Above: self.serverCommander=stringCommander.Analyzer() Add: if constInfo.ENABLE_ARENA_MANAGER_TARGET: serverCommandList.update({"StartArenaManager" : self.QUEST_arena_manager}) serverCommandList.update({"GetTargetArenaManager" : self.QUEST_get_target_arena_manager}) 2: Add this functions: if constInfo.ENABLE_ARENA_MANAGER_TARGET: def QUEST_arena_manager(self, quest_index): constInfo.QUEST_arena_manager_INDEX = quest_index def QUEST_get_target_arena_manager(self): net.SendQuestInputStringPacket(str(constInfo.QUEST_arena_manager_TARGET)) uitarget.py 1: import event 2: Above: GRADE_NAME = { Add: if constInfo.ENABLE_ARENA_MANAGER_TARGET: BUTTON_NAME_LIST.append(localeInfo.TARGET_BUTTON_ARENA_MANAGER) 3: Above: self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat)) Add: if constInfo.ENABLE_ARENA_MANAGER_TARGET: self.buttonDict[localeInfo.TARGET_BUTTON_ARENA_MANAGER].SAFE_SetEvent(self.__OnArena) 4: Above: if player.IsPartyMember(self.vid): Add: if constInfo.ENABLE_ARENA_MANAGER_TARGET: if player.GetStatus(player.LEVEL) >= constInfo.PVPMODE_PROTECTED_LEVEL: self.__ShowButton(localeInfo.TARGET_BUTTON_ARENA_MANAGER) 5: Add this function: if constInfo.ENABLE_ARENA_MANAGER_TARGET: def __OnArena(self): constInfo.QUEST_arena_manager_TARGET = chr.GetNameByVID(self.vid) event.QuestButtonClick(int(constInfo.QUEST_arena_manager_INDEX)) locale_game.txt TARGET_BUTTON_ARENA_MANAGER Arena If you do not have input ignore, then do it: constinfo.py Add anywhere: INPUT_IGNORE = 0 game.py 1: Find this function: def OpenQuestWindow(self, skin, idx): self.interface.OpenQuestWindow(skin, idx) Replace for: def OpenQuestWindow(self, skin, idx): if constInfo.INPUT_IGNORE == 1: return else: self.interface.OpenQuestWindow(skin, idx) 2: Below of: # PRIVATE_SHOP_PRICE_LIST "MyShopPriceList" : self.__PrivateShop_PriceList, # END_OF_PRIVATE_SHOP_PRICE_LIST Add: "quest_input_ignore" : self.questInputIgnore, Add this function: def questInputIgnore(self, var): constInfo.INPUT_IGNORE = int(var) interfacemondule.py Find: def OpenQuestWindow(self, skin, idx): wnds = () Replace for: def OpenQuestWindow(self, skin, idx): if constInfo.INPUT_IGNORE == 1: return else: wnds = () Quest: arena_manager.cpp 1: Add those when: when login begin cmdchat(string.format("StartArenaManager %s", q.currentquestindex())) end when logout begin -- if pc.get_map_index() == 112 then pc.delqf("saved_x") pc.delqf("saved_y") end end when button begin --clientside related cmdchat("quest_input_ignore 1") --Note: If you set my input_ignore then this is correct. If you already had your own input_ignore, put the correct command. local victim_name = input(cmdchat("GetTargetArenaManager")) cmdchat("quest_input_ignore 0") -- if game.get_event_flag("arena_close") > 0 then say(gameforge.arena_manager._30_say) --token 42 return end local useMinLevel = game.get_event_flag("arena_use_min_level") if useMinLevel == 0 then useMinLevel = 25 ; end if pc.get_level() < useMinLevel then say(string.format(gameforge.arena_manager._50_say, useMinLevel)) --token 44 return else local sname = victim_name local opp_vid = find_pc_by_name(sname) local old = pc.select(opp_vid , opp_vid) local opp_level = pc.level -- Save the position (opponent) from where the arena was started pc.setf("arena_manager", "saved_x", pc.x) --BUG FIXED: si no se especifica el nombre de la quest, se tomará la quest del id anterior (la quest que se compiló antes de ésta en el quest_list) pc.setf("arena_manager", "saved_y", pc.y) -- pc.select(old, old) if opp_level < useMinLevel then say(string.format(gameforge.arena_manager._110_say, useMinLevel)) --token 28 return end local a = arena.is_in_arena(opp_vid) if a == 0 then say_reward(string.format(gameforge.arena_manager._130_say, sname)) --token 30 return end chat(string.format(gameforge.arena_manager._85_say, pc.name, sname)) --token 48 local agree = confirm(opp_vid, string.format(gameforge.arena_manager._87_say, sname, pc.name), 30) --token 49 (text very long) if agree!= CONFIRM_OK then say(string.format(gameforge.arena_manager._150_say, sname)) --token 32 return end -- Save the position (current player) from where the arena was started pc.setqf("saved_x", pc.x) -- pc.setqf("saved_y", pc.y) -- local s = arena.start_duel(sname, 3) if s == 0 then say(gameforge.arena_manager._160_say) --token 33 elseif s == 2 then say(gameforge.arena_manager._170_say) --token 34 elseif s == 3 then say(gameforge.arena_manager._180_say) --token 35 end end end 2: Find: if table.getn(arena_observer) >= s then Add: -- Save the position (observer player) from where the arena was started pc.setqf("saved_x", pc.x) -- pc.setqf("saved_y", pc.y) -- Serverside arena.cpp 1. Find: LPCHARACTER playerB = GetPlayerB(); Add: quest::PC* pPC_A = quest::CQuestManager::instance().GetPC(playerA->GetPlayerID()); quest::PC* pPC_B = quest::CQuestManager::instance().GetPC(playerB->GetPlayerID()); int saved_A_x = pPC_A->GetFlag("arena_manager.saved_x"); int saved_A_y = pPC_A->GetFlag("arena_manager.saved_y"); int saved_B_x = pPC_B->GetFlag("arena_manager.saved_x"); int saved_B_y = pPC_B->GetFlag("arena_manager.saved_y"); 2: Find: playerA->WarpSet(ARENA_RETURN_POINT_X(playerA->GetEmpire()), ARENA_RETURN_POINT_Y(playerA->GetEmpire())); Replace for: if (saved_A_x != 0 && saved_A_y != 0) playerA->WarpSet(saved_A_x*100, saved_A_y*100); else playerA->WarpSet(ARENA_RETURN_POINT_X(playerA->GetEmpire()), ARENA_RETURN_POINT_Y(playerA->GetEmpire())); 3: Find: playerB->WarpSet(ARENA_RETURN_POINT_X(playerB->GetEmpire()), ARENA_RETURN_POINT_Y(playerB->GetEmpire())); Replace for: if (saved_B_x != 0 && saved_B_y != 0) playerB->WarpSet(saved_B_x*100, saved_B_y*100); else playerB->WarpSet(ARENA_RETURN_POINT_X(playerB->GetEmpire()), ARENA_RETURN_POINT_Y(playerB->GetEmpire())); 4: Find: LPCHARACTER pChar = CHARACTER_MANAGER::instance().FindByPID(iter->first); if (pChar != NULL) { pChar->WarpSet(ARENA_RETURN_POINT_X(pChar->GetEmpire()), ARENA_RETURN_POINT_Y(pChar->GetEmpire())); } Replace for: LPCHARACTER pChar = CHARACTER_MANAGER::instance().FindByPID(iter->first); if (pChar != NULL) { quest::PC* pPC = quest::CQuestManager::instance().GetPC(pChar->GetPlayerID()); int saved_x = pPC->GetFlag("arena_manager.saved_x"); int saved_y = pPC->GetFlag("arena_manager.saved_y"); if (saved_x != 0 && saved_y != 0) pChar->WarpSet(saved_x*100, saved_y*100); else pChar->WarpSet(ARENA_RETURN_POINT_X(pChar->GetEmpire()), ARENA_RETURN_POINT_Y(pChar->GetEmpire())); } Regards.
  13. 1. In db/conf.txt, which value has PROTO_FROM_DB? (WinSCP) 2. Send db/ClientManagerBoot.cpp from server 3. Send mob_proto dumped from db
×
×
  • 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.