DJGameFreakTheIguana
Active member
One script I've not been able to get much done with for years. I asked this for Beast Mode where it was suggest I long into the D&D mod, wise of Warduke, I did but couldn't make anything out and never got back to it. I decided to look back into last night where I ended up finding the entities I needed to find.
As far as I can tell, it's a few scripts working all at once, and the menu itself is actually using an image. As best I can, I'm going to list the scripts at work, and anyone who can take a look at it can see if they know how to change it for what I need, which is just summoning 2 or more NPC's of my choice.
First, I was told of this character, Strongheart, who summons's NPC with "@cmd SHSummon -100 10 1". I found he uses this script:
For a menu, there's this shop I triggered in the game, a guy that sells stuff for bows.
Inside villager.c
Searching for Bowyer with Notepad++, I found it's alias, BowyerD
Bowshop.c
Check next post for the other script, they went over the character limit.
x)
As far as I can tell, it's a few scripts working all at once, and the menu itself is actually using an image. As best I can, I'm going to list the scripts at work, and anyone who can take a look at it can see if they know how to change it for what I need, which is just summoning 2 or more NPC's of my choice.
First, I was told of this character, Strongheart, who summons's NPC with "@cmd SHSummon -100 10 1". I found he uses this script:
Code:
void SHSummon(float fX, float fY, float fZ)
{//Strongheart's special summon NPC script based on selected NPC
//fX: X location adjustment
//fY: Y location adjustment
//fZ: Z location adjustment
void self = getlocalvar("self"); //Get calling entity
int PIndex = getentityproperty(self,"playerindex");
int MagicS = getglobalvar(PIndex+"1");
void vSpawn;
if(MagicS=="Elkhorn"){
summon("Elkhorn", fX, fY, fZ, "Elkhorn");
} else if(MagicS=="Peralay"){
summon("Peralay", fX, fY, fZ, "Peralay");
} else if(MagicS=="Ringlerun"){
summon("Ringlerun", fX+300, fY, fZ, "Ringlerun");
} else if(MagicS=="Char"){
summon("Char", fX, fY, fZ, "Char");
} else if(MagicS=="Sarken"){
summonSarken(fX, fY, fZ);
}
}
For a menu, there's this shop I triggered in the game, a guy that sells stuff for bows.
Code:
name Bowyer
score 0 -1
health 100
speed 0
nomove 1
type enemy
gfxshadow 1
nodrop 1
defense all 0
noatflash 1
nolife 1
animationscript data/scripts/villager.c
anim idle
loop 1
delay 50
offset 32 84
bbox 22 10 25 75
frame data/chars/misc/civilian/merchant/bowyer.png
anim pain
delay 5
offset 32 84
frame data/chars/misc/civilian/merchant/bowyer.png
delay 42
@cmd spawnDial 160 0 206 320
frame data/chars/misc/civilian/merchant/bowyer.png
delay 52
frame data/chars/misc/civilian/merchant/bowyer.png
Inside villager.c
Code:
void spawnDial(float fX, float fY, float fZ, int Edge)
{//Spawns dialogue next to caller
// Spawned dialogue matches entity's alias
//fX: X location adjustment
//fY: Y location adjustment
//fZ: Z location adjustment
//Edge: Screen length (not used)
void self = getlocalvar("self"); //Get calling entity
char Name = getentityproperty(self,"name");
spawn06(Name, fX, fY, fZ); //Spawn dialogue
}
void spawnAlias(char Name, float fX, float fY, float fZ, char Alias)
{//Spawns entity next to caller
//Name: Entity to be spawned
//fX: X location adjustment
//fY: Y location adjustment
//fZ: Z location adjustment
//Alias: It's alias
void Spawn;
Spawn = spawn01(Name, fX, fY, fZ); // Spawn
changeentityproperty(Spawn, "name", Alias); // Change alias
}
Searching for Bowyer with Notepad++, I found it's alias, BowyerD
Code:
name BowyerD
type none
facing 1
palette none
setlayer 10000
animationscript data/scripts/shop/shopS.c
script data/scripts/shop/bowshop.c
anim idle
delay 6
offset 160 206
@cmd DeControl 0 1
@cmd DeControl 1 1
@cmd noplayerJoin 1
frame data/chars/dialogues/1.png
frame data/chars/dialogues/2.png
frame data/chars/dialogues/3.png
delay 200
frame data/chars/dialogues/shop/bowyer1.png
frame data/chars/dialogues/shop/bowyer2.png
delay 4
frame data/chars/dialogues/4.png
frame data/chars/dialogues/5.png
frame data/chars/dialogues/6.png
frame data/chars/dialogues/7.png
frame data/chars/dialogues/8.png
frame data/chars/dialogues/9.png
@cmd spawnHand "Hand1" 0 120 80 200 320 0
@cmd spawnHand "Hand2" 1 200 80 200 320 1
frame data/chars/dialogues/shop/bowyer3.png
delay 20000
frame data/chars/dialogues/shop/bowyer3.png
delay 4
@cmd killHand 0
@cmd killHand 1
frame data/chars/dialogues/9.png
frame data/chars/dialogues/8.png
frame data/chars/dialogues/7.png
frame data/chars/dialogues/6.png
frame data/chars/dialogues/5.png
frame data/chars/dialogues/4.png
delay 100
frame data/chars/dialogues/shop/bowyer4.png
delay 6
frame data/chars/dialogues/3.png
frame data/chars/dialogues/2.png
frame data/chars/dialogues/1.png
delay 16
@cmd DeControl 0 0
@cmd DeControl 1 0
@cmd noplayerJoin 0
@cmd suicide
frame data/chars/misc/empty.gif
Bowshop.c
Code:
void main()
{// Update script for displaying hand in bowyer & handles what hand shows
void vSelf = getlocalvar("self"); //Get player
void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame
int XPos = openborvariant("xpos");
void Hand1 = getentityvar(vSelf, 0);
void Hand2 = getentityvar(vSelf, 1);
void iJump1 = playerkeys(0, 1, "jump");
void iJump2 = playerkeys(1, 1, "jump");
int x1;
int y1;
int x2;
int y2;
if(Hand1){
x1 = getentityproperty(Hand1,"x"); //Get Hand1's x coordinate
y1 = getentityproperty(Hand1,"a"); //Get Hand1's y coordinate
// drawstring(150,110,1,x1-XPos);
// drawstring(150,150,1,y1);
if(vAniPos==12){
if(x1 >= XPos + 55 && x1 <= XPos + 170 && y1 >= 110 && y1 <= 125){
setentityvar(Hand1, 0, "Crossbow");
setentityvar(Hand1, 1, 5000);
setentityvar(Hand1, 2, "Magic");
setentityvar(Hand1, 3, NULL());
// drawstring(150,140,1,"Crossbow");
} else if(x1 >= XPos + 55 && x1 <= XPos + 150 && y1 >= 85 && y1 <= 100){
setentityvar(Hand1, 0, "1");
setentityvar(Hand1, 1, 100);
setentityvar(Hand1, 2, "Bolt");
setentityvar(Hand1, 3, NULL());
// drawstring(150,140,1,"Bolt");
} else if(x1 >= XPos + 55 && x1 <= XPos + 165 && y1 >= 60 && y1 <= 75){
setentityvar(Hand1, 0, "2");
setentityvar(Hand1, 1, 200);
setentityvar(Hand1, 2, "Bolt");
setentityvar(Hand1, 3, NULL());
// drawstring(150,140,1,"Fire_Bolt");
} else if(x1 >= XPos + 55 && x1 <= XPos + 180 && y1 >= 35 && y1 <= 50){
setentityvar(Hand1, 0, "3Arrow");
setentityvar(Hand1, 1, 5000);
setentityvar(Hand1, 2, "Magic");
setentityvar(Hand1, 3, NULL());
// drawstring(150,140,1,"Triple_Arrows");
} else if(x1 >= XPos + 145 && x1 <= XPos + 175 && y1 >= 15 && y1 <= 25){
setentityvar(Hand1, 0, NULL());
setentityvar(Hand1, 1, NULL());
setentityvar(Hand1, 2, "Menu");
setentityvar(Hand1, 3, 13);
// drawstring(150,140,1,"EXIT");
} else {
setentityvar(Hand1, 0, NULL());
setentityvar(Hand1, 1, NULL());
setentityvar(Hand1, 2, NULL());
setentityvar(Hand1, 3, NULL());
}
if(iJump1){
updateframe(vSelf, 13);
}
}
}
if(Hand2){
x2 = getentityproperty(Hand2,"x"); //Get Hand2's x coordinate
y2 = getentityproperty(Hand2,"a"); //Get Hand2's y coordinate
if(vAniPos==12){
if(x2 >= XPos + 55 && x2 <= XPos + 170 && y2 >= 110 && y2 <= 125){
setentityvar(Hand2, 0, "Crossbow");
setentityvar(Hand2, 1, 5000);
setentityvar(Hand2, 2, "Magic");
setentityvar(Hand2, 3, NULL());
} else if(x2 >= XPos + 55 && x2 <= XPos + 150 && y2 >= 85 && y2 <= 100){
setentityvar(Hand2, 0, "1");
setentityvar(Hand2, 1, 100);
setentityvar(Hand2, 2, "Bolt");
setentityvar(Hand2, 3, NULL());
} else if(x2 >= XPos + 55 && x2 <= XPos + 165 && y2 >= 60 && y2 <= 75){
setentityvar(Hand2, 0, "2");
setentityvar(Hand2, 1, 200);
setentityvar(Hand2, 2, "Bolt");
setentityvar(Hand2, 3, NULL());
} else if(x2 >= XPos + 55 && x2 <= XPos + 180 && y2 >= 35 && y2 <= 50){
setentityvar(Hand2, 0, "3Arrow");
setentityvar(Hand2, 1, 5000);
setentityvar(Hand2, 2, "Magic");
setentityvar(Hand2, 3, NULL());
} else if(x2 >= XPos + 145 && x2 <= XPos + 175 && y2 >= 15 && y2 <= 25){
setentityvar(Hand2, 0, NULL());
setentityvar(Hand2, 1, NULL());
setentityvar(Hand2, 2, "Menu");
setentityvar(Hand2, 3, 13);
} else {
setentityvar(Hand2, 0, NULL());
setentityvar(Hand2, 1, NULL());
setentityvar(Hand2, 2, NULL());
setentityvar(Hand2, 3, NULL());
}
if(iJump2){
updateframe(vSelf, 13);
}
}
}
}
Check next post for the other script, they went over the character limit.
x)