"; print ""; print ""; print ""; if ($task["maxlevel"] <= $server_max_level && $task["maxlevel"] != 0) { print ""; } $ZoneID = $task["startzone"]; $ZoneLongName = get_field_result("long_name", "SELECT long_name FROM zone WHERE zoneidnumber = $ZoneID"); $ZoneShortName = get_field_result("short_name", "SELECT short_name FROM zone WHERE zoneidnumber = $ZoneID"); print ""; $Reward = $task["reward"]; if ($task["rewardmethod"] == 0) { if ($task["rewardid"] > 0) { $ItemID = $task["rewardid"]; $ItemName = get_field_result("Name", "SELECT Name FROM items WHERE id = $ItemID"); $Reward = "" . $ItemName . ""; } } if ($Reward) { print ""; } print "\n"; print ""; $TaskDesc = $task["description"]; $MultiStepDesc = ""; $MultiStep = substr_count($TaskDesc, "["); if ($MultiStep) { $MultiStepDesc .= ""; print $MultiStepDesc; } else { print ""; } if ($display_task_activities == TRUE) { print "\n"; print ""; $Query = "SELECT * FROM $activities_table WHERE taskid='" . $id . "' ORDER BY activityid"; $QueryResult = db_mysql_query($Query) or message_die('task.php', 'MYSQL_QUERY', $Query, mysqli_error()); if (mysqli_num_rows($QueryResult) > 0) { print ""; while ($row = mysqli_fetch_array($QueryResult)) { $Text1 = $row["text1"]; $Text2 = $row["text2"]; $GoalID = $row["goalid"]; $GoalMethod = $row["goalmethod"]; $GoalCount = $row["goalcount"]; $DeliverToNPC = $row["delivertonpc"]; $Optional = $row["optional"]; $ActivityType = $row["activitytype"]; $ItemID = 0; $NPCID = 0; $StepDescription = $row["text3"]; $SingleGoal = 0; $ItemName = ""; $NPCName = ""; $GoalType = ""; if ($GoalMethod == 0) { // Single Goal == 0 // Goal List == 1 // Perl Controlled Goals == 2 $SingleGoal = $row["goalid"]; } if (!$StepDescription) { switch ($ActivityType) { case 1: // Deliver $StepDescription = "Deliver " . $GoalCount . " " . $Text2 . " to " . $Text1; $ItemID = $SingleGoal; $ItemName = $Text2; $NPCID = $DeliverToNPC; $NPCName = $Text1; $GoalType = "ItemID"; break; case 2: // Kill $StepDescription = "Kill " . $GoalCount . " " . $Text1; $NPCID = $SingleGoal; $NPCName = $Text1; $GoalType = "NPCID"; break; case 3: // Loot $StepDescription = "Loot " . $GoalCount . " " . $Text2 . " from " . $Text1; $ItemID = $SingleGoal; $ItemName = $Text2; $GoalType = "ItemID"; break; case 4: // SpeakWith $StepDescription = "Speak with " . $Text1; $NPCID = $SingleGoal; $NPCName = $Text1; $GoalType = "NPCID"; break; case 5: // Explore $StepDescription = "Explore " . $Text1; break; case 6: // TradeSkill $StepDescription = "Create " . $GoalCount . " " . $Text1; $ItemID = $SingleGoal; $ItemName = $Text1; $GoalType = "ItemID"; break; case 7: // Fish $StepDescription = "Fish " . $GoalCount . " " . $Text1; $ItemID = $SingleGoal; $ItemName = $Text1; $GoalType = "ItemID"; break; case 8: // Forage $StepDescription = "Forage " . $GoalCount . " " . $Text1; $ItemID = $SingleGoal; $ItemName = $Text1; $GoalType = "ItemID"; break; case 9: // ActivityUse1 $StepDescription = "Use " . $GoalCount . " " . $Text1; break; case 10: // ActivityUse2 $StepDescription = "Use " . $GoalCount . " " . $Text1; break; case 11: // ActivityTouch $StepDescription = "Touch " . $Text1; break; case 100: // ActivityGiveCash $StepDescription = "Give " . $GoalCount . " " . $Text1 . " to " . $Text2; $NPCID = $DeliverToNPC; $NPCName = $Text2; $GoalType = "NPCID"; break; case 255: // Custom Task Activity Type $StepDescription = $Text3; break; default: // Custom Task Activity Type $StepDescription = $Text3; break; } } if ($Optional) { $StepDescription .= " (Optional)"; } $ZoneID = $row["zoneid"]; if ($ZoneID == 0) { $ZoneName = "Any Zone"; } else { $ZoneLongName = get_field_result("long_name", "SELECT long_name FROM zone WHERE zoneidnumber = $ZoneID"); $ZoneShortName = get_field_result("short_name", "SELECT short_name FROM zone WHERE zoneidnumber = $ZoneID"); $ZoneName = "" . $ZoneLongName . ""; } print ""; } } else { print ""; } } print "
Task Title : " . $task["title"] . "
Task ID : " . $task["id"] . "
Min Level : " . $task["minlevel"] . "
Max Level : " . $task["maxlevel"] . "
Starts In : " . $ZoneLongName . "
Reward : " . $Reward . "
Task Description : "; $StepDescArray = split("]", $TaskDesc); foreach ($StepDescArray as $value) { if ($value) { $MultiStepDesc .= ""; } } $MultiStepDesc .= "
"; $MultiStepDesc .= str_replace("[", "Step(s): ", $value); $MultiStepDesc = str_replace("]", "", $MultiStepDesc); $MultiStepDesc .= "
Task Description :

" . $TaskDesc . "

Task Activities
  • Step " . ($row["activityid"] + 1) . ": $StepDescription - Zone: $ZoneName
    • "; // Single Goals if ($GoalMethod == 0) { if ($NPCID > 0) { print "
    • Related NPC: " . $NPCName . "
    • "; } if ($ItemID > 0) { print "
    • Related Item: " . $ItemName . "
    • "; } } // Goal List if ($GoalMethod == 1) { $Query2 = "SELECT * FROM goallists WHERE listid='" . $GoalID . "'"; $QueryResult2 = db_mysql_query($Query2) or message_die('task.php', 'MYSQL_QUERY', $Query2, mysqli_error()); $GoalListString = ""; if (mysqli_num_rows($QueryResult2) > 0) { while ($row2 = mysqli_fetch_array($QueryResult2)) { if ($GoalType == "NPCID" && $row2["entry"]) { $NPCID = $row2["entry"]; $NPCName = get_field_result("name", "SELECT name FROM npc_types WHERE id = $NPCID"); $GoalListString .= "
    • Related NPC: " . get_npc_name_human_readable($NPCName) . "
    • "; } if ($GoalType == "ItemID" && $row2["entry"]) { $ItemID = $row2["entry"]; $ItemName = get_field_result("name", "SELECT name FROM items WHERE id = $ItemID"); $GoalListString .= "
    • Related Item: " . $ItemName . "
    • "; } } } print $GoalListString; } print "
No Task Activities Listed

"; ?>