Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Travel Mage instead of a Travel Stone
Author Message
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #1
Travel Mage instead of a Travel Stone
is it possible to make a npc that works like a stone but instead of getting a menu up when you click on it you instead say something like "I want to go to minoc" and he charges you like 100gold and sends you on your merry way.
02-18-2016 12:59 AM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #2
RE: Travel Mage instead of a Travel Stone
[CHARDEF c_teleporter]
NAME=Teleporter
ID=C_MAN
DAM=15,20
ARMOR=20
TSPEECH=teleporter


ON=@Create
TITLE=The teleporter
NPC=brain_human
COLOR=colors_skin
STR={151 165}
DEX={80 120}
INT={151 165}

DETECTION={90.0 100.0}
FENCING={90.0 100.0}
PARRYING={90.0 100.0}
SWORDSMANSHIP={90.0 100.0}
WRESTLING={90.0 100.0}
MACEFIGHTING={90.0 100.0}
MAGICRESISTANCE={90.0 100.0}
TACTICS={90.0 100.0}

ITEMNEWBIE=random_male_hair
COLOR=colors_hair
ITEMNEWBIE=random_facial_hair
COLOR=match_hair

ON=@NPCRestock
ITEM=i_shirt_plain
COLOR=colors_all
ITEM=random_pants
COLOR=colors_all
ITEM=01710
COLOR=colors_all

[SPEECH teleporter]
ON=*hello*
ON=*hi*
Say Hello Adventurer!
Say Would you like to travel?
Say If yes, please say the name of the city you want to go to.

ON=*minoc*
IF ( <SRC.GOLD> >= 100 )
SAY Here you go.
SRC.GO minoc
Else
SAY Sorry but you do not have enough money for that.
ENDIF
(This post was last modified: 02-18-2016 05:17 AM by pointhz.)
02-18-2016 05:16 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #3
RE: Travel Mage instead of a Travel Stone
Code:
on=*hi*
on=*hello*
say Hello there. For 100 gold I can send you to any city you'd like.
say Just say the name of the city you would like to go.

on=*Minoc*
if (!<src.restest 100 i_gold>)
say Sorry, but you don't have enough money for that.
return 1 // We will now end this conversation with the player until the player gets the mage's attention again.
endif
src.consumegold 100
src.go Minoc
return 1 // The player is gone. Let's remove his presence from the mage's attention.

This can be setup for every town possible. The original response lacked a consumption of the gold needed. Also, return 1 *should* clear the player from the mage's memory and allow his attention to be sought out with other players without waiting on a delay.

I also cannot point this out enough with programming. Try to do checks to fail the processing first. Because if you get too complicated with success coding, you would be putting a lot more strain on processing than needed.
(This post was last modified: 02-18-2016 08:26 AM by Khaos.)
02-18-2016 08:23 AM
Find all posts by this user Like Post Quote this message in a reply
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #4
RE: Travel Mage instead of a Travel Stone
Thanks this works wonders and i can build on it Smile
02-18-2016 11:53 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes dunnetott's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)