MegaRPG NPC Module
Platform: mIRC
Published Jul 23, 2008
Updated Jul 25, 2008
This is the NPC Module for MegaRPG.
Use With MegaRPG Base Code v2.0 and Rank Module v2.0
Making NPC's:
- Load This Script into Bot
- Replace 2 Parts of Base Code and Ranks Module
- In Bot Window type: /auser 500 <YOURNICK>
- To Save from Readini Problem Please Also type in bot window: /writeini Admins.ini Admin <YourNick> Yes
Commands:
/msg <BOT> `NPC Add <NPC-Name> <NPC-Level>
/msg <BOT> `NPC Del <NPC-Name>
Adding an NPC will automatically give it HP/MHP, Attack and Defence stats depending on the Level you give it.
When someone typed `Entered they will see Who is entered including NPC's but there will be 3 different colors.
Normal: Player
Red: NPC
Blue: Admin
;NPC Maker
on 500:TEXT:`NPC *:?:{
if ($2 == Add) && ($3) && ($4) {
if ($istok(%NPC.Names,$3,32)) { notice $nick $left NPC Already Exists $right }
if (!$istok(%NPC.Names,$3,32)) {
createNPC $3 $4
set %NPC.Names $addtok(%NPC.Names,$3,32)
notice $nick $left NPC $3 Stats: $right
notice $nick $left Level:15 $readini(NPC.ini,$3,Lvl) 14|| HP:15 $readini(NPC.ini,$3,HP) $+ 14/15 $readini(NPC.ini,$3,MHP) $right
notice $nick $Left Character Name:15 $readini(NPC.ini,$3,Name) 14|| Attack:15 $readini(NPC.ini,$3,Atk) 14|| Defence:15 $readini(NPC.ini,$3,Def) $right
msg %MainChannel $left NPC Created:15 $3 $right
}
}
if ($2 == Del) && ($3) {
if (!$istok(%NPC.Names,$3,32)) { notice $nick $Left NPC Doesn't Exist $right | halt }
remini NPC.ini $3
set %NPC.Names $remtok(%NPC.Names,$3,32)
notice $nick $Left NPC15 $3 14Deleted $right
msg %Mainchannel $left 15 $+ $3 14Has been Removed from the Game. $right
set %BattleArena $remtok(%BattleArena,4 $+ $3 $+ 15,32)
}
}
alias createNPC {
if (!$1) || (!$2) { halt }
writeini NPC.ini $1 Name $1
writeini NPC.ini $1 Lvl $2
writeini NPC.ini $1 MHP $rand($calc($2 * 10),$calc($2 * 100))
writeini NPC.ini $1 Atk $rand($calc($2 * 5),$calc($2 * 50))
writeini NPC.ini $1 Def $rand($calc($2 * 5),$calc($2 * 50))
timer 1 5 NPCHeal $1
}
alias NPCHeal {
writeini NPC.ini $1 HP $readini(NPC.ini,$1,MHP)
set %BattleArena $addtok(%BattleArena,4 $+ $1 $+ 15,32)
msg %MainChannel $left 15 $+ $1 14Has Entered the Arena $right
}
on *:TEXT:`NPCStats *:%MainChannel:{
msg %MainChannel $left NPC $2 Stats: $right
msg %MainChannel $left Level:15 $readini(NPC.ini,$2,Lvl) 14|| HP:15 $readini(NPC.ini,$2,HP) $+ 14/15 $+ $readini(NPC.ini,$2,MHP) $right
msg %MainChannel $Left Character Name:15 $readini(NPC.ini,$2,Name) 14|| Attack:15 $readini(NPC.ini,$2,Atk) 14|| Defence:15 $readini(NPC.ini,$2,Def) $right
}
alias NPCDeathCheck {
if ($readini(NPC.ini,$1,HP) <= 0) {
set %EXPGained $rand(1,$calc($readini(NPC.ini,$1,Lvl) * 50))
writeini Players.ini $2 EXP $calc($readini(Players.ini,$2,EXP) + %EXPGained)
msg %MainChannel $left 15 $+ $2 $+ 14(15 $+ $readini(Players.ini,$2,Character_Name) $+ 14) has killed15 $1 $right
notice $2 $left You have gained15 %EXPGained 14Experience for killing15 $1 $right
timerHeal $+ $1 1 $calc($readini(NPC.ini,$1,Lvl) * 0.3) NPCHeal $1
levelcheck $2
set %BattleArena $remtok(%BattleArena,4 $+ $1 $+ 15,32)
}
}