View Full Version: The IVAN script challenge

ivan >>Programming >>The IVAN script challenge


Z- 09-07-2006
Re: The IVAN script challenge
XIV. This means I can remove any of the features I have coded, for instance if Marx has ordered me to code a striptease AI for Raxy. Why? "Sherarax the mistress queen throws her phoenix feather gauntlet of dexterity +4 away. You feel quite happy."

holybanana- 09-07-2006

All script exercises have been answered correctly. However, this was done by two people, so I declare Freelance Berzerker is Engels and mistfilio is Guevara. Exercises of lectures II and III were correctly solved by FB. Exercise IV.I was solved by mistfilio. Exercise IV.II was solved by both ones. I was looking for mistfilio's answer, yes, but the question was ambiguous, it can be interpreted also as FB did, when the answer is no. Exercise V was solved partially by FB and corrected by mistfilio. I'll give 2+0.5+0.5=3 exercise points to FB and 1+0.5+0.5=2 to mistfilio. Since 5 exercise points would yield a right to compose a list of ten entries for five hours of my time, FB is allowed to make a list of six entries for three hours and mistfilio a list of four entries for two hours. Notes: A pick-axe is instantiated as pickaxe, not meleeweapon(PICK_AXE). This is because it has special code for digging. (ORGANIC_ID +15) works as well as (ORGANIC_ID + 15). The difference is aesthetic. The correct answer to the coding exercise would have been to #include "miscitem.h", where holybanana is declared, and add the line PLAYER->GetStack()->AddItem(holybanana::Spawn()); to commandsystem::NOP. Here PLAYER->GetStack() is the player's inventory.

blob- 09-07-2006

Congratulation Engels aka Freelance and guevarra aka mistfilio . I hope you ll ask for some intelligent things like a strip tease by golgor dhan.

Freelance Berzerker- 09-07-2006
Freelance Berzerker AKA "Engels" Task List for Hol
First, I would like to sincerely thank HolyBanana for putting aside so much time as of late to put up exercises and help complete newbies coders like myself as well as for inaugurating this IVAN challenge. HolyBanana, you rock! Next, I’d like to thank mistifilio for his copious and most helpful corrections as well as Z for his helpful comments. This is the only way a guy (or at least a guy like me) can learn, so thank you very, very much. I look forward to receiving guidance in coding from all of you in the future. FB is allowed to make a list of six entries for three hours The following tasks are listed in order of priority. 1. Called Shots a) This function allows a player character to target a specific bodypart (head, arms, legs, torso, groin). b) Called shot is turned on via “F1” or whatever special hotkey HolyBanana would like to use. c) After called shot is activated, the player chooses the limb to attack via the number pad, which is as follows: 8 = head 5 = torso 4 = left arm 6 = right arm 1 = left leg 2 = groin 3 = right leg d) Called shots are obviously much more difficult than normal attacks, and are dependant upon—in order of importance—weapon skill (obviously) and dexerity (hitting a very specific location requires a great deal of finesse). The advantage of a called shot is that a player can quickly dispatch a certain body part or even sever it and greatly weaken an opponent rather than just whacking on it at random and trying to kill it with collateral damage. e) However, since “setting up” an opponent to be hit where it doesn’t want to takes more time and preparation, called shots take 1.5 times as much time as a conventional attack. For “weapons masters” who have attained level 18 in a certain weapon, this delay is waived. 2. Sentient Weapon, “Masamune the Corruptor” a) This weapon is a sentient +10 2-handed scimitar. It causes 5 additional points of HP loss through “bleeding” of the target. On a critical hit, Masamune does 50 points of “hemorrhaging” damage and automatically severs the body part hit. If Masamune is damaged, this bloody HP drain goes directly into healing Masamune. Masamune can be neither enchanted nor disenchanted. Nor can its material be changed. b) It is fashioned completely of gleaming BLACK_DIAMOND and nearly unbreakable. c) It is attached to the god Cruentus. d) Characters wielding this weapon who are not of Cruentus’s alignment will take damage every round depending on how far they are removed. This increases by a 5 hp for each alignment step. For instance, an adherent of Mortifer (1 alignment step) would take 5 hp per round after equipping Masamune, while an adherent of Valpurus (13 alignment steps) would take 65 hp per round! Obviously, Cruentus doesn’t like non-believers to be using his prized weapons. The damage done to the character goes directly to repairing Cruentus HP if it is hurt. e) This weapon also has the function of shifting the alignment of the character rapidly in the direction of Cruentus. Every time it is swung, the alignment of the character shifts 0.5 steps in the direction of Cruentus. Therefore, if the character is an adherent of Mortifer and swings the sword at an orc 2 times, he will become an adherent of Cruentus the very next round. f) Masamune has a mind of its own, and will prevail over characters who are not made of the right mental stuff. Think of Masamune as a monster which can be wielded. Like all monsters, it has its own set of attributes: Astr(refers to Masamune’s blade, it’s “arms”): 15 Lstr(refers to Masamune’s hilt and handle, it’s “legs”): 12 Dex: 14 Agi: 14 End: 20 Per: 15 Int: 25 Wis: 25 Cha: 25 HP: 500 (when HP reach zero, Masamune breaks and “dies” until repaired; hit points are only used when Masamune acts independently, otherwise Masamune is treated like any other “nearly-unbreakable” weapon.) g) Characters engage in a “battle of wills” with Masamune each time they use it. This battle of wills pits the sum of the character’s Int, Wis, and Cha against that of Masamune’s. If the character’s sum exceeds that of Masamune’s, the character has full control. If the character’s sum is less than half that of Masamune’s, the 2-handed sword takes possession of the character for 20 rounds and makes the character attack whoever it wants, including the character himself. If the character’s sum is greater than half but still less than Masamune’s sum, the game engine conducts a probability check of whether Masamune take possession of the player character. h) Once per day, the player character is able to “apply” Masamune, which allows the sword to fly free and attack as it were a pet. During this time, the character may equip another weapon. Masamune’s independent attacks last for 15 rounds. i) Characters who are not “Knights of Cruentus” are only able to use Masamune at 50% effectiveness. This means Masamune only does half damage, and hits and blocks 50% less effectively. j) Masamune speaks the following lines to the player’s enemy while in the midst of combat: 1) “Omae mo shinde iru! (You’re already dead!)” 2) “Cruentus corrupt your soul!” 3) “Your death is assured!” 4) “Taste my vorpal bite!” 5) “Cruentus wants your crotch, mortal!” 6) “Masamune shall rend you from limb to limb!” 3. Augmented “unarmed” skills. a) This expands the range of unarmed skills in the game from kicking and punching to headbutting, tackling, and biting. b) To use these unarmed skills, the character pressed “U,” and then presses the following from the number pad to select his the relevant unarmed skill for use: 1: punching 2: kicking 3: headbutting 4: tackling 5: biting The skill used will continue to be used until the character decides to use a different melee weapon or a different unarmed combat skill. c) In the weapon-skills screen, all of these skills and their skill levels now show up. d) Headbutting is an alternative to biting which does better and blunt damage (unless the character equips a spiked helm). e) Tackle allows the character to throw himself into the enemy and bring it to the ground, temporarily immobilizing it and allowing the character to melee it for one round. A missed tackle only brings the player to the ground and allows the monster a round of free attacks. f) Each of these skills have their own levels just like any other weapon. A level 18 biter has well-nigh vorpal teeth and is a fearsome foe. 4. Scroll of Graft Body Part. a) This scroll allows the grafting of any body part to any other vacant part of the body. For instance, most players, after having killed an orc general and losing their left arm, might choose to graft the left arm of the orc general onto their own. b) The new limb would take on the attributes of the original creature, including rate of strength progression. c) A player could just as readily graft the head of the orc onto the stub where his left arm used to be before being hacked off. Or he could be even more perverse and graft the left nut of Petrus onto his stub. It’s all good. In the case that a head is grafted onto the location of where another limb is, it will enter into an automatic conversation with the player character as he moves around. In combat, the player character can using the attached 2nd head for blunt damage, and on critical hits the attached head also bites the enemy for extra damage (in such as case, the progression for the bite weapon level of the attached head is treated separately from that of the player character’s “normal head” which he uses for biting). d) The player character is also able to science talk to his 2nd head by using the chat command, assuming that it is intelligent enough to do so. 5. The sentry command for pets. a) I was often annoyed by storing equipment in town or dungeons and having them mess with my stuff. The player character can now command pets to stand guard and not move from a designated area. Once set on guard, the pets will not move from their location and will attack anyone who enters their attack radius. b) The pets can also just stand guard without attacking by having the player character command the pets that they do not attack enemies. 6. Specific move command for pets. a) The player character is able to talk to the character and say “(name), go over there.” After executing this command, the player temporary possesses the pet and is able to use the keypad to place the pet in the location desired. The pet will not move from that location until the player moves right next to it. b) If the player moves away again after this, the pet will follow as usual. This command makes it easier to use pets as advance scouts and also to place them strategically for places that the player feels needs to be guarded.

Planplan- 09-08-2006

Damn, I was thinking I can post all 5 script at the same time, have to finish 2 more... Congrats to you two anyway! But wait, holybanana, you made a mistake 8) For the coding part, miscitem.h is already in the includes. Mainly because it's require for the spawn of scroll of wishing when you press X. truth commandsystem::WizardMode(character* Char) { (...) for(int c = 0; c < 5; ++c) Char->GetStack()->AddItem(scrollofwishing::Spawn()); (...) } And the correct line would be : Char->GetStack()->AddItem(holybanana::Spawn());instead ofPLAYER->GetStack()->AddItem(holybanana::Spawn()); Phew! So my trying isn't totaly useless ^^ Just because I have fun with this character I called Midas :

Freelance Berzerker- 09-08-2006

You gotta' love over-the-top characters...

Battleguy01- 09-08-2006

Yeah, and by the way FB you have some nice ideas.

Freelance Berzerker- 09-08-2006

Thanks BG, I hope they are implementable.

Battleguy01- 09-08-2006

I think the only one that would be a bit tricky is Masamune the Corruptor, even though i think its the best one there.

Freelance Berzerker- 09-08-2006

These ideas have been basting in my head for a very long time. I've played quite a few CRPGS, but have never seen a sentient weapon done to my satisfaction. BG, You ever played paper-version AD&D? Sometimes the best form of entertainment is a good storyteller and your imagination. Then the sky's the limit. A pity there aren't as many pen-and-paper gamers nowadays. I've asked several times if there are any traditional gamers on these boards, but haven't gotten much of a response.

blob- 09-08-2006

im afraid only the first one could take 3 hours of coding already :Y But about your " go there command " dont forget you can whistle your pets. Could be used to make them come back too ? edit : why choose the name masamune for an evil sword ? He was just an incredible smith making the best katanas, why use his name for this one ? EDIT 2 : muramasa 's blade are more known to be bloodthirsty or evil. This would fit more ( even thought asian addition in Ivan seems strange to me ) . just my opinion.

Battleguy01- 09-08-2006

Nope, i have never played paper-version AD&D, what do you do. (btw i have never played AD&D non-paper-version either.)

Freelance Berzerker- 09-08-2006

Check out this website: http://www.wizards.com/default.asp?x=dnd/welcome

Battleguy01- 09-08-2006

Looks nice, i'll check it out tommorro, because i going to bed.

Freelance Berzerker- 09-08-2006

Kewl. Maybe you can try it out with some friends. I guarantee you'll like if you put some effort into playing it.

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.