Danny696 Posted April 19, 2009 Posted April 19, 2009 i would like a few mods to be made also there are afew quiestions at the end of the mods i want 1 just like the male and female theres another option for NPC's called animals done thanks to tonk and MTG 2 an mod so that NPC's can attack without someone having to log into there user(would this be hard to make?) i would like an offer for both mods and/or separate please Quote
(((TOLK))) Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods These two are good ideas, for the animals try this query. All credit to Magictallguy he gave me them ALTER TABLE `users` DROP `gender`; ATLER TABLE `users` ADD `gender` ENUM('Male', 'Female', 'Animal') NOT NULL DEFAULT 'Male'; Quote
Danny696 Posted April 19, 2009 Author Posted April 19, 2009 Re: a couple of mods ok ty tolk and MTG so any ideas for the second one anyone? Quote
Lithium Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods NPC = Non Playing Character... Though if you want them to attack... add a cron to randomly attack users Quote
Danny696 Posted April 19, 2009 Author Posted April 19, 2009 Re: a couple of mods ty Lithium any idea what that cron would be?? Quote
(((TOLK))) Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods try the five minute cron. you might wanna add something like: $db->query("ALTER TABLE users SET hospital=15 WHERE userid=$random"); $db->query("ALTER TABLE users SET hospreason=Hospitalized by $bot") $bot and $random don't exist so you'll have to sort that out, i'll have a go if i get the chance. i don't think both them query's will work becoz the $random and $bot would change in each query and i'm not that good with SQL so i don't know how to put them together :? Quote
shrek1609 Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods This will automate the NPC's and get them to attack random members, the NPC's will jump to the city of the random member then attack them.... you may need to change the exp given i have exp caps in my game so edit it to suit your game... add this to whichever cron you want mine is in a new cron which runs every 20 mins you could add it to 5min cron or hour cron etc // start attack code function eve_add($userid,$text,$connection=0) { global $db; $text=mysql_esca($text); $db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$text')"); $db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$userid}"); return 1; } function mysql_esca($str) { return str_replace("'","''",$str); } $q=$db->query("SELECT * FROM users where user_level = 0 and hospital =0 limit 20"); while($r=$db->fetch_row($q)) { $s=$db->query("SELECT * FROM users where user_level > 0 and hospital =0 and jail =0 order by rand() limit 1"); $p=$db->fetch_row($s); $numb=$db->num_rows($s); if ($numb > 0) { $db->query("UPDATE users SET location={$p['location']} WHERE userid={$r['userid']}"); $t=$db->query("SELECT * FROM userstats where userid={$r['userid']}"); $v=$db->fetch_row($t); $bot=($v['strength'] + $v['guard'] + $v['agility']); $x=$db->query("SELECT * FROM userstats where userid={$p['userid']}"); $w=$db->fetch_row($x); $memb=($w['strength'] + $w['guard'] + $w['agility']); if ($bot > $memb) { $qe=abs((($p['level']-$r['level'])*100) + 100); if ($qe > 10000) { $qe = 10000; } if ($qe < 0) { $qe = 1; } if ($p['level'] < $r['level']) { $qe = 1; } $db->query("UPDATE users SET exp=exp+$qe WHERE userid={$r['userid']}"); $hosptime=20; $db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='Hospitalized by <a href=\'viewuser.php?u={$r['userid']}\'>{$r['username']}</a>' WHERE userid={$p['userid']}"); eve_add($p['userid'],"[url='viewuser.php?u={$r[']{$r['username']}[/url] beat you up. They gained $qe",$c); } else { $qe=abs((($p['level']-$r['level'])*100) + 100); if ($qe > 10000) { $qe = 10000; } if ($qe < 0) { $qe = 1; } if ($p['level'] < $r['level']) { $qe = 1; } $db->query("UPDATE users SET exp=exp+$qe WHERE userid={$p['userid']}"); $db->query("UPDATE users SET exp=0 WHERE exp < 0"); eve_add($p['userid'],"[url='viewuser.php?u={$r[']{$r['username']}[/url] attacked you and lost. You gained $qe",$c); } } } Quote
shrek1609 Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods this code again added into a cron will make the npc's train their stats... // start training code $q=$db->query("SELECT * FROM users where user_level = 0 and hospital = 0 limit 20"); while($r=$db->fetch_row($q)) { $gain=0; for($i=0; $i<$r['energy']; $i++) { $stat+=rand(1,3)/rand(800,1000)*rand(800,1000)*(($r['will']+20)/150); } $statgain=rand(1,3); if ($statgain == 1) { $db->query("update userstats set strength=strength+$stat where userid = {$r['userid']}"); } else if ($statgain == 2) { $db->query("update userstats set guard=guard+$stat where userid = {$r['userid']}"); } else if ($statgain == 3) { $db->query("update userstats set agility=agility+$stat where userid = {$r['userid']}"); } } Quote
shrek1609 Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods again add to cron of your choice... will make the NPC's appear online //fetchs the npc info and makes them appear online $db->query("UPDATE users SET laston=unix_timestamp() WHERE user_level = 0"); //fetch Quote
shrek1609 Posted April 19, 2009 Posted April 19, 2009 Re: a couple of mods just edited the attack code forgot to add the event function... any problems message me Quote
(((TOLK))) Posted April 21, 2009 Posted April 21, 2009 Re: a couple of mods i would like a few mods to be made also there are afew quiestions at the end of the mods i want 1 just like the male and female theres another option for NPC's called animals done thanks to tonk and MTG 2 an mod so that NPC's can attack without someone having to log into there user(would this be hard to make?) i would like an offer for both mods and/or separate please tonk? tonk!? is that what i get when trying to help people, i get called tonk!! it's tolk!! lol :lol: Quote
gideon prewett Posted April 22, 2009 Posted April 22, 2009 Re: a couple of mods ok im not even sure how u would do it but it would be cool if when u mail a npc it sends a random mail bk? also as u have it so the npcs randomly attack could u have it so if u had a gang of npc's if u declair war on then they will fight bk? Quote
DELETE ME NOW! Posted April 22, 2009 Posted April 22, 2009 Re: a couple of mods These two are good ideas, for the animals try this query. All credit to Magictallguy he gave me them ALTER TABLE `users` DROP `gender`; ATLER TABLE `users` ADD `gender` ENUM('Male', 'Female', 'Animal') NOT NULL DEFAULT 'Male'; Lmao, tolk do that it will mess your register page up :) This is what you do ALTER TABLE `users` CHANGE `gender` `gender` ENUM( 'Male', 'Female', 'Animal' ) NOT NULL DEFAULT 'Male' ^^ I only done php tags for colors ;) Quote
Danny696 Posted April 22, 2009 Author Posted April 22, 2009 Re: a couple of mods ok im not even sure how u would do it but it would be cool if when u mail a npc it sends a random mail bk? also as u have it so the npcs randomly attack could u have it so if u had a gang of npc's if u declair war on then they will fight bk? Good idea i know of a code with the mail ill post it soon Quote
Danny696 Posted April 22, 2009 Author Posted April 22, 2009 Re: a couple of mods hey i need help shrek1609 i put your mod in a game and then it put every player in hosp any help Quote
Joshua Posted June 16, 2009 Posted June 16, 2009 Re: a couple of mods So just adding these simple codes to Crons will make your NPC's go on the offensive? And what if you have several NPC's. Will they all attack or just one? "confused" Quote
shrek1609 Posted June 16, 2009 Posted June 16, 2009 Re: a couple of mods $q=$db->query("SELECT * FROM users where user_level = 0 and hospital =0 limit 20"); this line is selecting the npc's if you only want it to select a certain amount change limit 20 Quote
CrazyT Posted June 16, 2009 Posted June 16, 2009 Re: a couple of mods $q=$db->query("SELECT * FROM users where user_level = 0 and hospital =0 limit 20"); this line is selecting the npc's if you only want it to select a certain amount change limit 20 $db->query('SELECT `blah`, `blah`, `blah` FROM `users` WHERE ((`user_level` = 0) && (`hospital` = 0)) LIMIT 20'); Quote
gideon prewett Posted June 16, 2009 Posted June 16, 2009 Re: a couple of mods if u change $q=$db->query("SELECT * FROM users where user_level = 0 and hospital =0 limit 20"); to $q=$db->query("SELECT * FROM users where userid = 1 and hospital =0 limit 20"); that will make only id 1 attack so u can mako only 1 person attack Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.