DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • August 30, 2016, 11:01:49 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: Quests for 0.9.8  (Read 3828 times)
0 Members and 1 Guest are viewing this topic.
Sephiroth Reborn
Guest
« on: August 31, 2004, 06:39:58 PM »

OK this is my first try at making a mod for 0.9.8..it is a simple quest script..for now you can only do 1 quest..but within the next 3 days I should have at least 2 more quests ready and in the file..(as you can already tell I have some work going for the other two quests...please let me know if you like it...


BTW:
I love this site...whoever is the owner is an absolute genious! I love that people make so many mods and with different things to each one! THANK YOU ALL! Cheesy I'm just trying to give back for what all of you have given me!

-Sephiroth
Logged
Sephiroth Reborn.2
Guest
« Reply #1 on: August 31, 2004, 06:49:27 PM »

<?php
require_once("lib/http.php");

function quests_getmoduleinfo(){
   $info = array(
      "name"=>"Quests",
      "author"=>"Josh Elwell (Sephiroth)",
      "category"=>"Quests",
      "version"=>"1.0",
      "download"=>"http://dragonprime.net",
      "prefs"=>array(
         "Quests User Preferences,title",
         "qact"=>"Quest Act,int|1",
         "qinfo"=>"Quest Info,",
         "qid"=>"Quest Id,int|0",
         "questscomp"=>"Quests Completed,int|0",
         "quests"=>"Number of Quests the user Currently has,int|0",
         "questname"=>"Name of the Users current Quest,",
      )
   );
   return $info;
}

function quests_install(){
   module_addhook("village");
   module_addhook("inn");
   module_addhook("gypsy");
   module_addhook("village-desc");
   module_addhook("charstats");
   return true;
}

function quests_uninstall(){
   debug("Uninstalling module.");
   return true;
}

function quests_dohook($hookname, $args) {
   global $session;

   switch($hookname){
   case "village":
   if (get_module_pref("qid")==1 && get_module_pref("quests")==1 && get_module_pref("qact")==4){
   addnav("Quest #1: Act 4");
   addnav("Give Sephiroth His Book","runmodule.php?module=quests&op=yqa4");}
if (get_module_pref("qid")==2 && get_module_pref("quests")==1 && get_module_pref("qact")==9){
   addnav("Quest #2: Act 9");
   addnav("Talk to Sephiroth","runmodule.php?module=quests&op=q2finish");}
if (get_module_pref("qid")==3 && get_module_pref("quests")==1 && get_module_pref("qact")==1){
   addnav("Quest #3: Act 1");
   addnav("The Labyrinth","labyrinth.php?op=labyrinth");}
if (get_module_pref("qid")==3 && get_module_pref("quests")==1 && get_module_pref("qact")==2){
   addnav("Quest #3: Act 2");
   addnav("Talk to Sephiroth","runmodule.php?module=quests&op=q3finish");}
      break;

   case "charstats":
      $thingy = "<a href='runmodule.php?module=quests&op=qinfo'>`&Click Here`0</a>";
      setcharstat("Vital Info", "Quest Info", $thingy);
      addnav("","runmodule.php?module=quests&op=qinfo");
      break;
   case "village-desc":
   if (get_module_pref("questscomp")==0 && get_module_pref("qact")==1){
   output("`4`nA Young Man walks up to you and says Would ye like to do me favor? There will be a reward if you complete my task.`n`0`c[<a href='runmodule.php?module=quests&op=q1'>`&Accept`0</a>]/[<a href='runmodule.php?module=quests&op=deny'>`&Decline`0</a>]`c`n",true);
   addnav("","runmodule.php?module=quests&op=q1");
   addnav("","runmodule.php?module=quests&op=deny");}
   //if (get_module_pref("questscomp")==1343134 && get_module_pref("qact")==1){
   //output("`^A crew of evil people is trying to take over our land! Please help us stop them before they take over!!!`n`0`c[<a href='runmodule.php?module=quests&op=q2'>`&Accept`0</a>]/[<a href='runmodule.php?module=quests&op=deny'>`&Decline`0</a>]`c",true);
   //addnav("","runmodule.php?module=quests&op=q2");}
   //if (get_module_pref("questscomp")==1 && get_module_pref("qact")==1){
   //output("`^There is a tournament`n`0`c[<a href='runmodule.php?module=quests&op=q3'>`&Accept`0</a>]/[<a href='runmodule.php?module=quests&op=deny'>`&Decline`0</a>]`c",true);
   //addnav("","runmodule.php?module=quests&op=q3");}
   break;

   case "inn":
      if (get_module_pref("qid")==1 && get_module_pref("quests")==1 && get_module_pref("qact")==1){
   addnav("Things to Do");
   addnav("`2Quest #1: Act 1`0");
   addnav("Search the Table","runmodule.php?module=quests&op=yqa1");}
   if (get_module_pref("qid")==1 && get_module_pref("quests")==1 && get_module_pref("qact")==3){
   addnav("`2Quest #1: Act 3`0");
   addnav("Give Kira the Heirloom","runmodule.php?module=quests&op=yqa3");}
      break;

   case "gypsy":
      if (get_module_pref("qid")==1 && get_module_pref("quests")==1 && get_module_pref("qact")==2){
   addnav("Quest #1: Act 2");
   addnav("Search the Ground","runmodule.php?module=quests&op=yqa2");}
   break;
   
   }
   return $args;
}
Logged
Sephiroth Reborn.2
Guest
« Reply #2 on: August 31, 2004, 06:50:23 PM »

function quests_run(){
   global $session;

$op = httpget('op');
page_header("Quests");
   if ($op==""){
   output("No one knows how you got here");
addnav("Back to Village","village.php");
}

if ($op=="deny"){
   output("Well if you decide to try a quest later you can!");
addnav("Back to Village","village.php");
}

if ($op=="q1"){
   output("`4The man is Sephiroth! Thank you young sire! Your help will be much appreciated!");
set_module_pref("qid",get_module_pref("qid",0)+1);
set_module_pref("quests",get_module_pref("quests")+1);
set_module_pref("qact",get_module_pref("qact")+1);
set_module_pref("qinfo","You must help Sephiroth find his PhP for Dummies book! Try checking the Inn and see if you can find anything.");
set_module_pref("questname","Sephiroths Quest");
addnav("Back to the Village","village.php");
}

if ($op=="q2"){
   output("`4Run to the forest and save the people from the evil band of people!!!!!");
set_module_pref("qid",2);
set_module_pref("quests",1);
set_module_pref("qact",2);
set_module_pref("qinfo","Help the people in the forest from the evil band of people!");
set_module_pref("questname","A true Warriors Challenge.");
addnav("Back to the Village","village.php");
}

if ($op=="q3"){
   output("`^Ye have joined the tournament!!!!");
set_module_pref("qid",3);
set_module_pref("quests",1);
set_module_pref("qact",1);
set_module_pref("qinfo","Win the Tournament by completing the Labyrinth of Doom!");
set_module_pref("questname","The Test of Strength and Strategy.");
addnav("Back to the Village","village.php");
}


/*
I will finish this later....most likely in the next release
if ($op=="serf"){
   addnav("Fight the Serf","maz.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fps1.GIF'></img></a>",true);
       }

if ($op=="villein"){
   addnav("Fight the Villein","maze.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpv.GIF'></img></a>",true);
       }

if ($op=="merchant"){
addnav("Fight the Merchant","maze2.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpm.GIF'></img></a>",true);
       }

if ($op=="knight"){
addnav("Fight the Knight","maze3.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpk.GIF'></img></a>",true);
       }

if ($op=="bailiff"){
   addnav("Fight the Bailiff","maze4.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpb.GIF'></img></a>",true);
       }

if ($op=="duke"){
   addnav("Fight the Duke","maze5.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpd.GIF'></img></a>",true);
       }

if ($op=="bishop"){
   addnav("Fight the Bishop","maze6.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpbi.GIF'></img></a>",true);
       }

if ($op=="baron"){
   addnav("Fight the Baron","maze7.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpba.GIF'></img></a>",true);
       }

if ($op=="king"){
   addnav("Fight the Bailiff","maze8.php?op=mazefight");
output("`\$You are about to fight (The Stage with a Check)");
       output("<a href='maz.php'><img src='./images/fpkn.GIF'></img></a>",true);
       }*/

if ($op=="q2finish"){
   output("`4You killed the evil clan of people!! You saved us all!");
output("`^You get 20 gems and 1000 gold!!");
addnav("Back to Village","village.php");
addnews("$name completed the 2nd Quest!!");
set_module_pref("questscomp",2);
set_module_pref("qact",0);
set_module_pref("quests",0);
set_module_pref("qinfo","Nothing.");
$session['user']['gold']+=1000;
$session['user']['gems']+=20;
set_module_pref("qid",0);
}

if ($op=="q3finish"){
output("`^You get 10 gems and 650 gold!!");
addnav("Back to Village","village.php");
addnews("$name completed the 3rd Quest!!");
set_module_pref("questscomp",3);
set_module_pref("qact",0);
set_module_pref("quests",0);
set_module_pref("qinfo","Nothing.");
$session['user']['gold']+=650;
$session['user']['gems']+=10;
set_module_pref("qid",0);
}

if ($op=="yqa1"){
   output("`#You see Sephiroth's Book!! You go to grab it but a hand slaps you!");
output("A lady named Kira tells you that she found that book and she won't give it up unless you help her.");
output("After talking to her you find out that you need to find her family heirloom!");
output("She thinks that she may have dropped it somewhere in the market...");
set_module_pref("qinfo","Find Kira's Heirloom!! Check the Market!");
set_module_pref("qact",get_module_pref("qact")+1);
addnav("Back to the Village","village.php");
}

if ($op=="qinfo"){
   output("".get_module_pref("qinfo")."");
addnav("Back to the Village","village.php");
}

if ($op=="yqa2"){
   output("`@You search the ground looking for Kira's Heirloom....");
$Sephiroth = e_rand (1,3);
      switch($Sephiroth){
        case 1:
           output("You found nothing...");
        break;
       case "2":
           output("You found nothing...");
        break;
        case "3":
           output("You found the heirloom!!");
             set_module_pref("qinfo","Return the Heirloom to Kira!");
             set_module_pref("qact",get_module_pref("qact")+1);
        break;
     }
     addnav("Return to the Village","village.php");
     }
   
if ($op=="yqa3"){
   output("`3You hand Kira the heirloom and in return she gives you Sephiroth's PhP for Dummies Book!!");
set_module_pref("qinfo","Give Sephiroth his PhP for Dummies Book! He can be found in the Village!");
set_module_pref("qact",get_module_pref("qact")+1);
addnav("Back to the Village","village.php");
}

if ($op=="yqa4"){
   output("`\$You give Sephiroth his PhP for Dummies Book back and he thanks you a lot!! You recieve 900 gold for completing the quest.");
set_module_pref("questscomp",get_module_pref("questscomp")+1);
set_module_pref("qact",get_module_pref("qact")-3);
set_module_pref("quests",get_module_pref("quests")-1);
set_module_pref("qid",get_module_pref("qid")-1);
set_module_pref("qinfo","Nothing.");
addnews("$name Completed Sephiroth's Quest!!");
addnav("Back to Village","village.php");

   }
   page_footer();
}

?>

theres the rest! drop into your modules folder and install activate and then try it out!
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #3 on: August 31, 2004, 06:54:07 PM »

It would have been easier to make an account, put that all in a txt file and upload it, rather than place the entire code in.

Just a helpful reminder.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Sephiroth Reborn.2
Guest
« Reply #4 on: August 31, 2004, 06:55:06 PM »

I tried to make an account but never got the email....sorry...

BTW...What do you think of it?
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #5 on: August 31, 2004, 07:00:01 PM »

It seems nice, I have never played a Quest Script, but I was looking into them...
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5462



View Profile WWW
« Reply #6 on: August 31, 2004, 07:26:58 PM »

I tried to make an account but never got the email....sorry...

If you don't get the confirmation email, send me an email at mytrashcan@shaw.ca and I'll fix you up manually.
Logged

Play the latest beta version here on DragonPrime
Sephiroth Reborn.2
Guest
« Reply #7 on: September 03, 2004, 12:53:25 PM »

Sorry I haven't responded lately...been busy with work and some family stuff. I will e-mail you soon Talisman once I have enough time.

I was just wondering, has anyone tested this module yet? I just want to know if you think its worth it for me to continue on with this module or not. Thanks Everyone.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
19 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search