Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-15-2003, 10:24 PM   #1 (permalink)
stheno
Registered User
 
stheno's Avatar
 
Join Date: Mar 2003
Location: in my head
Posts: 7
stheno is on a distinguished road
Question LPC instructional files, anyone?

anyone who is interested in some LPC code instructional files, let me know. this is a fairly ancient language used for MUDs and such.

Stheno
:th:
stheno is offline   Reply With Quote
Old 03-15-2003, 10:54 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
wow cool, .. never heard of it..

can you post some example code to show us what it looks like?

& welcome to codenewbie
sde is online now   Reply With Quote
Old 03-15-2003, 10:55 PM   #3 (permalink)
Ilya020
Techno Rat
 
Ilya020's Avatar
 
Join Date: Jan 2003
Location: San Diego
Posts: 559
Ilya020 is on a distinguished road
Send a message via AIM to Ilya020
Ya...I would also love to see this example. Just post it anytime.

Ilya.
__________________
> SELECT * FROM users WHERE clue > 0
0 rows returned
Ilya020 is offline   Reply With Quote
Old 03-16-2003, 11:32 PM   #4 (permalink)
stheno
Registered User
 
stheno's Avatar
 
Join Date: Mar 2003
Location: in my head
Posts: 7
stheno is on a distinguished road
LPC examples

i was a wizard on Tsunami MUD (tsunami.thebigwave.net) and i coded these few things...a room, an object, and a NPC (non player character) in LPC.
stheno is offline   Reply With Quote
Old 03-16-2003, 11:33 PM   #5 (permalink)
stheno
Registered User
 
stheno's Avatar
 
Join Date: Mar 2003
Location: in my head
Posts: 7
stheno is on a distinguished road
room

#include "../path.h"
#include <weather.h>
inherit STD_ROOM;

void reset(int arg) {
::reset();
if(arg) return;
set_short("Undead Island");
set_outdoors(4);
set_terrain("cemetery");
set_long("You're standing at the edge of a great cliff. You "+
"can hear the sounds of the ocean, far below you. There "+
"is a very cold breeze blowing, carrying with it the "+
"sounds of the anguished undead, unable to die.\n");
add_obj("bigdk",1,"present");
set_light(0);

add_exit(UNDEAD+"undead/rooms/rm14", "east");
add_exit(UNDEAD+"undead/rooms/rm23", "north");

}
smell_room(string arg) {
if(!arg || arg=="room" || arg=="the room"){
write("The air is filled with a nausiating and putrid stench.\n");
return 1;
}
say(this_player()->query_name()+" takes a wiff of the putrid air.\n");
return 1;
}

pray() {
write("You may not do that here.\n");
return 1;
}
query_no_summon() {return 1;}
query_can_escape() {return 1;}
query_island() { return "the Undead"; }
query_undead_present(){
object *obj;
int index;
obj=all_inventory(this_object());
index=sizeof(obj);
while(index){
if(obj[index-1]->query_undead()) return 1;
index--;
}
return 0;
}
stheno is offline   Reply With Quote
Old 03-16-2003, 11:39 PM   #6 (permalink)
stheno
Registered User
 
stheno's Avatar
 
Join Date: Mar 2003
Location: in my head
Posts: 7
stheno is on a distinguished road
object (amulet)

inherit STD_ARMOUR;

int cr_skull;
void reset(int arg) {
::reset(arg);
if(arg) return;
set_name("black lily brooch");
set_alias("amulet");
set_alias("brooch");
set_short("Black Lily Brooch");
set_long("A black lily is encased in clear quartz and mounted "+
"on a silver filigree backing. Black lilies are said to bloom "+
"from the dead bodies of evil beings and will bleed when picked. "+
"Being in possession of one is said to mark you as evil for the "+
"rest of your days.\n");
set_type("amulet");
set_ac(2);
set_weight(2);
set_value(550);
}
int query_no_lock() { return 1; }
int query_magic() { return 1; }

int extra_wear(object ob) **boosts certain class skill**
{
if("/obj/handlers/skill_handler"->get_tot_level("deathmail", ob))

{
if(cr_skull != 1 && ob->query_subclass_name()=="deathknight"){
"/obj/handlers/skill_handler"->adjust_skill("deathmail",5,ob,1);
tell_object(ob,"The aura of death surrounding you grows stronger.\n");
cr_skull = 1;
}
}
}
int extra_unwear(object ob)
{
if (cr_skull)
{
"/obj/handlers/skill_handler"->adjust_skill("deathmail",-5,ob,1);
tell_object(ob, "The aura of death surrounding you weakens slightly.\n");
cr_skull = 0;
}
}

**i will be posting the tutorials for LPC on the tutorials forum shortly so you can see some of the things this code does. sadly, to really learn it, you have to have a "hands on" experience in an LPC MUD**
stheno is offline   Reply With Quote
Old 03-16-2003, 11:50 PM   #7 (permalink)
stheno
Registered User
 
stheno's Avatar
 
Join Date: Mar 2003
Location: in my head
Posts: 7
stheno is on a distinguished road
NPC

**this is the most fun thing to code for me because it allows a great deal of creativity and options to work with to develop a unique character for your "area" of rooms**

#include "path.h"
inherit "std/monster/deathknight";
string * chat_str;

int i;
object cs;

void reset(int arg){
::reset(arg);
if(arg) return;
set_name("Sir Hoyt");
set_alias("deathknight");
set_race("danpiru");
cs = clone_object("/obj/shadows/race/danpiru");
cs->start_shadow(this_object());
add_alias("hoyt");
add_alias("sir hoyt");
add_alias("sir");
add_alias("hoyt of glaxtonbury");
add_alias("undead");
add_alias("death knight");
add_alias("man");
set_short("Sir Hoyt of Glaxtonbury");
set_long("Sir Hoyt's blackened armour is still wet with the blood of "+
"his sister. Scars line his face, his matted "+
"black shoulder length hair falling around it. Volumes are spoken "+
"by his expression of lonliness as he has been cast into unlife "+
"and been damned for eternity.");
chat_str =allocate(4);
chat_str[0] = "Sir Hoyt stares through you with eyes of flame.";
chat_str[1] = "Sir Hoyt moans, 'I did love her...so much...'";
chat_str[2] = "Sir Hoyt floats slowly towards you.";
chat_str[3] = "Sir Hoyt asks, 'Do you find me appalling?'";
load_chat(6,chat_str);
set_ask_fail_msg("Sir Hoyt stares at you apathetically.");
add_knowledge(({"blood","bloody armour"}),"Sir Hoyt says: 'It is her "+
"blood...my sister's. I had always desired her more than any other "+
"woman. Alas, she rejected me. But I had to have her...no one "+
"else could...even if it meant exile and damnation...'");
add_knowledge("scars","Sir Hoyt says: 'Most warriors have scars..."+
"They are the only honourable thing I have left...'");
add_knowledge("sister","Sir Hoyt says: 'She was mine, at least for a "+
"small moment! Oh Ghysla, will I ever see your face again!'");
add_knowledge(({"lily","brooch"}),"Sir Hoyt says: 'Ah, my lily... "+
"'twas plucked from my sister's bleeding heart...'");
add_knowledge("glaxtonbury","Sir Hoyt says: 'Glaxtonbury is an ocean "+
"away...I was taken from my home and imprisoned on this foul isle "+
"when I fell from grace...I can never leave...never...'");
set_talk("
set_no_nightmare(1); **this is a spell the deathknight
subclass can cast; you can play with
their spells and skills, etc. much fun.**
}
stheno is offline   Reply With Quote
Old 03-17-2003, 12:38 AM   #8 (permalink)
stheno
Registered User
 
stheno's Avatar
 
Join Date: Mar 2003
Location: in my head
Posts: 7
stheno is on a distinguished road
additional note

the MUD where this code is from is a pretty custom MUD. there are a few other languages thrown in (due to the varied backgrounds of the coders) and it has become, in a way, its own language. this is just sample code as to how objects and whatnot are constructed within LPC. thanks
stheno is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing and using CMUgraphics library. Valmont Standard C, C++ 12 03-29-2003 08:39 AM
Linking files? ShadowSoft Standard C, C++ 3 02-27-2003 12:33 PM
All Class Files mixingsoup PHP 12 12-04-2002 06:49 AM


All times are GMT -8. The time now is 09:20 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting