Find
You are looking at a npc called Oya
Created by
thorn
, last updated 04 Jan 2012
Code
if target of talk then talks;
if reacting to meditate then checkskill;
if reacting to meditating then suggestspell;
##talks:
"[$init_obj] says, 'Can you tell me about enchantment?'";
"[$actor] replies, 'Enchantment is the enslavement of incantations within substance or entity.'";
"[$actor] adds, 'If you take a seat and meditate, I will teach you.'";
##checkskill:
getgender $init_obj;
"[$actor] watches $himher meditate.";
include 58416;
multivar $skiller=$init_obj,$skillname='magic';
runsub getskillvalue;
if $skillvalue == '0' then initmagic else sensemagic;
multivar $skiller=$init_obj,$skillname='enchantment';
runsub getskillvalue;
if $skillvalue == '0' then initenchantment else senseenchantment;
##suggestspell:
"[$actor] says to [$init_obj], 'Now stand and try casting our simplest spell, the one that inscribes a rune of mana.'";
##initmagic:
"[$actor] makes a symbolic gesture, and the fundamental secrets of magic are captured into [$init_obj]'s thoughts.";
multivar $skillcap='10',$skilltipobj='69414';
runsub initskill;
if $init_obj's manacap > 0 then convertit;
runsub getskillvalue;
set $init_obj's manamax to $skillvalue;
##sensemagic:
"[$actor] senses the magical ability already within [$init_obj]";
if $init_obj's manacap > 0 then convertit;
##initenchantment:
"[$actor] expresses a elaborate signal, and attaches some secrets of enchantment to [$init_obj]'s memory.";
multivar $skillcap='10',$skilltipobj='69372';
runsub initskill;
##senseenchantment:
"[$actor] senses the enchantment already within [$init_obj]";
##convertit:
$manamax = $init_obj's manamax;
if $manamax > 1 then convertit2 else erasem;
##convertit2:
$skillvals = $init_obj's skillvals;
manipulate $skillvals get magic to $magic;
manipulate $magic set svalue to $manamax by 2;
if $manamax > 10 then convertit3;
manipulate $skillvals set magic to $magic;
set $init_obj's skillvals to $skillvals;
runsub erasem;
"[$init_obj]'s magic converted to $manamax points";
##convertit3:
manipulate $magic set scap to 20 by 2;
manipulate $magic set stipobj to 69425 by 2;
##erasem:
find $init_obj,manacap;
if $found_id > 0 then erasem2;
find $init_obj,manapoints;
if $found_id > 0 then erasem2;
##erasem2:
set $found_id's loc to 0;