About Store Forum Documentation Contact



Post Reply 
Hello I need a little help with make quests.
Author Message
andreadixon825 Offline
Member

Post: #1
Hello I need a little help with make quests.
Hello, grin
I'm looking at the source code to esenthel rpg 2, to make more then one quest, would I just add something like this next to the same one in the source? And just change name.

Code:
virtual void toggleChr (Chr  &chr )
   {
      if(!chr.alive()) // loot corpse
      {
         Storage.link(&chr);
         Storage.show();
         InvGui .show();
      }else
      if(chr.type==CHR_HUMAN) // talk to
      {
         if(!QuestCompleted)
         {
            // check if we have required items
            Item *chalice=null, *wine=null, *key=null;
            REPA(inv.items)
            {
               Item &item=inv.items[i];
               if(item.name=="Chalice")chalice=&item;else
               if(item.name=="Wine"   )wine   =&item;else
               if(item.name=="Key"    )key    =&item;
            }
            if(chalice && wine && key)
            {
               itemDestroy(*chalice);
               itemDestroy(*wine   );
               itemDestroy(*key    );
               QuestShow("Thanks for bringing back the items.\nYou're awesome!\nThe horse is yours.");
               QuestCompleted=true;
            }else
            {
               QuestShow("Please help fellow Adventurer!\nThose nasty goblins stole my precious items, please bring them back.\nIf you'll return them safely I will give you my horse. You can find the two goblins behind the windmill, please hurry.");
            }
         }else
         {
            QuestShow("Again thank you so much!");
         }
      }
   }

How dose quests work? and can you have more then one quest on an object like human.
09-07-2016 06:07 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply