Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Remember Item List Before Ship Reset

 
Post new topic   Reply to topic Printable version
 View previous topic  Merv36 Post :: Post Need some help on the links of bot cod...  View next topic  
Author Message
Light Hazard
Novice


Gender:Gender:Male
Joined: Jun 09 2004
Posts: 63
Location: Bronx, NY
Offline

PostPosted: Tue Jan 03, 2006 7:25 pm    Post subject: Remember Item List Before Ship Reset Reply to topic Reply with quote

Well I am using the great CatID's ctf bot. He was nice enough to show me the source code. As many have noticed, his CTF bot does not support a check on flaggers who warp. I have made a separate plugin to take care of that problem. Now that I have the soure, I added the code from that plugin into the source so it will check right from the CTF plugin.

Now here's my dilemna:
When the flagger drops the flag, whether it's due to a warp or a score, his ship is reset to allow the flag to be dropped. Now the problem lies in the fact that some may want to buy some special items that may cost "creds" in the game.
I wanted to save the item information before *shipreset and then prizing them accordingly if they had that specific item. So far I have failed. I do not understand what I did wrong. So I am attaching the code..

Code: Show/Hide

         if(p->flagCount == 1)
         {
            int brick, decoy, portal, repel, rocket, thor, burst;
            bool stealth, xradar, cloak, shields, supers;

            if (p->flash)
            {
               if(settings->ships[p->ship].CloakStatus == 0)
               {

                  brick = p->brick;
                  decoy = p->decoy;
                  portal = p->portal;
                  repel = p->repel;
                  rocket = p->rocket;
                  stealth = p->stealth ;
                  thor = p->thor ;
                  xradar = p->xradar ;
                  sendPrivate(p, "*shipreset");
                  sendPrivate(p, "*warn Do not warp with the flag!");


                  if (brick)
                  {
                     for (int i = 0; i <= brick; i++)
                     {
                        sendPrivate(p, "*prize #26");
                     }
                  }
                  if (decoy)
                  {
                     for (int i = 0; i <= decoy; i++)
                     {
                        sendPrivate(p, "*prize #23");
                     }
                  }
                  if (portal)
                  {
                     for (int i = 0; i <= portal; i++)
                     {
                        sendPrivate(p, "*prize #28");
                     }
                  }
                  if (repel)
                  {
                     for (int i = 0; i <= repel; i++)
                     {
                        sendPrivate(p, "*prize #21");
                     }
                  }
                  if (rocket)
                  {
                     for (int i = 0; i <= rocket; i++)
                     {
                        sendPrivate(p, "*prize #27");
                     }
                  }
                  if (stealth)
                  {
                     sendPrivate(p, "*prize #4");
                  }
                  if (thor)
                  {
                     for (int i = 0; i <= thor; i++)
                     {
                        sendPrivate(p, "*prize #24");
                     }
                  }
                  if (xradar)
                  {
                     sendPrivate(p, "*prize #6");
                  }
                  String s;
                  s = "*arena ";
                  s += p->name;
                  s += " has dropped the flag!";
                  sendPublic(s);


                  break;
               }
               else
               {
                  Uint16 oldXCoord = get_tag(p, 0);
                  Uint16 oldYCoord = get_tag(p, 1);

                  if (oldXCoord == 0 && oldYCoord == 0)
                  {
                     set_tag(p, 0, p->tile.x);
                     set_tag(p, 1, p->tile.y);
                  }
                  else
                  {
                     Uint16 newXCoord = (Uint16)p->tile.x;
                     Uint16 newYCoord = (Uint16)p->tile.y;
                     
                     Uint32 dist = distance(oldXCoord, oldYCoord, newXCoord, newYCoord);

                     Uint16 oldXCoord = (Uint16)p->tile.x;
                     Uint16 oldYCoord = (Uint16)p->tile.y;

                            if ( dist > 5)
                     {



                        brick = p->brick;
                        decoy = p->decoy;
                        portal = p->portal;
                        repel = p->repel;
                        rocket = p->rocket;
                        stealth = p->stealth ;
                        thor = p->thor ;
                        xradar = p->xradar ;

                        String t;
                        t = "*arena ";
                        t += p->name;
                        t += "<-name ";
                        t += brick;
                        t += "<-brick ";
                        t += portal;
                        t += "<-portal ";
                        t += thor;
                        t += "<-thor ";
                        sendPublic(t);

                        sendPrivate(p, "*shipreset");
                        sendPrivate(p, "*warn Do not warp with the flag!");
                        if (brick)
                        {
                           for (int i = 0; i <= brick; i++)
                           {
                              sendPrivate(p, "*prize #26");

                           }
                        }
                        if (decoy)
                        {
                           for (int i = 0; i <= decoy; i++)
                           {
                              sendPrivate(p, "*prize #23");
                           }
                        }
                        if (portal)
                        {
                           for (int i = 0; i <= portal; i++)
                           {
                              sendPrivate(p, "*prize #28");
                           }
                        }
                        if (repel)
                        {
                           for (int i = 0; i <= repel; i++)
                           {
                              sendPrivate(p, "*prize #21");
                           }
                        }
                        if (rocket)
                        {
                           for (int i = 0; i <= rocket; i++)
                           {
                              sendPrivate(p, "*prize #27");
                           }
                        }
                        if (stealth)
                        {
                           sendPrivate(p, "*prize #4");
                        }
                        if (thor)
                        {
                           for (int i = 0; i <= thor; i++)
                           {
                              sendPrivate(p, "*prize #24");
                           }
                        }
                        if (xradar)
                        {
                           sendPrivate(p, "*prize #6");
                        }

                        String s;
                        s = "*arena ";
                        s += p->name;
                        s += " has dropped the flag!";
                        sendPublic(s);


                        break;
                     }
                  }

_________________
-Owner of Lethal Weapon
-Super Hacker


Last edited by Light Hazard on Tue Jan 03, 2006 11:47 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue Jan 03, 2006 10:50 pm    Post subject: Reply to topic Reply with quote

I made one of these back last march for use with the CTF plugin. The only thing it doesn't work with is TM_Mer prizes because the playerprize event doesn't catch those.

This should work for what you're looking for, maybe at some point I'll formally publish it to the site
http://d1st0rt.sscentral.com/downloads/reprize.zip
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Light Hazard
Novice


Gender:Gender:Male
Joined: Jun 09 2004
Posts: 63
Location: Bronx, NY
Offline

PostPosted: Wed Jan 04, 2006 12:03 am    Post subject: Reply to topic Reply with quote

Thanks for your help d1st0rt but as I was testing your plugin with the custom ctf plugin, it seems to prize me extra prizes that i just dont have, forexample, if i have a decoy, burst, thrust, warp, and thor, it'd prize me a repel as the only thing available..

What I need to do is record all item information of the flagger before the warp, and then prize the flagger the items back after they warped.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Jan 04, 2006 12:48 pm    Post subject: Reply to topic Reply with quote

you might want to try spectating the player, waiting until you get a player position packet, and using that information to reprize them.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Wed Jan 04, 2006 8:12 pm    Post subject: Reply to topic Reply with quote

Oh sorry, I forgot that it only gives greened stuff when you kill a flagger or win a flag game. You can change how many of each item it stores in the ini. The source is there if you want to change it, but bak's idea is probably better.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 463 page(s) served in previous 5 minutes.

phpBB Created this page in 0.470139 seconds : 29 queries executed (92.3%): GZIP compression disabled