Jump to content
MakeWebGames

NPC System


Newbie

Recommended Posts

Another freebie for yous guys/girls nothing special

ok lets stat with the sql first

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

npc.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

staff_npc.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

open up updates.php and add this into the min cron

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Edited by Newbie
Link to comment
Share on other sites

You don't check in the attack script if the NPC exits... This way if they put ?attack=1 behind the url they will just get $500 free each time.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Also, I don't see $_GET['ID'] being secured.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Other then that, Great job :)

Edited by Supervisor
Link to comment
Share on other sites

It'd be really awesome to have the NPC's randomly attack other players. Would make no player safe (in theory).

Build some logic to find players that would be fair to attack, we don't wanna start randomly killing low level players. Then "simulate" the attack and push an event to that user on the outcome. You could either build this into a cron that runs every 30 minutes or so, or potentially build it into the user requests on the page, but this would mean the NPC's are dead when their are no users online.

Link to comment
Share on other sites

  • 2 weeks later...
It'd be really awesome to have the NPC's randomly attack other players. Would make no player safe (in theory).

Build some logic to find players that would be fair to attack, we don't wanna start randomly killing low level players. Then "simulate" the attack and push an event to that user on the outcome. You could either build this into a cron that runs every 30 minutes or so, or potentially build it into the user requests on the page, but this would mean the NPC's are dead when their are no users online.

You could make it attack when the user is offline, might actually make people be online a little more?

Link to comment
Share on other sites

Linked with Facebook notifications or some other way to inform offline players about an attack it could get players to check the game.

Social media is also a good idea :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...