[GUIDE] Simple cq_dynanpc Function

11/27/2012 16:12 TheFlames#1
Hello Elitepvpers!
Today, i want make a guide for cq_dynanpc function. This function is very simple for me. hehe :p What you can make with cq_dynanpc? You can make data for monter etc. I just show you how to make a simple and perfect quest.
For example you kill 10 or more monster and you will be send into another maps, spawn a bosses or spawn npc etc. But I only show you how to kill 10 monster and spawn a bosses. :)

1. Make 1 cq_dynanpc for monster data. Its mean, kill monster and will record data at cq_dynanpc. Make sure cq_dynanpc set at mapping 100. Because only use for record the data not use the npc.

cq_dynanpc :
Quote:
INSERT INTO `cq_dynanpc` VALUES
(19000, 0, 2, 'MonsterData', 02, 190006, 0000, 0000, -1, 100, 100, 110, 1900000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0, 0, 0, 0, '0', 0000, 0000, 0000, 0000, 00, 0000, 0000, 0000, 0000, 0000, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0);
2. Make a query for monster and monster action for adding data you kill. Make sure you make generator for this monster.

cq_monster :
Quote:
INSERT INTO `cq_monstertype` VALUES
('21000', 'SmallMonster', '0000', '0407', '0', '0', '50000', '00', '0600', '0500', '0000', '0000', '0083', '0000', '0000', '0000', '0000', '0001', '0015', '0000', '1000', '0000', '0000', '32771', '20525', '38125', '0003', '1900000', '0000', '099', '099', '099', '099', '099', '099', '099', '1500', '70000', '0000', '0000', '0000', '0043', '0000', '0200', '5000', '10000', '15000', '000', '000', '0000000000', '0000000000', '0000000000', '0000000000', '0', '500', '0', '0', '0', '0', '0', '1000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
cq_action :
Quote:
INSERT INTO `cq_action` VALUES
('1900000', '1900001', '0000', '0201', '0', 'data0 += 1 19000'),
('1900001', '1900002', '0000', '0201', '0', 'data0 == 10 19000'),
('1900002', '1900003', '0000', '2006', '0', '0 0 %user_map_id %user_map_x %user_map_y 2200000 22000 0 BigBosses'),
('1900003', '1900004', '0000', '0201', '0', 'data0 = 0 19000'),
('1900004', '0000', '0000', '0126', '0', 'BigBosses has appear. Kill him to complete The quest!');

data0 += 1 = Adding 1 Data you kill at cq_dynanpc
19000 = cq_dynanpc ID
data0 == 10 = Record amount you kill the monster. So after you kill 10 monster, you will send the next action.
2200000 = Bosses generator ID. Make sure this ID same with your generator. If not same, your monster only stay 1 place only and not attack.
22000 = Monster bosses ID
data0 = 0 = Reset all record data you kill at cq_dynanpc to 0.


3. Make query for your bosses monster and generator.

cq_monster :
Quote:
INSERT INTO `cq_monstertype` VALUES
('22000', 'BigBosses', '0011', '0587', '0', '0', '9000000', '00', '50000', '50000', '0500', '0000', '0130', '0000', '0000', '0000', '0000', '0003', '0025', '0000', '1000', '0000', '18000', '32771', '0000', '0000', '0003', '1106600', '0000', '000', '000', '000', '000', '000', '000', '000', '0000', '0000', '48003', '1000', '0500', '0100', '0000', '0500', '0000', '0000', '0000', '0000', '000', '0000000000', '0000000000', '0000000000', '0000000000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
cq_generator :
Quote:
INSERT INTO `cq_generator` VALUES
(2200000, 8700, 0878, 0446, 0009, 0009, 0025, 70000, 0000, 22000, 0000, 0000, 0000, 0000, 0000);

Sorry, If this guide very simple for you. I hope you can learn it. If you have any question about this function just post here. I try to help you ;)


Best Regards,
The Flames
11/27/2012 20:03 reloaded90#2
I TRY.
11/27/2012 23:05 magewarior2#3
Good job!
11/28/2012 20:46 nomercyskin1#4
Nice guide man.. really helpful.. XD
12/01/2012 19:18 haizamlee#5
this guide was not simple but awesome . i bet not all of pserver owners would discover this action including me . saiful , u r legend bro .
12/26/2012 03:05 reaper72004#6
Good Job. I didn't think anyone else was gonna find that lol, I figured that on my last quest I made.. awhile ago. Keep it up man. :)
09/17/2021 11:44 mrtiteo#7
can someone help me on this:

INSERT INTO `cq_action` VALUES ('49007590', '49007591', '0000', '0101', '0', 'Anti-Macro System!');
INSERT INTO `cq_action` VALUES ('49007591', '49007592', '0000', '0101', '0', 'This was created to fight MACRO use.');
INSERT INTO `cq_action` VALUES ('49007592', '49007593', '0000', '0101', '0', 'If you answer wrong 3 consecutive times YOU CANNOT GET EP for 60 minutes.');
INSERT INTO `cq_action` VALUES ('49007593', '49000000', '0000', '0105', '0', '2 49007595 Type~the~Digit:~88');
INSERT INTO `cq_action` VALUES ('49007594', '0000', '0000', '0000', '0', '');
INSERT INTO `cq_action` VALUES ('49007595', '49007526', '49007500', '2003', '0', '%accept0 == 88');
INSERT INTO `cq_action` VALUES ('49000000', '49000001', '0000', '104', '0', '0 0 0');
INSERT INTO `cq_action` VALUES ('49000001', '0000', '0000', '120', '0', '');


anyone know how to make this work ?

i try to make anti farm system , but after click on monster it popup 101 display , but when insert number , it not go to next 49007595 ( already have cq_task )
10/22/2024 04:59 Dilff#8
I know this is an old post, but i have a question.
How would we check data? so lets say i have it set to kill 40 madbulls,
I want to trigger a message that as your killing them youll recieve a notification at the top saying 1/40 madbulls killed, 2/40 madbulls killed etc.
10/22/2024 06:18 hknippon#9
I believe you're running classic right, you can always use var data, though it might be a bit lot of action need to be added.

for example:

('1900000', '1900001', '0000', '0201', '0', 'data0 += 1 19000'),
('1900001', '1900002', '0000', '0201', '0', 'data0 == 10 19000'),


at 1900001, instead of data0 == 10 19000, add before it:
data0 == 1 19000 (if true go 1900005) (if fail go next)
data0 == 2 19000 (if true go 1900006) (if fail go next)
data0 == 3 19000 (if true go 1900007) (if fail go next)
data0 == 4 19000 (if true go 1900008) (if fail go next)
data0 == 5 19000 (if true go 1900009) (if fail go next)
data0 == 6 19000 (if true go 19000010) (if fail go next)
data0 == 7 19000 (if true go 19000011) (if fail go next)
data0 == 8 19000 (if true go 19000012) (if fail go next)
data0 == 9 19000 (if true go 19000013) (if fail go next)
data0 == 10 19000 (if true go 19000002)

1900005 1900014 0 1521 0 var(1) set 1
1900006 1900014 0 1521 0 var(1) set 2
1900007 1900014 0 1521 0 var(1) set 3
1900008 1900014 0 1521 0 var(1) set 4
1900009 1900014 0 1521 0 var(1) set 5
19000010 1900014 0 1521 0 var(1) set 6
19000011 1900014 0 1521 0 var(1) set 7
19000012 1900014 0 1521 0 var(1) set 8
19000013 1900014 0 1521 0 var(1) set 9
1900014 0 0 1010 2016 %iter_var_data1/40 madbulls killed.


Note that TheFlames guide applies to every player that killed madbulls, data will be inserted into dynannpc 19000.

public madbull kill = can use this method
if individual kill = better use 1080 instead of 201

but you can also add 1080 for the quest, as in:


('1899999', '1900000', '0000', '1080', '19000', 'isexit'),
('1900000', '1900001', '0000', '0201', '0', 'data0 += 1 19000'),
('1900001', '1900002', '0000', '0201', '0', 'data0 == 10 19000'),
('1900002', '1900003', '0000', '2006', '0', '0 0 %user_map_id %user_map_x %user_map_y 2200000 22000 0 BigBosses'),
('1900003', '1900004', '0000', '0201', '0', 'data0 = 0 19000'),
('1900004', '0000', '0000', '0126', '0', 'BigBosses has appear. Kill him to complete The quest!');


so players that have task 19000 will trigger the action
10/22/2024 13:48 Dilff#10
ok i see , now once the task is finished using var data
Quote:
1900014 0 0 1010 2016 %iter_var_data1/40 madbulls killed.
would i have to set the data to 0 like this?
Quote:
var(1) set 0
10/23/2024 07:49 hknippon#11
yes, once finished or in the beginning after accepting the task. though you need to be careful of the var data, my suggestion is dont use var data 1 for other things. you can use var data 2, 3 etc

why?

lets say you make redstone quest by using var data 1, you limit the claim to once only per day, but somehow you are using the same var data with madbull count which is vardata1, then they might exploit it by killing the madbull to 39 and then claim 39 redstone. remember to always set to 0
10/25/2024 13:35 DuaSelipar#12
alwasy use var in custom map quest/mission,so you can always set it to 0 when you enter it, dont use on public map like cronus and so on.. so it not messed up your var value and ruin your quest
10/26/2024 04:53 hknippon#13
Quote:
Originally Posted by DuaSelipar View Post
alwasy use var in custom map quest/mission,so you can always set it to 0 when you enter it, dont use on public map like cronus and so on.. so it not messed up your var value and ruin your quest
and if you are using new engine, cq_map will have enter action and leave action tab. you can add action to these section, where whenever the character enter the map, enter action will run and when leaving the map, leave action will run.
10/26/2024 14:15 DuaSelipar#14
Quote:
Originally Posted by hknippon View Post
and if you are using new engine, cq_map will have enter action and leave action tab. you can add action to these section, where whenever the character enter the map, enter action will run and when leaving the map, leave action will run.
true2