From 90f97ad76c533dd68da02aa1738eef47c4e01203 Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Tue, 23 Apr 2019 13:49:17 +0800 Subject: [PATCH] 1 --- webapp/classes/Quest.php | 4 ++++ webapp/controller/EquipController.class.php | 7 +++++++ webapp/controller/SignController.class.php | 8 ++++++++ webapp/controller/SupplyBoxController.class.php | 5 +++++ 4 files changed, 24 insertions(+) diff --git a/webapp/classes/Quest.php b/webapp/classes/Quest.php index 4313921..c1b55ad 100644 --- a/webapp/classes/Quest.php +++ b/webapp/classes/Quest.php @@ -56,12 +56,14 @@ class Quest{ if ($q['condition'] == 7 && $quest_type == 1) { if($quest_num <= $q['value']) { $quest_state = 1; + $this->triggerQuest(71013, 1, 1, $account_id); } } else { if ($row['quest_num'] + $quest_num >= $q['value']) { $quest_num = $q['value']; $quest_state = 1; + $this->triggerQuest(71013, 1, 1, $account_id); } else { $quest_num = $row['quest_num'] + $quest_num; $quest_state = 0; @@ -86,11 +88,13 @@ class Quest{ if ($q['condition'] == 7 && $quest_type == 1) { if($quest_num <= $q['value']) { $quest_state = 1; + $this->triggerQuest(71013, 1, 1, $account_id); } } else { if ($quest_num >= $q['value']) { $quest_num = $q['value']; $quest_state = 1; + $this->triggerQuest(71013, 1, 1, $account_id); } } $ret = $conn->execScript('INSERT INTO quest(accountid, quest_id, quest_num, quest_type, quest_state) ' . diff --git a/webapp/controller/EquipController.class.php b/webapp/controller/EquipController.class.php index d886d8e..02d7e07 100644 --- a/webapp/controller/EquipController.class.php +++ b/webapp/controller/EquipController.class.php @@ -114,6 +114,10 @@ class EquipController{ phpcommon\sendError(ERR_USER_BASE + 3, '金币不足'); return; } + if ($e['equip_level'] >= 10) { + phpcommon\sendError(ERR_USER_BASE + 4, '装备已到满级'); + return; + } $row = $conn->execQueryOne('SELECT * FROM equip WHERE accountid=:account_id AND equip_id=:equip_id;', array( ':account_id' => $account_id, @@ -148,6 +152,9 @@ class EquipController{ } $quest = new classes\Quest(); $quest->triggerQuest(71005, 1, 1, $account_id); + if ($e['equip_nextlevel'] == 10) { + $quest->triggerQuest(72005, 2, 1, $account_id); + } echo json_encode(array( 'errcode' => 0, 'errmsg' => '', diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index d02a60e..c8c00ee 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -1,5 +1,7 @@ getSign($sign_days + 90000); $item_id = $s['item_id']; $num = $s['num']; + $quest = new classes\Quest(); + $quest->triggerQuest(71001, 1, 1, $account_id); + $quest->triggerQuest(72001, 2, 1, $account_id); } else { if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($row['sign_time']) > 0) { $sign_days = $row['sign_days'] + 1; @@ -81,6 +86,9 @@ class SignController{ $s = $this->getSign($sign_days % 7 + 90000); $item_id = $s['item_id']; $num = $s['num']; + $quest = new classes\Quest(); + $quest->triggerQuest(71001, 1, 1, $account_id); + $quest->triggerQuest(72001, 2, 1, $account_id); } else { $sign_days = $row['sign_days']; $signable = 1; diff --git a/webapp/controller/SupplyBoxController.class.php b/webapp/controller/SupplyBoxController.class.php index ddef76c..4367174 100644 --- a/webapp/controller/SupplyBoxController.class.php +++ b/webapp/controller/SupplyBoxController.class.php @@ -1,5 +1,7 @@ $item_id, 'item_num' => $item_num, )); + $quest = new classes\Quest(); + $quest->triggerQuest(71004, 1, 1, $account_id); + $quest->triggerQuest(72004, 2, 1, $account_id); echo json_encode(array( 'errcode' => 0, 'errmsg' => '',