Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Making NPC's appearance show differently (https://forums.graalonline.com/forums/showthread.php?t=134268305)

Fulg0reSama 06-08-2013 01:22 AM

Making NPC's appearance show differently
 
I assume this is possible in some way, but how would you go about creating a NPC (let's say for simplicity, a noob character) and if you had a particular item, you would see the noob in a new form, like some other kind of person? (Simple outfit change based on meeting a criteria of having an item or flag checked to true) ?

I guess what I'm trying to say is how would this be gone about script wise?

Would it go something like default appearance if you don't have the item and then if you do then the apperance changes or is there a better way to handle this?

cbk1994 06-08-2013 03:25 AM

Just do whatever change you need clientside. Then it only affects the current player.

Simple example:

PHP Code:

// display block.png unless you have clientr.boo set;
// if it _is_ set, then, display bcalarmclock.png instead
//#CLIENTSIDE
function onPlayerEnters() {
  if (
player.clientr.boo) {
    
this.setImg("bcalarmclock.png");
  } else {
    
this.setImg("block.png");
  }


You do the same thing for characters, substituting the various body parts for the setImg. You can change the check to check if, for example, a player has a weapon.

Fulg0reSama 06-08-2013 04:00 AM

Quote:

Originally Posted by cbk1994 (Post 1718934)
Just do whatever change you need clientside. Then it only affects the current player.

Simple example:

PHP Code:

// display block.png unless you have clientr.boo set;
// if it _is_ set, then, display bcalarmclock.png instead
//#CLIENTSIDE
function onPlayerEnters() {
  if (
player.clientr.boo) {
    
this.setImg("bcalarmclock.png");
  } else {
    
this.setImg("block.png");
  }


You do the same thing for characters, substituting the various body parts for the setImg. You can change the check to check if, for example, a player has a weapon.

Interesting, good to know, thank you :D
You've helped me more than you know.


All times are GMT +2. The time now is 03:27 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.