Jump to content
×
×
  • Create New...
  • 0

party_kill and some trigger issue


Galet

Question

  • Premium

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

  • Answers 11
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

kodepiko

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

kodepiko

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

kodepiko

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("ques

11 answers to this question

Recommended Posts

  • 0

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 by kodepiko
  • Love 1
Link to comment
Share on other sites

  • 0
  • Premium

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

  • 0

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 by kodepiko
  • Love 1
Link to comment
Share on other sites

  • 0

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 by kodepiko
  • Love 1
Link to comment
Share on other sites

  • 0
  • Premium

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 by galet
Link to comment
Share on other sites

  • 0

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 :)

  • Love 1
Link to comment
Share on other sites

  • 0
  • Premium

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

  • 0

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.

  • Love 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.