The Dink Network

Reply to Re: Riddle Script

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
November 10th 2007, 03:27 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
I've looked into the riddle script from initiation (L5ridd2.c)
You should be able to keep most of what's there. You can probably figure out what text to change to support your riddle easily. His consisted of 5 lines.

&rmsg1 = say_xy("`%I can be an important part of most meals,", 10, 90);
&rmsg2 = say_xy("`%though I definately don't add or take taste.", 10, 108);
&rmsg3 = say_xy("`%My shoeless feet are often bare,", 10, 126);
&rmsg4 = say_xy("`%though I usually have four.", 10, 144);
&rmsg5 = say_xy("`%What am I?", 10, 162);


After you change those there is only one more line you need to alter.
if (&trv == 9158765)


Everything in this if statement is what happens when you answer the riddle correctly. But how do you get 9158765 out of table???

He used a formula that you should use to find the numeric value of your answer. In this formula, for each letter (in order) you multiply the previous value by 26, then add the numeric value of the letter that was just inputted. Note that the variable started at 0.

T- 20
A- 1
B- 2
L- 12
E- 5

T
(0 * 26) + 20 = 20

A
(20 * 26) + 1 = 521

B
(521 * 26) + 2 = 13548

L
(13548 * 26) + 12 = 352260

E
(352260 * 26) + 5 = 9158765

Besides what happens when you get the riddle right and some of the other extras put in (like it being destroyable by bombs,) that's pretty much all you need to modify.