-
Posts
52 -
Joined
-
Last visited
-
Days Won
2 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by newja
-
-
He said that {item_id, count} doesn't work in his table.
Solution is easy.
local index = { [1] = {1111, 5}, [2] = {2222, 4}, [3] = {3333, 3}, } local idx = index[1] syschat("Item ID: ".. idx[1]) syschat("Count: "..idx[2])
-
Looks more like spawn effect
Good job though.
-
Don't know how to help you, for me everything works.
Have you tried restarting machine?
-
replace
wait("")
with
wait()
in your quest and recompile it again.
-
will i dont know c++ anyway
https://metin2.download/picture/Dej0vMg7QsKZFUpRKn69U8226ms6OgPT/.png
+ i think for the exp :
int npc_get_exp(lua_State* L) { CQuestManager& q = CQuestManager::instance(); LPCHARACTER npc = q.GetCurrentNPCCharacterPtr(); lua_pushnumber(L, npc->GetExp()); return 1; }
i dont think it's will work anyway !becous npc dont have exp !
yep u have right but the mobs yes, how can get the exp of one mob when i kill him?
Well, you can't.
It's calculated by the GiveExp function.
Where is defined GetHP()char.h
- 1
-
say("test ã")
Won't work.
say("test ã ")
Will work.
Do you understand now?
-
When you use "say" function or so, remember that you can't place special chars (e.g. ) at the end of line.
It doesn't print the error but instead you get no object files.
-
not work @@
Works.
-
quest warp begin state start begin when login with pc.getqf("warp") != 1 begin pc.setqf("warp", 1) pc.warp(34744600, 50289600) end end end
- 1
-
pc.warp(index[1] is index for already map1?
[1] = {33493, 4994}, -- chunjo[2] = {xxxxx, xxxx}, -- shinsoo[3] = {xxxxx, xxxx}, -- jinnoindex[1] is red (coord X)index[2] is green (coord Z)- 1
-
quest firstport begin state start begin when login with pc.getqf("first") == 0 begin table = { [1] = {33493, 4994}, [2] = {xxxxx, xxxx}, [3] = {xxxxx, xxxx}, } index = table[pc.get_empire()] pc.warp(index[1], index[2]) pc.setqf("first", 1) end end end
- 1
-
apear Killed after compile!
lol wut.
You need to end your if/else condition.
Besides replace 2 last ifs with else if.
And if you get compile error, delete last else line.
- 1
-
How you fix it?
Don't know what you're talking about guys because I don't have this problem.
Post your syserr or tell me exactly in what conditions this happens.
-
You mean commands, right?
Cmd.cpp- 1
-
This heappens when I upgrade for the very first time.
Then, If I use again the same item.
After upgrade or /reload q? Happened to me after reload.
If you want to get data from actual item such as vnum, bonuses, sockets or slot number (e.g. Upgraded sword from +0 to +1, now you get ID 10 instead of new ID 11, continue reading to change that) you have to change all this:quest::CQuestManager::instance().upgrade(GetPlayerID(), item);
with thisquest::CQuestManager::instance().upgrade(GetPlayerID(), pkNewItem);
This fixed the problem.
- 1
-
This only works with blacksmith?
Check post above yours.
-
If you want to trigger this event while upgrading with scroll you need to do following:Open char_item.cpp and search for this. Now add:
quest::CQuestManager::instance().upgrade(GetPlayerID(), item);
########################################################If you want to get data from actual item such as vnum, bonuses, sockets or slot number (e.g. Upgraded sword from +0 to +1, now you get ID 10 instead of new ID 11, continue reading to change that) you have to change all this:quest::CQuestManager::instance().upgrade(GetPlayerID(), item);
with thisquest::CQuestManager::instance().upgrade(GetPlayerID(), pkNewItem);
Forgot to mention but this event is called only when upgrade is succesfull.Regards,newja- 1
-
You need to add sockets to the item, it is your ItemShop script part not item_proto, lol.
-
Nice , But Can u make it like that?
when xx.upgrade begin
No need for that, you can use item.vnum in quest to see what was upgraded.
Example
when upgrade begin if item.vnum =< 19 and item.vnum >= 10 then syschat("Only 10-19 ID is checked") end end
Also it's easier to use it with tables than copying 1000 times same phrase (xx.upgrade) with different item id, lol.
- 1
-
Since everyone instantly know how to do it and 0 help was given, there you go my friend:
http://metin2dev.org/board/index.php?/topic/5830-c-quest-event-when-upgrade/
- 1
-
Spoiler
Open char_item.cpp and find:
sys_log(0, "PayPee End %d", cost);
after this add:
quest::CQuestManager::instance().upgrade(GetPlayerID(), pkNewItem);
Open quest.h and find:
QUEST_ITEM_INFORMER_EVENT,
after this add:
QUEST_UPGRADE_EVENT,
Open questnpc.cpp and find:
bool NPC::OnItemInformer(PC& pc, unsigned int vnum)
after this add:
bool NPC::OnUpgrade(PC& pc, LPITEM item) { return HandleEvent(pc, QUEST_UPGRADE_EVENT); }
Open questnpc.h and find:
bool OnItemInformer(PC& pc,unsigned int vnum);
after this add:
bool OnUpgrade(PC& pc,LPITEM item);
Open questmanager.cpp and find:
m_mapEventName.insert(TEventNameMap::value_type("item_informer", QUEST_ITEM_INFORMER_EVENT));
after this add:
m_mapEventName.insert(TEventNameMap::value_type("upgrade", QUEST_UPGRADE_EVENT));
now find:
void CQuestManager::ItemInformer(unsigned int pc,unsigned int vnum)
after this add:
void CQuestManager::upgrade(unsigned int pc, LPITEM item) { PC * pPC; if ((pPC = GetPC(pc))) { if (!CheckQuestLoaded(pPC)) return; SetCurrentItem(item); m_mapNPC[QUEST_NO_NPC].OnUpgrade(*pPC,item); } else sys_err("QUEST no such pc id : %d", pc); }
Open questmanager.h and find:
void ItemInformer(unsigned int pc, unsigned int vnum);
after this add:
void upgrade(unsigned int pc, LPITEM item);
Example Quest:
when upgrade begin vnum = item.vnum - 10 syschat("Sword+"..vnum.." >> Sword+"..vnum+1) end
Regards,
newja
- 1
- 1
- 1
- 11
-
it's possible and can be done by quest
No !
mr lybya please show us that quest
MrLibya , + I Tell U It Can't Be Made By Quest Only By C++
If you write quest function in C++ then yes, it can be made by quest lol.
-
Someone know how to display the pet level in a "say" for example ?
I tried to put : "say("Your pet is level" ..pet_level)" but it doesn't work.
Have you defined pet_level?
say("Your pet level: "..pc.getqf("pet_"..pc.getqf("pet_item").."_level"))
If not, then try it.
- 1
-
Are you sure this work 100%?
Because we already tried this and sometimes it works and sometimes not.
There's such a mess in the code, I can't really tell if it's everything now but..
go to char_battle.cpp and find:
item->SetOwnership(ch);
replace with this
if (CBattleArena::instance().IsBattleArenaMap(ch->GetMapIndex()) == false) if (ch->IsPC()) { item->SetOwnership(ch); } else if (ch->IsPet()) { for (CPetSystem::TPetActorMap::iterator go = ch->GetPetSystem()->m_petActorMap.begin();go != ch->GetPetSystem()->m_petActorMap.end(); ++go) { CPetActor* petActor = go->second; if (NULL != petActor) { LPCHARACTER own = petActor->GetOwner(); if (own) { item->SetOwnership(own); } } } }
or do as @Deucalion says, however its problem lies deeper than that.
Regards,
newja
- 1
Quest Function - pc.get_exp_data()
in Quest Functions & Features
Posted
M2 Download Center
Introduction & Small explaination
https://www.youtube.com/watch?v=RbhBA1Ko4x8
As you can see in the video, this function stores XP amount of the last killed mob.
Variable is reseted every time you login into the game (including warps).
##### HowTo #####
######## Open char.cpp and find ########
######## Open char_battle.cpp and find ########
######## Open questlua_pc.cpp and add this function ########
######## Test Quest ########
(notice that this version isn't the same as showed in the video)