DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 12, 2018, 10:58:58 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Keeping NPCs off the PVP and Flirt lists  (Read 3112 times)
0 Members and 1 Guest are viewing this topic.
Odyssey
Guest
« on: June 12, 2004, 07:27:27 AM »

I saw this somewhere in here, but now I can't find it.

  There's a bit of code that you add that had a check for NPC = 1, that you could place in the PVP code, as well as where ever the flirts took place.

Any know what it is?
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #1 on: June 12, 2004, 07:53:13 AM »

just set the NPCs to level 25
Logged

Peanut_Butter_Wolf
Guest
« Reply #2 on: June 12, 2004, 10:39:17 AM »

In your sql query add  NPC to this..
Code:
$sql = "SELECT name AS creaturename,dragonkills,
                       level AS creaturelevel,
                                                                 weapon AS creatureweapon,
                                                                 gold AS creaturegold,
                                                                 goldinbank AS creaturebank,
                                                                 experience AS creatureexp,
                                                                 maxhitpoints AS creaturehealth,
                                                                 attack AS creatureattack,
                                                                 defence AS creaturedefense,
                                                                 bounty AS creaturebounty,
                                                                 loggedin,
                                                                 location,
                                                                 laston,
                                                                 alive,
                                                                 acctid,
                                                                 pvpflag,
NPC
then after the query add something to the effect of..
Code:
if ($row[NPC]==1){
output("`4 Sorry, you cannot challenge an NPC!");}

- pbw
« Last Edit: June 12, 2004, 10:42:50 AM by Peanut_Butter_Wolf » Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #3 on: June 12, 2004, 01:11:58 PM »

In your sql query add  NPC to this..
Code:
$sql = "SELECT name AS creaturename,dragonkills,
             .
             .
             .
NPC
then after the query add something to the effect of..
Code:
if ($row[NPC]==1){
output("`4 Sorry, you cannot challenge an NPC!");}

- pbw
Much easier then that, you can choose in your SQL query which char to pick up adding "WHERE npc = 0" Wink

Rgds Excalibur
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Odyssey
Guest
« Reply #4 on: June 12, 2004, 04:53:24 PM »

Thanks for all the replies.  Here's the code...

GARDENS.PHP

Code:
$sql = "SELECT acctid,name,sex,level,race,login,marriedto,charisma FROM accounts WHERE
      (locked=0) AND
      (sex <> ".$session[user][sex].") AND
      (alive=1) AND
      (acctid <> ".$session[user][acctid].") AND
      (npc=0) AND
      (laston > '".date("Y-m-d H:i:s",strtotime("-346000 sec"))."' OR (charisma=4294967295 AND acctid=".$session[user][marriedto].") )
      ORDER BY charm DESC LIMIT $limit";



Code:
} else if ($_GET[act]=="flirt"){
    if ($session[user][goldinbank]>0) $getgold=round($session[user][goldinbank]/2);
    $sql = "SELECT acctid,name,experience,charm,charisma,lastip,emailaddress,race,marriedto FROM accounts WHERE npc=0,login=\"$_GET[name]\"";


PVP.PHP

Code:
$sql = "SELECT name,alive,location,sex,level,laston,loggedin,login,pvpflag FROM accounts WHERE
   (locked=0) AND
   (npc=0) AND
   (age > $days OR dragonkills > 0 OR pk > 0 OR experience > $exp) AND
   (level >= ".($session[user][level]-1)." AND level <= ".($session[user][level]+2).") AND
   (alive=1 AND location=0) AND
   (laston < '".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." sec"))."' OR loggedin=0) AND
   (acctid <> ".$session[user][acctid].")
   ORDER BY level DESC";


Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
37 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search