Jump to content
  • 0

Making this script more than one (like duplicate)


Seiro

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  42
  • Reputation:   0
  • Joined:  10/24/12
  • Last Seen:  

This script is from AnnieRuru

prontera,155,177,5	script	kjdhfksdjf	100,2,2,{
if ( .summon_timetick + 10 > gettimetick(2) // 10 seconds delay to summon again
	|| mobcount( "this", strnpcinfo(0)+"::Onaa" ) ) end;
monster "this", -1,-1, "--ja--", 1952,1, strnpcinfo(0)+"::Onaa";
.summon_timetick = gettimetick(2);
sleep 5000; // 5 seconds auto-kill this mob
killmonster .map$, strnpcinfo(0) +"::Onaa";
end;
OnInit:
getmapxy .map$, .@x, .@y, 1; // wtf ... killmonster script command doesn't allow "this" variable
Onaa: // prevent server spam error
end;
}

Can anyone edit this for me?

This script is working but when I tried to make another one of this, it doesn't spawn a monster

How this script works:

- It spawns a monster when you step on a cell area

- It doesn't summon another monster when you step on the cell again.

- It has delay before you can spawn a monster again.

What I need:

- To make a multiple script of this (more than one), which spawns different monster each.

- To make the spawn point into a certain coordinate. (not around the NPC)

Ex.

This script is placed at [prontera,155,177]. But monster spawns at [prontera,152,165]

This is the script I tried :P

StepCellMonster.txt

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10014
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try setup like this for duplicate npc..

http://pastebin.com/raw.php?i=mjbNHJ7d

it work fine when i test in my server...

and the reason for you to unable summon it...i think it's because you set the delay too long

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  42
  • Reputation:   0
  • Joined:  10/24/12
  • Last Seen:  

you can try setup like this for duplicate npc..

http://pastebin.com/raw.php?i=mjbNHJ7d

it work fine when i test in my server...

and the reason for you to unable summon it...i think it's because you set the delay too long

Oh I mean, I wanted to use different monsters to spawn each spot, that's why I don't wanna use the duplicate. :x

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10014
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

try this

http://pastebin.com/raw.php?i=AmNQY4up

mapname,coordinate duplicate(AutoSummon) AutoSummon#<mob id> -1,3,3,{

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

What I need:

- To make a multiple script of this (more than one), which spawns different monster each.

- To make the spawn point into a certain coordinate. (not around the NPC)

Ex.

This script is placed at [prontera,155,177]. But monster spawns at [prontera,152,165]

emistry's technique can be use if there's only 1 condition

but there's 2 conditions here, so have to use array, but still using npc hidden name as index

-    script    AutoSummon    -1,{
   end;

OnTouch:
   .@n = atoi( strnpcinfo(2) );
   if ( .summon_timetick[.@n] + .spawn_delay > gettimetick(2) || mobcount( "this", strnpcinfo(0)+"::Onaa" ) ) end;
   monster "this", .mob_spawn[ .@n *2 ], .mob_spawn[ .@n *2 +1 ], "--ja--", .mob_id[.@n], 1, strnpcinfo(0)+"::Onaa";
   .summon_timetick[.@n] = gettimetick(2);
   sleep 60000; // 60 seconds auto-kill this mob
   killmonster strnpcinfo(4), strnpcinfo(0) +"::Onaa";
   end;

OnInit:
   if ( !getstrlen( strnpcinfo(2) ) ) end; // OnInit with duplicate npc will load multiple times
   .spawn_delay = 120; // a delay of 120 seconds
   setarray .mob_id, 1952, 1953, 1954;
   setarray .mob_spawn,
       293,200,
       155,181,
       155,183;

Onaa: // prevent server spam error
   end;
}

1@cash,293,200,4    duplicate(AutoSummon)    AutoSummon#0    100,3,3
prontera,155,181,4    duplicate(AutoSummon)    AutoSummon#1    100,3,3
prontera,155,183,4    duplicate(AutoSummon)    AutoSummon#2    100,3,3

a few things need to know about this duplicate with npc variable

1.

npc variable is actually share between all duplicate npcs

my mission board script uses atoi( strnpcinfo(2) ) to differentiated all npc in different ID

2.

if you have 5 duplicated npc, OnInit label will execute 5 times

so just need to load it once ...

3.

since npc variable is share, and if want to make them unique to each one

need to index them with array or getd command to make them do different stuffs

.summon_timetick[.@n] <-- if not doing this, the variable will be overwritten by someone else trigger other duplicated npc

and btw ... nice find of getting opening bracket is ignored by server when using duplicates =/

didn't know server will not read it ( I thought server spam error for it, but it actually works )

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  42
  • Reputation:   0
  • Joined:  10/24/12
  • Last Seen:  

It's working now! ^_^ one more thing though, How can I make each monster be spawned in different sizes? Like, Large (@monsterbig), and small (@monstersmall)?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

*monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>};
set another array, with settings 0,1,2

think this is just a minor edit

--> this is support section btw

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  42
  • Reputation:   0
  • Joined:  10/24/12
  • Last Seen:  

--> this is support section btw

I need support on monster sizes script! :P :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,156,180,5	script	kjdhfksjf	100,{
monster "this", -1,-1, "--ja--", 1002, 1, "", 0;
monster "this", -1,-1, "--ja--", 1002, 1, "", 1;
monster "this", -1,-1, "--ja--", 1002, 1, "", 2;
}

:ani_swt3:

I think we have complicated the solution with advance scripting technique, here is the solution that you can understand better

prontera,155,181,4	script	AutoSummon#1	-1,3,3,{
end;
OnTouch:
if ( .summon_timetick + .spawn_delay > gettimetick(2) || mobcount( "this", strnpcinfo(0)+"::Onaa" ) ) end;
monster "this", 155, 181, "--ja--", 1953, 1, strnpcinfo(0)+"::Onaa", 1; // small size mob
.summon_timetick = gettimetick(2);
sleep 60000; // 60 seconds auto-kill this mob
killmonster strnpcinfo(4), strnpcinfo(0) +"::Onaa";
end;
OnInit:
.spawn_delay = 120; // a delay of 120 seconds
Onaa: // prevent server spam error
end;
}

Edited by AnnieRuru
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
Answer this question...

×   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...