Premium Galet 514 Posted September 26, 2015 Premium Share Posted September 26, 2015 Hello ! I want to create a quest ike a hunting quest but only for groups, for example I want to kill 15 wild dogs but only if I am in a group. So I made something like that : when 101.party_kill begin So, If the player kill the pooch, the counter starts to decrease, but only if he his in a group. But, even if the player is alone, the counter starts to decrease... So, what could I do for having a kill trigger that count the kill only if the player is not alone ? Create a new trigger in C++ ? By the way, is it possible to trigger a quest for all the members of a group if a any member of this group kills a mob ? E.G : I just killed a boss and as a result, everybody in my group receive a special quest, message , item or anything ? Thanks ! Have a nice day ! Link to comment Share on other sites More sharing options...
metin2team 766 Posted September 26, 2015 Share Posted September 26, 2015 (edited) #misunderstood Edited September 26, 2015 by metin2team #misunderstood Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 26, 2015 Share Posted September 26, 2015 (edited) Hello ! I want to create a quest ike a hunting quest but only for groups, for example I want to kill 15 wild dogs but only if I am in a group. So I made something like that : when 101.party_kill begin So, If the player kill the pooch, the counter starts to decrease, but only if he his in a group. But, even if the player is alone, the counter starts to decrease... So, what could I do for having a kill trigger that count the kill only if the player is not alone ? Create a new trigger in C++ ? By the way, is it possible to trigger a quest for all the members of a group if a any member of this group kills a mob ? E.G : I just killed a boss and as a result, everybody in my group receive a special quest, message , item or anything ? Thanks ! Have a nice day ! if you want to deal with quests for party you should check party.setf / party.getf quest functions, when someone in party kill a specific mob there you can say notice in party and set party flag value to 1 party.setf("q_name", "flag", 1), for ex.: (party.syschat("hello, party leader killed legendary boss go to npc teacher to take special mission!") or party.chat("") ) and when npc_vnum.chat."Mission" with party.getf("quest_name", "flag") == 1 begin -- your quest happen party_kill should works fine but if they count also kills being alone just use this way: when 101.party_kill with party.is_party() begin if you need quest only for party leader you can use - party.is_leader() funcion easilly But remember, if your party disband - you lost party flags (party.getf) so when player talk with npc you should set pc.setf for him if you want to still give him mission for longer time than party is living Edited September 26, 2015 by kodepiko 1 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted September 26, 2015 Author Premium Share Posted September 26, 2015 Thanks ! That's a nice guide ! However, with : there's something strange : when 101.party_kill with party.is_party() begin If I am the party leader, the counter decrease if I'm killing the mobs by myself or if my mate kills them But if I'm not, the counter does not decrease at all, only the group leader is affected Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 26, 2015 Share Posted September 26, 2015 (edited) Thanks ! That's a nice guide ! However, with : there's something strange : when 101.party_kill with party.is_party() begin If I am the party leader, the counter decrease if I'm killing the mobs by myself or if my mate kills them But if I'm not, the counter does not decrease at all, only the group leader is affected Every player has this mission? if yes I suggest to take this mission when players are at group and then just count it as party.setqf("mob_kills", party.getqf("mob_kills")+1) if the party.getqf("mob_kills") counter turns for ex. 30 it finish "group" mission - and everyone can talk to npc to pass it or only the leader and then you should do something like this: when kill with party.is_party() begin party.setqf("mob_kills", party.getqf("mob_kills")+1) local mob_kills = party.getqf("mob_kills") if mob_kills >= 30 then -- you pass quest (here you can do quest_complete and give items or smth end end Edited September 26, 2015 by kodepiko 1 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted September 26, 2015 Author Premium Share Posted September 26, 2015 Thanks but party.setqf exist but party.getqf don't (in sources too) :/ Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 26, 2015 Share Posted September 26, 2015 (edited) To be honest just use party.setf("quest_name", "flag_name", party.getf("quest_name", "flag_name")+1) party.getf("quest_name", "flag_name") quest_name is name of the quest you declare at first line for ex.- quest quest_name begin flag_name can be anything, for ex. mob_kills how can I explain you setqf or setf? - the difference between pc.setqf and pc.setf is number of arguments function takes, pc.getqf("flag_name") works only in one quest where you use that function, if you use pc.getf("quest_name", "flag_name") you can get FLAG from another quest! but you still can use party.getf / party.setf in that way only at one quest Edited September 26, 2015 by kodepiko 1 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted September 27, 2015 Author Premium Share Posted September 27, 2015 (edited) Unfortunately, with that : when 101.party_kill with party.is_party() begin local count = party.getf("quest", "state") + 1 if count <= 15 then party.setf("quest", "state", count) q.set_counter("Rest-amount", 15 - count) if count == 15 then say_title("lorem ipsum dolor") say("") end end end The counter does not decrease, should I have to create two new characters and retry ? Edited September 27, 2015 by galet Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 27, 2015 Share Posted September 27, 2015 Unfortunately, with that : when 101.party_kill with party.is_party() begin local count = party.getf("quest", "state") + 1 if count <= 15 then party.setf("quest", "state", count) q.set_counter("Rest-amount", 15 - count) if count == 15 then say_title("lorem ipsum dolor") say("") end end end The counter does not decrease, should I have to create two new characters and retry ? Do it this way: when kill with npc.get_race() == 101 with party.is_party() begin local count = party.getf("quest", "state") + 1 if count <= 15 then party.setf("quest", "state", count) q.set_counter("Rest-amount", 15 - count) if count == 15 then say_title("lorem ipsum dolor") say("") end end end and change "quest" to your quest_name for ex. "party_mission" quest party_mission begin and save quest as party_mission.quest (or change this name to another one but it's nice to use this same quest_name at quest also 1 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted September 27, 2015 Author Premium Share Posted September 27, 2015 I only put quest for example, it is the name of my quest, so I'll try with this one because two "with" don't work and I'll tell you when kill with npc.get_race() == 101 and party.is_party() begin Exactly the same as before :/ Link to comment Share on other sites More sharing options...
Think 117 Posted September 29, 2015 Share Posted September 29, 2015 By the way, is it possible to trigger a quest for all the members of a group if a any member of this group kills a mob ? E.G : I just killed a boss and as a result, everybody in my group receive a special quest, message , item or anything ? Trigger on kill, and then loop through quest members with something like... local pids = {party.get_member_pids()} for i, pid in next, pids, nil do q.begin_other_pc_block(pid) --stuff with the other player... pc.functions() will act as if it's another char q.end_other_pc_block() end As for the problem with killing in party, party_kill is only triggered for the leader when either the leader or someone on the group kills anything. Some kill trigger with party conditions (but without party flags, is it really intended that progress is shared?) seems about right though. 1 Link to comment Share on other sites More sharing options...
Active Member Exygo 1096 Posted September 29, 2015 Active Member Share Posted September 29, 2015 Think is alive https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos 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